@danske/sapphire-react-lab 0.89.0 → 0.90.2
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/build/cjs/index.js +296 -3054
- package/build/cjs/index.js.map +1 -1
- package/build/esm/Accordion/index.js.map +1 -1
- package/build/esm/Accordion/src/Accordion.js +2 -2
- package/build/esm/Accordion/src/Accordion.js.map +1 -1
- package/build/esm/Accordion/src/AccordionHeading.js +1 -1
- package/build/esm/Accordion/src/AccordionHeading.js.map +1 -1
- package/build/esm/Accordion/src/AccordionItem.js.map +1 -1
- package/build/esm/FileDropzone/src/FileDropzone.js +3 -4
- package/build/esm/FileDropzone/src/FileDropzone.js.map +1 -1
- package/build/esm/Filtering/src/FilterDropdown.js +9 -8
- package/build/esm/Filtering/src/FilterDropdown.js.map +1 -1
- package/build/esm/LabeledValue/src/LabeledValue.js +2 -2
- package/build/esm/LabeledValue/src/LabeledValue.js.map +1 -1
- package/build/esm/NumberField/src/NumberField.js +11 -11
- package/build/esm/NumberField/src/NumberField.js.map +1 -1
- package/build/esm/NumberField/src/StepperButton.js +1 -1
- package/build/esm/NumberField/src/StepperButton.js.map +1 -1
- package/build/esm/TagGroup/src/Tag.js +2 -2
- package/build/esm/TagGroup/src/Tag.js.map +1 -1
- package/build/esm/TagGroup/src/TagGroup.js.map +1 -1
- package/build/esm/index.js +0 -17
- package/build/esm/index.js.map +1 -1
- package/build/index.d.ts +28 -756
- package/package.json +5 -13
- package/build/esm/AlertDialog/src/AlertDialog.js +0 -75
- package/build/esm/AlertDialog/src/AlertDialog.js.map +0 -1
- package/build/esm/Avatar/src/Avatar.js +0 -76
- package/build/esm/Avatar/src/Avatar.js.map +0 -1
- package/build/esm/Calendar/i18n/da-DK.js +0 -9
- package/build/esm/Calendar/i18n/da-DK.js.map +0 -1
- package/build/esm/Calendar/i18n/de-DE.js +0 -9
- package/build/esm/Calendar/i18n/de-DE.js.map +0 -1
- package/build/esm/Calendar/i18n/en-US.js +0 -9
- package/build/esm/Calendar/i18n/en-US.js.map +0 -1
- package/build/esm/Calendar/i18n/fi-FI.js +0 -9
- package/build/esm/Calendar/i18n/fi-FI.js.map +0 -1
- package/build/esm/Calendar/i18n/index.js +0 -20
- package/build/esm/Calendar/i18n/index.js.map +0 -1
- package/build/esm/Calendar/i18n/nb-NO.js +0 -9
- package/build/esm/Calendar/i18n/nb-NO.js.map +0 -1
- package/build/esm/Calendar/i18n/pl-PL.js +0 -9
- package/build/esm/Calendar/i18n/pl-PL.js.map +0 -1
- package/build/esm/Calendar/i18n/sv-SE.js +0 -9
- package/build/esm/Calendar/i18n/sv-SE.js.map +0 -1
- package/build/esm/Calendar/src/Calendar.js +0 -121
- package/build/esm/Calendar/src/Calendar.js.map +0 -1
- package/build/esm/Calendar/src/CalendarButtons.js +0 -96
- package/build/esm/Calendar/src/CalendarButtons.js.map +0 -1
- package/build/esm/Calendar/src/CalendarDaysGrid.js +0 -169
- package/build/esm/Calendar/src/CalendarDaysGrid.js.map +0 -1
- package/build/esm/Calendar/src/CalendarHeader.js +0 -58
- package/build/esm/Calendar/src/CalendarHeader.js.map +0 -1
- package/build/esm/Calendar/src/CalendarMonthOrYearCell.js +0 -79
- package/build/esm/Calendar/src/CalendarMonthOrYearCell.js.map +0 -1
- package/build/esm/Calendar/src/CalendarMonthsGrid.js +0 -58
- package/build/esm/Calendar/src/CalendarMonthsGrid.js.map +0 -1
- package/build/esm/Calendar/src/CalendarPageAnimation.js +0 -67
- package/build/esm/Calendar/src/CalendarPageAnimation.js.map +0 -1
- package/build/esm/Calendar/src/CalendarYearsGrid.js +0 -52
- package/build/esm/Calendar/src/CalendarYearsGrid.js.map +0 -1
- package/build/esm/Calendar/src/RangeCalendar.js +0 -119
- package/build/esm/Calendar/src/RangeCalendar.js.map +0 -1
- package/build/esm/Calendar/src/useCustomDurationCalendarGrid.js +0 -57
- package/build/esm/Calendar/src/useCustomDurationCalendarGrid.js.map +0 -1
- package/build/esm/Calendar/src/useRangeCalendarState.js +0 -57
- package/build/esm/Calendar/src/useRangeCalendarState.js.map +0 -1
- package/build/esm/Calendar/src/useSapphireCalendarState.js +0 -86
- package/build/esm/Calendar/src/useSapphireCalendarState.js.map +0 -1
- package/build/esm/Calendar/src/utils.js +0 -12
- package/build/esm/Calendar/src/utils.js.map +0 -1
- package/build/esm/DateField/i18n/da-DK.js +0 -7
- package/build/esm/DateField/i18n/da-DK.js.map +0 -1
- package/build/esm/DateField/i18n/de-DE.js +0 -7
- package/build/esm/DateField/i18n/de-DE.js.map +0 -1
- package/build/esm/DateField/i18n/en-US.js +0 -7
- package/build/esm/DateField/i18n/en-US.js.map +0 -1
- package/build/esm/DateField/i18n/fi-FI.js +0 -7
- package/build/esm/DateField/i18n/fi-FI.js.map +0 -1
- package/build/esm/DateField/i18n/index.js +0 -20
- package/build/esm/DateField/i18n/index.js.map +0 -1
- package/build/esm/DateField/i18n/nb-NO.js +0 -7
- package/build/esm/DateField/i18n/nb-NO.js.map +0 -1
- package/build/esm/DateField/i18n/pl-PL.js +0 -7
- package/build/esm/DateField/i18n/pl-PL.js.map +0 -1
- package/build/esm/DateField/i18n/sv-SE.js +0 -7
- package/build/esm/DateField/i18n/sv-SE.js.map +0 -1
- package/build/esm/DateField/src/DateField.js +0 -129
- package/build/esm/DateField/src/DateField.js.map +0 -1
- package/build/esm/DateField/src/DateFieldButton.js +0 -44
- package/build/esm/DateField/src/DateFieldButton.js.map +0 -1
- package/build/esm/DateField/src/DateInput.js +0 -81
- package/build/esm/DateField/src/DateInput.js.map +0 -1
- package/build/esm/DateField/src/DateRangeField.js +0 -154
- package/build/esm/DateField/src/DateRangeField.js.map +0 -1
- package/build/esm/DateField/src/DateRangeInput.js +0 -90
- package/build/esm/DateField/src/DateRangeInput.js.map +0 -1
- package/build/esm/DateField/src/DateSegment.js +0 -52
- package/build/esm/DateField/src/DateSegment.js.map +0 -1
- package/build/esm/DateField/src/helpers.js +0 -14
- package/build/esm/DateField/src/helpers.js.map +0 -1
- package/build/esm/DateField/src/useDateRangePickerState.js +0 -57
- package/build/esm/DateField/src/useDateRangePickerState.js.map +0 -1
- package/build/esm/DateField/src/utils/placeholders.js +0 -91
- package/build/esm/DateField/src/utils/placeholders.js.map +0 -1
- package/build/esm/DateField/src/utils/segments.js +0 -46
- package/build/esm/DateField/src/utils/segments.js.map +0 -1
- package/build/esm/FeedbackMessage/src/FeedbackMessage.js +0 -87
- package/build/esm/FeedbackMessage/src/FeedbackMessage.js.map +0 -1
- package/build/esm/Fieldset/src/Fieldset.js +0 -81
- package/build/esm/Fieldset/src/Fieldset.js.map +0 -1
- package/build/esm/NotificationBadge/src/NotificationBadge.js +0 -74
- package/build/esm/NotificationBadge/src/NotificationBadge.js.map +0 -1
- package/build/esm/SearchField/src/SearchField.js +0 -130
- package/build/esm/SearchField/src/SearchField.js.map +0 -1
- package/build/esm/SearchField/src/useComboBoxState.js +0 -42
- package/build/esm/SearchField/src/useComboBoxState.js.map +0 -1
- package/build/esm/Toast/src/Toast.js +0 -77
- package/build/esm/Toast/src/Toast.js.map +0 -1
- package/build/esm/Toast/src/ToastCloseButton.js +0 -50
- package/build/esm/Toast/src/ToastCloseButton.js.map +0 -1
- package/build/esm/Toast/src/ToastProvider.js +0 -60
- package/build/esm/Toast/src/ToastProvider.js.map +0 -1
- package/build/esm/Toast/src/ToastRegion.js +0 -66
- package/build/esm/Toast/src/ToastRegion.js.map +0 -1
- package/build/esm/Toast/src/context.js +0 -10
- package/build/esm/Toast/src/context.js.map +0 -1
- package/build/esm/Toast/src/useShowToast.js +0 -25
- package/build/esm/Toast/src/useShowToast.js.map +0 -1
- package/build/esm/ToggleButton/src/ToggleButton.js +0 -85
- package/build/esm/ToggleButton/src/ToggleButton.js.map +0 -1
- package/build/esm/Typography/index.js +0 -14
- package/build/esm/Typography/index.js.map +0 -1
- package/build/esm/Typography/src/Body.js +0 -66
- package/build/esm/Typography/src/Body.js.map +0 -1
- package/build/esm/Typography/src/Caption.js +0 -59
- package/build/esm/Typography/src/Caption.js.map +0 -1
- package/build/esm/Typography/src/Heading.js +0 -53
- package/build/esm/Typography/src/Heading.js.map +0 -1
- package/build/esm/Typography/src/Subheading.js +0 -63
- package/build/esm/Typography/src/Subheading.js.map +0 -1
package/build/index.d.ts
CHANGED
|
@@ -1,169 +1,13 @@
|
|
|
1
|
-
import * as _react_types_shared from '@react-types/shared';
|
|
2
|
-
import { PressEvents, Validation, RangeValue, HelpTextProps, LabelableProps, CollectionBase, DOMProps, Expandable, ItemProps, AriaLabelingProps, FocusableRefValue } from '@react-types/shared';
|
|
3
1
|
import * as React from 'react';
|
|
4
|
-
import React__default, { ReactNode,
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { DateValue } from '@internationalized/date';
|
|
8
|
-
import { AriaCalendarProps, AriaRangeCalendarProps } from '@react-aria/calendar';
|
|
9
|
-
import { CalendarStateOptions, RangeCalendarStateOptions as RangeCalendarStateOptions$1 } from '@react-stately/calendar';
|
|
10
|
-
import { DateValue as DateValue$1, AriaDatePickerProps, AriaDateRangePickerProps } from '@react-aria/datepicker';
|
|
11
|
-
import { DateRangePickerStateOptions as DateRangePickerStateOptions$1 } from '@react-stately/datepicker';
|
|
12
|
-
import { ComboBoxProps } from '@react-types/combobox';
|
|
13
|
-
import { AriaSearchFieldProps } from '@react-aria/searchfield';
|
|
14
|
-
import { AriaToastRegionProps } from '@react-aria/toast';
|
|
15
|
-
import { ToastState } from '@react-stately/toast';
|
|
2
|
+
import React__default, { ReactNode, RefObject, Key } from 'react';
|
|
3
|
+
import { SapphireStyleProps, PopoverTriggerProps, TypographyHeadingProps } from '@danske/sapphire-react';
|
|
4
|
+
import { CollectionBase, DOMProps, Expandable, ItemProps, AriaLabelingProps, Validation, FocusableRefValue, PressEvents } from '@react-types/shared';
|
|
16
5
|
import { HoverProps } from '@react-aria/interactions';
|
|
17
6
|
import { DropOptions } from '@react-aria/dnd';
|
|
18
|
-
import { AriaModalOverlayProps } from '@react-aria/overlays';
|
|
19
7
|
import { AriaNumberFieldProps } from '@react-aria/numberfield';
|
|
20
8
|
export { useLocale } from '@react-aria/i18n';
|
|
21
9
|
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* @default 'medium'
|
|
25
|
-
*/
|
|
26
|
-
size?: 'large' | 'medium' | 'small';
|
|
27
|
-
onChange?: (selected: boolean) => void;
|
|
28
|
-
isSelected?: boolean;
|
|
29
|
-
defaultSelected?: boolean;
|
|
30
|
-
} & (ButtonWithIconProps | ButtonWithoutIconProps);
|
|
31
|
-
interface ButtonWithIconProps {
|
|
32
|
-
/**
|
|
33
|
-
* The icon placed either before or after the `label`, based on `iconAlign` prop.
|
|
34
|
-
* */
|
|
35
|
-
icon: React__default.ReactNode;
|
|
36
|
-
/**
|
|
37
|
-
* The icon placement relative to the `label`.
|
|
38
|
-
* */
|
|
39
|
-
iconAlign?: 'left' | 'right';
|
|
40
|
-
}
|
|
41
|
-
interface ButtonWithoutIconProps {
|
|
42
|
-
icon?: never;
|
|
43
|
-
iconAlign?: never;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* A button with a toggleable `isSelected` state. By default, the selection is toggled when the
|
|
47
|
-
* button is pressed, allowing user to switch between two states or modes.
|
|
48
|
-
*/
|
|
49
|
-
declare const ToggleButton: React__default.ForwardRefExoticComponent<SapphireToggleButtonProps & React__default.RefAttributes<_react_types_shared.FocusableRefValue<HTMLButtonElement, HTMLButtonElement>>>;
|
|
50
|
-
|
|
51
|
-
declare type CalendarView = 'days' | 'months' | 'years';
|
|
52
|
-
interface SapphireCalendarStateOptions<T extends DateValue> extends CalendarStateOptions<T> {
|
|
53
|
-
/**
|
|
54
|
-
* Controls the calendar's view (day, month, year).
|
|
55
|
-
*/
|
|
56
|
-
view?: CalendarView;
|
|
57
|
-
/**
|
|
58
|
-
* The view of the calendar when it first mounts (uncontrolled).
|
|
59
|
-
*/
|
|
60
|
-
defaultView?: CalendarView;
|
|
61
|
-
/**
|
|
62
|
-
* Handler that is called when the view is changed.
|
|
63
|
-
*/
|
|
64
|
-
onViewChange?: (value: CalendarView) => void;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
interface SapphireCalendarProps<T extends DateValue = DateValue> extends SapphireStyleProps, Omit<AriaCalendarProps<T>, 'validationState' | 'errorMessage'>, Omit<SapphireCalendarStateOptions<T>, 'createCalendar'> {
|
|
68
|
-
/**
|
|
69
|
-
* Whether week numbers are visible as a first column
|
|
70
|
-
*/
|
|
71
|
-
showWeekNumbers?: boolean;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Displays a calendar and allows users to select a single date. It displays a grid of days in one
|
|
75
|
-
* month, by default, and the user can navigate to previous and next months. It's also possible
|
|
76
|
-
* to navigate to months and years view, to quickly jump to a date far away from the focused date.
|
|
77
|
-
*/
|
|
78
|
-
declare const Calendar: <T extends DateValue = DateValue>({ showWeekNumbers, ...props }: Omit<SapphireCalendarProps<T>, "locale">) => JSX.Element;
|
|
79
|
-
|
|
80
|
-
declare type OriginalOnChange$1<T extends DateValue> = NonNullable<RangeCalendarStateOptions$1<T>['onChange']>;
|
|
81
|
-
declare type RangeCalendarStateOptions<T extends DateValue, P extends string> = Omit<RangeCalendarStateOptions$1<T>, 'onChange'> & {
|
|
82
|
-
onChange?: (value: Parameters<OriginalOnChange$1<T>>[0], predefinedRange?: P) => ReturnType<OriginalOnChange$1<T>>;
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
interface PredefinedDateRange {
|
|
86
|
-
label: string;
|
|
87
|
-
dateRange: {
|
|
88
|
-
start: DateValue;
|
|
89
|
-
end: DateValue;
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
interface SapphireRangeCalendarProps<T extends DateValue = DateValue, P extends string = string> extends SapphireStyleProps, Omit<AriaRangeCalendarProps<T>, 'validationState' | 'errorMessage' | 'allowsNonContiguousRanges' | 'onChange'> {
|
|
93
|
-
/**
|
|
94
|
-
* This callback also gives you the information if the selected range was a
|
|
95
|
-
* predefined date according to the `predefinedRanges` prop.
|
|
96
|
-
*/
|
|
97
|
-
onChange?: RangeCalendarStateOptions<DateValue, P>['onChange'];
|
|
98
|
-
/**
|
|
99
|
-
* Whether week numbers are visible as a first column
|
|
100
|
-
*/
|
|
101
|
-
showWeekNumbers?: boolean;
|
|
102
|
-
/**
|
|
103
|
-
* Whether to show two months at the same time.
|
|
104
|
-
*/
|
|
105
|
-
showTwoMonths?: boolean;
|
|
106
|
-
/**
|
|
107
|
-
* A set of predefined date ranges the user can more conveniently select.
|
|
108
|
-
*/
|
|
109
|
-
predefinedRanges?: Record<P, PredefinedDateRange>;
|
|
110
|
-
/**
|
|
111
|
-
* Whether range is allowed to span unavailable dates.
|
|
112
|
-
*/
|
|
113
|
-
allowUnavailableDatesWithinRange?: boolean;
|
|
114
|
-
}
|
|
115
|
-
declare const _RangeCalendar: <T extends DateValue = DateValue, P extends string = string>({ showWeekNumbers, showTwoMonths, allowUnavailableDatesWithinRange, predefinedRanges, ...props }: SapphireRangeCalendarProps<T, P>, forwardedRef: React__default.ForwardedRef<HTMLDivElement>) => JSX.Element;
|
|
116
|
-
/**
|
|
117
|
-
* Displays a calendar and allow users to select a consecutive range of dates.
|
|
118
|
-
* One or two months can be visible at the same time.
|
|
119
|
-
*/
|
|
120
|
-
declare const RangeCalendar: <T extends DateValue, P extends string>(props: SapphireRangeCalendarProps<T, P> & {
|
|
121
|
-
ref?: React__default.ForwardedRef<HTMLDivElement> | undefined;
|
|
122
|
-
}) => ReturnType<typeof _RangeCalendar>;
|
|
123
|
-
|
|
124
|
-
declare type NotificationBadgeProps = {
|
|
125
|
-
/**
|
|
126
|
-
* Boolean to perform or not perform the animation
|
|
127
|
-
* @default 'true'
|
|
128
|
-
*/
|
|
129
|
-
animate?: boolean;
|
|
130
|
-
/**
|
|
131
|
-
* Badge will be added relative to the children. It is rendered inline if there is no children provided
|
|
132
|
-
* */
|
|
133
|
-
children?: React__default.ReactNode;
|
|
134
|
-
/**
|
|
135
|
-
* The shape of the container, based on which badge should be positioned. Badge is positioned on the border of the container
|
|
136
|
-
* @default 'circle'
|
|
137
|
-
* */
|
|
138
|
-
containerType?: 'circle' | 'rectangle';
|
|
139
|
-
/**
|
|
140
|
-
* Number to show in badge
|
|
141
|
-
* */
|
|
142
|
-
count: number;
|
|
143
|
-
/**
|
|
144
|
-
* The variation of badge which determines the badge's color.
|
|
145
|
-
*
|
|
146
|
-
* @default 'primary'
|
|
147
|
-
*/
|
|
148
|
-
variant?: 'primary' | 'secondary';
|
|
149
|
-
/**
|
|
150
|
-
* @default 'medium'
|
|
151
|
-
*/
|
|
152
|
-
size?: 'large' | 'medium' | 'small';
|
|
153
|
-
/**
|
|
154
|
-
* Boolean to show/hide the badge
|
|
155
|
-
*
|
|
156
|
-
* @default true
|
|
157
|
-
*/
|
|
158
|
-
show?: boolean;
|
|
159
|
-
} & SapphireStyleProps & ({
|
|
160
|
-
'aria-labelledby': string;
|
|
161
|
-
} | {
|
|
162
|
-
'aria-label': string;
|
|
163
|
-
});
|
|
164
|
-
declare const NotificationBadge: (props: NotificationBadgeProps) => JSX.Element;
|
|
165
|
-
|
|
166
|
-
interface SapphireFilterDropdownProps extends SapphireStyleProps, Pick<PopoverTriggerProps, 'defaultOpen' | 'isOpen' | 'onOpenChange' | 'noMaxWidth'> {
|
|
10
|
+
interface FilterDropdownProps extends SapphireStyleProps, Pick<PopoverTriggerProps, 'defaultOpen' | 'isOpen' | 'onOpenChange' | 'noMaxWidth'> {
|
|
167
11
|
/**
|
|
168
12
|
* "Filter by" label, shown inside the trigger button.
|
|
169
13
|
*/
|
|
@@ -192,9 +36,14 @@ interface SapphireFilterDropdownProps extends SapphireStyleProps, Pick<PopoverTr
|
|
|
192
36
|
*/
|
|
193
37
|
onClear?: () => void;
|
|
194
38
|
/**
|
|
195
|
-
*
|
|
39
|
+
* Whether the button is disabled.
|
|
196
40
|
*/
|
|
197
41
|
isDisabled?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Whether the 'Apply' button is disabled.
|
|
44
|
+
*/
|
|
45
|
+
isApplyDisabled?: boolean;
|
|
46
|
+
/**
|
|
198
47
|
/**
|
|
199
48
|
* The label of the 'Clear' button.
|
|
200
49
|
* @default "Clear"
|
|
@@ -209,371 +58,11 @@ interface SapphireFilterDropdownProps extends SapphireStyleProps, Pick<PopoverTr
|
|
|
209
58
|
/**
|
|
210
59
|
* A button with a dropdown, used for filtering UI.
|
|
211
60
|
*/
|
|
212
|
-
declare function FilterDropdown({ children, label, value, isOpen: isOpenProp,
|
|
213
|
-
|
|
214
|
-
declare type DateFieldProps<T extends DateValue$1> = Omit<AriaDatePickerProps<T>, keyof Omit<Validation<unknown>, 'isRequired'> | 'errorMessage' | 'description' | 'granularity' | 'hourCycle' | 'hideTimeZone'> & SapphireStyleProps & {
|
|
215
|
-
/**
|
|
216
|
-
* Whether week numbers are visible as a first column
|
|
217
|
-
*/
|
|
218
|
-
showWeekNumbers?: boolean;
|
|
219
|
-
/**
|
|
220
|
-
* Whether the input should render as having an error and an error message.
|
|
221
|
-
* This also sets the appropriate `aria` attributes on the input.
|
|
222
|
-
*
|
|
223
|
-
* A `boolean` sets the error state.
|
|
224
|
-
* A `string` sets the error state with an additional error message.
|
|
225
|
-
|
|
226
|
-
* **An error message is strongly recommended because an error should
|
|
227
|
-
* always have an explanation about how to fix it.**
|
|
228
|
-
*/
|
|
229
|
-
error?: boolean | string;
|
|
230
|
-
/**
|
|
231
|
-
* A note to show below the input.
|
|
232
|
-
* If the input has an error message, this note will be replaced by that.
|
|
233
|
-
*/
|
|
234
|
-
note?: ReactNode;
|
|
235
|
-
/**
|
|
236
|
-
* A ContextualHelp to render next to the label.
|
|
237
|
-
*/
|
|
238
|
-
contextualHelp?: ReactNode;
|
|
239
|
-
/**
|
|
240
|
-
* If it should hide the "clear" button when input is not empty.
|
|
241
|
-
*
|
|
242
|
-
* @default false
|
|
243
|
-
*/
|
|
244
|
-
noClearButton?: boolean;
|
|
245
|
-
/**
|
|
246
|
-
* @default 'large'
|
|
247
|
-
*/
|
|
248
|
-
size?: 'large' | 'medium';
|
|
249
|
-
/**
|
|
250
|
-
* To visually indicate if this field is required or optional.
|
|
251
|
-
* @default false
|
|
252
|
-
*/
|
|
253
|
-
necessityIndicator?: boolean;
|
|
254
|
-
/**
|
|
255
|
-
* Places the label either above (default) or on the side of the control.
|
|
256
|
-
* @default 'above'
|
|
257
|
-
*/
|
|
258
|
-
labelPlacement?: 'side' | 'above';
|
|
259
|
-
};
|
|
260
|
-
/**
|
|
261
|
-
* A date field allows users to enter or edit date values using the keyboard
|
|
262
|
-
* and/or mouse.
|
|
263
|
-
*/
|
|
264
|
-
declare const DateField: <T extends DateValue$1>(props: Omit<AriaDatePickerProps<T>, "isInvalid" | "validationState" | "validationBehavior" | "validate" | "errorMessage" | "hourCycle" | "granularity" | "hideTimeZone" | "description"> & SapphireStyleProps & {
|
|
265
|
-
/**
|
|
266
|
-
* Whether week numbers are visible as a first column
|
|
267
|
-
*/
|
|
268
|
-
showWeekNumbers?: boolean | undefined;
|
|
269
|
-
/**
|
|
270
|
-
* Whether the input should render as having an error and an error message.
|
|
271
|
-
* This also sets the appropriate `aria` attributes on the input.
|
|
272
|
-
*
|
|
273
|
-
* A `boolean` sets the error state.
|
|
274
|
-
* A `string` sets the error state with an additional error message.
|
|
275
|
-
|
|
276
|
-
* **An error message is strongly recommended because an error should
|
|
277
|
-
* always have an explanation about how to fix it.**
|
|
278
|
-
*/
|
|
279
|
-
error?: string | boolean | undefined;
|
|
280
|
-
/**
|
|
281
|
-
* A note to show below the input.
|
|
282
|
-
* If the input has an error message, this note will be replaced by that.
|
|
283
|
-
*/
|
|
284
|
-
note?: ReactNode;
|
|
285
|
-
/**
|
|
286
|
-
* A ContextualHelp to render next to the label.
|
|
287
|
-
*/
|
|
288
|
-
contextualHelp?: ReactNode;
|
|
289
|
-
/**
|
|
290
|
-
* If it should hide the "clear" button when input is not empty.
|
|
291
|
-
*
|
|
292
|
-
* @default false
|
|
293
|
-
*/
|
|
294
|
-
noClearButton?: boolean | undefined;
|
|
295
|
-
/**
|
|
296
|
-
* @default 'large'
|
|
297
|
-
*/
|
|
298
|
-
size?: "large" | "medium" | undefined;
|
|
299
|
-
/**
|
|
300
|
-
* To visually indicate if this field is required or optional.
|
|
301
|
-
* @default false
|
|
302
|
-
*/
|
|
303
|
-
necessityIndicator?: boolean | undefined;
|
|
304
|
-
/**
|
|
305
|
-
* Places the label either above (default) or on the side of the control.
|
|
306
|
-
* @default 'above'
|
|
307
|
-
*/
|
|
308
|
-
labelPlacement?: "above" | "side" | undefined;
|
|
309
|
-
} & {
|
|
310
|
-
ref?: React__default.RefObject<HTMLDivElement> | undefined;
|
|
311
|
-
}) => React__default.ReactElement;
|
|
312
|
-
|
|
313
|
-
declare type OriginalOnChange<T extends DateValue> = NonNullable<DateRangePickerStateOptions$1<T>['onChange']>;
|
|
314
|
-
declare type DateRangePickerStateOptions<T extends DateValue, P extends string, O extends OriginalOnChange<T> = OriginalOnChange<T>> = Omit<DateRangePickerStateOptions$1<T>, 'onChange'> & {
|
|
315
|
-
onChange?: (value: Parameters<O>[0] | null, predefinedRange?: P) => ReturnType<O>;
|
|
316
|
-
};
|
|
317
|
-
|
|
318
|
-
declare type DateRangeFieldProps<T extends DateValue$1, P extends string> = Omit<AriaDateRangePickerProps<T>, keyof Omit<Validation<unknown>, 'isRequired'> | 'errorMessage' | 'description' | 'granularity' | 'hourCycle' | 'hideTimeZone' | 'allowsNonContiguousRanges' | 'onChange'> & SapphireStyleProps & {
|
|
319
|
-
/**
|
|
320
|
-
* Handler that is called when the value changes.
|
|
321
|
-
*/
|
|
322
|
-
onChange?: DateRangePickerStateOptions<DateValue$1, P>['onChange'];
|
|
323
|
-
/**
|
|
324
|
-
* Whether week numbers are visible as a first column
|
|
325
|
-
*/
|
|
326
|
-
showWeekNumbers?: boolean;
|
|
327
|
-
/**
|
|
328
|
-
* Whether to show two months at the same time.
|
|
329
|
-
*/
|
|
330
|
-
showTwoMonths?: boolean;
|
|
331
|
-
/**
|
|
332
|
-
* A set of predefined date ranges the user can more conveniently select.
|
|
333
|
-
*/
|
|
334
|
-
predefinedRanges?: Record<P, PredefinedDateRange>;
|
|
335
|
-
/**
|
|
336
|
-
* Whether range is allowed to span unavailable dates.
|
|
337
|
-
*/
|
|
338
|
-
allowUnavailableDatesWithinRange?: boolean;
|
|
339
|
-
/**
|
|
340
|
-
* Whether the input should render as having an error and an error message.
|
|
341
|
-
* This also sets the appropriate `aria` attributes on the input.
|
|
342
|
-
*
|
|
343
|
-
* A `boolean` sets the error state.
|
|
344
|
-
* A `string` sets the error state with an additional error message.
|
|
345
|
-
|
|
346
|
-
* **An error message is strongly recommended because an error should
|
|
347
|
-
* always have an explanation about how to fix it.**
|
|
348
|
-
*/
|
|
349
|
-
error?: boolean | string;
|
|
350
|
-
/**
|
|
351
|
-
* A note to show below the input.
|
|
352
|
-
* If the input has an error message, this note will be replaced by that.
|
|
353
|
-
*/
|
|
354
|
-
note?: ReactNode;
|
|
355
|
-
/**
|
|
356
|
-
* A ContextualHelp to render next to the label.
|
|
357
|
-
*/
|
|
358
|
-
contextualHelp?: ReactNode;
|
|
359
|
-
/**
|
|
360
|
-
* If it should hide the "clear" button when input is not empty.
|
|
361
|
-
*
|
|
362
|
-
* @default false
|
|
363
|
-
*/
|
|
364
|
-
noClearButton?: boolean;
|
|
365
|
-
/**
|
|
366
|
-
* Locale (eg. "da-DK", "en-US", "sv-SE" etc.)
|
|
367
|
-
*
|
|
368
|
-
* THIS IS A TEMPORARY SOLUTION FOR THE INTERFACE OF LOCALIZATION. THIS API
|
|
369
|
-
* MAY CHANGE OR EVEN BE REPLACED WITH SOMETHING DIFFERENT IN A FUTURE VERSION.
|
|
370
|
-
*/
|
|
371
|
-
locale?: string;
|
|
372
|
-
/**
|
|
373
|
-
* @default 'large'
|
|
374
|
-
*/
|
|
375
|
-
size?: 'large' | 'medium';
|
|
376
|
-
/**
|
|
377
|
-
* To visually indicate if this field is required or optional.
|
|
378
|
-
* @default false
|
|
379
|
-
*/
|
|
380
|
-
necessityIndicator?: boolean;
|
|
381
|
-
/**
|
|
382
|
-
* Places the label either above (default) or on the side of the control.
|
|
383
|
-
* @default 'above'
|
|
384
|
-
*/
|
|
385
|
-
labelPlacement?: 'side' | 'above';
|
|
386
|
-
};
|
|
387
|
-
/**
|
|
388
|
-
* A date range field allows users to select a range of dates by selecting a to and a from date with keyboard and/or mouse.
|
|
389
|
-
*/
|
|
390
|
-
declare const DateRangeField: <T extends DateValue$1, P extends string>(props: Omit<AriaDateRangePickerProps<T>, "onChange" | "isInvalid" | "validationState" | "validationBehavior" | "validate" | "errorMessage" | "allowsNonContiguousRanges" | "hourCycle" | "granularity" | "hideTimeZone" | "description"> & SapphireStyleProps & {
|
|
391
|
-
/**
|
|
392
|
-
* Handler that is called when the value changes.
|
|
393
|
-
*/
|
|
394
|
-
onChange?: ((value: _react_types_shared.RangeValue<DateValue$1> | null, predefinedRange?: P | undefined) => void) | undefined;
|
|
395
|
-
/**
|
|
396
|
-
* Whether week numbers are visible as a first column
|
|
397
|
-
*/
|
|
398
|
-
showWeekNumbers?: boolean | undefined;
|
|
399
|
-
/**
|
|
400
|
-
* Whether to show two months at the same time.
|
|
401
|
-
*/
|
|
402
|
-
showTwoMonths?: boolean | undefined;
|
|
403
|
-
/**
|
|
404
|
-
* A set of predefined date ranges the user can more conveniently select.
|
|
405
|
-
*/
|
|
406
|
-
predefinedRanges?: Record<P, PredefinedDateRange> | undefined;
|
|
407
|
-
/**
|
|
408
|
-
* Whether range is allowed to span unavailable dates.
|
|
409
|
-
*/
|
|
410
|
-
allowUnavailableDatesWithinRange?: boolean | undefined;
|
|
411
|
-
/**
|
|
412
|
-
* Whether the input should render as having an error and an error message.
|
|
413
|
-
* This also sets the appropriate `aria` attributes on the input.
|
|
414
|
-
*
|
|
415
|
-
* A `boolean` sets the error state.
|
|
416
|
-
* A `string` sets the error state with an additional error message.
|
|
417
|
-
|
|
418
|
-
* **An error message is strongly recommended because an error should
|
|
419
|
-
* always have an explanation about how to fix it.**
|
|
420
|
-
*/
|
|
421
|
-
error?: string | boolean | undefined;
|
|
422
|
-
/**
|
|
423
|
-
* A note to show below the input.
|
|
424
|
-
* If the input has an error message, this note will be replaced by that.
|
|
425
|
-
*/
|
|
426
|
-
note?: ReactNode;
|
|
427
|
-
/**
|
|
428
|
-
* A ContextualHelp to render next to the label.
|
|
429
|
-
*/
|
|
430
|
-
contextualHelp?: ReactNode;
|
|
431
|
-
/**
|
|
432
|
-
* If it should hide the "clear" button when input is not empty.
|
|
433
|
-
*
|
|
434
|
-
* @default false
|
|
435
|
-
*/
|
|
436
|
-
noClearButton?: boolean | undefined;
|
|
437
|
-
/**
|
|
438
|
-
* Locale (eg. "da-DK", "en-US", "sv-SE" etc.)
|
|
439
|
-
*
|
|
440
|
-
* THIS IS A TEMPORARY SOLUTION FOR THE INTERFACE OF LOCALIZATION. THIS API
|
|
441
|
-
* MAY CHANGE OR EVEN BE REPLACED WITH SOMETHING DIFFERENT IN A FUTURE VERSION.
|
|
442
|
-
*/
|
|
443
|
-
locale?: string | undefined;
|
|
444
|
-
/**
|
|
445
|
-
* @default 'large'
|
|
446
|
-
*/
|
|
447
|
-
size?: "large" | "medium" | undefined;
|
|
448
|
-
/**
|
|
449
|
-
* To visually indicate if this field is required or optional.
|
|
450
|
-
* @default false
|
|
451
|
-
*/
|
|
452
|
-
necessityIndicator?: boolean | undefined;
|
|
453
|
-
/**
|
|
454
|
-
* Places the label either above (default) or on the side of the control.
|
|
455
|
-
* @default 'above'
|
|
456
|
-
*/
|
|
457
|
-
labelPlacement?: "above" | "side" | undefined;
|
|
458
|
-
} & {
|
|
459
|
-
ref?: React__default.RefObject<HTMLDivElement> | undefined;
|
|
460
|
-
}) => React__default.ReactElement;
|
|
461
|
-
|
|
462
|
-
/**
|
|
463
|
-
* The helpers in this file are meant for external use.
|
|
464
|
-
* We're exporting these.
|
|
465
|
-
*/
|
|
466
|
-
|
|
467
|
-
declare const isEndDateBeforeStartDate: (dateRange?: RangeValue<DateValue$1> | null) => boolean | null | undefined;
|
|
468
|
-
declare const isDateOutsideValidRange: (value?: DateValue$1 | null, minValue?: DateValue$1 | null, maxValue?: DateValue$1 | null) => "after" | "before" | undefined;
|
|
469
|
-
|
|
470
|
-
declare type FeedbackMessageVariant = 'success' | 'error' | 'warning' | 'informative' | 'neutral';
|
|
471
|
-
interface SapphireFeedbackMessageProps extends SapphireStyleProps {
|
|
472
|
-
/**
|
|
473
|
-
* Heading content, rendered in a sapphire Heading component.
|
|
474
|
-
*/
|
|
475
|
-
heading: React__default.ReactNode | string;
|
|
476
|
-
/**
|
|
477
|
-
* The type of message.
|
|
478
|
-
* The 'error' and 'success' are meant to attract more attention.
|
|
479
|
-
*
|
|
480
|
-
* @default 'neutral'
|
|
481
|
-
*/
|
|
482
|
-
variant?: FeedbackMessageVariant;
|
|
483
|
-
/**
|
|
484
|
-
* Optional icon to override the default icon for the message type.
|
|
485
|
-
*/
|
|
486
|
-
icon?: React__default.ReactNode;
|
|
487
|
-
/**
|
|
488
|
-
* Optional description, rendered as a section below heading.
|
|
489
|
-
*/
|
|
490
|
-
body?: React__default.ReactNode;
|
|
491
|
-
/**
|
|
492
|
-
* Optional actions, rendered at the bottom. Use {@link ButtonGroup}
|
|
493
|
-
* for the content.
|
|
494
|
-
*/
|
|
495
|
-
actions?: React__default.ReactNode;
|
|
496
|
-
}
|
|
497
|
-
/**
|
|
498
|
-
* Implements layout and style of a feedback message.
|
|
499
|
-
*/
|
|
500
|
-
declare const FeedbackMessage: ({ heading, body, actions, variant, icon, ...otherProps }: SapphireFeedbackMessageProps) => JSX.Element;
|
|
501
|
-
|
|
502
|
-
declare type SapphireSearchFieldProps<T extends object> = SapphireStyleProps & Omit<AriaSearchFieldProps, keyof HelpTextProps | keyof Validation<unknown> | keyof LabelableProps> & AutocompleteProps<T> & {
|
|
503
|
-
/**
|
|
504
|
-
* @default 'large'
|
|
505
|
-
*/
|
|
506
|
-
size?: 'large' | 'medium';
|
|
507
|
-
/**
|
|
508
|
-
* Adjusts the style for the type of surface it is rendered on.
|
|
509
|
-
* @default 'primary'
|
|
510
|
-
*/
|
|
511
|
-
surface?: 'primary' | 'secondary';
|
|
512
|
-
} & ({
|
|
513
|
-
'aria-labelledby': string;
|
|
514
|
-
} | {
|
|
515
|
-
'aria-label': string;
|
|
516
|
-
}) & {
|
|
517
|
-
loadingState?: 'loading';
|
|
518
|
-
loadingSkeletonRowsCount?: number;
|
|
519
|
-
};
|
|
520
|
-
interface AutocompleteProps<T extends object> {
|
|
521
|
-
items?: ComboBoxProps<T>['items'];
|
|
522
|
-
defaultItems?: ComboBoxProps<T>['defaultItems'];
|
|
523
|
-
children?: ComboBoxProps<T>['children'];
|
|
524
|
-
onOpenChange?: ComboBoxProps<T>['onOpenChange'];
|
|
525
|
-
defaultFilter?: (textValue: string, inputValue: string) => boolean;
|
|
526
|
-
}
|
|
527
|
-
declare type SapphireSearchFieldPropsWithRef<T extends object> = SapphireSearchFieldProps<T> & {
|
|
528
|
-
forwardedRef?: ForwardedRef<HTMLInputElement>;
|
|
529
|
-
};
|
|
530
|
-
/**
|
|
531
|
-
* Sapphire search input field.
|
|
532
|
-
*/
|
|
533
|
-
declare function SearchField<T extends object>(propsAndRef: SapphireSearchFieldPropsWithRef<T>): React__default.JSX.Element;
|
|
534
|
-
|
|
535
|
-
declare type VerticalPlacement = 'top' | 'bottom';
|
|
536
|
-
declare type HorizontalPlacement = 'left' | 'right';
|
|
537
|
-
declare type ToastRegionProps<T> = AriaToastRegionProps & SapphireStyleProps & {
|
|
538
|
-
state: ToastState<T>;
|
|
539
|
-
/**
|
|
540
|
-
* Placement of the Toast notifications on the page.
|
|
541
|
-
*/
|
|
542
|
-
placement?: VerticalPlacement | `${VerticalPlacement}-${HorizontalPlacement}`;
|
|
543
|
-
};
|
|
544
|
-
|
|
545
|
-
declare type ToastProviderProps = Omit<ToastRegionProps<ReactNode>, 'state'> & {
|
|
546
|
-
children: React__default.ReactNode;
|
|
547
|
-
};
|
|
548
|
-
/**
|
|
549
|
-
* Sapphire toast provider.
|
|
550
|
-
* Render this at the root of your app.
|
|
551
|
-
*/
|
|
552
|
-
declare const ToastProvider: ({ children, placement, ...props }: ToastProviderProps) => React__default.JSX.Element;
|
|
553
|
-
|
|
554
|
-
declare type ShowToastFn = (content: ReactNode, options?: ShowToastOptions) => void;
|
|
555
|
-
interface ShowToastOptions {
|
|
556
|
-
/**
|
|
557
|
-
* Handler that is called when the toast is closed, either by the user
|
|
558
|
-
* or after a timeout.
|
|
559
|
-
*/
|
|
560
|
-
onClose?: () => void;
|
|
561
|
-
/**
|
|
562
|
-
* A timeout to automatically close the toast after, in milliseconds.
|
|
563
|
-
* Note that if the toast is hovered or interacted with, the timeout is
|
|
564
|
-
* paused.
|
|
565
|
-
*
|
|
566
|
-
* @default 3000
|
|
567
|
-
*/
|
|
568
|
-
timeout?: number;
|
|
569
|
-
variant?: 'neutral' | 'success';
|
|
570
|
-
icon?: ReactNode;
|
|
571
|
-
}
|
|
572
|
-
declare const useShowToast: () => ShowToastFn;
|
|
61
|
+
declare function FilterDropdown({ children, label, value, isDisabled, isApplyDisabled, isOpen: isOpenProp, applyButtonLabel, clearButtonLabel, defaultOpen, hasApplyButton, noMaxWidth, onApply, onClear, onOpenChange, }: FilterDropdownProps): JSX.Element;
|
|
573
62
|
|
|
574
63
|
declare type TreeExpansionMode = 'single' | 'multiple';
|
|
575
64
|
|
|
576
|
-
interface
|
|
65
|
+
interface AccordionProps<T> extends SapphireStyleProps, CollectionBase<T>, DOMProps, Expandable {
|
|
577
66
|
/** Allow one or many expanded items
|
|
578
67
|
* @default 'multiple'
|
|
579
68
|
*/
|
|
@@ -582,7 +71,7 @@ interface SapphireAccordionProps<T> extends SapphireStyleProps, CollectionBase<T
|
|
|
582
71
|
* Defines the hierarchical level of an element within a page structure.
|
|
583
72
|
* @default 5
|
|
584
73
|
*/
|
|
585
|
-
headerLevel?:
|
|
74
|
+
headerLevel?: TypographyHeadingProps['level'];
|
|
586
75
|
/**
|
|
587
76
|
* Removes the divider after the last accordion item.
|
|
588
77
|
* Useful when rendered in a container which already has borders.
|
|
@@ -608,11 +97,11 @@ interface SapphireAccordionProps<T> extends SapphireStyleProps, CollectionBase<T
|
|
|
608
97
|
sidePadding?: number | string;
|
|
609
98
|
}
|
|
610
99
|
|
|
611
|
-
interface
|
|
100
|
+
interface AccordionHeadingProps extends DOMProps {
|
|
612
101
|
children?: ReactNode;
|
|
613
102
|
}
|
|
614
103
|
|
|
615
|
-
interface
|
|
104
|
+
interface AccordionItemProps<T> extends Omit<ItemProps<T>, 'title'> {
|
|
616
105
|
heading: ReactNode;
|
|
617
106
|
}
|
|
618
107
|
|
|
@@ -621,191 +110,13 @@ interface AccordionContextProps {
|
|
|
621
110
|
}
|
|
622
111
|
declare const AccordionContext: React__default.Context<AccordionContextProps>;
|
|
623
112
|
|
|
624
|
-
declare const _Accordion: (<T extends object>(props:
|
|
113
|
+
declare const _Accordion: (<T extends object>(props: AccordionProps<T> & {
|
|
625
114
|
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
626
115
|
}) => React.ReactElement<any, string | React.JSXElementConstructor<any>>) & {
|
|
627
|
-
Heading: ({ children, ...props }:
|
|
628
|
-
Item: <T_1>(props:
|
|
116
|
+
Heading: ({ children, ...props }: AccordionHeadingProps) => React.JSX.Element;
|
|
117
|
+
Item: <T_1>(props: AccordionItemProps<T_1>) => JSX.Element;
|
|
629
118
|
};
|
|
630
119
|
|
|
631
|
-
declare type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
632
|
-
interface TypographyHeadingProps extends DOMProps, TextStyleProps, SapphireStyleProps {
|
|
633
|
-
children: React__default.ReactNode;
|
|
634
|
-
/**
|
|
635
|
-
* The level of the heading.
|
|
636
|
-
*/
|
|
637
|
-
level: HeadingLevel;
|
|
638
|
-
elementType?: `h${HeadingLevel}`;
|
|
639
|
-
/**
|
|
640
|
-
* @deprecated 'alternative' variant will not be a part of the new CVI
|
|
641
|
-
*/
|
|
642
|
-
fontVariant?: 'default' | 'alternative';
|
|
643
|
-
}
|
|
644
|
-
|
|
645
|
-
interface TypographySubheadingProps extends DOMProps, TextStyleProps, SapphireStyleProps {
|
|
646
|
-
children: React__default.ReactNode;
|
|
647
|
-
/**
|
|
648
|
-
* The actual DOM element to render.
|
|
649
|
-
* @default 'div'
|
|
650
|
-
*/
|
|
651
|
-
elementType?: string;
|
|
652
|
-
/**
|
|
653
|
-
* Sets level of the hierarchy of the subheading.
|
|
654
|
-
* @default 1
|
|
655
|
-
*/
|
|
656
|
-
level?: 1 | 2;
|
|
657
|
-
/**
|
|
658
|
-
* If text is bold
|
|
659
|
-
* @default false
|
|
660
|
-
*/
|
|
661
|
-
isBold?: boolean;
|
|
662
|
-
}
|
|
663
|
-
|
|
664
|
-
interface TypographyBodyProps extends DOMProps, TextStyleProps, SapphireStyleProps {
|
|
665
|
-
children: React__default.ReactNode;
|
|
666
|
-
/**
|
|
667
|
-
* The actual DOM element to render.
|
|
668
|
-
* @default 'p'
|
|
669
|
-
*/
|
|
670
|
-
elementType?: string;
|
|
671
|
-
/**
|
|
672
|
-
* Sets the level of the hierarchy of the text.
|
|
673
|
-
* @default 1
|
|
674
|
-
*/
|
|
675
|
-
level?: 1 | 2 | 3;
|
|
676
|
-
/**
|
|
677
|
-
* If text should be underlined.
|
|
678
|
-
* @default false
|
|
679
|
-
*/
|
|
680
|
-
isUnderlined?: boolean;
|
|
681
|
-
/**
|
|
682
|
-
* If text is bold.
|
|
683
|
-
* @default false
|
|
684
|
-
*/
|
|
685
|
-
isBold?: boolean;
|
|
686
|
-
}
|
|
687
|
-
|
|
688
|
-
interface TypographyCaptionProps extends DOMProps, TextStyleProps, SapphireStyleProps {
|
|
689
|
-
children: React__default.ReactNode;
|
|
690
|
-
/**
|
|
691
|
-
* The actual DOM element to render.
|
|
692
|
-
* @default 'div'
|
|
693
|
-
*/
|
|
694
|
-
elementType?: string;
|
|
695
|
-
/**
|
|
696
|
-
* Sets the level of the hierarchy of the caption.
|
|
697
|
-
* @default 1
|
|
698
|
-
*/
|
|
699
|
-
level?: 1 | 2;
|
|
700
|
-
}
|
|
701
|
-
|
|
702
|
-
declare const Typography: {
|
|
703
|
-
Heading: ComponentType<TypographyHeadingProps>;
|
|
704
|
-
Subheading: ComponentType<TypographySubheadingProps>;
|
|
705
|
-
Body: ComponentType<TypographyBodyProps>;
|
|
706
|
-
Caption: ComponentType<TypographyCaptionProps>;
|
|
707
|
-
};
|
|
708
|
-
|
|
709
|
-
declare type FieldsetProps = SapphireStyleProps & {
|
|
710
|
-
/**
|
|
711
|
-
* A label that describes the groups of fields.
|
|
712
|
-
* The label is required because a fieldset that is not labelled is not
|
|
713
|
-
* better than separate labelled fields.
|
|
714
|
-
*/
|
|
715
|
-
label: ReactNode;
|
|
716
|
-
/**
|
|
717
|
-
* Whether the input is disabled.
|
|
718
|
-
* */
|
|
719
|
-
isDisabled?: boolean;
|
|
720
|
-
/**
|
|
721
|
-
* Whether the input is disabled.
|
|
722
|
-
* */
|
|
723
|
-
isRequired?: boolean;
|
|
724
|
-
/**
|
|
725
|
-
* Whether the input should render as having an error and an error message.
|
|
726
|
-
* This also sets the appropriate `aria` attributes on the input.
|
|
727
|
-
*
|
|
728
|
-
* A `boolean` sets the error state.
|
|
729
|
-
* A `string` sets the error state with an additional error message.
|
|
730
|
-
*
|
|
731
|
-
* **An error message is strongly recommended because an error should
|
|
732
|
-
* always have an explanation about how to fix it.**
|
|
733
|
-
*/
|
|
734
|
-
error?: boolean | string;
|
|
735
|
-
/**
|
|
736
|
-
* A note to show below the input.
|
|
737
|
-
* If the input has an error message, this note will be replaced by that.
|
|
738
|
-
*/
|
|
739
|
-
note?: ReactNode;
|
|
740
|
-
/**
|
|
741
|
-
* A ContextualHelp to render next to the label.
|
|
742
|
-
*/
|
|
743
|
-
contextualHelp?: ReactNode;
|
|
744
|
-
/**
|
|
745
|
-
* @default 'large'
|
|
746
|
-
*/
|
|
747
|
-
size?: 'large' | 'medium';
|
|
748
|
-
/**
|
|
749
|
-
* To visually indicate if this field is required or optional.
|
|
750
|
-
* @default false
|
|
751
|
-
*/
|
|
752
|
-
necessityIndicator?: boolean;
|
|
753
|
-
/**
|
|
754
|
-
* Children should be two or more form controls without labels, notes or
|
|
755
|
-
* error messages.
|
|
756
|
-
*
|
|
757
|
-
* We recommend you only use these fields inside: `<TextField>`, `<Select> `,
|
|
758
|
-
* `<SearchableSelect>`, `<MultiSelect>`, `<SearchableMultiSelect>`,
|
|
759
|
-
* `<DateField>` or `<DateRangeField>`.
|
|
760
|
-
*
|
|
761
|
-
* Example:
|
|
762
|
-
* ```jsx
|
|
763
|
-
* <Fieldset label="Phone Number">
|
|
764
|
-
* <Select aria-label="Country code" placeholder="+00" width={90}>
|
|
765
|
-
* <SelectItem>+40</SelectItem>
|
|
766
|
-
* <SelectItem>+42</SelectItem>
|
|
767
|
-
* <SelectItem>+45</SelectItem>
|
|
768
|
-
* </Select>
|
|
769
|
-
* <TextField
|
|
770
|
-
* aria-label="Phone number"
|
|
771
|
-
* placeholder="000-000-0000"
|
|
772
|
-
* ></TextField>
|
|
773
|
-
* </Fieldset>
|
|
774
|
-
* ```
|
|
775
|
-
*/
|
|
776
|
-
children: ReactNode;
|
|
777
|
-
/**
|
|
778
|
-
* Places the label either above (default) or on the side of the control.
|
|
779
|
-
* @default 'above'
|
|
780
|
-
*/
|
|
781
|
-
labelPlacement?: 'side' | 'above';
|
|
782
|
-
};
|
|
783
|
-
/**
|
|
784
|
-
* Sapphire search input field.
|
|
785
|
-
*/
|
|
786
|
-
declare const Fieldset: ({ label, contextualHelp, note, error, isDisabled, isRequired, necessityIndicator, children, size, labelPlacement, ...props }: FieldsetProps) => React__default.JSX.Element;
|
|
787
|
-
|
|
788
|
-
declare type SapphireAvatarProps = SapphireStyleProps & {
|
|
789
|
-
/**
|
|
790
|
-
* @default 'medium'
|
|
791
|
-
*/
|
|
792
|
-
size?: 'extraLarge' | 'large' | 'medium' | 'small' | 'extraSmall';
|
|
793
|
-
/**
|
|
794
|
-
* The background color of the avatar.
|
|
795
|
-
* Can either be semantic or one of the named decorative colors.
|
|
796
|
-
*
|
|
797
|
-
* @default 'informative'
|
|
798
|
-
*/
|
|
799
|
-
color?: 'positive' | 'negative' | 'warning' | 'informative' | 'passive' | 'aqua' | 'copper' | 'electro' | 'indigo' | 'lime' | 'pink' | 'violet' | 'gold' | 'beige' | 'orchid' | 'gray' | 'cobalt' | 'forestGreen' | 'teal' | 'orange';
|
|
800
|
-
} & ({
|
|
801
|
-
monogram: ReactNode;
|
|
802
|
-
icon?: never;
|
|
803
|
-
} | {
|
|
804
|
-
monogram?: never;
|
|
805
|
-
icon: ReactNode;
|
|
806
|
-
});
|
|
807
|
-
declare const Avatar: ({ monogram, icon, color, size, ...props }: SapphireAvatarProps) => React__default.ReactElement;
|
|
808
|
-
|
|
809
120
|
interface FileSelectProps {
|
|
810
121
|
/**
|
|
811
122
|
* List of file types that are allowed to be selected using the file select.
|
|
@@ -831,7 +142,7 @@ interface FileTriggerProps extends FileSelectProps {
|
|
|
831
142
|
}
|
|
832
143
|
declare const FileTrigger: React__default.ForwardRefExoticComponent<FileTriggerProps & React__default.RefAttributes<HTMLInputElement>>;
|
|
833
144
|
|
|
834
|
-
interface FileDropzoneProps extends SapphireStyleProps,
|
|
145
|
+
interface FileDropzoneProps extends SapphireStyleProps, Pick<DropOptions, 'getDropOperation' | 'onDropEnter' | 'onDropActivate' | 'onDropMove' | 'onDropExit' | 'onDrop'>, HoverProps, FileSelectProps, AriaLabelingProps {
|
|
835
146
|
/**
|
|
836
147
|
* Whether the dropzone has an error
|
|
837
148
|
* @default false
|
|
@@ -849,46 +160,7 @@ interface FileDropzoneProps extends SapphireStyleProps, Omit<DropOptions, 'hasDr
|
|
|
849
160
|
*/
|
|
850
161
|
onFileSelectOpen?: () => void;
|
|
851
162
|
}
|
|
852
|
-
declare const FileDropzone: React__default.ForwardRefExoticComponent<
|
|
853
|
-
|
|
854
|
-
declare type SapphireAlertDialogProps = AriaModalOverlayProps & SapphireStyleProps & Pick<DialogProps, 'isOpen' | 'onClose'> & Omit<SapphireFeedbackMessageProps, 'heading' | 'actions'> & {
|
|
855
|
-
/**
|
|
856
|
-
*
|
|
857
|
-
* @default "horizontal"
|
|
858
|
-
*/
|
|
859
|
-
actionsOrientation?: 'vertical' | 'horizontal';
|
|
860
|
-
/**
|
|
861
|
-
* The elements that will be rendered in the footer of the dialog.
|
|
862
|
-
*/
|
|
863
|
-
actions: ReactNode;
|
|
864
|
-
/**
|
|
865
|
-
* The title of the dialog.
|
|
866
|
-
*/
|
|
867
|
-
heading: string;
|
|
868
|
-
};
|
|
869
|
-
/**
|
|
870
|
-
* `AlertDialog` is a wrapper component around `Dialog` and allows you to interrupt the user's
|
|
871
|
-
* experience to prompt them for important confirmations. (e.g. deleting something, confirming
|
|
872
|
-
* an important or irreversible choice etc.).
|
|
873
|
-
* Don't use them for less relevant of unnecessary confirmations.
|
|
874
|
-
*
|
|
875
|
-
* The title should be similar to the action that prompted the user to open it.
|
|
876
|
-
*/
|
|
877
|
-
declare const AlertDialog: React__default.ForwardRefExoticComponent<AriaModalOverlayProps & SapphireStyleProps & Pick<DialogProps, "isOpen" | "onClose"> & Omit<SapphireFeedbackMessageProps, "heading" | "actions"> & {
|
|
878
|
-
/**
|
|
879
|
-
*
|
|
880
|
-
* @default "horizontal"
|
|
881
|
-
*/
|
|
882
|
-
actionsOrientation?: "horizontal" | "vertical" | undefined;
|
|
883
|
-
/**
|
|
884
|
-
* The elements that will be rendered in the footer of the dialog.
|
|
885
|
-
*/
|
|
886
|
-
actions: ReactNode;
|
|
887
|
-
/**
|
|
888
|
-
* The title of the dialog.
|
|
889
|
-
*/
|
|
890
|
-
heading: string;
|
|
891
|
-
} & React__default.RefAttributes<_react_types_shared.DOMRefValue<HTMLDivElement>>>;
|
|
163
|
+
declare const FileDropzone: React__default.ForwardRefExoticComponent<FileDropzoneProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
892
164
|
|
|
893
165
|
interface SapphireNumberFieldProps
|
|
894
166
|
/**
|
|
@@ -923,7 +195,7 @@ interface NumberFieldProps extends SapphireNumberFieldProps, PressEvents, Sapphi
|
|
|
923
195
|
*/
|
|
924
196
|
note?: ReactNode;
|
|
925
197
|
/**
|
|
926
|
-
* A
|
|
198
|
+
* A HelpButton to render next to the label.
|
|
927
199
|
*/
|
|
928
200
|
contextualHelp?: ReactNode;
|
|
929
201
|
/**
|
|
@@ -932,9 +204,9 @@ interface NumberFieldProps extends SapphireNumberFieldProps, PressEvents, Sapphi
|
|
|
932
204
|
*/
|
|
933
205
|
necessityIndicator?: boolean;
|
|
934
206
|
/**
|
|
935
|
-
* @default '
|
|
207
|
+
* @default 'lg'
|
|
936
208
|
*/
|
|
937
|
-
size?: '
|
|
209
|
+
size?: 'lg' | 'md';
|
|
938
210
|
/**
|
|
939
211
|
* Aligns the text inside the input fields without affecting the positioning of the label of the field.
|
|
940
212
|
*/
|
|
@@ -954,7 +226,7 @@ declare const NumberField: React__default.ForwardRefExoticComponent<NumberFieldP
|
|
|
954
226
|
|
|
955
227
|
interface TagGroupProps<T> extends CollectionBase<T>, DOMProps, AriaLabelingProps, SapphireStyleProps {
|
|
956
228
|
/**
|
|
957
|
-
* A
|
|
229
|
+
* A HelpButton element to place next to the label.
|
|
958
230
|
*/
|
|
959
231
|
contextualHelp?: ReactNode;
|
|
960
232
|
/**
|
|
@@ -997,7 +269,7 @@ declare const TagItem: <T>(props: TagItemProps<T>) => JSX.Element;
|
|
|
997
269
|
interface LabeledValueProps extends DOMProps, SapphireStyleProps {
|
|
998
270
|
children?: React__default.ReactNode;
|
|
999
271
|
/**
|
|
1000
|
-
* A
|
|
272
|
+
* A HelpButton element to place next to the label.
|
|
1001
273
|
*/
|
|
1002
274
|
contextualHelp?: ReactNode;
|
|
1003
275
|
/**
|
|
@@ -1010,10 +282,10 @@ interface LabeledValueProps extends DOMProps, SapphireStyleProps {
|
|
|
1010
282
|
*/
|
|
1011
283
|
labelPlacement?: 'above' | 'side';
|
|
1012
284
|
/**
|
|
1013
|
-
* @default '
|
|
285
|
+
* @default 'lg'
|
|
1014
286
|
*/
|
|
1015
|
-
size?: '
|
|
287
|
+
size?: 'lg' | 'md';
|
|
1016
288
|
}
|
|
1017
289
|
declare function LabeledValue(props: LabeledValueProps): React__default.JSX.Element;
|
|
1018
290
|
|
|
1019
|
-
export { _Accordion as Accordion, AccordionContext,
|
|
291
|
+
export { _Accordion as Accordion, AccordionContext, AccordionHeadingProps, AccordionItemProps, AccordionProps, FileDropzone, FileDropzoneProps, FileTrigger, FileTriggerProps, FilterDropdown, FilterDropdownProps, LabeledValue, NumberField, NumberFieldProps, NumberFieldRef, TagGroup, TagGroupProps, TagItem };
|