@orianatech/pire 2.1.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (233) hide show
  1. package/dist/components/core/Avatar.d.ts +0 -1
  2. package/dist/components/core/Badge.d.cts +2 -5
  3. package/dist/components/core/Badge.d.ts +2 -6
  4. package/dist/components/core/Button.d.ts +0 -1
  5. package/dist/components/core/Card.d.ts +0 -1
  6. package/dist/components/core/ComingSoonMark.d.ts +0 -1
  7. package/dist/components/core/Heading.d.cts +1 -1
  8. package/dist/components/core/Heading.d.ts +1 -2
  9. package/dist/components/core/Icon.d.cts +1 -2
  10. package/dist/components/core/Icon.d.ts +1 -3
  11. package/dist/components/core/IconButton.d.ts +0 -1
  12. package/dist/components/core/Kbd.d.ts +0 -1
  13. package/dist/components/core/Link.d.ts +0 -1
  14. package/dist/components/core/SegmentedControl.d.cts +1 -1
  15. package/dist/components/core/SegmentedControl.d.ts +1 -2
  16. package/dist/components/core/Separator.d.ts +0 -1
  17. package/dist/components/core/Tag.d.cts +1 -1
  18. package/dist/components/core/Tag.d.ts +1 -2
  19. package/dist/components/core/Text.d.cts +9 -1
  20. package/dist/components/core/Text.d.ts +9 -2
  21. package/dist/components/core/icon-data.generated.d.ts +0 -1
  22. package/dist/components/core/icon-map.d.ts +0 -1
  23. package/dist/components/data/BarChart.d.cts +1 -1
  24. package/dist/components/data/BarChart.d.ts +1 -2
  25. package/dist/components/data/BarList.d.ts +0 -1
  26. package/dist/components/data/ChartFrame.d.ts +0 -1
  27. package/dist/components/data/DataTable.d.cts +9 -3
  28. package/dist/components/data/DataTable.d.ts +9 -4
  29. package/dist/components/data/DescriptionList.d.ts +0 -1
  30. package/dist/components/data/DonutChart.d.cts +1 -1
  31. package/dist/components/data/DonutChart.d.ts +1 -2
  32. package/dist/components/data/FilterBar.d.ts +0 -1
  33. package/dist/components/data/KpiTile.d.ts +0 -1
  34. package/dist/components/data/LineChart.d.cts +1 -1
  35. package/dist/components/data/LineChart.d.ts +1 -2
  36. package/dist/components/data/LinkList.d.ts +0 -1
  37. package/dist/components/data/ObjectHeader.d.ts +0 -1
  38. package/dist/components/data/RecordCard.d.ts +0 -1
  39. package/dist/components/data/Timeline.d.cts +1 -1
  40. package/dist/components/data/Timeline.d.ts +1 -2
  41. package/dist/components/data/ViewSwitcher.d.ts +0 -1
  42. package/dist/components/data/chartGeometry.d.ts +0 -1
  43. package/dist/components/feedback/Dialog.d.cts +11 -0
  44. package/dist/components/feedback/Dialog.d.ts +11 -1
  45. package/dist/components/feedback/InlineMessage.d.cts +2 -0
  46. package/dist/components/feedback/InlineMessage.d.ts +2 -1
  47. package/dist/components/feedback/ProgressBar.d.ts +0 -1
  48. package/dist/components/feedback/Skeleton.d.ts +0 -1
  49. package/dist/components/feedback/Toast.d.cts +1 -1
  50. package/dist/components/feedback/Toast.d.ts +1 -2
  51. package/dist/components/feedback/Tooltip.d.ts +0 -1
  52. package/dist/components/forms/CalendarMonth.d.cts +6 -0
  53. package/dist/components/forms/CalendarMonth.d.ts +6 -0
  54. package/dist/components/forms/Checkbox.d.ts +0 -1
  55. package/dist/components/forms/ChoiceCardGroup.d.cts +3 -12
  56. package/dist/components/forms/ChoiceCardGroup.d.ts +3 -13
  57. package/dist/components/forms/ComboBox.d.cts +2 -11
  58. package/dist/components/forms/ComboBox.d.ts +2 -12
  59. package/dist/components/forms/ComboBoxListBox.d.cts +35 -0
  60. package/dist/components/forms/ComboBoxListBox.d.ts +35 -0
  61. package/dist/components/forms/DatePicker.d.cts +3 -13
  62. package/dist/components/forms/DatePicker.d.ts +3 -14
  63. package/dist/components/forms/DateRangePicker.d.cts +5 -15
  64. package/dist/components/forms/DateRangePicker.d.ts +5 -16
  65. package/dist/components/forms/FieldClearButton.d.cts +12 -0
  66. package/dist/components/forms/FieldClearButton.d.ts +12 -0
  67. package/dist/components/forms/FieldDescription.d.ts +0 -1
  68. package/dist/components/forms/FieldHelp.d.cts +23 -0
  69. package/dist/components/forms/FieldHelp.d.ts +23 -1
  70. package/dist/components/forms/FieldLabel.d.cts +2 -5
  71. package/dist/components/forms/FieldLabel.d.ts +2 -6
  72. package/dist/components/forms/FileUpload.d.cts +40 -1
  73. package/dist/components/forms/FileUpload.d.ts +40 -2
  74. package/dist/components/forms/FormField.d.ts +0 -1
  75. package/dist/components/forms/Input.d.cts +2 -11
  76. package/dist/components/forms/Input.d.ts +2 -12
  77. package/dist/components/forms/MultiComboBox.d.cts +2 -11
  78. package/dist/components/forms/MultiComboBox.d.ts +2 -12
  79. package/dist/components/forms/NumberField.d.cts +3 -13
  80. package/dist/components/forms/NumberField.d.ts +3 -14
  81. package/dist/components/forms/QuantityStepper.d.ts +0 -1
  82. package/dist/components/forms/Radio.d.ts +0 -1
  83. package/dist/components/forms/Select.d.cts +2 -11
  84. package/dist/components/forms/Select.d.ts +2 -12
  85. package/dist/components/forms/Switch.d.ts +0 -1
  86. package/dist/components/forms/TextArea.d.cts +3 -14
  87. package/dist/components/forms/TextArea.d.ts +3 -15
  88. package/dist/components/forms/ValueHelpField.d.cts +7 -3
  89. package/dist/components/forms/ValueHelpField.d.ts +7 -4
  90. package/dist/components/forms/dateValues.d.cts +2 -5
  91. package/dist/components/forms/dateValues.d.ts +2 -6
  92. package/dist/components/layout/FooterBar.d.ts +0 -1
  93. package/dist/components/layout/PageBand.d.ts +0 -1
  94. package/dist/components/layout/PageHeader.d.ts +0 -1
  95. package/dist/components/layout/SectionHeader.d.ts +0 -1
  96. package/dist/components/layout/SelectionBar.d.cts +1 -2
  97. package/dist/components/layout/SelectionBar.d.ts +1 -3
  98. package/dist/components/layout/SplitPane.d.ts +0 -1
  99. package/dist/components/navigation/Breadcrumb.d.ts +0 -1
  100. package/dist/components/navigation/Menu.d.ts +0 -1
  101. package/dist/components/navigation/Pagination.d.ts +0 -1
  102. package/dist/components/navigation/Ribbon.d.cts +1 -1
  103. package/dist/components/navigation/Ribbon.d.ts +1 -2
  104. package/dist/components/navigation/ShellBar.d.cts +2 -5
  105. package/dist/components/navigation/ShellBar.d.ts +2 -6
  106. package/dist/components/navigation/ShellRail.d.ts +0 -1
  107. package/dist/components/navigation/SideNav.d.cts +3 -6
  108. package/dist/components/navigation/SideNav.d.ts +3 -7
  109. package/dist/components/navigation/Tabs.d.cts +1 -1
  110. package/dist/components/navigation/Tabs.d.ts +1 -2
  111. package/dist/components/patterns/AppLauncher.d.cts +1 -2
  112. package/dist/components/patterns/AppLauncher.d.ts +1 -3
  113. package/dist/components/patterns/CommandPalette.d.ts +0 -1
  114. package/dist/components/patterns/ConfirmDialog.d.ts +0 -1
  115. package/dist/components/patterns/EmptyState.d.ts +0 -1
  116. package/dist/components/patterns/FileDropZone.d.cts +1 -1
  117. package/dist/components/patterns/FileDropZone.d.ts +1 -2
  118. package/dist/components/patterns/NumPad.d.cts +2 -8
  119. package/dist/components/patterns/NumPad.d.ts +2 -9
  120. package/dist/components/patterns/SidePanel.d.ts +0 -1
  121. package/dist/components/patterns/ValueHelpDialog.d.cts +5 -5
  122. package/dist/components/patterns/ValueHelpDialog.d.ts +5 -6
  123. package/dist/components/utils/cx.d.ts +0 -1
  124. package/dist/components/utils/decimalSeparator.d.cts +1 -4
  125. package/dist/components/utils/decimalSeparator.d.ts +1 -5
  126. package/dist/components/utils/devWarn.d.cts +5 -3
  127. package/dist/components/utils/devWarn.d.ts +5 -4
  128. package/dist/components/utils/useDocumentKeyDown.d.cts +5 -0
  129. package/dist/components/utils/useDocumentKeyDown.d.ts +5 -0
  130. package/dist/components/utils/useLoadMoreOnScroll.d.cts +11 -0
  131. package/dist/components/utils/useLoadMoreOnScroll.d.ts +11 -0
  132. package/dist/components.css +145 -87
  133. package/dist/i18n/PireIntlProvider.d.ts +0 -1
  134. package/dist/i18n/messages.d.cts +18 -0
  135. package/dist/i18n/messages.d.ts +18 -1
  136. package/dist/index.cjs +1615 -1514
  137. package/dist/index.cjs.map +1 -1
  138. package/dist/index.d.ts +0 -1
  139. package/dist/index.js +1527 -1449
  140. package/dist/index.js.map +1 -1
  141. package/dist/tokens/base.css +2 -5
  142. package/dist/tokens/colors.css +14 -8
  143. package/dist/tokens/elevation.css +15 -0
  144. package/dist/tokens/themes.css +7 -12
  145. package/package.json +1 -1
  146. package/dist/components/core/Avatar.d.ts.map +0 -1
  147. package/dist/components/core/Badge.d.ts.map +0 -1
  148. package/dist/components/core/Button.d.ts.map +0 -1
  149. package/dist/components/core/Card.d.ts.map +0 -1
  150. package/dist/components/core/ComingSoonMark.d.ts.map +0 -1
  151. package/dist/components/core/Heading.d.ts.map +0 -1
  152. package/dist/components/core/Icon.d.ts.map +0 -1
  153. package/dist/components/core/IconButton.d.ts.map +0 -1
  154. package/dist/components/core/Kbd.d.ts.map +0 -1
  155. package/dist/components/core/Link.d.ts.map +0 -1
  156. package/dist/components/core/SegmentedControl.d.ts.map +0 -1
  157. package/dist/components/core/Separator.d.ts.map +0 -1
  158. package/dist/components/core/Tag.d.ts.map +0 -1
  159. package/dist/components/core/Text.d.ts.map +0 -1
  160. package/dist/components/core/icon-data.generated.d.ts.map +0 -1
  161. package/dist/components/core/icon-map.d.ts.map +0 -1
  162. package/dist/components/data/BarChart.d.ts.map +0 -1
  163. package/dist/components/data/BarList.d.ts.map +0 -1
  164. package/dist/components/data/ChartFrame.d.ts.map +0 -1
  165. package/dist/components/data/DataTable.d.ts.map +0 -1
  166. package/dist/components/data/DescriptionList.d.ts.map +0 -1
  167. package/dist/components/data/DonutChart.d.ts.map +0 -1
  168. package/dist/components/data/FilterBar.d.ts.map +0 -1
  169. package/dist/components/data/KpiTile.d.ts.map +0 -1
  170. package/dist/components/data/LineChart.d.ts.map +0 -1
  171. package/dist/components/data/LinkList.d.ts.map +0 -1
  172. package/dist/components/data/ObjectHeader.d.ts.map +0 -1
  173. package/dist/components/data/RecordCard.d.ts.map +0 -1
  174. package/dist/components/data/Timeline.d.ts.map +0 -1
  175. package/dist/components/data/ViewSwitcher.d.ts.map +0 -1
  176. package/dist/components/data/chartGeometry.d.ts.map +0 -1
  177. package/dist/components/feedback/Dialog.d.ts.map +0 -1
  178. package/dist/components/feedback/InlineMessage.d.ts.map +0 -1
  179. package/dist/components/feedback/ProgressBar.d.ts.map +0 -1
  180. package/dist/components/feedback/Skeleton.d.ts.map +0 -1
  181. package/dist/components/feedback/Toast.d.ts.map +0 -1
  182. package/dist/components/feedback/Tooltip.d.ts.map +0 -1
  183. package/dist/components/forms/Checkbox.d.ts.map +0 -1
  184. package/dist/components/forms/ChoiceCardGroup.d.ts.map +0 -1
  185. package/dist/components/forms/ComboBox.d.ts.map +0 -1
  186. package/dist/components/forms/DatePicker.d.ts.map +0 -1
  187. package/dist/components/forms/DateRangePicker.d.ts.map +0 -1
  188. package/dist/components/forms/FieldDescription.d.ts.map +0 -1
  189. package/dist/components/forms/FieldHelp.d.ts.map +0 -1
  190. package/dist/components/forms/FieldLabel.d.ts.map +0 -1
  191. package/dist/components/forms/FileUpload.d.ts.map +0 -1
  192. package/dist/components/forms/FormField.d.ts.map +0 -1
  193. package/dist/components/forms/Input.d.ts.map +0 -1
  194. package/dist/components/forms/MultiComboBox.d.ts.map +0 -1
  195. package/dist/components/forms/NumberField.d.ts.map +0 -1
  196. package/dist/components/forms/QuantityStepper.d.ts.map +0 -1
  197. package/dist/components/forms/Radio.d.ts.map +0 -1
  198. package/dist/components/forms/Select.d.ts.map +0 -1
  199. package/dist/components/forms/Switch.d.ts.map +0 -1
  200. package/dist/components/forms/TextArea.d.ts.map +0 -1
  201. package/dist/components/forms/ValueHelpField.d.ts.map +0 -1
  202. package/dist/components/forms/dateValues.d.ts.map +0 -1
  203. package/dist/components/layout/FooterBar.d.ts.map +0 -1
  204. package/dist/components/layout/PageBand.d.ts.map +0 -1
  205. package/dist/components/layout/PageHeader.d.ts.map +0 -1
  206. package/dist/components/layout/SectionHeader.d.ts.map +0 -1
  207. package/dist/components/layout/SelectionBar.d.ts.map +0 -1
  208. package/dist/components/layout/SplitPane.d.ts.map +0 -1
  209. package/dist/components/navigation/Breadcrumb.d.ts.map +0 -1
  210. package/dist/components/navigation/Menu.d.ts.map +0 -1
  211. package/dist/components/navigation/Pagination.d.ts.map +0 -1
  212. package/dist/components/navigation/Ribbon.d.ts.map +0 -1
  213. package/dist/components/navigation/ShellBar.d.ts.map +0 -1
  214. package/dist/components/navigation/ShellRail.d.ts.map +0 -1
  215. package/dist/components/navigation/SideNav.d.ts.map +0 -1
  216. package/dist/components/navigation/Tabs.d.ts.map +0 -1
  217. package/dist/components/patterns/AppLauncher.d.ts.map +0 -1
  218. package/dist/components/patterns/CommandPalette.d.ts.map +0 -1
  219. package/dist/components/patterns/ConfirmDialog.d.ts.map +0 -1
  220. package/dist/components/patterns/EmptyState.d.ts.map +0 -1
  221. package/dist/components/patterns/FileDropZone.d.ts.map +0 -1
  222. package/dist/components/patterns/NumPad.d.ts.map +0 -1
  223. package/dist/components/patterns/SidePanel.d.ts.map +0 -1
  224. package/dist/components/patterns/ValueHelpDialog.d.ts.map +0 -1
  225. package/dist/components/utils/cx.d.ts.map +0 -1
  226. package/dist/components/utils/decimalSeparator.d.ts.map +0 -1
  227. package/dist/components/utils/devWarn.d.ts.map +0 -1
  228. package/dist/components/utils/focusField.d.cts +0 -11
  229. package/dist/components/utils/focusField.d.ts +0 -12
  230. package/dist/components/utils/focusField.d.ts.map +0 -1
  231. package/dist/i18n/PireIntlProvider.d.ts.map +0 -1
  232. package/dist/i18n/messages.d.ts.map +0 -1
  233. package/dist/index.d.ts.map +0 -1
