@vendure-io/ui 3.0.0-next.7 → 3.0.0-next.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vendure-io/ui",
|
|
3
|
-
"version": "3.0.0-next.
|
|
3
|
+
"version": "3.0.0-next.8",
|
|
4
4
|
"description": "React component library for Vendure, built on shadcn/ui and Tailwind v4",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"homepage": "https://github.com/vendurehq/design/tree/main/packages/ui",
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
import { cn } from "@vendure-io/ui/lib/utils"
|
|
12
12
|
import { Button, buttonVariants } from "@vendure-io/ui/components/atoms/button"
|
|
13
13
|
import { useFormatSettings } from "@vendure-io/ui/components/molecules/format-provider"
|
|
14
|
+
import { ProvidedDirection } from "../../lib/popup-direction.ts"
|
|
14
15
|
import { ChevronLeftIcon, ChevronRightIcon, ChevronDownIcon } from "lucide-react"
|
|
15
16
|
|
|
16
17
|
function Calendar({
|
|
@@ -22,6 +23,7 @@ function Calendar({
|
|
|
22
23
|
locale,
|
|
23
24
|
formatters,
|
|
24
25
|
components,
|
|
26
|
+
dir,
|
|
25
27
|
...props
|
|
26
28
|
}: React.ComponentProps<typeof DayPicker> & {
|
|
27
29
|
buttonVariant?: React.ComponentProps<typeof Button>["variant"]
|
|
@@ -31,6 +33,11 @@ function Calendar({
|
|
|
31
33
|
// reaches their popups without each caller passing `locale`.
|
|
32
34
|
const { calendarLocale } = useFormatSettings()
|
|
33
35
|
locale ??= calendarLocale
|
|
36
|
+
// DayPicker maps ArrowLeft and ArrowRight to days by `dir`. Inside a
|
|
37
|
+
// right-to-left DirectionProvider, ArrowLeft moves to the next day. Outside
|
|
38
|
+
// a provider `dir` stays unset and the grid inherits the page's direction.
|
|
39
|
+
const providedDir = React.useContext(ProvidedDirection)
|
|
40
|
+
dir ??= providedDir
|
|
34
41
|
|
|
35
42
|
return (
|
|
36
43
|
<DayPicker
|
|
@@ -42,6 +49,7 @@ function Calendar({
|
|
|
42
49
|
className
|
|
43
50
|
)}
|
|
44
51
|
captionLayout={captionLayout}
|
|
52
|
+
dir={dir}
|
|
45
53
|
locale={locale}
|
|
46
54
|
formatters={{
|
|
47
55
|
// Through DayPicker's date library, so the month names follow `locale`
|
|
@@ -205,6 +213,7 @@ function CalendarDayButton({
|
|
|
205
213
|
|
|
206
214
|
return (
|
|
207
215
|
<Button
|
|
216
|
+
ref={ref}
|
|
208
217
|
variant="ghost"
|
|
209
218
|
size="icon"
|
|
210
219
|
data-day={day.date.toLocaleDateString(locale?.code)}
|
|
@@ -124,9 +124,9 @@ function AppShellMain({
|
|
|
124
124
|
const pageEnterClassName = 'animate-page-enter motion-reduce:animate-page-fade';
|
|
125
125
|
|
|
126
126
|
// The page frame: one frame for every app on AppShell. The page is centred in
|
|
127
|
-
// AppShellMain, its content is at most
|
|
127
|
+
// AppShellMain, its content is at most 1600px wide, and a 16px gutter sits on
|
|
128
128
|
// every side at every width, the top and bottom included. The gutter is outside
|
|
129
|
-
// the
|
|
129
|
+
// the 1600px, so the frame is at most 1600px plus two gutters wide.
|
|
130
130
|
// The end padding of AppShellHeader (pe-4) is the same value as the gutter:
|
|
131
131
|
// change both together.
|
|
132
132
|
//
|
|
@@ -136,7 +136,7 @@ const pageEnterClassName = 'animate-page-enter motion-reduce:animate-page-fade';
|
|
|
136
136
|
// A page that wants a narrower column, such as a settings form at `max-w-4xl`,
|
|
137
137
|
// puts it inside the frame; it stays left-aligned there.
|
|
138
138
|
const pageFrameClassName =
|
|
139
|
-
'[--app-shell-page-width:
|
|
139
|
+
'[--app-shell-page-width:1600px] [--app-shell-page-gutter:--spacing(4)] mx-auto w-full min-w-0 max-w-[calc(var(--app-shell-page-width)+2*var(--app-shell-page-gutter))] p-(--app-shell-page-gutter)';
|
|
140
140
|
|
|
141
141
|
// AppShellPage wraps the page inside AppShellMain. It is the page frame (see
|
|
142
142
|
// pageFrameClassName), and it is the page enter: when it mounts, the page
|