@danske/sapphire-react-lab 0.82.2 → 0.84.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/index.js +1049 -808
- package/build/cjs/index.js.map +1 -1
- package/build/esm/Calendar/src/Calendar.js.map +1 -1
- package/build/esm/Calendar/src/RangeCalendar.js.map +1 -1
- package/build/esm/Calendar/src/useSapphireCalendarState.js.map +1 -1
- package/build/esm/FileDropzone/i18n/da-DK.js +7 -0
- package/build/esm/FileDropzone/i18n/da-DK.js.map +1 -0
- package/build/esm/FileDropzone/i18n/de-DE.js +7 -0
- package/build/esm/FileDropzone/i18n/de-DE.js.map +1 -0
- package/build/esm/FileDropzone/i18n/en-US.js +7 -0
- package/build/esm/FileDropzone/i18n/en-US.js.map +1 -0
- package/build/esm/FileDropzone/i18n/fi-FI.js +7 -0
- package/build/esm/FileDropzone/i18n/fi-FI.js.map +1 -0
- package/build/esm/FileDropzone/i18n/index.js +20 -0
- package/build/esm/FileDropzone/i18n/index.js.map +1 -0
- package/build/esm/FileDropzone/i18n/nb-NO.js +7 -0
- package/build/esm/FileDropzone/i18n/nb-NO.js.map +1 -0
- package/build/esm/FileDropzone/i18n/pl-PL.js +7 -0
- package/build/esm/FileDropzone/i18n/pl-PL.js.map +1 -0
- package/build/esm/FileDropzone/i18n/sv-SE.js +7 -0
- package/build/esm/FileDropzone/i18n/sv-SE.js.map +1 -0
- package/build/esm/FileDropzone/src/FileDropzone.js +122 -0
- package/build/esm/FileDropzone/src/FileDropzone.js.map +1 -0
- package/build/esm/FileDropzone/src/FileTrigger.js +74 -0
- package/build/esm/FileDropzone/src/FileTrigger.js.map +1 -0
- package/build/esm/FileDropzone/src/utils.js +20 -0
- package/build/esm/FileDropzone/src/utils.js.map +1 -0
- package/build/esm/index.js +2 -0
- package/build/esm/index.js.map +1 -1
- package/build/index.d.ts +56 -9
- package/package.json +4 -3
package/build/index.d.ts
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import * as _react_types_shared from '@react-types/shared';
|
|
2
|
-
import { PressEvents, Validation, RangeValue, HelpTextProps, LabelableProps, CollectionBase, DOMProps, Expandable, ItemProps, FocusableRefValue } from '@react-types/shared';
|
|
2
|
+
import { PressEvents, Validation, RangeValue, HelpTextProps, LabelableProps, CollectionBase, DOMProps, Expandable, ItemProps, AriaLabelingProps, FocusableRefValue } from '@react-types/shared';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import React__default, { ReactNode, ComponentType, RefObject } from 'react';
|
|
5
5
|
import { AriaToggleButtonProps } from '@react-aria/button';
|
|
6
6
|
import { SapphireStyleProps, PopoverTriggerProps, HeadingProps, TextStyleProps, DialogProps } from '@danske/sapphire-react';
|
|
7
7
|
import { DateValue } from '@internationalized/date';
|
|
8
8
|
import { AriaCalendarProps, AriaRangeCalendarProps } from '@react-aria/calendar';
|
|
9
|
-
import { RangeCalendarStateOptions as RangeCalendarStateOptions$1 } from '@react-stately/calendar';
|
|
9
|
+
import { CalendarStateOptions, RangeCalendarStateOptions as RangeCalendarStateOptions$1 } from '@react-stately/calendar';
|
|
10
10
|
import { DateValue as DateValue$1, AriaDatePickerProps, AriaDateRangePickerProps } from '@react-aria/datepicker';
|
|
11
11
|
import { DateRangePickerStateOptions as DateRangePickerStateOptions$1 } from '@react-stately/datepicker';
|
|
12
12
|
import { ComboBoxProps } from '@react-types/combobox';
|
|
13
13
|
import { AriaSearchFieldProps } from '@react-aria/searchfield';
|
|
14
14
|
import { AriaToastRegionProps } from '@react-aria/toast';
|
|
15
15
|
import { ToastState } from '@react-stately/toast';
|
|
16
|
+
import { HoverProps } from '@react-aria/interactions';
|
|
17
|
+
import { DropOptions } from '@react-aria/dnd';
|
|
16
18
|
import { AriaModalOverlayProps } from '@react-aria/overlays';
|
|
17
19
|
import { AriaNumberFieldProps } from '@react-aria/numberfield';
|
|
18
20
|
export { useLocale } from '@react-aria/i18n';
|
|
@@ -47,7 +49,7 @@ interface ButtonWithoutIconProps {
|
|
|
47
49
|
declare const ToggleButton: React__default.ForwardRefExoticComponent<SapphireToggleButtonProps & React__default.RefAttributes<_react_types_shared.FocusableRefValue<HTMLButtonElement, HTMLButtonElement>>>;
|
|
48
50
|
|
|
49
51
|
declare type CalendarView = 'days' | 'months' | 'years';
|
|
50
|
-
interface SapphireCalendarStateOptions {
|
|
52
|
+
interface SapphireCalendarStateOptions<T extends DateValue> extends CalendarStateOptions<T> {
|
|
51
53
|
/**
|
|
52
54
|
* Controls the calendar's view (day, month, year).
|
|
53
55
|
*/
|
|
@@ -62,7 +64,7 @@ interface SapphireCalendarStateOptions {
|
|
|
62
64
|
onViewChange?: (value: CalendarView) => void;
|
|
63
65
|
}
|
|
64
66
|
|
|
65
|
-
interface SapphireCalendarProps extends SapphireStyleProps, Omit<AriaCalendarProps<
|
|
67
|
+
interface SapphireCalendarProps<T extends DateValue = DateValue> extends SapphireStyleProps, Omit<AriaCalendarProps<T>, 'validationState' | 'errorMessage'>, Omit<SapphireCalendarStateOptions<T>, 'createCalendar'> {
|
|
66
68
|
/**
|
|
67
69
|
* Whether week numbers are visible as a first column
|
|
68
70
|
*/
|
|
@@ -73,7 +75,7 @@ interface SapphireCalendarProps extends SapphireStyleProps, Omit<AriaCalendarPro
|
|
|
73
75
|
* month, by default, and the user can navigate to previous and next months. It's also possible
|
|
74
76
|
* to navigate to months and years view, to quickly jump to a date far away from the focused date.
|
|
75
77
|
*/
|
|
76
|
-
declare const Calendar: ({ showWeekNumbers, ...props }: Omit<SapphireCalendarProps
|
|
78
|
+
declare const Calendar: <T extends DateValue = DateValue>({ showWeekNumbers, ...props }: Omit<SapphireCalendarProps<T>, "locale">) => JSX.Element;
|
|
77
79
|
|
|
78
80
|
declare type OriginalOnChange$1<T extends DateValue> = NonNullable<RangeCalendarStateOptions$1<T>['onChange']>;
|
|
79
81
|
declare type RangeCalendarStateOptions<T extends DateValue, P extends string> = Omit<RangeCalendarStateOptions$1<T>, 'onChange'> & {
|
|
@@ -87,7 +89,7 @@ interface PredefinedDateRange {
|
|
|
87
89
|
end: DateValue;
|
|
88
90
|
};
|
|
89
91
|
}
|
|
90
|
-
interface SapphireRangeCalendarProps<P extends string = string> extends SapphireStyleProps, Omit<AriaRangeCalendarProps<
|
|
92
|
+
interface SapphireRangeCalendarProps<T extends DateValue = DateValue, P extends string = string> extends SapphireStyleProps, Omit<AriaRangeCalendarProps<T>, 'validationState' | 'errorMessage' | 'allowsNonContiguousRanges' | 'onChange'> {
|
|
91
93
|
/**
|
|
92
94
|
* This callback also gives you the information if the selected range was a
|
|
93
95
|
* predefined date according to the `predefinedRanges` prop.
|
|
@@ -114,8 +116,8 @@ interface SapphireRangeCalendarProps<P extends string = string> extends Sapphire
|
|
|
114
116
|
* Displays a calendar and allow users to select a consecutive range of dates.
|
|
115
117
|
* One or two months can be visible at the same time.
|
|
116
118
|
*/
|
|
117
|
-
declare const _RangeCalendar: <T extends string>({ showWeekNumbers, showTwoMonths, allowUnavailableDatesWithinRange, predefinedRanges, ...props }: SapphireRangeCalendarProps<T>, forwardedRef: React__default.ForwardedRef<HTMLDivElement>) => JSX.Element;
|
|
118
|
-
declare const RangeCalendar: <T extends string>(props: SapphireRangeCalendarProps<T> & {
|
|
119
|
+
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;
|
|
120
|
+
declare const RangeCalendar: <T extends DateValue, P extends string>(props: SapphireRangeCalendarProps<T, P> & {
|
|
119
121
|
ref?: React__default.ForwardedRef<HTMLDivElement> | undefined;
|
|
120
122
|
}) => ReturnType<typeof _RangeCalendar>;
|
|
121
123
|
|
|
@@ -786,6 +788,51 @@ declare type SapphireAvatarProps = SapphireStyleProps & {
|
|
|
786
788
|
});
|
|
787
789
|
declare const Avatar: ({ monogram, icon, color, size, ...props }: SapphireAvatarProps) => React__default.ReactElement;
|
|
788
790
|
|
|
791
|
+
interface FileSelectProps {
|
|
792
|
+
/**
|
|
793
|
+
* List of file types that are allowed to be selected using the file select.
|
|
794
|
+
* When no list is passed, all file types will be allowed to be selected.
|
|
795
|
+
* @default ""
|
|
796
|
+
*/
|
|
797
|
+
acceptedFileTypes?: string[];
|
|
798
|
+
/**
|
|
799
|
+
* Whether multiple files are allowed to be selected using the file select.
|
|
800
|
+
* @default "false"
|
|
801
|
+
*/
|
|
802
|
+
allowsMultiple?: boolean;
|
|
803
|
+
}
|
|
804
|
+
interface FileTriggerProps extends FileSelectProps {
|
|
805
|
+
/**
|
|
806
|
+
* Callback for file selection.
|
|
807
|
+
* @param files - the list of selected files
|
|
808
|
+
* @default "() => null"
|
|
809
|
+
*/
|
|
810
|
+
onSelect?: (files: FileList | null) => void;
|
|
811
|
+
isDisabled?: boolean;
|
|
812
|
+
children?: React__default.ReactNode;
|
|
813
|
+
}
|
|
814
|
+
declare const FileTrigger: React__default.ForwardRefExoticComponent<FileTriggerProps & React__default.RefAttributes<HTMLInputElement>>;
|
|
815
|
+
|
|
816
|
+
interface FileDropzoneProps extends SapphireStyleProps, Omit<DropOptions, 'hasDropButton'>, HoverProps, FileSelectProps, AriaLabelingProps {
|
|
817
|
+
/**
|
|
818
|
+
* Whether the dropzone has an error
|
|
819
|
+
* @default false
|
|
820
|
+
*/
|
|
821
|
+
hasError?: boolean;
|
|
822
|
+
/**
|
|
823
|
+
* The body text of the dropzone which can contain the instructions for the files to be uploaded.
|
|
824
|
+
* Can be rendered differently based on the `isDropping` parameter, which is true if a file is about to be dropped in the zone.
|
|
825
|
+
* @param isDropping - boolean that marks whether a payload is about to be dropped in the dropzone.
|
|
826
|
+
*/
|
|
827
|
+
renderInstruction: (isDropping: boolean) => string;
|
|
828
|
+
/**
|
|
829
|
+
* Function that is called when the file select is opened on press, before any file is selected.
|
|
830
|
+
* @default "() => null"
|
|
831
|
+
*/
|
|
832
|
+
onFileSelectOpen?: () => void;
|
|
833
|
+
}
|
|
834
|
+
declare const FileDropzone: React__default.ForwardRefExoticComponent<Omit<FileDropzoneProps, "ref"> & React__default.RefAttributes<HTMLDivElement>>;
|
|
835
|
+
|
|
789
836
|
declare type SapphireAlertDialogProps = AriaModalOverlayProps & SapphireStyleProps & Pick<DialogProps, 'isOpen' | 'onClose'> & Omit<SapphireFeedbackMessageProps, 'heading' | 'actions'> & {
|
|
790
837
|
/**
|
|
791
838
|
*
|
|
@@ -879,4 +926,4 @@ interface NumberFieldProps extends SapphireNumberFieldProps, PressEvents, Sapphi
|
|
|
879
926
|
}
|
|
880
927
|
declare const NumberField: React__default.ForwardRefExoticComponent<NumberFieldProps & React__default.RefAttributes<NumberFieldRef>>;
|
|
881
928
|
|
|
882
|
-
export { _Accordion as Accordion, AlertDialog, Avatar, Calendar, CalendarView, DateField, DateFieldProps, DateRangeField, DateRangeFieldProps, FeedbackMessage, Fieldset, FieldsetProps, FilterDropdown, NotificationBadge, NotificationBadgeProps, NumberField, NumberFieldProps, NumberFieldRef, PredefinedDateRange, RangeCalendar, SapphireAccordionHeadingProps, SapphireAccordionItemProps, SapphireAccordionProps, SapphireAlertDialogProps, SapphireAvatarProps, SapphireCalendarProps, SapphireFeedbackMessageProps, SapphireFilterDropdownProps, SapphireRangeCalendarProps, SapphireSearchFieldProps, SapphireToggleButtonProps, SearchField, ShowToastFn, ShowToastOptions, Spinner, SpinnerProps, ToastProvider, ToastProviderProps, ToggleButton, Typography, TypographyBodyProps, TypographyCaptionProps, TypographyHeadingProps, TypographySubheadingProps, isDateOutsideValidRange, isEndDateBeforeStartDate, useShowToast };
|
|
929
|
+
export { _Accordion as Accordion, AlertDialog, Avatar, Calendar, CalendarView, DateField, DateFieldProps, DateRangeField, DateRangeFieldProps, FeedbackMessage, Fieldset, FieldsetProps, FileDropzone, FileDropzoneProps, FileTrigger, FileTriggerProps, FilterDropdown, NotificationBadge, NotificationBadgeProps, NumberField, NumberFieldProps, NumberFieldRef, PredefinedDateRange, RangeCalendar, SapphireAccordionHeadingProps, SapphireAccordionItemProps, SapphireAccordionProps, SapphireAlertDialogProps, SapphireAvatarProps, SapphireCalendarProps, SapphireFeedbackMessageProps, SapphireFilterDropdownProps, SapphireRangeCalendarProps, SapphireSearchFieldProps, SapphireToggleButtonProps, SearchField, ShowToastFn, ShowToastOptions, Spinner, SpinnerProps, ToastProvider, ToastProviderProps, ToggleButton, Typography, TypographyBodyProps, TypographyCaptionProps, TypographyHeadingProps, TypographySubheadingProps, isDateOutsideValidRange, isEndDateBeforeStartDate, useShowToast };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@danske/sapphire-react-lab",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.84.0",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"description": "Experimental React components of the Sapphire Design System from Danske Bank A/S",
|
|
6
6
|
"exports": {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"cross-env": "^7.0.3"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@danske/sapphire-css": "^28.0
|
|
39
|
+
"@danske/sapphire-css": "^28.1.0",
|
|
40
40
|
"@internationalized/date": "^3.5.2",
|
|
41
41
|
"@internationalized/string": "^3.2.1",
|
|
42
42
|
"@react-aria/accordion": "^3.0.0-alpha.27",
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
"@react-aria/combobox": "^3.8.4",
|
|
46
46
|
"@react-aria/datepicker": "^3.9.3",
|
|
47
47
|
"@react-aria/dialog": "^3.5.12",
|
|
48
|
+
"@react-aria/dnd": "^3.6.1",
|
|
48
49
|
"@react-aria/focus": "^3.16.2",
|
|
49
50
|
"@react-aria/i18n": "^3.10.2",
|
|
50
51
|
"@react-aria/interactions": "^3.21.1",
|
|
@@ -71,5 +72,5 @@
|
|
|
71
72
|
"clsx": "^1.1.1",
|
|
72
73
|
"react-transition-group": "^4.4.5"
|
|
73
74
|
},
|
|
74
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "07a564af42921a372a62519265afe48ec303efdb"
|
|
75
76
|
}
|