@@ -1,4 +1,5 @@
1
1
  import type * as React from 'react';
2
+ import type { WithFieldHelp } from './FieldHelp.js';
2
3
  export interface ChoiceCardOption {
3
4
  id: string;
4
5
  label: React.ReactNode;
@@ -12,7 +13,7 @@ export interface ChoiceCardOption {
12
13
  * support. Still shown, so the user knows the choice exists — just not right now. */
13
14
  isDisabled?: boolean;
14
15
  }
15
- export interface ChoiceCardGroupProps {
16
+ export interface ChoiceCardGroupProps extends WithFieldHelp {
16
17
  /** Names the choice for assistive tech, e.g. "Count scope". Required when `label` is omitted. */
17
18
  'aria-label'?: string;
18
19
  /** Visible group label. Use when the choice needs a heading of its own on the page; fall back
@@ -22,16 +23,6 @@ export interface ChoiceCardGroupProps {
22
23
  /** Guidance that applies to the group as a whole, below the cards — not a per-option detail,
23
24
  * which belongs in that option's `description`. */
24
25
  description?: React.ReactNode;
25
- /**
26
- * Contextual explanation, shown as a help icon beside the label and announced as part of the
27
- * field's description. For the sentence a user needs *occasionally* — `description` is for the
28
- * one they need every time, and it costs a line of vertical space in every row.
29
- *
30
- * Needs a visible `label`: the icon is drawn beside one, so on a field named only by
31
- * `aria-label` the text still reaches a screen reader through the description but no icon
32
- * appears. Pire warns in development rather than drawing an icon with nothing to anchor it to.
33
- */
34
- help?: React.ReactNode;
35
26
  /** Shown when `isRequired` and nothing has been chosen at validation time. */
36
27
  errorMessage?: React.ReactNode;
37
28
  options: ChoiceCardOption[];
@@ -57,5 +48,4 @@ export interface ChoiceCardGroupProps {
57
48
  * posting mode. Use it when the choice deserves a sentence; use `Radio` when the label is enough
58
49
  * and `SegmentedControl` when the options only change how data is displayed.
59
50
  */
60
- export declare function ChoiceCardGroup({ label, description, help, errorMessage, options, value, defaultValue, onChange, columns, isDisabled, isRequired, className, style, ...rest }: ChoiceCardGroupProps): React.JSX.Element;
61
- //# sourceMappingURL=ChoiceCardGroup.d.ts.map
51
+ export declare function ChoiceCardGroup({ label, description, help, errorMessage, options, value, defaultValue, onChange, columns, isDisabled, isRequired, className, style, 'aria-label': ariaLabel, }: ChoiceCardGroupProps): React.JSX.Element;
@@ -1,11 +1,12 @@
1
1
  import * as React from 'react';
2
+ import type { WithFieldHelp } from './FieldHelp.cjs';
2
3
  export interface ComboBoxOption {
3
4
  value: string;
4
5
  label: string;
5
6
  secondary?: string;
6
7
  isDisabled?: boolean;
7
8
  }
8
- export interface ComboBoxProps {
9
+ export interface ComboBoxProps extends WithFieldHelp {
9
10
  label?: React.ReactNode;
10
11
  value?: string | null;
11
12
  defaultValue?: string;
@@ -65,16 +66,6 @@ export interface ComboBoxProps {
65
66
  onLoadMore?: () => void;
66
67
  placeholder?: string;
67
68
  description?: React.ReactNode;
68
- /**
69
- * Contextual explanation, shown as a help icon beside the label and announced as part of the
70
- * field's description. For the sentence a user needs *occasionally* — `description` is for the
71
- * one they need every time, and it costs a line of vertical space in every row.
72
- *
73
- * Needs a visible `label`: the icon is drawn beside one, so on a field named only by
74
- * `aria-label` the text still reaches a screen reader through the description but no icon
75
- * appears. Pire warns in development rather than drawing an icon with nothing to anchor it to.
76
- */
77
- help?: React.ReactNode;
78
69
  errorMessage?: React.ReactNode;
79
70
  isInvalid?: boolean;
80
71
  isDisabled?: boolean;
@@ -1,11 +1,12 @@
1
1
  import * as React from 'react';
2
+ import type { WithFieldHelp } from './FieldHelp.js';
2
3
  export interface ComboBoxOption {
3
4
  value: string;
4
5
  label: string;
5
6
  secondary?: string;
6
7
  isDisabled?: boolean;
7
8
  }
8
- export interface ComboBoxProps {
9
+ export interface ComboBoxProps extends WithFieldHelp {
9
10
  label?: React.ReactNode;
10
11
  value?: string | null;
11
12
  defaultValue?: string;
@@ -65,16 +66,6 @@ export interface ComboBoxProps {
65
66
  onLoadMore?: () => void;
66
67
  placeholder?: string;
67
68
  description?: React.ReactNode;
68
- /**
69
- * Contextual explanation, shown as a help icon beside the label and announced as part of the
70
- * field's description. For the sentence a user needs *occasionally* — `description` is for the
71
- * one they need every time, and it costs a line of vertical space in every row.
72
- *
73
- * Needs a visible `label`: the icon is drawn beside one, so on a field named only by
74
- * `aria-label` the text still reaches a screen reader through the description but no icon
75
- * appears. Pire warns in development rather than drawing an icon with nothing to anchor it to.
76
- */
77
- help?: React.ReactNode;
78
69
  errorMessage?: React.ReactNode;
79
70
  isInvalid?: boolean;
80
71
  isDisabled?: boolean;
@@ -91,4 +82,3 @@ export interface ComboBoxProps {
91
82
  /** Type-ahead picker for lists too long to scroll — material, cost centre, G/L account.
92
83
  * Below ~10 fixed options use Select; for master-data search with several columns use ValueHelpField. */
93
84
  export declare function ComboBox({ label, value, defaultValue, onChange, onInputChange, inputValue, options, description, help, errorMessage, size, fullWidth, isFilteredExternally, isLoading, loadingLabel, emptyLabel, isClearable, clearLabel, onLoadMore, className, style, ...rest }: ComboBoxProps): React.JSX.Element;
94
- //# sourceMappingURL=ComboBox.d.ts.map
@@ -0,0 +1,35 @@
1
+ import * as React from 'react';
2
+ import type { ComboBoxOption } from './ComboBox.cjs';
3
+ /**
4
+ * The normalised options, and the collection props to hand React Aria's `ComboBox`.
5
+ *
6
+ * `items` (controlled) skips React Aria's local filter; `defaultItems` applies it. That single
7
+ * choice is the whole of `isFilteredExternally` — see useComboBoxState, which reads
8
+ * `props.items != null || !defaultFilter ? collection : filterCollection(...)`.
9
+ *
10
+ * `allowsEmptyCollection` is always true under external filtering, not just while a status row
11
+ * shows: gating it on the status closes the popover at the moment results land, because the flag
12
+ * flips false in the same render the collection fills.
13
+ */
14
+ export declare function useComboBoxItems(options: Array<string | ComboBoxOption>, isFilteredExternally: boolean | undefined, isLoading: boolean | undefined): {
15
+ items: ComboBoxOption[];
16
+ collectionProps: {
17
+ items: ComboBoxOption[];
18
+ allowsEmptyCollection: boolean;
19
+ } | {
20
+ defaultItems: ComboBoxOption[];
21
+ allowsEmptyCollection: boolean;
22
+ };
23
+ };
24
+ /** The chevron that opens the suggestions. React Aria adopts it as the field's trigger. */
25
+ export declare function ComboBoxTrigger(): React.JSX.Element;
26
+ export interface ComboBoxListBoxProps {
27
+ items: ComboBoxOption[];
28
+ isFilteredExternally?: boolean;
29
+ isLoading?: boolean;
30
+ loadingLabel?: string;
31
+ emptyLabel?: React.ReactNode;
32
+ onLoadMore?: () => void;
33
+ }
34
+ /** The popover, the option rows and the loading / empty status row, shared by `ComboBox` and `MultiComboBox`. */
35
+ export declare function ComboBoxListBox({ items, isFilteredExternally, isLoading, loadingLabel, emptyLabel, onLoadMore, }: ComboBoxListBoxProps): React.JSX.Element;
@@ -0,0 +1,35 @@
1
+ import * as React from 'react';
2
+ import type { ComboBoxOption } from './ComboBox.js';
3
+ /**
4
+ * The normalised options, and the collection props to hand React Aria's `ComboBox`.
5
+ *
6
+ * `items` (controlled) skips React Aria's local filter; `defaultItems` applies it. That single
7
+ * choice is the whole of `isFilteredExternally` — see useComboBoxState, which reads
8
+ * `props.items != null || !defaultFilter ? collection : filterCollection(...)`.
9
+ *
10
+ * `allowsEmptyCollection` is always true under external filtering, not just while a status row
11
+ * shows: gating it on the status closes the popover at the moment results land, because the flag
12
+ * flips false in the same render the collection fills.
13
+ */
14
+ export declare function useComboBoxItems(options: Array<string | ComboBoxOption>, isFilteredExternally: boolean | undefined, isLoading: boolean | undefined): {
15
+ items: ComboBoxOption[];
16
+ collectionProps: {
17
+ items: ComboBoxOption[];
18
+ allowsEmptyCollection: boolean;
19
+ } | {
20
+ defaultItems: ComboBoxOption[];
21
+ allowsEmptyCollection: boolean;
22
+ };
23
+ };
24
+ /** The chevron that opens the suggestions. React Aria adopts it as the field's trigger. */
25
+ export declare function ComboBoxTrigger(): React.JSX.Element;
26
+ export interface ComboBoxListBoxProps {
27
+ items: ComboBoxOption[];
28
+ isFilteredExternally?: boolean;
29
+ isLoading?: boolean;
30
+ loadingLabel?: string;
31
+ emptyLabel?: React.ReactNode;
32
+ onLoadMore?: () => void;
33
+ }
34
+ /** The popover, the option rows and the loading / empty status row, shared by `ComboBox` and `MultiComboBox`. */
35
+ export declare function ComboBoxListBox({ items, isFilteredExternally, isLoading, loadingLabel, emptyLabel, onLoadMore, }: ComboBoxListBoxProps): React.JSX.Element;
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import type { DateValue } from 'react-aria-components';
3
- export interface DatePickerProps<TFormat extends 'object' | 'iso' = 'object'> {
3
+ import type { WithFieldHelp } from './FieldHelp.cjs';
4
+ export interface DatePickerProps<TFormat extends 'object' | 'iso' = 'object'> extends WithFieldHelp {
4
5
  label?: React.ReactNode;
5
6
  /** A `DateValue`, or the `YYYY-MM-DD` string one arrived as — a value straight off a JSON
6
7
  * response needs no conversion. A datetime is accepted and trimmed to its date (`date`
@@ -13,8 +14,7 @@ export interface DatePickerProps<TFormat extends 'object' | 'iso' = 'object'> {
13
14
  /**
14
15
  * The shape `onChange` emits.
15
16
  *
16
- * `'object'` (the default) emits the `@internationalized/date` `DateValue` this component has
17
- * always emitted. `'iso'` emits the `YYYY-MM-DD` string a consumer sends back to its API, and
17
+ * `'object'` (the default) emits an `@internationalized/date` `DateValue`. `'iso'` emits the `YYYY-MM-DD` string a consumer sends back to its API, and
18
18
  * `null` for an empty field. Input accepts both shapes in either mode.
19
19
  */
20
20
  valueFormat?: TFormat;
@@ -28,16 +28,6 @@ export interface DatePickerProps<TFormat extends 'object' | 'iso' = 'object'> {
28
28
  /** Return true for dates that cannot be picked — factory calendar, blocked periods. */
29
29
  isDateUnavailable?: (date: DateValue) => boolean;
30
30
  description?: React.ReactNode;
31
- /**
32
- * Contextual explanation, shown as a help icon beside the label and announced as part of the
33
- * field's description. For the sentence a user needs *occasionally* — `description` is for the
34
- * one they need every time, and it costs a line of vertical space in every row.
35
- *
36
- * Needs a visible `label`: the icon is drawn beside one, so on a field named only by
37
- * `aria-label` the text still reaches a screen reader through the description but no icon
38
- * appears. Pire warns in development rather than drawing an icon with nothing to anchor it to.
39
- */
40
- help?: React.ReactNode;
41
31
  errorMessage?: React.ReactNode;
42
32
  isInvalid?: boolean;
43
33
  isDisabled?: boolean;
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import type { DateValue } from 'react-aria-components';
3
- export interface DatePickerProps<TFormat extends 'object' | 'iso' = 'object'> {
3
+ import type { WithFieldHelp } from './FieldHelp.js';
4
+ export interface DatePickerProps<TFormat extends 'object' | 'iso' = 'object'> extends WithFieldHelp {
4
5
  label?: React.ReactNode;
5
6
  /** A `DateValue`, or the `YYYY-MM-DD` string one arrived as — a value straight off a JSON
6
7
  * response needs no conversion. A datetime is accepted and trimmed to its date (`date`
@@ -13,8 +14,7 @@ export interface DatePickerProps<TFormat extends 'object' | 'iso' = 'object'> {
13
14
  /**
14
15
  * The shape `onChange` emits.
15
16
  *
16
- * `'object'` (the default) emits the `@internationalized/date` `DateValue` this component has
17
- * always emitted. `'iso'` emits the `YYYY-MM-DD` string a consumer sends back to its API, and
17
+ * `'object'` (the default) emits an `@internationalized/date` `DateValue`. `'iso'` emits the `YYYY-MM-DD` string a consumer sends back to its API, and
18
18
  * `null` for an empty field. Input accepts both shapes in either mode.
19
19
  */
20
20
  valueFormat?: TFormat;
@@ -28,16 +28,6 @@ export interface DatePickerProps<TFormat extends 'object' | 'iso' = 'object'> {
28
28
  /** Return true for dates that cannot be picked — factory calendar, blocked periods. */
29
29
  isDateUnavailable?: (date: DateValue) => boolean;
30
30
  description?: React.ReactNode;
31
- /**
32
- * Contextual explanation, shown as a help icon beside the label and announced as part of the
33
- * field's description. For the sentence a user needs *occasionally* — `description` is for the
34
- * one they need every time, and it costs a line of vertical space in every row.
35
- *
36
- * Needs a visible `label`: the icon is drawn beside one, so on a field named only by
37
- * `aria-label` the text still reaches a screen reader through the description but no icon
38
- * appears. Pire warns in development rather than drawing an icon with nothing to anchor it to.
39
- */
40
- help?: React.ReactNode;
41
31
  errorMessage?: React.ReactNode;
42
32
  isInvalid?: boolean;
43
33
  isDisabled?: boolean;
@@ -63,4 +53,3 @@ export interface DatePickerProps<TFormat extends 'object' | 'iso' = 'object'> {
63
53
  * so a German user types dd.mm.yyyy without any prop change. Wrap the app in React Aria's
64
54
  * I18nProvider to pin a locale. */
65
55
  export declare function DatePicker<TFormat extends 'object' | 'iso' = 'object'>({ label, description, help, errorMessage, size, fullWidth, className, style, value, defaultValue, onChange, valueFormat, minValue, maxValue, isClearable, clearLabel, ...rest }: DatePickerProps<TFormat>): React.JSX.Element;
66
- //# sourceMappingURL=DatePicker.d.ts.map
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import type { DateValue } from 'react-aria-components';
3
+ import type { WithFieldHelp } from './FieldHelp.cjs';
3
4
  /** A complete range: what this component emits, and what `rangeLengthInDays` measures. */
4
5
  export interface DateRange {
5
6
  start: DateValue;
@@ -29,7 +30,7 @@ export interface DateRangePreset {
29
30
  * computes in whatever shape it stores, so either shape is accepted here. */
30
31
  range: () => DateRangeInput;
31
32
  }
32
- export interface DateRangePickerProps<TFormat extends 'object' | 'iso' = 'object'> {
33
+ export interface DateRangePickerProps<TFormat extends 'object' | 'iso' = 'object'> extends WithFieldHelp {
33
34
  label?: React.ReactNode;
34
35
  /** Either end in either shape — see `DateRangeInput`. A range whose ends are both empty is an
35
36
  * empty field. */
@@ -39,7 +40,7 @@ export interface DateRangePickerProps<TFormat extends 'object' | 'iso' = 'object
39
40
  /**
40
41
  * The shape `onChange` emits.
41
42
  *
42
- * `'object'` (the default) emits the `DateValue` pair this component has always emitted. `'iso'`
43
+ * `'object'` (the default) emits a `DateValue` pair. `'iso'`
43
44
  * emits `{ start: 'YYYY-MM-DD', end: 'YYYY-MM-DD' }`, the shape a consumer sends back to its API.
44
45
  *
45
46
  * Either way the emitted range is always complete or `null`: React Aria never reports half a
@@ -73,16 +74,6 @@ export interface DateRangePickerProps<TFormat extends 'object' | 'iso' = 'object
73
74
  /** The clear button's visible text. Defaults to the dictionary's `inputClear`. */
74
75
  clearLabel?: string;
75
76
  description?: React.ReactNode;
76
- /**
77
- * Contextual explanation, shown as a help icon beside the label and announced as part of the
78
- * field's description. For the sentence a user needs *occasionally* — `description` is for the
79
- * one they need every time, and it costs a line of vertical space in every row.
80
- *
81
- * Needs a visible `label`: the icon is drawn beside one, so on a field named only by
82
- * `aria-label` the text still reaches a screen reader through the description but no icon
83
- * appears. Pire warns in development rather than drawing an icon with nothing to anchor it to.
84
- */
85
- help?: React.ReactNode;
86
77
  errorMessage?: React.ReactNode;
87
78
  isInvalid?: boolean;
88
79
  isDisabled?: boolean;
@@ -99,9 +90,8 @@ export interface DateRangePickerProps<TFormat extends 'object' | 'iso' = 'object
99
90
  /**
100
91
  * Whole days between the two ends, inclusive of both.
101
92
  *
102
- * A complete `DateRange` measures to a number, which is the signature this has always had. Given
103
- * the looser shape `value` now takes — either end a string, either end absent — it returns `null`
104
- * for a range it cannot measure, so a caller holding two strings can pass them straight in.
93
+ * A complete `DateRange` measures to a number. Anything looser — either end a string or absent —
94
+ * returns `null` when either end is missing or unreadable, so two strings can be passed straight in.
105
95
  */
106
96
  export declare function rangeLengthInDays(range: DateRange): number;
107
97
  export declare function rangeLengthInDays(range: DateRangeInput | null | undefined): number | null;
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import type { DateValue } from 'react-aria-components';
3
+ import type { WithFieldHelp } from './FieldHelp.js';
3
4
  /** A complete range: what this component emits, and what `rangeLengthInDays` measures. */
4
5
  export interface DateRange {
5
6
  start: DateValue;
@@ -29,7 +30,7 @@ export interface DateRangePreset {
29
30
  * computes in whatever shape it stores, so either shape is accepted here. */
30
31
  range: () => DateRangeInput;
31
32
  }
32
- export interface DateRangePickerProps<TFormat extends 'object' | 'iso' = 'object'> {
33
+ export interface DateRangePickerProps<TFormat extends 'object' | 'iso' = 'object'> extends WithFieldHelp {
33
34
  label?: React.ReactNode;
34
35
  /** Either end in either shape — see `DateRangeInput`. A range whose ends are both empty is an
35
36
  * empty field. */
@@ -39,7 +40,7 @@ export interface DateRangePickerProps<TFormat extends 'object' | 'iso' = 'object
39
40
  /**
40
41
  * The shape `onChange` emits.
41
42
  *
42
- * `'object'` (the default) emits the `DateValue` pair this component has always emitted. `'iso'`
43
+ * `'object'` (the default) emits a `DateValue` pair. `'iso'`
43
44
  * emits `{ start: 'YYYY-MM-DD', end: 'YYYY-MM-DD' }`, the shape a consumer sends back to its API.
44
45
  *
45
46
  * Either way the emitted range is always complete or `null`: React Aria never reports half a
@@ -73,16 +74,6 @@ export interface DateRangePickerProps<TFormat extends 'object' | 'iso' = 'object
73
74
  /** The clear button's visible text. Defaults to the dictionary's `inputClear`. */
74
75
  clearLabel?: string;
75
76
  description?: React.ReactNode;
76
- /**
77
- * Contextual explanation, shown as a help icon beside the label and announced as part of the
78
- * field's description. For the sentence a user needs *occasionally* — `description` is for the
79
- * one they need every time, and it costs a line of vertical space in every row.
80
- *
81
- * Needs a visible `label`: the icon is drawn beside one, so on a field named only by
82
- * `aria-label` the text still reaches a screen reader through the description but no icon
83
- * appears. Pire warns in development rather than drawing an icon with nothing to anchor it to.
84
- */
85
- help?: React.ReactNode;
86
77
  errorMessage?: React.ReactNode;
87
78
  isInvalid?: boolean;
88
79
  isDisabled?: boolean;
@@ -99,9 +90,8 @@ export interface DateRangePickerProps<TFormat extends 'object' | 'iso' = 'object
99
90
  /**
100
91
  * Whole days between the two ends, inclusive of both.
101
92
  *
102
- * A complete `DateRange` measures to a number, which is the signature this has always had. Given
103
- * the looser shape `value` now takes — either end a string, either end absent — it returns `null`
104
- * for a range it cannot measure, so a caller holding two strings can pass them straight in.
93
+ * A complete `DateRange` measures to a number. Anything looser — either end a string or absent —
94
+ * returns `null` when either end is missing or unreadable, so two strings can be passed straight in.
105
95
  */
106
96
  export declare function rangeLengthInDays(range: DateRange): number;
107
97
  export declare function rangeLengthInDays(range: DateRangeInput | null | undefined): number | null;
@@ -113,4 +103,3 @@ export declare function rangeLengthInDays(range: DateRangeInput | null | undefin
113
103
  * `es-PY` reads dd/mm/yyyy and `en-US` mm/dd/yyyy off the same value.
114
104
  */
115
105
  export declare function DateRangePicker<TFormat extends 'object' | 'iso' = 'object'>({ label, description, help, errorMessage, maxRangeDays, presets, size, fullWidth, startName, endName, className, style, value, defaultValue, onChange, valueFormat, minValue, maxValue, isClearable, clearLabel, ...rest }: DateRangePickerProps<TFormat>): React.JSX.Element;
116
- //# sourceMappingURL=DateRangePicker.d.ts.map
@@ -0,0 +1,12 @@
1
+ /**
2
+ * The clear button inside a field's `.pire-control` shell, shared by every clearable field.
3
+ *
4
+ * A labelled text button, not an "x": inside a dialog an icon-only x sits next to the dialog's own
5
+ * close x and reads as a second dismiss. `slot={null}` always, because an unslotted button inside
6
+ * `DatePicker`, `DateRangePicker` or `ComboBox` is adopted as that field's trigger — "Clear" would
7
+ * open the popover instead of clearing.
8
+ */
9
+ export declare function FieldClearButton({ label, onClear }: {
10
+ label: string;
11
+ onClear: () => void;
12
+ }): import("react").JSX.Element;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * The clear button inside a field's `.pire-control` shell, shared by every clearable field.
3
+ *
4
+ * A labelled text button, not an "x": inside a dialog an icon-only x sits next to the dialog's own
5
+ * close x and reads as a second dismiss. `slot={null}` always, because an unslotted button inside
6
+ * `DatePicker`, `DateRangePicker` or `ComboBox` is adopted as that field's trigger — "Clear" would
7
+ * open the popover instead of clearing.
8
+ */
9
+ export declare function FieldClearButton({ label, onClear }: {
10
+ label: string;
11
+ onClear: () => void;
12
+ }): import("react").JSX.Element;
@@ -14,4 +14,3 @@ export interface FieldDescriptionProps {
14
14
  * has one of those per helped field.
15
15
  */
16
16
  export declare function FieldDescription({ description, help }: FieldDescriptionProps): React.JSX.Element | null;
17
- //# sourceMappingURL=FieldDescription.d.ts.map
@@ -1,4 +1,17 @@
1
1
  import type * as React from 'react';
2
+ /** The `help` prop, documented once for every field that draws its own label. */
3
+ export interface WithFieldHelp {
4
+ /**
5
+ * Contextual explanation, shown as a help icon beside the label and announced as part of the
6
+ * field's description. For the sentence a user needs *occasionally* — `description` is for the
7
+ * one they need every time, and it costs a line of vertical space in every row.
8
+ *
9
+ * Needs a visible `label`: the icon is drawn beside one, so on a field named only by
10
+ * `aria-label` the text still reaches a screen reader through the description but no icon
11
+ * appears. Pire warns in development rather than drawing an icon with nothing to anchor it to.
12
+ */
13
+ help?: React.ReactNode;
14
+ }
2
15
  export interface FieldHelpProps {
3
16
  /** The explanation. Shown on hover and immediately on keyboard focus. Never put an instruction
4
17
  * here that is unavailable elsewhere — there is no hover on touch. */
@@ -17,3 +30,13 @@ export interface FieldHelpProps {
17
30
  * for you; reach for the component directly beside a `FormField` or a bare control.
18
31
  */
19
32
  export declare function FieldHelp({ children, label, placement }: FieldHelpProps): React.JSX.Element;
33
+ /**
34
+ * `FieldHelp` named after the field it explains — "More information about delivery date" — wherever
35
+ * the label is a string. `help` is the path every real use takes, and unnamed, a form with six
36
+ * helped fields has six buttons all called "More information". A ReactNode label cannot be
37
+ * flattened into a sentence, so those keep the plain name. Used by `FieldLabel` and `FormField`.
38
+ */
39
+ export declare function NamedFieldHelp({ label, children }: {
40
+ label: React.ReactNode;
41
+ children: React.ReactNode;
42
+ }): React.JSX.Element;
@@ -1,4 +1,17 @@
1
1
  import type * as React from 'react';
2
+ /** The `help` prop, documented once for every field that draws its own label. */
3
+ export interface WithFieldHelp {
4
+ /**
5
+ * Contextual explanation, shown as a help icon beside the label and announced as part of the
6
+ * field's description. For the sentence a user needs *occasionally* — `description` is for the
7
+ * one they need every time, and it costs a line of vertical space in every row.
8
+ *
9
+ * Needs a visible `label`: the icon is drawn beside one, so on a field named only by
10
+ * `aria-label` the text still reaches a screen reader through the description but no icon
11
+ * appears. Pire warns in development rather than drawing an icon with nothing to anchor it to.
12
+ */
13
+ help?: React.ReactNode;
14
+ }
2
15
  export interface FieldHelpProps {
3
16
  /** The explanation. Shown on hover and immediately on keyboard focus. Never put an instruction
4
17
  * here that is unavailable elsewhere — there is no hover on touch. */
@@ -17,4 +30,13 @@ export interface FieldHelpProps {
17
30
  * for you; reach for the component directly beside a `FormField` or a bare control.
18
31
  */
19
32
  export declare function FieldHelp({ children, label, placement }: FieldHelpProps): React.JSX.Element;
20
- //# sourceMappingURL=FieldHelp.d.ts.map
33
+ /**
34
+ * `FieldHelp` named after the field it explains — "More information about delivery date" — wherever
35
+ * the label is a string. `help` is the path every real use takes, and unnamed, a form with six
36
+ * helped fields has six buttons all called "More information". A ReactNode label cannot be
37
+ * flattened into a sentence, so those keep the plain name. Used by `FieldLabel` and `FormField`.
38
+ */
39
+ export declare function NamedFieldHelp({ label, children }: {
40
+ label: React.ReactNode;
41
+ children: React.ReactNode;
42
+ }): React.JSX.Element;
@@ -19,11 +19,8 @@ export declare function warnHelpWithoutLabel(component: string, label: React.Rea
19
19
  /**
20
20
  * Internal. The label row every Pire field draws, in one place.
21
21
  *
22
- * It exists because this markup was copied nine times, and the ButtonContext reset below had to
23
- * land in all nine: React Aria hands every descendant Button the field's own slotted context, so
24
- * a button a consumer puts in a label either throws (NumberField) or is silently adopted as the
25
- * field's trigger (DatePicker, DateRangePicker, ComboBox). Resetting the context here makes any
26
- * button in any field's label behave like a button — not just the help icon.
22
+ * It resets `ButtonContext` (see `FieldHelp` for why), so any button in any field's label behaves
23
+ * like a button — not just the help icon.
27
24
  *
28
25
  * That does not make every shape a good one. `help` renders `FieldHelp` as a **sibling** of
29
26
  * `<Label>`, which is the supported shape and the only one this component produces on its own.
@@ -19,11 +19,8 @@ export declare function warnHelpWithoutLabel(component: string, label: React.Rea
19
19
  /**
20
20
  * Internal. The label row every Pire field draws, in one place.
21
21
  *
22
- * It exists because this markup was copied nine times, and the ButtonContext reset below had to
23
- * land in all nine: React Aria hands every descendant Button the field's own slotted context, so
24
- * a button a consumer puts in a label either throws (NumberField) or is silently adopted as the
25
- * field's trigger (DatePicker, DateRangePicker, ComboBox). Resetting the context here makes any
26
- * button in any field's label behave like a button — not just the help icon.
22
+ * It resets `ButtonContext` (see `FieldHelp` for why), so any button in any field's label behaves
23
+ * like a button — not just the help icon.
27
24
  *
28
25
  * That does not make every shape a good one. `help` renders `FieldHelp` as a **sibling** of
29
26
  * `<Label>`, which is the supported shape and the only one this component produces on its own.
@@ -34,4 +31,3 @@ export declare function warnHelpWithoutLabel(component: string, label: React.Rea
34
31
  * prefer `help` unless the label truly needs its own button.
35
32
  */
36
33
  export declare function FieldLabel({ label, isRequired, help }: FieldLabelProps): React.JSX.Element;
37
- //# sourceMappingURL=FieldLabel.d.ts.map
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  export interface PireFile {
3
3
  /** The browser's `File`. Pire uploads nothing — that is the app's job. */
4
4
  file: File;
5
- /** Object URL, only for images with `showPreview`. Revoked on unmount. */
5
+ /** Object URL, only for images with `showPreview`. Revoked once the file leaves the list. */
6
6
  previewUrl?: string;
7
7
  }
8
8
  export interface FileRejection {
@@ -57,9 +57,48 @@ export declare function screenFiles(files: File[], { maxSize, acceptedFileTypes
57
57
  accepted: File[];
58
58
  rejected: FileRejection[];
59
59
  };
60
+ type FileListOptions = Pick<FileUploadProps, 'value' | 'defaultValue' | 'onChange' | 'acceptedFileTypes' | 'allowsMultiple' | 'maxSize' | 'onError' | 'showPreview' | 'isDisabled' | 'isReadOnly'>;
61
+ /**
62
+ * The file list behind `FileUpload` and `FileDropZone`: controlled / uncontrolled state, screening,
63
+ * preview URLs, and add / remove. `accept` ignores everything while the field is disabled or
64
+ * read-only, whichever path the files arrived by.
65
+ */
66
+ export declare function useFileList({ value, defaultValue, onChange, acceptedFileTypes, allowsMultiple, maxSize, onError, showPreview, isDisabled, isReadOnly, }: FileListOptions): {
67
+ files: PireFile[];
68
+ accept: (picked: File[]) => void;
69
+ remove: (target: File) => void;
70
+ };
71
+ /**
72
+ * Ids for the label, hint and error. Neither file field has a React Aria field context, so each
73
+ * wires these to its own control by hand.
74
+ */
75
+ export declare function useFileFieldIds({ label, description, errorMessage, isInvalid, }: Pick<FileUploadProps, 'label' | 'description' | 'errorMessage' | 'isInvalid'>): {
76
+ id: string;
77
+ labelId: string | undefined;
78
+ hintId: string | undefined;
79
+ errorId: string | undefined;
80
+ describedBy: string | undefined;
81
+ };
82
+ export declare function FileFieldLabel({ id, label, isRequired, }: {
83
+ id?: string;
84
+ label?: React.ReactNode;
85
+ isRequired?: boolean;
86
+ }): React.JSX.Element | null;
87
+ /** The chosen files, the upload progress, then the hint and the error — everything below the control. */
88
+ export declare function FileFieldFooter({ files, onRemove, uploadProgress, description, errorMessage, hintId, errorId, }: {
89
+ files: PireFile[];
90
+ /** Omitted while the field is disabled or read-only, which hides the remove buttons. */
91
+ onRemove?: (file: File) => void;
92
+ uploadProgress?: number;
93
+ description?: React.ReactNode;
94
+ errorMessage?: React.ReactNode;
95
+ hintId?: string;
96
+ errorId?: string;
97
+ }): React.JSX.Element;
60
98
  /**
61
99
  * File picker with a list of what was chosen. Pire hands back `File`s through `onChange` and
62
100
  * uploads nothing: the app owns the `FormData`, the request and the progress it reports back
63
101
  * through `uploadProgress`.
64
102
  */
65
103
  export declare function FileUpload({ label, value, defaultValue, onChange, acceptedFileTypes, allowsMultiple, maxSize, onError, showPreview, uploadProgress, chooseLabel, description, errorMessage, isInvalid, isDisabled, isReadOnly, isRequired, fullWidth, className, style, ...rest }: FileUploadProps): React.JSX.Element;
104
+ export {};
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  export interface PireFile {
3
3
  /** The browser's `File`. Pire uploads nothing — that is the app's job. */
4
4
  file: File;
5
- /** Object URL, only for images with `showPreview`. Revoked on unmount. */
5
+ /** Object URL, only for images with `showPreview`. Revoked once the file leaves the list. */
6
6
  previewUrl?: string;
7
7
  }
8
8
  export interface FileRejection {
@@ -57,10 +57,48 @@ export declare function screenFiles(files: File[], { maxSize, acceptedFileTypes
57
57
  accepted: File[];
58
58
  rejected: FileRejection[];
59
59
  };
60
+ type FileListOptions = Pick<FileUploadProps, 'value' | 'defaultValue' | 'onChange' | 'acceptedFileTypes' | 'allowsMultiple' | 'maxSize' | 'onError' | 'showPreview' | 'isDisabled' | 'isReadOnly'>;
61
+ /**
62
+ * The file list behind `FileUpload` and `FileDropZone`: controlled / uncontrolled state, screening,
63
+ * preview URLs, and add / remove. `accept` ignores everything while the field is disabled or
64
+ * read-only, whichever path the files arrived by.
65
+ */
66
+ export declare function useFileList({ value, defaultValue, onChange, acceptedFileTypes, allowsMultiple, maxSize, onError, showPreview, isDisabled, isReadOnly, }: FileListOptions): {
67
+ files: PireFile[];
68
+ accept: (picked: File[]) => void;
69
+ remove: (target: File) => void;
70
+ };
71
+ /**
72
+ * Ids for the label, hint and error. Neither file field has a React Aria field context, so each
73
+ * wires these to its own control by hand.
74
+ */
75
+ export declare function useFileFieldIds({ label, description, errorMessage, isInvalid, }: Pick<FileUploadProps, 'label' | 'description' | 'errorMessage' | 'isInvalid'>): {
76
+ id: string;
77
+ labelId: string | undefined;
78
+ hintId: string | undefined;
79
+ errorId: string | undefined;
80
+ describedBy: string | undefined;
81
+ };
82
+ export declare function FileFieldLabel({ id, label, isRequired, }: {
83
+ id?: string;
84
+ label?: React.ReactNode;
85
+ isRequired?: boolean;
86
+ }): React.JSX.Element | null;
87
+ /** The chosen files, the upload progress, then the hint and the error — everything below the control. */
88
+ export declare function FileFieldFooter({ files, onRemove, uploadProgress, description, errorMessage, hintId, errorId, }: {
89
+ files: PireFile[];
90
+ /** Omitted while the field is disabled or read-only, which hides the remove buttons. */
91
+ onRemove?: (file: File) => void;
92
+ uploadProgress?: number;
93
+ description?: React.ReactNode;
94
+ errorMessage?: React.ReactNode;
95
+ hintId?: string;
96
+ errorId?: string;
97
+ }): React.JSX.Element;
60
98
  /**
61
99
  * File picker with a list of what was chosen. Pire hands back `File`s through `onChange` and
62
100
  * uploads nothing: the app owns the `FormData`, the request and the progress it reports back
63
101
  * through `uploadProgress`.
64
102
  */
65
103
  export declare function FileUpload({ label, value, defaultValue, onChange, acceptedFileTypes, allowsMultiple, maxSize, onError, showPreview, uploadProgress, chooseLabel, description, errorMessage, isInvalid, isDisabled, isReadOnly, isRequired, fullWidth, className, style, ...rest }: FileUploadProps): React.JSX.Element;
66
- //# sourceMappingURL=FileUpload.d.ts.map
104
+ export {};
@@ -24,4 +24,3 @@ export interface FormFieldProps extends Omit<React.HTMLAttributes<HTMLDivElement
24
24
  /** Label + control + hint/error wrapper for controls that do not manage their own label
25
25
  * (most Pire controls do — use their `label` prop first). */
26
26
  export declare function FormField({ label, htmlFor, isRequired, hint, error, layout, help, children, className, ...rest }: FormFieldProps): React.JSX.Element;
27
- //# sourceMappingURL=FormField.d.ts.map