@cratis/components 4.42.1 → 4.42.3

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 (197) hide show
  1. package/compat-manifest.json +11 -11
  2. package/dist/esm/Canvas/Canvas.d.ts.map +1 -1
  3. package/dist/esm/Canvas/Canvas.js +16 -109
  4. package/dist/esm/Canvas/Canvas.js.map +1 -1
  5. package/dist/esm/Canvas/CanvasWorldLayers.d.ts +22 -0
  6. package/dist/esm/Canvas/CanvasWorldLayers.d.ts.map +1 -0
  7. package/dist/esm/Canvas/CanvasWorldLayers.js +27 -0
  8. package/dist/esm/Canvas/CanvasWorldLayers.js.map +1 -0
  9. package/dist/esm/Canvas/useCanvasSurface.d.ts +57 -0
  10. package/dist/esm/Canvas/useCanvasSurface.d.ts.map +1 -0
  11. package/dist/esm/Canvas/useCanvasSurface.js +112 -0
  12. package/dist/esm/Canvas/useCanvasSurface.js.map +1 -0
  13. package/dist/esm/Chat/ChatTopicEmptyMessage.d.ts +9 -0
  14. package/dist/esm/Chat/ChatTopicEmptyMessage.d.ts.map +1 -0
  15. package/dist/esm/Chat/ChatTopicEmptyMessage.js +19 -0
  16. package/dist/esm/Chat/ChatTopicEmptyMessage.js.map +1 -0
  17. package/dist/esm/Chat/ChatTopicList.d.ts +2 -2
  18. package/dist/esm/Chat/ChatTopicList.d.ts.map +1 -1
  19. package/dist/esm/Chat/ChatTopicList.js +5 -20
  20. package/dist/esm/Chat/ChatTopicList.js.map +1 -1
  21. package/dist/esm/Chat/ChatTopicRow.d.ts +22 -0
  22. package/dist/esm/Chat/ChatTopicRow.d.ts.map +1 -0
  23. package/dist/esm/Chat/ChatTopicRow.js +23 -0
  24. package/dist/esm/Chat/ChatTopicRow.js.map +1 -0
  25. package/dist/esm/Chat/ChatTopicStartButton.d.ts +8 -0
  26. package/dist/esm/Chat/ChatTopicStartButton.d.ts.map +1 -0
  27. package/dist/esm/Chat/ChatTopicStartButton.js +7 -0
  28. package/dist/esm/Chat/ChatTopicStartButton.js.map +1 -0
  29. package/dist/esm/CommandDialog/CommandStepperContent.d.ts.map +1 -1
  30. package/dist/esm/CommandDialog/CommandStepperContent.js +31 -119
  31. package/dist/esm/CommandDialog/CommandStepperContent.js.map +1 -1
  32. package/dist/esm/CommandDialog/CommandStepperList.d.ts +19 -0
  33. package/dist/esm/CommandDialog/CommandStepperList.d.ts.map +1 -0
  34. package/dist/esm/CommandDialog/CommandStepperList.js +20 -0
  35. package/dist/esm/CommandDialog/CommandStepperList.js.map +1 -0
  36. package/dist/esm/CommandDialog/CommandStepperNavigation.d.ts +20 -0
  37. package/dist/esm/CommandDialog/CommandStepperNavigation.d.ts.map +1 -0
  38. package/dist/esm/CommandDialog/CommandStepperNavigation.js +15 -0
  39. package/dist/esm/CommandDialog/CommandStepperNavigation.js.map +1 -0
  40. package/dist/esm/CommandDialog/CommandStepperPanels.d.ts +20 -0
  41. package/dist/esm/CommandDialog/CommandStepperPanels.d.ts.map +1 -0
  42. package/dist/esm/CommandDialog/CommandStepperPanels.js +9 -0
  43. package/dist/esm/CommandDialog/CommandStepperPanels.js.map +1 -0
  44. package/dist/esm/CommandDialog/CommandStepperStepParts.d.ts +23 -0
  45. package/dist/esm/CommandDialog/CommandStepperStepParts.d.ts.map +1 -0
  46. package/dist/esm/CommandDialog/CommandStepperStepParts.js +9 -0
  47. package/dist/esm/CommandDialog/CommandStepperStepParts.js.map +1 -0
  48. package/dist/esm/CommandDialog/commandStepperFields.d.ts +6 -0
  49. package/dist/esm/CommandDialog/commandStepperFields.d.ts.map +1 -0
  50. package/dist/esm/CommandDialog/commandStepperFields.js +54 -0
  51. package/dist/esm/CommandDialog/commandStepperFields.js.map +1 -0
  52. package/dist/esm/CommandDialog/joinClassNames.d.ts +3 -0
  53. package/dist/esm/CommandDialog/joinClassNames.d.ts.map +1 -0
  54. package/dist/esm/CommandDialog/joinClassNames.js +4 -0
  55. package/dist/esm/CommandDialog/joinClassNames.js.map +1 -0
  56. package/dist/esm/CommandDialog/resolveStepperLabels.d.ts +20 -0
  57. package/dist/esm/CommandDialog/resolveStepperLabels.d.ts.map +1 -0
  58. package/dist/esm/CommandDialog/resolveStepperLabels.js +8 -0
  59. package/dist/esm/CommandDialog/resolveStepperLabels.js.map +1 -0
  60. package/dist/esm/CommandDialog/useStepValidation.d.ts +7 -0
  61. package/dist/esm/CommandDialog/useStepValidation.d.ts.map +1 -0
  62. package/dist/esm/CommandDialog/useStepValidation.js +14 -0
  63. package/dist/esm/CommandDialog/useStepValidation.js.map +1 -0
  64. package/dist/esm/CommandDialog/useStepperState.d.ts +30 -0
  65. package/dist/esm/CommandDialog/useStepperState.d.ts.map +1 -0
  66. package/dist/esm/CommandDialog/useStepperState.js +37 -0
  67. package/dist/esm/CommandDialog/useStepperState.js.map +1 -0
  68. package/dist/esm/CommandForm/fields/ChipsField.d.ts +1 -1
  69. package/dist/esm/CommandForm/fields/ChipsField.d.ts.map +1 -1
  70. package/dist/esm/CommandForm/fields/ChipsField.js +6 -42
  71. package/dist/esm/CommandForm/fields/ChipsField.js.map +1 -1
  72. package/dist/esm/CommandForm/fields/ChipsInput.d.ts +18 -0
  73. package/dist/esm/CommandForm/fields/ChipsInput.d.ts.map +1 -0
  74. package/dist/esm/CommandForm/fields/ChipsInput.js +12 -0
  75. package/dist/esm/CommandForm/fields/ChipsInput.js.map +1 -0
  76. package/dist/esm/CommandForm/fields/ChipsItem.d.ts +14 -0
  77. package/dist/esm/CommandForm/fields/ChipsItem.d.ts.map +1 -0
  78. package/dist/esm/CommandForm/fields/ChipsItem.js +14 -0
  79. package/dist/esm/CommandForm/fields/ChipsItem.js.map +1 -0
  80. package/dist/esm/CommandForm/fields/ChipsRoot.d.ts +15 -0
  81. package/dist/esm/CommandForm/fields/ChipsRoot.d.ts.map +1 -0
  82. package/dist/esm/CommandForm/fields/ChipsRoot.js +11 -0
  83. package/dist/esm/CommandForm/fields/ChipsRoot.js.map +1 -0
  84. package/dist/esm/CommandForm/fields/PasswordField.d.ts.map +1 -1
  85. package/dist/esm/CommandForm/fields/PasswordField.js +4 -14
  86. package/dist/esm/CommandForm/fields/PasswordField.js.map +1 -1
  87. package/dist/esm/CommandForm/fields/PasswordInput.d.ts +17 -0
  88. package/dist/esm/CommandForm/fields/PasswordInput.d.ts.map +1 -0
  89. package/dist/esm/CommandForm/fields/PasswordInput.js +7 -0
  90. package/dist/esm/CommandForm/fields/PasswordInput.js.map +1 -0
  91. package/dist/esm/CommandForm/fields/PasswordRoot.d.ts +15 -0
  92. package/dist/esm/CommandForm/fields/PasswordRoot.d.ts.map +1 -0
  93. package/dist/esm/CommandForm/fields/PasswordRoot.js +7 -0
  94. package/dist/esm/CommandForm/fields/PasswordRoot.js.map +1 -0
  95. package/dist/esm/CommandForm/fields/PasswordToggle.d.ts +13 -0
  96. package/dist/esm/CommandForm/fields/PasswordToggle.d.ts.map +1 -0
  97. package/dist/esm/CommandForm/fields/PasswordToggle.js +9 -0
  98. package/dist/esm/CommandForm/fields/PasswordToggle.js.map +1 -0
  99. package/dist/esm/CommandForm/fields/useChipsDraft.d.ts +19 -0
  100. package/dist/esm/CommandForm/fields/useChipsDraft.d.ts.map +1 -0
  101. package/dist/esm/CommandForm/fields/useChipsDraft.js +19 -0
  102. package/dist/esm/CommandForm/fields/useChipsDraft.js.map +1 -0
  103. package/dist/esm/Common/CratisComponentsProvider.d.ts.map +1 -1
  104. package/dist/esm/Common/CratisComponentsProvider.js +1 -44
  105. package/dist/esm/Common/CratisComponentsProvider.js.map +1 -1
  106. package/dist/esm/Common/legacyLocaleMessages.d.ts +7 -0
  107. package/dist/esm/Common/legacyLocaleMessages.d.ts.map +1 -0
  108. package/dist/esm/Common/legacyLocaleMessages.js +43 -0
  109. package/dist/esm/Common/legacyLocaleMessages.js.map +1 -0
  110. package/dist/esm/DataTables/DataTableCore.d.ts +1 -1
  111. package/dist/esm/DataTables/DataTableCore.d.ts.map +1 -1
  112. package/dist/esm/DataTables/DataTableCore.js +12 -66
  113. package/dist/esm/DataTables/DataTableCore.js.map +1 -1
  114. package/dist/esm/DataTables/DataTableHead.d.ts +23 -0
  115. package/dist/esm/DataTables/DataTableHead.d.ts.map +1 -0
  116. package/dist/esm/DataTables/DataTableHead.js +12 -0
  117. package/dist/esm/DataTables/DataTableHead.js.map +1 -0
  118. package/dist/esm/DataTables/DataTableRows.d.ts +19 -0
  119. package/dist/esm/DataTables/DataTableRows.d.ts.map +1 -0
  120. package/dist/esm/DataTables/DataTableRows.js +7 -0
  121. package/dist/esm/DataTables/DataTableRows.js.map +1 -0
  122. package/dist/esm/DataTables/DataTableTable.d.ts +20 -0
  123. package/dist/esm/DataTables/DataTableTable.d.ts.map +1 -0
  124. package/dist/esm/DataTables/DataTableTable.js +10 -0
  125. package/dist/esm/DataTables/DataTableTable.js.map +1 -0
  126. package/dist/esm/DataTables/TablePaginatorImplementation.js +1 -1
  127. package/dist/esm/DataTables/useDataTableRows.d.ts +40 -0
  128. package/dist/esm/DataTables/useDataTableRows.d.ts.map +1 -0
  129. package/dist/esm/DataTables/useDataTableRows.js +49 -0
  130. package/dist/esm/DataTables/useDataTableRows.js.map +1 -0
  131. package/dist/esm/Dialogs/DialogImplementation.js +1 -1
  132. package/dist/esm/Dropdown/useDropdownState.js +1 -1
  133. package/dist/esm/Filter/FilterPanel.d.ts +69 -0
  134. package/dist/esm/Filter/FilterPanel.d.ts.map +1 -1
  135. package/dist/esm/Filter/FilterPanel.js +6 -21
  136. package/dist/esm/Filter/FilterPanel.js.map +1 -1
  137. package/dist/esm/Filter/FilterPanelContent.d.ts +14 -0
  138. package/dist/esm/Filter/FilterPanelContent.d.ts.map +1 -0
  139. package/dist/esm/Filter/FilterPanelContent.js +8 -0
  140. package/dist/esm/Filter/FilterPanelContent.js.map +1 -0
  141. package/dist/esm/Filter/usePortalTarget.d.ts +13 -0
  142. package/dist/esm/Filter/usePortalTarget.d.ts.map +1 -0
  143. package/dist/esm/Filter/usePortalTarget.js +24 -0
  144. package/dist/esm/Filter/usePortalTarget.js.map +1 -0
  145. package/dist/esm/Notifications/ToastCloseButton.d.ts +11 -0
  146. package/dist/esm/Notifications/ToastCloseButton.d.ts.map +1 -0
  147. package/dist/esm/Notifications/ToastCloseButton.js +14 -0
  148. package/dist/esm/Notifications/ToastCloseButton.js.map +1 -0
  149. package/dist/esm/Notifications/ToastContent.d.ts +10 -0
  150. package/dist/esm/Notifications/ToastContent.d.ts.map +1 -0
  151. package/dist/esm/Notifications/ToastContent.js +7 -0
  152. package/dist/esm/Notifications/ToastContent.js.map +1 -0
  153. package/dist/esm/Notifications/Toaster.d.ts.map +1 -1
  154. package/dist/esm/Notifications/Toaster.js +8 -17
  155. package/dist/esm/Notifications/Toaster.js.map +1 -1
  156. package/dist/esm/Notifications/useToastAutoDismiss.d.ts +4 -0
  157. package/dist/esm/Notifications/useToastAutoDismiss.d.ts.map +1 -0
  158. package/dist/esm/Notifications/useToastAutoDismiss.js +20 -0
  159. package/dist/esm/Notifications/useToastAutoDismiss.js.map +1 -0
  160. package/dist/esm/PivotViewer/PivotViewer.d.ts +1 -1
  161. package/dist/esm/PivotViewer/PivotViewer.d.ts.map +1 -1
  162. package/dist/esm/PivotViewer/PivotViewer.js +24 -31
  163. package/dist/esm/PivotViewer/PivotViewer.js.map +1 -1
  164. package/dist/esm/PivotViewer/components/PivotViewerContent.d.ts +40 -0
  165. package/dist/esm/PivotViewer/components/PivotViewerContent.d.ts.map +1 -0
  166. package/dist/esm/PivotViewer/components/PivotViewerContent.js +13 -0
  167. package/dist/esm/PivotViewer/components/PivotViewerContent.js.map +1 -0
  168. package/dist/esm/PivotViewer/hooks/usePivotViewerViewState.d.ts +37 -0
  169. package/dist/esm/PivotViewer/hooks/usePivotViewerViewState.d.ts.map +1 -0
  170. package/dist/esm/PivotViewer/hooks/usePivotViewerViewState.js +35 -0
  171. package/dist/esm/PivotViewer/hooks/usePivotViewerViewState.js.map +1 -0
  172. package/dist/esm/TimeMachine/EventCard.d.ts +9 -0
  173. package/dist/esm/TimeMachine/EventCard.d.ts.map +1 -0
  174. package/dist/esm/TimeMachine/EventCard.js +8 -0
  175. package/dist/esm/TimeMachine/EventCard.js.map +1 -0
  176. package/dist/esm/TimeMachine/EventSeparator.d.ts +11 -0
  177. package/dist/esm/TimeMachine/EventSeparator.d.ts.map +1 -0
  178. package/dist/esm/TimeMachine/EventSeparator.js +7 -0
  179. package/dist/esm/TimeMachine/EventSeparator.js.map +1 -0
  180. package/dist/esm/TimeMachine/EventTimelineItem.d.ts +14 -0
  181. package/dist/esm/TimeMachine/EventTimelineItem.d.ts.map +1 -0
  182. package/dist/esm/TimeMachine/EventTimelineItem.js +9 -0
  183. package/dist/esm/TimeMachine/EventTimelineItem.js.map +1 -0
  184. package/dist/esm/TimeMachine/EventsScrollButton.d.ts +10 -0
  185. package/dist/esm/TimeMachine/EventsScrollButton.d.ts.map +1 -0
  186. package/dist/esm/TimeMachine/EventsScrollButton.js +6 -0
  187. package/dist/esm/TimeMachine/EventsScrollButton.js.map +1 -0
  188. package/dist/esm/TimeMachine/EventsView.d.ts +1 -1
  189. package/dist/esm/TimeMachine/EventsView.d.ts.map +1 -1
  190. package/dist/esm/TimeMachine/EventsView.js +6 -39
  191. package/dist/esm/TimeMachine/EventsView.js.map +1 -1
  192. package/dist/esm/TimeMachine/useScrollEdges.d.ts +13 -0
  193. package/dist/esm/TimeMachine/useScrollEdges.d.ts.map +1 -0
  194. package/dist/esm/TimeMachine/useScrollEdges.js +40 -0
  195. package/dist/esm/TimeMachine/useScrollEdges.js.map +1 -0
  196. package/dist/esm/Toolbar/ToolbarFolder.js +1 -1
  197. package/package.json +1 -1
@@ -0,0 +1,12 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { classNames } from '../../ClassNames/classNames.js';
3
+
4
+ const ChipsInput = ({ id, ariaLabel, ariaDescribedBy, draft, onDraftChange, onCommit, placeholder, invalid, parts: pt, }) => (jsx("input", { ...pt?.input, id: id, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, value: draft, onChange: (event) => onDraftChange(event.target.value), onKeyDown: (event) => {
5
+ if (event.key === 'Enter') {
6
+ event.preventDefault();
7
+ onCommit();
8
+ }
9
+ }, placeholder: placeholder, "aria-invalid": invalid || undefined, "data-disabled": pt?.input?.disabled || undefined, "data-invalid": invalid || undefined, "data-readonly": pt?.input?.readOnly || undefined, className: classNames('cratis-chips-field__input', pt?.input?.className), "data-cratis-part": 'input' }));
10
+
11
+ export { ChipsInput };
12
+ //# sourceMappingURL=ChipsInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChipsInput.js","sources":["../../../../CommandForm/fields/ChipsInput.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { classNames } from '../../ClassNames/classNames';\nimport type { ChipsParts } from './ChipsField';\n\n/** Props for {@link ChipsInput}. */\nexport interface ChipsInputProps {\n id?: string;\n ariaLabel?: string;\n ariaDescribedBy?: string;\n draft: string;\n onDraftChange: (draft: string) => void;\n /** Called when Enter is pressed in the input. */\n onCommit: () => void;\n placeholder?: string;\n invalid?: boolean;\n /** The field's part attributes. */\n parts?: ChipsParts;\n}\n\n/** The native draft-value input of a chips field. */\nexport const ChipsInput = ({\n id,\n ariaLabel,\n ariaDescribedBy,\n draft,\n onDraftChange,\n onCommit,\n placeholder,\n invalid,\n parts: pt,\n}: ChipsInputProps) => (\n <input\n {...pt?.input}\n id={id}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedBy}\n value={draft}\n onChange={(event) => onDraftChange(event.target.value)}\n onKeyDown={(event) => {\n if (event.key === 'Enter') {\n event.preventDefault();\n onCommit();\n }\n }}\n placeholder={placeholder}\n aria-invalid={invalid || undefined}\n data-disabled={pt?.input?.disabled || undefined}\n data-invalid={invalid || undefined}\n data-readonly={pt?.input?.readOnly || undefined}\n className={classNames('cratis-chips-field__input', pt?.input?.className)}\n data-cratis-part='input'\n />\n);\n"],"names":["_jsx"],"mappings":";;;AAsBO,MAAM,UAAU,GAAG,CAAC,EACvB,EAAE,EACF,SAAS,EACT,eAAe,EACf,KAAK,EACL,aAAa,EACb,QAAQ,EACR,WAAW,EACX,OAAO,EACP,KAAK,EAAE,EAAE,GACK,MACdA,GAAA,CAAA,OAAA,EAAA,EAAA,GACQ,EAAE,EAAE,KAAK,EACb,EAAE,EAAE,EAAE,EAAA,YAAA,EACM,SAAS,sBACH,eAAe,EACjC,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,CAAC,KAAK,KAAK,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EACtD,SAAS,EAAE,CAAC,KAAK,KAAI;AACjB,QAAA,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,EAAE;YACvB,KAAK,CAAC,cAAc,EAAE;AACtB,YAAA,QAAQ,EAAE;QACd;IACJ,CAAC,EACD,WAAW,EAAE,WAAW,kBACV,OAAO,IAAI,SAAS,EAAA,eAAA,EACnB,EAAE,EAAE,KAAK,EAAE,QAAQ,IAAI,SAAS,kBACjC,OAAO,IAAI,SAAS,EAAA,eAAA,EACnB,EAAE,EAAE,KAAK,EAAE,QAAQ,IAAI,SAAS,EAC/C,SAAS,EAAE,UAAU,CAAC,2BAA2B,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,CAAC,EAAA,kBAAA,EACvD,OAAO,EAAA,CAC1B;;"}
@@ -0,0 +1,14 @@
1
+ import type { ChipsParts } from './ChipsField.js';
2
+ /** Props for {@link ChipsItem}. */
3
+ export interface ChipsItemProps {
4
+ item: string;
5
+ index: number;
6
+ /** Builds a remove-button label, or supplies one shared localized label. */
7
+ removeAriaLabel?: string | ((item: string, index: number) => string);
8
+ /** The field's part attributes. */
9
+ parts?: ChipsParts;
10
+ onRemove: () => void;
11
+ }
12
+ /** One selected chip with its remove button. */
13
+ export declare const ChipsItem: ({ item, index, removeAriaLabel, parts: pt, onRemove }: ChipsItemProps) => import("react").JSX.Element;
14
+ //# sourceMappingURL=ChipsItem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChipsItem.d.ts","sourceRoot":"","sources":["../../../../CommandForm/fields/ChipsItem.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAc,CAAC;AAE/C,mCAAmC;AACnC,MAAM,WAAW,cAAc;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,4EAA4E;IAC5E,eAAe,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC;IACrE,mCAAmC;IACnC,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACxB;AASD,gDAAgD;AAChD,eAAO,MAAM,SAAS,0DAA2D,cAAc,gCAwB9F,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { classNames } from '../../ClassNames/classNames.js';
3
+ import { useCratisIcon } from '../../configuration/useCratisIcon.js';
4
+
5
+ const removeLabel = ({ item, index, removeAriaLabel }) => typeof removeAriaLabel === 'function'
6
+ ? removeAriaLabel(item, index)
7
+ : (removeAriaLabel ?? `Remove ${item}`);
8
+ const ChipsItem = ({ item, index, removeAriaLabel, parts: pt, onRemove }) => {
9
+ const icon = useCratisIcon();
10
+ return (jsxs("span", { ...pt?.item, className: classNames('cratis-chips-field__item', pt?.item?.className), "data-cratis-part": 'item', "data-selected": true, children: [jsx("span", { children: item }), jsx("button", { ...pt?.remove, type: 'button', className: classNames('cratis-chips-field__remove', pt?.remove?.className), "data-cratis-part": 'remove', "data-disabled": pt?.remove?.disabled || undefined, "data-selected": true, "aria-label": removeLabel({ item, index, removeAriaLabel }), onClick: onRemove, children: icon('remove', '×') })] }));
11
+ };
12
+
13
+ export { ChipsItem };
14
+ //# sourceMappingURL=ChipsItem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChipsItem.js","sources":["../../../../CommandForm/fields/ChipsItem.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { classNames } from '../../ClassNames/classNames';\nimport { useCratisIcon } from '../../configuration/useCratisIcon';\nimport type { ChipsParts } from './ChipsField';\n\n/** Props for {@link ChipsItem}. */\nexport interface ChipsItemProps {\n item: string;\n index: number;\n /** Builds a remove-button label, or supplies one shared localized label. */\n removeAriaLabel?: string | ((item: string, index: number) => string);\n /** The field's part attributes. */\n parts?: ChipsParts;\n onRemove: () => void;\n}\n\nconst removeLabel = (\n { item, index, removeAriaLabel }: Pick<ChipsItemProps, 'item' | 'index' | 'removeAriaLabel'>,\n) =>\n typeof removeAriaLabel === 'function'\n ? removeAriaLabel(item, index)\n : (removeAriaLabel ?? `Remove ${item}`);\n\n/** One selected chip with its remove button. */\nexport const ChipsItem = ({ item, index, removeAriaLabel, parts: pt, onRemove }: ChipsItemProps) => {\n const icon = useCratisIcon();\n return (\n <span\n {...pt?.item}\n className={classNames('cratis-chips-field__item', pt?.item?.className)}\n data-cratis-part='item'\n data-selected\n >\n <span>{item}</span>\n <button\n {...pt?.remove}\n type='button'\n className={classNames('cratis-chips-field__remove', pt?.remove?.className)}\n data-cratis-part='remove'\n data-disabled={pt?.remove?.disabled || undefined}\n data-selected\n aria-label={removeLabel({ item, index, removeAriaLabel })}\n onClick={onRemove}\n >\n {icon('remove', '×')}\n </button>\n </span>\n );\n};\n"],"names":["_jsxs","_jsx"],"mappings":";;;;AAkBA,MAAM,WAAW,GAAG,CAChB,EAAE,IAAI,EAAE,KAAK,EAAE,eAAe,EAA8D,KAE5F,OAAO,eAAe,KAAK;AACvB,MAAE,eAAe,CAAC,IAAI,EAAE,KAAK;OAC1B,eAAe,IAAI,UAAU,IAAI,CAAA,CAAE,CAAC;AAGxC,MAAM,SAAS,GAAG,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAkB,KAAI;AAC/F,IAAA,MAAM,IAAI,GAAG,aAAa,EAAE;AAC5B,IAAA,QACIA,IAAA,CAAA,MAAA,EAAA,EAAA,GACQ,EAAE,EAAE,IAAI,EACZ,SAAS,EAAE,UAAU,CAAC,0BAA0B,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,CAAC,EAAA,kBAAA,EACrD,MAAM,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,CAGvBC,wBAAO,IAAI,EAAA,CAAQ,EACnBA,GAAA,CAAA,QAAA,EAAA,EAAA,GACQ,EAAE,EAAE,MAAM,EACd,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,UAAU,CAAC,4BAA4B,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,CAAC,EAAA,kBAAA,EACzD,QAAQ,EAAA,eAAA,EACV,EAAE,EAAE,MAAM,EAAE,QAAQ,IAAI,SAAS,EAAA,eAAA,EAAA,IAAA,EAAA,YAAA,EAEpC,WAAW,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC,EACzD,OAAO,EAAE,QAAQ,EAAA,QAAA,EAEhB,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,EAAA,CACf,CAAA,EAAA,CACN;AAEf;;"}
@@ -0,0 +1,15 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ChipsParts } from './ChipsField.js';
3
+ /** Props for {@link ChipsRoot}. */
4
+ export interface ChipsRootProps {
5
+ parts?: ChipsParts;
6
+ className?: string;
7
+ invalid?: boolean;
8
+ addOnBlur?: boolean;
9
+ onBlur?: () => void;
10
+ onCommit: () => void;
11
+ children: ReactNode;
12
+ }
13
+ /** The field wrapper of a chips field, which commits the draft when focus leaves it. */
14
+ export declare const ChipsRoot: ({ parts: pt, className, invalid, addOnBlur, onBlur, onCommit, children }: ChipsRootProps) => import("react").JSX.Element;
15
+ //# sourceMappingURL=ChipsRoot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChipsRoot.d.ts","sourceRoot":"","sources":["../../../../CommandForm/fields/ChipsRoot.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAc,CAAC;AAE/C,mCAAmC;AACnC,MAAM,WAAW,cAAc;IAC3B,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,EAAE,SAAS,CAAC;CACvB;AAED,wFAAwF;AACxF,eAAO,MAAM,SAAS,6EAA8E,cAAc,gCAiBjH,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { classNames } from '../../ClassNames/classNames.js';
3
+
4
+ const ChipsRoot = ({ parts: pt, className, invalid, addOnBlur, onBlur, onCommit, children }) => (jsx("div", { ...pt?.root, className: classNames('cratis-chips-field', 'cratis:w-full', pt?.root?.className, className), onBlur: (event) => {
5
+ onBlur?.();
6
+ if (addOnBlur && !event.currentTarget.contains(event.relatedTarget))
7
+ onCommit();
8
+ }, "data-cratis-part": 'root', "data-cratis-component": 'ChipsField', "data-disabled": pt?.input?.disabled || undefined, "data-invalid": invalid || undefined, "data-readonly": pt?.input?.readOnly || undefined, children: children }));
9
+
10
+ export { ChipsRoot };
11
+ //# sourceMappingURL=ChipsRoot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChipsRoot.js","sources":["../../../../CommandForm/fields/ChipsRoot.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { ReactNode } from 'react';\nimport { classNames } from '../../ClassNames/classNames';\nimport type { ChipsParts } from './ChipsField';\n\n/** Props for {@link ChipsRoot}. */\nexport interface ChipsRootProps {\n parts?: ChipsParts;\n className?: string;\n invalid?: boolean;\n addOnBlur?: boolean;\n onBlur?: () => void;\n onCommit: () => void;\n children: ReactNode;\n}\n\n/** The field wrapper of a chips field, which commits the draft when focus leaves it. */\nexport const ChipsRoot = ({ parts: pt, className, invalid, addOnBlur, onBlur, onCommit, children }: ChipsRootProps) => (\n <div\n {...pt?.root}\n className={classNames('cratis-chips-field', 'cratis:w-full', pt?.root?.className, className)}\n onBlur={(event) => {\n onBlur?.();\n if (addOnBlur && !event.currentTarget.contains(event.relatedTarget))\n onCommit();\n }}\n data-cratis-part='root'\n data-cratis-component='ChipsField'\n data-disabled={pt?.input?.disabled || undefined}\n data-invalid={invalid || undefined}\n data-readonly={pt?.input?.readOnly || undefined}\n >\n {children}\n </div>\n);\n"],"names":["_jsx"],"mappings":";;;AAmBO,MAAM,SAAS,GAAG,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAkB,MAC9GA,gBACQ,EAAE,EAAE,IAAI,EACZ,SAAS,EAAE,UAAU,CAAC,oBAAoB,EAAE,eAAe,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,CAAC,EAC5F,MAAM,EAAE,CAAC,KAAK,KAAI;QACd,MAAM,IAAI;AACV,QAAA,IAAI,SAAS,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,aAAa,CAAC;AAC/D,YAAA,QAAQ,EAAE;AAClB,IAAA,CAAC,EAAA,kBAAA,EACgB,MAAM,EAAA,uBAAA,EACD,YAAY,EAAA,eAAA,EACnB,EAAE,EAAE,KAAK,EAAE,QAAQ,IAAI,SAAS,EAAA,cAAA,EACjC,OAAO,IAAI,SAAS,EAAA,eAAA,EACnB,EAAE,EAAE,KAAK,EAAE,QAAQ,IAAI,SAAS,EAAA,QAAA,EAE9C,QAAQ,EAAA,CACP;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"PasswordField.d.ts","sourceRoot":"","sources":["../../../../CommandForm/fields/PasswordField.tsx"],"names":[],"mappings":"AAGA,OAAO,EAEH,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EAC3B,MAAM,OAAO,CAAC;AACf,OAAO,EAAsB,KAAK,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACxF,OAAO,EAEH,KAAK,uBAAuB,EAC/B,MAAM,yBAAsB,CAAC;AAI9B,wDAAwD;AACxD,MAAM,WAAW,aAAa;IAC1B,qBAAqB;IACrB,IAAI,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;IACtC,kCAAkC;IAClC,KAAK,CAAC,EAAE,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;IAC9C,gCAAgC;IAChC,MAAM,CAAC,EAAE,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;CACpD;AAKD,UAAU,2BACN,SAAQ,iBAAiB,CAAC,MAAM,CAAC,EAC7B,uBAAuB;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,aAAa,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAmED,4EAA4E;AAC5E,eAAO,MAAM,aAAa,0NAGzB,CAAC"}
1
+ {"version":3,"file":"PasswordField.d.ts","sourceRoot":"","sources":["../../../../CommandForm/fields/PasswordField.tsx"],"names":[],"mappings":"AAGA,OAAO,EAEH,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EAC3B,MAAM,OAAO,CAAC;AACf,OAAO,EAAsB,KAAK,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACxF,OAAO,EAEH,KAAK,uBAAuB,EAC/B,MAAM,yBAAsB,CAAC;AAO9B,wDAAwD;AACxD,MAAM,WAAW,aAAa;IAC1B,qBAAqB;IACrB,IAAI,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;IACtC,kCAAkC;IAClC,KAAK,CAAC,EAAE,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;IAC9C,gCAAgC;IAChC,MAAM,CAAC,EAAE,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;CACpD;AAKD,UAAU,2BACN,SAAQ,iBAAiB,CAAC,MAAM,CAAC,EAC7B,uBAAuB;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,aAAa,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAwCD,4EAA4E;AAC5E,eAAO,MAAM,aAAa,0NAGzB,CAAC"}
@@ -2,6 +2,9 @@ import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { useState } from 'react';
3
3
  import { asCommandFormField } from '@cratis/arc.react/commands';
4
4
  import { useFieldAccessibility } from './fieldAccessibility.js';
5
+ import { PasswordInput } from './PasswordInput.js';
6
+ import { PasswordRoot } from './PasswordRoot.js';
7
+ import { PasswordToggle } from './PasswordToggle.js';
5
8
 
6
9
  const PasswordControl = (props) => {
7
10
  const [visible, setVisible] = useState(false);
@@ -10,20 +13,7 @@ const PasswordControl = (props) => {
10
13
  ariaLabel: props.pt?.input?.['aria-label'],
11
14
  ariaDescribedBy: props.pt?.input?.['aria-describedby'],
12
15
  });
13
- return (jsxs("div", { ...props.pt?.root, onBlur: props.onBlur, className: [
14
- 'cratis-password-field',
15
- 'cratis:w-full',
16
- props.pt?.root?.className,
17
- props.className,
18
- ]
19
- .filter(Boolean)
20
- .join(' '), "data-cratis-part": 'root', "data-cratis-component": 'PasswordField', "data-disabled": props.pt?.input?.disabled || undefined, "data-invalid": props.invalid || undefined, "data-readonly": props.pt?.input?.readOnly || undefined, children: [jsx("input", { ...props.pt?.input, id: accessibility.controlId, "aria-label": accessibility.ariaLabel, "aria-describedby": accessibility.ariaDescribedBy, type: visible ? 'text' : 'password', value: props.value, onChange: (event) => props.onChange(event.currentTarget.value), placeholder: props.placeholder, "aria-invalid": props.invalid || undefined, "data-disabled": props.pt?.input?.disabled || undefined, "data-invalid": props.invalid || undefined, "data-readonly": props.pt?.input?.readOnly || undefined, className: ['cratis-field-input', 'cratis:w-full', props.pt?.input?.className]
21
- .filter(Boolean)
22
- .join(' '), "data-cratis-part": 'input' }), jsx("button", { ...props.pt?.toggle, type: 'button', className: ['cratis-password-field__toggle', props.pt?.toggle?.className]
23
- .filter(Boolean)
24
- .join(' '), "data-cratis-part": 'toggle', "data-disabled": props.pt?.toggle?.disabled || undefined, "aria-label": visible
25
- ? (props.hideLabel ?? 'Hide password')
26
- : (props.showLabel ?? 'Show password'), onClick: () => setVisible((current) => !current), children: jsx("span", { "aria-hidden": 'true', children: visible ? '◉' : '○' }) }), accessibility.hiddenError] }));
16
+ return (jsxs(PasswordRoot, { attributes: props.pt?.root, input: props.pt?.input, className: props.className, invalid: props.invalid, onBlur: props.onBlur, children: [jsx(PasswordInput, { attributes: props.pt?.input, id: accessibility.controlId, ariaLabel: accessibility.ariaLabel, ariaDescribedBy: accessibility.ariaDescribedBy, visible: visible, value: props.value, onChange: props.onChange, placeholder: props.placeholder, invalid: props.invalid }), jsx(PasswordToggle, { attributes: props.pt?.toggle, visible: visible, showLabel: props.showLabel, hideLabel: props.hideLabel, onToggle: () => setVisible((current) => !current) }), accessibility.hiddenError] }));
27
17
  };
28
18
  const PasswordField = asCommandFormField(PasswordControl, { defaultValue: '' });
29
19
 
