@webority/ui-react 0.164.0 → 0.167.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 (167) hide show
  1. package/LICENSE +1 -1
  2. package/dist/canvas-kit/kit.js +225 -223
  3. package/dist/canvas-kit/manifest.json +1334 -435
  4. package/dist/canvas-kit/release.json +6 -6
  5. package/dist/components/AppAsyncBlock.js +1 -1
  6. package/dist/components/AppAvatar.js +1 -1
  7. package/dist/components/AppAvatarGroup.js +1 -1
  8. package/dist/components/AppBanner.js +1 -1
  9. package/dist/components/AppBreadcrumbs.js +1 -1
  10. package/dist/components/AppButton.js +1 -1
  11. package/dist/components/AppCalendar.js +1 -1
  12. package/dist/components/AppCard.js +1 -1
  13. package/dist/components/AppCarousel.js +1 -1
  14. package/dist/components/AppCell.js +1 -1
  15. package/dist/components/AppChart.js +1 -1
  16. package/dist/components/AppChartCard.js +1 -1
  17. package/dist/components/AppCheckbox.js +1 -1
  18. package/dist/components/AppChip.js +1 -1
  19. package/dist/components/AppChipGroup.js +1 -1
  20. package/dist/components/AppChoiceCard.js +1 -1
  21. package/dist/components/AppChoiceChip.js +1 -1
  22. package/dist/components/AppColorField.js +1 -1
  23. package/dist/components/AppColumnMenu.js +1 -1
  24. package/dist/components/AppCommandPalette.js +1 -1
  25. package/dist/components/AppCommentThread.js +1 -1
  26. package/dist/components/AppCompareTable.js +1 -1
  27. package/dist/components/AppConfirmDialog.js +1 -1
  28. package/dist/components/AppConfirmProvider.js +1 -1
  29. package/dist/components/AppContextMenu.js +1 -1
  30. package/dist/components/AppCopyButton.js +1 -1
  31. package/dist/components/AppDataTable.js +1 -1
  32. package/dist/components/AppDatePicker.js +1 -1
  33. package/dist/components/AppDateRangePicker.js +1 -1
  34. package/dist/components/AppDescriptions.js +1 -1
  35. package/dist/components/AppDrawer.js +1 -1
  36. package/dist/components/AppDropZone.js +1 -1
  37. package/dist/components/AppDropdown.js +1 -1
  38. package/dist/components/AppDueDate.js +1 -1
  39. package/dist/components/AppEntryGrid.js +1 -0
  40. package/dist/components/AppErrorBoundary.js +1 -1
  41. package/dist/components/AppErrorSummary.js +1 -1
  42. package/dist/components/AppFileAttachment.js +1 -1
  43. package/dist/components/AppFilePicker.js +1 -1
  44. package/dist/components/AppFilterBar.js +1 -1
  45. package/dist/components/AppFloatingDock.js +1 -1
  46. package/dist/components/AppForm.js +1 -1
  47. package/dist/components/AppFormulaSteps.js +1 -0
  48. package/dist/components/AppHoverCard.js +1 -1
  49. package/dist/components/AppImagePicker.js +1 -1
  50. package/dist/components/AppInfoTip.js +1 -1
  51. package/dist/components/AppInlineEdit.js +1 -1
  52. package/dist/components/AppInput.js +1 -1
  53. package/dist/components/AppInputGroup.js +1 -1
  54. package/dist/components/AppKanban.js +1 -1
  55. package/dist/components/AppMentionInput.js +1 -1
  56. package/dist/components/AppMetricStrip.js +1 -1
  57. package/dist/components/AppModal.js +1 -1
  58. package/dist/components/AppNavigationMenu.js +1 -1
  59. package/dist/components/AppNotificationCenter.js +1 -1
  60. package/dist/components/AppNumberInput.js +1 -1
  61. package/dist/components/AppOnboardingChecklist.js +1 -1
  62. package/dist/components/AppOrgTree.js +1 -1
  63. package/dist/components/AppOtpInput.js +1 -1
  64. package/dist/components/AppPageHeader.js +1 -1
  65. package/dist/components/AppPhoneNumberInput.js +1 -1
  66. package/dist/components/AppPopover.js +1 -1
  67. package/dist/components/AppPricingCard.js +1 -1
  68. package/dist/components/AppQrCode.js +1 -1
  69. package/dist/components/AppRadio.js +1 -1
  70. package/dist/components/AppRadioGroup.js +1 -1
  71. package/dist/components/AppRating.js +1 -1
  72. package/dist/components/AppRecordPager.js +1 -1
  73. package/dist/components/AppRelativeTime.js +1 -1
  74. package/dist/components/AppRepeater.js +1 -1
  75. package/dist/components/AppRichText.js +1 -1
  76. package/dist/components/AppRouteError.js +1 -1
  77. package/dist/components/AppRowActions.js +1 -0
  78. package/dist/components/AppScoreScale.js +1 -1
  79. package/dist/components/AppSearch.js +1 -1
  80. package/dist/components/AppSectionFeatures.js +1 -1
  81. package/dist/components/AppSectionLeadCapture.js +1 -1
  82. package/dist/components/AppSectionLogos.js +1 -1
  83. package/dist/components/AppSegmented.js +1 -1
  84. package/dist/components/AppSelect.js +1 -1
  85. package/dist/components/AppShell.js +1 -1
  86. package/dist/components/AppShortcutLegend.js +1 -1
  87. package/dist/components/AppShowMore.js +1 -1
  88. package/dist/components/AppSlider.js +1 -1
  89. package/dist/components/AppSortableList.js +1 -1
  90. package/dist/components/AppSparkline.js +1 -1
  91. package/dist/components/AppSpinner.js +1 -1
  92. package/dist/components/AppSplash.js +1 -1
  93. package/dist/components/AppSplitButton.js +1 -1
  94. package/dist/components/AppSplitView.js +1 -1
  95. package/dist/components/AppStatusBadge.js +1 -1
  96. package/dist/components/AppStepper.js +1 -1
  97. package/dist/components/AppSwitch.js +1 -1
  98. package/dist/components/AppTablePagination.js +1 -1
  99. package/dist/components/AppTableToolbar.js +1 -1
  100. package/dist/components/AppTabs.js +1 -1
  101. package/dist/components/AppTextarea.js +1 -1
  102. package/dist/components/AppThemeToggle.js +1 -1
  103. package/dist/components/AppTimePicker.js +1 -1
  104. package/dist/components/AppTimeline.js +1 -1
  105. package/dist/components/AppToast.js +1 -1
  106. package/dist/components/AppUpdateBar.js +1 -1
  107. package/dist/components/AppWhatsNew.js +1 -1
  108. package/dist/components/AppWizard.js +1 -1
  109. package/dist/components/AppWorkspaceSwitcher.js +1 -1
  110. package/dist/components/toast.js +1 -1
  111. package/dist/guidance.json +220 -140
  112. package/dist/hookForm/index.js +1 -0
  113. package/dist/lib/CheckField.js +1 -1
  114. package/dist/lib/FileItemRow.js +1 -1
  115. package/dist/lib/emptyValue.js +1 -1
  116. package/dist/lib/fieldState.js +1 -1
  117. package/dist/lib/formFields.js +1 -0
  118. package/dist/lib/useWuiText.js +1 -0
  119. package/dist/types/components/AppAsyncBlock.d.ts +3 -3
  120. package/dist/types/components/AppChart.d.ts +12 -4
  121. package/dist/types/components/AppColorField.d.ts +3 -3
  122. package/dist/types/components/AppDataTable.d.ts +29 -2
  123. package/dist/types/components/AppDatePicker.d.ts +2 -1
  124. package/dist/types/components/AppDateRangePicker.d.ts +5 -1
  125. package/dist/types/components/AppDescriptions.d.ts +6 -0
  126. package/dist/types/components/AppDropdown.d.ts +6 -0
  127. package/dist/types/components/AppEntryGrid.d.ts +164 -0
  128. package/dist/types/components/AppFilterBar.d.ts +12 -1
  129. package/dist/types/components/AppForm.d.ts +18 -0
  130. package/dist/types/components/AppFormulaSteps.d.ts +64 -0
  131. package/dist/types/components/AppInput.d.ts +4 -4
  132. package/dist/types/components/AppInputGroup.d.ts +1 -1
  133. package/dist/types/components/AppMentionInput.d.ts +2 -2
  134. package/dist/types/components/AppMetricStrip.d.ts +5 -0
  135. package/dist/types/components/AppModal.d.ts +5 -0
  136. package/dist/types/components/AppNumberInput.d.ts +9 -3
  137. package/dist/types/components/AppPhoneNumberInput.d.ts +1 -1
  138. package/dist/types/components/AppRowActions.d.ts +46 -0
  139. package/dist/types/components/AppSearch.d.ts +1 -1
  140. package/dist/types/components/AppSectionFeatures.d.ts +5 -1
  141. package/dist/types/components/AppSectionLogos.d.ts +1 -0
  142. package/dist/types/components/AppSelect.d.ts +3 -2
  143. package/dist/types/components/AppShell.d.ts +2 -0
  144. package/dist/types/components/AppSlider.d.ts +5 -0
  145. package/dist/types/components/AppTextarea.d.ts +2 -2
  146. package/dist/types/components/AppTimePicker.d.ts +1 -1
  147. package/dist/types/components/AppToast.d.ts +5 -0
  148. package/dist/types/hookForm/index.d.ts +14 -0
  149. package/dist/types/index.d.ts +8 -5
  150. package/dist/types/lib/emptyValue.d.ts +2 -2
  151. package/dist/types/lib/fieldState.d.ts +1 -0
  152. package/dist/types/lib/formFields.d.ts +12 -0
  153. package/dist/types/lib/useWuiText.d.ts +3 -0
  154. package/dist/ui-react.js +1 -1
  155. package/dist/web-core/dist/errors/extractApiError.js +2 -0
  156. package/dist/web-core/dist/errors/requestPlatform.js +1 -0
  157. package/package.json +21 -10
  158. package/dist/components/AppResizable.js +0 -1
  159. package/dist/components/AppResizableHandle.js +0 -1
  160. package/dist/components/AppResizablePanel.js +0 -1
  161. package/dist/components/AppRollingNumber.js +0 -1
  162. package/dist/components/AppRowSwitch.js +0 -1
  163. package/dist/types/components/AppResizable.d.ts +0 -37
  164. package/dist/types/components/AppResizableHandle.d.ts +0 -14
  165. package/dist/types/components/AppResizablePanel.d.ts +0 -14
  166. package/dist/types/components/AppRollingNumber.d.ts +0 -30
  167. package/dist/types/components/AppRowSwitch.d.ts +0 -18
