@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,45 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
import { Slider as SliderPrimitive } from 'radix-ui'
|
|
4
|
-
|
|
5
|
-
import { cn } from '@/lib/utils'
|
|
6
|
-
|
|
7
|
-
function Slider({ className, defaultValue, value, min = 0, max = 100, ...props }: React.ComponentProps<typeof SliderPrimitive.Root>) {
|
|
8
|
-
const _values = React.useMemo(() => (Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max]), [value, defaultValue, min, max])
|
|
9
|
-
|
|
10
|
-
return (
|
|
11
|
-
<SliderPrimitive.Root
|
|
12
|
-
data-slot="slider"
|
|
13
|
-
defaultValue={defaultValue}
|
|
14
|
-
value={value}
|
|
15
|
-
min={min}
|
|
16
|
-
max={max}
|
|
17
|
-
className={cn(
|
|
18
|
-
'relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col',
|
|
19
|
-
className,
|
|
20
|
-
)}
|
|
21
|
-
{...props}
|
|
22
|
-
>
|
|
23
|
-
<SliderPrimitive.Track
|
|
24
|
-
data-slot="slider-track"
|
|
25
|
-
className={cn(
|
|
26
|
-
'bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5',
|
|
27
|
-
)}
|
|
28
|
-
>
|
|
29
|
-
<SliderPrimitive.Range
|
|
30
|
-
data-slot="slider-range"
|
|
31
|
-
className={cn('bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full')}
|
|
32
|
-
/>
|
|
33
|
-
</SliderPrimitive.Track>
|
|
34
|
-
{Array.from({ length: _values.length }, (_, index) => (
|
|
35
|
-
<SliderPrimitive.Thumb
|
|
36
|
-
data-slot="slider-thumb"
|
|
37
|
-
key={index}
|
|
38
|
-
className="border-primary bg-background ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"
|
|
39
|
-
/>
|
|
40
|
-
))}
|
|
41
|
-
</SliderPrimitive.Root>
|
|
42
|
-
)
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export { Slider }
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
import { LoaderIcon } from 'lucide-react'
|
|
3
|
-
import { useTheme } from 'next-themes'
|
|
4
|
-
import { Toaster as Sonner, type ToasterProps } from 'sonner'
|
|
5
|
-
|
|
6
|
-
const Toaster = () => {
|
|
7
|
-
const { theme = 'system' } = useTheme()
|
|
8
|
-
|
|
9
|
-
return (
|
|
10
|
-
<Sonner
|
|
11
|
-
richColors
|
|
12
|
-
theme={theme as ToasterProps['theme']}
|
|
13
|
-
expand={false}
|
|
14
|
-
visibleToasts={5}
|
|
15
|
-
closeButton={true}
|
|
16
|
-
position="bottom-right"
|
|
17
|
-
swipeDirections={['left', 'right']}
|
|
18
|
-
icons={{
|
|
19
|
-
loading: <LoaderIcon size={16} className="animate-spin" />,
|
|
20
|
-
}}
|
|
21
|
-
toastOptions={{
|
|
22
|
-
classNames: {
|
|
23
|
-
toast: '!text-white !border-none rounded-lg cursor-grab active:cursor-grabbing select-none z-99999',
|
|
24
|
-
icon: '!size-6',
|
|
25
|
-
title: '!text-sm !font-bold',
|
|
26
|
-
description: '!text-xs !font-semibold !text-white/80',
|
|
27
|
-
success: '!bg-success',
|
|
28
|
-
info: '!bg-blue-700',
|
|
29
|
-
loading: '!bg-slate-500',
|
|
30
|
-
warning: '!bg-warning',
|
|
31
|
-
error: '!bg-danger',
|
|
32
|
-
closeButton: '!text-gray-400 hover:!text-gray-500 !bg-neutral-50 hover:!bg-gray-100 !border-none !shadow',
|
|
33
|
-
},
|
|
34
|
-
}}
|
|
35
|
-
className="toaster group pointer-events-auto !z-999999"
|
|
36
|
-
/>
|
|
37
|
-
)
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export { Toaster }
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
import { Switch as SwitchPrimitive } from 'radix-ui'
|
|
4
|
-
|
|
5
|
-
import { cn } from '@/lib/utils'
|
|
6
|
-
|
|
7
|
-
function Switch({ className, ...props }: React.ComponentProps<typeof SwitchPrimitive.Root>) {
|
|
8
|
-
return (
|
|
9
|
-
<SwitchPrimitive.Root
|
|
10
|
-
data-slot="switch"
|
|
11
|
-
className={cn(
|
|
12
|
-
'peer',
|
|
13
|
-
'w-8 shrink-0 cursor-pointer items-center rounded-full border border-transparent shadow-xs transition-all outline-none',
|
|
14
|
-
'inline-flex h-5',
|
|
15
|
-
'data-[state=checked]:bg-primary',
|
|
16
|
-
'data-[state=unchecked]:bg-border-muted',
|
|
17
|
-
'focus-visible:border-primary-strong',
|
|
18
|
-
'focus-visible:ring-primary-weak',
|
|
19
|
-
'focus-visible:ring-4',
|
|
20
|
-
'disabled:cursor-not-allowed',
|
|
21
|
-
'disabled:opacity-50',
|
|
22
|
-
'data-[state=unchecked]:border-border-weak',
|
|
23
|
-
'data-[state=unchecked]:[&_span]:bg-accent-weak',
|
|
24
|
-
'data-[state=unchecked]:bg-transparent',
|
|
25
|
-
'data-[state=unchecked]:[&_span]:size-4',
|
|
26
|
-
'data-[state=unchecked]:[&_span]:translate-x-0.5',
|
|
27
|
-
'data-[state=unchecked]:[&_span]:shadow-none',
|
|
28
|
-
'data-[state=unchecked]:[&_span]:rtl:-translate-x-0.5',
|
|
29
|
-
className,
|
|
30
|
-
)}
|
|
31
|
-
{...props}
|
|
32
|
-
>
|
|
33
|
-
<SwitchPrimitive.Thumb
|
|
34
|
-
data-slot="switch-thumb"
|
|
35
|
-
className={cn(
|
|
36
|
-
'bg-background',
|
|
37
|
-
'pointer-events-none block size-4 rounded-full ring-0 transition-transform',
|
|
38
|
-
'data-[state=checked]:translate-x-[calc(100%-3px)]',
|
|
39
|
-
'data-[state=unchecked]:translate-x-0',
|
|
40
|
-
)}
|
|
41
|
-
/>
|
|
42
|
-
</SwitchPrimitive.Root>
|
|
43
|
-
)
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export { Switch }
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
|
|
4
|
-
import { cn } from '@/lib/utils'
|
|
5
|
-
|
|
6
|
-
function Table({ className, ...props }: React.ComponentProps<'table'>) {
|
|
7
|
-
return (
|
|
8
|
-
<div data-slot="table-container" className="relative w-full overflow-x-auto">
|
|
9
|
-
<table data-slot="table" className={cn('w-full caption-bottom text-sm', className)} {...props} />
|
|
10
|
-
</div>
|
|
11
|
-
)
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
function TableHeader({ className, ...props }: React.ComponentProps<'thead'>) {
|
|
15
|
-
return <thead data-slot="table-header" className={cn('bg-muted-muted border-border-weak [&_tr]:border-b', className)} {...props} />
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function TableBody({ className, ...props }: React.ComponentProps<'tbody'>) {
|
|
19
|
-
return <tbody data-slot="table-body" className={cn('[&_tr:last-child]:border-0', className)} {...props} />
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function TableFooter({ className, ...props }: React.ComponentProps<'tfoot'>) {
|
|
23
|
-
return <tfoot data-slot="table-footer" className={cn('bg-accent-muted border-t font-medium [&>tr]:last:border-b-0', className)} {...props} />
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
function TableRow({ className, ...props }: React.ComponentProps<'tr'>) {
|
|
27
|
-
return (
|
|
28
|
-
<tr
|
|
29
|
-
data-slot="table-row"
|
|
30
|
-
className={cn('hover:bg-muted-muted/50 active:bg-muted-muted data-[state=selected]:bg-muted border-border-weak border-b transition-colors', className)}
|
|
31
|
-
{...props}
|
|
32
|
-
/>
|
|
33
|
-
)
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function TableHead({ className, ...props }: React.ComponentProps<'th'>) {
|
|
37
|
-
return (
|
|
38
|
-
<th
|
|
39
|
-
data-slot="table-head"
|
|
40
|
-
className={cn(
|
|
41
|
-
'text-text-positive-weak',
|
|
42
|
-
'h-10 px-2 text-left align-middle font-medium whitespace-nowrap',
|
|
43
|
-
'[&:has([role=checkbox])]:pr-0',
|
|
44
|
-
'[&>[role=checkbox]]:translate-y-0.5',
|
|
45
|
-
className,
|
|
46
|
-
)}
|
|
47
|
-
{...props}
|
|
48
|
-
/>
|
|
49
|
-
)
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function TableCell({ className, ...props }: React.ComponentProps<'td'>) {
|
|
53
|
-
return (
|
|
54
|
-
<td
|
|
55
|
-
data-slot="table-cell"
|
|
56
|
-
className={cn('p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-0.5', className)}
|
|
57
|
-
{...props}
|
|
58
|
-
/>
|
|
59
|
-
)
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function TableCaption({ className, ...props }: React.ComponentProps<'caption'>) {
|
|
63
|
-
return <caption data-slot="table-caption" className={cn('text-text-positive-muted mt-4 text-sm', className)} {...props} />
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow }
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
import { Tabs as TabsPrimitive } from 'radix-ui'
|
|
3
|
-
|
|
4
|
-
import { cn } from '@/lib/utils'
|
|
5
|
-
|
|
6
|
-
function Tabs({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Root>) {
|
|
7
|
-
return <TabsPrimitive.Root data-slot="tabs" className={cn('flex flex-col gap-2', className)} {...props} />
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
function TabsList({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.List>) {
|
|
11
|
-
return (
|
|
12
|
-
<TabsPrimitive.List
|
|
13
|
-
data-slot="tabs-list"
|
|
14
|
-
className={cn('bg-muted-muted inline-flex h-9 w-fit items-center justify-center rounded-full p-1', className)}
|
|
15
|
-
{...props}
|
|
16
|
-
/>
|
|
17
|
-
)
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Trigger>) {
|
|
21
|
-
return (
|
|
22
|
-
<TabsPrimitive.Trigger
|
|
23
|
-
data-slot="tabs-trigger"
|
|
24
|
-
className={cn(
|
|
25
|
-
'text-text-positive-weak',
|
|
26
|
-
'inline-flex h-[calc(100%-1px)] flex-1 cursor-pointer items-center justify-center gap-1.5',
|
|
27
|
-
'rounded-full',
|
|
28
|
-
'border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition',
|
|
29
|
-
'hover:bg-muted-weak',
|
|
30
|
-
'data-[state=active]:shadow-card',
|
|
31
|
-
'data-[state=active]:bg-background',
|
|
32
|
-
'disabled:opacity-50',
|
|
33
|
-
'disabled:pointer-events-none',
|
|
34
|
-
'focus-visible:border-primary',
|
|
35
|
-
'focus-visible:ring-4',
|
|
36
|
-
'focus-visible:ring-primary-weak',
|
|
37
|
-
'focus-visible:outline-1',
|
|
38
|
-
'focus-visible:outline-primary',
|
|
39
|
-
'[&_svg]:pointer-events-none',
|
|
40
|
-
'[&_svg]:shrink-0',
|
|
41
|
-
"[&_svg:not([class*='size-'])]:size-4",
|
|
42
|
-
className,
|
|
43
|
-
)}
|
|
44
|
-
{...props}
|
|
45
|
-
/>
|
|
46
|
-
)
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Content>) {
|
|
50
|
-
return <TabsPrimitive.Content data-slot="tabs-content" className={cn('flex-1 outline-none', className)} {...props} />
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export { Tabs, TabsContent, TabsList, TabsTrigger }
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
|
|
4
|
-
import { cn } from '@/lib/utils'
|
|
5
|
-
|
|
6
|
-
function Textarea({
|
|
7
|
-
className,
|
|
8
|
-
onChange,
|
|
9
|
-
onValueChange,
|
|
10
|
-
...props
|
|
11
|
-
}: React.ComponentProps<'textarea'> & {
|
|
12
|
-
onValueChange?: (value: string) => void
|
|
13
|
-
}) {
|
|
14
|
-
const handleChange = React.useCallback(
|
|
15
|
-
(e: React.ChangeEvent<HTMLTextAreaElement>) => {
|
|
16
|
-
onChange?.(e)
|
|
17
|
-
onValueChange?.(e.target.value)
|
|
18
|
-
},
|
|
19
|
-
[onChange, onValueChange],
|
|
20
|
-
)
|
|
21
|
-
return (
|
|
22
|
-
<textarea
|
|
23
|
-
data-slot="textarea"
|
|
24
|
-
className={cn(
|
|
25
|
-
'border-border-weak caret-primary',
|
|
26
|
-
'flex min-h-16 w-full bg-transparent px-3 py-2',
|
|
27
|
-
'field-sizing-content',
|
|
28
|
-
'shadow-input rounded-md border',
|
|
29
|
-
'text-sm transition outline-none',
|
|
30
|
-
'placeholder:text-text-positive-muted',
|
|
31
|
-
'focus-visible:border-primary-strong',
|
|
32
|
-
'focus-visible:ring-primary-weak',
|
|
33
|
-
'focus-visible:ring-4',
|
|
34
|
-
'aria-invalid:ring-danger-weak',
|
|
35
|
-
'aria-invalid:border-danger-strong',
|
|
36
|
-
'disabled:cursor-not-allowed',
|
|
37
|
-
'disabled:opacity-50',
|
|
38
|
-
className,
|
|
39
|
-
)}
|
|
40
|
-
{...props}
|
|
41
|
-
onChange={handleChange}
|
|
42
|
-
/>
|
|
43
|
-
)
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export { Textarea }
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
import { ToggleGroup as ToggleGroupPrimitive } from 'radix-ui'
|
|
4
|
-
import { type VariantProps } from 'class-variance-authority'
|
|
5
|
-
|
|
6
|
-
import { toggleVariants } from '@/components/ui/toggle'
|
|
7
|
-
import { cn } from '@/lib/utils'
|
|
8
|
-
|
|
9
|
-
const ToggleGroupContext = React.createContext<VariantProps<typeof toggleVariants>>({
|
|
10
|
-
size: 'default',
|
|
11
|
-
variant: 'default',
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
function ToggleGroup({
|
|
15
|
-
className,
|
|
16
|
-
variant,
|
|
17
|
-
size,
|
|
18
|
-
children,
|
|
19
|
-
...props
|
|
20
|
-
}: React.ComponentProps<typeof ToggleGroupPrimitive.Root> & VariantProps<typeof toggleVariants>) {
|
|
21
|
-
return (
|
|
22
|
-
<ToggleGroupPrimitive.Root
|
|
23
|
-
data-slot="toggle-group"
|
|
24
|
-
data-variant={variant}
|
|
25
|
-
data-size={size}
|
|
26
|
-
className={cn('group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs', className)}
|
|
27
|
-
{...props}
|
|
28
|
-
>
|
|
29
|
-
<ToggleGroupContext.Provider value={{ variant, size }}>{children}</ToggleGroupContext.Provider>
|
|
30
|
-
</ToggleGroupPrimitive.Root>
|
|
31
|
-
)
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function ToggleGroupItem({
|
|
35
|
-
className,
|
|
36
|
-
children,
|
|
37
|
-
variant,
|
|
38
|
-
size,
|
|
39
|
-
...props
|
|
40
|
-
}: React.ComponentProps<typeof ToggleGroupPrimitive.Item> & VariantProps<typeof toggleVariants>) {
|
|
41
|
-
const context = React.useContext(ToggleGroupContext)
|
|
42
|
-
|
|
43
|
-
return (
|
|
44
|
-
<ToggleGroupPrimitive.Item
|
|
45
|
-
data-slot="toggle-group-item"
|
|
46
|
-
data-variant={context.variant || variant}
|
|
47
|
-
data-size={context.size || size}
|
|
48
|
-
className={cn(
|
|
49
|
-
toggleVariants({
|
|
50
|
-
variant: context.variant || variant,
|
|
51
|
-
size: context.size || size,
|
|
52
|
-
}),
|
|
53
|
-
'min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l',
|
|
54
|
-
className,
|
|
55
|
-
)}
|
|
56
|
-
{...props}
|
|
57
|
-
>
|
|
58
|
-
{children}
|
|
59
|
-
</ToggleGroupPrimitive.Item>
|
|
60
|
-
)
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export { ToggleGroup, ToggleGroupItem }
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
import { Toggle as TogglePrimitive } from 'radix-ui'
|
|
4
|
-
import { cva, type VariantProps } from 'class-variance-authority'
|
|
5
|
-
|
|
6
|
-
import { cn } from '@/lib/utils'
|
|
7
|
-
|
|
8
|
-
const toggleVariants = cva(
|
|
9
|
-
"inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",
|
|
10
|
-
{
|
|
11
|
-
variants: {
|
|
12
|
-
variant: {
|
|
13
|
-
default: 'bg-transparent',
|
|
14
|
-
outline: 'border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground',
|
|
15
|
-
},
|
|
16
|
-
size: {
|
|
17
|
-
default: 'h-9 px-2 min-w-9',
|
|
18
|
-
sm: 'h-8 px-1.5 min-w-8',
|
|
19
|
-
lg: 'h-10 px-2.5 min-w-10',
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
defaultVariants: {
|
|
23
|
-
variant: 'default',
|
|
24
|
-
size: 'default',
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
)
|
|
28
|
-
|
|
29
|
-
function Toggle({ className, variant, size, ...props }: React.ComponentProps<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>) {
|
|
30
|
-
return <TogglePrimitive.Root data-slot="toggle" className={cn(toggleVariants({ variant, size, className }))} {...props} />
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// eslint-disable-next-line react-refresh/only-export-components
|
|
34
|
-
export { Toggle, toggleVariants }
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
import { Tooltip as TooltipPrimitive } from 'radix-ui'
|
|
4
|
-
|
|
5
|
-
import { cn } from '@/lib/utils'
|
|
6
|
-
|
|
7
|
-
function TooltipProvider({ delayDuration = 0, ...props }: React.ComponentProps<typeof TooltipPrimitive.Provider>) {
|
|
8
|
-
return <TooltipPrimitive.Provider data-slot="tooltip-provider" delayDuration={delayDuration} {...props} />
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
function Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>) {
|
|
12
|
-
return (
|
|
13
|
-
<TooltipProvider>
|
|
14
|
-
<TooltipPrimitive.Root data-slot="tooltip" {...props} />
|
|
15
|
-
</TooltipProvider>
|
|
16
|
-
)
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {
|
|
20
|
-
return <TooltipPrimitive.Trigger data-slot="tooltip-trigger" {...props} />
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function TooltipContent({ className, sideOffset = 0, children, ...props }: React.ComponentProps<typeof TooltipPrimitive.Content>) {
|
|
24
|
-
return (
|
|
25
|
-
<TooltipPrimitive.Portal>
|
|
26
|
-
<TooltipPrimitive.Content
|
|
27
|
-
data-slot="tooltip-content"
|
|
28
|
-
sideOffset={sideOffset}
|
|
29
|
-
className={cn(
|
|
30
|
-
'bg-foreground text-text-negative-intense shadow-dropdown outline-none',
|
|
31
|
-
'animate-in fade-in-0 zoom-in-95',
|
|
32
|
-
'data-[state=closed]:animate-out',
|
|
33
|
-
'data-[state=closed]:fade-out-0',
|
|
34
|
-
'data-[state=closed]:zoom-out-95',
|
|
35
|
-
'data-[side=bottom]:slide-in-from-top-2',
|
|
36
|
-
'data-[side=left]:slide-in-from-right-2',
|
|
37
|
-
'data-[side=right]:slide-in-from-left-2',
|
|
38
|
-
'data-[side=top]:slide-in-from-bottom-2',
|
|
39
|
-
'z-50 w-fit',
|
|
40
|
-
'origin-(--radix-tooltip-content-transform-origin)',
|
|
41
|
-
'rounded-lg px-3 py-1.5 text-xs text-balance',
|
|
42
|
-
className,
|
|
43
|
-
)}
|
|
44
|
-
{...props}
|
|
45
|
-
>
|
|
46
|
-
{children}
|
|
47
|
-
<TooltipPrimitive.Arrow className="bg-foreground fill-foreground text-secondary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-xs" />
|
|
48
|
-
</TooltipPrimitive.Content>
|
|
49
|
-
</TooltipPrimitive.Portal>
|
|
50
|
-
)
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger }
|
package/packages/constants.tsx
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
// Vietnamese locale configuration
|
|
2
|
-
export const vietnameseLocale = {
|
|
3
|
-
weekdays: ['Chủ Nhật', 'Thứ Hai', 'Thứ Ba', 'Thứ Tư', 'Thứ Năm', 'Thứ Sáu', 'Thứ Bảy'],
|
|
4
|
-
weekdaysShort: ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'],
|
|
5
|
-
months: ['Tháng 1', 'Tháng 2', 'Tháng 3', 'Tháng 4', 'Tháng 5', 'Tháng 6', 'Tháng 7', 'Tháng 8', 'Tháng 9', 'Tháng 10', 'Tháng 11', 'Tháng 12'],
|
|
6
|
-
monthsShort: ['T1', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7', 'T8', 'T9', 'T10', 'T11', 'T12'],
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
// Vietnamese holidays
|
|
10
|
-
export const vietnameseHolidays = {
|
|
11
|
-
'01-01': 'Tết Dương lịch',
|
|
12
|
-
'03-08': 'Quốc tế Phụ nữ',
|
|
13
|
-
'04-30': 'Ngày Giải phóng miền Nam',
|
|
14
|
-
'05-01': 'Quốc tế Lao động',
|
|
15
|
-
'09-02': 'Quốc khánh',
|
|
16
|
-
'10-20': 'Ngày Phụ nữ Việt Nam',
|
|
17
|
-
'11-20': 'Ngày Nhà giáo Việt Nam',
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
// Time Constants in milliseconds, seconds, and minutes
|
|
21
|
-
export const TIME_IN_MS = Object.freeze({
|
|
22
|
-
SECOND: 1000,
|
|
23
|
-
MINUTE: 60 * 1000,
|
|
24
|
-
HOUR: 60 * 60 * 1000,
|
|
25
|
-
DAY: 24 * 60 * 60 * 1000,
|
|
26
|
-
WEEK: 7 * 24 * 60 * 60 * 1000,
|
|
27
|
-
MONTH: 30 * 24 * 60 * 60 * 1000, // Approximation for month length = 30 days
|
|
28
|
-
YEAR: 365 * 24 * 60 * 60 * 1000,
|
|
29
|
-
})
|
|
30
|
-
|
|
31
|
-
export const TIME_IN_SECONDS = Object.freeze({
|
|
32
|
-
MINUTE: 60,
|
|
33
|
-
HOUR: 60 * 60,
|
|
34
|
-
DAY: 24 * 60 * 60,
|
|
35
|
-
WEEK: 7 * 24 * 60 * 60,
|
|
36
|
-
MONTH: 30 * 24 * 60 * 60,
|
|
37
|
-
YEAR: 365 * 24 * 60 * 60,
|
|
38
|
-
})
|
|
39
|
-
|
|
40
|
-
export const TIME_IN_MINUTES = Object.freeze({
|
|
41
|
-
HOUR: 60,
|
|
42
|
-
DAY: 24 * 60,
|
|
43
|
-
WEEK: 7 * 24 * 60,
|
|
44
|
-
MONTH: 30 * 24 * 60,
|
|
45
|
-
})
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @see https://github.com/radix-ui/primitives/blob/main/packages/react/use-callback-ref/src/useCallbackRef.tsx
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a
|
|
9
|
-
* prop or avoid re-executing effects when passed as a dependency
|
|
10
|
-
*/
|
|
11
|
-
function useCallbackRef<T extends (...args: never[]) => unknown>(callback: T | undefined): T {
|
|
12
|
-
const callbackRef = React.useRef(callback)
|
|
13
|
-
|
|
14
|
-
React.useEffect(() => {
|
|
15
|
-
callbackRef.current = callback
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
// https://github.com/facebook/react/issues/19240
|
|
19
|
-
return React.useMemo(() => ((...args) => callbackRef.current?.(...args)) as T, [])
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export { useCallbackRef }
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
|
|
3
|
-
import { useCallbackRef } from './use-callback-ref'
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @see https://github.com/radix-ui/primitives/blob/main/packages/react/use-controllable-state/src/useControllableState.tsx
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
type UseControllableStateParams<T> = {
|
|
10
|
-
prop?: T | undefined
|
|
11
|
-
defaultProp?: T | undefined
|
|
12
|
-
onChange?: (state: T) => void
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
type SetStateFn<T> = (prevState?: T) => T
|
|
16
|
-
|
|
17
|
-
function useControllableState<T>({ prop, defaultProp, onChange = () => {} }: UseControllableStateParams<T>) {
|
|
18
|
-
const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({
|
|
19
|
-
defaultProp,
|
|
20
|
-
onChange,
|
|
21
|
-
})
|
|
22
|
-
const isControlled = prop !== undefined
|
|
23
|
-
const value = isControlled ? prop : uncontrolledProp
|
|
24
|
-
const handleChange = useCallbackRef(onChange)
|
|
25
|
-
|
|
26
|
-
const setValue: React.Dispatch<React.SetStateAction<T | undefined>> = React.useCallback(
|
|
27
|
-
(nextValue) => {
|
|
28
|
-
if (isControlled) {
|
|
29
|
-
const setter = nextValue as SetStateFn<T>
|
|
30
|
-
const value = typeof nextValue === 'function' ? setter(prop) : nextValue
|
|
31
|
-
if (value !== prop) handleChange(value as T)
|
|
32
|
-
} else {
|
|
33
|
-
setUncontrolledProp(nextValue)
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
[isControlled, prop, setUncontrolledProp, handleChange],
|
|
37
|
-
)
|
|
38
|
-
|
|
39
|
-
return [value, setValue] as const
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function useUncontrolledState<T>({ defaultProp, onChange }: Omit<UseControllableStateParams<T>, 'prop'>) {
|
|
43
|
-
const uncontrolledState = React.useState<T | undefined>(defaultProp)
|
|
44
|
-
const [value] = uncontrolledState
|
|
45
|
-
const prevValueRef = React.useRef(value)
|
|
46
|
-
const handleChange = useCallbackRef(onChange)
|
|
47
|
-
|
|
48
|
-
React.useEffect(() => {
|
|
49
|
-
if (prevValueRef.current !== value) {
|
|
50
|
-
handleChange(value as T)
|
|
51
|
-
prevValueRef.current = value
|
|
52
|
-
}
|
|
53
|
-
}, [value, prevValueRef, handleChange])
|
|
54
|
-
|
|
55
|
-
return uncontrolledState
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export { useControllableState }
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
|
|
3
|
-
const MOBILE_BREAKPOINT = 768
|
|
4
|
-
|
|
5
|
-
export function useIsMobile() {
|
|
6
|
-
const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined)
|
|
7
|
-
|
|
8
|
-
React.useEffect(() => {
|
|
9
|
-
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`)
|
|
10
|
-
const onChange = () => {
|
|
11
|
-
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)
|
|
12
|
-
}
|
|
13
|
-
mql.addEventListener('change', onChange)
|
|
14
|
-
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)
|
|
15
|
-
return () => mql.removeEventListener('change', onChange)
|
|
16
|
-
}, [])
|
|
17
|
-
|
|
18
|
-
return !!isMobile
|
|
19
|
-
}
|