@tailor-platform/app-shell 0.31.1 → 0.32.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/app-shell.css +1 -1
- package/dist/app-shell.d.ts +657 -56
- package/dist/app-shell.js +1628 -1160
- package/dist/theme.css +1 -0
- package/package.json +5 -5
package/dist/app-shell.d.ts
CHANGED
|
@@ -3,12 +3,16 @@ import { Autocomplete as Autocomplete_2 } from '@base-ui/react/autocomplete';
|
|
|
3
3
|
import { AutocompleteFilter } from '@base-ui/react';
|
|
4
4
|
import { AutocompleteFilterOptions } from '@base-ui/react';
|
|
5
5
|
import { AutocompleteRootProps } from '@base-ui/react/autocomplete';
|
|
6
|
+
import { Avatar as Avatar_2 } from '@base-ui/react/avatar';
|
|
6
7
|
import { ClassProp } from 'class-variance-authority/types';
|
|
7
8
|
import { Combobox as Combobox_2 } from '@base-ui/react/combobox';
|
|
8
9
|
import { CSSProperties } from 'react';
|
|
9
10
|
import { Dialog as Dialog_2 } from '@base-ui/react/dialog';
|
|
10
11
|
import { Drawer } from '@base-ui/react/drawer';
|
|
11
12
|
import { FC } from 'react';
|
|
13
|
+
import { Field as Field_2 } from '@base-ui/react/field';
|
|
14
|
+
import { Fieldset as Fieldset_2 } from '@base-ui/react/fieldset';
|
|
15
|
+
import { Form as Form_2 } from '@base-ui/react/form';
|
|
12
16
|
import { JSX } from 'react/jsx-runtime';
|
|
13
17
|
import { Link } from 'react-router';
|
|
14
18
|
import { LoaderFunctionArgs } from 'react-router';
|
|
@@ -82,6 +86,97 @@ export declare interface ActionPanelProps {
|
|
|
82
86
|
className?: string;
|
|
83
87
|
}
|
|
84
88
|
|
|
89
|
+
export declare const ActivityCard: typeof ActivityCardStandalone & {
|
|
90
|
+
Root: typeof Root;
|
|
91
|
+
Items: typeof Items;
|
|
92
|
+
Item: typeof Item;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Minimum shape required for items passed to ActivityCard.
|
|
97
|
+
* Consumers can extend this with any additional fields.
|
|
98
|
+
*/
|
|
99
|
+
export declare interface ActivityCardBaseItem {
|
|
100
|
+
id: string;
|
|
101
|
+
timestamp: Date | string;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* A single activity entry used by the standalone ActivityCard component.
|
|
106
|
+
*/
|
|
107
|
+
export declare interface ActivityCardItem extends ActivityCardBaseItem {
|
|
108
|
+
/**
|
|
109
|
+
* The subject of the activity. Optional — omit for system events with no specific actor
|
|
110
|
+
* (e.g. "Status automatically changed to EXPIRED").
|
|
111
|
+
*/
|
|
112
|
+
actor?: {
|
|
113
|
+
/** Display name of the actor (user, bot, service account, etc.). */
|
|
114
|
+
name: string;
|
|
115
|
+
/** Avatar image URL. Falls back to initials derived from `name`. */
|
|
116
|
+
avatarUrl?: string;
|
|
117
|
+
};
|
|
118
|
+
description: string;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Props for ActivityCard.Item — a single row in the timeline.
|
|
123
|
+
*/
|
|
124
|
+
export declare interface ActivityCardItemProps {
|
|
125
|
+
/** Element rendered in the left column (e.g. Avatar, Icon). The timeline connector line
|
|
126
|
+
* passes through the center of this element. Omit for rows without a connector. */
|
|
127
|
+
indicator?: React_2.ReactNode;
|
|
128
|
+
children: React_2.ReactNode;
|
|
129
|
+
className?: string;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Props for ActivityCard.Items — iterates over items and renders each via children render function.
|
|
134
|
+
*/
|
|
135
|
+
export declare interface ActivityCardItemsProps<T extends ActivityCardBaseItem> {
|
|
136
|
+
children: (item: T) => React_2.ReactNode;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Props for the standalone (pre-assembled) ActivityCard component.
|
|
141
|
+
*/
|
|
142
|
+
export declare interface ActivityCardProps {
|
|
143
|
+
/** List of items (newest first). */
|
|
144
|
+
items: ActivityCardItem[];
|
|
145
|
+
/** Card title, e.g. "Updates". */
|
|
146
|
+
title?: string;
|
|
147
|
+
/** Max number of activities shown in the card before overflow. Default 6. */
|
|
148
|
+
maxVisible?: number;
|
|
149
|
+
/** Overflow label style: "more" = "N more activities", "count" = "+N". Default "more". */
|
|
150
|
+
overflowLabel?: "more" | "count";
|
|
151
|
+
/** Optional grouping by day (TODAY / YESTERDAY / date). */
|
|
152
|
+
groupBy?: "none" | "day";
|
|
153
|
+
className?: string;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Props for ActivityCard.Root — the outermost card container.
|
|
158
|
+
*/
|
|
159
|
+
export declare interface ActivityCardRootProps<T extends ActivityCardBaseItem> {
|
|
160
|
+
/** List of items (newest first). */
|
|
161
|
+
items: T[];
|
|
162
|
+
/** Card title, e.g. "Updates". */
|
|
163
|
+
title?: string;
|
|
164
|
+
/** Max number of activities shown in the card before overflow. Default 6. */
|
|
165
|
+
maxVisible?: number;
|
|
166
|
+
/** Overflow label style: "more" = "N more activities", "count" = "+N". Default "more". */
|
|
167
|
+
overflowLabel?: "more" | "count";
|
|
168
|
+
/** Optional grouping by day (TODAY / YESTERDAY / date). */
|
|
169
|
+
groupBy?: "none" | "day";
|
|
170
|
+
className?: string;
|
|
171
|
+
children: React_2.ReactNode;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Pre-assembled ActivityCard that renders activities with avatars, descriptions,
|
|
176
|
+
* and timestamps. For custom item rendering, use ActivityCard.Root / .Items / .Item.
|
|
177
|
+
*/
|
|
178
|
+
declare function ActivityCardStandalone({ items, title, maxVisible, overflowLabel, groupBy, className, }: ActivityCardProps): JSX.Element;
|
|
179
|
+
|
|
85
180
|
export declare const AppShell: {
|
|
86
181
|
(props: AppShellProps): JSX.Element | null;
|
|
87
182
|
/* Excluded from this release type: WithPages */
|
|
@@ -134,6 +229,11 @@ export declare type AppShellPageProps = {
|
|
|
134
229
|
* Icon displayed alongside the title in navigation.
|
|
135
230
|
*/
|
|
136
231
|
icon?: ReactNode;
|
|
232
|
+
/**
|
|
233
|
+
* Custom breadcrumb segment title for this page.
|
|
234
|
+
* Can be a static string or a function that receives the URL segment.
|
|
235
|
+
*/
|
|
236
|
+
breadcrumbTitle?: string | ((segment: string) => string);
|
|
137
237
|
};
|
|
138
238
|
/**
|
|
139
239
|
* Guards to control access to this page.
|
|
@@ -517,6 +617,18 @@ declare namespace AutocompleteValue {
|
|
|
517
617
|
var displayName: string;
|
|
518
618
|
}
|
|
519
619
|
|
|
620
|
+
export declare const Avatar: {
|
|
621
|
+
Root: typeof Root_2;
|
|
622
|
+
Image: typeof Image_2;
|
|
623
|
+
Fallback: typeof Fallback;
|
|
624
|
+
};
|
|
625
|
+
|
|
626
|
+
export declare type AvatarProps = React_2.ComponentProps<typeof Avatar_2.Root> & VariantProps<typeof avatarVariants>;
|
|
627
|
+
|
|
628
|
+
export declare const avatarVariants: (props?: ({
|
|
629
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
630
|
+
} & ClassProp) | undefined) => string;
|
|
631
|
+
|
|
520
632
|
export declare function Badge({ className, variant, children, ...props }: BadgeProps): JSX.Element;
|
|
521
633
|
|
|
522
634
|
export declare interface BadgeProps extends React_2.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
|
|
@@ -558,7 +670,7 @@ export declare type ButtonProps = React_2.ComponentProps<"button"> & VariantProp
|
|
|
558
670
|
|
|
559
671
|
export declare const buttonVariants: (props?: ({
|
|
560
672
|
variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
|
|
561
|
-
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
673
|
+
size?: "default" | "xs" | "sm" | "lg" | "icon" | null | undefined;
|
|
562
674
|
} & ClassProp) | undefined) => string;
|
|
563
675
|
|
|
564
676
|
/** A table caption element. */
|
|
@@ -568,6 +680,12 @@ declare namespace Caption {
|
|
|
568
680
|
var displayName: string;
|
|
569
681
|
}
|
|
570
682
|
|
|
683
|
+
export declare const Card: {
|
|
684
|
+
Root: typeof Root_4;
|
|
685
|
+
Header: typeof Header_3;
|
|
686
|
+
Content: typeof Content;
|
|
687
|
+
};
|
|
688
|
+
|
|
571
689
|
/** A table data cell (`<td>`). */
|
|
572
690
|
declare function Cell({ className, ...props }: React_2.ComponentProps<"td">): JSX.Element;
|
|
573
691
|
|
|
@@ -863,6 +981,7 @@ declare type CommonPageResource = {
|
|
|
863
981
|
meta: {
|
|
864
982
|
title: LocalizedString;
|
|
865
983
|
icon?: ReactNode;
|
|
984
|
+
breadcrumbTitle?: string | ((segment: string) => string);
|
|
866
985
|
};
|
|
867
986
|
};
|
|
868
987
|
|
|
@@ -894,31 +1013,37 @@ declare type CommonProps = {
|
|
|
894
1013
|
guards?: Guard[];
|
|
895
1014
|
};
|
|
896
1015
|
|
|
897
|
-
|
|
898
|
-
declare function Content({ className, children, ...props }: React_2.ComponentProps<typeof Dialog_2.Popup>): JSX.Element;
|
|
1016
|
+
declare function Content({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
|
|
899
1017
|
|
|
900
1018
|
declare namespace Content {
|
|
901
1019
|
var displayName: string;
|
|
902
1020
|
}
|
|
903
1021
|
|
|
1022
|
+
/** The main dialog panel that contains the dialog content. Automatically includes a close button and overlay. */
|
|
1023
|
+
declare function Content_2({ className, children, ...props }: React_2.ComponentProps<typeof Dialog_2.Popup>): JSX.Element;
|
|
1024
|
+
|
|
1025
|
+
declare namespace Content_2 {
|
|
1026
|
+
var displayName: string;
|
|
1027
|
+
}
|
|
1028
|
+
|
|
904
1029
|
/** The menu popup that displays menu items. */
|
|
905
|
-
declare function
|
|
1030
|
+
declare function Content_3({ className, position, children, ...restProps }: React_2.ComponentProps<typeof Menu_2.Popup> & {
|
|
906
1031
|
position?: PositionProps;
|
|
907
1032
|
}): JSX.Element;
|
|
908
1033
|
|
|
909
|
-
declare namespace
|
|
1034
|
+
declare namespace Content_3 {
|
|
910
1035
|
var displayName: string;
|
|
911
1036
|
}
|
|
912
1037
|
|
|
913
1038
|
/** The main sheet panel. The `side` is inherited from `Sheet.Root` via context. */
|
|
914
|
-
declare function
|
|
1039
|
+
declare function Content_4({ className, children, ...props }: React_2.ComponentProps<typeof Drawer.Popup>): JSX.Element;
|
|
915
1040
|
|
|
916
|
-
declare namespace
|
|
1041
|
+
declare namespace Content_4 {
|
|
917
1042
|
var displayName: string;
|
|
918
1043
|
}
|
|
919
1044
|
|
|
920
1045
|
/** The tooltip popup that displays additional information. */
|
|
921
|
-
declare function
|
|
1046
|
+
declare function Content_5({ className, position, side: _side, align: _align, sideOffset: _sideOffset, children, ...restProps }: React_2.ComponentProps<typeof Tooltip_2.Popup> & {
|
|
922
1047
|
position?: PositionProps;
|
|
923
1048
|
/** @deprecated Use `position={{ side }}` instead. */
|
|
924
1049
|
side?: PositionProps["side"];
|
|
@@ -928,7 +1053,7 @@ declare function Content_4({ className, position, side: _side, align: _align, si
|
|
|
928
1053
|
sideOffset?: PositionProps["sideOffset"];
|
|
929
1054
|
}): JSX.Element;
|
|
930
1055
|
|
|
931
|
-
declare namespace
|
|
1056
|
+
declare namespace Content_5 {
|
|
932
1057
|
var displayName: string;
|
|
933
1058
|
}
|
|
934
1059
|
|
|
@@ -940,6 +1065,19 @@ export declare type ContextData = AppShellRegister extends {
|
|
|
940
1065
|
contextData: infer T;
|
|
941
1066
|
} ? T : Record<string, unknown>;
|
|
942
1067
|
|
|
1068
|
+
/**
|
|
1069
|
+
* A styled input control for the field.
|
|
1070
|
+
*
|
|
1071
|
+
* Can be omitted when using another Base UI-backed AppShell input component
|
|
1072
|
+
* (e.g. Select, Combobox, Autocomplete) as a sibling — those components
|
|
1073
|
+
* register themselves with the Field context automatically.
|
|
1074
|
+
*/
|
|
1075
|
+
declare function Control({ className, ...props }: React_2.ComponentProps<typeof Field_2.Control>): JSX.Element;
|
|
1076
|
+
|
|
1077
|
+
declare namespace Control {
|
|
1078
|
+
var displayName: string;
|
|
1079
|
+
}
|
|
1080
|
+
|
|
943
1081
|
/**
|
|
944
1082
|
* Creatable opt-in props. When `onCreateItem` is provided, the combobox allows
|
|
945
1083
|
* users to create new items on-the-fly.
|
|
@@ -1295,13 +1433,25 @@ declare namespace Description {
|
|
|
1295
1433
|
var displayName: string;
|
|
1296
1434
|
}
|
|
1297
1435
|
|
|
1298
|
-
/**
|
|
1299
|
-
|
|
1436
|
+
/**
|
|
1437
|
+
* A paragraph with additional information about the field.
|
|
1438
|
+
*
|
|
1439
|
+
* Its ID is registered with the Field context so that the control
|
|
1440
|
+
* automatically receives a matching `aria-describedby` attribute.
|
|
1441
|
+
*/
|
|
1442
|
+
declare function Description_2({ className, ...props }: React_2.ComponentProps<typeof Field_2.Description>): JSX.Element;
|
|
1300
1443
|
|
|
1301
1444
|
declare namespace Description_2 {
|
|
1302
1445
|
var displayName: string;
|
|
1303
1446
|
}
|
|
1304
1447
|
|
|
1448
|
+
/** A description that provides additional context for the sheet. */
|
|
1449
|
+
declare function Description_3({ className, ...props }: React_2.ComponentProps<typeof Drawer.Description>): JSX.Element;
|
|
1450
|
+
|
|
1451
|
+
declare namespace Description_3 {
|
|
1452
|
+
var displayName: string;
|
|
1453
|
+
}
|
|
1454
|
+
|
|
1305
1455
|
/**
|
|
1306
1456
|
* DescriptionCard - ERP document display component
|
|
1307
1457
|
*
|
|
@@ -1345,12 +1495,12 @@ export declare interface DescriptionCardProps {
|
|
|
1345
1495
|
}
|
|
1346
1496
|
|
|
1347
1497
|
export declare const Dialog: {
|
|
1348
|
-
Root: typeof
|
|
1498
|
+
Root: typeof Root_5;
|
|
1349
1499
|
Close: typeof Close;
|
|
1350
|
-
Content: typeof
|
|
1500
|
+
Content: typeof Content_2;
|
|
1351
1501
|
Description: typeof Description;
|
|
1352
1502
|
Footer: typeof Footer_2;
|
|
1353
|
-
Header: typeof
|
|
1503
|
+
Header: typeof Header_4;
|
|
1354
1504
|
Title: typeof Title;
|
|
1355
1505
|
Trigger: typeof Trigger;
|
|
1356
1506
|
};
|
|
@@ -1383,6 +1533,62 @@ export declare interface EnhancedAuthClient extends AuthClient {
|
|
|
1383
1533
|
fetch: AuthClient["fetch"];
|
|
1384
1534
|
}
|
|
1385
1535
|
|
|
1536
|
+
/**
|
|
1537
|
+
* An error message displayed if the field control fails validation.
|
|
1538
|
+
*
|
|
1539
|
+
* Its ID is registered with the Field context and appended to the control's
|
|
1540
|
+
* `aria-describedby`. Use the `match` prop to show the message only for a
|
|
1541
|
+
* specific `ValidityState` key (e.g. `"valueMissing"`, `"typeMismatch"`).
|
|
1542
|
+
* Omitting `match` shows the browser's default validation message.
|
|
1543
|
+
*
|
|
1544
|
+
* Multiple `Field.Error` elements can be placed in the same `Field.Root` to
|
|
1545
|
+
* handle different validation failures independently.
|
|
1546
|
+
*
|
|
1547
|
+
* @example
|
|
1548
|
+
* ### Single catch-all error
|
|
1549
|
+
* ```tsx
|
|
1550
|
+
* <Field.Root name="name">
|
|
1551
|
+
* <Field.Label>Name</Field.Label>
|
|
1552
|
+
* <Field.Control required />
|
|
1553
|
+
* <Field.Error>This field is required.</Field.Error>
|
|
1554
|
+
* </Field.Root>
|
|
1555
|
+
* ```
|
|
1556
|
+
*
|
|
1557
|
+
* @example
|
|
1558
|
+
* ### Multiple errors for different validity states
|
|
1559
|
+
* ```tsx
|
|
1560
|
+
* <Field.Root name="email">
|
|
1561
|
+
* <Field.Label>Email</Field.Label>
|
|
1562
|
+
* <Field.Control type="email" required />
|
|
1563
|
+
* <Field.Error match="valueMissing">Email is required.</Field.Error>
|
|
1564
|
+
* <Field.Error match="typeMismatch">Please enter a valid email address.</Field.Error>
|
|
1565
|
+
* </Field.Root>
|
|
1566
|
+
* ```
|
|
1567
|
+
*
|
|
1568
|
+
* @example
|
|
1569
|
+
* ### With React Hook Form error
|
|
1570
|
+
* ```tsx
|
|
1571
|
+
* <Controller
|
|
1572
|
+
* name="email"
|
|
1573
|
+
* control={control}
|
|
1574
|
+
* render={({ field, fieldState }) => (
|
|
1575
|
+
* <Field.Root {...fieldState}>
|
|
1576
|
+
* <Field.Label>Email</Field.Label>
|
|
1577
|
+
* <Field.Control {...field} />
|
|
1578
|
+
* <Field.Error match={!!fieldState.error}>
|
|
1579
|
+
* {fieldState.error?.message}
|
|
1580
|
+
* </Field.Error>
|
|
1581
|
+
* </Field.Root>
|
|
1582
|
+
* )}
|
|
1583
|
+
* />
|
|
1584
|
+
* ```
|
|
1585
|
+
*/
|
|
1586
|
+
declare function Error_2({ className, ...props }: React_2.ComponentProps<typeof Field_2.Error>): JSX.Element;
|
|
1587
|
+
|
|
1588
|
+
declare namespace Error_2 {
|
|
1589
|
+
var displayName: string;
|
|
1590
|
+
}
|
|
1591
|
+
|
|
1386
1592
|
/**
|
|
1387
1593
|
* Error boundary element type for route error handling.
|
|
1388
1594
|
*
|
|
@@ -1448,6 +1654,22 @@ declare type ExtractBasePath<T extends string> = T extends `${infer Base}?${stri
|
|
|
1448
1654
|
/** Extracts the item type from a possibly-grouped items array element. */
|
|
1449
1655
|
declare type ExtractItem<I> = I extends ItemGroup<infer T> ? T : I;
|
|
1450
1656
|
|
|
1657
|
+
/** Shown when there is no image or the image failed to load. */
|
|
1658
|
+
declare function Fallback({ className, ...props }: React_2.ComponentProps<typeof Avatar_2.Fallback>): JSX.Element;
|
|
1659
|
+
|
|
1660
|
+
declare namespace Fallback {
|
|
1661
|
+
var displayName: string;
|
|
1662
|
+
}
|
|
1663
|
+
|
|
1664
|
+
export declare const Field: {
|
|
1665
|
+
Root: typeof Root_6;
|
|
1666
|
+
Label: typeof Label;
|
|
1667
|
+
Control: typeof Control;
|
|
1668
|
+
Description: typeof Description_2;
|
|
1669
|
+
Error: typeof Error_2;
|
|
1670
|
+
Validity: typeof Validity;
|
|
1671
|
+
};
|
|
1672
|
+
|
|
1451
1673
|
/**
|
|
1452
1674
|
* A field configuration - either a divider or a field definition
|
|
1453
1675
|
*/
|
|
@@ -1502,6 +1724,50 @@ declare interface FieldMeta {
|
|
|
1502
1724
|
truncateLines?: number;
|
|
1503
1725
|
}
|
|
1504
1726
|
|
|
1727
|
+
declare type FieldRootProps = Pick<React_2.ComponentProps<typeof Field_2.Root>, "name" | "disabled" | "validate" | "validationMode" | "validationDebounceTime" | "className" | "style"> & {
|
|
1728
|
+
children: React_2.ReactNode;
|
|
1729
|
+
/** Whether the field has been blurred. Maps to Base UI's `touched`. */
|
|
1730
|
+
isTouched?: boolean;
|
|
1731
|
+
/** Whether the field value differs from the default. Maps to Base UI's `dirty`. */
|
|
1732
|
+
isDirty?: boolean;
|
|
1733
|
+
/** When true, marks the field as invalid. Also set automatically when `error` is provided. */
|
|
1734
|
+
invalid?: boolean;
|
|
1735
|
+
/**
|
|
1736
|
+
* An error object (e.g. from React Hook Form's `fieldState.error`).
|
|
1737
|
+
* When provided, the field is marked invalid (`invalid={!!error}`).
|
|
1738
|
+
*/
|
|
1739
|
+
error?: {
|
|
1740
|
+
message?: string;
|
|
1741
|
+
};
|
|
1742
|
+
};
|
|
1743
|
+
|
|
1744
|
+
export declare const Fieldset: {
|
|
1745
|
+
Root: typeof Root_7;
|
|
1746
|
+
Legend: typeof Legend;
|
|
1747
|
+
};
|
|
1748
|
+
|
|
1749
|
+
/**
|
|
1750
|
+
* Groups related fields with a shared legend for accessible form sectioning.
|
|
1751
|
+
*
|
|
1752
|
+
* @example
|
|
1753
|
+
* ```tsx
|
|
1754
|
+
* <Fieldset.Root>
|
|
1755
|
+
* <Fieldset.Legend>Billing details</Fieldset.Legend>
|
|
1756
|
+
* <Field.Root name="company">
|
|
1757
|
+
* <Field.Label>Company</Field.Label>
|
|
1758
|
+
* <Field.Control />
|
|
1759
|
+
* </Field.Root>
|
|
1760
|
+
* <Field.Root name="taxId">
|
|
1761
|
+
* <Field.Label>Tax ID</Field.Label>
|
|
1762
|
+
* <Field.Control />
|
|
1763
|
+
* </Field.Root>
|
|
1764
|
+
* </Fieldset.Root>
|
|
1765
|
+
* ```
|
|
1766
|
+
*/
|
|
1767
|
+
declare type FieldsetRootProps = Pick<React_2.ComponentProps<typeof Fieldset_2.Root>, "disabled" | "className" | "style"> & {
|
|
1768
|
+
children: React_2.ReactNode;
|
|
1769
|
+
};
|
|
1770
|
+
|
|
1505
1771
|
/**
|
|
1506
1772
|
* Supported field types for DescriptionCard
|
|
1507
1773
|
*/
|
|
@@ -1528,6 +1794,96 @@ declare namespace Footer_3 {
|
|
|
1528
1794
|
var displayName: string;
|
|
1529
1795
|
}
|
|
1530
1796
|
|
|
1797
|
+
/**
|
|
1798
|
+
* A form element with consolidated error handling and validation.
|
|
1799
|
+
*
|
|
1800
|
+
* Wraps every child `Field.Root` in a shared validation / error context.
|
|
1801
|
+
* External errors passed via `errors` are automatically routed to matching
|
|
1802
|
+
* `Field.Error` components by field `name`, and cleared when the user edits
|
|
1803
|
+
* the corresponding field.
|
|
1804
|
+
*
|
|
1805
|
+
* ## Validation flow
|
|
1806
|
+
*
|
|
1807
|
+
* Each `Field.Root` can declare its own `validate` function and/or rely on
|
|
1808
|
+
* native HTML constraint attributes (`required`, `type="email"`, `pattern`,
|
|
1809
|
+
* etc.). The moment validation fires is controlled by `validationMode`
|
|
1810
|
+
* (default `"onSubmit"`).
|
|
1811
|
+
*
|
|
1812
|
+
* External errors (e.g. from an API response) can be fed back via `errors`.
|
|
1813
|
+
* Errors are keyed by the field's `name` attribute and rendered by any
|
|
1814
|
+
* `Field.Error` with a matching `match` or a catch-all `Field.Error`
|
|
1815
|
+
* (no `match`).
|
|
1816
|
+
*
|
|
1817
|
+
* ## Programmatic validation
|
|
1818
|
+
*
|
|
1819
|
+
* Use `actionsRef` to imperatively trigger validation from outside the
|
|
1820
|
+
* normal submit flow (e.g. a "Validate" button or a multi-step wizard).
|
|
1821
|
+
*
|
|
1822
|
+
* ```tsx
|
|
1823
|
+
* const actions = React.useRef<{ validate: () => void }>(null);
|
|
1824
|
+
* <Form actionsRef={actions}>…</Form>
|
|
1825
|
+
* <button onClick={() => actions.current?.validate()}>Check</button>
|
|
1826
|
+
* ```
|
|
1827
|
+
*
|
|
1828
|
+
* @example
|
|
1829
|
+
* ### Basic usage
|
|
1830
|
+
* ```tsx
|
|
1831
|
+
* <Form onFormSubmit={(values) => save(values)}>
|
|
1832
|
+
* <Field.Root name="email">
|
|
1833
|
+
* <Field.Label>Email</Field.Label>
|
|
1834
|
+
* <Field.Control type="email" required />
|
|
1835
|
+
* <Field.Error match="typeMismatch">Enter a valid email.</Field.Error>
|
|
1836
|
+
* </Field.Root>
|
|
1837
|
+
* <button type="submit">Save</button>
|
|
1838
|
+
* </Form>
|
|
1839
|
+
* ```
|
|
1840
|
+
*
|
|
1841
|
+
* @example
|
|
1842
|
+
* ### External errors (e.g. API validation)
|
|
1843
|
+
* ```tsx
|
|
1844
|
+
* const [errors, setErrors] = React.useState({});
|
|
1845
|
+
*
|
|
1846
|
+
* async function handleSubmit(values) {
|
|
1847
|
+
* const res = await api.save(values);
|
|
1848
|
+
* if (res.errors) setErrors(res.errors);
|
|
1849
|
+
* }
|
|
1850
|
+
*
|
|
1851
|
+
* <Form errors={errors} onFormSubmit={handleSubmit}>
|
|
1852
|
+
* <Field.Root name="url">
|
|
1853
|
+
* <Field.Label>Homepage</Field.Label>
|
|
1854
|
+
* <Field.Control type="url" required />
|
|
1855
|
+
* <Field.Error />
|
|
1856
|
+
* </Field.Root>
|
|
1857
|
+
* <button type="submit">Submit</button>
|
|
1858
|
+
* </Form>
|
|
1859
|
+
* ```
|
|
1860
|
+
*/
|
|
1861
|
+
export declare function Form<FormValues extends Record<string, any> = Record<string, any>>({ className, children, ...props }: FormProps<FormValues>): JSX.Element;
|
|
1862
|
+
|
|
1863
|
+
export declare namespace Form {
|
|
1864
|
+
var displayName: string;
|
|
1865
|
+
}
|
|
1866
|
+
|
|
1867
|
+
export declare type FormProps<FormValues extends Record<string, any> = Record<string, any>> = Pick<React_2.ComponentProps<typeof Form_2>, "errors" | "actionsRef" | "validationMode" | "noValidate" | "ref" | "className" | "style"> & {
|
|
1868
|
+
children: React_2.ReactNode;
|
|
1869
|
+
/**
|
|
1870
|
+
* Low-level submit handler that receives the native `FormEvent`.
|
|
1871
|
+
* Use this when you need direct access to the event (e.g. integrating
|
|
1872
|
+
* with React Hook Form's `handleSubmit`). For type-safe parsed form
|
|
1873
|
+
* values, prefer `onFormSubmit` instead.
|
|
1874
|
+
*/
|
|
1875
|
+
onSubmit?: React_2.ComponentProps<typeof Form_2>["onSubmit"];
|
|
1876
|
+
/**
|
|
1877
|
+
* Called after successful validation with the parsed form values as a
|
|
1878
|
+
* typed object. Prefer this for simple forms that don't use an external
|
|
1879
|
+
* form library. When integrating with React Hook Form, use `onSubmit`
|
|
1880
|
+
* instead.
|
|
1881
|
+
*/
|
|
1882
|
+
onFormSubmit?: ((formValues: FormValues, eventDetails: FormSubmitEventDetails) => void) | undefined;
|
|
1883
|
+
};
|
|
1884
|
+
|
|
1885
|
+
declare type FormSubmitEventDetails = NonNullable<React_2.ComponentProps<typeof Form_2>["onFormSubmit"]> extends (values: any, details: infer D) => any ? D : never;
|
|
1886
|
+
|
|
1531
1887
|
/** Groups related menu items with the corresponding label. */
|
|
1532
1888
|
declare function Group({ ...props }: React_2.ComponentProps<typeof Menu_2.Group>): JSX.Element;
|
|
1533
1889
|
|
|
@@ -1633,20 +1989,31 @@ declare namespace Header_2 {
|
|
|
1633
1989
|
var displayName: string;
|
|
1634
1990
|
}
|
|
1635
1991
|
|
|
1636
|
-
|
|
1637
|
-
declare function Header_3({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
|
|
1992
|
+
declare function Header_3({ className, title, description, children, ...props }: HeaderProps): JSX.Element;
|
|
1638
1993
|
|
|
1639
1994
|
declare namespace Header_3 {
|
|
1640
1995
|
var displayName: string;
|
|
1641
1996
|
}
|
|
1642
1997
|
|
|
1643
|
-
/** A layout wrapper for the
|
|
1998
|
+
/** A layout wrapper for the dialog title and description. */
|
|
1644
1999
|
declare function Header_4({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
|
|
1645
2000
|
|
|
1646
2001
|
declare namespace Header_4 {
|
|
1647
2002
|
var displayName: string;
|
|
1648
2003
|
}
|
|
1649
2004
|
|
|
2005
|
+
/** A layout wrapper for the sheet title and description. */
|
|
2006
|
+
declare function Header_5({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
|
|
2007
|
+
|
|
2008
|
+
declare namespace Header_5 {
|
|
2009
|
+
var displayName: string;
|
|
2010
|
+
}
|
|
2011
|
+
|
|
2012
|
+
declare type HeaderProps = Omit<React_2.ComponentProps<"div">, "title"> & {
|
|
2013
|
+
title?: React_2.ReactNode;
|
|
2014
|
+
description?: React_2.ReactNode;
|
|
2015
|
+
};
|
|
2016
|
+
|
|
1650
2017
|
/**
|
|
1651
2018
|
* Deny access and show 404 Not Found.
|
|
1652
2019
|
*
|
|
@@ -1668,6 +2035,13 @@ export declare type I18nLabels<Def extends Record<string, LabelValue> = Record<s
|
|
|
1668
2035
|
[K in L]: LabelDefinition<Def>;
|
|
1669
2036
|
} & DynamicLocales<Def>;
|
|
1670
2037
|
|
|
2038
|
+
/** Profile image; hidden when missing or failed to load. */
|
|
2039
|
+
declare function Image_2({ className, ...props }: React_2.ComponentProps<typeof Avatar_2.Image>): JSX.Element;
|
|
2040
|
+
|
|
2041
|
+
declare namespace Image_2 {
|
|
2042
|
+
var displayName: string;
|
|
2043
|
+
}
|
|
2044
|
+
|
|
1671
2045
|
/**
|
|
1672
2046
|
* A styled input component.
|
|
1673
2047
|
*
|
|
@@ -1688,13 +2062,19 @@ export declare type InputProps = React_2.ComponentProps<"input">;
|
|
|
1688
2062
|
*/
|
|
1689
2063
|
declare type IsEmptyObject<T> = keyof T extends never ? true : false;
|
|
1690
2064
|
|
|
1691
|
-
|
|
1692
|
-
declare function Item({ className, ...props }: React_2.ComponentProps<typeof Menu_2.Item>): JSX.Element;
|
|
2065
|
+
declare function Item({ indicator, children, className }: ActivityCardItemProps): JSX.Element;
|
|
1693
2066
|
|
|
1694
2067
|
declare namespace Item {
|
|
1695
2068
|
var displayName: string;
|
|
1696
2069
|
}
|
|
1697
2070
|
|
|
2071
|
+
/** An individual interactive item in the menu. */
|
|
2072
|
+
declare function Item_2({ className, ...props }: React_2.ComponentProps<typeof Menu_2.Item>): JSX.Element;
|
|
2073
|
+
|
|
2074
|
+
declare namespace Item_2 {
|
|
2075
|
+
var displayName: string;
|
|
2076
|
+
}
|
|
2077
|
+
|
|
1698
2078
|
/**
|
|
1699
2079
|
* A group of items with a label, used by Select, Combobox, and Autocomplete standalone components.
|
|
1700
2080
|
*
|
|
@@ -1707,6 +2087,26 @@ export declare interface ItemGroup<T> {
|
|
|
1707
2087
|
items: T[];
|
|
1708
2088
|
}
|
|
1709
2089
|
|
|
2090
|
+
declare function Items<T extends ActivityCardBaseItem>({ children }: ActivityCardItemsProps<T>): JSX.Element;
|
|
2091
|
+
|
|
2092
|
+
declare namespace Items {
|
|
2093
|
+
var displayName: string;
|
|
2094
|
+
}
|
|
2095
|
+
|
|
2096
|
+
/**
|
|
2097
|
+
* An accessible label that is automatically associated with the field control.
|
|
2098
|
+
*
|
|
2099
|
+
* Uses the `LabelableContext` provided by `Field.Root` to resolve `htmlFor`.
|
|
2100
|
+
* Any Base UI control inside the same `Field.Root` (Field.Control, Select,
|
|
2101
|
+
* Combobox, Autocomplete) registers its ID with the context, so clicking
|
|
2102
|
+
* this label will focus the correct control.
|
|
2103
|
+
*/
|
|
2104
|
+
declare function Label({ className, ...props }: React_2.ComponentProps<typeof Field_2.Label>): JSX.Element;
|
|
2105
|
+
|
|
2106
|
+
declare namespace Label {
|
|
2107
|
+
var displayName: string;
|
|
2108
|
+
}
|
|
2109
|
+
|
|
1710
2110
|
/**
|
|
1711
2111
|
* Ensures that other locales have the same label structure as the base definition.
|
|
1712
2112
|
* For dynamic labels (functions), the props type must match.
|
|
@@ -1814,6 +2214,13 @@ export declare interface LayoutProps {
|
|
|
1814
2214
|
children: ReactNode;
|
|
1815
2215
|
}
|
|
1816
2216
|
|
|
2217
|
+
/** An accessible legend that is automatically associated with the fieldset. */
|
|
2218
|
+
declare function Legend({ className, ...props }: React_2.ComponentProps<typeof Fieldset_2.Legend>): JSX.Element;
|
|
2219
|
+
|
|
2220
|
+
declare namespace Legend {
|
|
2221
|
+
var displayName: string;
|
|
2222
|
+
}
|
|
2223
|
+
|
|
1817
2224
|
export { Link }
|
|
1818
2225
|
|
|
1819
2226
|
/** A link item in the menu that can be used to navigate to a different page. */
|
|
@@ -1838,10 +2245,10 @@ export declare interface MappedItem {
|
|
|
1838
2245
|
}
|
|
1839
2246
|
|
|
1840
2247
|
export declare const Menu: {
|
|
1841
|
-
Root: typeof
|
|
2248
|
+
Root: typeof Root_8;
|
|
1842
2249
|
Trigger: typeof Trigger_2;
|
|
1843
|
-
Content: typeof
|
|
1844
|
-
Item: typeof
|
|
2250
|
+
Content: typeof Content_3;
|
|
2251
|
+
Item: typeof Item_2;
|
|
1845
2252
|
LinkItem: typeof LinkItem;
|
|
1846
2253
|
CheckboxItem: typeof CheckboxItem;
|
|
1847
2254
|
CheckboxItemIndicator: typeof CheckboxItemIndicator;
|
|
@@ -1866,6 +2273,57 @@ declare namespace MenuSeparator {
|
|
|
1866
2273
|
var displayName: string;
|
|
1867
2274
|
}
|
|
1868
2275
|
|
|
2276
|
+
/**
|
|
2277
|
+
* MetricCard — Compact card for dashboard KPI display (title, value, optional trend and description).
|
|
2278
|
+
*
|
|
2279
|
+
* Static display only in v1. Use for summary metrics (e.g. net total, discount total).
|
|
2280
|
+
* Styling follows existing card conventions (bg-card, border, rounded-xl).
|
|
2281
|
+
*
|
|
2282
|
+
* @example
|
|
2283
|
+
* ```tsx
|
|
2284
|
+
* <MetricCard
|
|
2285
|
+
* title="Net total payment"
|
|
2286
|
+
* value="$1,500.00"
|
|
2287
|
+
* trend={{ direction: "up", value: "+5%" }}
|
|
2288
|
+
* description="vs last month"
|
|
2289
|
+
* />
|
|
2290
|
+
* ```
|
|
2291
|
+
*/
|
|
2292
|
+
export declare function MetricCard({ title, value, trend, description, icon, className }: MetricCardProps): JSX.Element;
|
|
2293
|
+
|
|
2294
|
+
/**
|
|
2295
|
+
* Props for the MetricCard component.
|
|
2296
|
+
*/
|
|
2297
|
+
export declare interface MetricCardProps {
|
|
2298
|
+
/** Metric title / header (e.g. "Net total payment") */
|
|
2299
|
+
title: string;
|
|
2300
|
+
/** Primary value (e.g. formatted currency or number) */
|
|
2301
|
+
value: ReactNode;
|
|
2302
|
+
/** Optional trend indicator */
|
|
2303
|
+
trend?: MetricCardTrend;
|
|
2304
|
+
/**
|
|
2305
|
+
* Optional supplementary description (e.g. "vs last period", "this week").
|
|
2306
|
+
* Empty strings are treated as absent and the description is not rendered in the meta row.
|
|
2307
|
+
*/
|
|
2308
|
+
description?: string;
|
|
2309
|
+
/** Optional leading icon */
|
|
2310
|
+
icon?: ReactNode;
|
|
2311
|
+
/** Additional CSS classes for the card container */
|
|
2312
|
+
className?: string;
|
|
2313
|
+
}
|
|
2314
|
+
|
|
2315
|
+
declare interface MetricCardTrend {
|
|
2316
|
+
/** Visual and semantic direction */
|
|
2317
|
+
direction: MetricCardTrendDirection;
|
|
2318
|
+
/** Display value (e.g. "+12%", "-5%") */
|
|
2319
|
+
value: string;
|
|
2320
|
+
}
|
|
2321
|
+
|
|
2322
|
+
/**
|
|
2323
|
+
* Trend direction for metric display (e.g. up = positive, down = negative).
|
|
2324
|
+
*/
|
|
2325
|
+
declare type MetricCardTrendDirection = "up" | "down" | "neutral";
|
|
2326
|
+
|
|
1869
2327
|
/**
|
|
1870
2328
|
* A resource that can be included in the root-level content in the navigation.
|
|
1871
2329
|
*/
|
|
@@ -2013,6 +2471,50 @@ declare type ResourceMeta = {
|
|
|
2013
2471
|
breadcrumbTitle?: string | ((segment: string) => string);
|
|
2014
2472
|
};
|
|
2015
2473
|
|
|
2474
|
+
declare function Root<T extends ActivityCardBaseItem>({ items, title, maxVisible, overflowLabel, groupBy, className, children, }: ActivityCardRootProps<T>): JSX.Element;
|
|
2475
|
+
|
|
2476
|
+
declare namespace Root {
|
|
2477
|
+
var displayName: string;
|
|
2478
|
+
}
|
|
2479
|
+
|
|
2480
|
+
/**
|
|
2481
|
+
* The root component that manages tooltip open/close state.
|
|
2482
|
+
*
|
|
2483
|
+
* @example
|
|
2484
|
+
* ```tsx
|
|
2485
|
+
* <Tooltip.Root>
|
|
2486
|
+
* <Tooltip.Trigger render={<Button variant="outline" />}>
|
|
2487
|
+
* Hover me
|
|
2488
|
+
* </Tooltip.Trigger>
|
|
2489
|
+
* <Tooltip.Content>Helpful information</Tooltip.Content>
|
|
2490
|
+
* </Tooltip.Root>
|
|
2491
|
+
* ```
|
|
2492
|
+
*/
|
|
2493
|
+
declare function Root_10({ children, ...props }: TooltipRootProps): JSX.Element;
|
|
2494
|
+
|
|
2495
|
+
declare namespace Root_10 {
|
|
2496
|
+
var displayName: string;
|
|
2497
|
+
}
|
|
2498
|
+
|
|
2499
|
+
/**
|
|
2500
|
+
* Root container for an avatar (image with optional fallback).
|
|
2501
|
+
*
|
|
2502
|
+
* @example
|
|
2503
|
+
* ```tsx
|
|
2504
|
+
* import { Avatar } from "@tailor-platform/app-shell";
|
|
2505
|
+
*
|
|
2506
|
+
* <Avatar.Root>
|
|
2507
|
+
* <Avatar.Image src="/user.png" alt="User" />
|
|
2508
|
+
* <Avatar.Fallback>AB</Avatar.Fallback>
|
|
2509
|
+
* </Avatar.Root>
|
|
2510
|
+
* ```
|
|
2511
|
+
*/
|
|
2512
|
+
declare function Root_2({ className, size, ...props }: AvatarProps): JSX.Element;
|
|
2513
|
+
|
|
2514
|
+
declare namespace Root_2 {
|
|
2515
|
+
var displayName: string;
|
|
2516
|
+
}
|
|
2517
|
+
|
|
2016
2518
|
/**
|
|
2017
2519
|
* The root table element with a horizontally scrollable container.
|
|
2018
2520
|
*
|
|
@@ -2036,9 +2538,15 @@ declare type ResourceMeta = {
|
|
|
2036
2538
|
* </Table.Root>
|
|
2037
2539
|
* ```
|
|
2038
2540
|
*/
|
|
2039
|
-
declare function
|
|
2541
|
+
declare function Root_3({ className, containerClassName, ...props }: RootProps): JSX.Element;
|
|
2040
2542
|
|
|
2041
|
-
declare namespace
|
|
2543
|
+
declare namespace Root_3 {
|
|
2544
|
+
var displayName: string;
|
|
2545
|
+
}
|
|
2546
|
+
|
|
2547
|
+
declare function Root_4({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
|
|
2548
|
+
|
|
2549
|
+
declare namespace Root_4 {
|
|
2042
2550
|
var displayName: string;
|
|
2043
2551
|
}
|
|
2044
2552
|
|
|
@@ -2062,9 +2570,70 @@ declare namespace Root {
|
|
|
2062
2570
|
* </Dialog.Root>
|
|
2063
2571
|
* ```
|
|
2064
2572
|
*/
|
|
2065
|
-
declare function
|
|
2573
|
+
declare function Root_5({ ...props }: DialogRootProps): JSX.Element;
|
|
2066
2574
|
|
|
2067
|
-
declare namespace
|
|
2575
|
+
declare namespace Root_5 {
|
|
2576
|
+
var displayName: string;
|
|
2577
|
+
}
|
|
2578
|
+
|
|
2579
|
+
/**
|
|
2580
|
+
* Groups all parts of a form field and manages its validation state.
|
|
2581
|
+
*
|
|
2582
|
+
* Provides a `LabelableContext` and `FieldRootContext` that Base UI controls
|
|
2583
|
+
* automatically connect to. Any Base UI-backed control placed as a child
|
|
2584
|
+
* (e.g. Select, Combobox, Autocomplete, Field.Control) will:
|
|
2585
|
+
*
|
|
2586
|
+
* - Register its ID so that `Field.Label` receives the correct `htmlFor`
|
|
2587
|
+
* - Receive `aria-describedby` linking to `Field.Description` and `Field.Error`
|
|
2588
|
+
* - Inherit the `disabled` state from this root
|
|
2589
|
+
* - Participate in the validation system (`invalid`, `dirty`, `touched`)
|
|
2590
|
+
*
|
|
2591
|
+
* This means `Field.Control` can be omitted when using another AppShell input
|
|
2592
|
+
* component — the wiring happens automatically through Base UI's context.
|
|
2593
|
+
*
|
|
2594
|
+
* @example
|
|
2595
|
+
* ### With Field.Control (plain input)
|
|
2596
|
+
* ```tsx
|
|
2597
|
+
* <Field.Root name="email">
|
|
2598
|
+
* <Field.Label>Email</Field.Label>
|
|
2599
|
+
* <Field.Control type="email" required />
|
|
2600
|
+
* <Field.Description>We'll never share your email.</Field.Description>
|
|
2601
|
+
* <Field.Error match="typeMismatch">Please enter a valid email.</Field.Error>
|
|
2602
|
+
* </Field.Root>
|
|
2603
|
+
* ```
|
|
2604
|
+
*
|
|
2605
|
+
* @example
|
|
2606
|
+
* ### With React Hook Form (Controller spread)
|
|
2607
|
+
* ```tsx
|
|
2608
|
+
* <Controller
|
|
2609
|
+
* name="email"
|
|
2610
|
+
* control={control}
|
|
2611
|
+
* rules={{ required: "Required" }}
|
|
2612
|
+
* render={({ field, fieldState }) => (
|
|
2613
|
+
* <Field.Root {...fieldState}>
|
|
2614
|
+
* <Field.Label>Email</Field.Label>
|
|
2615
|
+
* <Field.Control {...field} type="email" />
|
|
2616
|
+
* <Field.Error match={fieldState.invalid}>{fieldState.error?.message}</Field.Error>
|
|
2617
|
+
* </Field.Root>
|
|
2618
|
+
* )}
|
|
2619
|
+
* />
|
|
2620
|
+
* ```
|
|
2621
|
+
*
|
|
2622
|
+
* > **Note:** When combining RHF with `Form`'s `errors` prop for server-side
|
|
2623
|
+
* > error routing, add `name={field.name}` to `Field.Root` so errors can be
|
|
2624
|
+
* > matched by field name.
|
|
2625
|
+
*/
|
|
2626
|
+
declare function Root_6({ className, children, isTouched, isDirty, invalid, error, isValidating: _isValidating, ...props }: FieldRootProps & {
|
|
2627
|
+
isValidating?: unknown;
|
|
2628
|
+
}): JSX.Element;
|
|
2629
|
+
|
|
2630
|
+
declare namespace Root_6 {
|
|
2631
|
+
var displayName: string;
|
|
2632
|
+
}
|
|
2633
|
+
|
|
2634
|
+
declare function Root_7({ className, ...props }: FieldsetRootProps): JSX.Element;
|
|
2635
|
+
|
|
2636
|
+
declare namespace Root_7 {
|
|
2068
2637
|
var displayName: string;
|
|
2069
2638
|
}
|
|
2070
2639
|
|
|
@@ -2084,9 +2653,9 @@ declare namespace Root_2 {
|
|
|
2084
2653
|
* </Menu.Root>
|
|
2085
2654
|
* ```
|
|
2086
2655
|
*/
|
|
2087
|
-
declare function
|
|
2656
|
+
declare function Root_8({ children, ...props }: MenuRootProps): JSX.Element;
|
|
2088
2657
|
|
|
2089
|
-
declare namespace
|
|
2658
|
+
declare namespace Root_8 {
|
|
2090
2659
|
var displayName: string;
|
|
2091
2660
|
}
|
|
2092
2661
|
|
|
@@ -2110,28 +2679,9 @@ declare namespace Root_3 {
|
|
|
2110
2679
|
* </Sheet.Root>
|
|
2111
2680
|
* ```
|
|
2112
2681
|
*/
|
|
2113
|
-
declare function
|
|
2682
|
+
declare function Root_9({ side, ...props }: SheetRootProps): JSX.Element;
|
|
2114
2683
|
|
|
2115
|
-
declare namespace
|
|
2116
|
-
var displayName: string;
|
|
2117
|
-
}
|
|
2118
|
-
|
|
2119
|
-
/**
|
|
2120
|
-
* The root component that manages tooltip open/close state.
|
|
2121
|
-
*
|
|
2122
|
-
* @example
|
|
2123
|
-
* ```tsx
|
|
2124
|
-
* <Tooltip.Root>
|
|
2125
|
-
* <Tooltip.Trigger render={<Button variant="outline" />}>
|
|
2126
|
-
* Hover me
|
|
2127
|
-
* </Tooltip.Trigger>
|
|
2128
|
-
* <Tooltip.Content>Helpful information</Tooltip.Content>
|
|
2129
|
-
* </Tooltip.Root>
|
|
2130
|
-
* ```
|
|
2131
|
-
*/
|
|
2132
|
-
declare function Root_5({ children, ...props }: TooltipRootProps): JSX.Element;
|
|
2133
|
-
|
|
2134
|
-
declare namespace Root_5 {
|
|
2684
|
+
declare namespace Root_9 {
|
|
2135
2685
|
var displayName: string;
|
|
2136
2686
|
}
|
|
2137
2687
|
|
|
@@ -2404,14 +2954,14 @@ declare type SharedAppShellProps = React.PropsWithChildren<{
|
|
|
2404
2954
|
}>;
|
|
2405
2955
|
|
|
2406
2956
|
export declare const Sheet: {
|
|
2407
|
-
Root: typeof
|
|
2957
|
+
Root: typeof Root_9;
|
|
2408
2958
|
Trigger: typeof Trigger_3;
|
|
2409
2959
|
Close: typeof Close_2;
|
|
2410
|
-
Content: typeof
|
|
2411
|
-
Header: typeof
|
|
2960
|
+
Content: typeof Content_4;
|
|
2961
|
+
Header: typeof Header_5;
|
|
2412
2962
|
Footer: typeof Footer_3;
|
|
2413
2963
|
Title: typeof Title_2;
|
|
2414
|
-
Description: typeof
|
|
2964
|
+
Description: typeof Description_3;
|
|
2415
2965
|
};
|
|
2416
2966
|
|
|
2417
2967
|
declare type SheetRootProps = Pick<React_2.ComponentProps<typeof Drawer.Root>, "open" | "defaultOpen" | "onOpenChange" | "modal"> & {
|
|
@@ -2620,7 +3170,7 @@ declare namespace SubmenuTrigger {
|
|
|
2620
3170
|
}
|
|
2621
3171
|
|
|
2622
3172
|
export declare const Table: {
|
|
2623
|
-
Root: typeof
|
|
3173
|
+
Root: typeof Root_3;
|
|
2624
3174
|
Header: typeof Header_2;
|
|
2625
3175
|
Body: typeof Body_2;
|
|
2626
3176
|
Footer: typeof Footer;
|
|
@@ -2653,9 +3203,9 @@ declare namespace Title_2 {
|
|
|
2653
3203
|
}
|
|
2654
3204
|
|
|
2655
3205
|
export declare const Tooltip: {
|
|
2656
|
-
Root: typeof
|
|
3206
|
+
Root: typeof Root_10;
|
|
2657
3207
|
Trigger: typeof Trigger_4;
|
|
2658
|
-
Content: typeof
|
|
3208
|
+
Content: typeof Content_5;
|
|
2659
3209
|
Provider: typeof Provider;
|
|
2660
3210
|
};
|
|
2661
3211
|
|
|
@@ -3124,6 +3674,57 @@ export declare const useTheme: () => ThemeProviderState;
|
|
|
3124
3674
|
|
|
3125
3675
|
export declare const useToast: () => typeof toast;
|
|
3126
3676
|
|
|
3677
|
+
/**
|
|
3678
|
+
* Used to display a custom message based on the field's validity state.
|
|
3679
|
+
*
|
|
3680
|
+
* Requires `children` to be a render function that receives a
|
|
3681
|
+
* `FieldValidityState` object. The `validity` property within it mirrors the
|
|
3682
|
+
* browser's `ValidityState` (e.g. `valueMissing`, `tooShort`, `valid`),
|
|
3683
|
+
* enabling fully custom validation UI.
|
|
3684
|
+
*
|
|
3685
|
+
* @example
|
|
3686
|
+
* ### Checklist-style password requirements
|
|
3687
|
+
* ```tsx
|
|
3688
|
+
* <Field.Root name="password">
|
|
3689
|
+
* <Field.Label>Password</Field.Label>
|
|
3690
|
+
* <Field.Control type="password" required minLength={8} />
|
|
3691
|
+
* <Field.Validity>
|
|
3692
|
+
* {(state) => (
|
|
3693
|
+
* <ul>
|
|
3694
|
+
* <li>{state.validity.valueMissing ? "NG" : "OK"} Required</li>
|
|
3695
|
+
* <li>{state.validity.tooShort ? "NG" : "OK"} At least 8 characters</li>
|
|
3696
|
+
* </ul>
|
|
3697
|
+
* )}
|
|
3698
|
+
* </Field.Validity>
|
|
3699
|
+
* </Field.Root>
|
|
3700
|
+
* ```
|
|
3701
|
+
*
|
|
3702
|
+
* @example
|
|
3703
|
+
* ### Conditional styling based on validity
|
|
3704
|
+
* ```tsx
|
|
3705
|
+
* <Field.Root name="url">
|
|
3706
|
+
* <Field.Label>Website</Field.Label>
|
|
3707
|
+
* <Field.Control type="url" required />
|
|
3708
|
+
* <Field.Validity>
|
|
3709
|
+
* {(state) =>
|
|
3710
|
+
* state.validity.valid === false && (
|
|
3711
|
+
* <p className="text-destructive text-sm">
|
|
3712
|
+
* {state.validity.typeMismatch
|
|
3713
|
+
* ? "Please enter a valid URL (e.g. https://example.com)"
|
|
3714
|
+
* : "This field is required."}
|
|
3715
|
+
* </p>
|
|
3716
|
+
* )
|
|
3717
|
+
* }
|
|
3718
|
+
* </Field.Validity>
|
|
3719
|
+
* </Field.Root>
|
|
3720
|
+
* ```
|
|
3721
|
+
*/
|
|
3722
|
+
declare function Validity({ ...props }: React_2.ComponentProps<typeof Field_2.Validity>): JSX.Element;
|
|
3723
|
+
|
|
3724
|
+
declare namespace Validity {
|
|
3725
|
+
var displayName: string;
|
|
3726
|
+
}
|
|
3727
|
+
|
|
3127
3728
|
/**
|
|
3128
3729
|
* Conditionally render children based on guard evaluation.
|
|
3129
3730
|
*
|