@@ -1 +1 @@
1
- import e from"./assertValidValue.js";import{dismissAllToasts as t,pushToast as n}from"./toastStore.js";function r(){t()}var i=/* @__PURE__ */ new Set([`success`,`info`,`warning`,`danger`]);function a(t,r=`info`){if(typeof r==`string`)e(`toast`,`variant`,r,i),n(t,r,{});else{if(typeof r!=`object`||!r)throw TypeError(`[@webority/ui-react] toast() received ${String(r)} as its second argument; pass a variant name or an options object.`);e(`toast`,`variant`,r.variant,i),n(t,r.variant??`info`,r)}}function o(e,t={}){n(e,`danger`,t)}a.promise=(e,t,n={})=>{let r=n.id||`promise-${Date.now()}-${Math.random()}`;return a(t.loading||`Loading...`,{...n,variant:`info`,id:r,duration:0}),e.then(e=>(a((typeof t.success==`function`?t.success(e):t.success)||`Done`,{...n,variant:`success`,id:r,duration:n.duration===void 0?5e3:n.duration}),e)).catch(e=>{throw a((typeof t.error==`function`?t.error(e):t.error)||`Error`,{...n,variant:`danger`,id:r,duration:n.duration===void 0?5e3:n.duration}),e})};export{r as dismissAll,o as errorToast,a as toast};
1
+ import e from"./assertValidValue.js";import{dismissAllToasts as t,pushToast as n}from"./toastStore.js";import{TOAST_TEXT as r,readText as i}from"@webority/ui-elements/text";var a=()=>i(`toast`,r);function o(){t()}var s=/* @__PURE__ */ new Set([`success`,`info`,`warning`,`danger`]);function c(t,r=`info`){if(typeof r==`string`)e(`toast`,`variant`,r,s),n(t,r,{});else{if(typeof r!=`object`||!r)throw TypeError(`[@webority/ui-react] toast() received ${String(r)} as its second argument; pass a variant name or an options object.`);e(`toast`,`variant`,r.variant,s),n(t,r.variant??`info`,r)}}function l(e,t={}){n(e,`danger`,t)}c.promise=(e,t,n={})=>{let r=n.id||`promise-${Date.now()}-${Math.random()}`;return c(t.loading||a().loading,{...n,variant:`info`,id:r,duration:0}),e.then(e=>(c((typeof t.success==`function`?t.success(e):t.success)||a().success,{...n,variant:`success`,id:r,duration:n.duration===void 0?5e3:n.duration}),e)).catch(e=>{throw c((typeof t.error==`function`?t.error(e):t.error)||a().error,{...n,variant:`danger`,id:r,duration:n.duration===void 0?5e3:n.duration}),e})};export{o as dismissAll,l as errorToast,c as toast};
@@ -2,7 +2,7 @@
2
2
  "format": "webority-guidance/1",
3
3
  "package": {
4
4
  "name": "@webority/ui-react",
5
- "version": "0.164.0"
5
+ "version": "0.167.0"
6
6
  },
7
7
  "components": [
8
8
  {
@@ -467,7 +467,7 @@
467
467
  "a11y": [
468
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
- "The error state is an empty state with a Retry button that calls the state's retry.",
470
+ "The error state is an empty state with a Try again button that calls the state's retry.",
471
471
  "The component sets no aria attributes of its own."
472
472
  ]
473
473
  }
@@ -2894,7 +2894,7 @@
2894
2894
  ],
2895
2895
  "a11y": [
2896
2896
  "The field label names the control through aria-label when it is a string, and ariaLabel overrides it.",
2897
- "Helper text or error text is linked to the control with aria-describedby, and an error sets aria-invalid.",
2897
+ "Helper text or error text is linked to the control with aria-describedby, and an error sets aria-invalid. A caller's aria-invalid takes its place.",
2898
2898
  "Required and disabled are set as native attributes on the control."
2899
2899
  ]
2900
2900
  }
@@ -3462,6 +3462,123 @@
3462
3462
  ]
3463
3463
  }
3464
3464
  },
3465
+ {
3466
+ "name": "AppEntryGrid",
3467
+ "usage": {
3468
+ "when": [
3469
+ "A person enters or corrects several lines of figures in one table, one line at a time.",
3470
+ "Enter and Ctrl+S commit the line; the page decides whether a commit saves at once or with the grid."
3471
+ ],
3472
+ "whenNot": [
3473
+ {
3474
+ "text": "The table only shows records and nothing is typed into it.",
3475
+ "instead": "AppDataTable"
3476
+ },
3477
+ {
3478
+ "text": "One field on a record is edited in place.",
3479
+ "instead": "AppInlineEdit"
3480
+ }
3481
+ ],
3482
+ "do": [
3483
+ {
3484
+ "title": "Save each line as the person leaves it",
3485
+ "note": "Enter saves the line and moves to the next one, so the person never reaches for a save button per line.",
3486
+ "example": [
3487
+ {
3488
+ "component": "AppEntryGrid",
3489
+ "props": {
3490
+ "columns": [
3491
+ {
3492
+ "key": "item",
3493
+ "label": "Item"
3494
+ },
3495
+ {
3496
+ "key": "units",
3497
+ "label": "Units",
3498
+ "kind": "number"
3499
+ }
3500
+ ],
3501
+ "rows": [
3502
+ {
3503
+ "id": "L1",
3504
+ "item": "Blue pens",
3505
+ "units": 48
3506
+ }
3507
+ ]
3508
+ }
3509
+ }
3510
+ ]
3511
+ }
3512
+ ],
3513
+ "dont": [
3514
+ {
3515
+ "title": "Save each line as the person leaves it",
3516
+ "note": "A read-only table with no save path leaves the person's typing with nowhere to go.",
3517
+ "example": [
3518
+ {
3519
+ "component": "AppDataTable",
3520
+ "props": {
3521
+ "columns": [
3522
+ {
3523
+ "key": "item",
3524
+ "label": "Item"
3525
+ },
3526
+ {
3527
+ "key": "units",
3528
+ "label": "Units"
3529
+ }
3530
+ ],
3531
+ "rows": [
3532
+ {
3533
+ "id": "L1",
3534
+ "item": "Blue pens",
3535
+ "units": 48
3536
+ }
3537
+ ]
3538
+ }
3539
+ }
3540
+ ]
3541
+ }
3542
+ ],
3543
+ "a11y": [
3544
+ "The table is named by label, and the active line carries aria-current.",
3545
+ "Each status is a glyph with a visually hidden word, so a saving, saved or failed line is not shown by colour alone.",
3546
+ "A failed line shows its error in an alert region under the line."
3547
+ ],
3548
+ "keyboard": [
3549
+ {
3550
+ "key": "Enter",
3551
+ "does": "Saves the line; the page moves to the next line once the save succeeds.",
3552
+ "notes": "Does nothing inside a text area, a button, or an open menu."
3553
+ },
3554
+ {
3555
+ "key": "Ctrl+S",
3556
+ "does": "Saves the line and keeps the focus on it.",
3557
+ "notes": "Meta+S does the same on a Mac."
3558
+ },
3559
+ {
3560
+ "key": "Escape",
3561
+ "does": "Discards the changes on the line and restores its last saved values.",
3562
+ "notes": "Does nothing inside an open menu."
3563
+ },
3564
+ {
3565
+ "key": "Ctrl+ArrowUp and Ctrl+ArrowDown",
3566
+ "does": "Moves the active line up or down.",
3567
+ "notes": "Does nothing at the first or last line."
3568
+ },
3569
+ {
3570
+ "key": "Ctrl+Delete",
3571
+ "does": "Removes the line; the page deletes it.",
3572
+ "notes": "Only with onRemoveRow; Meta+Backspace does the same on a Mac."
3573
+ },
3574
+ {
3575
+ "key": "Tab and Shift+Tab",
3576
+ "does": "Move between the fields of a line in page order.",
3577
+ "notes": "Never intercepted, so the person can always tab out of the grid."
3578
+ }
3579
+ ]
3580
+ }
3581
+ },
3465
3582
  {
3466
3583
  "name": "AppErrorBoundary",
3467
3584
  "usage": {
@@ -4007,6 +4124,94 @@
4007
4124
  ]
4008
4125
  }
4009
4126
  },
4127
+ {
4128
+ "name": "AppFormulaSteps",
4129
+ "usage": {
4130
+ "when": [
4131
+ "Show how a figure on the page is reached, line by line, with the real numbers.",
4132
+ "The server computes the figure and the page only shows it: the lines display that result, and the page does no arithmetic of its own."
4133
+ ],
4134
+ "whenNot": [
4135
+ {
4136
+ "text": "The figures are many rows the user scans, sorts or edits.",
4137
+ "instead": "AppDataTable"
4138
+ },
4139
+ {
4140
+ "text": "The figures are a trend or a comparison shown as a picture.",
4141
+ "instead": "AppChart"
4142
+ },
4143
+ {
4144
+ "text": "The figure is a single value with no working to show.",
4145
+ "instead": "a plain value in the page text"
4146
+ }
4147
+ ],
4148
+ "do": [
4149
+ {
4150
+ "title": "End with the result line",
4151
+ "note": "Give each line the amount it stands for, and end with one equal line for the result.",
4152
+ "example": [
4153
+ {
4154
+ "component": "AppFormulaSteps",
4155
+ "props": {
4156
+ "label": "TDS on a bill",
4157
+ "steps": [
4158
+ {
4159
+ "key": "a",
4160
+ "label": "Bill amount",
4161
+ "result": "₹10,00,000.00"
4162
+ },
4163
+ {
4164
+ "key": "b",
4165
+ "sign": "minus",
4166
+ "label": "TDS",
4167
+ "result": "₹1,000.00"
4168
+ },
4169
+ {
4170
+ "key": "c",
4171
+ "sign": "equal",
4172
+ "label": "Net payable",
4173
+ "result": "₹9,99,000.00"
4174
+ }
4175
+ ]
4176
+ }
4177
+ }
4178
+ ]
4179
+ }
4180
+ ],
4181
+ "dont": [
4182
+ {
4183
+ "title": "End with the result line",
4184
+ "note": "A list of amounts with no equal line leaves the reader to add them up and find the total.",
4185
+ "example": [
4186
+ {
4187
+ "component": "AppFormulaSteps",
4188
+ "props": {
4189
+ "label": "TDS on a bill",
4190
+ "steps": [
4191
+ {
4192
+ "key": "a",
4193
+ "label": "Bill amount",
4194
+ "result": "₹10,00,000.00"
4195
+ },
4196
+ {
4197
+ "key": "b",
4198
+ "sign": "minus",
4199
+ "label": "TDS",
4200
+ "result": "₹1,000.00"
4201
+ }
4202
+ ]
4203
+ }
4204
+ }
4205
+ ]
4206
+ }
4207
+ ],
4208
+ "a11y": [
4209
+ "The lines are an ordered list with an accessible name, so a screen reader announces the count and reads each line in order.",
4210
+ "A screen reader reads each operator as its word, such as minus or times, taken from the sign-word props.",
4211
+ "Each operator glyph is hidden from assistive tech, so the symbol itself is never read out."
4212
+ ]
4213
+ }
4214
+ },
4010
4215
  {
4011
4216
  "name": "AppHoverCard",
4012
4217
  "usage": {
@@ -5156,7 +5361,7 @@
5156
5361
  "dont": [],
5157
5362
  "a11y": [
5158
5363
  "The steppers are labelled Decrease and Increase and stay out of the tab order; keyboard users step with ArrowUp and ArrowDown on the input.",
5159
- "ArrowUp and ArrowDown step the value by step, within min and max.",
5364
+ "ArrowUp and ArrowDown step the value by step, within min and max; with Ctrl, Meta or Alt held they are left to the page.",
5160
5365
  "aria-invalid is set from error, and aria-describedby points at the error or the helper text."
5161
5366
  ]
5162
5367
  }
@@ -6330,70 +6535,6 @@
6330
6535
  ]
6331
6536
  }
6332
6537
  },
6333
- {
6334
- "name": "AppResizable",
6335
- "usage": {
6336
- "when": [
6337
- "A reading pane, editor or preview whose ideal size depends on the person and the task.",
6338
- "Layouts a person returns to: add a storageKey."
6339
- ],
6340
- "whenNot": [
6341
- {
6342
- "text": "A fixed list beside an open item that stacks on phones.",
6343
- "instead": "AppSplitView"
6344
- },
6345
- {
6346
- "text": "Collapsing a region rather than sizing it.",
6347
- "instead": "AppAccordion"
6348
- }
6349
- ],
6350
- "do": [],
6351
- "dont": [],
6352
- "a11y": [
6353
- "Each handle is a keyboard-focusable separator named by its label.",
6354
- "Arrow keys along the axis move it 5%, with Shift 20%; Home and End take the panel before it to its minimum or maximum; a double click restores the default sizes.",
6355
- "The group writes each handle's current size and limits as aria-valuenow, aria-valuemin and aria-valuemax."
6356
- ]
6357
- }
6358
- },
6359
- {
6360
- "name": "AppResizableHandle",
6361
- "usage": {
6362
- "when": [
6363
- "Between two AppResizablePanels inside an AppResizable, as the divider the person drags."
6364
- ],
6365
- "whenNot": [
6366
- {
6367
- "text": "Outside an AppResizable group: there are no panels for it to resize.",
6368
- "instead": "AppResizable"
6369
- }
6370
- ],
6371
- "do": [],
6372
- "dont": [],
6373
- "a11y": [
6374
- "It is a focusable separator (role separator, one tab stop) named by its label.",
6375
- "Arrow keys, Home and End resize the panel before it against the panel after it, and its current size and limits are announced."
6376
- ]
6377
- }
6378
- },
6379
- {
6380
- "name": "AppResizablePanel",
6381
- "usage": {
6382
- "when": [
6383
- "Inside an AppResizable, one for each region whose size the person can change."
6384
- ],
6385
- "whenNot": [
6386
- {
6387
- "text": "Content that must keep a fixed size beside a resizable region. Place it outside the group."
6388
- }
6389
- ],
6390
- "do": [],
6391
- "dont": [],
6392
- "a11y": [
6393
- "The panel is a plain div with no role or aria attributes; the content inside carries its own semantics."
6394
- ]
6395
- }
6396
- },
6397
6538
  {
6398
6539
  "name": "AppResourceCard",
6399
6540
  "usage": {
@@ -6553,31 +6694,6 @@
6553
6694
  ]
6554
6695
  }
6555
6696
  },
6556
- {
6557
- "name": "AppRollingNumber",
6558
- "usage": {
6559
- "when": [
6560
- "A total or count that changes while the person is looking: a cart, a dashboard tile, a live counter."
6561
- ],
6562
- "whenNot": [
6563
- {
6564
- "text": "A figure that is set once on load, or a table cell in a long list.",
6565
- "instead": "plain text"
6566
- },
6567
- {
6568
- "text": "A KPI with a label, trend and sparkline.",
6569
- "instead": "AppKpiTile"
6570
- }
6571
- ],
6572
- "do": [],
6573
- "dont": [],
6574
- "a11y": [
6575
- "The rolling digits are hidden from assistive technology, and the final value sits next to them as plain text.",
6576
- "A change is not announced on every roll: wrap the figure in your own live region where a change should be announced.",
6577
- "Under reduced motion the figure just changes."
6578
- ]
6579
- }
6580
- },
6581
6697
  {
6582
6698
  "name": "AppRouteError",
6583
6699
  "usage": {
@@ -6642,63 +6758,27 @@
6642
6758
  }
6643
6759
  },
6644
6760
  {
6645
- "name": "AppRowSwitch",
6761
+ "name": "AppRowActions",
6646
6762
  "usage": {
6647
6763
  "when": [
6648
- "A setting on one row of a table that saves on its own, such as portal access or auto-reminders.",
6649
- "Each row has its own state and the change must reach the server before the row shows it."
6764
+ "The actions at the end of a table or list row, one list that shows as icon buttons from sm up and as one menu on a phone."
6650
6765
  ],
6651
6766
  "whenNot": [
6652
6767
  {
6653
- "text": "The switch is a page-level setting with no table row.",
6654
- "instead": "AppSwitch"
6655
- },
6656
- {
6657
- "text": "The row action opens several choices.",
6768
+ "text": "A menu that is not a row's own actions.",
6658
6769
  "instead": "AppDropdown"
6659
6770
  },
6660
6771
  {
6661
- "text": "The user submits several rows of settings together.",
6662
- "instead": "AppCheckbox"
6663
- }
6664
- ],
6665
- "do": [
6666
- {
6667
- "title": "Wait for the save before flipping",
6668
- "note": "The row keeps its saved state. The switch shows the next state only after the save resolves.",
6669
- "example": [
6670
- {
6671
- "component": "AppRowSwitch",
6672
- "props": {
6673
- "label": "Portal access",
6674
- "checked": true
6675
- },
6676
- "handlers": [
6677
- "onToggle"
6678
- ]
6679
- }
6680
- ]
6681
- }
6682
- ],
6683
- "dont": [
6684
- {
6685
- "title": "Wait for the save before flipping",
6686
- "note": "A page-level switch in a row has no busy state, so a second flip can race the first save.",
6687
- "example": [
6688
- {
6689
- "component": "AppSwitch",
6690
- "props": {
6691
- "label": "Portal access",
6692
- "defaultChecked": true
6693
- }
6694
- }
6695
- ]
6772
+ "text": "Bulk actions on the selected rows.",
6773
+ "instead": "AppTableToolbar"
6696
6774
  }
6697
6775
  ],
6776
+ "do": [],
6777
+ "dont": [],
6698
6778
  "a11y": [
6699
- "The control is a button with role switch and aria-checked, so a screen reader reads its state.",
6700
- "label is the accessible name, read out with the state.",
6701
- "While a save is pending the switch is busy and disabled, so a second flip cannot race the first."
6779
+ "Each icon button is named by its label and shows it as a tooltip; a disabled one names its disabledReason too.",
6780
+ "The menu trigger is named by menuLabel; Enter or Space opens the menu, arrows move through its rows, and Escape closes it and returns focus to the trigger.",
6781
+ "Below sm only the menu is shown, so every action is reachable by a touch target and by the keyboard."
6702
6782
  ]
6703
6783
  }
6704
6784
  },
@@ -7403,7 +7483,7 @@
7403
7483
  ],
7404
7484
  "a11y": [
7405
7485
  "The visible label is the control's accessible name; a select with no visible label takes aria-label or aria-labelledby from the caller.",
7406
- "An error sets aria-invalid on the control and is linked by aria-describedby, as is the helper text when there is no error.",
7486
+ "An error sets aria-invalid on the control and is linked by aria-describedby, as is the helper text when there is no error. A caller's aria-invalid takes its place.",
7407
7487
  "required and disabled are passed to the control, and required also draws a required mark in the label."
7408
7488
  ]
7409
7489
  }
