@alepha/ui 0.36.1 → 0.37.0
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/dist/account/$pageAccount.d.ts +1 -1
- package/dist/account/$pageAccount.d.ts.map +1 -1
- package/dist/account/$pageAccount.js.map +1 -1
- package/dist/account/AccountDisplay.d.ts +13 -0
- package/dist/account/AccountDisplay.d.ts.map +1 -0
- package/dist/account/AccountDisplay.js +48 -0
- package/dist/account/AccountDisplay.js.map +1 -0
- package/dist/account/AccountProfile.d.ts.map +1 -1
- package/dist/account/AccountProfile.js +14 -10
- package/dist/account/AccountProfile.js.map +1 -1
- package/dist/account/AccountRouter.d.ts +6 -6
- package/dist/account/AccountRouter.d.ts.map +1 -1
- package/dist/account/index.d.ts +5 -0
- package/dist/account/index.d.ts.map +1 -1
- package/dist/account/index.js +2 -1
- package/dist/admin/$pageAdmin.d.ts +1 -1
- package/dist/admin/$pageAdmin.d.ts.map +1 -1
- package/dist/admin/$pageAdmin.js.map +1 -1
- package/dist/admin/AdminAudits.js.map +1 -1
- package/dist/admin/AdminJobDetail.js.map +1 -1
- package/dist/admin/AdminJobs.js.map +1 -1
- package/dist/admin/AdminNotifications.js.map +1 -1
- package/dist/admin/AdminRouter.d.ts +14 -14
- package/dist/admin/AdminRouter.d.ts.map +1 -1
- package/dist/admin/AdminUserDetail.js.map +1 -1
- package/dist/admin/AdminUsers.js.map +1 -1
- package/dist/admin/ParameterHistoryItem.js.map +1 -1
- package/dist/ai/AiChat.d.ts +26 -39
- package/dist/ai/AiChat.d.ts.map +1 -1
- package/dist/ai/AiChat.js +65 -123
- package/dist/ai/AiChat.js.map +1 -1
- package/dist/ai/AiChatDock.d.ts +23 -0
- package/dist/ai/AiChatDock.d.ts.map +1 -0
- package/dist/ai/AiChatDock.js +90 -0
- package/dist/ai/AiChatDock.js.map +1 -0
- package/dist/ai/AiChatDockSlot.d.ts +15 -0
- package/dist/ai/AiChatDockSlot.d.ts.map +1 -0
- package/dist/ai/AiChatDockSlot.js +20 -0
- package/dist/ai/AiChatDockSlot.js.map +1 -0
- package/dist/ai/AiChatLauncher.d.ts +17 -0
- package/dist/ai/AiChatLauncher.d.ts.map +1 -0
- package/dist/ai/AiChatLauncher.js +42 -0
- package/dist/ai/AiChatLauncher.js.map +1 -0
- package/dist/ai/AiChatMessage.d.ts +6 -0
- package/dist/ai/AiChatMessage.d.ts.map +1 -1
- package/dist/ai/AiChatMessage.js +20 -4
- package/dist/ai/AiChatMessage.js.map +1 -1
- package/dist/ai/AiChatPanel.d.ts +71 -0
- package/dist/ai/AiChatPanel.d.ts.map +1 -0
- package/dist/ai/AiChatPanel.js +143 -0
- package/dist/ai/AiChatPanel.js.map +1 -0
- package/dist/ai/index.d.ts +8 -4
- package/dist/ai/index.d.ts.map +1 -1
- package/dist/ai/index.js +5 -1
- package/dist/ai/useAiChat.d.ts +12 -0
- package/dist/ai/useAiChat.d.ts.map +1 -1
- package/dist/ai/useAiChat.js +32 -15
- package/dist/ai/useAiChat.js.map +1 -1
- package/dist/auth/AuthLogin.d.ts +9 -0
- package/dist/auth/AuthLogin.d.ts.map +1 -1
- package/dist/auth/AuthLogin.js +2 -2
- package/dist/auth/AuthLogin.js.map +1 -1
- package/dist/auth/AuthRegister.d.ts +4 -1
- package/dist/auth/AuthRegister.d.ts.map +1 -1
- package/dist/auth/AuthRegister.js +1 -1
- package/dist/auth/AuthRegister.js.map +1 -1
- package/dist/auth/AuthResetPassword.d.ts +8 -0
- package/dist/auth/AuthResetPassword.d.ts.map +1 -1
- package/dist/auth/AuthResetPassword.js +2 -2
- package/dist/auth/AuthResetPassword.js.map +1 -1
- package/dist/auth/AuthRouter.d.ts +4 -4
- package/dist/auth/AuthRouter.d.ts.map +1 -1
- package/dist/core/Badge.d.ts.map +1 -1
- package/dist/core/Badge.js +7 -3
- package/dist/core/Badge.js.map +1 -1
- package/dist/core/Collapsible.d.ts +50 -0
- package/dist/core/Collapsible.d.ts.map +1 -0
- package/dist/core/Collapsible.js +70 -0
- package/dist/core/Collapsible.js.map +1 -0
- package/dist/core/Combobox.d.ts +7 -1
- package/dist/core/Combobox.d.ts.map +1 -1
- package/dist/core/Combobox.js +2 -2
- package/dist/core/Combobox.js.map +1 -1
- package/dist/core/PaneRail.d.ts +24 -7
- package/dist/core/PaneRail.d.ts.map +1 -1
- package/dist/core/PaneRail.js +24 -19
- package/dist/core/PaneRail.js.map +1 -1
- package/dist/core/Stepper.d.ts +36 -0
- package/dist/core/Stepper.d.ts.map +1 -0
- package/dist/core/Stepper.js +54 -0
- package/dist/core/Stepper.js.map +1 -0
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +3 -1
- package/dist/core/useToast.js +13 -13
- package/dist/core/useToast.js.map +1 -1
- package/dist/form/AutoForm.d.ts.map +1 -1
- package/dist/form/AutoForm.js +29 -0
- package/dist/form/AutoForm.js.map +1 -1
- package/dist/form/AutoFormErrorPopover.js +13 -3
- package/dist/form/AutoFormErrorPopover.js.map +1 -1
- package/dist/form/Control.d.ts +14 -1
- package/dist/form/Control.d.ts.map +1 -1
- package/dist/form/Control.js +12 -2
- package/dist/form/Control.js.map +1 -1
- package/dist/form/ControlDate.d.ts.map +1 -1
- package/dist/form/ControlDate.js +3 -0
- package/dist/form/ControlDate.js.map +1 -1
- package/dist/form/ControlDateRange.d.ts +12 -1
- package/dist/form/ControlDateRange.d.ts.map +1 -1
- package/dist/form/ControlDateRange.js +11 -1
- package/dist/form/ControlDateRange.js.map +1 -1
- package/dist/form/ControlNumber.d.ts.map +1 -1
- package/dist/form/ControlNumber.js +2 -0
- package/dist/form/ControlNumber.js.map +1 -1
- package/dist/form/ControlObject.d.ts.map +1 -1
- package/dist/form/ControlObject.js +15 -1
- package/dist/form/ControlObject.js.map +1 -1
- package/dist/form/ControlPassword.d.ts +4 -0
- package/dist/form/ControlPassword.d.ts.map +1 -1
- package/dist/form/ControlPassword.js +1 -0
- package/dist/form/ControlPassword.js.map +1 -1
- package/dist/form/ControlSelect.d.ts +23 -1
- package/dist/form/ControlSelect.d.ts.map +1 -1
- package/dist/form/ControlSelect.js +5 -0
- package/dist/form/ControlSelect.js.map +1 -1
- package/dist/form/ControlSelectCombobox.d.ts +11 -1
- package/dist/form/ControlSelectCombobox.d.ts.map +1 -1
- package/dist/form/ControlSelectCombobox.js +9 -1
- package/dist/form/ControlSelectCombobox.js.map +1 -1
- package/dist/form/ControlUpload.d.ts.map +1 -1
- package/dist/form/ControlUpload.js +1 -0
- package/dist/form/ControlUpload.js.map +1 -1
- package/dist/form/FormField.d.ts +5 -0
- package/dist/form/FormField.d.ts.map +1 -1
- package/dist/form/FormField.js +7 -0
- package/dist/form/FormField.js.map +1 -1
- package/dist/i18n/fr/uiFr.d.ts.map +1 -1
- package/dist/i18n/fr/uiFr.js +14 -0
- package/dist/i18n/fr/uiFr.js.map +1 -1
- package/dist/shell/$pageNav.d.ts +2 -2
- package/dist/shell/$pageNav.d.ts.map +1 -1
- package/dist/shell/$pageNav.js.map +1 -1
- package/dist/shell/AppShell.d.ts +6 -0
- package/dist/shell/AppShell.d.ts.map +1 -1
- package/dist/shell/AppShell.js +31 -27
- package/dist/shell/AppShell.js.map +1 -1
- package/dist/shell/ButtonSettings.d.ts +6 -2
- package/dist/shell/ButtonSettings.d.ts.map +1 -1
- package/dist/shell/ButtonSettings.js +17 -3
- package/dist/shell/ButtonSettings.js.map +1 -1
- package/dist/shell/ButtonSettingsVisionMenuItem.d.ts +16 -0
- package/dist/shell/ButtonSettingsVisionMenuItem.d.ts.map +1 -0
- package/dist/shell/ButtonSettingsVisionMenuItem.js +24 -0
- package/dist/shell/ButtonSettingsVisionMenuItem.js.map +1 -0
- package/dist/shell/ButtonVision.d.ts +28 -0
- package/dist/shell/ButtonVision.d.ts.map +1 -0
- package/dist/shell/ButtonVision.js +46 -0
- package/dist/shell/ButtonVision.js.map +1 -0
- package/dist/shell/index.d.ts +6 -3
- package/dist/shell/index.d.ts.map +1 -1
- package/dist/shell/index.js +2 -1
- package/dist/styles.css +57 -0
- package/dist/table/DataTable.d.ts.map +1 -1
- package/dist/table/DataTable.js +29 -4
- package/dist/table/DataTable.js.map +1 -1
- package/dist/table/DataTableColumnPicker.d.ts.map +1 -1
- package/dist/table/DataTableColumnPicker.js +1 -0
- package/dist/table/DataTableColumnPicker.js.map +1 -1
- package/dist/table/DataTableFilterBar.d.ts +1 -1
- package/dist/table/DataTableFilterBar.d.ts.map +1 -1
- package/dist/table/DataTableFilterBar.js +5 -108
- package/dist/table/DataTableFilterBar.js.map +1 -1
- package/dist/table/DataTableHeaderFilter.d.ts +51 -0
- package/dist/table/DataTableHeaderFilter.d.ts.map +1 -0
- package/dist/table/DataTableHeaderFilter.js +113 -0
- package/dist/table/DataTableHeaderFilter.js.map +1 -0
- package/dist/table/DataTableHeaderRow.d.ts +7 -0
- package/dist/table/DataTableHeaderRow.d.ts.map +1 -1
- package/dist/table/DataTableHeaderRow.js +92 -74
- package/dist/table/DataTableHeaderRow.js.map +1 -1
- package/dist/table/DataTableTabs.d.ts +42 -0
- package/dist/table/DataTableTabs.d.ts.map +1 -0
- package/dist/table/DataTableTabs.js +55 -0
- package/dist/table/DataTableTabs.js.map +1 -0
- package/dist/table/dataTableBaseProps.d.ts +12 -0
- package/dist/table/dataTableBaseProps.d.ts.map +1 -1
- package/dist/table/dataTablePersistence.d.ts.map +1 -1
- package/dist/table/dataTablePersistence.js +4 -2
- package/dist/table/dataTablePersistence.js.map +1 -1
- package/dist/table/dataTableTypes.d.ts +18 -0
- package/dist/table/dataTableTypes.d.ts.map +1 -1
- package/dist/table/index.d.ts +5 -2
- package/dist/table/index.d.ts.map +1 -1
- package/dist/table/index.js +2 -1
- package/dist/table/useDataTableColumns.d.ts.map +1 -1
- package/dist/table/useDataTableColumns.js +1 -0
- package/dist/table/useDataTableColumns.js.map +1 -1
- package/dist/table/useDataTableFilterModel.d.ts +110 -0
- package/dist/table/useDataTableFilterModel.d.ts.map +1 -0
- package/dist/table/useDataTableFilterModel.js +154 -0
- package/dist/table/useDataTableFilterModel.js.map +1 -0
- package/docs/packages-alepha-ui-account.md +4 -0
- package/docs/packages-alepha-ui-ai.md +5 -5
- package/docs/packages-alepha-ui-shell.md +4 -3
- package/docs/packages-alepha-ui-table.md +4 -2
- package/package.json +8 -8
- package/src/account/$pageAccount.tsx +5 -4
- package/src/account/AccountDisplay.tsx +58 -0
- package/src/account/AccountProfile.tsx +30 -42
- package/src/account/__tests__/AccountProfile.browser.spec.tsx +141 -0
- package/src/account/__tests__/AccountRecoveryCodes.browser.spec.tsx +1 -1
- package/src/account/index.ts +5 -0
- package/src/admin/$pageAdmin.tsx +5 -4
- package/src/admin/AdminAudits.tsx +1 -1
- package/src/admin/AdminJobDetail.tsx +1 -1
- package/src/admin/AdminJobs.tsx +1 -1
- package/src/admin/AdminNotifications.tsx +1 -1
- package/src/admin/AdminUserDetail.tsx +1 -1
- package/src/admin/AdminUsers.tsx +1 -1
- package/src/admin/ParameterHistoryItem.tsx +1 -1
- package/src/admin/__tests__/AdminFilesUsageCard.browser.spec.tsx +17 -9
- package/src/ai/AiChat.tsx +94 -183
- package/src/ai/AiChatDock.tsx +129 -0
- package/src/ai/AiChatDockSlot.tsx +23 -0
- package/src/ai/AiChatLauncher.tsx +58 -0
- package/src/ai/AiChatMessage.tsx +36 -2
- package/src/ai/AiChatPanel.tsx +252 -0
- package/src/ai/__tests__/AiChat.browser.spec.tsx +187 -5
- package/src/ai/index.ts +8 -4
- package/src/ai/useAiChat.ts +63 -14
- package/src/auth/AuthLogin.tsx +19 -4
- package/src/auth/AuthRegister.tsx +6 -3
- package/src/auth/AuthResetPassword.tsx +18 -8
- package/src/auth/__tests__/AuthCancel.browser.spec.tsx +129 -0
- package/src/core/Badge.tsx +7 -3
- package/src/core/Collapsible.tsx +95 -0
- package/src/core/Combobox.tsx +11 -3
- package/src/core/PaneRail.tsx +36 -20
- package/src/core/Stepper.tsx +118 -0
- package/src/core/__tests__/Badge.browser.spec.tsx +5 -5
- package/src/core/__tests__/Collapsible.browser.spec.tsx +88 -0
- package/src/core/__tests__/PaneRail.browser.spec.tsx +48 -0
- package/src/core/__tests__/Stepper.browser.spec.tsx +39 -0
- package/src/core/__tests__/primitiveSlots.spec.ts +7 -0
- package/src/core/index.ts +15 -0
- package/src/form/AutoForm.tsx +32 -0
- package/src/form/AutoFormErrorPopover.tsx +27 -6
- package/src/form/Control.tsx +22 -0
- package/src/form/ControlDate.tsx +3 -0
- package/src/form/ControlDateRange.tsx +87 -58
- package/src/form/ControlNumber.tsx +2 -0
- package/src/form/ControlObject.tsx +20 -1
- package/src/form/ControlPassword.tsx +5 -0
- package/src/form/ControlSelect.tsx +32 -1
- package/src/form/ControlSelectCombobox.tsx +82 -56
- package/src/form/ControlUpload.tsx +1 -0
- package/src/form/FormField.tsx +23 -1
- package/src/form/__tests__/ControlFieldErrors.browser.spec.tsx +253 -0
- package/src/form/__tests__/ControlValidateMode.browser.spec.tsx +217 -0
- package/src/form/__tests__/ControlVariantErrors.browser.spec.tsx +133 -0
- package/src/i18n/fr/uiFr.ts +18 -1
- package/src/markdown/css.d.ts +11 -0
- package/src/shell/$pageNav.tsx +6 -4
- package/src/shell/AppShell.tsx +7 -0
- package/src/shell/ButtonSettings.tsx +20 -5
- package/src/shell/ButtonSettingsVisionMenuItem.tsx +40 -0
- package/src/shell/ButtonVision.tsx +73 -0
- package/src/shell/__tests__/ButtonSettings.browser.spec.tsx +42 -2
- package/src/shell/__tests__/ButtonVision.browser.spec.tsx +73 -0
- package/src/shell/__tests__/visionTokens.spec.ts +104 -0
- package/src/shell/index.ts +6 -3
- package/src/styles.css +57 -0
- package/src/table/DataTable.tsx +52 -4
- package/src/table/DataTableColumnPicker.tsx +3 -0
- package/src/table/DataTableFilterBar.tsx +18 -191
- package/src/table/DataTableHeaderFilter.tsx +156 -0
- package/src/table/DataTableHeaderRow.tsx +78 -40
- package/src/table/DataTableTabs.tsx +114 -0
- package/src/table/__tests__/DataTableHeaderFilter.browser.spec.tsx +174 -0
- package/src/table/__tests__/DataTableStaleColumns.browser.spec.tsx +80 -0
- package/src/table/__tests__/DataTableTabs.browser.spec.tsx +72 -0
- package/src/table/dataTableBaseProps.ts +12 -0
- package/src/table/dataTablePersistence.ts +11 -5
- package/src/table/dataTableTypes.ts +18 -0
- package/src/table/index.ts +9 -2
- package/src/table/useDataTableColumns.ts +1 -0
- package/src/table/useDataTableFilterModel.tsx +240 -0
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
Calendar as CalendarIcon,
|
|
14
14
|
ChevronDown as ChevronDownIcon,
|
|
15
15
|
} from "lucide-react";
|
|
16
|
-
import { type ReactNode, useState } from "react";
|
|
16
|
+
import { type ReactElement, type ReactNode, useState } from "react";
|
|
17
17
|
import type { DateRange } from "react-day-picker";
|
|
18
18
|
|
|
19
19
|
import { LazyCalendar, preloadCalendar } from "../calendar/LazyCalendar.tsx";
|
|
@@ -63,6 +63,15 @@ export interface ControlDateRangeProps {
|
|
|
63
63
|
* placeholder already names it. Same contract as `ControlSelect`'s.
|
|
64
64
|
*/
|
|
65
65
|
triggerPrefix?: ReactNode;
|
|
66
|
+
/**
|
|
67
|
+
* An element drawn INSTEAD of the field, as the button that opens the
|
|
68
|
+
* calendar. Same contract as `ControlSelect`'s.
|
|
69
|
+
*/
|
|
70
|
+
trigger?: ReactElement<{ children?: ReactNode }>;
|
|
71
|
+
/**
|
|
72
|
+
* The calendar opened or closed. Same contract as `ControlSelect`'s.
|
|
73
|
+
*/
|
|
74
|
+
onPopupOpenChange?: (open: boolean) => void;
|
|
66
75
|
}
|
|
67
76
|
|
|
68
77
|
/**
|
|
@@ -159,6 +168,9 @@ export const ControlDateRange = (props: ControlDateRangeProps) => {
|
|
|
159
168
|
setPending(false);
|
|
160
169
|
setValue([formatDateOnly(next.from), formatDateOnly(next.to)]);
|
|
161
170
|
setOpen(false);
|
|
171
|
+
// Closed by hand, not through the popover, so its own callback is not
|
|
172
|
+
// called for this one.
|
|
173
|
+
props.onPopupOpenChange?.(false);
|
|
162
174
|
};
|
|
163
175
|
|
|
164
176
|
const showClear = Boolean(props.clearable && stored?.from && !props.disabled);
|
|
@@ -166,6 +178,7 @@ export const ControlDateRange = (props: ControlDateRangeProps) => {
|
|
|
166
178
|
|
|
167
179
|
return (
|
|
168
180
|
<FormField
|
|
181
|
+
onBlur={() => props.input.form?.blur(props.input.path)}
|
|
169
182
|
id={meta.id}
|
|
170
183
|
label={meta.label}
|
|
171
184
|
description={meta.description}
|
|
@@ -177,6 +190,7 @@ export const ControlDateRange = (props: ControlDateRangeProps) => {
|
|
|
177
190
|
onOpenChange={(next) => {
|
|
178
191
|
setOpen(next);
|
|
179
192
|
if (next) setPending(false);
|
|
193
|
+
props.onPopupOpenChange?.(next);
|
|
180
194
|
}}
|
|
181
195
|
>
|
|
182
196
|
{/* The kit's field trigger, and the kit's clear button positioned on
|
|
@@ -184,44 +198,58 @@ export const ControlDateRange = (props: ControlDateRangeProps) => {
|
|
|
184
198
|
filter bar beside this one draw (feedback #2197). The clear sits
|
|
185
199
|
BESIDE the trigger rather than inside it because a button nested
|
|
186
200
|
in a button is invalid, and Base UI's popover trigger would
|
|
187
|
-
swallow its click anyway.
|
|
188
|
-
|
|
201
|
+
swallow its click anyway.
|
|
202
|
+
|
|
203
|
+
A caller's own `trigger` replaces both, children handed over for
|
|
204
|
+
the reason `ControlSelectCombobox` gives. */}
|
|
205
|
+
{props.trigger ? (
|
|
189
206
|
<PopoverTrigger
|
|
190
207
|
id={meta.id}
|
|
191
|
-
// `date-trigger`, the same slot `ControlDate` claims: `styles.css`
|
|
192
|
-
// gives the `--border-hover` border to a list of `data-slot`s, and
|
|
193
|
-
// this is how the two calendars are on it.
|
|
194
|
-
data-slot="date-trigger"
|
|
195
208
|
disabled={props.disabled}
|
|
196
|
-
// The calendar is a chunk of its own (`LazyCalendar`), fetched as
|
|
197
|
-
// the pointer arrives or focus lands rather than on the click.
|
|
198
209
|
onPointerEnter={preloadCalendar}
|
|
199
210
|
onFocus={preloadCalendar}
|
|
200
|
-
|
|
201
|
-
// are an `<input>`'s props and this is a button, so their
|
|
202
|
-
// `onChange` signature is genuinely incompatible. The name is
|
|
203
|
-
// what `AutoForm`'s scroll-to-first-error looks a field up by.
|
|
204
|
-
name={props.input.props.name}
|
|
205
|
-
className={cn(
|
|
206
|
-
TRIGGER_CLASSES,
|
|
207
|
-
size.trigger,
|
|
208
|
-
size.chevron,
|
|
209
|
-
// Muted means "nothing picked yet", exactly as on a select.
|
|
210
|
-
!formatted && "text-muted-foreground",
|
|
211
|
-
props.triggerClassName,
|
|
212
|
-
)}
|
|
211
|
+
render={props.trigger}
|
|
213
212
|
>
|
|
214
|
-
{
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
213
|
+
{props.trigger.props.children}
|
|
214
|
+
</PopoverTrigger>
|
|
215
|
+
) : (
|
|
216
|
+
<div className={TRIGGER_WRAPPER_CLASSES}>
|
|
217
|
+
<PopoverTrigger
|
|
218
|
+
id={meta.id}
|
|
219
|
+
// `date-trigger`, the same slot `ControlDate` claims: `styles.css`
|
|
220
|
+
// gives the `--border-hover` border to a list of `data-slot`s, and
|
|
221
|
+
// this is how the two calendars are on it.
|
|
222
|
+
data-slot="date-trigger"
|
|
223
|
+
disabled={props.disabled}
|
|
224
|
+
// The calendar is a chunk of its own (`LazyCalendar`), fetched as
|
|
225
|
+
// the pointer arrives or focus lands rather than on the click.
|
|
226
|
+
onPointerEnter={preloadCalendar}
|
|
227
|
+
onFocus={preloadCalendar}
|
|
228
|
+
// `name` only, never the whole `input.props` spread: those
|
|
229
|
+
// are an `<input>`'s props and this is a button, so their
|
|
230
|
+
// `onChange` signature is genuinely incompatible. The name is
|
|
231
|
+
// what `AutoForm`'s scroll-to-first-error looks a field up by.
|
|
232
|
+
name={props.input.props.name}
|
|
219
233
|
className={cn(
|
|
220
|
-
|
|
221
|
-
|
|
234
|
+
TRIGGER_CLASSES,
|
|
235
|
+
size.trigger,
|
|
236
|
+
size.chevron,
|
|
237
|
+
// Muted means "nothing picked yet", exactly as on a select.
|
|
238
|
+
!formatted && "text-muted-foreground",
|
|
239
|
+
props.triggerClassName,
|
|
222
240
|
)}
|
|
223
241
|
>
|
|
224
|
-
{/*
|
|
242
|
+
{/* The room for the clear button - see `clearGap` in
|
|
243
|
+
TRIGGER_SIZES for why it is a margin here and not padding on
|
|
244
|
+
the trigger, and `ControlSelectCombobox` for `trigger-label`. */}
|
|
245
|
+
<span
|
|
246
|
+
data-slot="trigger-label"
|
|
247
|
+
className={cn(
|
|
248
|
+
"flex min-w-0 items-center gap-2",
|
|
249
|
+
showClear && size.clearGap,
|
|
250
|
+
)}
|
|
251
|
+
>
|
|
252
|
+
{/*
|
|
225
253
|
Muted whatever the field holds, matching every other leading
|
|
226
254
|
icon in the kit. Without the class it inherits the trigger's
|
|
227
255
|
own `color`, which swaps between muted and foreground to grey
|
|
@@ -229,39 +257,40 @@ export const ControlDateRange = (props: ControlDateRangeProps) => {
|
|
|
229
257
|
picked. An icon says what kind of field this is, which does
|
|
230
258
|
not change when you fill it.
|
|
231
259
|
*/}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
260
|
+
<CalendarIcon
|
|
261
|
+
className={cn("text-muted-foreground shrink-0", size.icon)}
|
|
262
|
+
/>
|
|
263
|
+
{/* The prefix rides in the same text run as the range, for the
|
|
236
264
|
reason `ControlSelectCombobox` gives: one run, one space. */}
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
265
|
+
<span className="truncate">
|
|
266
|
+
{props.triggerPrefix && formatted && (
|
|
267
|
+
<span className="text-muted-foreground">
|
|
268
|
+
{props.triggerPrefix}{" "}
|
|
269
|
+
</span>
|
|
270
|
+
)}
|
|
271
|
+
{formatted ||
|
|
272
|
+
props.placeholder ||
|
|
273
|
+
tr("controlDateRange.placeholder", {
|
|
274
|
+
default: "Pick a date range",
|
|
275
|
+
})}
|
|
276
|
+
</span>
|
|
248
277
|
</span>
|
|
249
|
-
|
|
250
|
-
{/* The same trailing caret a select trigger carries, appended by
|
|
278
|
+
{/* The same trailing caret a select trigger carries, appended by
|
|
251
279
|
`ComboboxTrigger` there and written out here: this opens a
|
|
252
280
|
popover, and without it the control reads as a text field that
|
|
253
281
|
happens to have a calendar glyph. */}
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
282
|
+
<ChevronDownIcon className="text-muted-foreground pointer-events-none size-4 shrink-0" />
|
|
283
|
+
</PopoverTrigger>
|
|
284
|
+
{showClear && (
|
|
285
|
+
<ControlClearButton
|
|
286
|
+
onClick={() => {
|
|
287
|
+
setDraft(undefined);
|
|
288
|
+
setValue(undefined);
|
|
289
|
+
}}
|
|
290
|
+
/>
|
|
291
|
+
)}
|
|
292
|
+
</div>
|
|
293
|
+
)}
|
|
265
294
|
<PopoverContent className="w-auto p-0" align="start">
|
|
266
295
|
{/* The range visuals were built and unused: `calendar.tsx` passes
|
|
267
296
|
`...props` straight to DayPicker and already defines
|
|
@@ -74,6 +74,7 @@ export const ControlNumber = (props: ControlNumberProps) => {
|
|
|
74
74
|
const hi = max ?? 100;
|
|
75
75
|
return (
|
|
76
76
|
<FormField
|
|
77
|
+
onBlur={() => props.input.form?.blur(props.input.path)}
|
|
77
78
|
id={meta.id}
|
|
78
79
|
label={meta.label}
|
|
79
80
|
description={meta.description}
|
|
@@ -102,6 +103,7 @@ export const ControlNumber = (props: ControlNumberProps) => {
|
|
|
102
103
|
const Icon = iconFor(meta.iconHint);
|
|
103
104
|
return (
|
|
104
105
|
<FormField
|
|
106
|
+
onBlur={() => props.input.form?.blur(props.input.path)}
|
|
105
107
|
id={meta.id}
|
|
106
108
|
label={meta.label}
|
|
107
109
|
description={meta.description}
|
|
@@ -3,6 +3,7 @@ import * as React from "react";
|
|
|
3
3
|
void React;
|
|
4
4
|
|
|
5
5
|
import { type ZObject, z } from "alepha";
|
|
6
|
+
import { useAlepha } from "alepha/react";
|
|
6
7
|
import {
|
|
7
8
|
type BaseInputField,
|
|
8
9
|
type ObjectInputField,
|
|
@@ -12,7 +13,7 @@ import {
|
|
|
12
13
|
} from "alepha/react/form";
|
|
13
14
|
import { useI18n } from "alepha/react/i18n";
|
|
14
15
|
import { ChevronDown, ChevronRight, Plus, Trash2 } from "lucide-react";
|
|
15
|
-
import { useState } from "react";
|
|
16
|
+
import { useEffect, useState } from "react";
|
|
16
17
|
|
|
17
18
|
import { Button } from "../core/Button.tsx";
|
|
18
19
|
import { Control, type ControlProps } from "./Control.tsx";
|
|
@@ -78,6 +79,24 @@ export const ControlObject = (props: ControlObjectProps) => {
|
|
|
78
79
|
const [value, setValue] = useFieldValue(props.input);
|
|
79
80
|
const [expanded, setExpanded] = useState(props.defaultExpanded ?? true);
|
|
80
81
|
const { tr } = useI18n();
|
|
82
|
+
const alepha = useAlepha();
|
|
83
|
+
|
|
84
|
+
// An error under a collapsed object must be reachable: open it the moment
|
|
85
|
+
// one lands on a field inside, so the field mounts and shows it (and
|
|
86
|
+
// `AutoForm` can bring it into view).
|
|
87
|
+
const formId = props.input?.form?.id;
|
|
88
|
+
const path = props.input?.path;
|
|
89
|
+
useEffect(() => {
|
|
90
|
+
if (!formId || !path) return;
|
|
91
|
+
return alepha.events.on("form:errors:changed", (event) => {
|
|
92
|
+
if (
|
|
93
|
+
event.id === formId &&
|
|
94
|
+
Object.keys(event.errors).some((key) => key.startsWith(`${path}/`))
|
|
95
|
+
) {
|
|
96
|
+
setExpanded(true);
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
}, [alepha, formId, path]);
|
|
81
100
|
|
|
82
101
|
if (!props.input?.props) return null;
|
|
83
102
|
|
|
@@ -22,6 +22,10 @@ export interface ControlPasswordProps {
|
|
|
22
22
|
icon?: IconComponent;
|
|
23
23
|
value: string;
|
|
24
24
|
onChange: (v: string) => void;
|
|
25
|
+
/**
|
|
26
|
+
* Called when focus leaves the field.
|
|
27
|
+
*/
|
|
28
|
+
onBlur?: () => void;
|
|
25
29
|
}
|
|
26
30
|
|
|
27
31
|
/**
|
|
@@ -36,6 +40,7 @@ export const ControlPassword = (props: ControlPasswordProps) => {
|
|
|
36
40
|
const Icon = props.icon;
|
|
37
41
|
return (
|
|
38
42
|
<FormField
|
|
43
|
+
onBlur={props.onBlur}
|
|
39
44
|
id={props.id}
|
|
40
45
|
label={props.label}
|
|
41
46
|
description={props.description}
|
|
@@ -12,7 +12,13 @@ import {
|
|
|
12
12
|
} from "alepha/react/form";
|
|
13
13
|
import { useI18n } from "alepha/react/i18n";
|
|
14
14
|
import type { HTMLAttributes } from "react";
|
|
15
|
-
import {
|
|
15
|
+
import {
|
|
16
|
+
type ReactElement,
|
|
17
|
+
type ReactNode,
|
|
18
|
+
useMemo,
|
|
19
|
+
useRef,
|
|
20
|
+
useState,
|
|
21
|
+
} from "react";
|
|
16
22
|
|
|
17
23
|
import { Checkbox } from "../core/Checkbox.tsx";
|
|
18
24
|
import { Segmented } from "../core/Segmented.tsx";
|
|
@@ -204,6 +210,26 @@ export interface ControlSelectProps {
|
|
|
204
210
|
* floor (`w-max min-w-48`) sizes it from its own content instead.
|
|
205
211
|
*/
|
|
206
212
|
popupClassName?: string;
|
|
213
|
+
/**
|
|
214
|
+
* An element drawn INSTEAD of the field: it becomes the button that opens
|
|
215
|
+
* the popup, rendered as written, with none of the field's own icon,
|
|
216
|
+
* label, caret or clear button. For a list opened from somewhere that is
|
|
217
|
+
* not a form, such as the funnel in a table column's header.
|
|
218
|
+
*
|
|
219
|
+
* Pass a `<button>`. Its children are kept; its click and its ARIA state
|
|
220
|
+
* are the popup's. The popup is anchored to it, so give `popupClassName`
|
|
221
|
+
* a width (`w-max min-w-48`): it would otherwise be as narrow as an icon.
|
|
222
|
+
*
|
|
223
|
+
* ⚠️ Only the combobox shape has a popup, so a segmented or checkbox
|
|
224
|
+
* rendering of the same field ignores it.
|
|
225
|
+
*/
|
|
226
|
+
trigger?: ReactElement<{ children?: ReactNode }>;
|
|
227
|
+
/**
|
|
228
|
+
* The popup opened or closed. For a caller that acts on the reader's
|
|
229
|
+
* choice once they are done with the list, such as a table header that
|
|
230
|
+
* takes an emptied filter off the bar. The combobox shape only.
|
|
231
|
+
*/
|
|
232
|
+
onPopupOpenChange?: (open: boolean) => void;
|
|
207
233
|
}
|
|
208
234
|
|
|
209
235
|
export const ControlSelect = (props: ControlSelectProps) => {
|
|
@@ -310,6 +336,7 @@ export const ControlSelect = (props: ControlSelectProps) => {
|
|
|
310
336
|
if (props.segmented) {
|
|
311
337
|
return (
|
|
312
338
|
<FormField
|
|
339
|
+
onBlur={() => props.input.form?.blur(props.input.path)}
|
|
313
340
|
id={meta.id}
|
|
314
341
|
label={meta.label}
|
|
315
342
|
description={meta.description}
|
|
@@ -341,6 +368,7 @@ export const ControlSelect = (props: ControlSelectProps) => {
|
|
|
341
368
|
const ticked = Array.isArray(value) ? (value as unknown[]).map(String) : [];
|
|
342
369
|
return (
|
|
343
370
|
<FormField
|
|
371
|
+
onBlur={() => props.input.form?.blur(props.input.path)}
|
|
344
372
|
id={meta.id}
|
|
345
373
|
label={meta.label}
|
|
346
374
|
description={meta.description}
|
|
@@ -416,6 +444,7 @@ export const ControlSelect = (props: ControlSelectProps) => {
|
|
|
416
444
|
|
|
417
445
|
return (
|
|
418
446
|
<FormField
|
|
447
|
+
onBlur={() => props.input.form?.blur(props.input.path)}
|
|
419
448
|
id={meta.id}
|
|
420
449
|
label={meta.label}
|
|
421
450
|
description={meta.description}
|
|
@@ -451,6 +480,8 @@ export const ControlSelect = (props: ControlSelectProps) => {
|
|
|
451
480
|
popupHeader={props.popupHeader}
|
|
452
481
|
triggerPrefix={props.triggerPrefix}
|
|
453
482
|
popupClassName={props.popupClassName}
|
|
483
|
+
trigger={props.trigger}
|
|
484
|
+
onPopupOpenChange={props.onPopupOpenChange}
|
|
454
485
|
// An optional field must also be able to go back to empty without a
|
|
455
486
|
// dedicated row: Base UI never emits `null`, so re-pressing the
|
|
456
487
|
// selected row deselects (see `handleSingle` in
|
|
@@ -5,7 +5,7 @@ void React;
|
|
|
5
5
|
import { useI18n } from "alepha/react/i18n";
|
|
6
6
|
import { ListChecks, Loader2 } from "lucide-react";
|
|
7
7
|
import type { HTMLAttributes } from "react";
|
|
8
|
-
import { type ReactNode, useRef, useState } from "react";
|
|
8
|
+
import { type ReactElement, type ReactNode, useRef, useState } from "react";
|
|
9
9
|
|
|
10
10
|
import {
|
|
11
11
|
ComboboxContent,
|
|
@@ -111,6 +111,14 @@ export interface ControlSelectComboboxProps {
|
|
|
111
111
|
* See `ControlSelectProps.popupClassName` in `ControlSelect.tsx`.
|
|
112
112
|
*/
|
|
113
113
|
popupClassName?: string;
|
|
114
|
+
/**
|
|
115
|
+
* See `ControlSelectProps.trigger` in `ControlSelect.tsx`.
|
|
116
|
+
*/
|
|
117
|
+
trigger?: ReactElement<{ children?: ReactNode }>;
|
|
118
|
+
/**
|
|
119
|
+
* See `ControlSelectProps.onPopupOpenChange` in `ControlSelect.tsx`.
|
|
120
|
+
*/
|
|
121
|
+
onPopupOpenChange?: (open: boolean) => void;
|
|
114
122
|
}
|
|
115
123
|
|
|
116
124
|
/**
|
|
@@ -388,6 +396,7 @@ export const ControlSelectCombobox = (props: ControlSelectComboboxProps) => {
|
|
|
388
396
|
((a: ComboOption, b: ComboOption) => a.value === b.value) as never
|
|
389
397
|
}
|
|
390
398
|
filter={null}
|
|
399
|
+
onOpenChange={(open) => props.onPopupOpenChange?.(open)}
|
|
391
400
|
// Base UI leaves `autoHighlight` off by default, so nothing is
|
|
392
401
|
// highlighted while typing and Enter has no target — the user has to
|
|
393
402
|
// click a row (including the `createNewEntry` one). Highlighting the
|
|
@@ -407,53 +416,69 @@ export const ControlSelectCombobox = (props: ControlSelectComboboxProps) => {
|
|
|
407
416
|
|
|
408
417
|
Wrapped so the clear button below can sit ON the trigger without
|
|
409
418
|
being INSIDE it: a button nested in a button is invalid, and Base
|
|
410
|
-
UI renders this trigger as a real `<button>`.
|
|
411
|
-
|
|
419
|
+
UI renders this trigger as a real `<button>`.
|
|
420
|
+
|
|
421
|
+
A caller's own `trigger` replaces all of it: the element is the
|
|
422
|
+
button, as it was drawn, and opens the same popup. Its children are
|
|
423
|
+
handed over explicitly, because the trigger's own children would
|
|
424
|
+
otherwise replace them. */}
|
|
425
|
+
{props.trigger ? (
|
|
412
426
|
<ComboboxTrigger
|
|
413
427
|
id={props.id}
|
|
414
428
|
disabled={props.disabled}
|
|
415
429
|
{...props.triggerProps}
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
data-minimal={props.minimal ? "" : undefined}
|
|
419
|
-
className={cn(
|
|
420
|
-
TRIGGER_CLASSES,
|
|
421
|
-
sizeClasses.trigger,
|
|
422
|
-
sizeClasses.chevron,
|
|
423
|
-
props.minimal && TRIGGER_MINIMAL_CLASSES,
|
|
424
|
-
// Muted means "nothing chosen yet", and now that is simply
|
|
425
|
-
// "nothing selected" for every shape.
|
|
426
|
-
//
|
|
427
|
-
// It used to carve out `clearable` singles, because for those empty
|
|
428
|
-
// WAS a selected value - the injected clear row - and muting it made
|
|
429
|
-
// one filter look unset while its neighbour looked set for the same
|
|
430
|
-
// meaning. That row is gone (see `items` in
|
|
431
|
-
// `controlSelectOptions.ts`), so empty is empty and reads as a
|
|
432
|
-
// placeholder everywhere.
|
|
433
|
-
selected.length === 0 && "text-muted-foreground",
|
|
434
|
-
props.triggerClassName,
|
|
435
|
-
)}
|
|
430
|
+
chevron={false}
|
|
431
|
+
render={props.trigger}
|
|
436
432
|
>
|
|
437
|
-
{
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
<
|
|
442
|
-
|
|
433
|
+
{props.trigger.props.children}
|
|
434
|
+
</ComboboxTrigger>
|
|
435
|
+
) : (
|
|
436
|
+
<div className={TRIGGER_WRAPPER_CLASSES}>
|
|
437
|
+
<ComboboxTrigger
|
|
438
|
+
id={props.id}
|
|
439
|
+
disabled={props.disabled}
|
|
440
|
+
{...props.triggerProps}
|
|
441
|
+
// Read by the hover-border rule in `styles.css`, which leaves a
|
|
442
|
+
// minimal trigger borderless on hover too: its hover is the tint.
|
|
443
|
+
data-minimal={props.minimal ? "" : undefined}
|
|
443
444
|
className={cn(
|
|
444
|
-
|
|
445
|
-
|
|
445
|
+
TRIGGER_CLASSES,
|
|
446
|
+
sizeClasses.trigger,
|
|
447
|
+
sizeClasses.chevron,
|
|
448
|
+
props.minimal && TRIGGER_MINIMAL_CLASSES,
|
|
449
|
+
// Muted means "nothing chosen yet", and now that is simply
|
|
450
|
+
// "nothing selected" for every shape.
|
|
451
|
+
//
|
|
452
|
+
// It used to carve out `clearable` singles, because for those empty
|
|
453
|
+
// WAS a selected value - the injected clear row - and muting it made
|
|
454
|
+
// one filter look unset while its neighbour looked set for the same
|
|
455
|
+
// meaning. That row is gone (see `items` in
|
|
456
|
+
// `controlSelectOptions.ts`), so empty is empty and reads as a
|
|
457
|
+
// placeholder everywhere.
|
|
458
|
+
selected.length === 0 && "text-muted-foreground",
|
|
459
|
+
props.triggerClassName,
|
|
446
460
|
)}
|
|
447
461
|
>
|
|
448
|
-
{
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
462
|
+
{/* The room for the clear button, per size - see `clearGap` in
|
|
463
|
+
TRIGGER_SIZES for why it is a margin here and not padding on the
|
|
464
|
+
trigger. `trigger-label` lets a container that hides the button
|
|
465
|
+
(`DataTableFilterControl`) take the room back. */}
|
|
466
|
+
<span
|
|
467
|
+
data-slot="trigger-label"
|
|
468
|
+
className={cn(
|
|
469
|
+
"flex min-w-0 items-center gap-2",
|
|
470
|
+
showClear && sizeClasses.clearGap,
|
|
471
|
+
)}
|
|
472
|
+
>
|
|
473
|
+
{props.icon && (
|
|
474
|
+
<props.icon
|
|
475
|
+
className={cn(
|
|
476
|
+
"text-muted-foreground shrink-0",
|
|
477
|
+
sizeClasses.icon,
|
|
478
|
+
)}
|
|
479
|
+
/>
|
|
480
|
+
)}
|
|
481
|
+
{/*
|
|
457
482
|
The prefix rides in the SAME text run as the label, separated by
|
|
458
483
|
an ordinary space. As a flex sibling it was spaced by the row's
|
|
459
484
|
`gap-2`, 8px, while the words inside it were a font space apart,
|
|
@@ -461,23 +486,24 @@ export const ControlSelectCombobox = (props: ControlSelectComboboxProps) => {
|
|
|
461
486
|
every gap the same space, and truncation eats from the end of
|
|
462
487
|
the value rather than squeezing the two apart.
|
|
463
488
|
*/}
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
489
|
+
<span className="truncate">
|
|
490
|
+
{props.triggerPrefix && selected.length > 0 && (
|
|
491
|
+
<span className="text-muted-foreground">
|
|
492
|
+
{props.triggerPrefix}{" "}
|
|
493
|
+
</span>
|
|
494
|
+
)}
|
|
495
|
+
{triggerLabel}
|
|
496
|
+
</span>
|
|
471
497
|
</span>
|
|
472
|
-
</
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
498
|
+
</ComboboxTrigger>
|
|
499
|
+
{showClear && (
|
|
500
|
+
<ControlClearButton
|
|
501
|
+
size={props.size}
|
|
502
|
+
onClick={() => props.onChange(props.multi ? [] : undefined)}
|
|
503
|
+
/>
|
|
504
|
+
)}
|
|
505
|
+
</div>
|
|
506
|
+
)}
|
|
481
507
|
<ComboboxContent className={props.popupClassName}>
|
|
482
508
|
{props.popupHeader}
|
|
483
509
|
{props.searchable && (
|
package/src/form/FormField.tsx
CHANGED
|
@@ -2,7 +2,13 @@ import * as React from "react";
|
|
|
2
2
|
|
|
3
3
|
void React;
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
createContext,
|
|
7
|
+
type FocusEvent,
|
|
8
|
+
type ReactNode,
|
|
9
|
+
useContext,
|
|
10
|
+
useMemo,
|
|
11
|
+
} from "react";
|
|
6
12
|
|
|
7
13
|
import { Label } from "../core/Label.tsx";
|
|
8
14
|
import { cn } from "../core/utils.ts";
|
|
@@ -46,6 +52,11 @@ export interface FormFieldProps {
|
|
|
46
52
|
* When omitted, falls back to the ambient `<FormFieldLayoutProvider>`.
|
|
47
53
|
*/
|
|
48
54
|
layout?: FormFieldLayout;
|
|
55
|
+
/**
|
|
56
|
+
* Called when focus leaves the field: the control and anything inside it
|
|
57
|
+
* (a picker's trigger and its inline parts). `validate: "blur"` hangs on it.
|
|
58
|
+
*/
|
|
59
|
+
onBlur?: () => void;
|
|
49
60
|
/**
|
|
50
61
|
* The control to wrap.
|
|
51
62
|
*/
|
|
@@ -70,6 +81,15 @@ export const FormField = (props: FormFieldProps) => {
|
|
|
70
81
|
? "[&_input]:border-danger [&_input]:focus-visible:ring-danger/30 [&_textarea]:border-danger [&_textarea]:focus-visible:ring-danger/30 [&_[role=combobox]]:border-danger"
|
|
71
82
|
: "";
|
|
72
83
|
const dataInvalid = props.error ? true : undefined;
|
|
84
|
+
// `focusout` bubbles, so one listener on the wrapper hears every input of
|
|
85
|
+
// the control; moving focus between two of its own parts is not leaving.
|
|
86
|
+
const onBlur = props.onBlur
|
|
87
|
+
? (event: FocusEvent<HTMLDivElement>) => {
|
|
88
|
+
const next = event.relatedTarget as Node | null;
|
|
89
|
+
if (next && event.currentTarget.contains(next)) return;
|
|
90
|
+
props.onBlur?.();
|
|
91
|
+
}
|
|
92
|
+
: undefined;
|
|
73
93
|
|
|
74
94
|
const errorId = formFieldErrorId(props.id, props.error);
|
|
75
95
|
const descriptionId = formFieldDescriptionId(
|
|
@@ -99,6 +119,7 @@ export const FormField = (props: FormFieldProps) => {
|
|
|
99
119
|
props.className,
|
|
100
120
|
)}
|
|
101
121
|
data-invalid={dataInvalid}
|
|
122
|
+
onBlur={onBlur}
|
|
102
123
|
>
|
|
103
124
|
<div className="flex flex-col gap-0.5">
|
|
104
125
|
{props.label && (
|
|
@@ -138,6 +159,7 @@ export const FormField = (props: FormFieldProps) => {
|
|
|
138
159
|
<div
|
|
139
160
|
className={cn("flex flex-col gap-1.5", invalidClasses, props.className)}
|
|
140
161
|
data-invalid={dataInvalid}
|
|
162
|
+
onBlur={onBlur}
|
|
141
163
|
>
|
|
142
164
|
{props.label && (
|
|
143
165
|
<Label htmlFor={props.id}>
|