diff --git a/apps/www/.vitepress/theme/config/docs.ts b/apps/www/.vitepress/theme/config/docs.ts
index 1a28cbea..d3e1e941 100644
--- a/apps/www/.vitepress/theme/config/docs.ts
+++ b/apps/www/.vitepress/theme/config/docs.ts
@@ -133,13 +133,11 @@ export const docsConfig: DocsConfig = {
href: '/docs/components/button',
items: [],
},
- // {
- // title: "Calendar",
- // href: "#",
- // label: "Soon",
- // disabled: true,
- // items: []
- // },
+ {
+ title: 'Calendar',
+ href: '/docs/components/calendar',
+ items: [],
+ },
{
title: 'Card',
href: '/docs/components/card',
@@ -179,13 +177,11 @@ export const docsConfig: DocsConfig = {
href: '/docs/components/data-table',
items: [],
},
- // {
- // title: "Date Picker",
- // href: "#",
- // label: "Soon",
- // disabled: true,
- // items: []
- // },
+ {
+ title: 'Date Picker',
+ href: '/docs/components/date-picker',
+ items: [],
+ },
{
title: 'Dialog',
href: '/docs/components/dialog',
diff --git a/apps/www/package.json b/apps/www/package.json
index c5a35ea4..b968fa12 100644
--- a/apps/www/package.json
+++ b/apps/www/package.json
@@ -16,8 +16,10 @@
"@vueuse/core": "^10.2.1",
"class-variance-authority": "^0.6.1",
"clsx": "^2.0.0",
+ "date-fns": "^2.30.0",
"lucide-vue-next": "^0.268.0",
"tailwindcss-animate": "^1.0.6",
+ "v-calendar": "^3.0.3",
"vitepress": "^1.0.0-rc.10",
"vue": "^3.3.4"
},
diff --git a/apps/www/src/content/docs/components/calendar.md b/apps/www/src/content/docs/components/calendar.md
new file mode 100644
index 00000000..58bd3046
--- /dev/null
+++ b/apps/www/src/content/docs/components/calendar.md
@@ -0,0 +1,44 @@
+---
+title: Calendar
+description: A date field component that allows users to enter and edit date.
+---
+
+
+
+
+<<< ../../../lib/registry/default/examples/CalendarDemo.vue
+
+
+
+## About
+
+The `Calendar` component is built on top of [VCalendar](https://vcalendar.io/getting-started/installation.html).
+
+## Installation
+
+```bash
+npx shadcn-vue@latest add calendar
+```
+
+
+
+1. Install `radix-vue`:
+
+```bash
+npm install radix-vue
+```
+
+2. Copy and paste the component source files linked at the top of this page into your project.
+
+
+## Usage
+
+```vue
+
+
+
+
+
+```
\ No newline at end of file
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..22c22fd8
--- /dev/null
+++ b/apps/www/src/content/docs/components/date-picker.md
@@ -0,0 +1,79 @@
+---
+title: Date Picker
+description: A date picker component with range and presets.
+---
+
+
+
+
+<<< ../../../lib/registry/default/examples/DatePickerDemo.vue
+
+
+
+## Installation
+
+The Date Picker is built using a composition of the `` and the `` components.
+
+See installation instructions for the [Popover](/docs/components/popover#installation) and the [Calendar](/docs/components/calendar#installation) components.
+
+## Usage
+
+```vue
+
+
+
+
+
+
+
+
+
+
+
+
+```
+
+
+## Examples
+
+### Date Range Picker
+
+
+
+<<< ../../../lib/registry/default/examples/DatePickerWithRange.vue
+
+
+
+
+### Date Picker
+
+
+
+
+<<< ../../../lib/registry/default/examples/DatePickerDemo.vue
+
+
diff --git a/apps/www/src/lib/registry/default/examples/CalendarDemo.vue b/apps/www/src/lib/registry/default/examples/CalendarDemo.vue
new file mode 100644
index 00000000..3dd2a71a
--- /dev/null
+++ b/apps/www/src/lib/registry/default/examples/CalendarDemo.vue
@@ -0,0 +1,10 @@
+
+
+
+
+
diff --git a/apps/www/src/lib/registry/default/examples/DatePickerDemo.vue b/apps/www/src/lib/registry/default/examples/DatePickerDemo.vue
new file mode 100644
index 00000000..18334e63
--- /dev/null
+++ b/apps/www/src/lib/registry/default/examples/DatePickerDemo.vue
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/apps/www/src/lib/registry/default/examples/DatePickerWithRange.vue b/apps/www/src/lib/registry/default/examples/DatePickerWithRange.vue
new file mode 100644
index 00000000..b892d3d8
--- /dev/null
+++ b/apps/www/src/lib/registry/default/examples/DatePickerWithRange.vue
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/apps/www/src/lib/registry/default/ui/calendar/Calendar.vue b/apps/www/src/lib/registry/default/ui/calendar/Calendar.vue
index 07711513..78f15c80 100644
--- a/apps/www/src/lib/registry/default/ui/calendar/Calendar.vue
+++ b/apps/www/src/lib/registry/default/ui/calendar/Calendar.vue
@@ -1,63 +1,110 @@
-
+
-
diff --git a/apps/www/src/lib/registry/default/ui/tabs/TabsTrigger.vue b/apps/www/src/lib/registry/default/ui/tabs/TabsTrigger.vue
index 84a9d66f..5255c621 100644
--- a/apps/www/src/lib/registry/default/ui/tabs/TabsTrigger.vue
+++ b/apps/www/src/lib/registry/default/ui/tabs/TabsTrigger.vue
@@ -10,7 +10,7 @@ const props = defineProps()
v-bind="props"
:class="
cn(
- 'inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1.5 text-sm font-medium transition-all focus-visible:outline-none disabled:cursor-default disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow',
+ 'inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm',
props.class,
)
"
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 6bc728e9..c79918ff 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -56,12 +56,18 @@ importers:
clsx:
specifier: ^2.0.0
version: 2.0.0
+ date-fns:
+ specifier: ^2.30.0
+ version: 2.30.0
lucide-vue-next:
specifier: ^0.268.0
version: 0.268.0(vue@3.3.4)
tailwindcss-animate:
specifier: ^1.0.6
version: 1.0.6(tailwindcss@3.3.2)
+ v-calendar:
+ specifier: ^3.0.3
+ version: 3.0.3(@popperjs/core@2.11.8)(vue@3.3.4)
vitepress:
specifier: ^1.0.0-rc.10
version: 1.0.0-rc.10(@algolia/client-search@4.19.1)(@types/node@20.5.7)(search-insights@2.7.0)
@@ -818,6 +824,13 @@ packages:
'@babel/plugin-syntax-typescript': 7.22.5(@babel/core@7.22.11)
dev: false
+ /@babel/runtime@7.22.11:
+ resolution: {integrity: sha512-ee7jVNlWN09+KftVOu9n7S8gQzD/Z6hN/I8VBRXW4P1+Xe7kJGXMwu8vds4aGIMHZnNbdpSWCfZZtinytpcAvA==}
+ engines: {node: '>=6.9.0'}
+ dependencies:
+ regenerator-runtime: 0.14.0
+ dev: false
+
/@babel/standalone@7.22.10:
resolution: {integrity: sha512-VmK2sWxUTfDDh9mPfCtFJPIehZToteqK+Zpwq8oJUjJ+WeeKIFTTQIrDzH7jEdom+cAaaguU7FI/FBsBWFkIeQ==}
engines: {node: '>=6.9.0'}
@@ -1729,6 +1742,10 @@ packages:
resolution: {integrity: sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g==}
dev: true
+ /@popperjs/core@2.11.8:
+ resolution: {integrity: sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==}
+ dev: false
+
/@rollup/pluginutils@5.0.3:
resolution: {integrity: sha512-hfllNN4a80rwNQ9QCxhxuHCGHMAvabXqxNdaChUSSadMre7t4iEUI6fFAhBOn/eIYTgYVhBv7vCLsAJ4u3lf3g==}
engines: {node: '>=14.0.0'}
@@ -1840,7 +1857,6 @@ packages:
/@types/lodash@4.14.197:
resolution: {integrity: sha512-BMVOiWs0uNxHVlHBgzTIqJYmj+PgCo4euloGF+5m4okL3rEYzM2EEv78mw8zWSMM57dM7kVIgJ2QDvwHSoCI5g==}
- dev: true
/@types/mdast@3.0.12:
resolution: {integrity: sha512-DT+iNIRNX884cx0/Q1ja7NyUPpZuv0KPyL5rGNxm1WC1OtHstl7n4Jb7nk+xacNShQMbczJjt8uFzznpp6kYBg==}
@@ -1869,6 +1885,10 @@ packages:
kleur: 3.0.3
dev: true
+ /@types/resize-observer-browser@0.1.7:
+ resolution: {integrity: sha512-G9eN0Sn0ii9PWQ3Vl72jDPgeJwRWhv2Qk/nQkJuWmRmOB4HX3/BhD5SE1dZs/hzPZL/WKnvF0RHdTSG54QJFyg==}
+ dev: false
+
/@types/semver@7.5.0:
resolution: {integrity: sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==}
dev: true
@@ -2977,6 +2997,21 @@ packages:
engines: {node: '>= 12'}
dev: false
+ /date-fns-tz@1.3.8(date-fns@2.30.0):
+ resolution: {integrity: sha512-qwNXUFtMHTTU6CFSFjoJ80W8Fzzp24LntbjFFBgL/faqds4e5mo9mftoRLgr3Vi1trISsg4awSpYVsOQCRnapQ==}
+ peerDependencies:
+ date-fns: '>=2.0.0'
+ dependencies:
+ date-fns: 2.30.0
+ dev: false
+
+ /date-fns@2.30.0:
+ resolution: {integrity: sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==}
+ engines: {node: '>=0.11'}
+ dependencies:
+ '@babel/runtime': 7.22.11
+ dev: false
+
/de-indent@1.0.2:
resolution: {integrity: sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg==}
dev: true
@@ -4727,7 +4762,6 @@ packages:
/lodash@4.17.21:
resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==}
- dev: true
/log-symbols@5.1.0:
resolution: {integrity: sha512-l0x2DvrW294C9uDCoQe1VSU4gf529FkSZ6leBl4TiqZH/e+0R7hSfHQBNut2mNygDgHwvYHfFLn6Oxb3VWj2rA==}
@@ -5535,6 +5569,10 @@ packages:
strip-indent: 3.0.0
dev: true
+ /regenerator-runtime@0.14.0:
+ resolution: {integrity: sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==}
+ dev: false
+
/regexp-tree@0.1.27:
resolution: {integrity: sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA==}
hasBin: true
@@ -6497,6 +6535,22 @@ packages:
which-typed-array: 1.1.11
dev: false
+ /v-calendar@3.0.3(@popperjs/core@2.11.8)(vue@3.3.4):
+ resolution: {integrity: sha512-Skpp/nMoFqFadm94aWj0oOfazoux5T5Ug3/pbRbdolkoDrnVcL7Ronw1/SGFRUPGOwnLdYwhKPhrhSE1segW6w==}
+ peerDependencies:
+ '@popperjs/core': ^2.0.0
+ vue: ^3.2.0
+ dependencies:
+ '@popperjs/core': 2.11.8
+ '@types/lodash': 4.14.197
+ '@types/resize-observer-browser': 0.1.7
+ date-fns: 2.30.0
+ date-fns-tz: 1.3.8(date-fns@2.30.0)
+ lodash: 4.17.21
+ vue: 3.3.4
+ vue-screen-utils: 1.0.0-beta.13(vue@3.3.4)
+ dev: false
+
/v8-compile-cache-lib@3.0.1:
resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==}
@@ -6814,6 +6868,14 @@ packages:
- supports-color
dev: true
+ /vue-screen-utils@1.0.0-beta.13(vue@3.3.4):
+ resolution: {integrity: sha512-EJ/8TANKhFj+LefDuOvZykwMr3rrLFPLNb++lNBqPOpVigT2ActRg6icH9RFQVm4nHwlHIHSGm5OY/Clar9yIg==}
+ peerDependencies:
+ vue: ^3.2.0
+ dependencies:
+ vue: 3.3.4
+ dev: false
+
/vue-template-compiler@2.7.14:
resolution: {integrity: sha512-zyA5Y3ArvVG0NacJDkkzJuPQDF8RFeRlzV2vLeSnhSpieO6LK2OVbdLPi5MPPs09Ii+gMO8nY4S3iKQxBxDmWQ==}
dependencies: