@webority/ui-react 0.150.0 → 0.153.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.
Files changed (49) hide show
  1. package/dist/canvas-kit/kit.js +200 -200
  2. package/dist/canvas-kit/manifest.json +624 -31
  3. package/dist/canvas-kit/release.json +6 -6
  4. package/dist/components/AppAlert.js +1 -1
  5. package/dist/components/AppAsyncBlock.js +1 -1
  6. package/dist/components/AppBreadcrumbs.js +1 -1
  7. package/dist/components/AppButton.js +1 -1
  8. package/dist/components/AppCard.js +1 -1
  9. package/dist/components/AppCarousel.js +1 -1
  10. package/dist/components/AppCompareTable.js +1 -1
  11. package/dist/components/AppDashboardCell.js +1 -1
  12. package/dist/components/AppDropdown.js +1 -1
  13. package/dist/components/AppFileAttachment.js +1 -1
  14. package/dist/components/AppFilePicker.js +1 -1
  15. package/dist/components/AppFilterBar.js +1 -1
  16. package/dist/components/AppForm.js +1 -0
  17. package/dist/components/AppInlineEdit.js +1 -1
  18. package/dist/components/AppInput.js +1 -1
  19. package/dist/components/AppKanban.js +1 -1
  20. package/dist/components/AppLink.js +1 -1
  21. package/dist/components/AppModal.js +1 -1
  22. package/dist/components/AppPopover.js +1 -1
  23. package/dist/components/AppSearch.js +1 -1
  24. package/dist/components/AppSectionLeadCapture.js +1 -1
  25. package/dist/components/AppSelect.js +1 -1
  26. package/dist/components/AppShell.js +1 -1
  27. package/dist/components/AppTextarea.js +1 -1
  28. package/dist/components/AppThemeToggle.js +1 -1
  29. package/dist/components/AppTooltip.js +1 -1
  30. package/dist/components/AppWizard.js +1 -1
  31. package/dist/guidance.json +160 -16
  32. package/dist/lib/useFileDrop.js +1 -1
  33. package/dist/types/components/AppAsyncBlock.d.ts +2 -2
  34. package/dist/types/components/AppBreadcrumbs.d.ts +11 -0
  35. package/dist/types/components/AppButton.d.ts +3 -3
  36. package/dist/types/components/AppCompareTable.d.ts +7 -0
  37. package/dist/types/components/AppDashboardCell.d.ts +9 -5
  38. package/dist/types/components/AppDashboardGrid.d.ts +6 -5
  39. package/dist/types/components/AppDropdown.d.ts +19 -0
  40. package/dist/types/components/AppForm.d.ts +23 -0
  41. package/dist/types/components/AppKanban.d.ts +5 -0
  42. package/dist/types/components/AppLink.d.ts +2 -2
  43. package/dist/types/components/AppSearch.d.ts +1 -1
  44. package/dist/types/components/AppSelect.d.ts +7 -2
  45. package/dist/types/components/AppShell.d.ts +6 -0
  46. package/dist/types/index.d.ts +3 -0
  47. package/dist/ui-react.js +1 -1
  48. package/dist/web-core/dist/api/idempotencyKey.js +1 -0
  49. package/package.json +10 -9
@@ -2,7 +2,7 @@
2
2
  "format": "webority-guidance/1",
3
3
  "package": {
4
4
  "name": "@webority/ui-react",
5
- "version": "0.150.0"
5
+ "version": "0.153.0"
6
6
  },
7
7
  "components": [
8
8
  {
@@ -465,7 +465,7 @@
465
465
  }
466
466
  ],
467
467
  "a11y": [
468
- "Each state is marked with a data-state attribute on the wrapper: loading, error, empty or data.",
468
+ "Each drawn state is marked with a data-state attribute on the wrapper: loading, error, empty or data. Idle draws no wrapper.",
469
469
  "With no skeleton, the loading state is an indeterminate progress bar labelled Loading.",
470
470
  "The error state is an empty state with a Retry button that calls the state's retry.",
471
471
  "The component sets no aria attributes of its own."
@@ -903,7 +903,8 @@
903
903
  ],
904
904
  "a11y": [
905
905
  "The last item is the current page: it is text with aria-current page, never a link, unless the trail sits in a bar page header, where every crumb is a parent link.",
906
- "An item with no target renders as a plain span, so it is never announced as a button with no link."
906
+ "An item with no target renders as a plain span, so it is never announced as a button with no link.",
907
+ "With maxItems, the hidden crumbs sit in an ellipsis menu below md, reachable by keyboard like any dropdown."
907
908
  ]
908
909
  }
909
910
  },
@@ -2160,11 +2161,48 @@
2160
2161
  "note": "One Columns button in the toolbar actions, beside search and export.",