@@ -0,0 +1 @@
1
+ import{extractApiError as e}from"../web-core/dist/errors/extractApiError.js";import{useState as t}from"react";var n=e=>e.length>0,r=(e,t,n)=>{if(typeof e==`object`&&e){if(`type`in e&&typeof e.type==`string`)n[t]=`message`in e&&typeof e.message==`string`?e.message:``;else for(let[i,a]of Object.entries(e))r(a,t===``?i:`${t}.${i}`,n)}};function i(i,a){let[o,s]=t([]),c={};return r(i.formState.errors,``,c),{onSubmit:async(t,r)=>{s([]);let o=!1;return await i.handleSubmit(async t=>{try{await a.onSubmit(t,r)}catch(t){let r=e(t);if(r.offline){s([r.message]);return}if(r.status>0){let e=Object.entries(r.fieldErrors);e.length===0&&s([r.message]);for(let[t,r]of e)n(t)&&i.setError(t,{type:`server`,message:r});return}throw t}i.reset(i.getValues()),o=!0})(t),o},fieldErrors:c,formErrors:o,noValidate:!0}}export{i as useHookForm};
@@ -1 +1 @@
1
- import e from"./FieldMessage.js";import{FIELD_BUSY_CLASS as t}from"./fieldState.js";import{forwardRef as n,useId as r}from"react";import{jsx as i,jsxs as a}from"react/jsx-runtime";var o=()=>{},s=n(function({label:n,id:s,name:c,error:l,hint:u,className:d=``,rest:f={},inputType:p,wrapperClass:m,rootProps:h,readOnly:g=!1,loading:_=!1,size:v=`md`,controlOnly:y=!1},b){let x=r(),S=s||x,C=l?`${S}-error`:void 0,w=u?`${S}-hint`:void 0,T=v===`sm`?` form-check-sm`:v===`lg`?` form-check-lg`:``,{onClick:E,...D}=f;(g||_)&&D.checked!==void 0&&D.onChange===void 0&&(D.onChange=o);let O=_?`form-check-input ${t}`:`form-check-input`,k=y&&d?`${O} ${d}`:O,A=/* @__PURE__ */ i(`input`,{...y?h:void 0,type:p,className:k,id:S,name:c,ref:b,"aria-invalid":l?`true`:`false`,"aria-describedby":C||w,"aria-readonly":g||void 0,"aria-busy":_||void 0,onClick:e=>{g||_?e.preventDefault():E?.(e)},...D});return y?A:/* @__PURE__ */ a(`div`,{className:`${m}${T}${d?` ${d}`:``}`,...h,children:[A,n!=null&&/* @__PURE__ */ i(`label`,{className:`form-check-label`,htmlFor:S,children:n}),/* @__PURE__ */ i(e,{error:l,hint:u,errorId:C,hintId:w})]})});export{s as default};
1
+ import e from"./FieldMessage.js";import{FIELD_BUSY_CLASS as t}from"./fieldState.js";import{useFieldError as n}from"./formFields.js";import{forwardRef as r,useId as i}from"react";import{jsx as a,jsxs as o}from"react/jsx-runtime";var s=()=>{},c=r(function({label:r,id:c,name:l,error:u,hint:d,className:f=``,rest:p={},inputType:m,wrapperClass:h,rootProps:g,readOnly:_=!1,loading:v=!1,size:y=`md`,controlOnly:b=!1},x){let S=n(l),C=b?u:u??S,w=i(),T=c||w,E=C?`${T}-error`:void 0,D=d?`${T}-hint`:void 0,O=y===`sm`?` form-check-sm`:y===`lg`?` form-check-lg`:``,{onClick:k,...A}=p;(_||v)&&A.checked!==void 0&&A.onChange===void 0&&(A.onChange=s);let j=v?`form-check-input ${t}`:`form-check-input`,M=b&&f?`${j} ${f}`:j,N=/* @__PURE__ */ a(`input`,{...b?g:void 0,type:m,className:M,id:T,name:l,ref:x,"aria-invalid":C?`true`:`false`,"aria-describedby":E||D,"aria-readonly":_||void 0,"aria-busy":v||void 0,onClick:e=>{_||v?e.preventDefault():k?.(e)},...A});return b?N:/* @__PURE__ */ o(`div`,{className:`${h}${O}${f?` ${f}`:``}`,...g,children:[N,r!=null&&/* @__PURE__ */ a(`label`,{className:`form-check-label`,htmlFor:T,children:r}),/* @__PURE__ */ a(e,{error:C,hint:d,errorId:E,hintId:D})]})});export{c as default};
@@ -1 +1 @@
1
- import e from"../components/AppIcon.js";import t from"../components/AppProgress.js";import{linkOf as n,nameOf as r,sizeLabelOf as i,uploadErrorOf as a,uploadProgressOf as o,useItemUrl as s}from"./fileItem.js";import c from"./fillLabel.js";import{linkTarget as l}from"./linkTarget.js";import{TargetLink as u}from"./TargetLink.js";import{jsx as d,jsxs as f}from"react/jsx-runtime";function p({item:p,isImage:m,onRemove:h,linkComponent:g,noun:_=`attachment`,removeFileLabel:v=`Remove {name}`,readOnly:y=!1}){let b=s(p,m),x=r(p),S=i(p),C=o(p),w=a(p),T=n(p),E=p instanceof File?void 0:p?.to,D=l(g,{to:E,href:T??void 0,routeHref:!1});return/* @__PURE__ */ f(`div`,{className:w?`attach-item wui-attach-failed`:`attach-item`,children:[/* @__PURE__ */ d(`span`,{className:`attach-item-media`,children:b?/* @__PURE__ */ d(`img`,{src:b,alt:x}):/* @__PURE__ */ d(e,{name:`file-text`,size:18})}),/* @__PURE__ */ f(`span`,{className:`attach-item-info`,children:[/* @__PURE__ */ d(`span`,{className:`attach-name`,children:T||E?/* @__PURE__ */ d(u,{link:D,children:x}):x}),S&&/* @__PURE__ */ d(`span`,{className:`attach-size`,children:S}),C!==null&&/* @__PURE__ */ d(t,{value:C,size:`sm`,label:`Uploading ${x}`,className:`wui-attach-progress`}),w&&/* @__PURE__ */ d(`div`,{className:`wui-attach-error`,children:w})]}),!y&&/* @__PURE__ */ d(`button`,{type:`button`,className:`attach-item-remove`,"aria-label":c(v,{name:x||_}),onClick:h,children:/* @__PURE__ */ d(e,{name:`x`,size:16})})]})}export{p as default};
1
+ import e from"../components/AppIcon.js";import t from"../components/AppProgress.js";import{linkOf as n,nameOf as r,sizeLabelOf as i,uploadErrorOf as a,uploadProgressOf as o,useItemUrl as s}from"./fileItem.js";import{linkTarget as c}from"./linkTarget.js";import{TargetLink as l}from"./TargetLink.js";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{fillText as f}from"@webority/ui-elements/text";function p({item:p,isImage:m,onRemove:h,linkComponent:g,noun:_=`attachment`,removeFileLabel:v=`Remove {name}`,readOnly:y=!1}){let b=s(p,m),x=r(p),S=i(p),C=o(p),w=a(p),T=n(p),E=p instanceof File?void 0:p?.to,D=c(g,{to:E,href:T??void 0,routeHref:!1});return/* @__PURE__ */ d(`div`,{className:w?`attach-item wui-attach-failed`:`attach-item`,children:[/* @__PURE__ */ u(`span`,{className:`attach-item-media`,children:b?/* @__PURE__ */ u(`img`,{src:b,alt:x}):/* @__PURE__ */ u(e,{name:`file-text`,size:18})}),/* @__PURE__ */ d(`span`,{className:`attach-item-info`,children:[/* @__PURE__ */ u(`span`,{className:`attach-name`,children:T||E?/* @__PURE__ */ u(l,{link:D,children:x}):x}),S&&/* @__PURE__ */ u(`span`,{className:`attach-size`,children:S}),C!==null&&/* @__PURE__ */ u(t,{value:C,size:`sm`,label:`Uploading ${x}`,className:`wui-attach-progress`}),w&&/* @__PURE__ */ u(`div`,{className:`wui-attach-error`,children:w})]}),!y&&/* @__PURE__ */ u(`button`,{type:`button`,className:`attach-item-remove`,"aria-label":f(v,{name:x||_}),onClick:h,children:/* @__PURE__ */ u(e,{name:`x`,size:16})})]})}export{p as default};
@@ -1 +1 @@
1
- function e(e){return e==null||e===``}export{e as isEmpty};
1
+ import{emptyValueLabel as e}from"@webority/ui-elements/helpers";var t=()=>e();function n(e){return e==null||e===``}export{t as emptyPlaceholder,n as isEmpty};
@@ -1 +1 @@
1
- var e=[`sm`,`md`,`lg`],t=`wui-field-busy`;function n(e){return e?e=>e.preventDefault():void 0}export{t as FIELD_BUSY_CLASS,e as FIELD_SIZES,n as blockWhenReadOnly};
1
+ var e=[`sm`,`md`,`lg`,`xl`],t=[`sm`,`md`,`lg`],n=`wui-field-busy`;function r(e){return e?e=>e.preventDefault():void 0}export{t as BOX_SIZES,n as FIELD_BUSY_CLASS,e as FIELD_SIZES,r as blockWhenReadOnly};
@@ -0,0 +1 @@
1
+ import{createContext as e,useContext as t,useEffect as n}from"react";var r=e(null);function i(e){let i=t(r),o=e?a(e):void 0,s=i?.claim;return n(()=>{if(o!==void 0&&s!==void 0)return s(o)},[s,o]),o!==void 0&&i?i.errorOf(o):void 0}function a(e){return e.replace(/\[(\w+)\]/g,`.$1`).replace(/^\./,``)}export{r as FormFieldsContext,a as toFieldName,i as useFieldError};
@@ -0,0 +1 @@
1
+ import{useSyncExternalStore as e}from"react";import{readText as t,subscribeText as n}from"@webority/ui-elements/text";function r(r,i){return e(n,()=>t(r,i),()=>t(r,i))}export{r as default};
@@ -21,17 +21,17 @@ export interface AppAsyncBlockProps<T> extends Omit<ComponentPropsWithoutRef<"di
21
21
  loadingLabel?: string | undefined;
