@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,141 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from 'lucide-react'
|
|
4
|
-
import { DayButton, DayPicker, getDefaultClassNames } from 'react-day-picker'
|
|
5
|
-
|
|
6
|
-
import { Button, buttonVariants } from '@/components/ui/button'
|
|
7
|
-
import { cn } from '@/lib/utils'
|
|
8
|
-
|
|
9
|
-
function Calendar({
|
|
10
|
-
className,
|
|
11
|
-
classNames,
|
|
12
|
-
showOutsideDays = true,
|
|
13
|
-
captionLayout = 'label',
|
|
14
|
-
buttonVariant = 'ghost',
|
|
15
|
-
formatters,
|
|
16
|
-
components,
|
|
17
|
-
...props
|
|
18
|
-
}: React.ComponentProps<typeof DayPicker> & {
|
|
19
|
-
buttonVariant?: React.ComponentProps<typeof Button>['variant']
|
|
20
|
-
}) {
|
|
21
|
-
const defaultClassNames = getDefaultClassNames()
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
<DayPicker
|
|
25
|
-
showOutsideDays={showOutsideDays}
|
|
26
|
-
className={cn(
|
|
27
|
-
'bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent',
|
|
28
|
-
String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
|
|
29
|
-
String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
|
|
30
|
-
className,
|
|
31
|
-
)}
|
|
32
|
-
captionLayout={captionLayout}
|
|
33
|
-
formatters={{
|
|
34
|
-
formatMonthDropdown: (date) => date.toLocaleString('default', { month: 'short' }),
|
|
35
|
-
...formatters,
|
|
36
|
-
}}
|
|
37
|
-
classNames={{
|
|
38
|
-
root: cn('w-fit', defaultClassNames.root),
|
|
39
|
-
months: cn('flex gap-4 flex-col md:flex-row relative', defaultClassNames.months),
|
|
40
|
-
month: cn('flex flex-col w-full gap-4', defaultClassNames.month),
|
|
41
|
-
nav: cn('flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between', defaultClassNames.nav),
|
|
42
|
-
button_previous: cn(
|
|
43
|
-
buttonVariants({ variant: buttonVariant }),
|
|
44
|
-
'size-(--cell-size) aria-disabled:opacity-50 p-0 select-none',
|
|
45
|
-
defaultClassNames.button_previous,
|
|
46
|
-
),
|
|
47
|
-
button_next: cn(
|
|
48
|
-
buttonVariants({ variant: buttonVariant }),
|
|
49
|
-
'size-(--cell-size) aria-disabled:opacity-50 p-0 select-none',
|
|
50
|
-
defaultClassNames.button_next,
|
|
51
|
-
),
|
|
52
|
-
month_caption: cn('flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)', defaultClassNames.month_caption),
|
|
53
|
-
dropdowns: cn('w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5', defaultClassNames.dropdowns),
|
|
54
|
-
dropdown_root: cn(
|
|
55
|
-
'relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md',
|
|
56
|
-
defaultClassNames.dropdown_root,
|
|
57
|
-
),
|
|
58
|
-
dropdown: cn('absolute inset-0 opacity-0', defaultClassNames.dropdown),
|
|
59
|
-
caption_label: cn(
|
|
60
|
-
'select-none font-medium',
|
|
61
|
-
captionLayout === 'label' ? 'text-sm' : 'rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5',
|
|
62
|
-
defaultClassNames.caption_label,
|
|
63
|
-
),
|
|
64
|
-
table: 'w-full border-collapse',
|
|
65
|
-
weekdays: cn('flex', defaultClassNames.weekdays),
|
|
66
|
-
weekday: cn('text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none', defaultClassNames.weekday),
|
|
67
|
-
week: cn('flex w-full mt-2', defaultClassNames.week),
|
|
68
|
-
week_number_header: cn('select-none w-(--cell-size)', defaultClassNames.week_number_header),
|
|
69
|
-
week_number: cn('text-[0.8rem] select-none text-muted-foreground', defaultClassNames.week_number),
|
|
70
|
-
day: cn(
|
|
71
|
-
'relative w-full h-full p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none',
|
|
72
|
-
defaultClassNames.day,
|
|
73
|
-
),
|
|
74
|
-
range_start: cn('rounded-l-md bg-accent', defaultClassNames.range_start),
|
|
75
|
-
range_middle: cn('rounded-none', defaultClassNames.range_middle),
|
|
76
|
-
range_end: cn('rounded-r-md bg-accent', defaultClassNames.range_end),
|
|
77
|
-
today: cn('bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none', defaultClassNames.today),
|
|
78
|
-
outside: cn('text-muted-foreground aria-selected:text-muted-foreground', defaultClassNames.outside),
|
|
79
|
-
disabled: cn('text-muted-foreground opacity-50', defaultClassNames.disabled),
|
|
80
|
-
hidden: cn('invisible', defaultClassNames.hidden),
|
|
81
|
-
...classNames,
|
|
82
|
-
}}
|
|
83
|
-
components={{
|
|
84
|
-
Root: ({ className, rootRef, ...props }) => {
|
|
85
|
-
return <div data-slot="calendar" ref={rootRef} className={cn(className)} {...props} />
|
|
86
|
-
},
|
|
87
|
-
Chevron: ({ className, orientation, ...props }) => {
|
|
88
|
-
if (orientation === 'left') {
|
|
89
|
-
return <ChevronLeftIcon className={cn('size-4', className)} {...props} />
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
if (orientation === 'right') {
|
|
93
|
-
return <ChevronRightIcon className={cn('size-4', className)} {...props} />
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
return <ChevronDownIcon className={cn('size-4', className)} {...props} />
|
|
97
|
-
},
|
|
98
|
-
DayButton: CalendarDayButton,
|
|
99
|
-
WeekNumber: ({ children, ...props }) => {
|
|
100
|
-
return (
|
|
101
|
-
<td {...props}>
|
|
102
|
-
<div className="flex size-(--cell-size) items-center justify-center text-center">{children}</div>
|
|
103
|
-
</td>
|
|
104
|
-
)
|
|
105
|
-
},
|
|
106
|
-
...components,
|
|
107
|
-
}}
|
|
108
|
-
{...props}
|
|
109
|
-
/>
|
|
110
|
-
)
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
function CalendarDayButton({ className, day, modifiers, ...props }: React.ComponentProps<typeof DayButton>) {
|
|
114
|
-
const defaultClassNames = getDefaultClassNames()
|
|
115
|
-
|
|
116
|
-
const ref = React.useRef<HTMLButtonElement>(null)
|
|
117
|
-
React.useEffect(() => {
|
|
118
|
-
if (modifiers.focused) ref.current?.focus()
|
|
119
|
-
}, [modifiers.focused])
|
|
120
|
-
|
|
121
|
-
return (
|
|
122
|
-
<Button
|
|
123
|
-
ref={ref}
|
|
124
|
-
variant="ghost"
|
|
125
|
-
size="icon"
|
|
126
|
-
data-day={day.date.toLocaleDateString()}
|
|
127
|
-
data-selected-single={modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle}
|
|
128
|
-
data-range-start={modifiers.range_start}
|
|
129
|
-
data-range-end={modifiers.range_end}
|
|
130
|
-
data-range-middle={modifiers.range_middle}
|
|
131
|
-
className={cn(
|
|
132
|
-
'data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70',
|
|
133
|
-
defaultClassNames.day,
|
|
134
|
-
className,
|
|
135
|
-
)}
|
|
136
|
-
{...props}
|
|
137
|
-
/>
|
|
138
|
-
)
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
export { Calendar, CalendarDayButton }
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { cn } from '@/lib/utils'
|
|
2
|
-
|
|
3
|
-
function Card({ className, ...props }: React.ComponentProps<'div'>) {
|
|
4
|
-
return <div data-slot="card" className={cn('bg-card text-text-positive shadow-card flex flex-col gap-6 rounded-2xl py-6', className)} {...props} />
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
function CardHeader({ className, ...props }: React.ComponentProps<'div'>) {
|
|
8
|
-
return (
|
|
9
|
-
<div
|
|
10
|
-
data-slot="card-header"
|
|
11
|
-
className={cn(
|
|
12
|
-
'@container/card-header',
|
|
13
|
-
'grid auto-rows-min grid-rows-[auto_auto]',
|
|
14
|
-
'text-text-positive-strong items-start gap-1.5 px-6',
|
|
15
|
-
'has-data-[slot=card-action]:grid-cols-[1fr_auto]',
|
|
16
|
-
'[.border-b]:pb-6',
|
|
17
|
-
className,
|
|
18
|
-
)}
|
|
19
|
-
{...props}
|
|
20
|
-
/>
|
|
21
|
-
)
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function CardTitle({ className, ...props }: React.ComponentProps<'div'>) {
|
|
25
|
-
return <div data-slot="card-title" className={cn('leading-none font-semibold', className)} {...props} />
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function CardDescription({ className, ...props }: React.ComponentProps<'div'>) {
|
|
29
|
-
return <div data-slot="card-description" className={cn('text-text-positive-muted text-sm', className)} {...props} />
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function CardAction({ className, ...props }: React.ComponentProps<'div'>) {
|
|
33
|
-
return <div data-slot="card-action" className={cn('col-start-2 row-span-2 row-start-1 self-start justify-self-end', className)} {...props} />
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function CardContent({ className, ...props }: React.ComponentProps<'div'>) {
|
|
37
|
-
return <div data-slot="card-content" className={cn('px-6 text-sm', className)} {...props} />
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function CardFooter({ className, ...props }: React.ComponentProps<'div'>) {
|
|
41
|
-
return <div data-slot="card-footer" className={cn('flex items-center px-6 text-sm [.border-t]:pt-6', className)} {...props} />
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle }
|
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
import { ArrowLeft, ArrowRight } from 'lucide-react'
|
|
4
|
-
|
|
5
|
-
import { Button } from '@/components/ui/button'
|
|
6
|
-
import { cn } from '@/lib/utils'
|
|
7
|
-
|
|
8
|
-
import useEmblaCarousel, { type UseEmblaCarouselType } from 'embla-carousel-react'
|
|
9
|
-
|
|
10
|
-
type CarouselApi = UseEmblaCarouselType[1]
|
|
11
|
-
type UseCarouselParameters = Parameters<typeof useEmblaCarousel>
|
|
12
|
-
type CarouselOptions = UseCarouselParameters[0]
|
|
13
|
-
type CarouselPlugin = UseCarouselParameters[1]
|
|
14
|
-
|
|
15
|
-
type CarouselProps = {
|
|
16
|
-
opts?: CarouselOptions
|
|
17
|
-
plugins?: CarouselPlugin
|
|
18
|
-
orientation?: 'horizontal' | 'vertical'
|
|
19
|
-
setApi?: (api: CarouselApi) => void
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
type CarouselContextProps = {
|
|
23
|
-
carouselRef: ReturnType<typeof useEmblaCarousel>[0]
|
|
24
|
-
api: ReturnType<typeof useEmblaCarousel>[1]
|
|
25
|
-
scrollPrev: () => void
|
|
26
|
-
scrollNext: () => void
|
|
27
|
-
canScrollPrev: boolean
|
|
28
|
-
canScrollNext: boolean
|
|
29
|
-
} & CarouselProps
|
|
30
|
-
|
|
31
|
-
const CarouselContext = React.createContext<CarouselContextProps | null>(null)
|
|
32
|
-
|
|
33
|
-
function useCarousel() {
|
|
34
|
-
const context = React.useContext(CarouselContext)
|
|
35
|
-
|
|
36
|
-
if (!context) {
|
|
37
|
-
throw new Error('useCarousel must be used within a <Carousel />')
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return context
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function Carousel({ orientation = 'horizontal', opts, setApi, plugins, className, children, ...props }: React.ComponentProps<'div'> & CarouselProps) {
|
|
44
|
-
const [carouselRef, api] = useEmblaCarousel(
|
|
45
|
-
{
|
|
46
|
-
...opts,
|
|
47
|
-
axis: orientation === 'horizontal' ? 'x' : 'y',
|
|
48
|
-
},
|
|
49
|
-
plugins,
|
|
50
|
-
)
|
|
51
|
-
const [canScrollPrev, setCanScrollPrev] = React.useState(false)
|
|
52
|
-
const [canScrollNext, setCanScrollNext] = React.useState(false)
|
|
53
|
-
|
|
54
|
-
const onSelect = React.useCallback((api: CarouselApi) => {
|
|
55
|
-
if (!api) return
|
|
56
|
-
setCanScrollPrev(api.canScrollPrev())
|
|
57
|
-
setCanScrollNext(api.canScrollNext())
|
|
58
|
-
}, [])
|
|
59
|
-
|
|
60
|
-
const scrollPrev = React.useCallback(() => {
|
|
61
|
-
api?.scrollPrev()
|
|
62
|
-
}, [api])
|
|
63
|
-
|
|
64
|
-
const scrollNext = React.useCallback(() => {
|
|
65
|
-
api?.scrollNext()
|
|
66
|
-
}, [api])
|
|
67
|
-
|
|
68
|
-
const handleKeyDown = React.useCallback(
|
|
69
|
-
(event: React.KeyboardEvent<HTMLDivElement>) => {
|
|
70
|
-
if (event.key === 'ArrowLeft') {
|
|
71
|
-
event.preventDefault()
|
|
72
|
-
scrollPrev()
|
|
73
|
-
} else if (event.key === 'ArrowRight') {
|
|
74
|
-
event.preventDefault()
|
|
75
|
-
scrollNext()
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
[scrollPrev, scrollNext],
|
|
79
|
-
)
|
|
80
|
-
|
|
81
|
-
React.useEffect(() => {
|
|
82
|
-
if (!api || !setApi) return
|
|
83
|
-
setApi(api)
|
|
84
|
-
}, [api, setApi])
|
|
85
|
-
|
|
86
|
-
React.useEffect(() => {
|
|
87
|
-
if (!api) return
|
|
88
|
-
onSelect(api)
|
|
89
|
-
api.on('reInit', onSelect)
|
|
90
|
-
api.on('select', onSelect)
|
|
91
|
-
|
|
92
|
-
return () => {
|
|
93
|
-
api?.off('select', onSelect)
|
|
94
|
-
}
|
|
95
|
-
}, [api, onSelect])
|
|
96
|
-
|
|
97
|
-
return (
|
|
98
|
-
<CarouselContext.Provider
|
|
99
|
-
value={{
|
|
100
|
-
carouselRef,
|
|
101
|
-
api: api,
|
|
102
|
-
opts,
|
|
103
|
-
orientation: orientation || (opts?.axis === 'y' ? 'vertical' : 'horizontal'),
|
|
104
|
-
scrollPrev,
|
|
105
|
-
scrollNext,
|
|
106
|
-
canScrollPrev,
|
|
107
|
-
canScrollNext,
|
|
108
|
-
}}
|
|
109
|
-
>
|
|
110
|
-
<div onKeyDownCapture={handleKeyDown} className={cn('relative', className)} role="region" aria-roledescription="carousel" data-slot="carousel" {...props}>
|
|
111
|
-
{children}
|
|
112
|
-
</div>
|
|
113
|
-
</CarouselContext.Provider>
|
|
114
|
-
)
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
function CarouselContent({ className, ...props }: React.ComponentProps<'div'>) {
|
|
118
|
-
const { carouselRef, orientation } = useCarousel()
|
|
119
|
-
|
|
120
|
-
return (
|
|
121
|
-
<div ref={carouselRef} className="overflow-hidden" data-slot="carousel-content">
|
|
122
|
-
<div className={cn('flex', orientation === 'horizontal' ? '-ml-4' : '-mt-4 flex-col', className)} {...props} />
|
|
123
|
-
</div>
|
|
124
|
-
)
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
function CarouselItem({ className, ...props }: React.ComponentProps<'div'>) {
|
|
128
|
-
const { orientation } = useCarousel()
|
|
129
|
-
|
|
130
|
-
return (
|
|
131
|
-
<div
|
|
132
|
-
role="group"
|
|
133
|
-
aria-roledescription="slide"
|
|
134
|
-
data-slot="carousel-item"
|
|
135
|
-
className={cn('min-w-0 shrink-0 grow-0 basis-full', orientation === 'horizontal' ? 'pl-4' : 'pt-4', className)}
|
|
136
|
-
{...props}
|
|
137
|
-
/>
|
|
138
|
-
)
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
function CarouselPrevious({ className, variant = 'outline', size = 'icon', ...props }: React.ComponentProps<typeof Button>) {
|
|
142
|
-
const { orientation, scrollPrev, canScrollPrev } = useCarousel()
|
|
143
|
-
|
|
144
|
-
return (
|
|
145
|
-
<Button
|
|
146
|
-
data-slot="carousel-previous"
|
|
147
|
-
variant={variant}
|
|
148
|
-
size={size}
|
|
149
|
-
className={cn(
|
|
150
|
-
'absolute size-8 rounded-full',
|
|
151
|
-
orientation === 'horizontal' ? 'top-1/2 -left-12 -translate-y-1/2' : '-top-12 left-1/2 -translate-x-1/2 rotate-90',
|
|
152
|
-
className,
|
|
153
|
-
)}
|
|
154
|
-
disabled={!canScrollPrev}
|
|
155
|
-
onClick={scrollPrev}
|
|
156
|
-
{...props}
|
|
157
|
-
>
|
|
158
|
-
<ArrowLeft />
|
|
159
|
-
<span className="sr-only">Previous slide</span>
|
|
160
|
-
</Button>
|
|
161
|
-
)
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
function CarouselNext({ className, variant = 'outline', size = 'icon', ...props }: React.ComponentProps<typeof Button>) {
|
|
165
|
-
const { orientation, scrollNext, canScrollNext } = useCarousel()
|
|
166
|
-
|
|
167
|
-
return (
|
|
168
|
-
<Button
|
|
169
|
-
data-slot="carousel-next"
|
|
170
|
-
variant={variant}
|
|
171
|
-
size={size}
|
|
172
|
-
className={cn(
|
|
173
|
-
'absolute size-8 rounded-full',
|
|
174
|
-
orientation === 'horizontal' ? 'top-1/2 -right-12 -translate-y-1/2' : '-bottom-12 left-1/2 -translate-x-1/2 rotate-90',
|
|
175
|
-
className,
|
|
176
|
-
)}
|
|
177
|
-
disabled={!canScrollNext}
|
|
178
|
-
onClick={scrollNext}
|
|
179
|
-
{...props}
|
|
180
|
-
>
|
|
181
|
-
<ArrowRight />
|
|
182
|
-
<span className="sr-only">Next slide</span>
|
|
183
|
-
</Button>
|
|
184
|
-
)
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
export { Carousel, type CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious }
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
import { Checkbox as CheckboxPrimitive } from 'radix-ui'
|
|
3
|
-
import { CheckIcon } from 'lucide-react'
|
|
4
|
-
|
|
5
|
-
import { cn } from '@/lib/utils'
|
|
6
|
-
|
|
7
|
-
function Checkbox({ className, ...props }: React.ComponentProps<typeof CheckboxPrimitive.Root>) {
|
|
8
|
-
return (
|
|
9
|
-
<CheckboxPrimitive.Root
|
|
10
|
-
data-slot="checkbox"
|
|
11
|
-
className={cn(
|
|
12
|
-
'peer border-border',
|
|
13
|
-
'size-4 shrink-0 rounded border shadow-xs transition-shadow outline-none',
|
|
14
|
-
'data-[state=checked]:bg-primary',
|
|
15
|
-
'data-[state=checked]:text-text-negative-strong',
|
|
16
|
-
'data-[state=checked]:border-primary',
|
|
17
|
-
'focus-visible:border-primary-strong',
|
|
18
|
-
'focus-visible:ring-primary-weak',
|
|
19
|
-
'focus-visible:ring-3',
|
|
20
|
-
'aria-invalid:ring-danger-weak',
|
|
21
|
-
'aria-invalid:border-danger',
|
|
22
|
-
'disabled:cursor-not-allowed disabled:opacity-50',
|
|
23
|
-
className,
|
|
24
|
-
)}
|
|
25
|
-
{...props}
|
|
26
|
-
>
|
|
27
|
-
<CheckboxPrimitive.Indicator data-slot="checkbox-indicator" className="flex items-center justify-center text-current transition-none">
|
|
28
|
-
<CheckIcon className="size-3.5" />
|
|
29
|
-
</CheckboxPrimitive.Indicator>
|
|
30
|
-
</CheckboxPrimitive.Root>
|
|
31
|
-
)
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export { Checkbox }
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
import { Collapsible as CollapsiblePrimitive } from 'radix-ui'
|
|
4
|
-
|
|
5
|
-
function Collapsible({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.Root>) {
|
|
6
|
-
return <CollapsiblePrimitive.Root data-slot="collapsible" {...props} />
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
function CollapsibleTrigger({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>) {
|
|
10
|
-
return <CollapsiblePrimitive.CollapsibleTrigger data-slot="collapsible-trigger" {...props} />
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
function CollapsibleContent({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>) {
|
|
14
|
-
return <CollapsiblePrimitive.CollapsibleContent data-slot="collapsible-content" {...props} />
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export { Collapsible, CollapsibleContent, CollapsibleTrigger }
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
import { Command as CommandPrimitive } from 'cmdk'
|
|
3
|
-
import { SearchIcon } from 'lucide-react'
|
|
4
|
-
|
|
5
|
-
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '@/components/ui/dialog'
|
|
6
|
-
import { cn } from '@/lib/utils'
|
|
7
|
-
|
|
8
|
-
function Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>) {
|
|
9
|
-
return (
|
|
10
|
-
<CommandPrimitive
|
|
11
|
-
data-slot="command"
|
|
12
|
-
className={cn('bg-popover text-text-positive border-border-weak flex size-full flex-col overflow-hidden rounded-md', className)}
|
|
13
|
-
{...props}
|
|
14
|
-
/>
|
|
15
|
-
)
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function CommandDialog({
|
|
19
|
-
title = 'Command Palette',
|
|
20
|
-
description = 'Search for a command to run...',
|
|
21
|
-
children,
|
|
22
|
-
className,
|
|
23
|
-
showCloseButton = true,
|
|
24
|
-
...props
|
|
25
|
-
}: React.ComponentProps<typeof Dialog> & {
|
|
26
|
-
title?: string
|
|
27
|
-
description?: string
|
|
28
|
-
className?: string
|
|
29
|
-
showCloseButton?: boolean
|
|
30
|
-
}) {
|
|
31
|
-
return (
|
|
32
|
-
<Dialog {...props}>
|
|
33
|
-
<DialogHeader className="sr-only">
|
|
34
|
-
<DialogTitle>{title}</DialogTitle>
|
|
35
|
-
<DialogDescription>{description}</DialogDescription>
|
|
36
|
-
</DialogHeader>
|
|
37
|
-
<DialogContent className={cn('overflow-hidden p-0', className)} showCloseButton={showCloseButton}>
|
|
38
|
-
<Command
|
|
39
|
-
className={cn(
|
|
40
|
-
'[&_[cmdk-group-heading]]:text-text-positive-muted',
|
|
41
|
-
'**:data-[slot=command-input-wrapper]:h-12',
|
|
42
|
-
'[&_[cmdk-group-heading]]:px-2',
|
|
43
|
-
'[&_[cmdk-group-heading]]:font-medium',
|
|
44
|
-
'[&_[cmdk-group]]:px-2',
|
|
45
|
-
'[&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0',
|
|
46
|
-
'[&_[cmdk-input-wrapper]_svg]:size-5',
|
|
47
|
-
'[&_[cmdk-input]]:h-12',
|
|
48
|
-
'[&_[cmdk-item]]:px-2',
|
|
49
|
-
'[&_[cmdk-item]]:py-3',
|
|
50
|
-
'[&_[cmdk-item]_svg]:size-5',
|
|
51
|
-
)}
|
|
52
|
-
>
|
|
53
|
-
{children}
|
|
54
|
-
</Command>
|
|
55
|
-
</DialogContent>
|
|
56
|
-
</Dialog>
|
|
57
|
-
)
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function CommandInput({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Input>) {
|
|
61
|
-
return (
|
|
62
|
-
<div data-slot="command-input-wrapper" className="border-border-weak flex h-9 items-center gap-2 border-b px-3">
|
|
63
|
-
<SearchIcon className="size-4 shrink-0 opacity-50" />
|
|
64
|
-
<CommandPrimitive.Input
|
|
65
|
-
data-slot="command-input"
|
|
66
|
-
className={cn(
|
|
67
|
-
'flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden',
|
|
68
|
-
'placeholder:text-text-positive-muted',
|
|
69
|
-
'disabled:cursor-not-allowed',
|
|
70
|
-
'disabled:opacity-50',
|
|
71
|
-
className,
|
|
72
|
-
)}
|
|
73
|
-
{...props}
|
|
74
|
-
/>
|
|
75
|
-
</div>
|
|
76
|
-
)
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
function CommandList({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.List>) {
|
|
80
|
-
return <CommandPrimitive.List data-slot="command-list" className={cn('max-h-80 scroll-py-1 overflow-x-hidden overflow-y-auto', className)} {...props} />
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
function CommandEmpty({ ...props }: React.ComponentProps<typeof CommandPrimitive.Empty>) {
|
|
84
|
-
return <CommandPrimitive.Empty data-slot="command-empty" className="py-6 text-center text-sm" {...props} />
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
function CommandGroup({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Group>) {
|
|
88
|
-
return (
|
|
89
|
-
<CommandPrimitive.Group
|
|
90
|
-
data-slot="command-group"
|
|
91
|
-
className={cn(
|
|
92
|
-
'text-text-positive',
|
|
93
|
-
'overflow-hidden p-1',
|
|
94
|
-
'[&_[cmdk-group-heading]]:text-text-positive-weak',
|
|
95
|
-
'[&_[cmdk-group-heading]]:px-2',
|
|
96
|
-
'[&_[cmdk-group-heading]]:py-1.5',
|
|
97
|
-
'[&_[cmdk-group-heading]]:text-xs',
|
|
98
|
-
'[&_[cmdk-group-heading]]:font-medium',
|
|
99
|
-
className,
|
|
100
|
-
)}
|
|
101
|
-
{...props}
|
|
102
|
-
/>
|
|
103
|
-
)
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
function CommandSeparator({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Separator>) {
|
|
107
|
-
return <CommandPrimitive.Separator data-slot="command-separator" className={cn('bg-border-weak -mx-1 h-px', className)} {...props} />
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
function CommandItem({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Item>) {
|
|
111
|
-
return (
|
|
112
|
-
<CommandPrimitive.Item
|
|
113
|
-
data-slot="command-item"
|
|
114
|
-
className={cn(
|
|
115
|
-
'relative flex cursor-pointer items-center gap-2 rounded-md p-2.5 text-sm outline-hidden transition-all duration-300 select-none',
|
|
116
|
-
'active:ring-border',
|
|
117
|
-
'active:opacity-60',
|
|
118
|
-
'active:ring-4',
|
|
119
|
-
'data-[selected=true]:bg-accent-muted',
|
|
120
|
-
'data-[selected=true]:text-text-positive-strong',
|
|
121
|
-
'data-[disabled=true]:opacity-50',
|
|
122
|
-
'data-[disabled=true]:pointer-events-none',
|
|
123
|
-
'[&_svg]:shrink-0',
|
|
124
|
-
'[&_svg]:pointer-events-none',
|
|
125
|
-
"[&_svg:not([class*='size-'])]:size-4",
|
|
126
|
-
"[&_svg:not([class*='text-'])]:text-text-positive-muted",
|
|
127
|
-
className,
|
|
128
|
-
)}
|
|
129
|
-
{...props}
|
|
130
|
-
/>
|
|
131
|
-
)
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
function CommandShortcut({ className, ...props }: React.ComponentProps<'span'>) {
|
|
135
|
-
return <span data-slot="command-shortcut" className={cn('text-text-positive-muted ml-auto text-xs tracking-widest', className)} {...props} />
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut }
|