diff --git a/src/components/DatePicker.astro b/src/components/DatePicker.astro index 9385c41..c71fd18 100644 --- a/src/components/DatePicker.astro +++ b/src/components/DatePicker.astro @@ -64,7 +64,7 @@ const fieldId = `field-${name.replace(/[[\]]/g, "-")}`; @@ -107,7 +107,7 @@ const fieldId = `field-${name.replace(/[[\]]/g, "-")}`; Today @@ -417,7 +417,7 @@ const fieldId = `field-${name.replace(/[[\]]/g, "-")}`; dayButton.type = "button"; dayButton.textContent = day; dayButton.className = - "wr:w-8 wr:h-8 wr:text-sm wr:rounded wr:transition-colors wr:hover:wr:bg-muted focus:wr:outline-none focus:wr:ring-2 focus:wr:ring-primary"; + "wr:w-8 wr:h-8 wr:text-sm wr:rounded wr:transition-colors wr:hover:bg-muted wr:focus:outline-none wr:focus:ring-2 wr:focus:ring-primary"; const isDisabled = this.isDateDisabled(currentDate); if (isDisabled) { diff --git a/src/components/DateTimePicker.astro b/src/components/DateTimePicker.astro index fb84281..d19768c 100644 --- a/src/components/DateTimePicker.astro +++ b/src/components/DateTimePicker.astro @@ -76,7 +76,7 @@ if (value) { @@ -128,7 +128,7 @@ if (value) { Time @@ -144,7 +144,7 @@ if (value) { { @@ -275,7 +275,7 @@ if (value) { AM PM @@ -302,14 +302,14 @@ if (value) { Now Apply @@ -556,7 +556,7 @@ if (value) { dayButton.type = "button"; dayButton.textContent = day; dayButton.className = - "wr:w-8 wr:h-8 wr:text-sm wr:rounded wr:transition-colors wr:hover:wr:bg-muted focus:wr:outline-none focus:wr:ring-2 focus:wr:ring-primary"; + "wr:w-8 wr:h-8 wr:text-sm wr:rounded wr:transition-colors wr:hover:bg-muted wr:focus:outline-none wr:focus:ring-2 wr:focus:ring-primary"; const dateStr = currentDate.toISOString().split("T")[0]; if (this.selectedDate === dateStr) { @@ -639,14 +639,14 @@ if (value) { this.dateTab.className = "wr:flex-1 wr:px-4 wr:py-2 wr:text-sm wr:font-medium wr:border-b-2 wr:border-primary wr:text-primary"; this.timeTab.className = - "wr:flex-1 wr:px-4 wr:py-2 wr:text-sm wr:font-medium wr:border-b-2 wr:border-transparent wr:text-muted-foreground hover:wr:text-foreground"; + "wr:flex-1 wr:px-4 wr:py-2 wr:text-sm wr:font-medium wr:border-b-2 wr:border-transparent wr:text-muted-foreground wr:hover:text-foreground"; this.datePanel.className = "wr:block"; this.timePanel.className = "wr:hidden"; } else { this.timeTab.className = "wr:flex-1 wr:px-4 wr:py-2 wr:text-sm wr:font-medium wr:border-b-2 wr:border-primary wr:text-primary"; this.dateTab.className = - "wr:flex-1 wr:px-4 wr:py-2 wr:text-sm wr:font-medium wr:border-b-2 wr:border-transparent wr:text-muted-foreground hover:wr:text-foreground"; + "wr:flex-1 wr:px-4 wr:py-2 wr:text-sm wr:font-medium wr:border-b-2 wr:border-transparent wr:text-muted-foreground wr:hover:text-foreground"; this.timePanel.className = "wr:block"; this.datePanel.className = "wr:hidden"; } diff --git a/src/components/Drawer.astro b/src/components/Drawer.astro new file mode 100644 index 0000000..70afa8c --- /dev/null +++ b/src/components/Drawer.astro @@ -0,0 +1,531 @@ +--- +// Drawer.astro +export interface Props { + position?: "left" | "right" | "top" | "bottom"; + size?: string; + overlay?: boolean; + closeOnOverlayClick?: boolean; + closeOnEsc?: boolean; + showCloseButton?: boolean; + animationDuration?: number; + zIndex?: number; + id?: string; + class?: string; + lockScroll?: boolean; + persistent?: boolean; + blurBackground?: boolean; +} + +const { + position = "right", + size = "320px", + overlay = true, + closeOnOverlayClick = true, + closeOnEsc = true, + showCloseButton = true, + animationDuration = 300, + zIndex = 1000, + id = `drawer-${Math.random().toString(36).slice(2)}`, + class: className = "", + lockScroll = true, + persistent = false, + blurBackground = false, +} = Astro.props; + +const isHorizontal = position === "left" || position === "right"; +const sizeProperty = isHorizontal ? "width" : "height"; +--- + + + + + + + + + + + { + overlay && ( + + ) + } + + + + + + + + + Drawer + + + + + { + showCloseButton && ( + + + + + + + ) + } + + + + + + + + + + + + + + diff --git a/src/components/Field.astro b/src/components/Field.astro index 71ffead..0c728e4 100644 --- a/src/components/Field.astro +++ b/src/components/Field.astro @@ -172,7 +172,7 @@ const controlWrap = "wr:relative"; {p.kind === "password" && ( diff --git a/src/components/FileUploader.astro b/src/components/FileUploader.astro index af23d8d..b2bc029 100644 --- a/src/components/FileUploader.astro +++ b/src/components/FileUploader.astro @@ -93,7 +93,7 @@ const fieldId = `field-${name.replace(/[[\]]/g, "-")}`; browse @@ -163,7 +163,7 @@ const fieldId = `field-${name.replace(/[[\]]/g, "-")}`; @@ -536,7 +536,7 @@ const fieldId = `field-${name.replace(/[[\]]/g, "-")}`; : "" } - @@ -202,7 +202,7 @@ const showChecklist = p.showChecklist ?? true; p.description && ( {p.description} diff --git a/src/components/TimePicker.astro b/src/components/TimePicker.astro index 8a52a59..ad20641 100644 --- a/src/components/TimePicker.astro +++ b/src/components/TimePicker.astro @@ -64,7 +64,7 @@ const fieldId = `field-${name.replace(/[[\]]/g, "-")}`; @@ -107,7 +107,7 @@ const fieldId = `field-${name.replace(/[[\]]/g, "-")}`; > @@ -124,7 +124,7 @@ const fieldId = `field-${name.replace(/[[\]]/g, "-")}`; > @@ -136,7 +136,7 @@ const fieldId = `field-${name.replace(/[[\]]/g, "-")}`; AM PM @@ -149,17 +149,17 @@ const fieldId = `field-${name.replace(/[[\]]/g, "-")}`; 9:00 12:00 17:00 @@ -168,7 +168,7 @@ const fieldId = `field-${name.replace(/[[\]]/g, "-")}`; Now @@ -176,14 +176,14 @@ const fieldId = `field-${name.replace(/[[\]]/g, "-")}`; Cancel Apply diff --git a/src/layouts/ComponentLayout.astro b/src/layouts/ComponentLayout.astro index 6551739..ba18590 100644 --- a/src/layouts/ComponentLayout.astro +++ b/src/layouts/ComponentLayout.astro @@ -53,6 +53,9 @@ import Base from "./Base.astro"; Dropdown + + Drawer + diff --git a/src/pages/drawer.astro b/src/pages/drawer.astro new file mode 100644 index 0000000..db1897e --- /dev/null +++ b/src/pages/drawer.astro @@ -0,0 +1,308 @@ +--- +import Drawer from "../components/Drawer.astro"; +import ComponentLayout from "../layouts/ComponentLayout.astro"; +--- + + + + + Open Settings + + + + Settings + + + + + Theme + + Light + Dark + System + + + + Language + + English + Spanish + French + + + + + + Cancel + Save + + + + + + + + + + + + + + + + Navigation + + + + + + + + Home + + + + + + + About + + + + + + + Contact + + + + + + + + + + + + + + + + + Notifications + + + + + New message from John + + 5 minutes ago + + + + + System update available + + + 1 hour ago + + + + + + + + + Open Advanced Drawer + + + + + + + + + Advanced Settings + + + + + + Security + + + + Two-factor authentication + + + + Login notifications + + + + + + Privacy + + + + Allow analytics + + + + Share usage data + + + + + + + + Reset + + + Apply Changes + + + + + +
{p.description}
+ 5 minutes ago +
+ 1 hour ago +