22
22
  /**
23
23
  * Replaces the built-in English text, for other languages.
24
- * @default "Something went wrong"
24
+ * @default "That didn't load"
25
25
  */
26
26
  errorTitle?: string | undefined;
27
27
  /**
28
28
  * Replaces the built-in English text, for other languages.
29
- * @default "Retry"
29
+ * @default "Try again"
30
30
  */
31
31
  retryLabel?: string | undefined;
32
32
  /**
33
33
  * Replaces the built-in English text, for other languages.
34
- * @default "Nothing to show yet"
34
+ * @default "Nothing here yet"
35
35
  */
36
36
  emptyTitle?: string | undefined;
37
37
  }
@@ -1,6 +1,14 @@
1
1
  import type { ComponentPropsWithoutRef, CSSProperties } from "react";
2
2
  export type ChartType = "line" | "area" | "column" | "bar" | "donut" | "heatmap" | "calendar" | "funnel" | "gauge" | "waterfall" | "treemap" | "sankey" | "scatter" | "bubble" | "multiples";
3
3
  export type ChartStack = "none" | "stacked" | "percent";
4
+ /** How a value prints. Every part is optional: a part left out reads as its default. */
5
+ export interface ChartFormat {
6
+ style?: "number" | "currency" | "percent" | "compact" | "duration" | "date" | undefined;
7
+ currency?: string | undefined;
8
+ unit?: "rupees" | "paise" | "ms" | "s" | "min" | "h" | undefined;
9
+ decimals?: number | undefined;
10
+ pattern?: "day" | "month" | "year" | "datetime" | "time" | undefined;
11
+ }
4
12
  export type ChartState = "ready" | "loading" | "empty" | "error";
5
13
  export type ChartRenderer = "auto" | "svg" | "canvas";
6
14
  export type ChartView = "chart" | "table";
@@ -31,7 +39,7 @@ export interface AppChartProps extends Omit<ComponentPropsWithoutRef<"div">, "on
31
39
  x: {
32
40
  key: string;
33
41
  kind?: "category" | "time" | "value" | undefined;
34
- format?: Record<string, unknown> | undefined;
42
+ format?: ChartFormat | undefined;
35
43
  label?: string | undefined;
36
44
  labelFit?: "auto" | "all" | "rotate" | "ellipsis" | undefined;
37
45
  };
@@ -39,7 +47,7 @@ export interface AppChartProps extends Omit<ComponentPropsWithoutRef<"div">, "on
39
47
  series: {
40
48
  key: string;
41
49
  label: string;
42
- format?: Record<string, unknown> | undefined;
50
+ format?: ChartFormat | undefined;
43
51
  }[];
44
52
  /** The second dimension: a heatmap's rows, a treemap's parents, a scatter or bubble's colour groups (at most 3). Required for a heatmap and a treemap. */
