@orianatech/pire 2.1.1 → 2.3.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.
- package/dist/components/core/Avatar.d.ts +0 -1
- package/dist/components/core/Badge.d.cts +2 -5
- package/dist/components/core/Badge.d.ts +2 -6
- package/dist/components/core/Button.d.ts +0 -1
- package/dist/components/core/Card.d.ts +0 -1
- package/dist/components/core/ComingSoonMark.d.ts +0 -1
- package/dist/components/core/Heading.d.cts +1 -1
- package/dist/components/core/Heading.d.ts +1 -2
- package/dist/components/core/Icon.d.cts +1 -2
- package/dist/components/core/Icon.d.ts +1 -3
- package/dist/components/core/IconButton.d.ts +0 -1
- package/dist/components/core/Kbd.d.ts +0 -1
- package/dist/components/core/Link.d.ts +0 -1
- package/dist/components/core/SegmentedControl.d.cts +1 -1
- package/dist/components/core/SegmentedControl.d.ts +1 -2
- package/dist/components/core/Separator.d.ts +0 -1
- package/dist/components/core/Tag.d.cts +1 -1
- package/dist/components/core/Tag.d.ts +1 -2
- package/dist/components/core/Text.d.cts +9 -1
- package/dist/components/core/Text.d.ts +9 -2
- package/dist/components/core/icon-data.generated.d.ts +0 -1
- package/dist/components/core/icon-map.d.ts +0 -1
- package/dist/components/data/BarChart.d.cts +1 -1
- package/dist/components/data/BarChart.d.ts +1 -2
- package/dist/components/data/BarList.d.ts +0 -1
- package/dist/components/data/ChartFrame.d.ts +0 -1
- package/dist/components/data/DataTable.d.cts +13 -2
- package/dist/components/data/DataTable.d.ts +13 -3
- package/dist/components/data/DescriptionList.d.ts +0 -1
- package/dist/components/data/DonutChart.d.cts +1 -1
- package/dist/components/data/DonutChart.d.ts +1 -2
- package/dist/components/data/FilterBar.d.ts +0 -1
- package/dist/components/data/KpiTile.d.ts +0 -1
- package/dist/components/data/LineChart.d.cts +1 -1
- package/dist/components/data/LineChart.d.ts +1 -2
- package/dist/components/data/LinkList.d.ts +0 -1
- package/dist/components/data/ObjectHeader.d.ts +0 -1
- package/dist/components/data/RecordCard.d.ts +0 -1
- package/dist/components/data/Timeline.d.ts +0 -1
- package/dist/components/data/ViewSwitcher.d.ts +0 -1
- package/dist/components/data/chartGeometry.d.ts +0 -1
- package/dist/components/feedback/Dialog.d.cts +11 -0
- package/dist/components/feedback/Dialog.d.ts +11 -1
- package/dist/components/feedback/InlineMessage.d.cts +2 -0
- package/dist/components/feedback/InlineMessage.d.ts +2 -1
- package/dist/components/feedback/ProgressBar.d.cts +5 -1
- package/dist/components/feedback/ProgressBar.d.ts +5 -2
- package/dist/components/feedback/Skeleton.d.ts +0 -1
- package/dist/components/feedback/Toast.d.cts +1 -1
- package/dist/components/feedback/Toast.d.ts +1 -2
- package/dist/components/feedback/Tooltip.d.ts +0 -1
- package/dist/components/forms/CalendarMonth.d.cts +6 -0
- package/dist/components/forms/CalendarMonth.d.ts +6 -0
- package/dist/components/forms/Checkbox.d.ts +0 -1
- package/dist/components/forms/ChoiceCardGroup.d.cts +3 -12
- package/dist/components/forms/ChoiceCardGroup.d.ts +3 -13
- package/dist/components/forms/ComboBox.d.cts +2 -11
- package/dist/components/forms/ComboBox.d.ts +2 -12
- package/dist/components/forms/ComboBoxListBox.d.cts +35 -0
- package/dist/components/forms/ComboBoxListBox.d.ts +35 -0
- package/dist/components/forms/DatePicker.d.cts +3 -13
- package/dist/components/forms/DatePicker.d.ts +3 -14
- package/dist/components/forms/DateRangePicker.d.cts +5 -15
- package/dist/components/forms/DateRangePicker.d.ts +5 -16
- package/dist/components/forms/FieldClearButton.d.cts +12 -0
- package/dist/components/forms/FieldClearButton.d.ts +12 -0
- package/dist/components/forms/FieldDescription.d.ts +0 -1
- package/dist/components/forms/FieldHelp.d.cts +24 -1
- package/dist/components/forms/FieldHelp.d.ts +24 -2
- package/dist/components/forms/FieldLabel.d.cts +2 -5
- package/dist/components/forms/FieldLabel.d.ts +2 -6
- package/dist/components/forms/FileUpload.d.cts +37 -4
- package/dist/components/forms/FileUpload.d.ts +37 -5
- package/dist/components/forms/FormField.d.ts +0 -1
- package/dist/components/forms/Input.d.cts +2 -11
- package/dist/components/forms/Input.d.ts +2 -12
- package/dist/components/forms/MultiComboBox.d.cts +2 -11
- package/dist/components/forms/MultiComboBox.d.ts +2 -12
- package/dist/components/forms/NumberField.d.cts +3 -13
- package/dist/components/forms/NumberField.d.ts +3 -14
- package/dist/components/forms/QuantityStepper.d.ts +0 -1
- package/dist/components/forms/Radio.d.ts +0 -1
- package/dist/components/forms/Select.d.cts +2 -11
- package/dist/components/forms/Select.d.ts +2 -12
- package/dist/components/forms/Switch.d.ts +0 -1
- package/dist/components/forms/TextArea.d.cts +2 -11
- package/dist/components/forms/TextArea.d.ts +2 -12
- package/dist/components/forms/ValueHelpField.d.cts +7 -3
- package/dist/components/forms/ValueHelpField.d.ts +7 -4
- package/dist/components/forms/dateValues.d.cts +2 -5
- package/dist/components/forms/dateValues.d.ts +2 -6
- package/dist/components/layout/FooterBar.d.ts +0 -1
- package/dist/components/layout/PageBand.d.ts +0 -1
- package/dist/components/layout/PageHeader.d.cts +7 -1
- package/dist/components/layout/PageHeader.d.ts +7 -2
- package/dist/components/layout/SectionHeader.d.ts +0 -1
- package/dist/components/layout/SelectionBar.d.cts +1 -2
- package/dist/components/layout/SelectionBar.d.ts +1 -3
- package/dist/components/layout/SplitPane.d.ts +0 -1
- package/dist/components/navigation/Breadcrumb.d.ts +0 -1
- package/dist/components/navigation/Menu.d.ts +0 -1
- package/dist/components/navigation/Pagination.d.ts +0 -1
- package/dist/components/navigation/Ribbon.d.cts +1 -1
- package/dist/components/navigation/Ribbon.d.ts +1 -2
- package/dist/components/navigation/ShellBar.d.ts +0 -1
- package/dist/components/navigation/ShellRail.d.ts +0 -1
- package/dist/components/navigation/SideNav.d.cts +3 -6
- package/dist/components/navigation/SideNav.d.ts +3 -7
- package/dist/components/navigation/Tabs.d.cts +1 -1
- package/dist/components/navigation/Tabs.d.ts +1 -2
- package/dist/components/patterns/AppLauncher.d.cts +1 -2
- package/dist/components/patterns/AppLauncher.d.ts +1 -3
- package/dist/components/patterns/CommandPalette.d.ts +0 -1
- package/dist/components/patterns/ConfirmDialog.d.ts +0 -1
- package/dist/components/patterns/EmptyState.d.ts +0 -1
- package/dist/components/patterns/FileDropZone.d.cts +1 -1
- package/dist/components/patterns/FileDropZone.d.ts +1 -2
- package/dist/components/patterns/NumPad.d.cts +2 -8
- package/dist/components/patterns/NumPad.d.ts +2 -9
- package/dist/components/patterns/SidePanel.d.ts +0 -1
- package/dist/components/patterns/ValueHelpDialog.d.cts +5 -5
- package/dist/components/patterns/ValueHelpDialog.d.ts +5 -6
- package/dist/components/utils/cx.d.ts +0 -1
- package/dist/components/utils/decimalSeparator.d.cts +1 -4
- package/dist/components/utils/decimalSeparator.d.ts +1 -5
- package/dist/components/utils/devWarn.d.cts +5 -3
- package/dist/components/utils/devWarn.d.ts +5 -4
- package/dist/components/utils/useDocumentKeyDown.d.cts +5 -0
- package/dist/components/utils/useDocumentKeyDown.d.ts +5 -0
- package/dist/components/utils/useLoadMoreOnScroll.d.ts +0 -1
- package/dist/components.css +154 -85
- package/dist/i18n/PireIntlProvider.d.ts +0 -1
- package/dist/i18n/messages.d.ts +0 -1
- package/dist/index.cjs +1352 -1394
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.js +1216 -1281
- package/dist/index.js.map +1 -1
- package/dist/tokens/base.css +2 -5
- package/dist/tokens/colors.css +13 -8
- package/dist/tokens/elevation.css +15 -0
- package/dist/tokens/themes.css +6 -12
- package/package.json +1 -1
- package/dist/components/core/Avatar.d.ts.map +0 -1
- package/dist/components/core/Badge.d.ts.map +0 -1
- package/dist/components/core/Button.d.ts.map +0 -1
- package/dist/components/core/Card.d.ts.map +0 -1
- package/dist/components/core/ComingSoonMark.d.ts.map +0 -1
- package/dist/components/core/Heading.d.ts.map +0 -1
- package/dist/components/core/Icon.d.ts.map +0 -1
- package/dist/components/core/IconButton.d.ts.map +0 -1
- package/dist/components/core/Kbd.d.ts.map +0 -1
- package/dist/components/core/Link.d.ts.map +0 -1
- package/dist/components/core/SegmentedControl.d.ts.map +0 -1
- package/dist/components/core/Separator.d.ts.map +0 -1
- package/dist/components/core/Tag.d.ts.map +0 -1
- package/dist/components/core/Text.d.ts.map +0 -1
- package/dist/components/core/icon-data.generated.d.ts.map +0 -1
- package/dist/components/core/icon-map.d.ts.map +0 -1
- package/dist/components/data/BarChart.d.ts.map +0 -1
- package/dist/components/data/BarList.d.ts.map +0 -1
- package/dist/components/data/ChartFrame.d.ts.map +0 -1
- package/dist/components/data/DataTable.d.ts.map +0 -1
- package/dist/components/data/DescriptionList.d.ts.map +0 -1
- package/dist/components/data/DonutChart.d.ts.map +0 -1
- package/dist/components/data/FilterBar.d.ts.map +0 -1
- package/dist/components/data/KpiTile.d.ts.map +0 -1
- package/dist/components/data/LineChart.d.ts.map +0 -1
- package/dist/components/data/LinkList.d.ts.map +0 -1
- package/dist/components/data/ObjectHeader.d.ts.map +0 -1
- package/dist/components/data/RecordCard.d.ts.map +0 -1
- package/dist/components/data/Timeline.d.ts.map +0 -1
- package/dist/components/data/ViewSwitcher.d.ts.map +0 -1
- package/dist/components/data/chartGeometry.d.ts.map +0 -1
- package/dist/components/feedback/Dialog.d.ts.map +0 -1
- package/dist/components/feedback/InlineMessage.d.ts.map +0 -1
- package/dist/components/feedback/ProgressBar.d.ts.map +0 -1
- package/dist/components/feedback/Skeleton.d.ts.map +0 -1
- package/dist/components/feedback/Toast.d.ts.map +0 -1
- package/dist/components/feedback/Tooltip.d.ts.map +0 -1
- package/dist/components/forms/Checkbox.d.ts.map +0 -1
- package/dist/components/forms/ChoiceCardGroup.d.ts.map +0 -1
- package/dist/components/forms/ComboBox.d.ts.map +0 -1
- package/dist/components/forms/DatePicker.d.ts.map +0 -1
- package/dist/components/forms/DateRangePicker.d.ts.map +0 -1
- package/dist/components/forms/FieldDescription.d.ts.map +0 -1
- package/dist/components/forms/FieldHelp.d.ts.map +0 -1
- package/dist/components/forms/FieldLabel.d.ts.map +0 -1
- package/dist/components/forms/FileUpload.d.ts.map +0 -1
- package/dist/components/forms/FormField.d.ts.map +0 -1
- package/dist/components/forms/Input.d.ts.map +0 -1
- package/dist/components/forms/MultiComboBox.d.ts.map +0 -1
- package/dist/components/forms/NumberField.d.ts.map +0 -1
- package/dist/components/forms/QuantityStepper.d.ts.map +0 -1
- package/dist/components/forms/Radio.d.ts.map +0 -1
- package/dist/components/forms/Select.d.ts.map +0 -1
- package/dist/components/forms/Switch.d.ts.map +0 -1
- package/dist/components/forms/TextArea.d.ts.map +0 -1
- package/dist/components/forms/ValueHelpField.d.ts.map +0 -1
- package/dist/components/forms/dateValues.d.ts.map +0 -1
- package/dist/components/layout/FooterBar.d.ts.map +0 -1
- package/dist/components/layout/PageBand.d.ts.map +0 -1
- package/dist/components/layout/PageHeader.d.ts.map +0 -1
- package/dist/components/layout/SectionHeader.d.ts.map +0 -1
- package/dist/components/layout/SelectionBar.d.ts.map +0 -1
- package/dist/components/layout/SplitPane.d.ts.map +0 -1
- package/dist/components/navigation/Breadcrumb.d.ts.map +0 -1
- package/dist/components/navigation/Menu.d.ts.map +0 -1
- package/dist/components/navigation/Pagination.d.ts.map +0 -1
- package/dist/components/navigation/Ribbon.d.ts.map +0 -1
- package/dist/components/navigation/ShellBar.d.ts.map +0 -1
- package/dist/components/navigation/ShellRail.d.ts.map +0 -1
- package/dist/components/navigation/SideNav.d.ts.map +0 -1
- package/dist/components/navigation/Tabs.d.ts.map +0 -1
- package/dist/components/patterns/AppLauncher.d.ts.map +0 -1
- package/dist/components/patterns/CommandPalette.d.ts.map +0 -1
- package/dist/components/patterns/ConfirmDialog.d.ts.map +0 -1
- package/dist/components/patterns/EmptyState.d.ts.map +0 -1
- package/dist/components/patterns/FileDropZone.d.ts.map +0 -1
- package/dist/components/patterns/NumPad.d.ts.map +0 -1
- package/dist/components/patterns/SidePanel.d.ts.map +0 -1
- package/dist/components/patterns/ValueHelpDialog.d.ts.map +0 -1
- package/dist/components/utils/cx.d.ts.map +0 -1
- package/dist/components/utils/decimalSeparator.d.ts.map +0 -1
- package/dist/components/utils/devWarn.d.ts.map +0 -1
- package/dist/components/utils/focusField.d.cts +0 -11
- package/dist/components/utils/focusField.d.ts +0 -12
- package/dist/components/utils/focusField.d.ts.map +0 -1
- package/dist/components/utils/useLoadMoreOnScroll.d.ts.map +0 -1
- package/dist/i18n/PireIntlProvider.d.ts.map +0 -1
- package/dist/i18n/messages.d.ts.map +0 -1
- 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,
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
103
|
-
*
|
|
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
|
|
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
|
|
103
|
-
*
|
|
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;
|
|
@@ -1,4 +1,17 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * 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
|
-
import
|
|
1
|
+
import * 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
|
-
|
|
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
|
|
23
|
-
*
|
|
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
|
|
23
|
-
*
|
|
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
|
|
@@ -57,15 +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'>;
|
|
60
61
|
/**
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
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.
|
|
64
65
|
*/
|
|
65
|
-
export declare function
|
|
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;
|
|
66
98
|
/**
|
|
67
99
|
* File picker with a list of what was chosen. Pire hands back `File`s through `onChange` and
|
|
68
100
|
* uploads nothing: the app owns the `FormData`, the request and the progress it reports back
|
|
69
101
|
* through `uploadProgress`.
|
|
70
102
|
*/
|
|
71
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 {};
|
|
@@ -57,16 +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'>;
|
|
60
61
|
/**
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
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.
|
|
64
65
|
*/
|
|
65
|
-
export declare function
|
|
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;
|
|
66
98
|
/**
|
|
67
99
|
* File picker with a list of what was chosen. Pire hands back `File`s through `onChange` and
|
|
68
100
|
* uploads nothing: the app owns the `FormData`, the request and the progress it reports back
|
|
69
101
|
* through `uploadProgress`.
|
|
70
102
|
*/
|
|
71
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;
|
|
72
|
-
|
|
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
|