2161
2162
  "example": [
2162
2163
  {
2163
- "component": "AppTableToolbar",
2164
+ "component": "div",
2164
2165
  "props": {
2165
- "actions": {
2166
- "component": "AppColumnMenu",
2166
+ "className": "w-100"
2167
+ },
2168
+ "children": [
2169
+ {
2170
+ "component": "AppTableToolbar",
2167
2171
  "props": {
2172
+ "actions": {
2173
+ "component": "AppColumnMenu",
2174
+ "props": {
2175
+ "columns": [
2176
+ {
2177
+ "key": "name",
2178
+ "label": "Building"
2179
+ },
2180
+ {
2181
+ "key": "owner",
2182
+ "label": "Owner",
2183
+ "hideable": true
2184
+ },
2185
+ {
2186
+ "key": "floors",
2187
+ "label": "Floors",
2188
+ "hideable": true
2189
+ },
2190
+ {
2191
+ "key": "status",
2192
+ "label": "Status"
2193
+ }
2194
+ ],
2195
+ "hiddenColumns": []
2196
+ }
2197
+ }
2198
+ }
2199
+ },
2200
+ {
2201
+ "component": "AppDataTable",
2202
+ "props": {
2203
+ "id": "wui-column-menu-usage",
2204
+ "ariaLabel": "Buildings",
2205
+ "density": "compact",
2168
2206
  "columns": [
2169
2207
  {
2170
2208
  "key": "name",
@@ -2185,10 +2223,32 @@
2185
2223
  "label": "Status"
2186
2224
  }
2187
2225
  ],
2188
- "hiddenColumns": []
2226
+ "rows": [
2227
+ {
2228
+ "id": 1,
2229
+ "name": "Corporate Office",
2230
+ "owner": "Asha Rao",
2231
+ "floors": 12,
2232
+ "status": "Draft"
2233
+ },
2234
+ {
2235
+ "id": 2,
2236
+ "name": "Warehouse Annexe",
2237
+ "owner": "Vikram Shah",
2238
+ "floors": 3,
2239
+ "status": "Compliant"
2240
+ },
2241
+ {
2242
+ "id": 3,
2243
+ "name": "Server Room",
2244
+ "owner": "Asha Rao",
2245
+ "floors": 1,
2246
+ "status": "Draft"
2247
+ }
2248
+ ]
2189
2249
  }
2190
2250
  }
2191
- }
2251
+ ]
2192
2252
  }
2193
2253
  ]
2194
2254
  }
@@ -2291,6 +2351,7 @@
2291
2351
  "usage": {
2292
2352
  "when": [
2293
2353
  "A reader is choosing between two to four options on the same criteria.",
2354
+ "A page shows figures in ruled rows with no frame, such as rates and charges (variant plain).",
2294
2355
  "The rows are authored capabilities, not records from a query.",
2295
2356
  "Seeing the options side by side is what makes the choice obvious."
2296
2357
  ],
@@ -2593,7 +2654,7 @@
2593
2654
  ],
2594
2655
  "whenNot": [
2595
2656
  {
2596
- "text": "A layout that needs other widths than 3, 4, 6, 8 or 12.",
2657
+ "text": "A layout that needs other widths than Quarter, Third, Half, TwoThirds or Full.",
2597
2658
  "instead": "Bootstrap's Row and Col"
2598
2659
  }
2599
2660
  ],
@@ -2618,7 +2679,7 @@
2618
2679
  "instead": "AppFormSection"
2619
2680
  },
2620
2681
  {
2621
- "text": "A layout that needs other widths than 3, 4, 6, 8 or 12.",
2682
+ "text": "A layout that needs other widths than a quarter, a third, a half, two thirds, a fifth or the full row.",
2622
2683
  "instead": "Bootstrap's Row and Col"
2623
2684
  }
2624
2685
  ],
@@ -3085,7 +3146,8 @@
3085
3146
  "when": [
3086
3147
  "A row or card has several secondary actions that would clutter the layout as buttons.",
3087
3148
  "You want a consistent “⋯” affordance for overflow actions across every row.",
3088
- "The actions are related and belong under one grouped trigger."
3149
+ "The actions are related and belong under one grouped trigger.",
3150
+ "A menu lists more than about ten rows and the user knows the name of the one they want."
3089
3151
  ],
3090
3152
  "whenNot": [
3091
3153
  {
@@ -3825,6 +3887,32 @@
3825
3887
  ]
3826
3888
  }
3827
3889
  },