45
53
  group?: {
@@ -55,7 +63,7 @@ export interface AppChartProps extends Omit<ComponentPropsWithoutRef<"div">, "on
55
63
  size?: {
56
64
  key: string;
57
65
  label?: string | undefined;
58
- format?: Record<string, unknown> | undefined;
66
+ format?: ChartFormat | undefined;
59
67
  } | undefined;
60
68
  /** A scatter or bubble's straight trend line through the visible points. */
61
69
  trend?: boolean | undefined;
@@ -74,7 +82,7 @@ export interface AppChartProps extends Omit<ComponentPropsWithoutRef<"div">, "on
74
82
  /** The one value axis. There is no second axis: show another measure as its own chart. */
75
83
  y?: {
76
84
  label?: string | undefined;
77
- format?: Record<string, unknown> | undefined;
85
+ format?: ChartFormat | undefined;
78
86
  min?: number | undefined;
79
87
  max?: number | undefined;
80
88
  wholeNumbers?: boolean | undefined;
@@ -63,10 +63,10 @@ export interface AppColorFieldProps extends Omit<React.ComponentPropsWithoutRef<
63
63
  */
64
64
  loading?: boolean | undefined;
65
65
  /**
66
- * Control size. sm and lg resize the swatch and the hex box together.
66
+ * Control size. sm, lg and xl resize the swatch and the hex box together.
67
67
  * @default "md"
68
68
  */
69
- size?: "sm" | "md" | "lg" | undefined;
69
+ size?: "sm" | "md" | "lg" | "xl" | undefined;
70
70
  /**
71
71
  * Applied to the hex text input, the control.
72
72
  * @default ""
@@ -101,7 +101,7 @@ export interface AppColorFieldProps extends Omit<React.ComponentPropsWithoutRef<
101
101
  * @param [props.help]
102
102
  * @param [props.helpLabel]
103
103
  * @param [props.colourLabel] Default "Colour".
104
- * @param [props.colourPickerLabel] Default "{label}, colour picker". The {label} token is the field label.
104
+ * @param [props.colourPickerLabel] Default "{label}, colour picker". The {label} token is the field label when it is text, otherwise the colour word; pass this prop to name the picker when the label is markup.
105
105
  * @param [props.optionalLabel] Default "(optional)".
106
106
  * @param [props.name]
107
107
  * @param [props.id]
@@ -1,4 +1,6 @@
1
1
  import { type ComponentPropsWithoutRef, type CSSProperties, type JSX, type ReactNode } from "react";
2
+ import type { AppLinkComponent } from "../lib/linkTarget.ts";
3
+ import { type AppRowActionEntry } from "./AppRowActions.tsx";
2
4
  /** A row's identity as `rowKey` returns it. */
3
5
  export type AppDataTableKey = string | number;
4
6
  export type AppDataTableAlign = "end" | "num" | "center";
@@ -27,6 +29,8 @@ export interface AppDataTablePagination {
27
29
  export interface AppDataTableColumn<Row> {
28
30
  key: string;
29
31
  label: ReactNode;
32
+ /** Help shown in an AppInfoTip beside the header label. */
33
+ help?: ReactNode | undefined;
30
34
  sortable?: boolean | undefined;
31
35
  align?: AppDataTableAlign | undefined;
32
36
  width?: string | number | undefined;
@@ -58,6 +62,11 @@ export interface AppDataTableProps<Row> extends Omit<ComponentPropsWithoutRef<"d
58
62
  * @default false
59
63
  */
60
64
  loading?: boolean | undefined;
65
+ /**
66
+ * Keeps the current rows on screen, dimmed and marked busy, while new rows load. Has no effect with no rows; loading shows skeleton rows instead.
67
+ * @default false
68
+ */
69
+ refreshing?: boolean | undefined;
61
70
  /**
62
71
  * How many skeleton rows to draw while loading.
63
72
  * @default 5
@@ -72,7 +81,10 @@ export interface AppDataTableProps<Row> extends Omit<ComponentPropsWithoutRef<"d
72
81
  emptyFiltered?: ReactNode | undefined;
73
82
  /** The number of rows before filtering. 0 means the source is empty and empty shows; unset means the table was filtered. */
74
83
  sourceCount?: number | undefined;
75
- rowActions?: ((row: Row) => ReactNode) | undefined;
84
+ /** The row's actions as a list: icon buttons from sm up, one "more" menu below it. Leave an action out of the list to hide it for a row. */
85
+ rowActions?: ((row: Row) => readonly AppRowActionEntry[]) | undefined;
86
+ /** The product's router link, for actions that carry `to`. */
87
+ linkComponent?: AppLinkComponent | undefined;
76
88
  /** The heading text of the trailing actions column. */
77
89
  rowActionsLabel?: string | undefined;
78
90
  /** The footer's state, usually straight from usePagination. The footer shows once total is above the smallest page size and stays in place while loading. */
@@ -136,10 +148,20 @@ export interface AppDataTableProps<Row> extends Omit<ComponentPropsWithoutRef<"d
136
148
  */
137
149
  stickyFirstColumn?: boolean | undefined;
138
150
  /**
139
- * Pins the last column, where rowActions render, to the end edge while a wide table scrolls sideways, so a row's actions stay in view in a narrow box.
151
+ * Pins the last column, where the rowActions list renders, to the end edge while a wide table scrolls sideways, so a row's actions stay in view in a narrow box.
140
152
  * @default false
141
153
  */
142
154
  stickyActions?: boolean | undefined;
155
+ /**
156
+ * Gives every labelled button in the row actions column the same width, so the column lines up from row to row. Icon-only actions are not widened.
157
+ * @default false
158
+ */
159
+ equalActions?: boolean | undefined;
160
+ /**
161
+ * Draws the first column's name as a link. Needs rowHref or onRowClick.
162
+ * @default false
163
+ */
164
+ linkFirstColumn?: boolean | undefined;
143
165
  /**
144
166
  * Makes the whole row open this URL on click or Enter (Ctrl/Cmd or middle click opens a new tab).
145
167
  * Checkboxes, buttons, links and menus in the row keep their own behaviour. Razor: `data-href` on the <tr>.
@@ -185,6 +207,11 @@ export interface AppDataTableProps<Row> extends Omit<ComponentPropsWithoutRef<"d
185
207
  * beneath it.
186
208
  */
187
209
  renderExpanded?: ((row: Row) => ReactNode) | undefined;
210
+ /**
211
+ * With renderExpanded, opening a row closes the one that was open, so at most one row is expanded.
212
+ * @default false
213
+ */
214
+ singleExpand?: boolean | undefined;
188
215
  /**
189
216
  * Each column but the last gets a handle on its end edge: drag it, or focus it and press the arrow keys. The table then keeps fixed widths measured from its rows, and the last column takes the rest.
190
217
  * @default false