diff --git a/apps/www/.vitepress/theme/config/docs.ts b/apps/www/.vitepress/theme/config/docs.ts index 2e34421b..ef2fa5e9 100644 --- a/apps/www/.vitepress/theme/config/docs.ts +++ b/apps/www/.vitepress/theme/config/docs.ts @@ -183,7 +183,7 @@ export const docsConfig: DocsConfig = { title: 'Calendar', href: '/docs/components/calendar', items: [], - label: 'New', + label: 'Updated', }, { title: 'Card', @@ -226,6 +226,12 @@ export const docsConfig: DocsConfig = { href: '/docs/components/data-table', items: [], }, + { + title: 'Date Picker', + href: '/docs/components/date-picker', + items: [], + label: 'Updated', + }, { title: 'Dialog', href: '/docs/components/dialog', @@ -298,6 +304,12 @@ export const docsConfig: DocsConfig = { href: '/docs/components/radio-group', items: [], }, + { + title: 'Range Calendar', + href: '/docs/components/range-calendar', + items: [], + label: 'New', + }, { title: 'Resizable', href: '/docs/components/resizable', diff --git a/apps/www/__registry__/index.ts b/apps/www/__registry__/index.ts index 36567140..2e72d58c 100644 --- a/apps/www/__registry__/index.ts +++ b/apps/www/__registry__/index.ts @@ -202,7 +202,7 @@ export const Index = { "CalendarWithSelect": { name: "CalendarWithSelect", type: "components:example", - registryDependencies: [], + registryDependencies: ["calendar","select","utils"], component: () => import("../src/lib/registry/default/example/CalendarWithSelect.vue").then((m) => m.default), files: ["../src/lib/registry/default/example/CalendarWithSelect.vue"], }, @@ -409,6 +409,34 @@ export const Index = { component: () => import("../src/lib/registry/default/example/DataTableDemoColumn.vue").then((m) => m.default), files: ["../src/lib/registry/default/example/DataTableDemoColumn.vue"], }, + "DatePickerDemo": { + name: "DatePickerDemo", + type: "components:example", + registryDependencies: ["calendar","button","popover","utils"], + component: () => import("../src/lib/registry/default/example/DatePickerDemo.vue").then((m) => m.default), + files: ["../src/lib/registry/default/example/DatePickerDemo.vue"], + }, + "DatePickerForm": { + name: "DatePickerForm", + type: "components:example", + registryDependencies: [], + component: () => import("../src/lib/registry/default/example/DatePickerForm.vue").then((m) => m.default), + files: ["../src/lib/registry/default/example/DatePickerForm.vue"], + }, + "DatePickerWithPresets": { + name: "DatePickerWithPresets", + type: "components:example", + registryDependencies: [], + component: () => import("../src/lib/registry/default/example/DatePickerWithPresets.vue").then((m) => m.default), + files: ["../src/lib/registry/default/example/DatePickerWithPresets.vue"], + }, + "DatePickerWithRange": { + name: "DatePickerWithRange", + type: "components:example", + registryDependencies: ["range-calendar","button","popover","utils"], + component: () => import("../src/lib/registry/default/example/DatePickerWithRange.vue").then((m) => m.default), + files: ["../src/lib/registry/default/example/DatePickerWithRange.vue"], + }, "DialogCustomCloseButton": { name: "DialogCustomCloseButton", type: "components:example", @@ -633,6 +661,13 @@ export const Index = { component: () => import("../src/lib/registry/default/example/RadioGroupForm.vue").then((m) => m.default), files: ["../src/lib/registry/default/example/RadioGroupForm.vue"], }, + "RangeCalendarDemo": { + name: "RangeCalendarDemo", + type: "components:example", + registryDependencies: ["range-calendar"], + component: () => import("../src/lib/registry/default/example/RangeCalendarDemo.vue").then((m) => m.default), + files: ["../src/lib/registry/default/example/RangeCalendarDemo.vue"], + }, "ResizableDemo": { name: "ResizableDemo", type: "components:example", @@ -1379,7 +1414,7 @@ export const Index = { "CalendarWithSelect": { name: "CalendarWithSelect", type: "components:example", - registryDependencies: [], + registryDependencies: ["calendar","select","utils"], component: () => import("../src/lib/registry/new-york/example/CalendarWithSelect.vue").then((m) => m.default), files: ["../src/lib/registry/new-york/example/CalendarWithSelect.vue"], }, @@ -1586,6 +1621,34 @@ export const Index = { component: () => import("../src/lib/registry/new-york/example/DataTableDemoColumn.vue").then((m) => m.default), files: ["../src/lib/registry/new-york/example/DataTableDemoColumn.vue"], }, + "DatePickerDemo": { + name: "DatePickerDemo", + type: "components:example", + registryDependencies: ["calendar","button","popover","utils"], + component: () => import("../src/lib/registry/new-york/example/DatePickerDemo.vue").then((m) => m.default), + files: ["../src/lib/registry/new-york/example/DatePickerDemo.vue"], + }, + "DatePickerForm": { + name: "DatePickerForm", + type: "components:example", + registryDependencies: [], + component: () => import("../src/lib/registry/new-york/example/DatePickerForm.vue").then((m) => m.default), + files: ["../src/lib/registry/new-york/example/DatePickerForm.vue"], + }, + "DatePickerWithPresets": { + name: "DatePickerWithPresets", + type: "components:example", + registryDependencies: [], + component: () => import("../src/lib/registry/new-york/example/DatePickerWithPresets.vue").then((m) => m.default), + files: ["../src/lib/registry/new-york/example/DatePickerWithPresets.vue"], + }, + "DatePickerWithRange": { + name: "DatePickerWithRange", + type: "components:example", + registryDependencies: ["range-calendar","button","popover","utils"], + component: () => import("../src/lib/registry/new-york/example/DatePickerWithRange.vue").then((m) => m.default), + files: ["../src/lib/registry/new-york/example/DatePickerWithRange.vue"], + }, "DialogCustomCloseButton": { name: "DialogCustomCloseButton", type: "components:example", @@ -1810,6 +1873,13 @@ export const Index = { component: () => import("../src/lib/registry/new-york/example/RadioGroupForm.vue").then((m) => m.default), files: ["../src/lib/registry/new-york/example/RadioGroupForm.vue"], }, + "RangeCalendarDemo": { + name: "RangeCalendarDemo", + type: "components:example", + registryDependencies: ["range-calendar"], + component: () => import("../src/lib/registry/new-york/example/RangeCalendarDemo.vue").then((m) => m.default), + files: ["../src/lib/registry/new-york/example/RangeCalendarDemo.vue"], + }, "ResizableDemo": { name: "ResizableDemo", type: "components:example", diff --git a/apps/www/src/content/docs/components/calendar.md b/apps/www/src/content/docs/components/calendar.md index ff489df6..854ea9cd 100644 --- a/apps/www/src/content/docs/components/calendar.md +++ b/apps/www/src/content/docs/components/calendar.md @@ -7,15 +7,21 @@ primitive: https://www.radix-vue.com/components/calendar.html + + +If you're looking for **previous** Calendar implementation, checkout to [VCalendar](/docs/components/v-calendar) component + + + ## About The `` component is built on top of the [RadixVue Calendar](https://www.radix-vue.com/components/calendar.html) component, which uses the [@internationalized/date](https://react-spectrum.adobe.com/internationalized/date/index.html) package to handle dates. -If you're looking for a range calendar, check out the [Range Calendar](#asdasd) component. +If you're looking for a range calendar, check out the [Range Calendar](/docs/components/range-calendar) component. ## Installation -```shell +```bash npx shadcn-vue@latest add calendar ``` diff --git a/apps/www/src/content/docs/components/date-picker.md b/apps/www/src/content/docs/components/date-picker.md new file mode 100644 index 00000000..6073c593 --- /dev/null +++ b/apps/www/src/content/docs/components/date-picker.md @@ -0,0 +1,38 @@ +--- +title: Date Picker +description: A date picker component with range and presets. +source: apps/www/src/lib/registry/default/example/DatePickerDemo.vue +primitive: https://www.radix-vue.com/components/calendar.html +--- + + + + + +If you're looking for **previous** Date Picker implementation, checkout to [VCalendar Datepicker](/docs/components/v-date-picker) component + + + +## Installation + +The Date Picker is built using a composition of the `` and either the `` or `` components. + +See installations instructions for the [Popover](/docs/components/popover), [Calendar](/docs/components/calendar), and [Range Calendar](/docs/components/range-calendar) components. + +## Examples + +### Date Picker + + + +### Date Range Picker + + + +### With Presets + + + +### Form + + diff --git a/apps/www/src/content/docs/components/range-calendar.md b/apps/www/src/content/docs/components/range-calendar.md new file mode 100644 index 00000000..b8ea7312 --- /dev/null +++ b/apps/www/src/content/docs/components/range-calendar.md @@ -0,0 +1,18 @@ +--- +title: Range Calendar +description: A calendar component that allows users to select a range of dates. +source: apps/www/src/lib/registry/default/ui/range-calendar +primitive: https://www.radix-vue.com/components/range-calendar.html +--- + + + +## About + +The `` component is built on top of the [RadixVue Range Calendar](https://www.bits-ui.com/docs/components/range-calendar) component, which uses the [@internationalized/date](https://react-spectrum.adobe.com/internationalized/date/index.html) package to handle dates. + +## Installation + +```bash +npx shadcn-vue@latest add range-calendar +``` diff --git a/apps/www/src/content/docs/components/v-calendar.md b/apps/www/src/content/docs/components/v-calendar.md index 88b271be..c5c9b097 100644 --- a/apps/www/src/content/docs/components/v-calendar.md +++ b/apps/www/src/content/docs/components/v-calendar.md @@ -1,5 +1,5 @@ --- -title: Calendar +title: VCalendar description: A date field component that allows users to enter and edit date. source: apps/www/src/lib/registry/default/ui/calendar primitive: https://vcalendar.io/ @@ -17,7 +17,7 @@ The `Calendar` component is built on top of [VCalendar](https://vcalendar.io/get diff --git a/apps/www/src/content/docs/components/v-date-picker.md b/apps/www/src/content/docs/components/v-date-picker.md index d04e156d..219e36c5 100644 --- a/apps/www/src/content/docs/components/v-date-picker.md +++ b/apps/www/src/content/docs/components/v-date-picker.md @@ -1,5 +1,5 @@ --- -title: Date Picker +title: VCalendar Date Picker description: A date picker component with range and presets. --- diff --git a/apps/www/src/lib/registry/default/example/CalendarWithSelect.vue b/apps/www/src/lib/registry/default/example/CalendarWithSelect.vue index f58fe4bf..473b401b 100644 --- a/apps/www/src/lib/registry/default/example/CalendarWithSelect.vue +++ b/apps/www/src/lib/registry/default/example/CalendarWithSelect.vue @@ -1,7 +1,7 @@ + + diff --git a/apps/www/src/lib/registry/default/example/DatePickerForm.vue b/apps/www/src/lib/registry/default/example/DatePickerForm.vue new file mode 100644 index 00000000..64812a51 --- /dev/null +++ b/apps/www/src/lib/registry/default/example/DatePickerForm.vue @@ -0,0 +1,109 @@ + + + diff --git a/apps/www/src/lib/registry/default/example/DatePickerWithPresets.vue b/apps/www/src/lib/registry/default/example/DatePickerWithPresets.vue new file mode 100644 index 00000000..4f64cf24 --- /dev/null +++ b/apps/www/src/lib/registry/default/example/DatePickerWithPresets.vue @@ -0,0 +1,64 @@ + + + diff --git a/apps/www/src/lib/registry/default/example/DatePickerWithRange.vue b/apps/www/src/lib/registry/default/example/DatePickerWithRange.vue new file mode 100644 index 00000000..aca54025 --- /dev/null +++ b/apps/www/src/lib/registry/default/example/DatePickerWithRange.vue @@ -0,0 +1,52 @@ + + + diff --git a/apps/www/src/lib/registry/default/example/RangeCalendarDemo.vue b/apps/www/src/lib/registry/default/example/RangeCalendarDemo.vue new file mode 100644 index 00000000..caec1ef6 --- /dev/null +++ b/apps/www/src/lib/registry/default/example/RangeCalendarDemo.vue @@ -0,0 +1,18 @@ + + + diff --git a/apps/www/src/lib/registry/default/ui/calendar/CalendarGridHead.vue b/apps/www/src/lib/registry/default/ui/calendar/CalendarGridHead.vue index 20660e06..f8101a3d 100644 --- a/apps/www/src/lib/registry/default/ui/calendar/CalendarGridHead.vue +++ b/apps/www/src/lib/registry/default/ui/calendar/CalendarGridHead.vue @@ -1,5 +1,4 @@ + + diff --git a/apps/www/src/lib/registry/default/ui/range-calendar/RangeCalendarCell.vue b/apps/www/src/lib/registry/default/ui/range-calendar/RangeCalendarCell.vue new file mode 100644 index 00000000..bc8e4152 --- /dev/null +++ b/apps/www/src/lib/registry/default/ui/range-calendar/RangeCalendarCell.vue @@ -0,0 +1,24 @@ + + + diff --git a/apps/www/src/lib/registry/default/ui/range-calendar/RangeCalendarCellTrigger.vue b/apps/www/src/lib/registry/default/ui/range-calendar/RangeCalendarCellTrigger.vue new file mode 100644 index 00000000..283aad5e --- /dev/null +++ b/apps/www/src/lib/registry/default/ui/range-calendar/RangeCalendarCellTrigger.vue @@ -0,0 +1,40 @@ + + + diff --git a/apps/www/src/lib/registry/default/ui/range-calendar/RangeCalendarGrid.vue b/apps/www/src/lib/registry/default/ui/range-calendar/RangeCalendarGrid.vue new file mode 100644 index 00000000..e346b07d --- /dev/null +++ b/apps/www/src/lib/registry/default/ui/range-calendar/RangeCalendarGrid.vue @@ -0,0 +1,24 @@ + + + diff --git a/apps/www/src/lib/registry/default/ui/range-calendar/RangeCalendarGridBody.vue b/apps/www/src/lib/registry/default/ui/range-calendar/RangeCalendarGridBody.vue new file mode 100644 index 00000000..cae15cc7 --- /dev/null +++ b/apps/www/src/lib/registry/default/ui/range-calendar/RangeCalendarGridBody.vue @@ -0,0 +1,11 @@ + + + diff --git a/apps/www/src/lib/registry/default/ui/range-calendar/RangeCalendarGridHead.vue b/apps/www/src/lib/registry/default/ui/range-calendar/RangeCalendarGridHead.vue new file mode 100644 index 00000000..c11ad365 --- /dev/null +++ b/apps/www/src/lib/registry/default/ui/range-calendar/RangeCalendarGridHead.vue @@ -0,0 +1,11 @@ + + + diff --git a/apps/www/src/lib/registry/default/ui/range-calendar/RangeCalendarGridRow.vue b/apps/www/src/lib/registry/default/ui/range-calendar/RangeCalendarGridRow.vue new file mode 100644 index 00000000..425ed58f --- /dev/null +++ b/apps/www/src/lib/registry/default/ui/range-calendar/RangeCalendarGridRow.vue @@ -0,0 +1,21 @@ + + + diff --git a/apps/www/src/lib/registry/default/ui/range-calendar/RangeCalendarHeadCell.vue b/apps/www/src/lib/registry/default/ui/range-calendar/RangeCalendarHeadCell.vue new file mode 100644 index 00000000..26ea9283 --- /dev/null +++ b/apps/www/src/lib/registry/default/ui/range-calendar/RangeCalendarHeadCell.vue @@ -0,0 +1,21 @@ + + + diff --git a/apps/www/src/lib/registry/default/ui/range-calendar/RangeCalendarHeader.vue b/apps/www/src/lib/registry/default/ui/range-calendar/RangeCalendarHeader.vue new file mode 100644 index 00000000..7d98cafa --- /dev/null +++ b/apps/www/src/lib/registry/default/ui/range-calendar/RangeCalendarHeader.vue @@ -0,0 +1,21 @@ + + + diff --git a/apps/www/src/lib/registry/default/ui/range-calendar/RangeCalendarHeading.vue b/apps/www/src/lib/registry/default/ui/range-calendar/RangeCalendarHeading.vue new file mode 100644 index 00000000..51ee1f8b --- /dev/null +++ b/apps/www/src/lib/registry/default/ui/range-calendar/RangeCalendarHeading.vue @@ -0,0 +1,27 @@ + + + diff --git a/apps/www/src/lib/registry/default/ui/range-calendar/RangeCalendarNextButton.vue b/apps/www/src/lib/registry/default/ui/range-calendar/RangeCalendarNextButton.vue new file mode 100644 index 00000000..e82731e4 --- /dev/null +++ b/apps/www/src/lib/registry/default/ui/range-calendar/RangeCalendarNextButton.vue @@ -0,0 +1,32 @@ + + + diff --git a/apps/www/src/lib/registry/default/ui/range-calendar/RangeCalendarPrevButton.vue b/apps/www/src/lib/registry/default/ui/range-calendar/RangeCalendarPrevButton.vue new file mode 100644 index 00000000..97d5cbf4 --- /dev/null +++ b/apps/www/src/lib/registry/default/ui/range-calendar/RangeCalendarPrevButton.vue @@ -0,0 +1,32 @@ + + + diff --git a/apps/www/src/lib/registry/default/ui/range-calendar/index.ts b/apps/www/src/lib/registry/default/ui/range-calendar/index.ts new file mode 100644 index 00000000..7ba1637e --- /dev/null +++ b/apps/www/src/lib/registry/default/ui/range-calendar/index.ts @@ -0,0 +1,12 @@ +export { default as RangeCalendar } from './RangeCalendar.vue' +export { default as RangeCalendarCell } from './RangeCalendarCell.vue' +export { default as RangeCalendarCellTrigger } from './RangeCalendarCellTrigger.vue' +export { default as RangeCalendarGrid } from './RangeCalendarGrid.vue' +export { default as RangeCalendarGridBody } from './RangeCalendarGridBody.vue' +export { default as RangeCalendarGridHead } from './RangeCalendarGridHead.vue' +export { default as RangeCalendarGridRow } from './RangeCalendarGridRow.vue' +export { default as RangeCalendarHeadCell } from './RangeCalendarHeadCell.vue' +export { default as RangeCalendarHeader } from './RangeCalendarHeader.vue' +export { default as RangeCalendarHeading } from './RangeCalendarHeading.vue' +export { default as RangeCalendarNextButton } from './RangeCalendarNextButton.vue' +export { default as RangeCalendarPrevButton } from './RangeCalendarPrevButton.vue' diff --git a/apps/www/src/lib/registry/new-york/example/CalendarDemo.vue b/apps/www/src/lib/registry/new-york/example/CalendarDemo.vue index 1ef56466..33243667 100644 --- a/apps/www/src/lib/registry/new-york/example/CalendarDemo.vue +++ b/apps/www/src/lib/registry/new-york/example/CalendarDemo.vue @@ -1,7 +1,11 @@ diff --git a/apps/www/src/lib/registry/new-york/example/CalendarForm.vue b/apps/www/src/lib/registry/new-york/example/CalendarForm.vue index 01299290..fc66b26f 100644 --- a/apps/www/src/lib/registry/new-york/example/CalendarForm.vue +++ b/apps/www/src/lib/registry/new-york/example/CalendarForm.vue @@ -1,11 +1,13 @@