@tailor-platform/app-shell 0.29.0 → 0.30.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.
@@ -1,5 +1,8 @@
1
1
  import { AuthClient } from '@tailor-platform/auth-public-client';
2
2
  import { ClassProp } from 'class-variance-authority/types';
3
+ import { CSSProperties } from 'react';
4
+ import { Dialog as Dialog_2 } from '@base-ui/react/dialog';
5
+ import { Drawer } from '@base-ui/react/drawer';
3
6
  import { FC } from 'react';
4
7
  import { JSX } from 'react/jsx-runtime';
5
8
  import { Link } from 'react-router';
@@ -7,6 +10,7 @@ import { LoaderFunctionArgs } from 'react-router';
7
10
  import * as React_2 from 'react';
8
11
  import { ReactNode } from 'react';
9
12
  import { toast } from 'sonner';
13
+ import { Tooltip as Tooltip_2 } from '@base-ui/react/tooltip';
10
14
  import { useLocation } from 'react-router';
11
15
  import { useNavigate } from 'react-router';
12
16
  import { useParams } from 'react-router';
@@ -293,6 +297,64 @@ export declare const badgeVariants: (props?: ({
293
297
  */
294
298
  declare type BadgeVariantType = "default" | "success" | "warning" | "error" | "neutral" | "outline-success" | "outline-warning" | "outline-error" | "outline-info" | "outline-neutral";
295
299
 
300
+ /** The table body section (`<tbody>`). */
301
+ declare function Body_2({ className, ...props }: React_2.ComponentProps<"tbody">): JSX.Element;
302
+
303
+ declare namespace Body_2 {
304
+ var displayName: string;
305
+ }
306
+
307
+ /**
308
+ * A styled button component with multiple variants and sizes.
309
+ *
310
+ * @example
311
+ * ```tsx
312
+ * import { Button } from "@tailor-platform/app-shell";
313
+ *
314
+ * <Button variant="default">Click me</Button>
315
+ * <Button variant="outline" size="sm">Small</Button>
316
+ * <Button variant="destructive">Delete</Button>
317
+ * ```
318
+ */
319
+ export declare function Button({ className, variant, size, render, children, ...props }: ButtonProps): React_2.ReactElement<unknown, string | React_2.JSXElementConstructor<any>>;
320
+
321
+ export declare type ButtonProps = React_2.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
322
+ render?: React_2.ReactElement;
323
+ };
324
+
325
+ export declare const buttonVariants: (props?: ({
326
+ variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
327
+ size?: "default" | "sm" | "lg" | "icon" | null | undefined;
328
+ } & ClassProp) | undefined) => string;
329
+
330
+ /** A table caption element. */
331
+ declare function Caption({ className, ...props }: React_2.ComponentProps<"caption">): JSX.Element;
332
+
333
+ declare namespace Caption {
334
+ var displayName: string;
335
+ }
336
+
337
+ /** A table data cell (`<td>`). */
338
+ declare function Cell({ className, ...props }: React_2.ComponentProps<"td">): JSX.Element;
339
+
340
+ declare namespace Cell {
341
+ var displayName: string;
342
+ }
343
+
344
+ /** A button that closes the dialog. */
345
+ declare function Close({ ...props }: React_2.ComponentProps<typeof Dialog_2.Close>): JSX.Element;
346
+
347
+ declare namespace Close {
348
+ var displayName: string;
349
+ }
350
+
351
+ /** A button that closes the sheet. */
352
+ declare function Close_2({ ...props }: React_2.ComponentProps<typeof Drawer.Close>): JSX.Element;
353
+
354
+ declare namespace Close_2 {
355
+ var displayName: string;
356
+ }
357
+
296
358
  /**
297
359
  * Supported area values for Layout.Column
298
360
  */
@@ -309,6 +371,8 @@ declare type ColumnCount = 1 | 2 | 3;
309
371
  declare interface ColumnProps {
310
372
  /** Additional CSS classes */
311
373
  className?: string;
374
+ /** Inline styles */
375
+ style?: CSSProperties;
312
376
  /**
313
377
  * Column area role. When specified on all columns, determines width template
314
378
  * based on role rather than position.
@@ -379,6 +443,31 @@ declare type CommonProps = {
379
443
  guards?: Guard[];
380
444
  };
381
445
 
446
+ /** The main dialog panel that contains the dialog content. Automatically includes a close button and overlay. */
447
+ declare function Content({ className, children, ...props }: React_2.ComponentProps<typeof Dialog_2.Popup>): JSX.Element;
448
+
449
+ declare namespace Content {
450
+ var displayName: string;
451
+ }
452
+
453
+ /** The main sheet panel. The `side` is inherited from `Sheet.Root` via context. */
454
+ declare function Content_2({ className, children, ...props }: React_2.ComponentProps<typeof Drawer.Popup>): JSX.Element;
455
+
456
+ declare namespace Content_2 {
457
+ var displayName: string;
458
+ }
459
+
460
+ /** The tooltip popup that displays additional information. */
461
+ declare function Content_3({ className, sideOffset, side, align, children, ...restProps }: React_2.ComponentProps<typeof Tooltip_2.Popup> & {
462
+ sideOffset?: number;
463
+ side?: "top" | "right" | "bottom" | "left";
464
+ align?: "start" | "center" | "end";
465
+ }): JSX.Element;
466
+
467
+ declare namespace Content_3 {
468
+ var displayName: string;
469
+ }
470
+
382
471
  /**
383
472
  * Context data type inferred from AppShellRegister.
384
473
  * Falls back to Record<string, unknown> if not augmented.
@@ -709,6 +798,20 @@ declare type DefineResourceProps = CommonProps & ErrorBoundaryProps & {
709
798
  subResources?: Array<Resource>;
710
799
  };
711
800
 
801
+ /** A description that provides additional context for the dialog. */
802
+ declare function Description({ className, ...props }: React_2.ComponentProps<typeof Dialog_2.Description>): JSX.Element;
803
+
804
+ declare namespace Description {
805
+ var displayName: string;
806
+ }
807
+
808
+ /** A description that provides additional context for the sheet. */
809
+ declare function Description_2({ className, ...props }: React_2.ComponentProps<typeof Drawer.Description>): JSX.Element;
810
+
811
+ declare namespace Description_2 {
812
+ var displayName: string;
813
+ }
814
+
712
815
  /**
713
816
  * DescriptionCard - ERP document display component
714
817
  *
@@ -729,7 +832,7 @@ declare type DefineResourceProps = CommonProps & ErrorBoundaryProps & {
729
832
  * />
730
833
  * ```
731
834
  */
732
- export declare function DescriptionCard({ data, title, fields, columns, className, headerAction, }: DescriptionCardProps): JSX.Element;
835
+ export declare function DescriptionCard({ data, title, fields, columns, className, style, headerAction, }: DescriptionCardProps): JSX.Element;
733
836
 
734
837
  /**
735
838
  * Props for the DescriptionCard component
@@ -745,10 +848,27 @@ export declare interface DescriptionCardProps {
745
848
  columns?: Columns;
746
849
  /** Additional CSS classes */
747
850
  className?: string;
851
+ /** Inline styles */
852
+ style?: CSSProperties;
748
853
  /** Header action slot (e.g., edit button) */
749
- headerAction?: React.ReactNode;
854
+ headerAction?: ReactNode;
750
855
  }
751
856
 
857
+ export declare const Dialog: {
858
+ Root: typeof Root_2;
859
+ Close: typeof Close;
860
+ Content: typeof Content;
861
+ Description: typeof Description;
862
+ Footer: typeof Footer_2;
863
+ Header: typeof Header_3;
864
+ Title: typeof Title;
865
+ Trigger: typeof Trigger;
866
+ };
867
+
868
+ declare type DialogRootProps = Pick<React_2.ComponentProps<typeof Dialog_2.Root>, "open" | "defaultOpen" | "onOpenChange" | "modal"> & {
869
+ children: React_2.ReactNode;
870
+ };
871
+
752
872
  declare type DynamicLocales<Def extends Record<string, LabelValue>> = {
753
873
  [locale: string]: Partial<LabelDefinition<Def>> | undefined;
754
874
  };
@@ -894,6 +1014,27 @@ declare interface FieldMeta {
894
1014
  */
895
1015
  declare type FieldType = "text" | "badge" | "money" | "date" | "link" | "address" | "reference";
896
1016
 
1017
+ /** The table footer section (`<tfoot>`). */
1018
+ declare function Footer({ className, ...props }: React_2.ComponentProps<"tfoot">): JSX.Element;
1019
+
1020
+ declare namespace Footer {
1021
+ var displayName: string;
1022
+ }
1023
+
1024
+ /** A layout wrapper for dialog action buttons, typically placed at the bottom. */
1025
+ declare function Footer_2({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
1026
+
1027
+ declare namespace Footer_2 {
1028
+ var displayName: string;
1029
+ }
1030
+
1031
+ /** A layout wrapper for sheet action buttons, typically placed at the bottom. */
1032
+ declare function Footer_3({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
1033
+
1034
+ declare namespace Footer_3 {
1035
+ var displayName: string;
1036
+ }
1037
+
897
1038
  /**
898
1039
  * Guard function type.
899
1040
  * Guards are executed in order and stop on the first non-pass result.
@@ -926,6 +1067,13 @@ export declare type GuardResult =
926
1067
  to: string;
927
1068
  };
928
1069
 
1070
+ /** A table header cell (`<th>`). */
1071
+ declare function Head({ className, ...props }: React_2.ComponentProps<"th">): JSX.Element;
1072
+
1073
+ declare namespace Head {
1074
+ var displayName: string;
1075
+ }
1076
+
929
1077
  /**
930
1078
  * Layout.Header — Page-level header with title, actions, and an optional
931
1079
  * full-width slot.
@@ -971,6 +1119,27 @@ declare namespace Header {
971
1119
  var displayName: string;
972
1120
  }
973
1121
 
1122
+ /** The table header section (`<thead>`). */
1123
+ declare function Header_2({ className, ...props }: React_2.ComponentProps<"thead">): JSX.Element;
1124
+
1125
+ declare namespace Header_2 {
1126
+ var displayName: string;
1127
+ }
1128
+
1129
+ /** A layout wrapper for the dialog title and description. */
1130
+ declare function Header_3({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
1131
+
1132
+ declare namespace Header_3 {
1133
+ var displayName: string;
1134
+ }
1135
+
1136
+ /** A layout wrapper for the sheet title and description. */
1137
+ declare function Header_4({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
1138
+
1139
+ declare namespace Header_4 {
1140
+ var displayName: string;
1141
+ }
1142
+
974
1143
  /**
975
1144
  * Deny access and show 404 Not Found.
976
1145
  *
@@ -992,6 +1161,21 @@ export declare type I18nLabels<Def extends Record<string, LabelValue> = Record<s
992
1161
  [K in L]: LabelDefinition<Def>;
993
1162
  } & DynamicLocales<Def>;
994
1163
 
1164
+ /**
1165
+ * A styled input component.
1166
+ *
1167
+ * @example
1168
+ * ```tsx
1169
+ * import { Input } from "@tailor-platform/app-shell";
1170
+ *
1171
+ * <Input type="text" placeholder="Enter your name" />
1172
+ * <Input type="email" disabled />
1173
+ * ```
1174
+ */
1175
+ export declare function Input({ className, type, ...props }: InputProps): JSX.Element;
1176
+
1177
+ export declare type InputProps = React_2.ComponentProps<"input">;
1178
+
995
1179
  /**
996
1180
  * Check if an object type has no keys.
997
1181
  */
@@ -1049,7 +1233,7 @@ declare type LabelValue = string | ((props: any) => string);
1049
1233
  * </Layout>
1050
1234
  * ```
1051
1235
  */
1052
- export declare function Layout({ columns, className, gap, title, actions, children }: LayoutProps): JSX.Element;
1236
+ export declare function Layout({ columns, className, style, gap, title, actions, children }: LayoutProps): JSX.Element;
1053
1237
 
1054
1238
  export declare namespace Layout {
1055
1239
  var Column: React_2.ForwardRefExoticComponent<ColumnProps & React_2.RefAttributes<HTMLDivElement>>;
@@ -1080,6 +1264,8 @@ export declare interface LayoutProps {
1080
1264
  columns?: ColumnCount;
1081
1265
  /** Additional CSS classes */
1082
1266
  className?: string;
1267
+ /** Inline styles */
1268
+ style?: CSSProperties;
1083
1269
  /**
1084
1270
  * Gap between columns (default: 4 = 16px)
1085
1271
  *
@@ -1170,6 +1356,17 @@ export declare type PageMeta = {
1170
1356
  */
1171
1357
  export declare const pass: () => GuardResult;
1172
1358
 
1359
+ /** Provides shared delay configuration for nested tooltips. */
1360
+ declare function Provider({ delay, children, ...props }: ProviderProps): JSX.Element;
1361
+
1362
+ declare namespace Provider {
1363
+ var displayName: string;
1364
+ }
1365
+
1366
+ declare type ProviderProps = Pick<React_2.ComponentProps<typeof Tooltip_2.Provider>, "delay" | "closeDelay" | "timeout"> & {
1367
+ children: React_2.ReactNode;
1368
+ };
1369
+
1173
1370
  /**
1174
1371
  * Redirect to another path.
1175
1372
  *
@@ -1221,6 +1418,106 @@ declare type ResourceMeta = {
1221
1418
  breadcrumbTitle?: string | ((segment: string) => string);
1222
1419
  };
1223
1420
 
1421
+ /**
1422
+ * The root table element with a horizontally scrollable container.
1423
+ *
1424
+ * Note: `className` targets the inner `<table>` element, while `containerClassName` targets the outer scrollable `<div>` wrapper.
1425
+ *
1426
+ * @example
1427
+ * ```tsx
1428
+ * <Table.Root>
1429
+ * <Table.Header>
1430
+ * <Table.Row>
1431
+ * <Table.Head>Name</Table.Head>
1432
+ * <Table.Head>Status</Table.Head>
1433
+ * </Table.Row>
1434
+ * </Table.Header>
1435
+ * <Table.Body>
1436
+ * <Table.Row>
1437
+ * <Table.Cell>Item 1</Table.Cell>
1438
+ * <Table.Cell>Active</Table.Cell>
1439
+ * </Table.Row>
1440
+ * </Table.Body>
1441
+ * </Table.Root>
1442
+ * ```
1443
+ */
1444
+ declare function Root({ className, containerClassName, ...props }: RootProps): JSX.Element;
1445
+
1446
+ declare namespace Root {
1447
+ var displayName: string;
1448
+ }
1449
+
1450
+ /**
1451
+ * The root component that manages dialog open/close state.
1452
+ *
1453
+ * @example
1454
+ * ```tsx
1455
+ * <Dialog.Root>
1456
+ * <Dialog.Trigger render={<Button />}>Open</Dialog.Trigger>
1457
+ * <Dialog.Content>
1458
+ * <Dialog.Header>
1459
+ * <Dialog.Title>Are you sure?</Dialog.Title>
1460
+ * <Dialog.Description>This action cannot be undone.</Dialog.Description>
1461
+ * </Dialog.Header>
1462
+ * <Dialog.Footer>
1463
+ * <Button variant="outline">Cancel</Button>
1464
+ * <Button>Confirm</Button>
1465
+ * </Dialog.Footer>
1466
+ * </Dialog.Content>
1467
+ * </Dialog.Root>
1468
+ * ```
1469
+ */
1470
+ declare function Root_2({ ...props }: DialogRootProps): JSX.Element;
1471
+
1472
+ declare namespace Root_2 {
1473
+ var displayName: string;
1474
+ }
1475
+
1476
+ /**
1477
+ * The root component that manages sheet open/close state.
1478
+ * The `side` prop controls which edge of the screen the sheet slides in from.
1479
+ *
1480
+ * @example
1481
+ * ```tsx
1482
+ * <Sheet.Root side="right">
1483
+ * <Sheet.Trigger render={<Button />}>Open</Sheet.Trigger>
1484
+ * <Sheet.Content>
1485
+ * <Sheet.Header>
1486
+ * <Sheet.Title>Settings</Sheet.Title>
1487
+ * <Sheet.Description>Manage your preferences.</Sheet.Description>
1488
+ * </Sheet.Header>
1489
+ * <Sheet.Footer>
1490
+ * <Button>Save</Button>
1491
+ * </Sheet.Footer>
1492
+ * </Sheet.Content>
1493
+ * </Sheet.Root>
1494
+ * ```
1495
+ */
1496
+ declare function Root_3({ side, ...props }: SheetRootProps): JSX.Element;
1497
+
1498
+ declare namespace Root_3 {
1499
+ var displayName: string;
1500
+ }
1501
+
1502
+ /**
1503
+ * The root component that manages tooltip open/close state.
1504
+ *
1505
+ * @example
1506
+ * ```tsx
1507
+ * <Tooltip.Root>
1508
+ * <Tooltip.Trigger render={<Button variant="outline" />}>
1509
+ * Hover me
1510
+ * </Tooltip.Trigger>
1511
+ * <Tooltip.Content>Helpful information</Tooltip.Content>
1512
+ * </Tooltip.Root>
1513
+ * ```
1514
+ */
1515
+ declare function Root_4({ children, ...props }: TooltipRootProps): JSX.Element;
1516
+
1517
+ declare namespace Root_4 {
1518
+ var displayName: string;
1519
+ }
1520
+
1224
1521
  declare type RootConfiguration = {
1225
1522
  modules: Modules;
1226
1523
  settingsResources: Resource[];
@@ -1229,6 +1526,11 @@ declare type RootConfiguration = {
1229
1526
  locale: string;
1230
1527
  };
1231
1528
 
1529
+ declare type RootProps = React_2.ComponentProps<"table"> & {
1530
+ /** Additional CSS classes for the outer scrollable `<div>` container. Use this to control height, overflow, or container-level layout. */
1531
+ containerClassName?: string;
1532
+ };
1533
+
1232
1534
  /**
1233
1535
  * Route parameters type inferred from AppShellRegister.
1234
1536
  * Falls back to Record<string, Record<string, string>> if not augmented.
@@ -1238,6 +1540,13 @@ export declare type RouteParams = AppShellRegister extends {
1238
1540
  routeParams: infer T;
1239
1541
  } ? T : Record<string, Record<string, string>>;
1240
1542
 
1543
+ /** A table row (`<tr>`). */
1544
+ declare function Row({ className, ...props }: React_2.ComponentProps<"tr">): JSX.Element;
1545
+
1546
+ declare namespace Row {
1547
+ var displayName: string;
1548
+ }
1549
+
1241
1550
  declare type SharedAppShellProps = React.PropsWithChildren<{
1242
1551
  /**
1243
1552
  * App shell title
@@ -1327,6 +1636,24 @@ declare type SharedAppShellProps = React.PropsWithChildren<{
1327
1636
  contextData?: ContextData;
1328
1637
  }>;
1329
1638
 
1639
+ export declare const Sheet: {
1640
+ Root: typeof Root_3;
1641
+ Trigger: typeof Trigger_2;
1642
+ Close: typeof Close_2;
1643
+ Content: typeof Content_2;
1644
+ Header: typeof Header_4;
1645
+ Footer: typeof Footer_3;
1646
+ Title: typeof Title_2;
1647
+ Description: typeof Description_2;
1648
+ };
1649
+
1650
+ declare type SheetRootProps = Pick<React_2.ComponentProps<typeof Drawer.Root>, "open" | "defaultOpen" | "onOpenChange" | "modal"> & {
1651
+ children: React_2.ReactNode;
1652
+ side?: Side;
1653
+ };
1654
+
1655
+ declare type Side = "top" | "right" | "bottom" | "left";
1656
+
1330
1657
  /**
1331
1658
  * A collapsible group for sidebar navigation.
1332
1659
  *
@@ -1507,6 +1834,17 @@ export declare type SidebarLayoutProps = {
1507
1834
  */
1508
1835
  export declare const SidebarSeparator: () => JSX.Element;
1509
1836
 
1837
+ export declare const Table: {
1838
+ Root: typeof Root;
1839
+ Header: typeof Header_2;
1840
+ Body: typeof Body_2;
1841
+ Footer: typeof Footer;
1842
+ Row: typeof Row;
1843
+ Head: typeof Head;
1844
+ Cell: typeof Cell;
1845
+ Caption: typeof Caption;
1846
+ };
1847
+
1510
1848
  declare type Theme = "dark" | "light" | "system";
1511
1849
 
1512
1850
  declare type ThemeProviderState = {
@@ -1515,6 +1853,52 @@ declare type ThemeProviderState = {
1515
1853
  setTheme: (theme: Theme) => void;
1516
1854
  };
1517
1855
 
1856
+ /** The title of the dialog, announced by screen readers. */
1857
+ declare function Title({ className, ...props }: React_2.ComponentProps<typeof Dialog_2.Title>): JSX.Element;
1858
+
1859
+ declare namespace Title {
1860
+ var displayName: string;
1861
+ }
1862
+
1863
+ /** The title of the sheet, announced by screen readers. */
1864
+ declare function Title_2({ className, ...props }: React_2.ComponentProps<typeof Drawer.Title>): JSX.Element;
1865
+
1866
+ declare namespace Title_2 {
1867
+ var displayName: string;
1868
+ }
1869
+
1870
+ export declare const Tooltip: {
1871
+ Root: typeof Root_4;
1872
+ Trigger: typeof Trigger_3;
1873
+ Content: typeof Content_3;
1874
+ Provider: typeof Provider;
1875
+ };
1876
+
1877
+ declare type TooltipRootProps = Pick<React_2.ComponentProps<typeof Tooltip_2.Root>, "open" | "defaultOpen" | "onOpenChange"> & {
1878
+ children: React_2.ReactNode;
1879
+ };
1880
+
1881
+ /** The element that opens the dialog when clicked. */
1882
+ declare function Trigger({ ...props }: React_2.ComponentProps<typeof Dialog_2.Trigger>): JSX.Element;
1883
+
1884
+ declare namespace Trigger {
1885
+ var displayName: string;
1886
+ }
1887
+
1888
+ /** The element that opens the sheet when clicked. */
1889
+ declare function Trigger_2({ ...props }: React_2.ComponentProps<typeof Drawer.Trigger>): JSX.Element;
1890
+
1891
+ declare namespace Trigger_2 {
1892
+ var displayName: string;
1893
+ }
1894
+
1895
+ /** The element that triggers the tooltip on hover or focus. */
1896
+ declare function Trigger_3({ ...props }: React_2.ComponentProps<typeof Tooltip_2.Trigger>): JSX.Element;
1897
+
1898
+ declare namespace Trigger_3 {
1899
+ var displayName: string;
1900
+ }
1901
+
1518
1902
  /**
1519
1903
  * Type-safe path builder interface.
1520
1904
  *