chore(docs): Updated UI Reference (automated) (#9726)

Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2024-10-24 09:38:58 +00:00
1 parent 432af1e2d1
commit e196ad7659
99 files changed
+2962 -2581

No files matched your search

+2 -2
View File
@@ -2,7 +2,7 @@ import { Calendar } from "@medusajs/ui"
import * as React from "react"
export default function CalendarDemo() {
const [date, setDate] = React.useState<Date | undefined>()
const [date, setDate] = React.useState<Date | null>()
return <Calendar selected={date} onSelect={setDate} />
return <Calendar value={date} onChange={setDate} />
}
@@ -1,9 +0,0 @@
import { Calendar } from "@medusajs/ui"
import * as React from "react"
import { es } from "date-fns/locale"
export default function CalendarDemo() {
const [date, setDate] = React.useState<Date | undefined>()
return <Calendar selected={date} onSelect={setDate} locale={es} />
}
@@ -1,13 +0,0 @@
import { Calendar } from "@medusajs/ui"
import * as React from "react"
import type { DateRange } from "react-day-picker"
export default function CalendarRange() {
const [dates, setDates] = React.useState<DateRange | undefined>()
const setDateRange = (range: DateRange | undefined) => {
setDates(range)
}
return <Calendar selected={dates} onSelect={setDateRange} mode="range" />
}
@@ -1,8 +0,0 @@
import { Calendar } from "@medusajs/ui"
import * as React from "react"
export default function CalendarSingle() {
const [date, setDate] = React.useState<Date | undefined>()
return <Calendar selected={date} onSelect={setDate} />
}
@@ -3,7 +3,7 @@ import { DatePicker } from "@medusajs/ui"
export default function DatePickerDemo() {
return (
<div className="w-[250px]">
<DatePicker placeholder="Pick a date" />
<DatePicker />
</div>
)
}
@@ -1,10 +0,0 @@
import { DatePicker } from "@medusajs/ui"
import { es } from "date-fns/locale"
export default function DatePickerDemo() {
return (
<div className="w-[250px]">
<DatePicker locale={es} placeholder="Elija una fecha" />
</div>
)
}
@@ -1,52 +0,0 @@
import { DatePicker } from "@medusajs/ui"
export default function DatePickerRangePresetsTime() {
return (
<div className="w-[250px]">
<DatePicker
placeholder="Pick a date"
showTimePicker
mode="range"
presets={[
{
dateRange: {
to: new Date(),
from: new Date(),
},
label: "Today",
},
{
label: "Past 7 days",
dateRange: {
to: new Date(),
from: new Date(new Date().setDate(new Date().getDate() - 7)),
},
},
{
label: "Past 30 days",
dateRange: {
to: new Date(),
from: new Date(new Date().setDate(new Date().getDate() - 30)),
},
},
{
label: "Past 90 days",
dateRange: {
to: new Date(),
from: new Date(new Date().setDate(new Date().getDate() - 90)),
},
},
{
label: "Past year",
dateRange: {
to: new Date(),
from: new Date(
new Date().setFullYear(new Date().getFullYear() - 1)
),
},
},
]}
/>
</div>
)
}
@@ -1,51 +0,0 @@
import { DatePicker } from "@medusajs/ui"
export default function DatePickerRangePresets() {
return (
<div className="w-[250px]">
<DatePicker
placeholder="Pick a date"
mode="range"
presets={[
{
dateRange: {
to: new Date(),
from: new Date(),
},
label: "Today",
},
{
label: "Past 7 days",
dateRange: {
to: new Date(),
from: new Date(new Date().setDate(new Date().getDate() - 7)),
},
},
{
label: "Past 30 days",
dateRange: {
to: new Date(),
from: new Date(new Date().setDate(new Date().getDate() - 30)),
},
},
{
label: "Past 90 days",
dateRange: {
to: new Date(),
from: new Date(new Date().setDate(new Date().getDate() - 90)),
},
},
{
label: "Past year",
dateRange: {
to: new Date(),
from: new Date(
new Date().setFullYear(new Date().getFullYear() - 1)
),
},
},
]}
/>
</div>
)
}
@@ -1,9 +0,0 @@
import { DatePicker } from "@medusajs/ui"
export default function DatePickerRangeTime() {
return (
<div className="w-[250px]">
<DatePicker showTimePicker mode="range" placeholder="Pick a date" />
</div>
)
}
@@ -1,9 +0,0 @@
import { DatePicker } from "@medusajs/ui"
export default function DatePickerRange() {
return (
<div className="w-[250px]">
<DatePicker mode="range" placeholder="Pick a date" />
</div>
)
}
@@ -1,36 +0,0 @@
import { DatePicker } from "@medusajs/ui"
export default function DatePickerSinglePresetsTime() {
return (
<div className="w-[250px]">
<DatePicker
placeholder="Pick a date"
showTimePicker
presets={[
{
date: new Date(),
label: "Today",
},
{
label: "Tomorrow",
date: new Date(new Date().setDate(new Date().getDate() + 1)),
},
{
label: "A week from now",
date: new Date(new Date().setDate(new Date().getDate() + 7)),
},
{
label: "A month from now",
date: new Date(new Date().setMonth(new Date().getMonth() + 1)),
},
{
label: "A year from now",
date: new Date(
new Date().setFullYear(new Date().getFullYear() + 1)
),
},
]}
/>
</div>
)
}
@@ -1,35 +0,0 @@
import { DatePicker } from "@medusajs/ui"
export default function DatePickerSinglePresets() {
return (
<div className="w-[250px]">
<DatePicker
placeholder="Pick a date"
presets={[
{
date: new Date(),
label: "Today",
},
{
label: "Tomorrow",
date: new Date(new Date().setDate(new Date().getDate() + 1)),
},
{
label: "A week from now",
date: new Date(new Date().setDate(new Date().getDate() + 7)),
},
{
label: "A month from now",
date: new Date(new Date().setMonth(new Date().getMonth() + 1)),
},
{
label: "A year from now",
date: new Date(
new Date().setFullYear(new Date().getFullYear() + 1)
),
},
]}
/>
</div>
)
}
@@ -1,9 +0,0 @@
import { DatePicker } from "@medusajs/ui"
export default function DatePickerSingleTime() {
return (
<div className="w-[250px]">
<DatePicker showTimePicker placeholder="Pick a date" />
</div>
)
}
@@ -1,9 +0,0 @@
import { DatePicker } from "@medusajs/ui"
export default function DatePickerSingle() {
return (
<div className="w-[250px]">
<DatePicker placeholder="Pick a date" />
</div>
)
}