@danske/sapphire-react-lab 0.88.1 → 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 +337 -3066
- package/build/cjs/index.js.map +1 -1
- package/build/esm/Accordion/index.js +1 -0
- package/build/esm/Accordion/index.js.map +1 -1
- package/build/esm/Accordion/src/Accordion.js +22 -11
- package/build/esm/Accordion/src/Accordion.js.map +1 -1
- package/build/esm/Accordion/src/AccordionContext.js +15 -0
- package/build/esm/Accordion/src/AccordionContext.js.map +1 -0
- 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 +14 -6
- 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 +1 -17
- package/build/esm/index.js.map +1 -1
- package/build/index.d.ts +50 -755
- 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,206 +71,51 @@ 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
|
-
* Removes the divider after the last
|
|
76
|
+
* Removes the divider after the last accordion item.
|
|
588
77
|
* Useful when rendered in a container which already has borders.
|
|
589
78
|
*/
|
|
590
79
|
hideLastDivider?: boolean;
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
interface SapphireAccordionHeadingProps extends DOMProps {
|
|
594
|
-
children?: ReactNode;
|
|
595
|
-
}
|
|
596
|
-
|
|
597
|
-
interface SapphireAccordionItemProps<T> extends Omit<ItemProps<T>, 'title'> {
|
|
598
|
-
heading: ReactNode;
|
|
599
|
-
}
|
|
600
|
-
|
|
601
|
-
declare const _Accordion: (<T extends object>(props: SapphireAccordionProps<T> & {
|
|
602
|
-
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
603
|
-
}) => React.ReactElement<any, string | React.JSXElementConstructor<any>>) & {
|
|
604
|
-
Heading: ({ children, ...props }: SapphireAccordionHeadingProps) => React.JSX.Element;
|
|
605
|
-
Item: <T_1>(props: SapphireAccordionItemProps<T_1>) => JSX.Element;
|
|
606
|
-
};
|
|
607
|
-
|
|
608
|
-
declare type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
609
|
-
interface TypographyHeadingProps extends DOMProps, TextStyleProps, SapphireStyleProps {
|
|
610
|
-
children: React__default.ReactNode;
|
|
611
80
|
/**
|
|
612
|
-
*
|
|
81
|
+
* Counter acts the side padding, so that accordion is shifted to the left with same amount
|
|
82
|
+
* and having side padding * 2 added to width – resulting in full width accordion.
|
|
83
|
+
* Useful in scenarions where accordion is inside a padded container and desired layout has accordion going from edge to edge horizontally.
|
|
84
|
+
* @example
|
|
85
|
+
* ```tsx
|
|
86
|
+
* <Accordion hasNegativeSideMargin>...</Accordion>
|
|
87
|
+
* ```
|
|
613
88
|
*/
|
|
614
|
-
|
|
615
|
-
elementType?: `h${HeadingLevel}`;
|
|
89
|
+
hasNegativeSideMargin?: boolean;
|
|
616
90
|
/**
|
|
617
|
-
*
|
|
91
|
+
* Add custom sized padding to the sides of the accordion items.
|
|
92
|
+
* @example
|
|
93
|
+
* ```tsx
|
|
94
|
+
* <Accordion sidePadding={tokens.size.spacingContainerHorizontalM.value} hasNegativeSideMargin>...</Accordion>
|
|
95
|
+
* ```
|
|
618
96
|
*/
|
|
619
|
-
|
|
97
|
+
sidePadding?: number | string;
|
|
620
98
|
}
|
|
621
99
|
|
|
622
|
-
interface
|
|
623
|
-
children
|
|
624
|
-
/**
|
|
625
|
-
* The actual DOM element to render.
|
|
626
|
-
* @default 'div'
|
|
627
|
-
*/
|
|
628
|
-
elementType?: string;
|
|
629
|
-
/**
|
|
630
|
-
* Sets level of the hierarchy of the subheading.
|
|
631
|
-
* @default 1
|
|
632
|
-
*/
|
|
633
|
-
level?: 1 | 2;
|
|
634
|
-
/**
|
|
635
|
-
* If text is bold
|
|
636
|
-
* @default false
|
|
637
|
-
*/
|
|
638
|
-
isBold?: boolean;
|
|
100
|
+
interface AccordionHeadingProps extends DOMProps {
|
|
101
|
+
children?: ReactNode;
|
|
639
102
|
}
|
|
640
103
|
|
|
641
|
-
interface
|
|
642
|
-
|
|
643
|
-
/**
|
|
644
|
-
* The actual DOM element to render.
|
|
645
|
-
* @default 'p'
|
|
646
|
-
*/
|
|
647
|
-
elementType?: string;
|
|
648
|
-
/**
|
|
649
|
-
* Sets the level of the hierarchy of the text.
|
|
650
|
-
* @default 1
|
|
651
|
-
*/
|
|
652
|
-
level?: 1 | 2 | 3;
|
|
653
|
-
/**
|
|
654
|
-
* If text should be underlined.
|
|
655
|
-
* @default false
|
|
656
|
-
*/
|
|
657
|
-
isUnderlined?: boolean;
|
|
658
|
-
/**
|
|
659
|
-
* If text is bold.
|
|
660
|
-
* @default false
|
|
661
|
-
*/
|
|
662
|
-
isBold?: boolean;
|
|
104
|
+
interface AccordionItemProps<T> extends Omit<ItemProps<T>, 'title'> {
|
|
105
|
+
heading: ReactNode;
|
|
663
106
|
}
|
|
664
107
|
|
|
665
|
-
interface
|
|
666
|
-
|
|
667
|
-
/**
|
|
668
|
-
* The actual DOM element to render.
|
|
669
|
-
* @default 'div'
|
|
670
|
-
*/
|
|
671
|
-
elementType?: string;
|
|
672
|
-
/**
|
|
673
|
-
* Sets the level of the hierarchy of the caption.
|
|
674
|
-
* @default 1
|
|
675
|
-
*/
|
|
676
|
-
level?: 1 | 2;
|
|
108
|
+
interface AccordionContextProps {
|
|
109
|
+
sidePadding?: number | string;
|
|
677
110
|
}
|
|
111
|
+
declare const AccordionContext: React__default.Context<AccordionContextProps>;
|
|
678
112
|
|
|
679
|
-
declare const
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
};
|
|
685
|
-
|
|
686
|
-
declare type FieldsetProps = SapphireStyleProps & {
|
|
687
|
-
/**
|
|
688
|
-
* A label that describes the groups of fields.
|
|
689
|
-
* The label is required because a fieldset that is not labelled is not
|
|
690
|
-
* better than separate labelled fields.
|
|
691
|
-
*/
|
|
692
|
-
label: ReactNode;
|
|
693
|
-
/**
|
|
694
|
-
* Whether the input is disabled.
|
|
695
|
-
* */
|
|
696
|
-
isDisabled?: boolean;
|
|
697
|
-
/**
|
|
698
|
-
* Whether the input is disabled.
|
|
699
|
-
* */
|
|
700
|
-
isRequired?: boolean;
|
|
701
|
-
/**
|
|
702
|
-
* Whether the input should render as having an error and an error message.
|
|
703
|
-
* This also sets the appropriate `aria` attributes on the input.
|
|
704
|
-
*
|
|
705
|
-
* A `boolean` sets the error state.
|
|
706
|
-
* A `string` sets the error state with an additional error message.
|
|
707
|
-
*
|
|
708
|
-
* **An error message is strongly recommended because an error should
|
|
709
|
-
* always have an explanation about how to fix it.**
|
|
710
|
-
*/
|
|
711
|
-
error?: boolean | string;
|
|
712
|
-
/**
|
|
713
|
-
* A note to show below the input.
|
|
714
|
-
* If the input has an error message, this note will be replaced by that.
|
|
715
|
-
*/
|
|
716
|
-
note?: ReactNode;
|
|
717
|
-
/**
|
|
718
|
-
* A ContextualHelp to render next to the label.
|
|
719
|
-
*/
|
|
720
|
-
contextualHelp?: ReactNode;
|
|
721
|
-
/**
|
|
722
|
-
* @default 'large'
|
|
723
|
-
*/
|
|
724
|
-
size?: 'large' | 'medium';
|
|
725
|
-
/**
|
|
726
|
-
* To visually indicate if this field is required or optional.
|
|
727
|
-
* @default false
|
|
728
|
-
*/
|
|
729
|
-
necessityIndicator?: boolean;
|
|
730
|
-
/**
|
|
731
|
-
* Children should be two or more form controls without labels, notes or
|
|
732
|
-
* error messages.
|
|
733
|
-
*
|
|
734
|
-
* We recommend you only use these fields inside: `<TextField>`, `<Select> `,
|
|
735
|
-
* `<SearchableSelect>`, `<MultiSelect>`, `<SearchableMultiSelect>`,
|
|
736
|
-
* `<DateField>` or `<DateRangeField>`.
|
|
737
|
-
*
|
|
738
|
-
* Example:
|
|
739
|
-
* ```jsx
|
|
740
|
-
* <Fieldset label="Phone Number">
|
|
741
|
-
* <Select aria-label="Country code" placeholder="+00" width={90}>
|
|
742
|
-
* <SelectItem>+40</SelectItem>
|
|
743
|
-
* <SelectItem>+42</SelectItem>
|
|
744
|
-
* <SelectItem>+45</SelectItem>
|
|
745
|
-
* </Select>
|
|
746
|
-
* <TextField
|
|
747
|
-
* aria-label="Phone number"
|
|
748
|
-
* placeholder="000-000-0000"
|
|
749
|
-
* ></TextField>
|
|
750
|
-
* </Fieldset>
|
|
751
|
-
* ```
|
|
752
|
-
*/
|
|
753
|
-
children: ReactNode;
|
|
754
|
-
/**
|
|
755
|
-
* Places the label either above (default) or on the side of the control.
|
|
756
|
-
* @default 'above'
|
|
757
|
-
*/
|
|
758
|
-
labelPlacement?: 'side' | 'above';
|
|
113
|
+
declare const _Accordion: (<T extends object>(props: AccordionProps<T> & {
|
|
114
|
+
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
115
|
+
}) => React.ReactElement<any, string | React.JSXElementConstructor<any>>) & {
|
|
116
|
+
Heading: ({ children, ...props }: AccordionHeadingProps) => React.JSX.Element;
|
|
117
|
+
Item: <T_1>(props: AccordionItemProps<T_1>) => JSX.Element;
|
|
759
118
|
};
|
|
760
|
-
/**
|
|
761
|
-
* Sapphire search input field.
|
|
762
|
-
*/
|
|
763
|
-
declare const Fieldset: ({ label, contextualHelp, note, error, isDisabled, isRequired, necessityIndicator, children, size, labelPlacement, ...props }: FieldsetProps) => React__default.JSX.Element;
|
|
764
|
-
|
|
765
|
-
declare type SapphireAvatarProps = SapphireStyleProps & {
|
|
766
|
-
/**
|
|
767
|
-
* @default 'medium'
|
|
768
|
-
*/
|
|
769
|
-
size?: 'extraLarge' | 'large' | 'medium' | 'small' | 'extraSmall';
|
|
770
|
-
/**
|
|
771
|
-
* The background color of the avatar.
|
|
772
|
-
* Can either be semantic or one of the named decorative colors.
|
|
773
|
-
*
|
|
774
|
-
* @default 'informative'
|
|
775
|
-
*/
|
|
776
|
-
color?: 'positive' | 'negative' | 'warning' | 'informative' | 'passive' | 'aqua' | 'copper' | 'electro' | 'indigo' | 'lime' | 'pink' | 'violet' | 'gold' | 'beige' | 'orchid' | 'gray' | 'cobalt' | 'forestGreen' | 'teal' | 'orange';
|
|
777
|
-
} & ({
|
|
778
|
-
monogram: ReactNode;
|
|
779
|
-
icon?: never;
|
|
780
|
-
} | {
|
|
781
|
-
monogram?: never;
|
|
782
|
-
icon: ReactNode;
|
|
783
|
-
});
|
|
784
|
-
declare const Avatar: ({ monogram, icon, color, size, ...props }: SapphireAvatarProps) => React__default.ReactElement;
|
|
785
119
|
|
|
786
120
|
interface FileSelectProps {
|
|
787
121
|
/**
|
|
@@ -808,7 +142,7 @@ interface FileTriggerProps extends FileSelectProps {
|
|
|
808
142
|
}
|
|
809
143
|
declare const FileTrigger: React__default.ForwardRefExoticComponent<FileTriggerProps & React__default.RefAttributes<HTMLInputElement>>;
|
|
810
144
|
|
|
811
|
-
interface FileDropzoneProps extends SapphireStyleProps,
|
|
145
|
+
interface FileDropzoneProps extends SapphireStyleProps, Pick<DropOptions, 'getDropOperation' | 'onDropEnter' | 'onDropActivate' | 'onDropMove' | 'onDropExit' | 'onDrop'>, HoverProps, FileSelectProps, AriaLabelingProps {
|
|
812
146
|
/**
|
|
813
147
|
* Whether the dropzone has an error
|
|
814
148
|
* @default false
|
|
@@ -826,46 +160,7 @@ interface FileDropzoneProps extends SapphireStyleProps, Omit<DropOptions, 'hasDr
|
|
|
826
160
|
*/
|
|
827
161
|
onFileSelectOpen?: () => void;
|
|
828
162
|
}
|
|
829
|
-
declare const FileDropzone: React__default.ForwardRefExoticComponent<
|
|
830
|
-
|
|
831
|
-
declare type SapphireAlertDialogProps = AriaModalOverlayProps & SapphireStyleProps & Pick<DialogProps, 'isOpen' | 'onClose'> & Omit<SapphireFeedbackMessageProps, 'heading' | 'actions'> & {
|
|
832
|
-
/**
|
|
833
|
-
*
|
|
834
|
-
* @default "horizontal"
|
|
835
|
-
*/
|
|
836
|
-
actionsOrientation?: 'vertical' | 'horizontal';
|
|
837
|
-
/**
|
|
838
|
-
* The elements that will be rendered in the footer of the dialog.
|
|
839
|
-
*/
|
|
840
|
-
actions: ReactNode;
|
|
841
|
-
/**
|
|
842
|
-
* The title of the dialog.
|
|
843
|
-
*/
|
|
844
|
-
heading: string;
|
|
845
|
-
};
|
|
846
|
-
/**
|
|
847
|
-
* `AlertDialog` is a wrapper component around `Dialog` and allows you to interrupt the user's
|
|
848
|
-
* experience to prompt them for important confirmations. (e.g. deleting something, confirming
|
|
849
|
-
* an important or irreversible choice etc.).
|
|
850
|
-
* Don't use them for less relevant of unnecessary confirmations.
|
|
851
|
-
*
|
|
852
|
-
* The title should be similar to the action that prompted the user to open it.
|
|
853
|
-
*/
|
|
854
|
-
declare const AlertDialog: React__default.ForwardRefExoticComponent<AriaModalOverlayProps & SapphireStyleProps & Pick<DialogProps, "isOpen" | "onClose"> & Omit<SapphireFeedbackMessageProps, "heading" | "actions"> & {
|
|
855
|
-
/**
|
|
856
|
-
*
|
|
857
|
-
* @default "horizontal"
|
|
858
|
-
*/
|
|
859
|
-
actionsOrientation?: "horizontal" | "vertical" | undefined;
|
|
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
|
-
} & React__default.RefAttributes<_react_types_shared.DOMRefValue<HTMLDivElement>>>;
|
|
163
|
+
declare const FileDropzone: React__default.ForwardRefExoticComponent<FileDropzoneProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
869
164
|
|
|
870
165
|
interface SapphireNumberFieldProps
|
|
871
166
|
/**
|
|
@@ -900,7 +195,7 @@ interface NumberFieldProps extends SapphireNumberFieldProps, PressEvents, Sapphi
|
|
|
900
195
|
*/
|
|
901
196
|
note?: ReactNode;
|
|
902
197
|
/**
|
|
903
|
-
* A
|
|
198
|
+
* A HelpButton to render next to the label.
|
|
904
199
|
*/
|
|
905
200
|
contextualHelp?: ReactNode;
|
|
906
201
|
/**
|
|
@@ -909,9 +204,9 @@ interface NumberFieldProps extends SapphireNumberFieldProps, PressEvents, Sapphi
|
|
|
909
204
|
*/
|
|
910
205
|
necessityIndicator?: boolean;
|
|
911
206
|
/**
|
|
912
|
-
* @default '
|
|
207
|
+
* @default 'lg'
|
|
913
208
|
*/
|
|
914
|
-
size?: '
|
|
209
|
+
size?: 'lg' | 'md';
|
|
915
210
|
/**
|
|
916
211
|
* Aligns the text inside the input fields without affecting the positioning of the label of the field.
|
|
917
212
|
*/
|
|
@@ -931,7 +226,7 @@ declare const NumberField: React__default.ForwardRefExoticComponent<NumberFieldP
|
|
|
931
226
|
|
|
932
227
|
interface TagGroupProps<T> extends CollectionBase<T>, DOMProps, AriaLabelingProps, SapphireStyleProps {
|
|
933
228
|
/**
|
|
934
|
-
* A
|
|
229
|
+
* A HelpButton element to place next to the label.
|
|
935
230
|
*/
|
|
936
231
|
contextualHelp?: ReactNode;
|
|
937
232
|
/**
|
|
@@ -974,7 +269,7 @@ declare const TagItem: <T>(props: TagItemProps<T>) => JSX.Element;
|
|
|
974
269
|
interface LabeledValueProps extends DOMProps, SapphireStyleProps {
|
|
975
270
|
children?: React__default.ReactNode;
|
|
976
271
|
/**
|
|
977
|
-
* A
|
|
272
|
+
* A HelpButton element to place next to the label.
|
|
978
273
|
*/
|
|
979
274
|
contextualHelp?: ReactNode;
|
|
980
275
|
/**
|
|
@@ -987,10 +282,10 @@ interface LabeledValueProps extends DOMProps, SapphireStyleProps {
|
|
|
987
282
|
*/
|
|
988
283
|
labelPlacement?: 'above' | 'side';
|
|
989
284
|
/**
|
|
990
|
-
* @default '
|
|
285
|
+
* @default 'lg'
|
|
991
286
|
*/
|
|
992
|
-
size?: '
|
|
287
|
+
size?: 'lg' | 'md';
|
|
993
288
|
}
|
|
994
289
|
declare function LabeledValue(props: LabeledValueProps): React__default.JSX.Element;
|
|
995
290
|
|
|
996
|
-
export { _Accordion as Accordion,
|
|
291
|
+
export { _Accordion as Accordion, AccordionContext, AccordionHeadingProps, AccordionItemProps, AccordionProps, FileDropzone, FileDropzoneProps, FileTrigger, FileTriggerProps, FilterDropdown, FilterDropdownProps, LabeledValue, NumberField, NumberFieldProps, NumberFieldRef, TagGroup, TagGroupProps, TagItem };
|