@customafk/lunas-ui 0.0.26 → 0.0.27
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/{alert-dialog-D-oR0YW3.cjs → alert-dialog-26JyobJb.cjs} +1 -1
- package/dist/{alert-dialog-D-oR0YW3.cjs.map → alert-dialog-26JyobJb.cjs.map} +1 -1
- package/dist/{alert-dialog-CNHyP_A9.js → alert-dialog-Dv0cgymS.js} +1 -1
- package/dist/{alert-dialog-CNHyP_A9.js.map → alert-dialog-Dv0cgymS.js.map} +1 -1
- package/dist/{button-BmBtMriU.d.ts → button-CPBLm_02.d.ts} +5 -5
- package/dist/{button-tCnJHt8O.d.cts → button-ghXW1WTr.d.cts} +5 -5
- package/dist/{calendar-CbuOOMpK.js → calendar-B66UT_fu.js} +1 -1
- package/dist/{calendar-CbuOOMpK.js.map → calendar-B66UT_fu.js.map} +1 -1
- package/dist/{calendar-B8IKzrdN.cjs → calendar-DXegnGRJ.cjs} +1 -1
- package/dist/{calendar-B8IKzrdN.cjs.map → calendar-DXegnGRJ.cjs.map} +1 -1
- package/dist/{command-Dr2XmKV6.d.cts → command-CE_Qcgo7.d.ts} +12 -12
- package/dist/{command-Dvq-HZwH.d.ts → command-CiEjoEnP.d.cts} +12 -12
- package/dist/{command-TFZwJmux.js → command-Dbkg10QA.js} +2 -2
- package/dist/{command-TFZwJmux.js.map → command-Dbkg10QA.js.map} +1 -1
- package/dist/{command-CoB5R5FI.cjs → command-IL3ogESu.cjs} +2 -2
- package/dist/{command-CoB5R5FI.cjs.map → command-IL3ogESu.cjs.map} +1 -1
- package/dist/data-display/empty.d.cts +2 -2
- package/dist/data-display/statistic.d.cts +2 -2
- package/dist/data-display/statistic.d.ts +2 -2
- package/dist/{dialog-CSDDiHKO.js → dialog-BEdMA5Lp.js} +1 -1
- package/dist/{dialog-CSDDiHKO.js.map → dialog-BEdMA5Lp.js.map} +1 -1
- package/dist/{dialog-C-DYoapJ.d.ts → dialog-Bw_T5aco.d.cts} +12 -12
- package/dist/{dialog-_Cgij9NP.cjs → dialog-C4oHnJNN.cjs} +1 -1
- package/dist/{dialog-_Cgij9NP.cjs.map → dialog-C4oHnJNN.cjs.map} +1 -1
- package/dist/{dialog-CA0E_tNX.d.cts → dialog-CoH1pTBH.d.ts} +12 -12
- package/dist/dialogs/confirm-dialog.cjs +1 -1
- package/dist/dialogs/confirm-dialog.js +1 -1
- package/dist/dialogs/detail-dialog/component/sidebar.d.cts +4 -4
- package/dist/dialogs/detail-dialog/component/sidebar.d.ts +28 -28
- package/dist/dialogs/detail-dialog/index.cjs +1 -1
- package/dist/dialogs/detail-dialog/index.js +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.d.cts +2 -2
- package/dist/dialogs/form-dialog.d.ts +2 -2
- package/dist/dialogs/form-dialog.js +1 -1
- package/dist/dialogs/loading-dialog.cjs +1 -1
- package/dist/dialogs/loading-dialog.js +1 -1
- package/dist/{error-dialog-D5R5le-W.cjs → error-dialog-C0PDn-pj.cjs} +2 -2
- package/dist/{error-dialog-D5R5le-W.cjs.map → error-dialog-C0PDn-pj.cjs.map} +1 -1
- package/dist/{error-dialog-Q99thrSD.js → error-dialog-CCdQ8zbQ.js} +2 -2
- package/dist/{error-dialog-Q99thrSD.js.map → error-dialog-CCdQ8zbQ.js.map} +1 -1
- package/dist/{form-wrapper-CY-stRaQ.cjs → form-wrapper-Cd8c5MIL.cjs} +2 -2
- package/dist/{form-wrapper-CY-stRaQ.cjs.map → form-wrapper-Cd8c5MIL.cjs.map} +1 -1
- package/dist/{form-wrapper-C2xlvWx0.js → form-wrapper-DntbFqN1.js} +2 -2
- package/dist/{form-wrapper-C2xlvWx0.js.map → form-wrapper-DntbFqN1.js.map} +1 -1
- package/dist/forms/combobox-field.cjs +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/date-field.cjs +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/form-wrapper.cjs +1 -1
- package/dist/forms/form-wrapper.d.cts +2 -2
- package/dist/forms/form-wrapper.d.ts +2 -2
- 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/number-field.d.cts +2 -2
- package/dist/forms/number-field.d.ts +2 -2
- package/dist/forms/password-field.d.cts +2 -2
- package/dist/forms/password-field.d.ts +2 -2
- package/dist/forms/select-field.d.cts +2 -2
- package/dist/forms/select-field.d.ts +2 -2
- package/dist/forms/switch-field.d.cts +2 -2
- package/dist/forms/switch-field.d.ts +2 -2
- package/dist/forms/text-field.d.cts +2 -2
- package/dist/forms/text-field.d.ts +2 -2
- package/dist/forms/textarea-field.d.cts +2 -2
- package/dist/forms/textarea-field.d.ts +2 -2
- package/dist/{input-CjNcnHb_.d.ts → input-CUDclgoU.d.ts} +3 -3
- package/dist/{input-BsXm0_Iq.d.cts → input-y_n-XGys.d.cts} +3 -3
- package/dist/layouts/app-layout/index.d.cts +5 -5
- package/dist/layouts/app-layout/index.d.ts +3 -3
- package/dist/layouts/flex.d.cts +4 -4
- package/dist/layouts/flex.d.ts +4 -4
- package/dist/layouts/main/index.d.cts +4 -4
- package/dist/layouts/main/index.d.ts +4 -4
- package/dist/{multi-select-Cjvm4tK5.cjs → multi-select-3yxD9gbY.cjs} +2 -2
- package/dist/{multi-select-Cjvm4tK5.cjs.map → multi-select-3yxD9gbY.cjs.map} +1 -1
- package/dist/{multi-select-D0bZVOnm.js → multi-select-Cb07NlA7.js} +2 -2
- package/dist/{multi-select-D0bZVOnm.js.map → multi-select-Cb07NlA7.js.map} +1 -1
- package/dist/{popover-CTFp7ZXi.js → popover-CqAD7HNo.js} +1 -1
- package/dist/{popover-CTFp7ZXi.js.map → popover-CqAD7HNo.js.map} +1 -1
- package/dist/{popover-DCcPvdz2.cjs → popover-Dd0acCEk.cjs} +1 -1
- package/dist/{popover-DCcPvdz2.cjs.map → popover-Dd0acCEk.cjs.map} +1 -1
- package/dist/{separator-5FdzRGaJ.d.ts → separator-BLYi41aC.d.ts} +3 -3
- package/dist/{separator-DpxrpK_H.d.cts → separator-ClGBPiYE.d.cts} +3 -3
- package/dist/table/index.d.cts +2 -2
- package/dist/table/index.d.ts +2 -2
- package/dist/{toggle-Cx9H5u3p.d.cts → toggle-BWQWsKMA.d.ts} +4 -4
- package/dist/{toggle-DH9IssyE.d.ts → toggle-DnGvFJh8.d.cts} +4 -4
- package/dist/{tooltip-Djh_dcy5.d.ts → tooltip-Bk8VwHdM.d.ts} +6 -6
- package/dist/{tooltip-BAtWdJyX.d.cts → tooltip-cisSpCHG.d.cts} +6 -6
- package/dist/typography/paragraph.d.cts +2 -2
- package/dist/typography/paragraph.d.ts +2 -2
- package/dist/typography/title.d.cts +2 -2
- package/dist/typography/title.d.ts +2 -2
- 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.d.cts +6 -6
- package/dist/ui/alert.d.ts +6 -6
- package/dist/ui/aspect-ratio.d.cts +2 -2
- package/dist/ui/aspect-ratio.d.ts +2 -2
- package/dist/ui/avatar.d.cts +4 -4
- package/dist/ui/avatar.d.ts +4 -4
- package/dist/ui/badge.d.cts +2 -2
- package/dist/ui/badge.d.ts +4 -4
- package/dist/ui/breadcrumb.d.cts +8 -8
- package/dist/ui/breadcrumb.d.ts +8 -8
- package/dist/ui/button.d.cts +1 -1
- package/dist/ui/button.d.ts +1 -1
- package/dist/ui/calendar.cjs +1 -1
- package/dist/ui/calendar.d.cts +4 -4
- package/dist/ui/calendar.d.ts +4 -4
- package/dist/ui/calendar.js +1 -1
- package/dist/ui/card.d.cts +8 -8
- package/dist/ui/card.d.ts +8 -8
- package/dist/ui/carousel.d.cts +7 -7
- package/dist/ui/carousel.d.ts +7 -7
- package/dist/ui/collapsible.d.cts +4 -4
- package/dist/ui/collapsible.d.ts +4 -4
- 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.d.cts +16 -16
- package/dist/ui/context-menu.d.ts +16 -16
- 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.d.cts +16 -16
- package/dist/ui/dropdown-menu.d.ts +16 -16
- package/dist/ui/file-uploader.d.cts +2 -2
- package/dist/ui/file-uploader.d.ts +2 -2
- package/dist/ui/form.d.cts +7 -7
- package/dist/ui/form.d.ts +7 -7
- package/dist/ui/hover-card.d.cts +4 -4
- package/dist/ui/hover-card.d.ts +4 -4
- package/dist/ui/input-otp.d.cts +5 -5
- package/dist/ui/input-otp.d.ts +5 -5
- package/dist/ui/input.d.cts +1 -1
- package/dist/ui/input.d.ts +1 -1
- package/dist/ui/inputs/search-input.d.cts +1 -1
- package/dist/ui/inputs/search-input.d.ts +3 -3
- package/dist/ui/label.d.cts +2 -2
- package/dist/ui/label.d.ts +2 -2
- package/dist/ui/menubar.d.cts +17 -17
- package/dist/ui/menubar.d.ts +17 -17
- package/dist/ui/multi-select.cjs +1 -1
- package/dist/ui/multi-select.d.cts +2 -2
- package/dist/ui/multi-select.d.ts +2 -2
- package/dist/ui/multi-select.js +1 -1
- package/dist/ui/navigation-menu.d.cts +11 -11
- package/dist/ui/navigation-menu.d.ts +9 -9
- package/dist/ui/pagination.d.cts +9 -9
- package/dist/ui/pagination.d.ts +9 -9
- package/dist/ui/popover.cjs +1 -1
- package/dist/ui/popover.d.cts +5 -5
- package/dist/ui/popover.d.ts +5 -5
- package/dist/ui/popover.js +1 -1
- package/dist/ui/progress.d.cts +2 -2
- package/dist/ui/progress.d.ts +2 -2
- package/dist/ui/radio-group.d.cts +3 -3
- package/dist/ui/radio-group.d.ts +3 -3
- package/dist/ui/resizable.d.cts +4 -4
- package/dist/ui/resizable.d.ts +4 -4
- package/dist/ui/scroll-area.d.ts +3 -3
- package/dist/ui/select.d.cts +11 -11
- package/dist/ui/select.d.ts +11 -11
- package/dist/ui/separator.d.cts +1 -1
- package/dist/ui/separator.d.ts +1 -1
- package/dist/ui/sheet.d.cts +9 -9
- package/dist/ui/sheet.d.ts +9 -9
- package/dist/ui/sidebar.d.cts +30 -30
- package/dist/ui/sidebar.d.ts +30 -30
- package/dist/ui/skeleton.d.cts +2 -2
- package/dist/ui/skeleton.d.ts +2 -2
- package/dist/ui/slider.d.cts +2 -2
- package/dist/ui/slider.d.ts +2 -2
- package/dist/ui/sonner.d.cts +2 -2
- package/dist/ui/sonner.d.ts +2 -2
- package/dist/ui/switch.d.cts +2 -2
- package/dist/ui/switch.d.ts +2 -2
- package/dist/ui/table.d.cts +9 -9
- package/dist/ui/table.d.ts +9 -9
- package/dist/ui/tabs.d.cts +5 -5
- package/dist/ui/tabs.d.ts +5 -5
- package/dist/ui/textarea.d.cts +2 -2
- package/dist/ui/textarea.d.ts +2 -2
- package/dist/ui/toggle-group.d.cts +4 -4
- package/dist/ui/toggle-group.d.ts +4 -4
- package/dist/ui/toggle.d.cts +1 -1
- package/dist/ui/toggle.d.ts +1 -1
- package/dist/ui/tooltip.d.cts +1 -1
- package/dist/ui/tooltip.d.ts +1 -1
- package/package.json +2 -2
- package/styles/base.css +29 -0
- package/styles/loader.css +113 -0
- package/styles/theme.css +104 -0
- package/styles/typography.css +6 -0
- package/packages/components/cards/simple-card.tsx +0 -23
- package/packages/components/data-display/country.tsx +0 -53
- package/packages/components/data-display/data-list.tsx +0 -29
- package/packages/components/data-display/date-tooltip.tsx +0 -23
- package/packages/components/data-display/date.tsx +0 -157
- package/packages/components/data-display/empty.tsx +0 -13
- package/packages/components/data-display/name.tsx +0 -23
- package/packages/components/data-display/phone-number.tsx +0 -14
- package/packages/components/data-display/role-badge.tsx +0 -29
- package/packages/components/data-display/statistic.tsx +0 -139
- package/packages/components/dialogs/confirm-dialog.tsx +0 -44
- package/packages/components/dialogs/detail-dialog/component/header.tsx +0 -10
- package/packages/components/dialogs/detail-dialog/component/main.tsx +0 -35
- package/packages/components/dialogs/detail-dialog/component/sidebar.tsx +0 -618
- package/packages/components/dialogs/detail-dialog/component/wrapper.tsx +0 -15
- package/packages/components/dialogs/detail-dialog/index.tsx +0 -91
- package/packages/components/dialogs/error-dialog.tsx +0 -34
- package/packages/components/dialogs/form-dialog.tsx +0 -74
- package/packages/components/dialogs/loading-dialog.tsx +0 -20
- package/packages/components/forms/combobox-field.tsx +0 -104
- package/packages/components/forms/date-field.tsx +0 -62
- package/packages/components/forms/form-wrapper.tsx +0 -120
- package/packages/components/forms/multi-select-field.tsx +0 -56
- package/packages/components/forms/number-field.tsx +0 -54
- package/packages/components/forms/password-field.tsx +0 -38
- package/packages/components/forms/select-field.tsx +0 -58
- package/packages/components/forms/switch-field.tsx +0 -40
- package/packages/components/forms/text-field.tsx +0 -73
- package/packages/components/forms/textarea-field.tsx +0 -45
- package/packages/components/index.tsx +0 -0
- package/packages/components/layouts/app-layout/index.tsx +0 -74
- package/packages/components/layouts/app-layout/sidebar.tsx +0 -663
- package/packages/components/layouts/flex.tsx +0 -99
- package/packages/components/layouts/main/content.tsx +0 -11
- package/packages/components/layouts/main/header.tsx +0 -41
- package/packages/components/layouts/main/index.tsx +0 -3
- package/packages/components/layouts/main/wrapper.tsx +0 -5
- package/packages/components/table/data-table-pagination.tsx +0 -70
- package/packages/components/table/data-table.tsx +0 -241
- package/packages/components/table/index.tsx +0 -107
- package/packages/components/typography/paragraph.tsx +0 -29
- package/packages/components/typography/title.tsx +0 -31
- package/packages/components/ui/alert-dialog.tsx +0 -99
- package/packages/components/ui/alert.tsx +0 -44
- package/packages/components/ui/aspect-ratio.tsx +0 -11
- package/packages/components/ui/avatar.tsx +0 -25
- package/packages/components/ui/badge.tsx +0 -57
- package/packages/components/ui/breadcrumb.tsx +0 -74
- package/packages/components/ui/button.tsx +0 -205
- package/packages/components/ui/buttons/add-new.tsx +0 -19
- package/packages/components/ui/buttons/edit.tsx +0 -14
- package/packages/components/ui/buttons/refresh.tsx +0 -19
- package/packages/components/ui/buttons/trash.tsx +0 -14
- package/packages/components/ui/buttons/upload-image.tsx +0 -25
- package/packages/components/ui/calendar.tsx +0 -141
- package/packages/components/ui/card.tsx +0 -44
- package/packages/components/ui/carousel.tsx +0 -187
- package/packages/components/ui/checkbox.tsx +0 -34
- package/packages/components/ui/collapsible.tsx +0 -17
- package/packages/components/ui/command.tsx +0 -138
- package/packages/components/ui/context-menu.tsx +0 -196
- package/packages/components/ui/dialog.tsx +0 -119
- package/packages/components/ui/dropdown-menu.tsx +0 -249
- package/packages/components/ui/file-uploader.tsx +0 -314
- package/packages/components/ui/form.tsx +0 -104
- package/packages/components/ui/hover-card.tsx +0 -32
- package/packages/components/ui/input-otp.tsx +0 -67
- package/packages/components/ui/input.tsx +0 -59
- package/packages/components/ui/inputs/number-input.tsx +0 -317
- package/packages/components/ui/inputs/password-input.tsx +0 -29
- package/packages/components/ui/inputs/search-input.tsx +0 -24
- package/packages/components/ui/label.tsx +0 -26
- package/packages/components/ui/menubar.tsx +0 -212
- package/packages/components/ui/multi-select.tsx +0 -626
- package/packages/components/ui/navigation-menu.tsx +0 -124
- package/packages/components/ui/pagination.tsx +0 -70
- package/packages/components/ui/popover.tsx +0 -49
- package/packages/components/ui/progress.tsx +0 -19
- package/packages/components/ui/radio-group.tsx +0 -36
- package/packages/components/ui/resizable.tsx +0 -47
- package/packages/components/ui/scroll-area.tsx +0 -35
- package/packages/components/ui/select.tsx +0 -199
- package/packages/components/ui/separator.tsx +0 -25
- package/packages/components/ui/sheet.tsx +0 -119
- package/packages/components/ui/sidebar.tsx +0 -675
- package/packages/components/ui/skeleton.tsx +0 -8
- package/packages/components/ui/slider.tsx +0 -45
- package/packages/components/ui/sonner.tsx +0 -40
- package/packages/components/ui/switch.tsx +0 -46
- package/packages/components/ui/table.tsx +0 -66
- package/packages/components/ui/tabs.tsx +0 -53
- package/packages/components/ui/textarea.tsx +0 -46
- package/packages/components/ui/toggle-group.tsx +0 -63
- package/packages/components/ui/toggle.tsx +0 -34
- package/packages/components/ui/tooltip.tsx +0 -53
- package/packages/constants.tsx +0 -45
- package/packages/hooks/use-callback-ref.ts +0 -22
- package/packages/hooks/use-controllable-state.ts +0 -58
- package/packages/hooks/use-mobile.ts +0 -19
- package/packages/index.css +0 -133
- package/packages/lib/utils.ts +0 -24
- package/packages/stories/1.Guideline.mdx +0 -3
- package/packages/stories/2.Colors.mdx +0 -145
- package/packages/stories/3.Pypography.mdx +0 -51
- package/packages/stories/cards/simple-card.stories.tsx +0 -24
- package/packages/stories/data-display/data-list.stories.tsx +0 -22
- package/packages/stories/data-display/empty.stories.tsx +0 -13
- package/packages/stories/data-display/form-dialog.stories.tsx +0 -27
- package/packages/stories/data-display/name.stories.tsx +0 -25
- package/packages/stories/data-display/phone-number.stories.tsx +0 -17
- package/packages/stories/data-display/statistic.stories.tsx +0 -41
- package/packages/stories/dialogs/confirm-dialog.stories.tsx +0 -26
- package/packages/stories/dialogs/detail-dialog.stories.tsx +0 -34
- package/packages/stories/dialogs/error-dialog.stories.tsx +0 -27
- package/packages/stories/dialogs/loading-dialog.stories.tsx +0 -16
- package/packages/stories/forms/combobox-field.stories.tsx +0 -38
- package/packages/stories/forms/form-wrapper.stories.tsx +0 -59
- package/packages/stories/forms/multi-select-field.stories.tsx +0 -42
- package/packages/stories/forms/number-field.stories.tsx +0 -35
- package/packages/stories/forms/select-field.stories.tsx +0 -39
- package/packages/stories/forms/switch-field.stories.tsx +0 -36
- package/packages/stories/forms/text-field.stories.tsx +0 -41
- package/packages/stories/forms/textarea-field.stories.tsx +0 -34
- package/packages/stories/layouts/app-layout.stories.tsx +0 -49
- package/packages/stories/typography/paragraph.stories.tsx +0 -45
- package/packages/stories/typography/title.stories.tsx +0 -39
- package/packages/stories/ui/alert-dialog.stories.tsx +0 -49
- package/packages/stories/ui/alert.stories.tsx +0 -63
- package/packages/stories/ui/aspect-ratio.stories.tsx +0 -22
- package/packages/stories/ui/badge.stories.tsx +0 -170
- package/packages/stories/ui/breadcrumb.stories.tsx +0 -172
- package/packages/stories/ui/button.stories.tsx +0 -181
- package/packages/stories/ui/card.stories.tsx +0 -58
- package/packages/stories/ui/checkbox.stories.tsx +0 -48
- package/packages/stories/ui/command.stories.tsx +0 -58
- package/packages/stories/ui/dialog.stories.tsx +0 -55
- package/packages/stories/ui/dropdown-menu.stories.tsx +0 -89
- package/packages/stories/ui/file-uploader.stories.tsx +0 -18
- package/packages/stories/ui/input.stories.tsx +0 -38
- package/packages/stories/ui/label.stories.tsx +0 -17
- package/packages/stories/ui/multi-select.stories.tsx +0 -29
- package/packages/stories/ui/popover.stories.tsx +0 -52
- package/packages/stories/ui/progress.stories.tsx +0 -17
- package/packages/stories/ui/radio-group.stories.tsx +0 -31
- package/packages/stories/ui/select.stories.tsx +0 -31
- package/packages/stories/ui/separator.stories.tsx +0 -31
- package/packages/stories/ui/sheet.stories.tsx +0 -50
- package/packages/stories/ui/skeleton.stories.tsx +0 -27
- package/packages/stories/ui/switch.stories.tsx +0 -21
- package/packages/stories/ui/table.stories.tsx +0 -82
- package/packages/stories/ui/tabs.stories.tsx +0 -70
- package/packages/stories/ui/textarea.stories.tsx +0 -15
- package/packages/stories/ui/toaster.stories.tsx +0 -87
- package/packages/types.ts +0 -50
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
import type { FieldPath, FieldValues } from 'react-hook-form'
|
|
3
|
-
|
|
4
|
-
import { cn } from '@/lib/utils'
|
|
5
|
-
|
|
6
|
-
import { FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage } from '../ui/form'
|
|
7
|
-
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../ui/select'
|
|
8
|
-
|
|
9
|
-
type Props<TFieldValues extends FieldValues = FieldValues> = {
|
|
10
|
-
name: FieldPath<TFieldValues>
|
|
11
|
-
label?: string
|
|
12
|
-
placeholder?: string
|
|
13
|
-
disabledValues?: string[]
|
|
14
|
-
options?: { value: string; label: string }[]
|
|
15
|
-
isShowLabel?: boolean
|
|
16
|
-
isShowErrorMsg?: boolean
|
|
17
|
-
modal?: boolean
|
|
18
|
-
description?: string
|
|
19
|
-
className?: string
|
|
20
|
-
}
|
|
21
|
-
export const SelectField = <TFieldValues extends FieldValues = FieldValues>({
|
|
22
|
-
name,
|
|
23
|
-
label = 'Select Field',
|
|
24
|
-
placeholder = 'Select an option',
|
|
25
|
-
disabledValues = [],
|
|
26
|
-
options = [],
|
|
27
|
-
isShowLabel = true,
|
|
28
|
-
isShowErrorMsg = false,
|
|
29
|
-
description = '',
|
|
30
|
-
className = '',
|
|
31
|
-
}: Props<TFieldValues>) => {
|
|
32
|
-
return (
|
|
33
|
-
<FormField
|
|
34
|
-
name={name}
|
|
35
|
-
render={({ field }) => (
|
|
36
|
-
<FormItem className={cn('w-full', className)}>
|
|
37
|
-
{isShowLabel && <FormLabel>{label}</FormLabel>}
|
|
38
|
-
<Select defaultValue={field.value} onValueChange={field.onChange}>
|
|
39
|
-
<FormControl>
|
|
40
|
-
<SelectTrigger className="w-full">
|
|
41
|
-
<SelectValue placeholder={placeholder} />
|
|
42
|
-
</SelectTrigger>
|
|
43
|
-
</FormControl>
|
|
44
|
-
<SelectContent>
|
|
45
|
-
{options.map((option) => (
|
|
46
|
-
<SelectItem key={option.value} disabled={disabledValues.includes(option.value)} value={option.value}>
|
|
47
|
-
{option.label}
|
|
48
|
-
</SelectItem>
|
|
49
|
-
))}
|
|
50
|
-
</SelectContent>
|
|
51
|
-
</Select>
|
|
52
|
-
{!!description && <FormDescription>{description}</FormDescription>}
|
|
53
|
-
{isShowErrorMsg && <FormMessage />}
|
|
54
|
-
</FormItem>
|
|
55
|
-
)}
|
|
56
|
-
/>
|
|
57
|
-
)
|
|
58
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
import type { FieldPath, FieldValues } from 'react-hook-form'
|
|
3
|
-
|
|
4
|
-
import { cn } from '@/lib/utils'
|
|
5
|
-
|
|
6
|
-
import { FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage } from '../ui/form'
|
|
7
|
-
import { Switch } from '../ui/switch'
|
|
8
|
-
|
|
9
|
-
type Props<TFieldValues extends FieldValues = FieldValues> = {
|
|
10
|
-
name: FieldPath<TFieldValues>
|
|
11
|
-
label?: string
|
|
12
|
-
description?: string
|
|
13
|
-
isShowErrorMsg?: boolean
|
|
14
|
-
}
|
|
15
|
-
export const SwitchField = <TFieldValues extends FieldValues = FieldValues>({
|
|
16
|
-
name,
|
|
17
|
-
label = 'Switch Field',
|
|
18
|
-
description,
|
|
19
|
-
isShowErrorMsg = false,
|
|
20
|
-
}: Props<TFieldValues>) => {
|
|
21
|
-
return (
|
|
22
|
-
<FormField
|
|
23
|
-
name={name}
|
|
24
|
-
render={({ field }) => (
|
|
25
|
-
<div className="spage-y-1">
|
|
26
|
-
<FormItem className={cn('border-border-weak flex flex-row items-center justify-between rounded-lg border p-3 shadow-xs')}>
|
|
27
|
-
<div className="space-y-0.5">
|
|
28
|
-
<FormLabel className="cursor-pointer text-sm">{label}</FormLabel>
|
|
29
|
-
{description && <FormDescription className="text-xs">{description}</FormDescription>}
|
|
30
|
-
</div>
|
|
31
|
-
<FormControl>
|
|
32
|
-
<Switch checked={field.value} onCheckedChange={field.onChange} />
|
|
33
|
-
</FormControl>
|
|
34
|
-
</FormItem>
|
|
35
|
-
{isShowErrorMsg && <FormMessage />}
|
|
36
|
-
</div>
|
|
37
|
-
)}
|
|
38
|
-
/>
|
|
39
|
-
)
|
|
40
|
-
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
import { type FieldPath, type FieldValues, useWatch } from 'react-hook-form'
|
|
4
|
-
import { XIcon } from 'lucide-react'
|
|
5
|
-
|
|
6
|
-
import { cn } from '@/lib/utils'
|
|
7
|
-
|
|
8
|
-
import { Flex } from '../layouts/flex'
|
|
9
|
-
import { FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField } from '../ui/form'
|
|
10
|
-
import { Input } from '../ui/input'
|
|
11
|
-
|
|
12
|
-
type Props<TFieldValues extends FieldValues = FieldValues> = {
|
|
13
|
-
name: FieldPath<TFieldValues>
|
|
14
|
-
label?: string
|
|
15
|
-
description?: string
|
|
16
|
-
placeholder?: string
|
|
17
|
-
isShowLabel?: boolean
|
|
18
|
-
isShowClearButton?: boolean
|
|
19
|
-
isShowErrorMsg?: boolean
|
|
20
|
-
isShowCount?: boolean
|
|
21
|
-
className?: string
|
|
22
|
-
onValueChange?: (value: string) => void
|
|
23
|
-
}
|
|
24
|
-
export const TextField = <TFieldValues extends FieldValues = FieldValues>({
|
|
25
|
-
name,
|
|
26
|
-
label = 'Text Field',
|
|
27
|
-
placeholder = 'Enter text here',
|
|
28
|
-
isShowLabel = true,
|
|
29
|
-
isShowClearButton = false,
|
|
30
|
-
isShowErrorMsg = false,
|
|
31
|
-
isShowCount = false,
|
|
32
|
-
description,
|
|
33
|
-
className = '',
|
|
34
|
-
onValueChange,
|
|
35
|
-
}: Props<TFieldValues>) => {
|
|
36
|
-
const { resetField } = useFormField()
|
|
37
|
-
const valueWatch = useWatch({ name })
|
|
38
|
-
|
|
39
|
-
const handleClearInput = React.useCallback(() => {
|
|
40
|
-
resetField(name)
|
|
41
|
-
}, [resetField, name])
|
|
42
|
-
|
|
43
|
-
return (
|
|
44
|
-
<FormField
|
|
45
|
-
name={name}
|
|
46
|
-
render={({ field }) => (
|
|
47
|
-
<FormItem className={cn('w-full gap-0', isShowCount || (!!description && 'space-y-1'), className)}>
|
|
48
|
-
{isShowLabel && <FormLabel>{label}</FormLabel>}
|
|
49
|
-
<div className="relative">
|
|
50
|
-
<FormControl>
|
|
51
|
-
<Input {...field} placeholder={placeholder} className={cn('w-full', isShowClearButton && 'pr-9')} onValueChange={onValueChange} />
|
|
52
|
-
</FormControl>
|
|
53
|
-
{isShowClearButton && valueWatch && (
|
|
54
|
-
<button
|
|
55
|
-
type="button"
|
|
56
|
-
className="text-muted-foreground/80 hover:text-accent-foreground focus-visible:ring-border absolute inset-y-0 end-0 flex h-full w-8 cursor-pointer items-center justify-center rounded-e-md transition-[color,box-shadow] outline-none focus:z-10 focus-visible:ring-2"
|
|
57
|
-
aria-label="Clear input"
|
|
58
|
-
onClick={handleClearInput}
|
|
59
|
-
>
|
|
60
|
-
<XIcon size={14} aria-hidden="true" />
|
|
61
|
-
</button>
|
|
62
|
-
)}
|
|
63
|
-
</div>
|
|
64
|
-
<Flex width="full" padding="none" justify="end">
|
|
65
|
-
{isShowErrorMsg && <FormMessage className="grow" />}
|
|
66
|
-
{isShowCount && <div className="text-muted-foreground text-end text-xs">{valueWatch?.length ?? 0} characters</div>}
|
|
67
|
-
</Flex>
|
|
68
|
-
{!!description && <FormDescription>{description}</FormDescription>}
|
|
69
|
-
</FormItem>
|
|
70
|
-
)}
|
|
71
|
-
/>
|
|
72
|
-
)
|
|
73
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
import { type FieldPath, type FieldValues, useWatch } from 'react-hook-form'
|
|
3
|
-
|
|
4
|
-
import { FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage } from '../ui/form'
|
|
5
|
-
import { Textarea } from '../ui/textarea'
|
|
6
|
-
|
|
7
|
-
type Props<TFieldValues extends FieldValues = FieldValues> = {
|
|
8
|
-
name: FieldPath<TFieldValues>
|
|
9
|
-
label?: string
|
|
10
|
-
description?: string
|
|
11
|
-
placeholder?: string
|
|
12
|
-
isShowErrorMsg?: boolean
|
|
13
|
-
isShowCount?: boolean
|
|
14
|
-
rows?: number
|
|
15
|
-
onValueChange?: (value: string) => void
|
|
16
|
-
}
|
|
17
|
-
export const TextareaField = <TFieldValues extends FieldValues = FieldValues>({
|
|
18
|
-
name,
|
|
19
|
-
label = 'Textarea Field',
|
|
20
|
-
placeholder = 'Enter text here',
|
|
21
|
-
isShowErrorMsg = false,
|
|
22
|
-
isShowCount = false,
|
|
23
|
-
description,
|
|
24
|
-
rows = 3,
|
|
25
|
-
onValueChange,
|
|
26
|
-
}: Props<TFieldValues>) => {
|
|
27
|
-
const valueWatch = useWatch({ name })
|
|
28
|
-
|
|
29
|
-
return (
|
|
30
|
-
<FormField
|
|
31
|
-
name={name}
|
|
32
|
-
render={({ field }) => (
|
|
33
|
-
<FormItem className="w-full">
|
|
34
|
-
<FormLabel>{label}</FormLabel>
|
|
35
|
-
<FormControl>
|
|
36
|
-
<Textarea {...field} placeholder={placeholder} className="w-full" rows={rows} onValueChange={onValueChange} />
|
|
37
|
-
</FormControl>
|
|
38
|
-
{isShowCount && <div className="text-muted-foreground text-end text-xs">{valueWatch?.length ?? 0} characters</div>}
|
|
39
|
-
{!!description && <FormDescription>{description}</FormDescription>}
|
|
40
|
-
{isShowErrorMsg && <FormMessage />}
|
|
41
|
-
</FormItem>
|
|
42
|
-
)}
|
|
43
|
-
/>
|
|
44
|
-
)
|
|
45
|
-
}
|
|
File without changes
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { ShoppingCartIcon } from 'lucide-react'
|
|
3
|
-
|
|
4
|
-
import { cn } from '@/lib/utils'
|
|
5
|
-
|
|
6
|
-
import { Sidebar, SidebarInset, SidebarProvider, SidebarTrigger } from './sidebar'
|
|
7
|
-
|
|
8
|
-
export const AppLayoutWrapper: React.FC<React.PropsWithChildren> = ({ children }) => {
|
|
9
|
-
return <SidebarProvider>{children}</SidebarProvider>
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export const AppLayoutHeader: React.FC<React.PropsWithChildren> = ({ children }) => {
|
|
13
|
-
return (
|
|
14
|
-
<header
|
|
15
|
-
className={cn(
|
|
16
|
-
'bg-card',
|
|
17
|
-
'h-(--header-height)',
|
|
18
|
-
'absolute inset-x-0 top-0 z-20',
|
|
19
|
-
'shadow-nav flex items-center gap-2',
|
|
20
|
-
'transition-[width,height] ease-linear',
|
|
21
|
-
'group-has-data-[collapsible=icon]/sidebar-wrapper:h-(--header-height)',
|
|
22
|
-
'px-4',
|
|
23
|
-
)}
|
|
24
|
-
>
|
|
25
|
-
<SidebarTrigger />
|
|
26
|
-
|
|
27
|
-
<div className="ml-2.5 flex gap-x-2">
|
|
28
|
-
<div className="bg-sidebar-primary text-sidebar-primary-foreground flex aspect-square size-8 items-center justify-center rounded-lg">
|
|
29
|
-
<ShoppingCartIcon size={20} />
|
|
30
|
-
</div>
|
|
31
|
-
<div className="grid flex-1 text-left text-sm leading-tight">
|
|
32
|
-
<span className="truncate font-medium">Lunas Store</span>
|
|
33
|
-
<span className="truncate text-xs">Established 2023</span>
|
|
34
|
-
</div>
|
|
35
|
-
</div>
|
|
36
|
-
|
|
37
|
-
<div className="flex flex-1 items-center justify-end">{children}</div>
|
|
38
|
-
</header>
|
|
39
|
-
)
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export const AppLayoutSidebar: React.FC<React.PropsWithChildren & React.ComponentProps<typeof Sidebar>> = ({ children, ...props }) => {
|
|
43
|
-
return (
|
|
44
|
-
<Sidebar variant="inset" collapsible="icon" {...props}>
|
|
45
|
-
{children}
|
|
46
|
-
</Sidebar>
|
|
47
|
-
)
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export const AppLayoutMain: React.FC<React.PropsWithChildren> = ({ children }) => {
|
|
51
|
-
return (
|
|
52
|
-
<SidebarInset>
|
|
53
|
-
<section className="relative size-full">
|
|
54
|
-
<div className="absolute inset-0">{children}</div>
|
|
55
|
-
</section>
|
|
56
|
-
</SidebarInset>
|
|
57
|
-
)
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export const AppLayoutMainGroup: React.FC<React.PropsWithChildren<{ className?: string }>> = ({ children, className }) => {
|
|
61
|
-
return (
|
|
62
|
-
<div data-slot="main-group" className={cn('flex size-full flex-col gap-4 overflow-y-auto p-4', className)}>
|
|
63
|
-
{children}
|
|
64
|
-
</div>
|
|
65
|
-
)
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export const AppLayoutMainGroupContent: React.FC<React.PropsWithChildren> = ({ children }) => {
|
|
69
|
-
return (
|
|
70
|
-
<div data-slot="main-group-content" className="bg-card shadow-card size-full rounded-md p-4">
|
|
71
|
-
{children}
|
|
72
|
-
</div>
|
|
73
|
-
)
|
|
74
|
-
}
|