From cfccb8e510e04afe3f42fe8d48d6aca55537a596 Mon Sep 17 00:00:00 2001 From: Sadegh Barati Date: Thu, 11 Apr 2024 18:42:20 +0330 Subject: [PATCH] feat: new calendar components (#468) --- .../theme/components/theming/Theming.vue | 18 +- apps/www/.vitepress/theme/config/docs.ts | 16 +- apps/www/__registry__/index.ts | 176 ++++- apps/www/package.json | 7 +- .../src/content/docs/components/calendar.md | 87 +-- .../content/docs/components/date-picker.md | 71 +- .../content/docs/components/range-calendar.md | 18 + .../src/content/docs/components/v-calendar.md | 91 +++ .../content/docs/components/v-date-picker.md | 79 +++ .../dashboard/components/DateRangePicker.vue | 53 +- .../examples/forms/components/AccountForm.vue | 63 +- .../registry/default/example/CalendarDemo.vue | 7 +- .../registry/default/example/CalendarForm.vue | 105 +++ .../default/example/CalendarWithSelect.vue | 127 ++++ .../default/example/DatePickerDemo.vue | 34 +- .../default/example/DatePickerForm.vue | 70 +- .../default/example/DatePickerWithPresets.vue | 77 +-- .../default/example/DatePickerWithRange.vue | 88 +-- .../default/example/RangeCalendarDemo.vue | 18 + .../default/example/VCalendarDemo.vue | 10 + .../default/example/VDatePickerDemo.vue | 36 + .../default/example/VDatePickerForm.vue | 79 +++ .../example/VDatePickerWithPresets.vue | 73 +++ .../default/example/VDatePickerWithRange.vue | 51 ++ ...PickerDemo.vue => VDateTimePickerDemo.vue} | 2 +- ...rWithSlot.vue => VRangePickerWithSlot.vue} | 2 +- .../registry/default/ui/calendar/Calendar.vue | 369 ++--------- .../default/ui/calendar/CalendarCell.vue | 24 + .../ui/calendar/CalendarCellTrigger.vue | 38 ++ .../default/ui/calendar/CalendarGrid.vue | 24 + .../default/ui/calendar/CalendarGridBody.vue | 11 + .../default/ui/calendar/CalendarGridHead.vue | 11 + .../default/ui/calendar/CalendarGridRow.vue | 21 + .../default/ui/calendar/CalendarHeadCell.vue | 21 + .../default/ui/calendar/CalendarHeader.vue | 21 + .../default/ui/calendar/CalendarHeading.vue | 27 + .../ui/calendar/CalendarNextButton.vue | 32 + .../ui/calendar/CalendarPrevButton.vue | 32 + .../lib/registry/default/ui/calendar/index.ts | 32 +- .../ui/range-calendar/RangeCalendar.vue | 60 ++ .../ui/range-calendar/RangeCalendarCell.vue | 24 + .../RangeCalendarCellTrigger.vue | 40 ++ .../ui/range-calendar/RangeCalendarGrid.vue | 24 + .../range-calendar/RangeCalendarGridBody.vue | 11 + .../range-calendar/RangeCalendarGridHead.vue | 11 + .../range-calendar/RangeCalendarGridRow.vue | 21 + .../range-calendar/RangeCalendarHeadCell.vue | 21 + .../ui/range-calendar/RangeCalendarHeader.vue | 21 + .../range-calendar/RangeCalendarHeading.vue | 27 + .../RangeCalendarNextButton.vue | 32 + .../RangeCalendarPrevButton.vue | 32 + .../default/ui/range-calendar/index.ts | 12 + .../default/ui/v-calendar/Calendar.vue | 331 ++++++++++ .../registry/default/ui/v-calendar/index.ts | 22 + .../new-york/example/CalendarDemo.vue | 7 +- .../new-york/example/CalendarForm.vue | 105 +++ .../new-york/example/CalendarWithSelect.vue | 127 ++++ .../new-york/example/Cards/ActivityGoal.vue | 2 +- .../new-york/example/DatePickerDemo.vue | 34 +- .../new-york/example/DatePickerForm.vue | 70 +- .../example/DatePickerWithPresets.vue | 77 +-- .../new-york/example/DatePickerWithRange.vue | 88 +-- .../new-york/example/RangeCalendarDemo.vue | 18 + .../new-york/example/VCalendarDemo.vue | 10 + .../new-york/example/VDatePickerDemo.vue | 36 + .../new-york/example/VDatePickerForm.vue | 79 +++ .../example/VDatePickerWithPresets.vue | 73 +++ .../new-york/example/VDatePickerWithRange.vue | 51 ++ ...PickerDemo.vue => VDateTimePickerDemo.vue} | 4 +- ...rWithSlot.vue => VRangePickerWithSlot.vue} | 2 +- .../new-york/ui/calendar/Calendar.vue | 365 ++--------- .../new-york/ui/calendar/CalendarCell.vue | 24 + .../ui/calendar/CalendarCellTrigger.vue | 38 ++ .../new-york/ui/calendar/CalendarGrid.vue | 24 + .../new-york/ui/calendar/CalendarGridBody.vue | 11 + .../new-york/ui/calendar/CalendarGridHead.vue | 12 + .../new-york/ui/calendar/CalendarGridRow.vue | 21 + .../new-york/ui/calendar/CalendarHeadCell.vue | 21 + .../new-york/ui/calendar/CalendarHeader.vue | 21 + .../new-york/ui/calendar/CalendarHeading.vue | 27 + .../ui/calendar/CalendarNextButton.vue | 32 + .../ui/calendar/CalendarPrevButton.vue | 32 + .../registry/new-york/ui/calendar/index.ts | 32 +- .../ui/range-calendar/RangeCalendar.vue | 60 ++ .../ui/range-calendar/RangeCalendarCell.vue | 24 + .../RangeCalendarCellTrigger.vue | 40 ++ .../ui/range-calendar/RangeCalendarGrid.vue | 24 + .../range-calendar/RangeCalendarGridBody.vue | 11 + .../range-calendar/RangeCalendarGridHead.vue | 11 + .../range-calendar/RangeCalendarGridRow.vue | 21 + .../range-calendar/RangeCalendarHeadCell.vue | 21 + .../ui/range-calendar/RangeCalendarHeader.vue | 21 + .../range-calendar/RangeCalendarHeading.vue | 27 + .../RangeCalendarNextButton.vue | 32 + .../RangeCalendarPrevButton.vue | 32 + .../new-york/ui/range-calendar/index.ts | 12 + .../new-york/ui/v-calendar/Calendar.vue | 325 +++++++++ .../registry/new-york/ui/v-calendar/index.ts | 22 + apps/www/src/public/registry/colors/gray.json | 2 +- .../www/src/public/registry/colors/index.json | 2 +- apps/www/src/public/registry/colors/lime.json | 2 +- .../src/public/registry/colors/neutral.json | 2 +- .../www/src/public/registry/colors/slate.json | 2 +- .../www/src/public/registry/colors/stone.json | 2 +- apps/www/src/public/registry/colors/zinc.json | 2 +- apps/www/src/public/registry/index.json | 56 +- .../registry/styles/default/accordion.json | 2 +- .../registry/styles/default/alert-dialog.json | 2 +- .../public/registry/styles/default/alert.json | 2 +- .../registry/styles/default/aspect-ratio.json | 2 +- .../registry/styles/default/avatar.json | 2 +- .../public/registry/styles/default/badge.json | 2 +- .../registry/styles/default/breadcrumb.json | 2 +- .../registry/styles/default/button.json | 2 +- .../registry/styles/default/calendar.json | 53 +- .../public/registry/styles/default/card.json | 2 +- .../registry/styles/default/carousel.json | 2 +- .../registry/styles/default/checkbox.json | 2 +- .../registry/styles/default/collapsible.json | 2 +- .../registry/styles/default/command.json | 2 +- .../registry/styles/default/context-menu.json | 2 +- .../registry/styles/default/dialog.json | 2 +- .../registry/styles/default/drawer.json | 2 +- .../styles/default/dropdown-menu.json | 2 +- .../public/registry/styles/default/form.json | 2 +- .../registry/styles/default/hover-card.json | 2 +- .../public/registry/styles/default/input.json | 2 +- .../public/registry/styles/default/label.json | 2 +- .../registry/styles/default/menubar.json | 2 +- .../styles/default/navigation-menu.json | 2 +- .../registry/styles/default/pagination.json | 2 +- .../registry/styles/default/pin-input.json | 2 +- .../registry/styles/default/popover.json | 2 +- .../registry/styles/default/progress.json | 2 +- .../registry/styles/default/radio-group.json | 2 +- .../styles/default/range-calendar.json | 63 ++ .../registry/styles/default/resizable.json | 2 +- .../registry/styles/default/scroll-area.json | 2 +- .../registry/styles/default/select.json | 2 +- .../registry/styles/default/separator.json | 2 +- .../public/registry/styles/default/sheet.json | 2 +- .../registry/styles/default/skeleton.json | 2 +- .../registry/styles/default/slider.json | 2 +- .../registry/styles/default/sonner.json | 2 +- .../registry/styles/default/switch.json | 2 +- .../public/registry/styles/default/table.json | 2 +- .../public/registry/styles/default/tabs.json | 2 +- .../registry/styles/default/tags-input.json | 2 +- .../registry/styles/default/textarea.json | 2 +- .../public/registry/styles/default/toast.json | 2 +- .../registry/styles/default/toggle-group.json | 2 +- .../registry/styles/default/toggle.json | 2 +- .../registry/styles/default/tooltip.json | 2 +- .../registry/styles/default/v-calendar.json | 22 + .../www/src/public/registry/styles/index.json | 2 +- .../registry/styles/new-york/accordion.json | 2 +- .../styles/new-york/alert-dialog.json | 2 +- .../registry/styles/new-york/alert.json | 2 +- .../styles/new-york/aspect-ratio.json | 2 +- .../registry/styles/new-york/avatar.json | 2 +- .../registry/styles/new-york/badge.json | 2 +- .../registry/styles/new-york/breadcrumb.json | 2 +- .../registry/styles/new-york/button.json | 2 +- .../registry/styles/new-york/calendar.json | 53 +- .../public/registry/styles/new-york/card.json | 2 +- .../registry/styles/new-york/carousel.json | 2 +- .../registry/styles/new-york/checkbox.json | 2 +- .../registry/styles/new-york/collapsible.json | 2 +- .../registry/styles/new-york/command.json | 2 +- .../styles/new-york/context-menu.json | 2 +- .../registry/styles/new-york/dialog.json | 2 +- .../registry/styles/new-york/drawer.json | 2 +- .../styles/new-york/dropdown-menu.json | 2 +- .../public/registry/styles/new-york/form.json | 2 +- .../registry/styles/new-york/hover-card.json | 2 +- .../registry/styles/new-york/input.json | 2 +- .../registry/styles/new-york/label.json | 2 +- .../registry/styles/new-york/menubar.json | 2 +- .../styles/new-york/navigation-menu.json | 2 +- .../registry/styles/new-york/pagination.json | 2 +- .../registry/styles/new-york/pin-input.json | 2 +- .../registry/styles/new-york/popover.json | 2 +- .../registry/styles/new-york/progress.json | 2 +- .../registry/styles/new-york/radio-group.json | 2 +- .../styles/new-york/range-calendar.json | 63 ++ .../registry/styles/new-york/resizable.json | 2 +- .../registry/styles/new-york/scroll-area.json | 2 +- .../registry/styles/new-york/select.json | 2 +- .../registry/styles/new-york/separator.json | 2 +- .../registry/styles/new-york/sheet.json | 2 +- .../registry/styles/new-york/skeleton.json | 2 +- .../registry/styles/new-york/slider.json | 2 +- .../registry/styles/new-york/sonner.json | 2 +- .../registry/styles/new-york/switch.json | 2 +- .../registry/styles/new-york/table.json | 2 +- .../public/registry/styles/new-york/tabs.json | 2 +- .../registry/styles/new-york/tags-input.json | 2 +- .../registry/styles/new-york/textarea.json | 2 +- .../registry/styles/new-york/toast.json | 2 +- .../styles/new-york/toggle-group.json | 2 +- .../registry/styles/new-york/toggle.json | 2 +- .../registry/styles/new-york/tooltip.json | 2 +- .../registry/styles/new-york/v-calendar.json | 22 + apps/www/tsconfig.json | 1 - pnpm-lock.yaml | 614 +++++------------- 205 files changed, 4389 insertions(+), 1690 deletions(-) create mode 100644 apps/www/src/content/docs/components/range-calendar.md create mode 100644 apps/www/src/content/docs/components/v-calendar.md create mode 100644 apps/www/src/content/docs/components/v-date-picker.md create mode 100644 apps/www/src/lib/registry/default/example/CalendarForm.vue create mode 100644 apps/www/src/lib/registry/default/example/CalendarWithSelect.vue create mode 100644 apps/www/src/lib/registry/default/example/RangeCalendarDemo.vue create mode 100644 apps/www/src/lib/registry/default/example/VCalendarDemo.vue create mode 100644 apps/www/src/lib/registry/default/example/VDatePickerDemo.vue create mode 100644 apps/www/src/lib/registry/default/example/VDatePickerForm.vue create mode 100644 apps/www/src/lib/registry/default/example/VDatePickerWithPresets.vue create mode 100644 apps/www/src/lib/registry/default/example/VDatePickerWithRange.vue rename apps/www/src/lib/registry/default/example/{DateTimePickerDemo.vue => VDateTimePickerDemo.vue} (93%) rename apps/www/src/lib/registry/default/example/{RangePickerWithSlot.vue => VRangePickerWithSlot.vue} (96%) create mode 100644 apps/www/src/lib/registry/default/ui/calendar/CalendarCell.vue create mode 100644 apps/www/src/lib/registry/default/ui/calendar/CalendarCellTrigger.vue create mode 100644 apps/www/src/lib/registry/default/ui/calendar/CalendarGrid.vue create mode 100644 apps/www/src/lib/registry/default/ui/calendar/CalendarGridBody.vue create mode 100644 apps/www/src/lib/registry/default/ui/calendar/CalendarGridHead.vue create mode 100644 apps/www/src/lib/registry/default/ui/calendar/CalendarGridRow.vue create mode 100644 apps/www/src/lib/registry/default/ui/calendar/CalendarHeadCell.vue create mode 100644 apps/www/src/lib/registry/default/ui/calendar/CalendarHeader.vue create mode 100644 apps/www/src/lib/registry/default/ui/calendar/CalendarHeading.vue create mode 100644 apps/www/src/lib/registry/default/ui/calendar/CalendarNextButton.vue create mode 100644 apps/www/src/lib/registry/default/ui/calendar/CalendarPrevButton.vue create mode 100644 apps/www/src/lib/registry/default/ui/range-calendar/RangeCalendar.vue create mode 100644 apps/www/src/lib/registry/default/ui/range-calendar/RangeCalendarCell.vue create mode 100644 apps/www/src/lib/registry/default/ui/range-calendar/RangeCalendarCellTrigger.vue create mode 100644 apps/www/src/lib/registry/default/ui/range-calendar/RangeCalendarGrid.vue create mode 100644 apps/www/src/lib/registry/default/ui/range-calendar/RangeCalendarGridBody.vue create mode 100644 apps/www/src/lib/registry/default/ui/range-calendar/RangeCalendarGridHead.vue create mode 100644 apps/www/src/lib/registry/default/ui/range-calendar/RangeCalendarGridRow.vue create mode 100644 apps/www/src/lib/registry/default/ui/range-calendar/RangeCalendarHeadCell.vue create mode 100644 apps/www/src/lib/registry/default/ui/range-calendar/RangeCalendarHeader.vue create mode 100644 apps/www/src/lib/registry/default/ui/range-calendar/RangeCalendarHeading.vue create mode 100644 apps/www/src/lib/registry/default/ui/range-calendar/RangeCalendarNextButton.vue create mode 100644 apps/www/src/lib/registry/default/ui/range-calendar/RangeCalendarPrevButton.vue create mode 100644 apps/www/src/lib/registry/default/ui/range-calendar/index.ts create mode 100644 apps/www/src/lib/registry/default/ui/v-calendar/Calendar.vue create mode 100644 apps/www/src/lib/registry/default/ui/v-calendar/index.ts create mode 100644 apps/www/src/lib/registry/new-york/example/CalendarForm.vue create mode 100644 apps/www/src/lib/registry/new-york/example/CalendarWithSelect.vue create mode 100644 apps/www/src/lib/registry/new-york/example/RangeCalendarDemo.vue create mode 100644 apps/www/src/lib/registry/new-york/example/VCalendarDemo.vue create mode 100644 apps/www/src/lib/registry/new-york/example/VDatePickerDemo.vue create mode 100644 apps/www/src/lib/registry/new-york/example/VDatePickerForm.vue create mode 100644 apps/www/src/lib/registry/new-york/example/VDatePickerWithPresets.vue create mode 100644 apps/www/src/lib/registry/new-york/example/VDatePickerWithRange.vue rename apps/www/src/lib/registry/new-york/example/{DateTimePickerDemo.vue => VDateTimePickerDemo.vue} (93%) rename apps/www/src/lib/registry/new-york/example/{RangePickerWithSlot.vue => VRangePickerWithSlot.vue} (96%) create mode 100644 apps/www/src/lib/registry/new-york/ui/calendar/CalendarCell.vue create mode 100644 apps/www/src/lib/registry/new-york/ui/calendar/CalendarCellTrigger.vue create mode 100644 apps/www/src/lib/registry/new-york/ui/calendar/CalendarGrid.vue create mode 100644 apps/www/src/lib/registry/new-york/ui/calendar/CalendarGridBody.vue create mode 100644 apps/www/src/lib/registry/new-york/ui/calendar/CalendarGridHead.vue create mode 100644 apps/www/src/lib/registry/new-york/ui/calendar/CalendarGridRow.vue create mode 100644 apps/www/src/lib/registry/new-york/ui/calendar/CalendarHeadCell.vue create mode 100644 apps/www/src/lib/registry/new-york/ui/calendar/CalendarHeader.vue create mode 100644 apps/www/src/lib/registry/new-york/ui/calendar/CalendarHeading.vue create mode 100644 apps/www/src/lib/registry/new-york/ui/calendar/CalendarNextButton.vue create mode 100644 apps/www/src/lib/registry/new-york/ui/calendar/CalendarPrevButton.vue create mode 100644 apps/www/src/lib/registry/new-york/ui/range-calendar/RangeCalendar.vue create mode 100644 apps/www/src/lib/registry/new-york/ui/range-calendar/RangeCalendarCell.vue create mode 100644 apps/www/src/lib/registry/new-york/ui/range-calendar/RangeCalendarCellTrigger.vue create mode 100644 apps/www/src/lib/registry/new-york/ui/range-calendar/RangeCalendarGrid.vue create mode 100644 apps/www/src/lib/registry/new-york/ui/range-calendar/RangeCalendarGridBody.vue create mode 100644 apps/www/src/lib/registry/new-york/ui/range-calendar/RangeCalendarGridHead.vue create mode 100644 apps/www/src/lib/registry/new-york/ui/range-calendar/RangeCalendarGridRow.vue create mode 100644 apps/www/src/lib/registry/new-york/ui/range-calendar/RangeCalendarHeadCell.vue create mode 100644 apps/www/src/lib/registry/new-york/ui/range-calendar/RangeCalendarHeader.vue create mode 100644 apps/www/src/lib/registry/new-york/ui/range-calendar/RangeCalendarHeading.vue create mode 100644 apps/www/src/lib/registry/new-york/ui/range-calendar/RangeCalendarNextButton.vue create mode 100644 apps/www/src/lib/registry/new-york/ui/range-calendar/RangeCalendarPrevButton.vue create mode 100644 apps/www/src/lib/registry/new-york/ui/range-calendar/index.ts create mode 100644 apps/www/src/lib/registry/new-york/ui/v-calendar/Calendar.vue create mode 100644 apps/www/src/lib/registry/new-york/ui/v-calendar/index.ts create mode 100644 apps/www/src/public/registry/styles/default/range-calendar.json create mode 100644 apps/www/src/public/registry/styles/default/v-calendar.json create mode 100644 apps/www/src/public/registry/styles/new-york/range-calendar.json create mode 100644 apps/www/src/public/registry/styles/new-york/v-calendar.json diff --git a/apps/www/.vitepress/theme/components/theming/Theming.vue b/apps/www/.vitepress/theme/components/theming/Theming.vue index a3047b9a..bf3b949e 100644 --- a/apps/www/.vitepress/theme/components/theming/Theming.vue +++ b/apps/www/.vitepress/theme/components/theming/Theming.vue @@ -1,6 +1,8 @@