@customafk/lunas-ui 0.0.25 → 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,317 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
|
|
4
|
-
import { cn } from '@/lib/utils'
|
|
5
|
-
|
|
6
|
-
import { Input } from '../input'
|
|
7
|
-
|
|
8
|
-
const createValidationRegex = (allowNegative: boolean): RegExp => {
|
|
9
|
-
return allowNegative ? /^-?\d*\.?\d*$/ : /^\d*\.?\d*$/
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const formatNumberWithCommas = (num: number | string): string => {
|
|
13
|
-
return Number(num).toLocaleString()
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
interface IProps extends React.HTMLAttributes<HTMLInputElement> {
|
|
17
|
-
/**
|
|
18
|
-
* Description: Value for the text field
|
|
19
|
-
*
|
|
20
|
-
* Default: ''
|
|
21
|
-
*
|
|
22
|
-
* Usage: Value for the text field
|
|
23
|
-
*/
|
|
24
|
-
value?: string | number
|
|
25
|
-
/**
|
|
26
|
-
* Description: Disabled state of the text field
|
|
27
|
-
*
|
|
28
|
-
* Default: `false`
|
|
29
|
-
*
|
|
30
|
-
* Usage: Disabled state of the text field
|
|
31
|
-
*
|
|
32
|
-
* Note: If true, the text field will be disabled
|
|
33
|
-
*/
|
|
34
|
-
disabled?: boolean
|
|
35
|
-
/**
|
|
36
|
-
* Description: Readonly state of the text field
|
|
37
|
-
*
|
|
38
|
-
* Default: `false`
|
|
39
|
-
*
|
|
40
|
-
* Usage: Readonly state of the text field
|
|
41
|
-
*/
|
|
42
|
-
readonly?: boolean
|
|
43
|
-
/**
|
|
44
|
-
* Description: Allow negative value for the text field
|
|
45
|
-
*
|
|
46
|
-
* Default: `false`
|
|
47
|
-
*
|
|
48
|
-
* Usage: Allow negative value for the text field
|
|
49
|
-
*/
|
|
50
|
-
allowNegative?: boolean
|
|
51
|
-
/**
|
|
52
|
-
* Description: Decimal point for the text field
|
|
53
|
-
*
|
|
54
|
-
* Default: `undefined`
|
|
55
|
-
*
|
|
56
|
-
* Usage: Ex: [12,3] => console.log(2323.23) // True
|
|
57
|
-
*
|
|
58
|
-
* Note: IF use this prop, `numberAfterDecimalPoint` will be ignored
|
|
59
|
-
*/
|
|
60
|
-
decimal?: [number, number]
|
|
61
|
-
/**
|
|
62
|
-
* Description: Rounding rule for the text field
|
|
63
|
-
*
|
|
64
|
-
* Default: `nearest`
|
|
65
|
-
*
|
|
66
|
-
* Usage: Rounding rule for the text field
|
|
67
|
-
*/
|
|
68
|
-
roundingRule?: 'up' | 'down' | 'nearest' | 'none'
|
|
69
|
-
/**
|
|
70
|
-
* Description: Number of digits after the decimal point
|
|
71
|
-
*
|
|
72
|
-
* Default: `2`
|
|
73
|
-
*
|
|
74
|
-
* Usage: Number of digits after the decimal point
|
|
75
|
-
*/
|
|
76
|
-
numberAfterDecimalPoint?: number
|
|
77
|
-
/**
|
|
78
|
-
* Description: Placeholder for the text field
|
|
79
|
-
*
|
|
80
|
-
* Default: ''
|
|
81
|
-
*
|
|
82
|
-
* Usage: Placeholder for the text field
|
|
83
|
-
*/
|
|
84
|
-
placeholder?: string
|
|
85
|
-
/**
|
|
86
|
-
* Description: Unit text for the text field
|
|
87
|
-
*
|
|
88
|
-
* Default: ''
|
|
89
|
-
*
|
|
90
|
-
* E.g. 'kg', 'm', 'USD'...
|
|
91
|
-
*/
|
|
92
|
-
unitText?: string
|
|
93
|
-
/**
|
|
94
|
-
* Description: Invalid state of the text field
|
|
95
|
-
*
|
|
96
|
-
* Default: `false`
|
|
97
|
-
*
|
|
98
|
-
* Usage: Invalid state of the text field
|
|
99
|
-
*/
|
|
100
|
-
invalid?: boolean
|
|
101
|
-
/**
|
|
102
|
-
* Description: Precision for the text field
|
|
103
|
-
*
|
|
104
|
-
* Default: `undefined`
|
|
105
|
-
* E.g.
|
|
106
|
-
* - 2.13 => 2.1 when precision is 1
|
|
107
|
-
* - 2.134 => 2.13 when precision is 2
|
|
108
|
-
*/
|
|
109
|
-
precision?: number
|
|
110
|
-
/**
|
|
111
|
-
* Description: Callback function for the value change
|
|
112
|
-
* Usage: Callback function for the value change
|
|
113
|
-
*/
|
|
114
|
-
onValueChange?: (value?: number) => void
|
|
115
|
-
onBlur?: () => void
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* ## Unit Text Field Component
|
|
119
|
-
*
|
|
120
|
-
* **Description**: This component is to display common text field with unit
|
|
121
|
-
*
|
|
122
|
-
* **Usage**: Text field with unit example: 1000 (kg), 100 (m), 1000 (USD)...
|
|
123
|
-
*/
|
|
124
|
-
export const NumberInput: React.FC<IProps> = ({
|
|
125
|
-
disabled = false,
|
|
126
|
-
readonly = false,
|
|
127
|
-
allowNegative = false,
|
|
128
|
-
numberAfterDecimalPoint = 2,
|
|
129
|
-
roundingRule = 'none',
|
|
130
|
-
value: initialValue = '',
|
|
131
|
-
unitText,
|
|
132
|
-
decimal,
|
|
133
|
-
placeholder,
|
|
134
|
-
precision,
|
|
135
|
-
onChange,
|
|
136
|
-
onValueChange,
|
|
137
|
-
onBlur,
|
|
138
|
-
...props
|
|
139
|
-
}) => {
|
|
140
|
-
const _unitRef = React.useRef<HTMLSpanElement>(null)
|
|
141
|
-
const _inputRef = React.useRef<HTMLInputElement>(null)
|
|
142
|
-
|
|
143
|
-
const [value, setValue] = React.useState<string>(initialValue.toString())
|
|
144
|
-
|
|
145
|
-
// Memoized values for validation and formatting
|
|
146
|
-
const maxDecimalPlaces = decimal?.[1] ?? numberAfterDecimalPoint
|
|
147
|
-
const maxIntegerLength = decimal && decimal[0] - decimal[1]
|
|
148
|
-
const validationRegex = React.useMemo(() => createValidationRegex(allowNegative), [allowNegative])
|
|
149
|
-
|
|
150
|
-
// Validation functions
|
|
151
|
-
const isValidDecimalLength = React.useCallback(
|
|
152
|
-
(value: string): boolean => {
|
|
153
|
-
if (!maxDecimalPlaces && value.includes('.')) return false
|
|
154
|
-
const decimalPart = value.split('.')[1]
|
|
155
|
-
return !decimalPart || decimalPart.length <= maxDecimalPlaces
|
|
156
|
-
},
|
|
157
|
-
[maxDecimalPlaces],
|
|
158
|
-
)
|
|
159
|
-
const isValidFormat = React.useCallback(
|
|
160
|
-
(value: string): boolean => {
|
|
161
|
-
if (!decimal || value === '-') return true
|
|
162
|
-
const [integerPart, decimalPart = ''] = value.split('.')
|
|
163
|
-
|
|
164
|
-
return decimalPart.length <= decimal[1] && (integerPart.startsWith('-') ? integerPart.length - 1 : integerPart.length) <= maxIntegerLength!
|
|
165
|
-
},
|
|
166
|
-
[decimal, maxIntegerLength],
|
|
167
|
-
)
|
|
168
|
-
const customRoundedValue = React.useCallback(
|
|
169
|
-
(value: number, precision: number) => {
|
|
170
|
-
if (roundingRule === 'none') return value
|
|
171
|
-
|
|
172
|
-
const factor = Math.pow(10, precision)
|
|
173
|
-
const scaledValue = value * factor
|
|
174
|
-
|
|
175
|
-
switch (roundingRule) {
|
|
176
|
-
case 'up':
|
|
177
|
-
return Math.ceil(scaledValue) / factor
|
|
178
|
-
case 'down':
|
|
179
|
-
return Math.floor(scaledValue) / factor
|
|
180
|
-
case 'nearest': {
|
|
181
|
-
if (scaledValue % 1 < 0.1) return Math.floor(scaledValue) / factor
|
|
182
|
-
if (scaledValue % 1 >= 0.59) return Math.ceil(scaledValue) / factor
|
|
183
|
-
return (Math.floor(scaledValue) + 0.5) / factor
|
|
184
|
-
}
|
|
185
|
-
default:
|
|
186
|
-
return value
|
|
187
|
-
}
|
|
188
|
-
},
|
|
189
|
-
[roundingRule],
|
|
190
|
-
)
|
|
191
|
-
const isDecimalPointGreaterThanLimit = React.useCallback(
|
|
192
|
-
(value: string) => (!numberAfterDecimalPoint && value.includes('.')) || value.split('.')[1]?.length > numberAfterDecimalPoint,
|
|
193
|
-
[numberAfterDecimalPoint],
|
|
194
|
-
)
|
|
195
|
-
const formattedValue = React.useCallback(
|
|
196
|
-
(val: string) => {
|
|
197
|
-
if (val === '0') return '0'
|
|
198
|
-
if (!Number(val)) return ''
|
|
199
|
-
|
|
200
|
-
const numValue = parseFloat(val)
|
|
201
|
-
const effectivePrecision = Math.min(maxDecimalPlaces - 1, precision || 0)
|
|
202
|
-
const roundedValue = customRoundedValue(numValue, effectivePrecision).toString()
|
|
203
|
-
const [integerPart, decimalPart = ''] = roundedValue.split('.')
|
|
204
|
-
const formattedInteger = formatNumberWithCommas(integerPart)
|
|
205
|
-
return decimalPart ? `${formattedInteger}.${decimalPart}` : formattedInteger
|
|
206
|
-
},
|
|
207
|
-
[customRoundedValue, maxDecimalPlaces, precision],
|
|
208
|
-
)
|
|
209
|
-
// Validate decimal point is less than or equal to the limit
|
|
210
|
-
const validateDecimalPoint = React.useCallback(
|
|
211
|
-
(value: string) => {
|
|
212
|
-
if (!decimal || value === '-') return true
|
|
213
|
-
|
|
214
|
-
const [integerPart, decimalPart = ''] = value.split('.')
|
|
215
|
-
const integerLength = integerPart.startsWith('-') ? integerPart.length - 1 : integerPart.length
|
|
216
|
-
const maxIntegerLength = decimal[0] - decimal[1]
|
|
217
|
-
|
|
218
|
-
return decimalPart.length <= decimal[1] && integerLength <= maxIntegerLength
|
|
219
|
-
},
|
|
220
|
-
[decimal],
|
|
221
|
-
)
|
|
222
|
-
const handleChange = React.useCallback(
|
|
223
|
-
(e: React.ChangeEvent<HTMLInputElement>) => {
|
|
224
|
-
// Don't prevent default behavior of input change
|
|
225
|
-
onChange?.(e)
|
|
226
|
-
|
|
227
|
-
// Custom event handler for value change
|
|
228
|
-
const { value: inputValue } = e.target
|
|
229
|
-
|
|
230
|
-
// Handle empty input
|
|
231
|
-
if (!inputValue) {
|
|
232
|
-
onValueChange?.(undefined)
|
|
233
|
-
setValue('')
|
|
234
|
-
return
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
// Handle zero and negative zero
|
|
238
|
-
const isZero = inputValue === '0'
|
|
239
|
-
const isNegativeZero = inputValue === '-' && allowNegative
|
|
240
|
-
if (isZero || isNegativeZero) {
|
|
241
|
-
onValueChange?.(0)
|
|
242
|
-
setValue(inputValue)
|
|
243
|
-
return
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
// Validate input format
|
|
247
|
-
const isValid = validationRegex.test(inputValue) && isValidFormat(inputValue) && (decimal || isValidDecimalLength(inputValue))
|
|
248
|
-
if (!isValid) return
|
|
249
|
-
|
|
250
|
-
const numericValue = parseFloat(inputValue) || 0
|
|
251
|
-
onValueChange?.(numericValue)
|
|
252
|
-
setValue(inputValue)
|
|
253
|
-
},
|
|
254
|
-
[allowNegative, decimal, isValidDecimalLength, isValidFormat, onChange, onValueChange, validationRegex],
|
|
255
|
-
)
|
|
256
|
-
|
|
257
|
-
const handleFocus = React.useCallback(() => {
|
|
258
|
-
if (readonly) return
|
|
259
|
-
setValue((prev) => prev.replace(/,/g, '')) // Remove commas for easier editing
|
|
260
|
-
}, [readonly])
|
|
261
|
-
|
|
262
|
-
const handleBlur = React.useCallback(() => {
|
|
263
|
-
if (readonly) return
|
|
264
|
-
onBlur?.()
|
|
265
|
-
setValue((prev) => formattedValue(prev))
|
|
266
|
-
}, [readonly, onBlur, formattedValue])
|
|
267
|
-
|
|
268
|
-
// Set initial value
|
|
269
|
-
React.useEffect(() => {
|
|
270
|
-
const isFocused = document.activeElement === _inputRef.current
|
|
271
|
-
|
|
272
|
-
if (
|
|
273
|
-
!initialValue ||
|
|
274
|
-
!validationRegex.test(initialValue.toString()) ||
|
|
275
|
-
!validateDecimalPoint(initialValue.toString()) ||
|
|
276
|
-
(!decimal && isDecimalPointGreaterThanLimit(initialValue.toString()))
|
|
277
|
-
) {
|
|
278
|
-
setValue('')
|
|
279
|
-
return
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
setValue((prev) => {
|
|
283
|
-
if (prev === '-') return '-'
|
|
284
|
-
if (!prev) return ''
|
|
285
|
-
return isFocused ? initialValue.toString() : formattedValue(initialValue.toString())
|
|
286
|
-
})
|
|
287
|
-
}, [decimal, formattedValue, initialValue, isDecimalPointGreaterThanLimit, validateDecimalPoint, validationRegex])
|
|
288
|
-
|
|
289
|
-
// Set padding right for the input field
|
|
290
|
-
React.useEffect(() => {
|
|
291
|
-
if (!_unitRef.current || !_inputRef.current || !unitText) return
|
|
292
|
-
const unitWidth = _unitRef.current.offsetWidth
|
|
293
|
-
_inputRef.current.style.setProperty('padding-right', `${(unitWidth + 8) / 16}rem`)
|
|
294
|
-
}, [disabled, unitText])
|
|
295
|
-
|
|
296
|
-
return (
|
|
297
|
-
<div className="relative">
|
|
298
|
-
<Input
|
|
299
|
-
{...props}
|
|
300
|
-
ref={_inputRef}
|
|
301
|
-
value={value || (readonly ? '0' : '')}
|
|
302
|
-
placeholder={placeholder}
|
|
303
|
-
disabled={disabled}
|
|
304
|
-
readOnly={readonly}
|
|
305
|
-
className={cn('font-number text-end', readonly && 'bg-muted text-muted-foreground')}
|
|
306
|
-
onChange={handleChange}
|
|
307
|
-
onFocus={handleFocus}
|
|
308
|
-
onBlur={handleBlur}
|
|
309
|
-
/>
|
|
310
|
-
{unitText && (
|
|
311
|
-
<span ref={_unitRef} className="text-muted-foreground pointer-events-none absolute top-1/2 right-2 -translate-y-1/2 text-sm">
|
|
312
|
-
{unitText}
|
|
313
|
-
</span>
|
|
314
|
-
)}
|
|
315
|
-
</div>
|
|
316
|
-
)
|
|
317
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
import { EyeIcon, EyeOffIcon } from 'lucide-react'
|
|
4
|
-
|
|
5
|
-
import { cn } from '@/lib/utils'
|
|
6
|
-
|
|
7
|
-
import { Input } from '../input'
|
|
8
|
-
|
|
9
|
-
type Props = React.ComponentPropsWithoutRef<typeof Input>
|
|
10
|
-
export const PasswordInput: React.FC<Props> = ({ className, ...rest }) => {
|
|
11
|
-
const id = React.useId()
|
|
12
|
-
const [isVisible, setIsVisible] = React.useState<boolean>(false)
|
|
13
|
-
const toggleVisibility = React.useCallback(() => setIsVisible((prevState) => !prevState), [])
|
|
14
|
-
return (
|
|
15
|
-
<div className="relative">
|
|
16
|
-
<Input {...rest} id={id} placeholder="Password" type={isVisible ? 'text' : 'password'} className={cn('pe-9', className)} />
|
|
17
|
-
<button
|
|
18
|
-
className="text-muted-foreground/80 hover:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 absolute inset-y-0 end-0 flex h-full w-9 items-center justify-center rounded-e-md transition-[color,box-shadow] outline-none focus:z-10 focus-visible:ring-[3px] disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50"
|
|
19
|
-
type="button"
|
|
20
|
-
onClick={toggleVisibility}
|
|
21
|
-
aria-label={isVisible ? 'Hide password' : 'Show password'}
|
|
22
|
-
aria-pressed={isVisible}
|
|
23
|
-
aria-controls="password"
|
|
24
|
-
>
|
|
25
|
-
{isVisible ? <EyeOffIcon size={16} aria-hidden="true" /> : <EyeIcon size={16} aria-hidden="true" />}
|
|
26
|
-
</button>
|
|
27
|
-
</div>
|
|
28
|
-
)
|
|
29
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { ArrowRightIcon, SearchIcon } from 'lucide-react'
|
|
2
|
-
|
|
3
|
-
import { cn } from '@/lib/utils'
|
|
4
|
-
|
|
5
|
-
import { Input } from '../input'
|
|
6
|
-
|
|
7
|
-
type Props = React.ComponentPropsWithoutRef<typeof Input>
|
|
8
|
-
export const SearchInput = ({ className, ...rest }: Props) => {
|
|
9
|
-
return (
|
|
10
|
-
<div className="relative">
|
|
11
|
-
<Input {...rest} type="search" className={cn('ps-9 pe-9', className)} />
|
|
12
|
-
<div className="text-muted-foreground/80 pointer-events-none absolute inset-y-0 start-0 flex items-center justify-center ps-3 peer-disabled:opacity-50">
|
|
13
|
-
<SearchIcon size={16} />
|
|
14
|
-
</div>
|
|
15
|
-
<button
|
|
16
|
-
className="text-muted-foreground/80 hover:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 absolute inset-y-0 end-0 flex h-full w-9 items-center justify-center rounded-e-md transition-[color,box-shadow] outline-none focus:z-10 focus-visible:ring-[3px] disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50"
|
|
17
|
-
aria-label="Submit search"
|
|
18
|
-
type="submit"
|
|
19
|
-
>
|
|
20
|
-
<ArrowRightIcon size={16} aria-hidden="true" />
|
|
21
|
-
</button>
|
|
22
|
-
</div>
|
|
23
|
-
)
|
|
24
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
import { Label as LabelPrimitive } from 'radix-ui'
|
|
4
|
-
|
|
5
|
-
import { cn } from '@/lib/utils'
|
|
6
|
-
|
|
7
|
-
function Label({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>) {
|
|
8
|
-
return (
|
|
9
|
-
<LabelPrimitive.Root
|
|
10
|
-
data-slot="label"
|
|
11
|
-
className={cn(
|
|
12
|
-
'text-text-positive',
|
|
13
|
-
'flex items-center gap-2',
|
|
14
|
-
'text-sm leading-none font-medium select-none',
|
|
15
|
-
'group-data-[disabled=true]:pointer-events-none',
|
|
16
|
-
'group-data-[disabled=true]:opacity-50',
|
|
17
|
-
'peer-disabled:cursor-not-allowed',
|
|
18
|
-
'peer-disabled:opacity-50',
|
|
19
|
-
className,
|
|
20
|
-
)}
|
|
21
|
-
{...props}
|
|
22
|
-
/>
|
|
23
|
-
)
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export { Label }
|
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
import { Menubar as MenubarPrimitive } from 'radix-ui'
|
|
4
|
-
import { CheckIcon, ChevronRightIcon, CircleIcon } from 'lucide-react'
|
|
5
|
-
|
|
6
|
-
import { cn } from '@/lib/utils'
|
|
7
|
-
|
|
8
|
-
function Menubar({ className, ...props }: React.ComponentProps<typeof MenubarPrimitive.Root>) {
|
|
9
|
-
return (
|
|
10
|
-
<MenubarPrimitive.Root
|
|
11
|
-
data-slot="menubar"
|
|
12
|
-
className={cn('bg-background flex h-9 items-center gap-1 rounded-md border p-1 shadow-xs', className)}
|
|
13
|
-
{...props}
|
|
14
|
-
/>
|
|
15
|
-
)
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function MenubarMenu({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Menu>) {
|
|
19
|
-
return <MenubarPrimitive.Menu data-slot="menubar-menu" {...props} />
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function MenubarGroup({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Group>) {
|
|
23
|
-
return <MenubarPrimitive.Group data-slot="menubar-group" {...props} />
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
function MenubarPortal({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Portal>) {
|
|
27
|
-
return <MenubarPrimitive.Portal data-slot="menubar-portal" {...props} />
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function MenubarRadioGroup({ ...props }: React.ComponentProps<typeof MenubarPrimitive.RadioGroup>) {
|
|
31
|
-
return <MenubarPrimitive.RadioGroup data-slot="menubar-radio-group" {...props} />
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function MenubarTrigger({ className, ...props }: React.ComponentProps<typeof MenubarPrimitive.Trigger>) {
|
|
35
|
-
return (
|
|
36
|
-
<MenubarPrimitive.Trigger
|
|
37
|
-
data-slot="menubar-trigger"
|
|
38
|
-
className={cn(
|
|
39
|
-
'focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex items-center rounded-sm px-2 py-1 text-sm font-medium outline-hidden select-none',
|
|
40
|
-
className,
|
|
41
|
-
)}
|
|
42
|
-
{...props}
|
|
43
|
-
/>
|
|
44
|
-
)
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function MenubarContent({ className, align = 'start', alignOffset = -4, sideOffset = 8, ...props }: React.ComponentProps<typeof MenubarPrimitive.Content>) {
|
|
48
|
-
return (
|
|
49
|
-
<MenubarPortal>
|
|
50
|
-
<MenubarPrimitive.Content
|
|
51
|
-
data-slot="menubar-content"
|
|
52
|
-
align={align}
|
|
53
|
-
alignOffset={alignOffset}
|
|
54
|
-
sideOffset={sideOffset}
|
|
55
|
-
className={cn(
|
|
56
|
-
'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[12rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-md',
|
|
57
|
-
className,
|
|
58
|
-
)}
|
|
59
|
-
{...props}
|
|
60
|
-
/>
|
|
61
|
-
</MenubarPortal>
|
|
62
|
-
)
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
function MenubarItem({
|
|
66
|
-
className,
|
|
67
|
-
inset,
|
|
68
|
-
variant = 'default',
|
|
69
|
-
...props
|
|
70
|
-
}: React.ComponentProps<typeof MenubarPrimitive.Item> & {
|
|
71
|
-
inset?: boolean
|
|
72
|
-
variant?: 'default' | 'destructive'
|
|
73
|
-
}) {
|
|
74
|
-
return (
|
|
75
|
-
<MenubarPrimitive.Item
|
|
76
|
-
data-slot="menubar-item"
|
|
77
|
-
data-inset={inset}
|
|
78
|
-
data-variant={variant}
|
|
79
|
-
className={cn(
|
|
80
|
-
"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
81
|
-
className,
|
|
82
|
-
)}
|
|
83
|
-
{...props}
|
|
84
|
-
/>
|
|
85
|
-
)
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
function MenubarCheckboxItem({ className, children, checked, ...props }: React.ComponentProps<typeof MenubarPrimitive.CheckboxItem>) {
|
|
89
|
-
return (
|
|
90
|
-
<MenubarPrimitive.CheckboxItem
|
|
91
|
-
data-slot="menubar-checkbox-item"
|
|
92
|
-
className={cn(
|
|
93
|
-
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
94
|
-
className,
|
|
95
|
-
)}
|
|
96
|
-
checked={checked}
|
|
97
|
-
{...props}
|
|
98
|
-
>
|
|
99
|
-
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
|
100
|
-
<MenubarPrimitive.ItemIndicator>
|
|
101
|
-
<CheckIcon className="size-4" />
|
|
102
|
-
</MenubarPrimitive.ItemIndicator>
|
|
103
|
-
</span>
|
|
104
|
-
{children}
|
|
105
|
-
</MenubarPrimitive.CheckboxItem>
|
|
106
|
-
)
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
function MenubarRadioItem({ className, children, ...props }: React.ComponentProps<typeof MenubarPrimitive.RadioItem>) {
|
|
110
|
-
return (
|
|
111
|
-
<MenubarPrimitive.RadioItem
|
|
112
|
-
data-slot="menubar-radio-item"
|
|
113
|
-
className={cn(
|
|
114
|
-
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
115
|
-
className,
|
|
116
|
-
)}
|
|
117
|
-
{...props}
|
|
118
|
-
>
|
|
119
|
-
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
|
120
|
-
<MenubarPrimitive.ItemIndicator>
|
|
121
|
-
<CircleIcon className="size-2 fill-current" />
|
|
122
|
-
</MenubarPrimitive.ItemIndicator>
|
|
123
|
-
</span>
|
|
124
|
-
{children}
|
|
125
|
-
</MenubarPrimitive.RadioItem>
|
|
126
|
-
)
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
function MenubarLabel({
|
|
130
|
-
className,
|
|
131
|
-
inset,
|
|
132
|
-
...props
|
|
133
|
-
}: React.ComponentProps<typeof MenubarPrimitive.Label> & {
|
|
134
|
-
inset?: boolean
|
|
135
|
-
}) {
|
|
136
|
-
return (
|
|
137
|
-
<MenubarPrimitive.Label
|
|
138
|
-
data-slot="menubar-label"
|
|
139
|
-
data-inset={inset}
|
|
140
|
-
className={cn('px-2 py-1.5 text-sm font-medium data-[inset]:pl-8', className)}
|
|
141
|
-
{...props}
|
|
142
|
-
/>
|
|
143
|
-
)
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
function MenubarSeparator({ className, ...props }: React.ComponentProps<typeof MenubarPrimitive.Separator>) {
|
|
147
|
-
return <MenubarPrimitive.Separator data-slot="menubar-separator" className={cn('bg-border -mx-1 my-1 h-px', className)} {...props} />
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
function MenubarShortcut({ className, ...props }: React.ComponentProps<'span'>) {
|
|
151
|
-
return <span data-slot="menubar-shortcut" className={cn('text-muted-foreground ml-auto text-xs tracking-widest', className)} {...props} />
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
function MenubarSub({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Sub>) {
|
|
155
|
-
return <MenubarPrimitive.Sub data-slot="menubar-sub" {...props} />
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
function MenubarSubTrigger({
|
|
159
|
-
className,
|
|
160
|
-
inset,
|
|
161
|
-
children,
|
|
162
|
-
...props
|
|
163
|
-
}: React.ComponentProps<typeof MenubarPrimitive.SubTrigger> & {
|
|
164
|
-
inset?: boolean
|
|
165
|
-
}) {
|
|
166
|
-
return (
|
|
167
|
-
<MenubarPrimitive.SubTrigger
|
|
168
|
-
data-slot="menubar-sub-trigger"
|
|
169
|
-
data-inset={inset}
|
|
170
|
-
className={cn(
|
|
171
|
-
'focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[inset]:pl-8',
|
|
172
|
-
className,
|
|
173
|
-
)}
|
|
174
|
-
{...props}
|
|
175
|
-
>
|
|
176
|
-
{children}
|
|
177
|
-
<ChevronRightIcon className="ml-auto h-4 w-4" />
|
|
178
|
-
</MenubarPrimitive.SubTrigger>
|
|
179
|
-
)
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
function MenubarSubContent({ className, ...props }: React.ComponentProps<typeof MenubarPrimitive.SubContent>) {
|
|
183
|
-
return (
|
|
184
|
-
<MenubarPrimitive.SubContent
|
|
185
|
-
data-slot="menubar-sub-content"
|
|
186
|
-
className={cn(
|
|
187
|
-
'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg',
|
|
188
|
-
className,
|
|
189
|
-
)}
|
|
190
|
-
{...props}
|
|
191
|
-
/>
|
|
192
|
-
)
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
export {
|
|
196
|
-
Menubar,
|
|
197
|
-
MenubarCheckboxItem,
|
|
198
|
-
MenubarContent,
|
|
199
|
-
MenubarGroup,
|
|
200
|
-
MenubarItem,
|
|
201
|
-
MenubarLabel,
|
|
202
|
-
MenubarMenu,
|
|
203
|
-
MenubarPortal,
|
|
204
|
-
MenubarRadioGroup,
|
|
205
|
-
MenubarRadioItem,
|
|
206
|
-
MenubarSeparator,
|
|
207
|
-
MenubarShortcut,
|
|
208
|
-
MenubarSub,
|
|
209
|
-
MenubarSubContent,
|
|
210
|
-
MenubarSubTrigger,
|
|
211
|
-
MenubarTrigger,
|
|
212
|
-
}
|