3890
+ {
3891
+ "name": "AppForm",
3892
+ "usage": {
3893
+ "when": [
3894
+ "A form submits to the server and must not send twice: a double click or Enter while a save is in flight is dropped.",
3895
+ "A submit may be retried after a failure and the server must recognise the retry as the same request.",
3896
+ "Child buttons must show a pending state while the form submits: AppButton inside AppForm reads it."
3897
+ ],
3898
+ "whenNot": [
3899
+ {
3900
+ "text": "The form is a dialog or modal",
3901
+ "instead": "AppModal or AppConfirmDialog own the footer logic"
3902
+ },
3903
+ {
3904
+ "text": "The control is a single button with no form around it",
3905
+ "instead": "use AppButton with its own onClick"
3906
+ }
3907
+ ],
3908
+ "do": [],
3909
+ "dont": [],
3910
+ "a11y": [
3911
+ "Renders a plain form element. While a submit is pending it sets aria-busy=\"true\" so assistive technology knows the form is updating.",
3912
+ "Extra attributes such as aria-label and id pass through to the form element."
3913
+ ]
3914
+ }
3915
+ },
3828
3916
  {
3829
3917
  "name": "AppFormActions",
3830
3918
  "usage": {
@@ -5020,7 +5108,8 @@
5020
5108
  "when": [
5021
5109
  "A portal's list of things that happened to the person: approvals, comments, runs finished.",
5022
5110
  "Anything that links to a record.",
5023
- "A row needs its own controls, such as Accept and Decline buttons: pass renderItem(item), which returns the row's content in place of the icon, title, text and time. The dot, the Unread prefix and the read handling stay."
5111
+ "A row needs its own controls, such as Accept and Decline buttons: pass renderItem(item), which returns the row's content in place of the icon, title, text and time. The dot, the Unread prefix and the read handling stay.",
5112
+ "A product brands the unread count: set --wui-notification-count-bg (the fill, default the strong danger colour) and --wui-notification-count-fg (the text, default white) on .wui-notification-center or an ancestor. No prop or class override is needed."
5024
5113
  ],
5025
5114
  "whenNot": [
5026
5115
  {
@@ -7061,16 +7150,14 @@
7061
7150
  "do": [
7062
7151
  {
7063
7152
  "title": "Searchable past ten options",
7064
- "note": "Past ~10 options, searchable turns a long scroll into a quick type-to-find.",
7153
+ "note": "Past ten options the search box shows on its own, so leave searchable unset.",
7065
7154
  "example": [
7066
7155
  {
7067
7156
  "component": "AppSelect",
7068
7157
  "props": {
7069
7158
  "label": "Client",
7070
7159
  "value": "",
7071
- "searchable": true,
7072
7160
  "placeholder": "Select a client…",
7073
- "searchPlaceholder": "Search clients…",
7074
7161
  "options": [
7075
7162
  {
7076
7163
  "value": "rpg",
@@ -7087,6 +7174,34 @@
7087
7174
  {
7088
7175
  "value": "lt",
7089
7176
  "label": "L&T Construction"
7177
+ },
7178
+ {
7179
+ "value": "jsw",
7180
+ "label": "JSW Steel Vijayanagar"
7181
+ },
7182
+ {
7183
+ "value": "ntpc",
7184
+ "label": "NTPC Dadri"
7185
+ },
7186
+ {
7187
+ "value": "bhel",
7188
+ "label": "BHEL Haridwar"
7189
+ },
7190
+ {
7191
+ "value": "ongc",
7192
+ "label": "ONGC Hazira"
7193
+ },
7194
+ {
7195
+ "value": "sail",
7196
+ "label": "SAIL Bokaro"
7197
+ },
7198
+ {
7199
+ "value": "hind",
7200
+ "label": "Hindalco Renukoot"
7201
+ },
7202
+ {
7203
+ "value": "bpcl",
7204
+ "label": "BPCL Kochi"
7090
7205
  }
7091
7206
  ]
7092
7207
  }
@@ -7162,7 +7277,7 @@
7162
7277
  "dont": [
7163
7278
  {
7164
7279
  "title": "Searchable past ten options",
7165
- "note": "A long, unsearchable list forces the user to scroll and scan every time.",
7280
+ "note": "Turning the search box off on a long list forces the user to scroll and scan every time.",
7166
7281
  "example": [
7167
7282
  {
7168
7283
  "component": "AppSelect",
@@ -7170,6 +7285,7 @@
7170
7285
  "label": "Client",
7171
7286
  "value": "",
7172
7287
  "placeholder": "Select a client…",
7288
+ "searchable": false,
7173
7289
  "options": [
7174
7290
  {
7175
7291
  "value": "rpg",
@@ -7186,6 +7302,34 @@
7186
7302
  {
7187
7303
  "value": "lt",
7188
7304
  "label": "L&T Construction"
7305
+ },
7306
+ {
7307
+ "value": "jsw",
7308
+ "label": "JSW Steel Vijayanagar"
7309
+ },
7310
+ {
7311
+ "value": "ntpc",
7312
+ "label": "NTPC Dadri"
7313
+ },
7314
+ {
7315
+ "value": "bhel",
7316
+ "label": "BHEL Haridwar"
7317
+ },
7318
+ {
7319
+ "value": "ongc",
7320
+ "label": "ONGC Hazira"
7321
+ },
7322
+ {
7323
+ "value": "sail",
7324
+ "label": "SAIL Bokaro"
7325
+ },
7326
+ {
7327
+ "value": "hind",
7328
+ "label": "Hindalco Renukoot"
7329
+ },
7330
+ {
7331
+ "value": "bpcl",
7332
+ "label": "BPCL Kochi"
7189
7333
  }
7190
7334
  ]
7191
7335
  }
@@ -1 +1 @@
1
- import{acceptDroppedFiles as e}from"@webority/ui-elements/helpers";import{useRef as t,useState as n}from"react";function r({accept:r,maxSizeMb:i,multiple:a,disabled:o=!1,onFiles:s,onReject:c}){let[l,u]=n(!1),d=t(0);return{dragOver:l,dropProps:{onDragEnter:e=>{e.preventDefault(),o||(d.current+=1,u(!0))},onDragOver:e=>{e.preventDefault(),o||u(!0)},onDragLeave:e=>{e.preventDefault(),o||(d.current=Math.max(0,d.current-1),d.current===0&&u(!1))},onDrop:t=>{if(t.preventDefault(),d.current=0,u(!1),o)return;let{files:n,rejections:l}=e(t.dataTransfer?.files,{accept:r,maxSizeMb:i,multiple:a});n.length&&s(n);let f=l[0];f&&c(f)}}}}export{r as default};
1
+ import{acceptDroppedFiles as e}from"@webority/ui-elements/helpers";import{useRef as t,useState as n}from"react";function r({accept:r,maxSizeMb:i,multiple:a,disabled:o=!1,onFiles:s,onReject:c}){let[l,u]=n(!1),d=t(0);return{dragOver:l,dropProps:{onDragEnter:e=>{e.preventDefault(),o||(d.current+=1,u(!0))},onDragOver:e=>{e.preventDefault(),o||u(!0)},onDragLeave:e=>{e.preventDefault(),o||(d.current=Math.max(0,d.current-1),d.current===0&&u(!1))},onDrop:t=>{if(t.preventDefault(),d.current=0,u(!1),o)return;let{files:n,rejections:l}=e(t.dataTransfer?.files,{...r===void 0?null:{accept:r},...i===void 0?null:{maxSizeMb:i},...a===void 0?null:{multiple:a}});n.length&&s(n);let f=l[0];f&&c(f)}}}}export{r as default};
@@ -1,7 +1,7 @@
1
1
  import type { DataState } from "@webority/web-core/query";
2
2
  import type { ComponentPropsWithoutRef, ReactElement, ReactNode } from "react";
3
3
  export interface AppAsyncBlockProps<T> extends Omit<ComponentPropsWithoutRef<"div">, "children"> {
4
- /** What the screen is showing: one DataState from useDataState, with status loading, error, empty or data. */
4
+ /** What the screen is showing: one DataState from useDataState, with status idle, loading, error, empty or data. Idle is a skipped query and draws nothing. */
5
5
  state: DataState<T>;
6
6
  /** Called only in the "data" state. */
7
7
  children: (data: T) => ReactNode;
@@ -41,4 +41,4 @@ export interface AppAsyncBlockProps<T> extends Omit<ComponentPropsWithoutRef<"di
41
41
  * page model already knows whether it has data by the time it renders, and there is no
42
42
  * client-side loading or error state to switch on.
43
43
  */
44
- export default function AppAsyncBlock<T>(props: AppAsyncBlockProps<T>): ReactElement;
44
+ export default function AppAsyncBlock<T>(props: AppAsyncBlockProps<T>): ReactElement | null;
@@ -16,6 +16,13 @@ export interface AppBreadcrumbsProps extends ComponentPropsWithoutRef<"nav"> {
16
16
  * @default ""
17
17
  */
18
18
  className?: string | undefined;
19
+ /** Below md, show only the last this many crumbs, with an ellipsis menu holding the rest. A whole number of 1 or more. Unset shows the whole trail. */
20
+ maxItems?: number | undefined;
21
+ /**
22
+ * The accessible name of the ellipsis button.
23
+ * @default "Show hidden levels"
24
+ */
25
+ moreLabel?: string | undefined;
19
26
  }
20
27
  /** True inside a bar page header: every crumb is a parent link and none is the current page. */
21
28
  export declare const BreadcrumbTrailContext: Context<boolean>;
@@ -30,9 +37,13 @@ export declare const BreadcrumbTrailContext: Context<boolean>;
30
37
  * (react-router's `Link`) when one is provided, otherwise a plain `<a href>`. The library
31
38
  * never imports a router.
32
39
  *
40
+ * `maxItems` collapses the trail below md to its last items with a menu for the rest.
41
+ *
33
42
  * @param props
34
43
  * @param {AppBreadcrumbsItem[]} props.items
35
44
  * @param {AppLinkComponent} [props.linkComponent] The product's router link, which receives `to`, for `to` items.
36
45
  * @param {string} [props.className]
46
+ * @param {number} [props.maxItems] Below md, show only the last this many crumbs, with an ellipsis menu holding the rest. A whole number of 1 or more.
47
+ * @param {string} [props.moreLabel] The accessible name of the ellipsis button. Default "Show hidden levels".
37
48
  */
38
49
  export default function AppBreadcrumbs(props: AppBreadcrumbsProps): ReactElement;
@@ -1,5 +1,5 @@
1
1
  import type { ComponentPropsWithRef, ElementType, JSX, MouseEventHandler, ReactNode } from "react";
2
- type ButtonSize = "sm" | "md" | "lg";
2
+ type ButtonSize = "sm" | "md" | "lg" | "xl";
3
3
  type IconVariant = "linear" | "outline" | "bold" | "bulk" | "broken" | "twotone";
4
4
  export interface AppButtonProps extends Omit<ComponentPropsWithRef<"button">, "children" | "className" | "onClick" | "onClickCapture" | "type"> {
5
5
  children: ReactNode;
@@ -14,7 +14,7 @@ export interface AppButtonProps extends Omit<ComponentPropsWithRef<"button">, "c
14
14
  */
15
15
  variant?: "solid" | "soft" | "outline" | "ghost" | "link" | "glass" | undefined;
16
16
  /**
17
- * Control size.
17
+ * Control size. xl is a marketing call to action: 55px tall with larger text, and 45px below 992px.
18
18
  * @default "md"
19
19
  */
20
20
  size?: ButtonSize | undefined;
@@ -113,7 +113,7 @@ export interface AppButtonProps extends Omit<ComponentPropsWithRef<"button">, "c
113
113
  * @param [props.iconVariant]
114
114
  * @param [props.className]
115
115
  * @param [props.vibrate] `true` buzzes 10 ms on a tap, a whole number 1 to 100 buzzes that many ms; phones only.
116
- * @param [props.onClick] Runs on a click; ignored on a static button.
116
+ * @param [props.onClick] Runs on a click; ignored on a static button. A promise it returns holds the button in its loading state until it settles.
117
117
  * @param [props.onClickCapture] Runs in the capture phase, before any handler inside; ignored on a static, disabled or loading button.
118
118
  */
119
119
  export default function AppButton(props: AppButtonProps): JSX.Element;
@@ -47,6 +47,11 @@ export interface AppCompareTableProps extends ComponentPropsWithoutRef<"div"> {
47
47
  * @default "comfortable"
48
48
  */
49
49
  density?: "comfortable" | "relaxed" | undefined;
50
+ /**
51
+ * plain draws a figure table: ruled rows with no outer border, rounded corners or shaded first column, and body-size text.
52
+ * @default "boxed"
53
+ */
54
+ variant?: "boxed" | "plain" | undefined;
50
55
  /**
51
56
  * Replaces the built-in English text, for other languages.
52
57
  * @default "Yes"
@@ -85,6 +90,8 @@ export interface AppCompareTableProps extends ComponentPropsWithoutRef<"div"> {
85
90
  * its label as the title and each cell under its column name. `mobile="scroll"` keeps the
86
91
  * table whole and scrolls it sideways in a focusable region named by the caption.
87
92
  *
93
+ * `variant="plain"` draws a figure table: ruled rows, no frame, body-size text.
94
+ *
88
95
  * For tabular DATA (sortable, paginated rows of records) use `AppDataTable`.
89
96
  */
90
97
  export default function AppCompareTable(props: AppCompareTableProps): import("react").JSX.Element;
@@ -1,7 +1,10 @@
1
1
  import type { ReactElement, ReactNode } from "react";
2
+ declare const SPANS: readonly ["Quarter", "Third", "Half", "TwoThirds", "Full", "Fifth"];
3
+ export type DashboardSpan = (typeof SPANS)[number];
2
4
  /**
3
- * One cell of an `AppDashboardGrid`: it spans 3, 4, 6, 8 or 12 of the twelve columns, or "fifth": three to a row
4
- * from 576px and five from 992px; full width under 576px. A card or tile inside fills the cell's height.
5
+ * One cell of an `AppDashboardGrid`: it spans Quarter, Third, Half or TwoThirds of the twelve columns, Full (the
6
+ * default), or Fifth: three to a row from 576px and five from 992px; full width under 576px. A card or tile inside
7
+ * fills the cell's height.
5
8
  *
6
9
  * @param props
7
10
  * @param [props.span]
@@ -10,10 +13,10 @@ import type { ReactElement, ReactNode } from "react";
10
13
  */
11
14
  export interface AppDashboardCellProps {
12
15
  /**
13
- * How many of the twelve columns the cell spans, or fifth for five to a row on wide screens.
14
- * @default 12
16
+ * The share of the row the cell takes, by name: Quarter, Third, Half or TwoThirds of the twelve columns, Full (the default), or Fifth for five to a row on wide screens.
17
+ * @default "Full"
15
18
  */
16
- span?: 3 | 4 | 6 | 8 | 12 | "fifth" | undefined;
19
+ span?: DashboardSpan | undefined;
17
20
  children: ReactNode;
18
21
  /**
19
22
  * Extra classes on the cell.
@@ -22,3 +25,4 @@ export interface AppDashboardCellProps {
22
25
  className?: string | undefined;
23
26
  }
24
27
  export default function AppDashboardCell(props: AppDashboardCellProps): ReactElement;
28
+ export {};
@@ -1,15 +1,16 @@
1
1
  import type { ReactElement, ReactNode } from "react";
2
2
  /**
3
- * The layout of a dashboard: twelve columns of `AppDashboardCell`s that each span 3, 4, 6, 8 or 12 of
4
- * them, and one column under 576px. There is no drag and drop and no saved layout: the page says
5
- * where each card goes. Put KPI tiles at span 3, charts at 6 or 12, and a wide table at 12.
3
+ * The layout of a dashboard: `AppDashboardCell`s that each take a named share of the row (Quarter,
4
+ * Third, Half, TwoThirds, Fifth or Full), and one column under 576px. There is no drag and drop and no
5
+ * saved layout: the page says where each card goes. Put KPI tiles at Quarter, charts at Half or Full,
6
+ * and a wide table at Full.
6
7
  *
7
8
  * The date range of a dashboard belongs in one filter row above the grid, not inside each card.
8
9
  *
9
10
  * ```jsx
10
11
  * <AppDashboardGrid>
11
- * <AppDashboardCell span={3}><AppKpiTile label="Revenue" value="₹38 L" /></AppDashboardCell>
12
- * <AppDashboardCell span={6}><AppChartCard title="Revenue by month">…</AppChartCard></AppDashboardCell>
12
+ * <AppDashboardCell span="Quarter"><AppKpiTile label="Revenue" value="₹38 L" /></AppDashboardCell>
13
+ * <AppDashboardCell span="Half"><AppChartCard title="Revenue by month">…</AppChartCard></AppDashboardCell>
13
14
  * </AppDashboardGrid>
14
15
  * ```
15
16
  *
@@ -3,9 +3,11 @@ import { type AppLinkComponent } from "../lib/linkTarget.ts";
3
3
  export interface AppDropdownItem {
4
4
  key: string;
5
5
  label?: string | undefined;
6
+ description?: string | undefined;
6
7
  icon?: string | React.ReactNode | undefined;
7
8
  image?: string | undefined;
8
9
  to?: string | undefined;
10
+ href?: string | undefined;
9
11
  onClick?: (() => void) | undefined;
10
12
  tone?: "danger" | undefined;
11
13
  disabled?: boolean | undefined;
@@ -56,6 +58,18 @@ export interface AppDropdownProps extends Omit<React.ComponentPropsWithoutRef<"d
56
58
  /** Controlled open state. Leave it out and the menu manages its own; set it and the caller owns it, updating it from onOpenChange. */
57
59
  open?: boolean | undefined;
58
60
  onOpenChange?: ((open: boolean, meta: AppDropdownOpenMeta) => void) | undefined;
61
+ /** Puts a search box above the rows that filters them by label as the user types, for a long menu. It filters items, so it cannot be combined with children. */
62
+ searchable?: boolean | undefined;
63
+ /**
64
+ * Placeholder and accessible name of the search box. Needs searchable.
65
+ * @default "Search"
66
+ */
67
+ searchPlaceholder?: string | undefined;
68
+ /**
69
+ * Text shown when no row matches the search. Needs searchable.
70
+ * @default "No matches."
71
+ */
72
+ noMatchText?: string | undefined;
59
73
  }
60
74
  /**
61
75
  * Icon-triggered menu — react-bootstrap Dropdown.
@@ -75,5 +89,10 @@ export interface AppDropdownProps extends Omit<React.ComponentPropsWithoutRef<"d
75
89
  * `onOpenChange` is called whenever the menu asks to open or close: a toggle click, an outside click, Escape, an item
76
90
  * pick (react-bootstrap's `source`), and the close on a scroll that moves the toggle or a window
77
91
  * resize (`source` "scroll" or "resize"). Fires in both modes.
92
+ *
93
+ * `searchable` puts a search box above the rows and filters them by label as the user types; it
94
+ * takes `items` only, not `children`. `searchPlaceholder` and `noMatchText` set its words and need `searchable`.
95
+ *
96
+ * An item `description` draws a muted second line under the label.
78
97
  */
79
98
  export default function AppDropdown(props: AppDropdownProps): React.JSX.Element;
@@ -0,0 +1,23 @@
1
+ import { type ComponentPropsWithRef, type FormEvent, type JSX, type ReactNode } from "react";
2
+ export interface AppFormSubmitContext {
3
+ /** One key per send; a new one is made only after onSubmit returns true. */
4
+ idempotencyKey: string;
5
+ }
6
+ export interface AppFormProps extends Omit<ComponentPropsWithRef<"form">, "onSubmit" | "className"> {
7
+ /** Runs once per submit; return true when the send succeeded, false to keep the same idempotency key for a retry. A second submit while one is pending is dropped. */
8
+ onSubmit: (event: FormEvent<HTMLFormElement>, context: AppFormSubmitContext) => boolean | Promise<boolean>;
9
+ /**
10
+ * Extra class names added to the form element.
11
+ * @default ""
12
+ */
13
+ className?: string | undefined;
14
+ children?: ReactNode;
15
+ }
16
+ export interface FormSubmitState {
17
+ submitting: boolean;
18
+ idempotencyKey: string;
19
+ }
20
+ /** The enclosing AppForm's state, or null outside one. Internal: AppButton reads it; not exported from the package. */
21
+ export declare const FormSubmitContext: import("react").Context<FormSubmitState | null>;
22
+ export declare function useFormSubmit(): FormSubmitState;
23
+ export default function AppForm(props: AppFormProps): JSX.Element;
@@ -107,6 +107,11 @@ export interface AppKanbanProps<C extends KanbanCard = KanbanCard> {
107
107
  * @default "inline"
108
108
  */
109
109
  headLayout?: KanbanHeadLayout | undefined;
110
+ /**
111
+ * Keeps each stage name on one line, ends a long one in an ellipsis and shows the full name on hover.
112
+ * @default false
113
+ */
114
+ truncateHeads?: boolean | undefined;
110
115
  /**
111
116
  * From md up the board fits the screen and each column's cards scroll inside the column under its fixed head. Phones keep the one-column layout.
112
117
  * @default false
@@ -6,7 +6,7 @@ declare const ICON_SIZE: {
6
6
  lg: number;
7
7
  };
8
8
  type IconSize = keyof typeof ICON_SIZE;
9
- declare const ANIMATIONS: readonly ["underline", "underline-center", "static", "slide", "icon", "highlight", "bracket", "fade", "grow", "glow", "shine", "none"];
9
+ declare const ANIMATIONS: readonly ["underline", "underline-center", "static", "slide", "icon", "rotate", "highlight", "bracket", "fade", "grow", "glow", "shine", "none"];
10
10
  type Animation = (typeof ANIMATIONS)[number];
11
11
  export interface AppLinkProps extends Omit<React.ComponentPropsWithoutRef<"a">, "children" | "href" | "onClick" | "onClickCapture"> {
12
12
  /** Typed for any element, because `linkComponent` decides what renders (an anchor, a button, a router link). */
@@ -20,7 +20,7 @@ export interface AppLinkProps extends Omit<React.ComponentPropsWithoutRef<"a">,
20
20
  /** The destination, or the `to` path when a link component is given. Left out, the anchor has no href. */
21
21
  href?: string | undefined;
22
22
  /**
23
- * The hover treatment: underline slides a line in from the left, underline-center grows it from the middle, static is an always-visible underline with no motion, slide nudges the label and icons right, icon slides a trailing icon in (an arrow when none is given), highlight wipes a tinted background across, bracket slides brackets in around the label, fade shifts colour only, grow opens up the letter spacing, glow adds a soft glow, shine sweeps a light shimmer across the label, and none is a plain coloured link.
23
+ * The hover treatment: underline slides a line in from the left, underline-center grows it from the middle, static is an always-visible underline with no motion, slide nudges the label and icons right, icon slides a trailing icon in (an arrow when none is given), rotate turns the trailing icon a quarter-eighth turn (45 degrees) on hover and focus (an up-right arrow when none is given), highlight wipes a tinted background across, bracket slides brackets in around the label, fade shifts colour only, grow opens up the letter spacing, glow adds a soft glow, shine sweeps a light shimmer across the label, and none is a plain coloured link.
24
24
  * @default "underline"
25
25
  */
26
26
  animation?: Animation | undefined;
@@ -1,5 +1,5 @@
1
1
  import { type ComponentPropsWithoutRef, type JSX, type KeyboardEvent as ReactKeyboardEvent } from "react";
2
- export interface AppSearchProps extends Omit<ComponentPropsWithoutRef<"input">, "value" | "defaultValue" | "onChange" | "onKeyDown" | "size"> {
2
+ export interface AppSearchProps extends Omit<ComponentPropsWithoutRef<"input">, "value" | "defaultValue" | "onChange" | "onKeyDown" | "size" | "type"> {
3
3
  /** The text in the field. */
4
4
  value?: string | undefined;
5
5
  /** The starting value of an uncontrolled field. */
@@ -59,20 +59,25 @@ interface AppSelectBaseProps {
59
59
  validate?: ((value: string) => true | string) | undefined;
60
60
  /** The text in the empty field. Left unset, the element's default for the mode applies: Select… in single, search and multiple, Add… in tag, Select country in country. */
61
61
  placeholder?: string | undefined;
62
- /** The placeholder of the search box in the menu. Left unset, the element's default applies: Search… in every mode except country, which shows Search countries… */
62
+ /** The placeholder of the search box in the menu. Left unset, it is Search and the field's label (Search Client…) in single, multiple and search modes, Search… without a label, and Search countries… in country mode. */
63
63
  searchPlaceholder?: string | undefined;
64
64
  /**
65
65
  * Text shown in the menu when a search matches nothing.
66
66
  * @default "No matches"
67
67
  */
68
68
  emptyText?: string | undefined;
69
- /** Show the search box in the menu. Multiple and country modes are searchable by default; passing false turns it off. Single mode is not searchable by default. */
69
+ /** Show the search box in the menu. Default: on in multiple and country, on in single when there are more than ten options, off otherwise. true or false forces it either way. */
70
70
  searchable?: boolean | undefined;
71
71
  /**
72
72
  * Show a control that clears the chosen value.
73
73
  * @default false
74
74
  */
75
75
  clearable?: boolean | undefined;
76
+ /**
77
+ * Open the list when the mouse rests on the control, and close it when the mouse leaves the control and the list. Mouse only: touch and pen keep tap to open. A select with a search box (search mode, or searchable) and tag mode ignore it. A click on the control right after it opened on hover keeps the list open.
78
+ * @default false
79
+ */
80
+ openOnHover?: boolean | undefined;
76
81
  /** Icon name shown in the control. */
77
82
  icon?: string | undefined;
78
83
  /** Static text inside the control before the value, such as Sort:. Not prefix, which is the bordered affix box. */
@@ -41,6 +41,8 @@ export interface NavItemShape {
41
41
  /** A sub-heading row in a group, drawn with no link. Shown only while a link follows it. */
42
42
  header?: string | undefined;
43
43
  }
44
+ /** A link pinned in the sidebar footer: a flat nav row, with no sub-items, tab bar entry or header. */
45
+ export type NavFooterItemShape = Omit<NavItemShape, "children" | "tab" | "tabLabel" | "header">;
44
46
  /** A group of nav items. A `collapsible` group with a `key` folds from its heading; its folded state is remembered in `foldedCookie`. */
45
47
  export interface NavGroupShape {
46
48
  key?: string | undefined;
@@ -56,6 +58,8 @@ export interface UserMenuShape {
56
58
  role?: string | undefined;
57
59
  /** Portal role display names, shown under the job title as "Role:" or "Roles:". */
58
60
  roles?: string[] | undefined;
61
+ /** Leave the job title off the topbar trigger; the opened menu still shows it. */
62
+ noTriggerRole?: boolean | undefined;
59
63
  /** Profile photo URL. */
60
64
  photo?: string | undefined;
61
65
  profileHref?: string | undefined;
@@ -159,6 +163,8 @@ export interface AppShellProps extends Omit<React.ComponentPropsWithoutRef<"div"
159
163
  sidebarStartCompact?: React.ReactNode | undefined;
160
164
  /** Pinned below the scrolling nav. */
161
165
  sidebarFooter?: React.ReactNode | undefined;
166
+ /** Nav links pinned in the sidebar footer, matched and marked active with the menu links. Flat links only: no children, no tab, no header. */
167
+ sidebarFooterItems?: NavFooterItemShape[] | undefined;
162
168
  /** Leading topbar slot, such as the page title or crumbs. */
163
169
  topbarStart?: React.ReactNode | undefined;
164
170
  /** Trailing topbar slot for page actions. The bell and account menu follow it. */
@@ -35,6 +35,7 @@ export { default as AppConsentBanner } from "./components/AppConsentBanner.tsx";
35
35
  export { default as AppContextMenu } from "./components/AppContextMenu.tsx";
36
36
  export { default as AppCopyButton } from "./components/AppCopyButton.tsx";
37
37
  export { default as AppCountryFlag } from "./components/AppCountryFlag.tsx";
38
+ export type { DashboardSpan } from "./components/AppDashboardCell.tsx";
38
39
  export { default as AppDashboardCell } from "./components/AppDashboardCell.tsx";
39
40
  export { default as AppDashboardGrid } from "./components/AppDashboardGrid.tsx";
40
41
  export { default as AppDataTable } from "./components/AppDataTable.tsx";
@@ -58,6 +59,8 @@ export type { AppFilterBarProps, AppFilterDateRange, AppFilterFacet, AppFilterOp
58
59
  export { default as AppFilterBar } from "./components/AppFilterBar.tsx";
59
60
  export { default as AppFloatingButton } from "./components/AppFloatingButton.tsx";
60
61
  export { default as AppFloatingDock } from "./components/AppFloatingDock.tsx";
62
+ export type { AppFormProps, AppFormSubmitContext, FormSubmitState } from "./components/AppForm.tsx";
63
+ export { default as AppForm, useFormSubmit } from "./components/AppForm.tsx";
61
64
  export { default as AppFormActions } from "./components/AppFormActions.tsx";
62
65
  export { default as AppFormRow } from "./components/AppFormRow.tsx";
63
66
  export { default as AppFormSection } from "./components/AppFormSection.tsx";