@customafk/lunas-ui 0.0.21 → 0.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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-BEwm_iVK.d.cts +25 -0
- package/dist/button-BSGNpclh.cjs +2 -0
- package/dist/button-BSGNpclh.cjs.map +1 -0
- package/dist/{button-CFhTSUSV.d.ts → button-CSKaUiLi.d.ts} +7 -5
- package/dist/button-CnMfXTBU.js +2 -0
- package/dist/button-CnMfXTBU.js.map +1 -0
- 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-CoB5R5FI.cjs +2 -0
- package/dist/command-CoB5R5FI.cjs.map +1 -0
- package/dist/{command-DK3Z1Vcb.d.ts → command-DCgWctIo.d.cts} +12 -13
- package/dist/{command-ChE1SC-Q.d.cts → command-DQMBhKsg.d.ts} +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-B1TYYUwQ.d.cts} +12 -13
- package/dist/{dialog-BfAIULbh.d.ts → dialog-BFjbRwaD.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/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 +29 -29
- package/dist/dialogs/detail-dialog/component/sidebar.d.ts +29 -29
- 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.cts +2 -2
- 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.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.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.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-B0fJo2WZ.d.cts → input-B-Gq-nr8.d.cts} +4 -4
- package/dist/{input-CsU6VSlk.d.ts → input-EM59LdpP.d.ts} +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-BnnbFnrB.d.ts} +3 -4
- package/dist/separator-Cigaqna1.cjs +2 -0
- package/dist/separator-Cigaqna1.cjs.map +1 -0
- package/dist/separator-aLdI4FQe.js +2 -0
- package/dist/separator-aLdI4FQe.js.map +1 -0
- package/dist/{separator-5OitSlUj.d.cts → separator-mZ8r56s2.d.cts} +3 -4
- 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.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-B-LtBkTS.d.ts} +4 -4
- package/dist/{toggle-B9onDBto.d.cts → toggle-BLlf4Xgl.d.cts} +3 -3
- 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/tooltip-B8KdfOeT.js +2 -0
- package/dist/tooltip-B8KdfOeT.js.map +1 -0
- package/dist/{tooltip-Ju-oCFdl.d.ts → tooltip-CbtJCe-c.d.ts} +6 -6
- package/dist/tooltip-DLnAwybV.cjs +2 -0
- package/dist/tooltip-DLnAwybV.cjs.map +1 -0
- package/dist/{tooltip-Ccg2G_fB.d.cts → tooltip-etVeWcFC.d.cts} +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.d.ts +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 +12 -12
- 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 +4 -4
- package/dist/ui/alert.d.ts +4 -4
- 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 +3 -3
- 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 +7 -7
- 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 +9 -9
- package/dist/ui/navigation-menu.d.ts +9 -9
- 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.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 +41 -41
- package/dist/ui/sidebar.d.ts +41 -41
- 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 +0 -1
- 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-CqGv362j.d.cts +0 -23
- 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,155 +1,141 @@
|
|
|
1
|
-
|
|
2
|
-
import React from
|
|
3
|
-
import { Command as CommandPrimitive, useCommandState } from
|
|
4
|
-
import { PlusIcon, X } from
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
CommandItem,
|
|
10
|
-
CommandList,
|
|
11
|
-
CommandSeparator,
|
|
12
|
-
} from "@/components/ui/command";
|
|
13
|
-
import { cn } from "@/lib/utils";
|
|
14
|
-
|
|
15
|
-
import { Button } from "./button";
|
|
1
|
+
'use client'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import { Command as CommandPrimitive, useCommandState } from 'cmdk'
|
|
4
|
+
import { PlusIcon, X } from 'lucide-react'
|
|
5
|
+
|
|
6
|
+
import { Command, CommandGroup, CommandItem, CommandList, CommandSeparator } from '@/components/ui/command'
|
|
7
|
+
import { Button } from '@/components/ui/button'
|
|
8
|
+
import { cn } from '@/lib/utils'
|
|
16
9
|
|
|
17
10
|
export interface Option {
|
|
18
|
-
value: string
|
|
19
|
-
label: string
|
|
20
|
-
disable?: boolean
|
|
11
|
+
value: string
|
|
12
|
+
label: string
|
|
13
|
+
disable?: boolean
|
|
21
14
|
/** fixed option that can‘t be removed. */
|
|
22
|
-
fixed?: boolean
|
|
15
|
+
fixed?: boolean
|
|
23
16
|
/** Group the options by providing key. */
|
|
24
|
-
[key: string]: string | boolean | undefined
|
|
17
|
+
[key: string]: string | boolean | undefined
|
|
25
18
|
}
|
|
26
19
|
interface GroupOption {
|
|
27
|
-
[key: string]: Option[]
|
|
20
|
+
[key: string]: Option[]
|
|
28
21
|
}
|
|
29
22
|
|
|
30
23
|
interface MultipleSelectorProps {
|
|
31
|
-
value?: Option[]
|
|
32
|
-
defaultOptions?: Option[]
|
|
24
|
+
value?: Option[]
|
|
25
|
+
defaultOptions?: Option[]
|
|
33
26
|
/** manually controlled options */
|
|
34
|
-
options?: Option[]
|
|
35
|
-
placeholder?: string
|
|
27
|
+
options?: Option[]
|
|
28
|
+
placeholder?: string
|
|
36
29
|
/** Loading component. */
|
|
37
|
-
loadingIndicator?: React.ReactNode
|
|
30
|
+
loadingIndicator?: React.ReactNode
|
|
38
31
|
/** Empty component. */
|
|
39
|
-
emptyIndicator?: React.ReactNode
|
|
32
|
+
emptyIndicator?: React.ReactNode
|
|
40
33
|
/** Debounce time for async search. Only work with `onSearch`. */
|
|
41
|
-
delay?: number
|
|
34
|
+
delay?: number
|
|
42
35
|
/**
|
|
43
36
|
* Only work with `onSearch` prop. Trigger search when `onFocus`.
|
|
44
37
|
* For example, when user click on the input, it will trigger the search to get initial options.
|
|
45
38
|
**/
|
|
46
|
-
triggerSearchOnFocus?: boolean
|
|
39
|
+
triggerSearchOnFocus?: boolean
|
|
47
40
|
/** async search */
|
|
48
|
-
onSearch?: (value: string) => Promise<Option[]
|
|
41
|
+
onSearch?: (value: string) => Promise<Option[]>
|
|
49
42
|
/**
|
|
50
43
|
* sync search. This search will not showing loadingIndicator.
|
|
51
44
|
* The rest props are the same as async search.
|
|
52
45
|
* i.e.: creatable, groupBy, delay.
|
|
53
46
|
**/
|
|
54
|
-
onSearchSync?: (value: string) => Option[]
|
|
55
|
-
onChange?: (options: Option[]) => void
|
|
47
|
+
onSearchSync?: (value: string) => Option[]
|
|
48
|
+
onChange?: (options: Option[]) => void
|
|
56
49
|
/** Limit the maximum number of selected options. */
|
|
57
|
-
maxSelected?: number
|
|
50
|
+
maxSelected?: number
|
|
58
51
|
/** When the number of selected options exceeds the limit, the onMaxSelected will be called. */
|
|
59
|
-
onMaxSelected?: (maxLimit: number) => void
|
|
52
|
+
onMaxSelected?: (maxLimit: number) => void
|
|
60
53
|
/** Hide the placeholder when there are options selected. */
|
|
61
|
-
hidePlaceholderWhenSelected?: boolean
|
|
62
|
-
disabled?: boolean
|
|
54
|
+
hidePlaceholderWhenSelected?: boolean
|
|
55
|
+
disabled?: boolean
|
|
63
56
|
/** Group the options base on provided key. */
|
|
64
|
-
groupBy?: string
|
|
65
|
-
className?: string
|
|
66
|
-
badgeClassName?: string
|
|
57
|
+
groupBy?: string
|
|
58
|
+
className?: string
|
|
59
|
+
badgeClassName?: string
|
|
67
60
|
/**
|
|
68
61
|
* First item selected is a default behavior by cmdk. That is why the default is true.
|
|
69
62
|
* This is a workaround solution by add a dummy item.
|
|
70
63
|
*
|
|
71
64
|
* @reference: https://github.com/pacocoursey/cmdk/issues/171
|
|
72
65
|
*/
|
|
73
|
-
selectFirstItem?: boolean
|
|
66
|
+
selectFirstItem?: boolean
|
|
74
67
|
/** Allow user to create option when there is no option matched. */
|
|
75
|
-
creatable?: boolean
|
|
68
|
+
creatable?: boolean
|
|
76
69
|
/** Props of `Command` */
|
|
77
|
-
commandProps?: React.ComponentPropsWithoutRef<typeof Command
|
|
70
|
+
commandProps?: React.ComponentPropsWithoutRef<typeof Command>
|
|
78
71
|
/** Props of `CommandInput` */
|
|
79
|
-
inputProps?: Omit<
|
|
80
|
-
React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>,
|
|
81
|
-
"value" | "placeholder" | "disabled"
|
|
82
|
-
>;
|
|
72
|
+
inputProps?: Omit<React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>, 'value' | 'placeholder' | 'disabled'>
|
|
83
73
|
/** hide the clear all button. */
|
|
84
|
-
hideClearAllButton?: boolean
|
|
74
|
+
hideClearAllButton?: boolean
|
|
85
75
|
|
|
86
76
|
/** Add new item event for select with search */
|
|
87
|
-
onAddNewItem?: () => void
|
|
77
|
+
onAddNewItem?: () => void
|
|
88
78
|
}
|
|
89
79
|
|
|
90
80
|
export interface MultipleSelectorRef {
|
|
91
|
-
selectedValue: Option[]
|
|
92
|
-
input: HTMLInputElement
|
|
93
|
-
focus: () => void
|
|
94
|
-
reset: () => void
|
|
81
|
+
selectedValue: Option[]
|
|
82
|
+
input: HTMLInputElement
|
|
83
|
+
focus: () => void
|
|
84
|
+
reset: () => void
|
|
95
85
|
}
|
|
96
86
|
|
|
97
87
|
// eslint-disable-next-line react-refresh/only-export-components
|
|
98
88
|
export function useDebounce<T>(value: T, delay?: number): T {
|
|
99
|
-
const [debouncedValue, setDebouncedValue] = React.useState<T>(value)
|
|
89
|
+
const [debouncedValue, setDebouncedValue] = React.useState<T>(value)
|
|
100
90
|
|
|
101
91
|
React.useEffect(() => {
|
|
102
|
-
const timer = setTimeout(() => setDebouncedValue(value), delay || 500)
|
|
92
|
+
const timer = setTimeout(() => setDebouncedValue(value), delay || 500)
|
|
103
93
|
|
|
104
94
|
return () => {
|
|
105
|
-
clearTimeout(timer)
|
|
106
|
-
}
|
|
107
|
-
}, [value, delay])
|
|
95
|
+
clearTimeout(timer)
|
|
96
|
+
}
|
|
97
|
+
}, [value, delay])
|
|
108
98
|
|
|
109
|
-
return debouncedValue
|
|
99
|
+
return debouncedValue
|
|
110
100
|
}
|
|
111
101
|
|
|
112
102
|
function transToGroupOption(options: Option[], groupBy?: string) {
|
|
113
103
|
if (options.length === 0) {
|
|
114
|
-
return {}
|
|
104
|
+
return {}
|
|
115
105
|
}
|
|
116
106
|
if (!groupBy) {
|
|
117
107
|
return {
|
|
118
|
-
|
|
119
|
-
}
|
|
108
|
+
'': options,
|
|
109
|
+
}
|
|
120
110
|
}
|
|
121
111
|
|
|
122
|
-
const groupOption: GroupOption = {}
|
|
112
|
+
const groupOption: GroupOption = {}
|
|
123
113
|
options.forEach((option) => {
|
|
124
|
-
const key = (option[groupBy] as string) ||
|
|
114
|
+
const key = (option[groupBy] as string) || ''
|
|
125
115
|
if (!groupOption[key]) {
|
|
126
|
-
groupOption[key] = []
|
|
116
|
+
groupOption[key] = []
|
|
127
117
|
}
|
|
128
|
-
groupOption[key].push(option)
|
|
129
|
-
})
|
|
130
|
-
return groupOption
|
|
118
|
+
groupOption[key].push(option)
|
|
119
|
+
})
|
|
120
|
+
return groupOption
|
|
131
121
|
}
|
|
132
122
|
|
|
133
123
|
function removePickedOption(groupOption: GroupOption, picked: Option[]) {
|
|
134
|
-
const cloneOption = JSON.parse(JSON.stringify(groupOption)) as GroupOption
|
|
124
|
+
const cloneOption = JSON.parse(JSON.stringify(groupOption)) as GroupOption
|
|
135
125
|
|
|
136
126
|
for (const [key, value] of Object.entries(cloneOption)) {
|
|
137
|
-
cloneOption[key] = value.filter(
|
|
138
|
-
(val) => !picked.find((p) => p.value === val.value),
|
|
139
|
-
);
|
|
127
|
+
cloneOption[key] = value.filter((val) => !picked.find((p) => p.value === val.value))
|
|
140
128
|
}
|
|
141
|
-
return cloneOption
|
|
129
|
+
return cloneOption
|
|
142
130
|
}
|
|
143
131
|
|
|
144
132
|
function isOptionsExist(groupOption: GroupOption, targetOption: Option[]) {
|
|
145
133
|
for (const [, value] of Object.entries(groupOption)) {
|
|
146
|
-
if (
|
|
147
|
-
|
|
148
|
-
) {
|
|
149
|
-
return true;
|
|
134
|
+
if (value.some((option) => targetOption.find((p) => p.value === option.value))) {
|
|
135
|
+
return true
|
|
150
136
|
}
|
|
151
137
|
}
|
|
152
|
-
return false
|
|
138
|
+
return false
|
|
153
139
|
}
|
|
154
140
|
|
|
155
141
|
/**
|
|
@@ -158,31 +144,17 @@ function isOptionsExist(groupOption: GroupOption, targetOption: Option[]) {
|
|
|
158
144
|
*
|
|
159
145
|
* @reference: https://github.com/hsuanyi-chou/shadcn-ui-expansions/issues/34#issuecomment-1949561607
|
|
160
146
|
**/
|
|
161
|
-
const CommandEmpty = React.forwardRef<
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
className={cn("px-2 py-4 text-center text-sm", className)}
|
|
173
|
-
cmdk-empty=""
|
|
174
|
-
role="presentation"
|
|
175
|
-
{...props}
|
|
176
|
-
/>
|
|
177
|
-
);
|
|
178
|
-
});
|
|
179
|
-
|
|
180
|
-
CommandEmpty.displayName = "CommandEmpty";
|
|
181
|
-
|
|
182
|
-
const MultipleSelector = React.forwardRef<
|
|
183
|
-
MultipleSelectorRef,
|
|
184
|
-
MultipleSelectorProps
|
|
185
|
-
>(
|
|
147
|
+
const CommandEmpty = React.forwardRef<HTMLDivElement, React.ComponentProps<typeof CommandPrimitive.Empty>>(({ className, ...props }, forwardedRef) => {
|
|
148
|
+
const render = useCommandState((state) => state.filtered.count === 0)
|
|
149
|
+
|
|
150
|
+
if (!render) return null
|
|
151
|
+
|
|
152
|
+
return <div ref={forwardedRef} className={cn('px-2 py-4 text-center text-sm', className)} cmdk-empty="" role="presentation" {...props} />
|
|
153
|
+
})
|
|
154
|
+
|
|
155
|
+
CommandEmpty.displayName = 'CommandEmpty'
|
|
156
|
+
|
|
157
|
+
export const MultipleSelector = React.forwardRef<MultipleSelectorRef, MultipleSelectorProps>(
|
|
186
158
|
(
|
|
187
159
|
{
|
|
188
160
|
value,
|
|
@@ -212,20 +184,18 @@ const MultipleSelector = React.forwardRef<
|
|
|
212
184
|
}: MultipleSelectorProps,
|
|
213
185
|
ref: React.Ref<MultipleSelectorRef>,
|
|
214
186
|
) => {
|
|
215
|
-
const inputRef = React.useRef<HTMLInputElement>(null)
|
|
216
|
-
const dropdownRef = React.useRef<HTMLDivElement>(null)
|
|
187
|
+
const inputRef = React.useRef<HTMLInputElement>(null)
|
|
188
|
+
const dropdownRef = React.useRef<HTMLDivElement>(null) // Added this
|
|
217
189
|
|
|
218
|
-
const [open, setOpen] = React.useState(false)
|
|
219
|
-
const [onScrollbar, setOnScrollbar] = React.useState(false)
|
|
220
|
-
const [isLoading, setIsLoading] = React.useState(false)
|
|
190
|
+
const [open, setOpen] = React.useState(false)
|
|
191
|
+
const [onScrollbar, setOnScrollbar] = React.useState(false)
|
|
192
|
+
const [isLoading, setIsLoading] = React.useState(false)
|
|
221
193
|
|
|
222
|
-
const [selected, setSelected] = React.useState<Option[]>(value || [])
|
|
223
|
-
const [options, setOptions] = React.useState<GroupOption>(
|
|
224
|
-
|
|
225
|
-
);
|
|
226
|
-
const [inputValue, setInputValue] = React.useState("");
|
|
194
|
+
const [selected, setSelected] = React.useState<Option[]>(value || [])
|
|
195
|
+
const [options, setOptions] = React.useState<GroupOption>(transToGroupOption(arrayDefaultOptions, groupBy))
|
|
196
|
+
const [inputValue, setInputValue] = React.useState('')
|
|
227
197
|
|
|
228
|
-
const debouncedSearchTerm = useDebounce(inputValue, delay || 500)
|
|
198
|
+
const debouncedSearchTerm = useDebounce(inputValue, delay || 500)
|
|
229
199
|
|
|
230
200
|
React.useImperativeHandle(
|
|
231
201
|
ref,
|
|
@@ -236,145 +206,134 @@ const MultipleSelector = React.forwardRef<
|
|
|
236
206
|
reset: () => setSelected([]),
|
|
237
207
|
}),
|
|
238
208
|
[selected],
|
|
239
|
-
)
|
|
240
|
-
|
|
241
|
-
const handleClickOutside = React.useCallback(
|
|
242
|
-
(event
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
!inputRef.current.contains(event.target as Node)
|
|
248
|
-
) {
|
|
249
|
-
setOpen(false);
|
|
250
|
-
inputRef.current.blur();
|
|
251
|
-
}
|
|
252
|
-
},
|
|
253
|
-
[],
|
|
254
|
-
);
|
|
209
|
+
)
|
|
210
|
+
|
|
211
|
+
const handleClickOutside = React.useCallback((event: MouseEvent | TouchEvent) => {
|
|
212
|
+
if (dropdownRef.current && !dropdownRef.current.contains(event.target as Node) && inputRef.current && !inputRef.current.contains(event.target as Node)) {
|
|
213
|
+
setOpen(false)
|
|
214
|
+
inputRef.current.blur()
|
|
215
|
+
}
|
|
216
|
+
}, [])
|
|
255
217
|
|
|
256
218
|
const handleUnselect = React.useCallback(
|
|
257
219
|
(option: Option) => {
|
|
258
|
-
const newOptions = selected.filter((s) => s.value !== option.value)
|
|
259
|
-
setSelected(newOptions)
|
|
260
|
-
onChange?.(newOptions)
|
|
220
|
+
const newOptions = selected.filter((s) => s.value !== option.value)
|
|
221
|
+
setSelected(newOptions)
|
|
222
|
+
onChange?.(newOptions)
|
|
261
223
|
},
|
|
262
224
|
[onChange, selected],
|
|
263
|
-
)
|
|
225
|
+
)
|
|
264
226
|
|
|
265
227
|
const handleKeyDown = React.useCallback(
|
|
266
228
|
(e: React.KeyboardEvent<HTMLDivElement>) => {
|
|
267
|
-
const input = inputRef.current
|
|
268
|
-
if (!input) return
|
|
229
|
+
const input = inputRef.current
|
|
230
|
+
if (!input) return
|
|
269
231
|
|
|
270
|
-
if (e.key ===
|
|
271
|
-
if (input.value ===
|
|
272
|
-
const lastSelectOption = selected[selected.length - 1]
|
|
232
|
+
if (e.key === 'Delete' || e.key === 'Backspace') {
|
|
233
|
+
if (input.value === '' && selected.length > 0) {
|
|
234
|
+
const lastSelectOption = selected[selected.length - 1]
|
|
273
235
|
// If last item is fixed, we should not remove it.
|
|
274
236
|
if (!lastSelectOption.fixed) {
|
|
275
|
-
handleUnselect(selected[selected.length - 1])
|
|
237
|
+
handleUnselect(selected[selected.length - 1])
|
|
276
238
|
}
|
|
277
239
|
}
|
|
278
240
|
}
|
|
279
241
|
|
|
280
242
|
// This is not a default behavior of the <input /> field
|
|
281
|
-
if (e.key ===
|
|
282
|
-
input.blur()
|
|
243
|
+
if (e.key === 'Escape') {
|
|
244
|
+
input.blur()
|
|
283
245
|
}
|
|
284
246
|
},
|
|
285
247
|
[handleUnselect, selected],
|
|
286
|
-
)
|
|
248
|
+
)
|
|
287
249
|
|
|
288
250
|
React.useEffect(() => {
|
|
289
251
|
if (open) {
|
|
290
|
-
document.addEventListener(
|
|
291
|
-
document.addEventListener(
|
|
252
|
+
document.addEventListener('mousedown', handleClickOutside)
|
|
253
|
+
document.addEventListener('touchend', handleClickOutside)
|
|
292
254
|
} else {
|
|
293
|
-
document.removeEventListener(
|
|
294
|
-
document.removeEventListener(
|
|
255
|
+
document.removeEventListener('mousedown', handleClickOutside)
|
|
256
|
+
document.removeEventListener('touchend', handleClickOutside)
|
|
295
257
|
}
|
|
296
258
|
|
|
297
259
|
return () => {
|
|
298
|
-
document.removeEventListener(
|
|
299
|
-
document.removeEventListener(
|
|
300
|
-
}
|
|
260
|
+
document.removeEventListener('mousedown', handleClickOutside)
|
|
261
|
+
document.removeEventListener('touchend', handleClickOutside)
|
|
262
|
+
}
|
|
301
263
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
302
|
-
}, [open])
|
|
264
|
+
}, [open])
|
|
303
265
|
|
|
304
266
|
React.useEffect(() => {
|
|
305
267
|
if (value) {
|
|
306
|
-
setSelected(value)
|
|
268
|
+
setSelected(value)
|
|
307
269
|
}
|
|
308
|
-
}, [value])
|
|
270
|
+
}, [value])
|
|
309
271
|
|
|
310
272
|
React.useEffect(() => {
|
|
311
273
|
/** If `onSearch` is provided, do not trigger options updated. */
|
|
312
274
|
if (!arrayOptions || onSearch) {
|
|
313
|
-
return
|
|
275
|
+
return
|
|
314
276
|
}
|
|
315
|
-
const newOption = transToGroupOption(arrayOptions || [], groupBy)
|
|
277
|
+
const newOption = transToGroupOption(arrayOptions || [], groupBy)
|
|
316
278
|
if (JSON.stringify(newOption) !== JSON.stringify(options)) {
|
|
317
|
-
setOptions(newOption)
|
|
279
|
+
setOptions(newOption)
|
|
318
280
|
}
|
|
319
|
-
}, [arrayDefaultOptions, arrayOptions, groupBy, onSearch, options])
|
|
281
|
+
}, [arrayDefaultOptions, arrayOptions, groupBy, onSearch, options])
|
|
320
282
|
|
|
321
283
|
React.useEffect(() => {
|
|
322
284
|
/** sync search */
|
|
323
285
|
|
|
324
286
|
const doSearchSync = () => {
|
|
325
|
-
const res = onSearchSync?.(debouncedSearchTerm)
|
|
326
|
-
setOptions(transToGroupOption(res || [], groupBy))
|
|
327
|
-
}
|
|
287
|
+
const res = onSearchSync?.(debouncedSearchTerm)
|
|
288
|
+
setOptions(transToGroupOption(res || [], groupBy))
|
|
289
|
+
}
|
|
328
290
|
|
|
329
291
|
const exec = async () => {
|
|
330
|
-
if (!onSearchSync || !open) return
|
|
292
|
+
if (!onSearchSync || !open) return
|
|
331
293
|
|
|
332
294
|
if (triggerSearchOnFocus) {
|
|
333
|
-
doSearchSync()
|
|
295
|
+
doSearchSync()
|
|
334
296
|
}
|
|
335
297
|
|
|
336
298
|
if (debouncedSearchTerm) {
|
|
337
|
-
doSearchSync()
|
|
299
|
+
doSearchSync()
|
|
338
300
|
}
|
|
339
|
-
}
|
|
301
|
+
}
|
|
340
302
|
|
|
341
|
-
void exec()
|
|
303
|
+
void exec()
|
|
342
304
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
343
|
-
}, [debouncedSearchTerm, groupBy, open, triggerSearchOnFocus])
|
|
305
|
+
}, [debouncedSearchTerm, groupBy, open, triggerSearchOnFocus])
|
|
344
306
|
|
|
345
307
|
React.useEffect(() => {
|
|
346
308
|
/** async search */
|
|
347
309
|
|
|
348
310
|
const doSearch = async () => {
|
|
349
|
-
setIsLoading(true)
|
|
350
|
-
const res = await onSearch?.(debouncedSearchTerm)
|
|
351
|
-
setOptions(transToGroupOption(res || [], groupBy))
|
|
352
|
-
setIsLoading(false)
|
|
353
|
-
}
|
|
311
|
+
setIsLoading(true)
|
|
312
|
+
const res = await onSearch?.(debouncedSearchTerm)
|
|
313
|
+
setOptions(transToGroupOption(res || [], groupBy))
|
|
314
|
+
setIsLoading(false)
|
|
315
|
+
}
|
|
354
316
|
|
|
355
317
|
const exec = async () => {
|
|
356
|
-
if (!onSearch || !open) return
|
|
318
|
+
if (!onSearch || !open) return
|
|
357
319
|
|
|
358
320
|
if (triggerSearchOnFocus) {
|
|
359
|
-
await doSearch()
|
|
321
|
+
await doSearch()
|
|
360
322
|
}
|
|
361
323
|
|
|
362
324
|
if (debouncedSearchTerm) {
|
|
363
|
-
await doSearch()
|
|
325
|
+
await doSearch()
|
|
364
326
|
}
|
|
365
|
-
}
|
|
327
|
+
}
|
|
366
328
|
|
|
367
|
-
void exec()
|
|
329
|
+
void exec()
|
|
368
330
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
369
|
-
}, [debouncedSearchTerm, groupBy, open, triggerSearchOnFocus])
|
|
331
|
+
}, [debouncedSearchTerm, groupBy, open, triggerSearchOnFocus])
|
|
370
332
|
|
|
371
333
|
const CreatableItem = () => {
|
|
372
|
-
if (!creatable) return undefined
|
|
373
|
-
if (
|
|
374
|
-
|
|
375
|
-
selected.find((s) => s.value === inputValue)
|
|
376
|
-
) {
|
|
377
|
-
return undefined;
|
|
334
|
+
if (!creatable) return undefined
|
|
335
|
+
if (isOptionsExist(options, [{ value: inputValue, label: inputValue }]) || selected.find((s) => s.value === inputValue)) {
|
|
336
|
+
return undefined
|
|
378
337
|
}
|
|
379
338
|
|
|
380
339
|
const Item = (
|
|
@@ -382,39 +341,39 @@ const MultipleSelector = React.forwardRef<
|
|
|
382
341
|
value={inputValue}
|
|
383
342
|
className="cursor-pointer"
|
|
384
343
|
onMouseDown={(e) => {
|
|
385
|
-
e.preventDefault()
|
|
386
|
-
e.stopPropagation()
|
|
344
|
+
e.preventDefault()
|
|
345
|
+
e.stopPropagation()
|
|
387
346
|
}}
|
|
388
347
|
onSelect={(value: string) => {
|
|
389
348
|
if (selected.length >= maxSelected) {
|
|
390
|
-
onMaxSelected?.(selected.length)
|
|
391
|
-
return
|
|
349
|
+
onMaxSelected?.(selected.length)
|
|
350
|
+
return
|
|
392
351
|
}
|
|
393
|
-
setInputValue(
|
|
394
|
-
const newOptions = [...selected, { value, label: value }]
|
|
395
|
-
setSelected(newOptions)
|
|
396
|
-
onChange?.(newOptions)
|
|
352
|
+
setInputValue('')
|
|
353
|
+
const newOptions = [...selected, { value, label: value }]
|
|
354
|
+
setSelected(newOptions)
|
|
355
|
+
onChange?.(newOptions)
|
|
397
356
|
}}
|
|
398
357
|
>
|
|
399
358
|
{`Create "${inputValue}"`}
|
|
400
359
|
</CommandItem>
|
|
401
|
-
)
|
|
360
|
+
)
|
|
402
361
|
|
|
403
362
|
// For normal creatable
|
|
404
363
|
if (!onSearch && inputValue.length > 0) {
|
|
405
|
-
return Item
|
|
364
|
+
return Item
|
|
406
365
|
}
|
|
407
366
|
|
|
408
367
|
// For async search creatable. avoid showing creatable item before loading at first.
|
|
409
368
|
if (onSearch && debouncedSearchTerm.length > 0 && !isLoading) {
|
|
410
|
-
return Item
|
|
369
|
+
return Item
|
|
411
370
|
}
|
|
412
371
|
|
|
413
|
-
return undefined
|
|
414
|
-
}
|
|
372
|
+
return undefined
|
|
373
|
+
}
|
|
415
374
|
|
|
416
375
|
const EmptyItem = React.useCallback(() => {
|
|
417
|
-
if (!emptyIndicator) return undefined
|
|
376
|
+
if (!emptyIndicator) return undefined
|
|
418
377
|
|
|
419
378
|
// For async search that showing emptyIndicator
|
|
420
379
|
if (onSearch && !creatable && Object.keys(options).length === 0) {
|
|
@@ -422,66 +381,58 @@ const MultipleSelector = React.forwardRef<
|
|
|
422
381
|
<CommandItem value="-" disabled>
|
|
423
382
|
{emptyIndicator}
|
|
424
383
|
</CommandItem>
|
|
425
|
-
)
|
|
384
|
+
)
|
|
426
385
|
}
|
|
427
386
|
|
|
428
|
-
return <CommandEmpty>{emptyIndicator}</CommandEmpty
|
|
429
|
-
}, [creatable, emptyIndicator, onSearch, options])
|
|
387
|
+
return <CommandEmpty>{emptyIndicator}</CommandEmpty>
|
|
388
|
+
}, [creatable, emptyIndicator, onSearch, options])
|
|
430
389
|
|
|
431
|
-
const selectables = React.useMemo<GroupOption>(
|
|
432
|
-
() => removePickedOption(options, selected),
|
|
433
|
-
[options, selected],
|
|
434
|
-
);
|
|
390
|
+
const selectables = React.useMemo<GroupOption>(() => removePickedOption(options, selected), [options, selected])
|
|
435
391
|
|
|
436
392
|
/** Avoid Creatable Selector freezing or lagging when paste a long string. */
|
|
437
393
|
const commandFilter = React.useCallback(() => {
|
|
438
394
|
if (commandProps?.filter) {
|
|
439
|
-
return commandProps.filter
|
|
395
|
+
return commandProps.filter
|
|
440
396
|
}
|
|
441
397
|
|
|
442
398
|
if (creatable) {
|
|
443
399
|
return (value: string, search: string) => {
|
|
444
|
-
return value.toLowerCase().includes(search.toLowerCase()) ? 1 : -1
|
|
445
|
-
}
|
|
400
|
+
return value.toLowerCase().includes(search.toLowerCase()) ? 1 : -1
|
|
401
|
+
}
|
|
446
402
|
}
|
|
447
403
|
// Using default filter in `cmdk`. We don‘t have to provide it.
|
|
448
|
-
return undefined
|
|
449
|
-
}, [creatable, commandProps?.filter])
|
|
404
|
+
return undefined
|
|
405
|
+
}, [creatable, commandProps?.filter])
|
|
450
406
|
|
|
451
407
|
return (
|
|
452
408
|
<Command
|
|
453
409
|
ref={dropdownRef}
|
|
454
410
|
{...commandProps}
|
|
455
411
|
onKeyDown={(e) => {
|
|
456
|
-
handleKeyDown(e)
|
|
457
|
-
commandProps?.onKeyDown?.(e)
|
|
412
|
+
handleKeyDown(e)
|
|
413
|
+
commandProps?.onKeyDown?.(e)
|
|
458
414
|
}}
|
|
459
|
-
className={cn(
|
|
460
|
-
|
|
461
|
-
commandProps?.className,
|
|
462
|
-
)}
|
|
463
|
-
shouldFilter={
|
|
464
|
-
commandProps?.shouldFilter !== undefined
|
|
465
|
-
? commandProps.shouldFilter
|
|
466
|
-
: !onSearch
|
|
467
|
-
} // When onSearch is provided, we don‘t want to filter the options. You can still override it.
|
|
415
|
+
className={cn('h-auto overflow-visible bg-transparent', commandProps?.className)}
|
|
416
|
+
shouldFilter={commandProps?.shouldFilter !== undefined ? commandProps.shouldFilter : !onSearch} // When onSearch is provided, we don‘t want to filter the options. You can still override it.
|
|
468
417
|
filter={commandFilter()}
|
|
469
418
|
>
|
|
470
419
|
<div
|
|
471
420
|
className={cn(
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
421
|
+
'border-border-weak relative rounded-md border text-sm transition-shadow',
|
|
422
|
+
'focus-within:border-primary',
|
|
423
|
+
'focus-within:ring-primary-weak',
|
|
424
|
+
'focus-within:ring-4',
|
|
425
|
+
'focus-within:outline-hidden',
|
|
426
|
+
'has-disabled:bg-muted',
|
|
427
|
+
'has-disabled:text-muted-foreground',
|
|
428
|
+
selected.length !== 0 && 'p-1',
|
|
429
|
+
!disabled && selected.length !== 0 && 'cursor-text',
|
|
430
|
+
!hideClearAllButton && 'pe-9',
|
|
480
431
|
className,
|
|
481
432
|
)}
|
|
482
433
|
onClick={() => {
|
|
483
|
-
if (disabled) return
|
|
484
|
-
inputRef?.current?.focus()
|
|
434
|
+
if (disabled) return
|
|
435
|
+
inputRef?.current?.focus()
|
|
485
436
|
}}
|
|
486
437
|
>
|
|
487
438
|
<div className="flex flex-wrap gap-1">
|
|
@@ -490,7 +441,14 @@ const MultipleSelector = React.forwardRef<
|
|
|
490
441
|
<div
|
|
491
442
|
key={option.value}
|
|
492
443
|
className={cn(
|
|
493
|
-
|
|
444
|
+
'animate-fadeIn',
|
|
445
|
+
'bg-background',
|
|
446
|
+
'hover:bg-background',
|
|
447
|
+
'border-border-weak border border-solid',
|
|
448
|
+
'text-text-positive-weak relative inline-flex h-7 cursor-default items-center rounded-md ps-2 pe-7 pl-2 text-xs font-medium transition-all',
|
|
449
|
+
'disabled:cursor-not-allowed',
|
|
450
|
+
'disabled:opacity-50',
|
|
451
|
+
'data-fixed:pe-2',
|
|
494
452
|
badgeClassName,
|
|
495
453
|
)}
|
|
496
454
|
data-fixed={option.fixed}
|
|
@@ -501,21 +459,20 @@ const MultipleSelector = React.forwardRef<
|
|
|
501
459
|
type="button"
|
|
502
460
|
disabled={disabled || option.fixed}
|
|
503
461
|
className={cn(
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
462
|
+
'text-text-positive-muted absolute -inset-y-px -end-px flex size-7 items-center justify-center rounded-e-lg border border-transparent p-0 outline-0 transition-colors',
|
|
463
|
+
'hover:text-foreground',
|
|
464
|
+
'focus-visible:outline',
|
|
465
|
+
'focus-visible:outline-2',
|
|
466
|
+
'focus-visible:outline-primary-weak',
|
|
467
|
+
'disabled:hover:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50',
|
|
510
468
|
)}
|
|
511
469
|
onKeyDown={(e) => {
|
|
512
|
-
if (e.key
|
|
513
|
-
|
|
514
|
-
}
|
|
470
|
+
if (e.key !== 'Enter') return
|
|
471
|
+
handleUnselect(option)
|
|
515
472
|
}}
|
|
516
473
|
onMouseDown={(e) => {
|
|
517
|
-
e.preventDefault()
|
|
518
|
-
e.stopPropagation()
|
|
474
|
+
e.preventDefault()
|
|
475
|
+
e.stopPropagation()
|
|
519
476
|
}}
|
|
520
477
|
onClick={() => handleUnselect(option)}
|
|
521
478
|
aria-label="Remove"
|
|
@@ -523,7 +480,7 @@ const MultipleSelector = React.forwardRef<
|
|
|
523
480
|
<X size={14} strokeWidth={2} aria-hidden="true" />
|
|
524
481
|
</button>
|
|
525
482
|
</div>
|
|
526
|
-
)
|
|
483
|
+
)
|
|
527
484
|
})}
|
|
528
485
|
{/* Avoid having the "Search" Icon */}
|
|
529
486
|
<CommandPrimitive.Input
|
|
@@ -532,34 +489,30 @@ const MultipleSelector = React.forwardRef<
|
|
|
532
489
|
value={inputValue}
|
|
533
490
|
disabled={disabled}
|
|
534
491
|
onValueChange={(value) => {
|
|
535
|
-
setInputValue(value)
|
|
536
|
-
inputProps?.onValueChange?.(value)
|
|
492
|
+
setInputValue(value)
|
|
493
|
+
inputProps?.onValueChange?.(value)
|
|
537
494
|
}}
|
|
538
495
|
onBlur={(event) => {
|
|
539
496
|
if (!onScrollbar) {
|
|
540
|
-
setOpen(false)
|
|
497
|
+
setOpen(false)
|
|
541
498
|
}
|
|
542
|
-
inputProps?.onBlur?.(event)
|
|
499
|
+
inputProps?.onBlur?.(event)
|
|
543
500
|
}}
|
|
544
501
|
onFocus={(event) => {
|
|
545
|
-
setOpen(true)
|
|
502
|
+
setOpen(true)
|
|
546
503
|
if (triggerSearchOnFocus) {
|
|
547
|
-
onSearch?.(debouncedSearchTerm)
|
|
504
|
+
onSearch?.(debouncedSearchTerm)
|
|
548
505
|
}
|
|
549
|
-
inputProps?.onFocus?.(event)
|
|
506
|
+
inputProps?.onFocus?.(event)
|
|
550
507
|
}}
|
|
551
|
-
placeholder={
|
|
552
|
-
hidePlaceholderWhenSelected && selected.length !== 0
|
|
553
|
-
? ""
|
|
554
|
-
: placeholder
|
|
555
|
-
}
|
|
508
|
+
placeholder={hidePlaceholderWhenSelected && selected.length !== 0 ? '' : placeholder}
|
|
556
509
|
className={cn(
|
|
557
|
-
|
|
558
|
-
|
|
510
|
+
'placeholder:text-text-positive-muted flex-1 bg-transparent outline-hidden',
|
|
511
|
+
'disabled:placeholder:text-transparent',
|
|
559
512
|
{
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
513
|
+
'w-full': hidePlaceholderWhenSelected,
|
|
514
|
+
'px-3 py-2': selected.length === 0,
|
|
515
|
+
'ml-1': selected.length !== 0,
|
|
563
516
|
},
|
|
564
517
|
inputProps?.className,
|
|
565
518
|
)}
|
|
@@ -567,21 +520,16 @@ const MultipleSelector = React.forwardRef<
|
|
|
567
520
|
<button
|
|
568
521
|
type="button"
|
|
569
522
|
onClick={() => {
|
|
570
|
-
setSelected(selected.filter((s) => s.fixed))
|
|
571
|
-
onChange?.(selected.filter((s) => s.fixed))
|
|
523
|
+
setSelected(selected.filter((s) => s.fixed))
|
|
524
|
+
onChange?.(selected.filter((s) => s.fixed))
|
|
572
525
|
}}
|
|
573
526
|
className={cn(
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
(hideClearAllButton ||
|
|
580
|
-
disabled ||
|
|
581
|
-
selected.length < 1 ||
|
|
582
|
-
selected.filter(({ fixed }) => fixed).length ===
|
|
583
|
-
selected.length) &&
|
|
584
|
-
"hidden",
|
|
527
|
+
'text-muted-foreground/80',
|
|
528
|
+
'absolute end-0 top-0 flex size-9 items-center justify-center rounded-lg border border-transparent transition-colors',
|
|
529
|
+
'focus-visible:outline-2',
|
|
530
|
+
'hover:text-text-positive',
|
|
531
|
+
'focus-visible:outline-primary-weak',
|
|
532
|
+
(hideClearAllButton || disabled || selected.length < 1 || selected.filter(({ fixed }) => fixed).length === selected.length) && 'hidden',
|
|
585
533
|
)}
|
|
586
534
|
aria-label="Clear all"
|
|
587
535
|
>
|
|
@@ -592,40 +540,36 @@ const MultipleSelector = React.forwardRef<
|
|
|
592
540
|
<div className="relative">
|
|
593
541
|
<div
|
|
594
542
|
className={cn(
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
543
|
+
'shadow-dropdown absolute top-2 z-10 w-full overflow-hidden rounded-lg',
|
|
544
|
+
'data-[state=open]:animate-in',
|
|
545
|
+
'data-[state=closed]:animate-out',
|
|
546
|
+
'data-[state=closed]:fade-out-0',
|
|
547
|
+
'data-[state=open]:fade-in-0',
|
|
548
|
+
'data-[state=closed]:zoom-out-95',
|
|
549
|
+
'data-[state=open]:zoom-in-95',
|
|
550
|
+
!open && 'hidden',
|
|
598
551
|
)}
|
|
599
|
-
data-state={open ?
|
|
552
|
+
data-state={open ? 'open' : 'closed'}
|
|
600
553
|
>
|
|
601
554
|
{open && (
|
|
602
555
|
<CommandList
|
|
603
|
-
className="
|
|
556
|
+
className="shadow-lg outline-hidden"
|
|
604
557
|
onMouseLeave={() => {
|
|
605
|
-
setOnScrollbar(false)
|
|
558
|
+
setOnScrollbar(false)
|
|
606
559
|
}}
|
|
607
560
|
onMouseEnter={() => {
|
|
608
|
-
setOnScrollbar(true)
|
|
561
|
+
setOnScrollbar(true)
|
|
609
562
|
}}
|
|
610
563
|
onMouseUp={() => {
|
|
611
|
-
inputRef?.current?.focus()
|
|
564
|
+
inputRef?.current?.focus()
|
|
612
565
|
}}
|
|
613
566
|
>
|
|
614
567
|
{onAddNewItem && (
|
|
615
568
|
<>
|
|
616
569
|
<CommandSeparator />
|
|
617
570
|
<CommandGroup>
|
|
618
|
-
<Button
|
|
619
|
-
|
|
620
|
-
variant="ghost"
|
|
621
|
-
className="w-full font-normal [&_div]:justify-start"
|
|
622
|
-
onClick={onAddNewItem}
|
|
623
|
-
>
|
|
624
|
-
<PlusIcon
|
|
625
|
-
size={14}
|
|
626
|
-
className="-ms-2 opacity-60"
|
|
627
|
-
aria-hidden="true"
|
|
628
|
-
/>
|
|
571
|
+
<Button type="button" variant="ghost" className="w-full font-normal [&_div]:justify-start" onClick={onAddNewItem}>
|
|
572
|
+
<PlusIcon size={14} className="opacity-60" aria-hidden="true" />
|
|
629
573
|
Thêm mới
|
|
630
574
|
</Button>
|
|
631
575
|
</CommandGroup>
|
|
@@ -637,15 +581,9 @@ const MultipleSelector = React.forwardRef<
|
|
|
637
581
|
<React.Fragment>
|
|
638
582
|
{EmptyItem()}
|
|
639
583
|
{CreatableItem()}
|
|
640
|
-
{!selectFirstItem &&
|
|
641
|
-
<CommandItem value="-" className="hidden" />
|
|
642
|
-
)}
|
|
584
|
+
{!selectFirstItem && <CommandItem value="-" className="hidden" />}
|
|
643
585
|
{Object.entries(selectables).map(([key, dropdowns]) => (
|
|
644
|
-
<CommandGroup
|
|
645
|
-
key={key}
|
|
646
|
-
heading={key}
|
|
647
|
-
className="h-full overflow-auto"
|
|
648
|
-
>
|
|
586
|
+
<CommandGroup key={key} heading={key} className="h-full overflow-auto">
|
|
649
587
|
{dropdowns.map((option) => {
|
|
650
588
|
return (
|
|
651
589
|
<CommandItem
|
|
@@ -653,28 +591,24 @@ const MultipleSelector = React.forwardRef<
|
|
|
653
591
|
value={option.value}
|
|
654
592
|
disabled={option.disable}
|
|
655
593
|
onMouseDown={(e) => {
|
|
656
|
-
e.preventDefault()
|
|
657
|
-
e.stopPropagation()
|
|
594
|
+
e.preventDefault()
|
|
595
|
+
e.stopPropagation()
|
|
658
596
|
}}
|
|
659
597
|
onSelect={() => {
|
|
660
598
|
if (selected.length >= maxSelected) {
|
|
661
|
-
onMaxSelected?.(selected.length)
|
|
662
|
-
return
|
|
599
|
+
onMaxSelected?.(selected.length)
|
|
600
|
+
return
|
|
663
601
|
}
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
setSelected(newOptions)
|
|
667
|
-
onChange?.(newOptions)
|
|
602
|
+
const newOptions = [...selected, option]
|
|
603
|
+
setInputValue('')
|
|
604
|
+
setSelected(newOptions)
|
|
605
|
+
onChange?.(newOptions)
|
|
668
606
|
}}
|
|
669
|
-
className={cn(
|
|
670
|
-
"cursor-pointer",
|
|
671
|
-
option.disable &&
|
|
672
|
-
"cursor-not-allowed opacity-50",
|
|
673
|
-
)}
|
|
607
|
+
className={cn('cursor-pointer', option.disable && 'cursor-not-allowed opacity-50')}
|
|
674
608
|
>
|
|
675
609
|
{option.label}
|
|
676
610
|
</CommandItem>
|
|
677
|
-
)
|
|
611
|
+
)
|
|
678
612
|
})}
|
|
679
613
|
</CommandGroup>
|
|
680
614
|
))}
|
|
@@ -685,9 +619,8 @@ const MultipleSelector = React.forwardRef<
|
|
|
685
619
|
</div>
|
|
686
620
|
</div>
|
|
687
621
|
</Command>
|
|
688
|
-
)
|
|
622
|
+
)
|
|
689
623
|
},
|
|
690
|
-
)
|
|
624
|
+
)
|
|
691
625
|
|
|
692
|
-
MultipleSelector.displayName =
|
|
693
|
-
export default MultipleSelector;
|
|
626
|
+
MultipleSelector.displayName = 'MultipleSelector'
|