@maestro-js/components 1.0.0-alpha.17 → 1.0.0-alpha.19
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
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"@types/react-dom": "^19.1.6",
|
|
9
9
|
"react-pdf-hook": "^1.0.4",
|
|
10
10
|
"vaul": "^1.1.2",
|
|
11
|
-
"@maestro-js/form": "1.0.0-alpha.
|
|
11
|
+
"@maestro-js/form": "1.0.0-alpha.19"
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
14
14
|
"@bundled-es-modules/pdfjs-dist": "3.6.172-alpha.1",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"react-router": ">=7",
|
|
27
27
|
"vite-env-only": "^3.0.2",
|
|
28
28
|
"vaul": ">=1",
|
|
29
|
-
"@maestro-js/form": "1.0.0-alpha.
|
|
29
|
+
"@maestro-js/form": "1.0.0-alpha.19"
|
|
30
30
|
},
|
|
31
|
-
"version": "1.0.0-alpha.
|
|
31
|
+
"version": "1.0.0-alpha.19",
|
|
32
32
|
"license": "UNLICENSED",
|
|
33
33
|
"engines": {
|
|
34
34
|
"node": ">=22.18.0"
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
import { twMerge } from 'tailwind-merge'
|
|
14
14
|
import { parseDate, type CalendarDate, type DateValue } from '@internationalized/date'
|
|
15
15
|
import type { Iso } from 'iso-fns'
|
|
16
|
+
import { Icon } from './icon'
|
|
16
17
|
|
|
17
18
|
export type DateRangeRootAdditionalProps = {
|
|
18
19
|
defaultStart: Iso.Date | null
|
|
@@ -74,11 +75,11 @@ export function DateRangePicker(props: DateRangePickerProps) {
|
|
|
74
75
|
>
|
|
75
76
|
<header className="flex items-center justify-between mb-2 px-1">
|
|
76
77
|
<Button slot="previous" className="p-1 hover:bg-neutral-100 rounded cursor-pointer">
|
|
77
|
-
<
|
|
78
|
+
<Icon name="chevron-left" />
|
|
78
79
|
</Button>
|
|
79
80
|
<Heading className="text-sm font-semibold text-neutral-900 flex-1 text-center" />
|
|
80
81
|
<Button slot="next" className="p-1 hover:bg-neutral-100 rounded cursor-pointer">
|
|
81
|
-
<
|
|
82
|
+
<Icon name="chevron-right" />
|
|
82
83
|
</Button>
|
|
83
84
|
</header>
|
|
84
85
|
<div className="flex gap-4">
|
|
@@ -135,27 +136,3 @@ export function DateRangePicker(props: DateRangePickerProps) {
|
|
|
135
136
|
</I18nProvider>
|
|
136
137
|
)
|
|
137
138
|
}
|
|
138
|
-
|
|
139
|
-
function ChevronLeft() {
|
|
140
|
-
return (
|
|
141
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" className="w-4 h-4">
|
|
142
|
-
<path
|
|
143
|
-
fillRule="evenodd"
|
|
144
|
-
d="M11.78 5.22a.75.75 0 0 1 0 1.06L8.06 10l3.72 3.72a.75.75 0 1 1-1.06 1.06l-4.25-4.25a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.06 0Z"
|
|
145
|
-
clipRule="evenodd"
|
|
146
|
-
/>
|
|
147
|
-
</svg>
|
|
148
|
-
)
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
function ChevronRight() {
|
|
152
|
-
return (
|
|
153
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" className="w-4 h-4">
|
|
154
|
-
<path
|
|
155
|
-
fillRule="evenodd"
|
|
156
|
-
d="M8.22 5.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 1 1-1.06-1.06L11.94 10 8.22 6.28a.75.75 0 0 1 0-1.06Z"
|
|
157
|
-
clipRule="evenodd"
|
|
158
|
-
/>
|
|
159
|
-
</svg>
|
|
160
|
-
)
|
|
161
|
-
}
|
|
@@ -47,6 +47,8 @@ export type TextFieldProps = {
|
|
|
47
47
|
|
|
48
48
|
export function TextField(props: TextFieldProps) {
|
|
49
49
|
const inputRef = React.useRef<HTMLInputElement>(null)
|
|
50
|
+
const visibleRef = React.useRef<HTMLInputElement>(null)
|
|
51
|
+
|
|
50
52
|
const helpTextId = React.useId()
|
|
51
53
|
const inputId = React.useId()
|
|
52
54
|
|
|
@@ -66,7 +68,7 @@ export function TextField(props: TextFieldProps) {
|
|
|
66
68
|
isRequired: props.isRequired,
|
|
67
69
|
form: props.form,
|
|
68
70
|
focus() {
|
|
69
|
-
|
|
71
|
+
visibleRef.current?.focus()
|
|
70
72
|
}
|
|
71
73
|
},
|
|
72
74
|
inputRef
|
|
@@ -113,6 +115,7 @@ export function TextField(props: TextFieldProps) {
|
|
|
113
115
|
inputMode={props.inputMode}
|
|
114
116
|
aria-invalid={isInvalid || undefined}
|
|
115
117
|
aria-describedby={helpTextId}
|
|
118
|
+
ref={visibleRef}
|
|
116
119
|
/>
|
|
117
120
|
{props.trailingInlineAddon}
|
|
118
121
|
</FormFieldComponents.FieldGroup>
|