@@ -1 +1 @@
1
- {"version":3,"file":"PasswordField.js","sources":["../../../../CommandForm/fields/PasswordField.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport {\n useState,\n type ButtonHTMLAttributes,\n type HTMLAttributes,\n type InputHTMLAttributes,\n} from 'react';\nimport { asCommandFormField, type WrappedFieldProps } from '@cratis/arc.react/commands';\nimport {\n useFieldAccessibility,\n type FieldAccessibilityProps,\n} from './fieldAccessibility';\nimport type { ExactPartKeys } from '../../types/ExactPartKeys';\nimport type { PartsOf } from '../../types/parts';\n\n/** Stable part attributes for {@link PasswordField}. */\nexport interface PasswordParts {\n /** Field wrapper. */\n root?: HTMLAttributes<HTMLDivElement>;\n /** Native password/text input. */\n input?: InputHTMLAttributes<HTMLInputElement>;\n /** Visibility toggle button. */\n toggle?: ButtonHTMLAttributes<HTMLButtonElement>;\n}\n\nconst passwordPartsMatchManifest: ExactPartKeys<PasswordParts, PartsOf<'PasswordField'>> = true;\nvoid passwordPartsMatchManifest;\n\ninterface PasswordFieldComponentProps\n extends WrappedFieldProps<string>,\n FieldAccessibilityProps {\n placeholder?: string;\n className?: string;\n pt?: PasswordParts;\n ptOptions?: object;\n unstyled?: boolean;\n showLabel?: string;\n hideLabel?: string;\n}\n\nconst PasswordControl = (props: PasswordFieldComponentProps) => {\n const [visible, setVisible] = useState(false);\n const accessibility = useFieldAccessibility(props, {\n id: props.pt?.input?.id,\n ariaLabel: props.pt?.input?.['aria-label'],\n ariaDescribedBy: props.pt?.input?.['aria-describedby'],\n });\n return (\n <div\n {...props.pt?.root}\n onBlur={props.onBlur}\n className={[\n 'cratis-password-field',\n 'cratis:w-full',\n props.pt?.root?.className,\n props.className,\n ]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='root'\n data-cratis-component='PasswordField'\n data-disabled={props.pt?.input?.disabled || undefined}\n data-invalid={props.invalid || undefined}\n data-readonly={props.pt?.input?.readOnly || undefined}\n >\n <input\n {...props.pt?.input}\n id={accessibility.controlId}\n aria-label={accessibility.ariaLabel}\n aria-describedby={accessibility.ariaDescribedBy}\n type={visible ? 'text' : 'password'}\n value={props.value}\n onChange={(event) => props.onChange(event.currentTarget.value)}\n placeholder={props.placeholder}\n aria-invalid={props.invalid || undefined}\n data-disabled={props.pt?.input?.disabled || undefined}\n data-invalid={props.invalid || undefined}\n data-readonly={props.pt?.input?.readOnly || undefined}\n className={['cratis-field-input', 'cratis:w-full', props.pt?.input?.className]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='input'\n />\n <button\n {...props.pt?.toggle}\n type='button'\n className={['cratis-password-field__toggle', props.pt?.toggle?.className]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='toggle'\n data-disabled={props.pt?.toggle?.disabled || undefined}\n aria-label={\n visible\n ? (props.hideLabel ?? 'Hide password')\n : (props.showLabel ?? 'Show password')\n }\n onClick={() => setVisible((current) => !current)}\n >\n <span aria-hidden='true'>{visible ? '◉' : '○'}</span>\n </button>\n {accessibility.hiddenError}\n </div>\n );\n};\n\n/** A masked password field bound to a string property on an Arc command. */\nexport const PasswordField = asCommandFormField<PasswordFieldComponentProps>(\n PasswordControl,\n { defaultValue: '' },\n);\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;AA0CA,MAAM,eAAe,GAAG,CAAC,KAAkC,KAAI;IAC3D,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC;AAC7C,IAAA,MAAM,aAAa,GAAG,qBAAqB,CAAC,KAAK,EAAE;AAC/C,QAAA,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE;QACvB,SAAS,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,GAAG,YAAY,CAAC;QAC1C,eAAe,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,GAAG,kBAAkB,CAAC;AACzD,K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,SAAS,EAAE,CAAC,oBAAoB,EAAE,eAAe,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,SAAS;qBACxE,MAAM,CAAC,OAAO;AACd,qBAAA,IAAI,CAAC,GAAG,CAAC,EAAA,kBAAA,EACG,OAAO,EAAA,CAC1B,EACFA,GAAA,CAAA,QAAA,EAAA,EAAA,GACQ,KAAK,CAAC,EAAE,EAAE,MAAM,EACpB,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,CAAC,+BAA+B,EAAE,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS;qBACnE,MAAM,CAAC,OAAO;AACd,qBAAA,IAAI,CAAC,GAAG,CAAC,EAAA,kBAAA,EACG,QAAQ,mBACV,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,IAAI,SAAS,gBAElD;AACI,uBAAG,KAAK,CAAC,SAAS,IAAI,eAAe;uBAClC,KAAK,CAAC,SAAS,IAAI,eAAe,CAAC,EAE9C,OAAO,EAAE,MAAM,UAAU,CAAC,CAAC,OAAO,KAAK,CAAC,OAAO,CAAC,EAAA,QAAA,EAEhDA,6BAAkB,MAAM,EAAA,QAAA,EAAE,OAAO,GAAG,GAAG,GAAG,GAAG,GAAQ,EAAA,CAChD,EACR,aAAa,CAAC,WAAW,CAAA,EAAA,CACxB;AAEd,CAAC;AAGM,MAAM,aAAa,GAAG,kBAAkB,CAC3C,eAAe,EACf,EAAE,YAAY,EAAE,EAAE,EAAE;;"}
1
+ {"version":3,"file":"PasswordField.js","sources":["../../../../CommandForm/fields/PasswordField.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport {\n useState,\n type ButtonHTMLAttributes,\n type HTMLAttributes,\n type InputHTMLAttributes,\n} from 'react';\nimport { asCommandFormField, type WrappedFieldProps } from '@cratis/arc.react/commands';\nimport {\n useFieldAccessibility,\n type FieldAccessibilityProps,\n} from './fieldAccessibility';\nimport { PasswordInput } from './PasswordInput';\nimport { PasswordRoot } from './PasswordRoot';\nimport { PasswordToggle } from './PasswordToggle';\nimport type { ExactPartKeys } from '../../types/ExactPartKeys';\nimport type { PartsOf } from '../../types/parts';\n\n/** Stable part attributes for {@link PasswordField}. */\nexport interface PasswordParts {\n /** Field wrapper. */\n root?: HTMLAttributes<HTMLDivElement>;\n /** Native password/text input. */\n input?: InputHTMLAttributes<HTMLInputElement>;\n /** Visibility toggle button. */\n toggle?: ButtonHTMLAttributes<HTMLButtonElement>;\n}\n\nconst passwordPartsMatchManifest: ExactPartKeys<PasswordParts, PartsOf<'PasswordField'>> = true;\nvoid passwordPartsMatchManifest;\n\ninterface PasswordFieldComponentProps\n extends WrappedFieldProps<string>,\n FieldAccessibilityProps {\n placeholder?: string;\n className?: string;\n pt?: PasswordParts;\n ptOptions?: object;\n unstyled?: boolean;\n showLabel?: string;\n hideLabel?: string;\n}\n\nconst PasswordControl = (props: PasswordFieldComponentProps) => {\n const [visible, setVisible] = useState(false);\n const accessibility = useFieldAccessibility(props, {\n id: props.pt?.input?.id,\n ariaLabel: props.pt?.input?.['aria-label'],\n ariaDescribedBy: props.pt?.input?.['aria-describedby'],\n });\n return (\n <PasswordRoot\n attributes={props.pt?.root}\n input={props.pt?.input}\n className={props.className}\n invalid={props.invalid}\n onBlur={props.onBlur}\n >\n <PasswordInput\n attributes={props.pt?.input}\n id={accessibility.controlId}\n ariaLabel={accessibility.ariaLabel}\n ariaDescribedBy={accessibility.ariaDescribedBy}\n visible={visible}\n value={props.value}\n onChange={props.onChange}\n placeholder={props.placeholder}\n invalid={props.invalid}\n />\n <PasswordToggle\n attributes={props.pt?.toggle}\n visible={visible}\n showLabel={props.showLabel}\n hideLabel={props.hideLabel}\n onToggle={() => setVisible((current) => !current)}\n />\n {accessibility.hiddenError}\n </PasswordRoot>\n );\n};\n\n/** A masked password field bound to a string property on an Arc command. */\nexport const PasswordField = asCommandFormField<PasswordFieldComponentProps>(\n PasswordControl,\n { default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S,EAAE,KAAK,CAAC,SAAS,EAC1B,QAAQ,EAAE,MAAM,UAAU,CAAC,CAAC,OAAO,KAAK,CAAC,OAAO,CAAC,EAAA,CACnD,EACD,aAAa,CAAC,WAAW,CAAA,EAAA,CACf;AAEvB,CAAC;AAGM,MAAM,aAAa,GAAG,kBAAkB,CAC3C,eAAe,EACf,EAAE,YAAY,EAAE,EAAE,EAAE;;"}
@@ -0,0 +1,17 @@
1
+ import type { InputHTMLAttributes } from 'react';
2
+ /** Props for {@link PasswordInput}. */
3
+ export interface PasswordInputProps {
4
+ /** The part attributes for the native input. */
5
+ attributes?: InputHTMLAttributes<HTMLInputElement>;
6
+ id: string | undefined;
7
+ ariaLabel: string | undefined;
8
+ ariaDescribedBy: string | undefined;
9
+ visible: boolean;
10
+ value: string;
11
+ onChange: (value: string) => void;
12
+ placeholder?: string;
13
+ invalid?: boolean;
14
+ }
15
+ /** The native password/text input of a password field. */
16
+ export declare const PasswordInput: ({ attributes, id, ariaLabel, ariaDescribedBy, visible, value, onChange, placeholder, invalid, }: PasswordInputProps) => import("react").JSX.Element;
17
+ //# sourceMappingURL=PasswordInput.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PasswordInput.d.ts","sourceRoot":"","sources":["../../../../CommandForm/fields/PasswordInput.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAGjD,uCAAuC;AACvC,MAAM,WAAW,kBAAkB;IAC/B,gDAAgD;IAChD,UAAU,CAAC,EAAE,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;IACnD,EAAE,EAAE,MAAM,GAAG,SAAS,CAAC;IACvB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,0DAA0D;AAC1D,eAAO,MAAM,aAAa,oGAUvB,kBAAkB,gCAiBpB,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { classNames } from '../../ClassNames/classNames.js';
3
+
4
+ const PasswordInput = ({ attributes, id, ariaLabel, ariaDescribedBy, visible, value, onChange, placeholder, invalid, }) => (jsx("input", { ...attributes, id: id, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, type: visible ? 'text' : 'password', value: value, onChange: (event) => onChange(event.currentTarget.value), placeholder: placeholder, "aria-invalid": invalid || undefined, "data-disabled": attributes?.disabled || undefined, "data-invalid": invalid || undefined, "data-readonly": attributes?.readOnly || undefined, className: classNames('cratis-field-input', 'cratis:w-full', attributes?.className), "data-cratis-part": 'input' }));
5
+
6
+ export { PasswordInput };
7
+ //# sourceMappingURL=PasswordInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PasswordInput.js","sources":["../../../../CommandForm/fields/PasswordInput.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { InputHTMLAttributes } from 'react';\nimport { classNames } from '../../ClassNames/classNames';\n\n/** Props for {@link PasswordInput}. */\nexport interface PasswordInputProps {\n /** The part attributes for the native input. */\n attributes?: InputHTMLAttributes<HTMLInputElement>;\n id: string | undefined;\n ariaLabel: string | undefined;\n ariaDescribedBy: string | undefined;\n visible: boolean;\n value: string;\n onChange: (value: string) => void;\n placeholder?: string;\n invalid?: boolean;\n}\n\n/** The native password/text input of a password field. */\nexport const PasswordInput = ({\n attributes,\n id,\n ariaLabel,\n ariaDescribedBy,\n visible,\n value,\n onChange,\n placeholder,\n invalid,\n}: PasswordInputProps) => (\n <input\n {...attributes}\n id={id}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedBy}\n type={visible ? 'text' : 'password'}\n value={value}\n onChange={(event) => onChange(event.currentTarget.value)}\n placeholder={placeholder}\n aria-invalid={invalid || undefined}\n data-disabled={attributes?.disabled || undefined}\n data-invalid={invalid || undefined}\n data-readonly={attributes?.readOnly || undefined}\n className={classNames('cratis-field-input', 'cratis:w-full', attributes?.className)}\n data-cratis-part='input'\n />\n);\n"],"names":["_jsx"],"mappings":";;;AAqBO,MAAM,aAAa,GAAG,CAAC,EAC1B,UAAU,EACV,EAAE,EACF,SAAS,EACT,eAAe,EACf,OAAO,EACP,KAAK,EACL,QAAQ,EACR,WAAW,EACX,OAAO,GACU,MACjBA,GAAA,CAAA,OAAA,EAAA,EAAA,GACQ,UAAU,EACd,EAAE,EAAE,EAAE,EAAA,YAAA,EACM,SAAS,EAAA,kBAAA,EACH,eAAe,EACjC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,UAAU,EACnC,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,EACxD,WAAW,EAAE,WAAW,EAAA,cAAA,EACV,OAAO,IAAI,SAAS,EAAA,eAAA,EACnB,UAAU,EAAE,QAAQ,IAAI,SAAS,kBAClC,OAAO,IAAI,SAAS,EAAA,eAAA,EACnB,UAAU,EAAE,QAAQ,IAAI,SAAS,EAChD,SAAS,EAAE,UAAU,CAAC,oBAAoB,EAAE,eAAe,EAAE,UAAU,EAAE,SAAS,CAAC,EAAA,kBAAA,EAClE,OAAO,EAAA,CAC1B;;"}
@@ -0,0 +1,15 @@
1
+ import type { HTMLAttributes, InputHTMLAttributes, ReactNode } from 'react';
2
+ /** Props for {@link PasswordRoot}. */
3
+ export interface PasswordRootProps {
4
+ /** The part attributes for the wrapper. */
5
+ attributes?: HTMLAttributes<HTMLDivElement>;
6
+ /** The part attributes of the input, whose state the wrapper mirrors. */
7
+ input?: InputHTMLAttributes<HTMLInputElement>;
8
+ className?: string;
9
+ invalid?: boolean;
10
+ onBlur?: () => void;
11
+ children: ReactNode;
12
+ }
13
+ /** The field wrapper of a password field. */
14
+ export declare const PasswordRoot: ({ attributes, input, className, invalid, onBlur, children }: PasswordRootProps) => import("react").JSX.Element;
15
+ //# sourceMappingURL=PasswordRoot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PasswordRoot.d.ts","sourceRoot":"","sources":["../../../../CommandForm/fields/PasswordRoot.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAG5E,sCAAsC;AACtC,MAAM,WAAW,iBAAiB;IAC9B,2CAA2C;IAC3C,UAAU,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;IAC5C,yEAAyE;IACzE,KAAK,CAAC,EAAE,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC;CACvB;AAED,6CAA6C;AAC7C,eAAO,MAAM,YAAY,gEAAiE,iBAAiB,gCAa1G,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { classNames } from '../../ClassNames/classNames.js';
3
+
4
+ const PasswordRoot = ({ attributes, input, className, invalid, onBlur, children }) => (jsx("div", { ...attributes, onBlur: onBlur, className: classNames('cratis-password-field', 'cratis:w-full', attributes?.className, className), "data-cratis-part": 'root', "data-cratis-component": 'PasswordField', "data-disabled": input?.disabled || undefined, "data-invalid": invalid || undefined, "data-readonly": input?.readOnly || undefined, children: children }));
5
+
6
+ export { PasswordRoot };
7
+ //# sourceMappingURL=PasswordRoot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PasswordRoot.js","sources":["../../../../CommandForm/fields/PasswordRoot.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { HTMLAttributes, InputHTMLAttributes, ReactNode } from 'react';\nimport { classNames } from '../../ClassNames/classNames';\n\n/** Props for {@link PasswordRoot}. */\nexport interface PasswordRootProps {\n /** The part attributes for the wrapper. */\n attributes?: HTMLAttributes<HTMLDivElement>;\n /** The part attributes of the input, whose state the wrapper mirrors. */\n input?: InputHTMLAttributes<HTMLInputElement>;\n className?: string;\n invalid?: boolean;\n onBlur?: () => void;\n children: ReactNode;\n}\n\n/** The field wrapper of a password field. */\nexport const PasswordRoot = ({ attributes, input, className, invalid, onBlur, children }: PasswordRootProps) => (\n <div\n {...attributes}\n onBlur={onBlur}\n className={classNames('cratis-password-field', 'cratis:w-full', attributes?.className, className)}\n data-cratis-part='root'\n data-cratis-component='PasswordField'\n data-disabled={input?.disabled || undefined}\n data-invalid={invalid || undefined}\n data-readonly={input?.readOnly || undefined}\n >\n {children}\n </div>\n);\n"],"names":["_jsx"],"mappings":";;;AAmBO,MAAM,YAAY,GAAG,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAqB,MACvGA,GAAA,CAAA,KAAA,EAAA,EAAA,GACQ,UAAU,EACd,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,UAAU,CAAC,uBAAuB,EAAE,eAAe,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,CAAC,EAAA,kBAAA,EAChF,MAAM,EAAA,uBAAA,EACD,eAAe,EAAA,eAAA,EACtB,KAAK,EAAE,QAAQ,IAAI,SAAS,EAAA,cAAA,EAC7B,OAAO,IAAI,SAAS,mBACnB,KAAK,EAAE,QAAQ,IAAI,SAAS,EAAA,QAAA,EAE1C,QAAQ,EAAA,CACP;;"}
@@ -0,0 +1,13 @@
1
+ import type { ButtonHTMLAttributes } from 'react';
2
+ /** Props for {@link PasswordToggle}. */
3
+ export interface PasswordToggleProps {
4
+ /** The part attributes for the toggle button. */
5
+ attributes?: ButtonHTMLAttributes<HTMLButtonElement>;
6
+ visible: boolean;
7
+ showLabel?: string;
8
+ hideLabel?: string;
9
+ onToggle: () => void;
10
+ }
11
+ /** The button that shows or hides the value of a password field. */
12
+ export declare const PasswordToggle: ({ attributes, visible, showLabel, hideLabel, onToggle }: PasswordToggleProps) => import("react").JSX.Element;
13
+ //# sourceMappingURL=PasswordToggle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PasswordToggle.d.ts","sourceRoot":"","sources":["../../../../CommandForm/fields/PasswordToggle.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAGlD,wCAAwC;AACxC,MAAM,WAAW,mBAAmB;IAChC,iDAAiD;IACjD,UAAU,CAAC,EAAE,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;IACrD,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,oEAAoE;AACpE,eAAO,MAAM,cAAc,4DAA6D,mBAAmB,gCAgB1G,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { classNames } from '../../ClassNames/classNames.js';
3
+
4
+ const PasswordToggle = ({ attributes, visible, showLabel, hideLabel, onToggle }) => (jsx("button", { ...attributes, type: 'button', className: classNames('cratis-password-field__toggle', attributes?.className), "data-cratis-part": 'toggle', "data-disabled": attributes?.disabled || undefined, "aria-label": visible
5
+ ? (hideLabel ?? 'Hide password')
6
+ : (showLabel ?? 'Show password'), onClick: onToggle, children: jsx("span", { "aria-hidden": 'true', children: visible ? '◉' : '○' }) }));
7
+
8
+ export { PasswordToggle };
9
+ //# sourceMappingURL=PasswordToggle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PasswordToggle.js","sources":["../../../../CommandForm/fields/PasswordToggle.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { ButtonHTMLAttributes } from 'react';\nimport { classNames } from '../../ClassNames/classNames';\n\n/** Props for {@link PasswordToggle}. */\nexport interface PasswordToggleProps {\n /** The part attributes for the toggle button. */\n attributes?: ButtonHTMLAttributes<HTMLButtonElement>;\n visible: boolean;\n showLabel?: string;\n hideLabel?: string;\n onToggle: () => void;\n}\n\n/** The button that shows or hides the value of a password field. */\nexport const PasswordToggle = ({ attributes, visible, showLabel, hideLabel, onToggle }: PasswordToggleProps) => (\n <button\n {...attributes}\n type='button'\n className={classNames('cratis-password-field__toggle', attributes?.className)}\n data-cratis-part='toggle'\n data-disabled={attributes?.disabled || undefined}\n aria-label={\n visible\n ? (hideLabel ?? 'Hide password')\n : (showLabel ?? 'Show password')\n }\n onClick={onToggle}\n >\n <span aria-hidden='true'>{visible ? '◉' : '○'}</span>\n </button>\n);\n"],"names":["_jsx"],"mappings":";;;MAiBa,cAAc,GAAG,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAuB,MACvGA,GAAA,CAAA,QAAA,EAAA,EAAA,GACQ,UAAU,EACd,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,UAAU,CAAC,+BAA+B,EAAE,UAAU,EAAE,SAAS,CAAC,EAAA,kBAAA,EAC5D,QAAQ,EAAA,eAAA,EACV,UAAU,EAAE,QAAQ,IAAI,SAAS,EAAA,YAAA,EAE5C;AACI,WAAG,SAAS,IAAI,eAAe;WAC5B,SAAS,IAAI,eAAe,CAAC,EAExC,OAAO,EAAE,QAAQ,EAAA,QAAA,EAEjBA,GAAA,CAAA,MAAA,EAAA,EAAA,aAAA,EAAkB,MAAM,YAAE,OAAO,GAAG,GAAG,GAAG,GAAG,EAAA,CAAQ,EAAA,CAChD;;"}
@@ -0,0 +1,19 @@
1
+ /** What {@link useChipsDraft} needs from the field. */
2
+ export interface ChipsDraftSource {
3
+ value: string[];
4
+ onChange: (value: string[]) => void;
5
+ separator?: string;
6
+ max?: number;
7
+ allowDuplicate?: boolean;
8
+ }
9
+ /**
10
+ * Holds the text being typed into a chips field and turns it into chips on commit.
11
+ * @param source The field value and the rules for adding to it.
12
+ * @returns The draft text, its setter, and the commit action.
13
+ */
14
+ export declare const useChipsDraft: ({ value, onChange, separator, max, allowDuplicate }: ChipsDraftSource) => {
15
+ draft: string;
16
+ setDraft: import("react").Dispatch<import("react").SetStateAction<string>>;
17
+ commit: () => void;
18
+ };
19
+ //# sourceMappingURL=useChipsDraft.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useChipsDraft.d.ts","sourceRoot":"","sources":["../../../../CommandForm/fields/useChipsDraft.ts"],"names":[],"mappings":"AAMA,uDAAuD;AACvD,MAAM,WAAW,gBAAgB;IAC7B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,cAAc,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;;;GAIG;AACH,eAAO,MAAM,aAAa,wDAAyD,gBAAgB;;;;CAalG,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { useState } from 'react';
2
+ import { appendChipCandidates } from './chipValues.js';
3
+
4
+ const useChipsDraft = ({ value, onChange, separator, max, allowDuplicate }) => {
5
+ const [draft, setDraft] = useState('');
6
+ const commit = () => {
7
+ const candidates = (separator ? draft.split(separator) : [draft])
8
+ .map((candidate) => candidate.trim())
9
+ .filter(Boolean);
10
+ if (candidates.length === 0)
11
+ return;
12
+ onChange(appendChipCandidates(value, candidates, max, allowDuplicate ?? false));
13
+ setDraft('');
14
+ };
15
+ return { draft, setDraft, commit };
16
+ };
17
+
18
+ export { useChipsDraft };
19
+ //# sourceMappingURL=useChipsDraft.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useChipsDraft.js","sources":["../../../../CommandForm/fields/useChipsDraft.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useState } from 'react';\nimport { appendChipCandidates } from './chipValues';\n\n/** What {@link useChipsDraft} needs from the field. */\nexport interface ChipsDraftSource {\n value: string[];\n onChange: (value: string[]) => void;\n separator?: string;\n max?: number;\n allowDuplicate?: boolean;\n}\n\n/**\n * Holds the text being typed into a chips field and turns it into chips on commit.\n * @param source The field value and the rules for adding to it.\n * @returns The draft text, its setter, and the commit action.\n */\nexport const useChipsDraft = ({ value, onChange, separator, max, allowDuplicate }: ChipsDraftSource) => {\n const [draft, setDraft] = useState('');\n\n const commit = () => {\n const candidates = (separator ? draft.split(separator) : [draft])\n .map((candidate) => candidate.trim())\n .filter(Boolean);\n if (candidates.length === 0) return;\n onChange(appendChipCandidates(value, candidates, max, allowDuplicate ?? false));\n setDraft('');\n };\n\n return { draft, setDraft, commit };\n};\n"],"names":[],"mappings":";;;AAoBO,MAAM,aAAa,GAAG,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,EAAE,cAAc,EAAoB,KAAI;IACnG,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC;IAEtC,MAAM,MAAM,GAAG,MAAK;AAChB,QAAA,MAAM,UAAU,GAAG,CAAC,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC;aAC3D,GAAG,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC,IAAI,EAAE;aACnC,MAAM,CAAC,OAAO,CAAC;AACpB,QAAA,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC;YAAE;AAC7B,QAAA,QAAQ,CAAC,o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KAAK,CAAC,EAAE,sBAAsB,CAAC;IAC/B;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,2BAA2B,CAAC;IAClD,mEAAmE;IACnE,OAAO,CAAC,EAAE,OAAO,GAAG,YAAY,CAAC;IACjC;;;OAGG;IACH,OAAO,CAAC,EAAE,kBAAkB,GAAG,SAAS,kBAAkB,EAAE,CAAC;IAC7D,iEAAiE;IACjE,WAAW,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IACnC,qFAAqF;IACrF,gBAAgB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACpC,sDAAsD;IACtD,kBAAkB,CAAC,EAAE,wBAAwB,CAAC;IAC9C;;;OAGG;IACH,aAAa,CAAC,EAAE,mBAAmB,CAAC;IACpC,2BAA2B;IAC3B,QAAQ,EAAE,SAAS,CAAC;CACvB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B,UAC7B,sBAAsB,GAAG,SAAS,KAC1C,sBAIF,CAAC;AAWF,8EAA8E;AAC9E,eAAO,MAAM,wBAAwB,kIAUlC,6BAA6B,gCA+B/B,CAAC"}
@@ -8,6 +8,7 @@ import { unstable_RendererRoot } from '../renderer/RendererContext.js';
8
8
  import { CratisComponentsContext } from '../configuration/CratisComponentsContext.js';
9
9
  export { useCratisComponentsConfig } from '../configuration/CratisComponentsContext.js';
10
10
  import { cratisDefaults } from '../configuration/CratisComponentsDefaults.js';
11
+ import { withLegacyLocaleMessages } from './legacyLocaleMessages.js';
11
12
 
12
13
  const RendererRoot = unstable_RendererRoot;
13
14
  const mergeCratisComponentsConfig = (value) => {
@@ -15,50 +16,6 @@ const mergeCratisComponentsConfig = (value) => {
15
16
  const merged = merge(cratisDefaults, rest);
16
17
  return icons ? { ...merged, icons: { ...cratisDefaults.icons, ...icons } } : merged;
17
18
  };
18
- const withLegacyLocaleMessages = (config, explicitMessages) => {
19
- const legacy = config.locale ? config.locales?.[config.locale] : undefined;
20
- if (!legacy)
21
- return config;
22
- return {
23
- ...config,
24
- messages: {
25
- ...config.messages,
26
- paginator: {
27
- ...config.messages?.paginator,
28
- navigation: explicitMessages?.paginator?.navigation ??
29
- legacy.aria?.navigation ??
30
- config.messages?.paginator?.navigation,
31
- first: explicitMessages?.paginator?.first ??
32
- legacy.aria?.firstPageLabel ??
33
- config.messages?.paginator?.first,
34
- previous: explicitMessages?.paginator?.previous ??
35
- legacy.aria?.prevPageLabel ??
36
- config.messages?.paginator?.previous,
37
- next: explicitMessages?.paginator?.next ??
38
- legacy.aria?.nextPageLabel ??
39
- config.messages?.paginator?.next,
40
- last: explicitMessages?.paginator?.last ??
41
- legacy.aria?.lastPageLabel ??
42
- config.messages?.paginator?.last,
43
- },
44
- datePicker: {
45
- ...config.messages?.datePicker,
46
- today: explicitMessages?.datePicker?.today ??
47
- legacy.today ??
48
- config.messages?.datePicker?.today,
49
- clear: explicitMessages?.datePicker?.clear ??
50
- legacy.clear ??
51
- config.messages?.datePicker?.clear,
52
- openCalendar: explicitMessages?.datePicker?.openCalendar ??
53
- config.messages?.datePicker?.openCalendar,
54
- previousMonth: explicitMessages?.datePicker?.previousMonth ??
55
- config.messages?.datePicker?.previousMonth,
56
- nextMonth: explicitMessages?.datePicker?.nextMonth ??
57
- config.messages?.datePicker?.nextMonth,
58
- },
59
- },
60
- };
61
- };
62
19
  const validLocale = (locale) => {
63
20
  if (!locale)
64
21
  return 'en-US';
@@ -1 +1 @@
1
- {"version":3,"file":"CratisComponentsProvider.js","sources":["../../../Common/CratisComponentsProvider.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useMemo, type ReactNode } from 'react';\nimport { I18nProvider } from 'react-aria-components/I18nProvider';\nimport { RouterProvider } from 'react-aria-components';\nimport { merge } from 'ts-deepmerge';\nimport { Toaster, type ToasterProps } from '../Notifications/Toaster';\nimport { unstable_RendererRoot } from '../renderer/RendererContext';\nimport type { CratisRendererSetup, unstable_UiLibrary } from '../renderer/manifest';\nimport type { CratisOverlayEnvironment } from '../renderer/overlayEnvironment';\nimport { CratisComponentsContext } from '../configuration/CratisComponentsContext';\nimport { cratisDefaults } from '../configuration/CratisComponentsDefaults';\nimport type { DialogHeaderActionsRenderer } from '../configuration/DialogHeaderActionsRenderer';\n\nconst RendererRoot = unstable_RendererRoot;\n\nexport { cratisDefaults } from '../configuration/CratisComponentsDefaults';\nexport { useCratisComponentsConfig } from '../configuration/CratisComponentsContext';\n\n/** Localizable labels owned by the Cratis paginator. */\nexport interface CratisPaginatorMessages {\n /** Pagination navigation-region name. */\n navigation?: string;\n /** First-page action label. */\n first?: string;\n /** Previous-page action label. */\n previous?: string;\n /** Next-page action label. */\n next?: string;\n /** Last-page action label. */\n last?: string;\n /** Builds a numbered page button's accessible name from its one-based page number. */\n page?: (page: number) => string;\n /** Accessible name for the numbered-page group. */\n pages?: string;\n /** Builds the visible range text from the one-based start, the clamped end and the total. Defaults to `start–end of total`. */\n range?: (start: number, end: number, total: number) => string;\n}\n\n/** Localizable labels owned by the Cratis date picker composition. */\nexport interface CratisDatePickerMessages {\n /** Today action label. */\n today?: string;\n /** Clear action label. */\n clear?: string;\n /** Calendar-trigger label. */\n openCalendar?: string;\n /** Previous-month action label. */\n previousMonth?: string;\n /** Next-month action label. */\n nextMonth?: string;\n /**\n * Accessible name for the segmented date input when neither an explicit\n * `aria-label` nor a `placeholder` is supplied. Previously an orphaned\n * `'Date'` literal with no override path.\n */\n label?: string;\n}\n\n/** Localizable labels owned by the Cratis {@link Dropdown} composition. */\nexport interface CratisDropdownMessages {\n /** Accessible name for the options-popover trigger. */\n showOptions?: string;\n /** Accessible name for the clear-selection action. */\n clearSelection?: string;\n}\n\n/**\n * Localizable action and dismissal labels shared by every Cratis-owned dialog\n * surface — {@link Dialog}, {@link CommandDialog}, and {@link StepperCommandDialog}.\n */\nexport interface CratisDialogMessages {\n /** Primary confirmation label (the `Ok` action in `DialogButtons.Ok*`). */\n ok?: string;\n /** Cancellation label (the `Cancel` action, and the Stepper footer Cancel). */\n cancel?: string;\n /** Affirmative label (the `Yes` action in `DialogButtons.YesNo*`). */\n yes?: string;\n /** Negative label (the `No` action in `DialogButtons.YesNo*`). */\n no?: string;\n /** Accessible name for the header close (×) action. */\n close?: string;\n /**\n * Polite announcement made when a confirm is refused and the dialog stays open\n * (validation failure or business rule). Defaults to\n * 'The action was not completed. Review the dialog and try again.'\n */\n refused?: string;\n}\n\n/** Localizable navigation labels owned by {@link CommandStepper} / {@link StepperCommandDialog}. */\nexport interface CratisStepperMessages {\n /** Advance-to-next-step action label. */\n next?: string;\n /** Return-to-previous-step action label. */\n previous?: string;\n /** Final-step submit action label. */\n submit?: string;\n}\n\n/** Localizable labels owned by the Cratis {@link Toaster}. */\nexport interface CratisNotificationsMessages {\n /** Accessible name for a toast's dismiss action. */\n dismiss?: string;\n /** Accessible name for the toast region landmark. */\n region?: string;\n}\n\n/** Localizable labels owned by the Cratis {@link DataTableCore} composition. */\nexport interface CratisDataTableMessages {\n /** Accessible name for a single-selection row control. */\n selectRow?: string;\n /** Accessible name for the select-all control in a multiple-selection header. */\n selectAllRows?: string;\n /** Placeholder for the loaded-page search input. */\n search?: string;\n /** Accessible name for the loaded-page search input. */\n searchAriaLabel?: string;\n /** Message shown while loading an empty table. */\n loading?: string;\n /** Message shown when a query fails. */\n failed?: string;\n /** Message shown when a query denies access. */\n unauthorized?: string;\n /** Message shown when a search or filter leaves no rows on the loaded page. */\n filteredEmpty?: string;\n /** Message shown when a search or filter leaves no rows in server mode. */\n filteredEmptyServer?: string;\n}\n\n/** Localizable accessible names for the Cratis filter panel and its searches. */\nexport interface CratisFilterMessages {\n /** FilterPanel dialog name. Defaults to 'Filters'. */\n label?: string;\n /**\n * Search-input name for FilterPanel, its option groups, and standalone CheckboxListFilter.\n * Unset by default so an effective search placeholder retains precedence over 'Search'.\n * PivotViewer supplies group-specific names instead of using this shared name for its groups.\n */\n searchAriaLabel?: string;\n}\n\n/** Localizable labels owned by the Cratis column-filter popup. */\nexport interface CratisColumnFilterMessages {\n /** Builds the filter-trigger accessible name from the effective field. */\n filterTriggerAriaLabel?: (field: string) => string;\n /** Builds the value-control accessible name from the effective field. */\n valueAriaLabel?: (field: string) => string;\n /** Accessible name for the match-mode selector. */\n matchModeAriaLabel?: string;\n /** Localizes a match mode while retaining its default label as fallback input. */\n matchModeLabel?: (mode: string, defaultLabel: string) => string;\n /** Clear action label. */\n clear?: string;\n /** Apply action label. */\n apply?: string;\n /** Boolean true option label. */\n true?: string;\n /** Boolean false option label. */\n false?: string;\n}\n\n/** Localizable labels owned by the Cratis {@link Toolbar} composition. */\nexport interface CratisToolbarMessages {\n /** Accessible toolbar name used when neither `aria-label` nor `aria-labelledby` is supplied. */\n label?: string;\n /** Accessible name of the close button in a drawer {@link ToolbarFolder}. Defaults to 'Close'. */\n closeDrawer?: string;\n}\n\n/** Components-owned message groups. */\nexport interface CratisComponentsMessages {\n /** Paginator labels. */\n paginator?: CratisPaginatorMessages;\n /** Date-picker labels. */\n datePicker?: CratisDatePickerMessages;\n /** Dropdown labels. */\n dropdown?: CratisDropdownMessages;\n /** Dialog action/dismissal labels shared by Dialog, CommandDialog, and StepperCommandDialog. */\n dialog?: CratisDialogMessages;\n /** Stepper navigation labels shared by CommandStepper and StepperCommandDialog. */\n stepper?: CratisStepperMessages;\n /** Toaster labels. */\n notifications?: CratisNotificationsMessages;\n /** DataTable search, selection, and query-state messages. */\n dataTable?: CratisDataTableMessages;\n /** FilterPanel dialog and search-input accessible names. */\n filter?: CratisFilterMessages;\n /** Column-filter popup labels and match-mode copy. */\n columnFilter?: CratisColumnFilterMessages;\n /** Toolbar accessible-name fallback. */\n toolbar?: CratisToolbarMessages;\n}\n\n/**\n * Components-owned icon vocabulary. Every name is a concept the library draws in more than one\n * place; registering one replaces that concept's built-in glyph everywhere it is drawn, without\n * touching the surrounding element, its part, or its accessible name.\n *\n * Resolution per site is `per-component prop → provider icon → built-in glyph`: a named prop such\n * as `Dialog`'s `closeIcon` means \"this one call site\" and keeps winning, while the provider\n * replaces the built-in default for the whole product. Registering nothing renders exactly what the\n * library renders today, because the built-in glyph stays at its call site and is never part of\n * {@link cratisDefaults}.\n *\n * A name registered as `null` draws no glyph while the button, its part, and its accessible name\n * remain — the same meaning `closeIcon={null}` already has.\n */\nexport interface CratisComponentsIcons {\n /** Dismissal mark. Drawn by `Dialog`'s header close, `Toaster`'s dismiss, `ChatSidebar`, the `Chat` panel, and the PivotViewer detail panel. Defaults to `×`. */\n close?: ReactNode;\n /** Remove-this-value mark. Drawn by `TagGroup`'s tag remove, `Chip`'s remove control, and `CommandForm`'s chips field. Defaults to `×`. */\n remove?: ReactNode;\n /** Expand/collapse chevron on a closed-by-default surface. Drawn by `Dropdown`'s trigger and `ComboBox`'s trigger. Defaults to `⌄` (`▾` in `ComboBox`). */\n expand?: ReactNode;\n /** Ascending sort indicator. Drawn by `DataTableCore`'s sortable column header. Defaults to `▲`. */\n sortAscending?: ReactNode;\n /** Descending sort indicator. Drawn by `DataTableCore`'s sortable column header. Defaults to `▼`. */\n sortDescending?: ReactNode;\n /** Step-backwards mark. Drawn by `TablePaginator`'s previous page and the date picker's previous month. Defaults to `‹`. */\n previous?: ReactNode;\n /** Step-forwards mark. Drawn by `TablePaginator`'s next page and the date picker's next month. Defaults to `›`. */\n next?: ReactNode;\n /** Clear-the-current-value mark. Drawn by `Dropdown`'s clear-selection action and the PivotViewer filter panel's clear action. Defaults to `×`. */\n clear?: ReactNode;\n}\n\ninterface LegacyLocaleMessages {\n today?: string;\n clear?: string;\n aria?: {\n navigation?: string;\n firstPageLabel?: string;\n prevPageLabel?: string;\n nextPageLabel?: string;\n lastPageLabel?: string;\n };\n [message: string]: unknown;\n}\n\n/** Application routing callbacks used by Components links. */\nexport interface CratisComponentsRouter {\n /** Navigate to the original link destination for an ordinary same-origin activation. */\n navigate: (href: string) => void;\n /** Resolve a destination to the rendered href, for example to include a router basename. */\n useHref?: (href: string) => string;\n}\n\n/** Renderer-independent application configuration for Components. */\nexport interface CratisComponentsConfig {\n /** Optional client-side router. Omit to retain native or inherited routing behavior. */\n router?: CratisComponentsRouter;\n /** BCP 47 locale used by React Aria for dates, numbers, and interaction announcements. */\n locale?: string;\n /** Cratis-owned labels not supplied by the platform's internationalization APIs. */\n messages?: CratisComponentsMessages;\n /** Cratis-owned icon vocabulary replacing the built-in glyphs the library draws. */\n icons?: CratisComponentsIcons;\n /**\n * App-wide dialog header actions, set through the provider's `dialogHeaderActions` prop. Read by\n * `Dialog`, `CommandDialog` and `StepperCommandDialog`.\n */\n dialogHeaderActions?: DialogHeaderActionsRenderer;\n /**\n * @deprecated Use {@link messages}; React Aria supplies its own locale data.\n */\n locales?: Record<string, LegacyLocaleMessages>;\n}\n\n/** Props for the application-root Components provider. */\nexport interface CratisComponentsProviderProps {\n /** Locale and Components-owned messages. */\n value?: CratisComponentsConfig;\n /**\n * Registers header actions once for every dialog. The renderer receives each dialog's\n * `DialogHeaderContext`, and may return `null` to hide itself for that dialog. The result\n * renders before the close button, next to any per-dialog `headerActions`; a dialog opts out\n * with `hideGlobalHeaderActions`.\n */\n dialogHeaderActions?: DialogHeaderActionsRenderer;\n /** Mounts the global toaster with defaults or explicit options. */\n toaster?: boolean | ToasterProps;\n /**\n * Selects one stable presentation library. The broader generic manifest and ordered,\n * last-wins composition form remain experimental.\n */\n library?: unstable_UiLibrary | readonly unstable_UiLibrary[];\n /** Experimental profile-promise behavior. Defaults to strict. */\n libraryMode?: 'strict' | 'degrade';\n /** Terminal slot fallback behavior. Defaults to the built-in Core implementation. */\n rendererFallback?: 'core' | 'throw';\n /** Host environment for overlay portal containers. */\n overlayEnvironment?: CratisOverlayEnvironment;\n /**\n * Non-secret renderer setup attestations. Values are booleans so credentials and license\n * tokens never cross the Components provider boundary.\n */\n rendererSetup?: CratisRendererSetup;\n /** Application content. */\n children: ReactNode;\n}\n\n/**\n * Deep-merges consumer configuration over {@link cratisDefaults}.\n *\n * `icons` merges by name only. An icon value is an opaque node — often a React element — so it is\n * carried over by identity instead of being deep-merged into, while a partial map still leaves every\n * unregistered name to its built-in glyph.\n */\nexport const mergeCratisComponentsConfig = (\n value: CratisComponentsConfig | undefined,\n): CratisComponentsConfig => {\n const { icons, ...rest } = value ?? {};\n const merged = merge(cratisDefaults, rest) as CratisComponentsConfig;\n return icons ? { ...merged, icons: { ...cratisDefaults.icons, ...icons } } : merged;\n};\n\nconst withLegacyLocaleMessages = (\n config: CratisComponentsConfig,\n explicitMessages: CratisComponentsMessages | undefined,\n): CratisComponentsConfig => {\n const legacy = config.locale ? config.locales?.[config.locale] : undefined;\n if (!legacy) return config;\n return {\n ...config,\n messages: {\n ...config.messages,\n paginator: {\n ...config.messages?.paginator,\n navigation:\n explicitMessages?.paginator?.navigation ??\n legacy.aria?.navigation ??\n config.messages?.paginator?.navigation,\n first:\n explicitMessages?.paginator?.first ??\n legacy.aria?.firstPageLabel ??\n config.messages?.paginator?.first,\n previous:\n explicitMessages?.paginator?.previous ??\n legacy.aria?.prevPageLabel ??\n config.messages?.paginator?.previous,\n next:\n explicitMessages?.paginator?.next ??\n legacy.aria?.nextPageLabel ??\n config.messages?.paginator?.next,\n last:\n explicitMessages?.paginator?.last ??\n legacy.aria?.lastPageLabel ??\n config.messages?.paginator?.last,\n },\n datePicker: {\n ...config.messages?.datePicker,\n today:\n explicitMessages?.datePicker?.today ??\n legacy.today ??\n config.messages?.datePicker?.today,\n clear:\n explicitMessages?.datePicker?.clear ??\n legacy.clear ??\n config.messages?.datePicker?.clear,\n openCalendar:\n explicitMessages?.datePicker?.openCalendar ??\n config.messages?.datePicker?.openCalendar,\n previousMonth:\n explicitMessages?.datePicker?.previousMonth ??\n config.messages?.datePicker?.previousMonth,\n nextMonth:\n explicitMessages?.datePicker?.nextMonth ??\n config.messages?.datePicker?.nextMonth,\n },\n },\n };\n};\n\nconst validLocale = (locale: string | undefined) => {\n if (!locale) return 'en-US';\n try {\n return new Intl.Locale(locale).toString();\n } catch {\n return 'en-US';\n }\n};\n\n/** Application root for locale, labels, and the optional app-wide toaster. */\nexport const CratisComponentsProvider = ({\n value,\n dialogHeaderActions,\n toaster,\n library,\n libraryMode,\n rendererFallback,\n overlayEnvironment,\n rendererSetup,\n children,\n}: CratisComponentsProviderProps) => {\n const resolved = useMemo(() => {\n const config = withLegacyLocaleMessages(mergeCratisComponentsConfig(value), value?.messages);\n const headerActions = dialogHeaderActions ?? value?.dialogHeaderActions;\n return headerActions ? { ...config, dialogHeaderActions: headerActions } : config;\n }, [value, dialogHeaderActions]);\n\n const content = (\n <I18nProvider locale={validLocale(resolved.locale)}>\n {children}\n {toaster && <Toaster {...(typeof toaster === 'object' ? toaster : {})} />}\n </I18nProvider>\n );\n\n return (\n <RendererRoot\n library={library}\n libraryMode={libraryMode}\n rendererFallback={rendererFallback}\n overlayEnvironment={overlayEnvironment}\n rendererSetup={rendererSetup}\n >\n <CratisComponentsContext.Provider value={resolved}>\n {resolved.router ? (\n <RouterProvider navigate={resolved.router.navigate} useHref={resolved.router.useHref}>\n {content}\n </RouterProvider>\n ) : content}\n </CratisComponentsContext.Provider>\n </RendererRoot>\n );\n};\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;;AAeA,MAAM,YAAY,GAAG,qBAAqB;AAuSnC,MAAM,2BAA2B,GAAG,CACvC,KAAyC,KACjB;IACxB,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,IAAI,EAAE;IACtC,MAAM,MAAM,GAAG,KAAK,CAAC,cAAc,EAAE,IAAI,CAA2B;IACpE,OAAO,KAAK,GAAG,EAAE,GAAG,MAAM,EAAE,KAAK,EAAE,EAAE,GAAG,cAAc,CAAC,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,MAAM;AACvF;AAEA,MAAM,wBAAwB,GAAG,CAC7B,MAA8B,EAC9B,gBAAsD,KAC9B;IACxB,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC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AE,aAAa,EAAE,GAAG,MAAM;AACrF,IAAA,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,CAAC,CAAC;AAEhC,IAAA,MAAM,OAAO,IACTA,IAAA,CAAC,YAAY,IAAC,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAA,QAAA,EAAA,CAC7C,QAAQ,EACR,OAAO,IAAIC,GAAA,CAAC,OAAO,QAAM,OAAO,OAAO,KAAK,QAAQ,GAAG,OAAO,GAAG,EAAE,CAAC,EAAA,CAAI,CAAA,EAAA,CAC9D,CAClB;AAED,IAAA,QACIA,GAAA,CAAC,YAAY,EAAA,EACT,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,EACxB,gBAAgB,EAAE,gBAAgB,EAClC,kBAAkB,EAAE,kBAAkB,EACtC,aAAa,EAAE,aAAa,EAAA,QAAA,EAE5BA,GAAA,CAAC,uBAAuB,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,QAAQ,EAAA,QAAA,EAC5C,QAAQ,CAAC,MAAM,IACZA,IAAC,cAAc,EAAA,EAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,OAAO,YAC/E,OAAO,EAAA,CACK,IACjB,OAAO,EAAA,CACoB,EAAA,CACxB;AAEvB;;"}
1
+ {"version":3,"file":"CratisComponentsProvider.js","sources":["../../../Common/CratisComponentsProvider.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useMemo, type ReactNode } from 'react';\nimport { I18nProvider } from 'react-aria-components/I18nProvider';\nimport { RouterProvider } from 'react-aria-components';\nimport { merge } from 'ts-deepmerge';\nimport { Toaster, type ToasterProps } from '../Notifications/Toaster';\nimport { unstable_RendererRoot } from '../renderer/RendererContext';\nimport type { CratisRendererSetup, unstable_UiLibrary } from '../renderer/manifest';\nimport type { CratisOverlayEnvironment } from '../renderer/overlayEnvironment';\nimport { CratisComponentsContext } from '../configuration/CratisComponentsContext';\nimport { cratisDefaults } from '../configuration/CratisComponentsDefaults';\nimport type { DialogHeaderActionsRenderer } from '../configuration/DialogHeaderActionsRenderer';\nimport { withLegacyLocaleMessages } from './legacyLocaleMessages';\n\nconst RendererRoot = unstable_RendererRoot;\n\nexport { cratisDefaults } from '../configuration/CratisComponentsDefaults';\nexport { useCratisComponentsConfig } from '../configuration/CratisComponentsContext';\n\n/** Localizable labels owned by the Cratis paginator. */\nexport interface CratisPaginatorMessages {\n /** Pagination navigation-region name. */\n navigation?: string;\n /** First-page action label. */\n first?: string;\n /** Previous-page action label. */\n previous?: string;\n /** Next-page action label. */\n next?: string;\n /** Last-page action label. */\n last?: string;\n /** Builds a numbered page button's accessible name from its one-based page number. */\n page?: (page: number) => string;\n /** Accessible name for the numbered-page group. */\n pages?: string;\n /** Builds the visible range text from the one-based start, the clamped end and the total. Defaults to `start–end of total`. */\n range?: (start: number, end: number, total: number) => string;\n}\n\n/** Localizable labels owned by the Cratis date picker composition. */\nexport interface CratisDatePickerMessages {\n /** Today action label. */\n today?: string;\n /** Clear action label. */\n clear?: string;\n /** Calendar-trigger label. */\n openCalendar?: string;\n /** Previous-month action label. */\n previousMonth?: string;\n /** Next-month action label. */\n nextMonth?: string;\n /**\n * Accessible name for the segmented date input when neither an explicit\n * `aria-label` nor a `placeholder` is supplied. Previously an orphaned\n * `'Date'` literal with no override path.\n */\n label?: string;\n}\n\n/** Localizable labels owned by the Cratis {@link Dropdown} composition. */\nexport interface CratisDropdownMessages {\n /** Accessible name for the options-popover trigger. */\n showOptions?: string;\n /** Accessible name for the clear-selection action. */\n clearSelection?: string;\n}\n\n/**\n * Localizable action and dismissal labels shared by every Cratis-owned dialog\n * surface — {@link Dialog}, {@link CommandDialog}, and {@link StepperCommandDialog}.\n */\nexport interface CratisDialogMessages {\n /** Primary confirmation label (the `Ok` action in `DialogButtons.Ok*`). */\n ok?: string;\n /** Cancellation label (the `Cancel` action, and the Stepper footer Cancel). */\n cancel?: string;\n /** Affirmative label (the `Yes` action in `DialogButtons.YesNo*`). */\n yes?: string;\n /** Negative label (the `No` action in `DialogButtons.YesNo*`). */\n no?: string;\n /** Accessible name for the header close (×) action. */\n close?: string;\n /**\n * Polite announcement made when a confirm is refused and the dialog stays open\n * (validation failure or business rule). Defaults to\n * 'The action was not completed. Review the dialog and try again.'\n */\n refused?: string;\n}\n\n/** Localizable navigation labels owned by {@link CommandStepper} / {@link StepperCommandDialog}. */\nexport interface CratisStepperMessages {\n /** Advance-to-next-step action label. */\n next?: string;\n /** Return-to-previous-step action label. */\n previous?: string;\n /** Final-step submit action label. */\n submit?: string;\n}\n\n/** Localizable labels owned by the Cratis {@link Toaster}. */\nexport interface CratisNotificationsMessages {\n /** Accessible name for a toast's dismiss action. */\n dismiss?: string;\n /** Accessible name for the toast region landmark. */\n region?: string;\n}\n\n/** Localizable labels owned by the Cratis {@link DataTableCore} composition. */\nexport interface CratisDataTableMessages {\n /** Accessible name for a single-selection row control. */\n selectRow?: string;\n /** Accessible name for the select-all control in a multiple-selection header. */\n selectAllRows?: string;\n /** Placeholder for the loaded-page search input. */\n search?: string;\n /** Accessible name for the loaded-page search input. */\n searchAriaLabel?: string;\n /** Message shown while loading an empty table. */\n loading?: string;\n /** Message shown when a query fails. */\n failed?: string;\n /** Message shown when a query denies access. */\n unauthorized?: string;\n /** Message shown when a search or filter leaves no rows on the loaded page. */\n filteredEmpty?: string;\n /** Message shown when a search or filter leaves no rows in server mode. */\n filteredEmptyServer?: string;\n}\n\n/** Localizable accessible names for the Cratis filter panel and its searches. */\nexport interface CratisFilterMessages {\n /** FilterPanel dialog name. Defaults to 'Filters'. */\n label?: string;\n /**\n * Search-input name for FilterPanel, its option groups, and standalone CheckboxListFilter.\n * Unset by default so an effective search placeholder retains precedence over 'Search'.\n * PivotViewer supplies group-specific names instead of using this shared name for its groups.\n */\n searchAriaLabel?: string;\n}\n\n/** Localizable labels owned by the Cratis column-filter popup. */\nexport interface CratisColumnFilterMessages {\n /** Builds the filter-trigger accessible name from the effective field. */\n filterTriggerAriaLabel?: (field: string) => string;\n /** Builds the value-control accessible name from the effective field. */\n valueAriaLabel?: (field: string) => string;\n /** Accessible name for the match-mode selector. */\n matchModeAriaLabel?: string;\n /** Localizes a match mode while retaining its default label as fallback input. */\n matchModeLabel?: (mode: string, defaultLabel: string) => string;\n /** Clear action label. */\n clear?: string;\n /** Apply action label. */\n apply?: string;\n /** Boolean true option label. */\n true?: string;\n /** Boolean false option label. */\n false?: string;\n}\n\n/** Localizable labels owned by the Cratis {@link Toolbar} composition. */\nexport interface CratisToolbarMessages {\n /** Accessible toolbar name used when neither `aria-label` nor `aria-labelledby` is supplied. */\n label?: string;\n /** Accessible name of the close button in a drawer {@link ToolbarFolder}. Defaults to 'Close'. */\n closeDrawer?: string;\n}\n\n/** Components-owned message groups. */\nexport interface CratisComponentsMessages {\n /** Paginator labels. */\n paginator?: CratisPaginatorMessages;\n /** Date-picker labels. */\n datePicker?: CratisDatePickerMessages;\n /** Dropdown labels. */\n dropdown?: CratisDropdownMessages;\n /** Dialog action/dismissal labels shared by Dialog, CommandDialog, and StepperCommandDialog. */\n dialog?: CratisDialogMessages;\n /** Stepper navigation labels shared by CommandStepper and StepperCommandDialog. */\n stepper?: CratisStepperMessages;\n /** Toaster labels. */\n notifications?: CratisNotificationsMessages;\n /** DataTable search, selection, and query-state messages. */\n dataTable?: CratisDataTableMessages;\n /** FilterPanel dialog and search-input accessible names. */\n filter?: CratisFilterMessages;\n /** Column-filter popup labels and match-mode copy. */\n columnFilter?: CratisColumnFilterMessages;\n /** Toolbar accessible-name fallback. */\n toolbar?: CratisToolbarMessages;\n}\n\n/**\n * Components-owned icon vocabulary. Every name is a concept the library draws in more than one\n * place; registering one replaces that concept's built-in glyph everywhere it is drawn, without\n * touching the surrounding element, its part, or its accessible name.\n *\n * Resolution per site is `per-component prop → provider icon → built-in glyph`: a named prop such\n * as `Dialog`'s `closeIcon` means \"this one call site\" and keeps winning, while the provider\n * replaces the built-in default for the whole product. Registering nothing renders exactly what the\n * library renders today, because the built-in glyph stays at its call site and is never part of\n * {@link cratisDefaults}.\n *\n * A name registered as `null` draws no glyph while the button, its part, and its accessible name\n * remain — the same meaning `closeIcon={null}` already has.\n */\nexport interface CratisComponentsIcons {\n /** Dismissal mark. Drawn by `Dialog`'s header close, `Toaster`'s dismiss, `ChatSidebar`, the `Chat` panel, and the PivotViewer detail panel. Defaults to `×`. */\n close?: ReactNode;\n /** Remove-this-value mark. Drawn by `TagGroup`'s tag remove, `Chip`'s remove control, and `CommandForm`'s chips field. Defaults to `×`. */\n remove?: ReactNode;\n /** Expand/collapse chevron on a closed-by-default surface. Drawn by `Dropdown`'s trigger and `ComboBox`'s trigger. Defaults to `⌄` (`▾` in `ComboBox`). */\n expand?: ReactNode;\n /** Ascending sort indicator. Drawn by `DataTableCore`'s sortable column header. Defaults to `▲`. */\n sortAscending?: ReactNode;\n /** Descending sort indicator. Drawn by `DataTableCore`'s sortable column header. Defaults to `▼`. */\n sortDescending?: ReactNode;\n /** Step-backwards mark. Drawn by `TablePaginator`'s previous page and the date picker's previous month. Defaults to `‹`. */\n previous?: ReactNode;\n /** Step-forwards mark. Drawn by `TablePaginator`'s next page and the date picker's next month. Defaults to `›`. */\n next?: ReactNode;\n /** Clear-the-current-value mark. Drawn by `Dropdown`'s clear-selection action and the PivotViewer filter panel's clear action. Defaults to `×`. */\n clear?: ReactNode;\n}\n\ninterface LegacyLocaleMessages {\n today?: string;\n clear?: string;\n aria?: {\n navigation?: string;\n firstPageLabel?: string;\n prevPageLabel?: string;\n nextPageLabel?: string;\n lastPageLabel?: string;\n };\n [message: string]: unknown;\n}\n\n/** Application routing callbacks used by Components links. */\nexport interface CratisComponentsRouter {\n /** Navigate to the original link destination for an ordinary same-origin activation. */\n navigate: (href: string) => void;\n /** Resolve a destination to the rendered href, for example to include a router basename. */\n useHref?: (href: string) => string;\n}\n\n/** Renderer-independent application configuration for Components. */\nexport interface CratisComponentsConfig {\n /** Optional client-side router. Omit to retain native or inherited routing behavior. */\n router?: CratisComponentsRouter;\n /** BCP 47 locale used by React Aria for dates, numbers, and interaction announcements. */\n locale?: string;\n /** Cratis-owned labels not supplied by the platform's internationalization APIs. */\n messages?: CratisComponentsMessages;\n /** Cratis-owned icon vocabulary replacing the built-in glyphs the library draws. */\n icons?: CratisComponentsIcons;\n /**\n * App-wide dialog header actions, set through the provider's `dialogHeaderActions` prop. Read by\n * `Dialog`, `CommandDialog` and `StepperCommandDialog`.\n */\n dialogHeaderActions?: DialogHeaderActionsRenderer;\n /**\n * @deprecated Use {@link messages}; React Aria supplies its own locale data.\n */\n locales?: Record<string, LegacyLocaleMessages>;\n}\n\n/** Props for the application-root Components provider. */\nexport interface CratisComponentsProviderProps {\n /** Locale and Components-owned messages. */\n value?: CratisComponentsConfig;\n /**\n * Registers header actions once for every dialog. The renderer receives each dialog's\n * `DialogHeaderContext`, and may return `null` to hide itself for that dialog. The result\n * renders before the close button, next to any per-dialog `headerActions`; a dialog opts out\n * with `hideGlobalHeaderActions`.\n */\n dialogHeaderActions?: DialogHeaderActionsRenderer;\n /** Mounts the global toaster with defaults or explicit options. */\n toaster?: boolean | ToasterProps;\n /**\n * Selects one stable presentation library. The broader generic manifest and ordered,\n * last-wins composition form remain experimental.\n */\n library?: unstable_UiLibrary | readonly unstable_UiLibrary[];\n /** Experimental profile-promise behavior. Defaults to strict. */\n libraryMode?: 'strict' | 'degrade';\n /** Terminal slot fallback behavior. Defaults to the built-in Core implementation. */\n rendererFallback?: 'core' | 'throw';\n /** Host environment for overlay portal containers. */\n overlayEnvironment?: CratisOverlayEnvironment;\n /**\n * Non-secret renderer setup attestations. Values are booleans so credentials and license\n * tokens never cross the Components provider boundary.\n */\n rendererSetup?: CratisRendererSetup;\n /** Application content. */\n children: ReactNode;\n}\n\n/**\n * Deep-merges consumer configuration over {@link cratisDefaults}.\n *\n * `icons` merges by name only. An icon value is an opaque node — often a React element — so it is\n * carried over by identity instead of being deep-merged into, while a partial map still leaves every\n * unregistered name to its built-in glyph.\n */\nexport const mergeCratisComponentsConfig = (\n value: CratisComponentsConfig | undefined,\n): CratisComponentsConfig => {\n const { icons, ...rest } = value ?? {};\n const merged = merge(cratisDefaults, rest) as CratisComponentsConfig;\n return icons ? { ...merged, icons: { ...cratisDefaults.icons, ...icons } } : merged;\n};\n\nconst validLocale = (locale: string | undefined) => {\n if (!locale) return 'en-US';\n try {\n return new Intl.Locale(locale).toString();\n } catch {\n return 'en-US';\n }\n};\n\n/** Application root for locale, labels, and the optional app-wide toaster. */\nexport const CratisComponentsProvider = ({\n value,\n dialogHeaderActions,\n toaster,\n library,\n libraryMode,\n rendererFallback,\n overlayEnvironment,\n rendererSetup,\n children,\n}: CratisComponentsProviderProps) => {\n const resolved = useMemo(() => {\n const config = withLegacyLocaleMessages(mergeCratisComponentsConfig(value), value?.messages);\n const headerActions = dialogHeaderActions ?? value?.dialogHeaderActions;\n return headerActions ? { ...config, dialogHeaderActions: headerActions } : config;\n }, [value, dialogHeaderActions]);\n\n const content = (\n <I18nProvider locale={validLocale(resolved.locale)}>\n {children}\n {toaster && <Toaster {...(typeof toaster === 'object' ? toaster : {})} />}\n </I18nProvider>\n );\n\n return (\n <RendererRoot\n library={library}\n libraryMode={libraryMode}\n rendererFallback={rendererFallback}\n overlayEnvironment={overlayEnvironment}\n rendererSetup={rendererSetup}\n >\n <CratisComponentsContext.Provider value={resolved}>\n {resolved.router ? (\n <RouterProvider navigate={resolved.router.navigate} useHref={resolved.router.useHref}>\n {content}\n </RouterProvider>\n ) : content}\n </CratisComponentsContext.Provider>\n </RendererRoot>\n );\n};\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;;;AAgBA,MAAM,YAAY,GAAG,qBAAqB;AAuSnC,MAAM,2BAA2B,GAAG,CACvC,KAAyC,KACjB;IACxB,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,GAAG,KA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AAC,EAAA,CAAI,CAAA,EAAA,CAC9D,CAClB;AAED,IAAA,QACIA,GAAA,CAAC,YAAY,EAAA,EACT,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,EACxB,gBAAgB,EAAE,gBAAgB,EAClC,kBAAkB,EAAE,kBAAkB,EACtC,aAAa,EAAE,aAAa,EAAA,QAAA,EAE5BA,GAAA,CAAC,uBAAuB,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,QAAQ,EAAA,QAAA,EAC5C,QAAQ,CAAC,MAAM,IACZA,IAAC,cAAc,EAAA,EAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,OAAO,YAC/E,OAAO,EAAA,CACK,IACjB,OAAO,EAAA,CACoB,EAAA,CACxB;AAEvB;;"}
@@ -0,0 +1,7 @@
1
+ import type { CratisComponentsConfig, CratisComponentsMessages } from './CratisComponentsProvider.js';
2
+ /**
3
+ * Folds the deprecated `locales` entry for the active locale into `messages`; an explicitly supplied
4
+ * message wins over the legacy entry, which wins over the already merged message.
5
+ */
6
+ export declare const withLegacyLocaleMessages: (config: CratisComponentsConfig, explicitMessages: CratisComponentsMessages | undefined) => CratisComponentsConfig;
7
+ //# sourceMappingURL=legacyLocaleMessages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legacyLocaleMessages.d.ts","sourceRoot":"","sources":["../../../Common/legacyLocaleMessages.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACR,sBAAsB,EACtB,wBAAwB,EAG3B,MAAM,+BAA4B,CAAC;AA4CpC;;;GAGG;AACH,eAAO,MAAM,wBAAwB,WACzB,sBAAsB,oBACZ,wBAAwB,GAAG,SAAS,KACvD,sBAgBF,CAAC"}