@navikt/ds-react 1.5.7 → 1.5.9-next.1
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/_docs.json +303 -694
- package/cjs/date/hooks/useDatepicker.js +0 -2
- package/esm/date/hooks/useDatepicker.js +0 -2
- package/esm/date/hooks/useDatepicker.js.map +1 -1
- package/package.json +2 -2
- package/src/chat/chat.stories.tsx +2 -2
- package/src/date/hooks/useDatepicker.tsx +0 -3
- package/src/form/stories/switch.stories.tsx +0 -1
- package/src/grid/grid.stories.tsx +1 -1
- package/src/guide-panel/guidepanel.stories.tsx +4 -8
- package/src/tabs/Tabs.stories.tsx +3 -3
- package/esm/accordion/Accordion.d.ts +0 -17
- package/esm/accordion/AccordionContent.d.ts +0 -10
- package/esm/accordion/AccordionHeader.d.ts +0 -10
- package/esm/accordion/AccordionItem.d.ts +0 -26
- package/esm/accordion/index.d.ts +0 -1
- package/esm/alert/Alert.d.ts +0 -31
- package/esm/alert/index.d.ts +0 -2
- package/esm/button/Button.d.ts +0 -39
- package/esm/button/index.d.ts +0 -2
- package/esm/chat/Bubble.d.ts +0 -22
- package/esm/chat/Chat.d.ts +0 -38
- package/esm/chat/index.d.ts +0 -1
- package/esm/chips/Chips.d.ts +0 -17
- package/esm/chips/Removable.d.ts +0 -23
- package/esm/chips/Toggle.d.ts +0 -13
- package/esm/chips/index.d.ts +0 -1
- package/esm/date/DateInput.d.ts +0 -25
- package/esm/date/datepicker/DatePicker.d.ts +0 -90
- package/esm/date/datepicker/DatePickerStandalone.d.ts +0 -12
- package/esm/date/datepicker/DayButton.d.ts +0 -3
- package/esm/date/datepicker/Head.d.ts +0 -3
- package/esm/date/datepicker/caption/Caption.d.ts +0 -4
- package/esm/date/datepicker/caption/DropdownCaption.d.ts +0 -4
- package/esm/date/datepicker/caption/index.d.ts +0 -2
- package/esm/date/hooks/index.d.ts +0 -8
- package/esm/date/hooks/useDateInputContext.d.ts +0 -18
- package/esm/date/hooks/useDatepicker.d.ts +0 -63
- package/esm/date/hooks/useMonthPicker.d.ts +0 -58
- package/esm/date/hooks/useRangeDatepicker.d.ts +0 -53
- package/esm/date/hooks/useSharedMonthContext.d.ts +0 -21
- package/esm/date/index.d.ts +0 -6
- package/esm/date/monthpicker/MonthButton.d.ts +0 -11
- package/esm/date/monthpicker/MonthCaption.d.ts +0 -3
- package/esm/date/monthpicker/MonthPicker.d.ts +0 -85
- package/esm/date/monthpicker/MonthPickerStandalone.d.ts +0 -11
- package/esm/date/monthpicker/MonthSelector.d.ts +0 -3
- package/esm/date/utils/check-dates.d.ts +0 -4
- package/esm/date/utils/dates-disabled.d.ts +0 -1
- package/esm/date/utils/format-date.d.ts +0 -1
- package/esm/date/utils/get-dates.d.ts +0 -2
- package/esm/date/utils/get-initial-year.d.ts +0 -5
- package/esm/date/utils/index.d.ts +0 -10
- package/esm/date/utils/is-match.d.ts +0 -4
- package/esm/date/utils/labels.d.ts +0 -6
- package/esm/date/utils/locale.d.ts +0 -2
- package/esm/date/utils/navigation.d.ts +0 -2
- package/esm/date/utils/parse-date.d.ts +0 -3
- package/esm/form/ConfirmationPanel.d.ts +0 -22
- package/esm/form/Fieldset/Fieldset.d.ts +0 -42
- package/esm/form/Fieldset/index.d.ts +0 -1
- package/esm/form/Fieldset/useFieldset.d.ts +0 -14
- package/esm/form/Select.d.ts +0 -26
- package/esm/form/Switch.d.ts +0 -27
- package/esm/form/TextField.d.ts +0 -31
- package/esm/form/Textarea.d.ts +0 -48
- package/esm/form/checkbox/Checkbox.d.ts +0 -36
- package/esm/form/checkbox/CheckboxGroup.d.ts +0 -28
- package/esm/form/checkbox/index.d.ts +0 -2
- package/esm/form/checkbox/useCheckbox.d.ts +0 -21
- package/esm/form/error-summary/ErrorSummary.d.ts +0 -27
- package/esm/form/error-summary/ErrorSummaryItem.d.ts +0 -11
- package/esm/form/error-summary/index.d.ts +0 -2
- package/esm/form/index.d.ts +0 -10
- package/esm/form/radio/Radio.d.ts +0 -18
- package/esm/form/radio/RadioGroup.d.ts +0 -38
- package/esm/form/radio/index.d.ts +0 -2
- package/esm/form/radio/useRadio.d.ts +0 -23
- package/esm/form/search/Search.d.ts +0 -57
- package/esm/form/search/SearchButton.d.ts +0 -11
- package/esm/form/search/index.d.ts +0 -1
- package/esm/form/useFormField.d.ts +0 -44
- package/esm/grid/Cell.d.ts +0 -26
- package/esm/grid/ContentContainer.d.ts +0 -9
- package/esm/grid/Grid.d.ts +0 -9
- package/esm/grid/index.d.ts +0 -3
- package/esm/guide-panel/Guide.d.ts +0 -14
- package/esm/guide-panel/GuidePanel.d.ts +0 -18
- package/esm/guide-panel/Illustration.d.ts +0 -7
- package/esm/guide-panel/index.d.ts +0 -3
- package/esm/help-text/HelpText.d.ts +0 -17
- package/esm/help-text/index.d.ts +0 -2
- package/esm/index.d.ts +0 -27
- package/esm/link/Link.d.ts +0 -10
- package/esm/link/index.d.ts +0 -2
- package/esm/link-panel/LinkPanel.d.ts +0 -22
- package/esm/link-panel/LinkPanelDescription.d.ts +0 -7
- package/esm/link-panel/LinkPanelTitle.d.ts +0 -8
- package/esm/link-panel/index.d.ts +0 -2
- package/esm/loader/Loader.d.ts +0 -26
- package/esm/loader/index.d.ts +0 -2
- package/esm/modal/Modal.d.ts +0 -59
- package/esm/modal/ModalContent.d.ts +0 -10
- package/esm/modal/index.d.ts +0 -2
- package/esm/pagination/Pagination.d.ts +0 -53
- package/esm/pagination/PaginationItem.d.ts +0 -22
- package/esm/pagination/index.d.ts +0 -1
- package/esm/panel/Panel.d.ts +0 -16
- package/esm/panel/index.d.ts +0 -2
- package/esm/popover/Popover.d.ts +0 -47
- package/esm/popover/PopoverContent.d.ts +0 -10
- package/esm/popover/index.d.ts +0 -2
- package/esm/provider/Provider.d.ts +0 -20
- package/esm/provider/index.d.ts +0 -1
- package/esm/read-more/ReadMore.d.ts +0 -28
- package/esm/read-more/index.d.ts +0 -2
- package/esm/stepper/Step.d.ts +0 -28
- package/esm/stepper/Stepper.d.ts +0 -41
- package/esm/stepper/index.d.ts +0 -1
- package/esm/table/Body.d.ts +0 -7
- package/esm/table/ColumnHeader.d.ts +0 -17
- package/esm/table/DataCell.d.ts +0 -12
- package/esm/table/ExpandableRow.d.ts +0 -41
- package/esm/table/Header.d.ts +0 -7
- package/esm/table/HeaderCell.d.ts +0 -13
- package/esm/table/Row.d.ts +0 -17
- package/esm/table/Table.d.ts +0 -49
- package/esm/table/index.d.ts +0 -8
- package/esm/tabs/Tab.d.ts +0 -19
- package/esm/tabs/TabList.d.ts +0 -10
- package/esm/tabs/TabPanel.d.ts +0 -14
- package/esm/tabs/Tabs.d.ts +0 -52
- package/esm/tabs/index.d.ts +0 -4
- package/esm/tag/Tag.d.ts +0 -14
- package/esm/tag/index.d.ts +0 -1
- package/esm/toggle-group/ToggleGroup.d.ts +0 -38
- package/esm/toggle-group/ToggleItem.d.ts +0 -14
- package/esm/toggle-group/index.d.ts +0 -2
- package/esm/tooltip/Tooltip.d.ts +0 -53
- package/esm/tooltip/index.d.ts +0 -1
- package/esm/typography/BodyLong.d.ts +0 -19
- package/esm/typography/BodyShort.d.ts +0 -19
- package/esm/typography/Detail.d.ts +0 -23
- package/esm/typography/ErrorMessage.d.ts +0 -19
- package/esm/typography/Heading.d.ts +0 -24
- package/esm/typography/Ingress.d.ts +0 -14
- package/esm/typography/Label.d.ts +0 -19
- package/esm/typography/index.d.ts +0 -7
- package/esm/util/AnimateHeight.d.ts +0 -10
- package/esm/util/OverridableComponent.d.ts +0 -7
- package/esm/util/TextareaAutoSize.d.ts +0 -14
- package/esm/util/debounce.d.ts +0 -4
- package/esm/util/index.d.ts +0 -13
- package/esm/util/mergeRefs.d.ts +0 -2
- package/esm/util/useId.d.ts +0 -7
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { DateInputProps } from "../DateInput";
|
|
2
|
-
import { DatePickerProps } from "../datepicker/DatePicker";
|
|
3
|
-
export interface UseDatepickerOptions extends Pick<DatePickerProps, "locale" | "fromDate" | "toDate" | "today" | "toDate" | "fromDate" | "toDate" | "disabled" | "disableWeekends"> {
|
|
4
|
-
/**
|
|
5
|
-
* The initially selected Date
|
|
6
|
-
*/
|
|
7
|
-
defaultSelected?: Date;
|
|
8
|
-
/**
|
|
9
|
-
* Default shown month
|
|
10
|
-
*/
|
|
11
|
-
defaultMonth?: Date;
|
|
12
|
-
/**
|
|
13
|
-
* Make selection of Date required
|
|
14
|
-
*/
|
|
15
|
-
required?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Callback for changed state
|
|
18
|
-
*/
|
|
19
|
-
onDateChange?: (val?: Date) => void;
|
|
20
|
-
/**
|
|
21
|
-
* Input-format
|
|
22
|
-
* @default "dd.MM.yyyy"
|
|
23
|
-
*/
|
|
24
|
-
inputFormat?: string;
|
|
25
|
-
/**
|
|
26
|
-
* validation-callback
|
|
27
|
-
*/
|
|
28
|
-
onValidate?: (val: DateValidationT) => void;
|
|
29
|
-
}
|
|
30
|
-
interface UseDatepickerValue {
|
|
31
|
-
/**
|
|
32
|
-
* Use: <DatePicker {...datepickerProps}/>
|
|
33
|
-
*/
|
|
34
|
-
datepickerProps: DatePickerProps;
|
|
35
|
-
/**
|
|
36
|
-
* Use: <DatePicker.Input {...inputProps}/>
|
|
37
|
-
*/
|
|
38
|
-
inputProps: Pick<DateInputProps, "onChange" | "onFocus" | "onBlur" | "value">;
|
|
39
|
-
/**
|
|
40
|
-
* Resets all states (callback)
|
|
41
|
-
*/
|
|
42
|
-
reset: () => void;
|
|
43
|
-
/**
|
|
44
|
-
* Currently selected date
|
|
45
|
-
* Up to user to validate date
|
|
46
|
-
*/
|
|
47
|
-
selectedDay?: Date;
|
|
48
|
-
/**
|
|
49
|
-
* Manually override currently selected day
|
|
50
|
-
*/
|
|
51
|
-
setSelected: (date?: Date) => void;
|
|
52
|
-
}
|
|
53
|
-
export declare type DateValidationT = {
|
|
54
|
-
isDisabled: boolean;
|
|
55
|
-
isWeekend: boolean;
|
|
56
|
-
isEmpty: boolean;
|
|
57
|
-
isInvalid: boolean;
|
|
58
|
-
isValidDate: boolean;
|
|
59
|
-
isBefore: boolean;
|
|
60
|
-
isAfter: boolean;
|
|
61
|
-
};
|
|
62
|
-
export declare const useDatepicker: (opt?: UseDatepickerOptions) => UseDatepickerValue;
|
|
63
|
-
export {};
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { DateInputProps } from "../DateInput";
|
|
2
|
-
import { MonthPickerProps } from "../monthpicker/MonthPicker";
|
|
3
|
-
export interface UseMonthPickerOptions extends Pick<MonthPickerProps, "locale" | "fromDate" | "toDate" | "disabled" | "defaultSelected"> {
|
|
4
|
-
/**
|
|
5
|
-
* Make Date-selection required
|
|
6
|
-
*/
|
|
7
|
-
required?: boolean;
|
|
8
|
-
/**
|
|
9
|
-
* Callback for month-change
|
|
10
|
-
*/
|
|
11
|
-
onMonthChange?: (date?: Date) => void;
|
|
12
|
-
/**
|
|
13
|
-
* Input-format
|
|
14
|
-
* @default "MMMM yyyy"
|
|
15
|
-
*/
|
|
16
|
-
inputFormat?: string;
|
|
17
|
-
/**
|
|
18
|
-
* validation-callback
|
|
19
|
-
*/
|
|
20
|
-
onValidate?: (val: MonthValidationT) => void;
|
|
21
|
-
/**
|
|
22
|
-
* Default shown year
|
|
23
|
-
*/
|
|
24
|
-
defaultYear?: Date;
|
|
25
|
-
}
|
|
26
|
-
interface UseMonthPickerValue {
|
|
27
|
-
/**
|
|
28
|
-
* Use: <MonthPicker {...monthpickerProps} />
|
|
29
|
-
*/
|
|
30
|
-
monthpickerProps: MonthPickerProps;
|
|
31
|
-
/**
|
|
32
|
-
* Use: <MonthPicker.Input {...inputProps} />
|
|
33
|
-
*/
|
|
34
|
-
inputProps: Pick<DateInputProps, "onChange" | "onFocus" | "value">;
|
|
35
|
-
/**
|
|
36
|
-
* Currently selected Date
|
|
37
|
-
* Up to user to validate value and extract month
|
|
38
|
-
*/
|
|
39
|
-
selectedMonth?: Date;
|
|
40
|
-
/**
|
|
41
|
-
* Manually set selected month if needed
|
|
42
|
-
*/
|
|
43
|
-
setSelected: (date?: Date) => void;
|
|
44
|
-
/**
|
|
45
|
-
* Resets all states
|
|
46
|
-
*/
|
|
47
|
-
reset: () => void;
|
|
48
|
-
}
|
|
49
|
-
export declare type MonthValidationT = {
|
|
50
|
-
isDisabled: boolean;
|
|
51
|
-
isEmpty: boolean;
|
|
52
|
-
isInvalid: boolean;
|
|
53
|
-
isValidMonth: boolean;
|
|
54
|
-
isBefore: boolean;
|
|
55
|
-
isAfter: boolean;
|
|
56
|
-
};
|
|
57
|
-
export declare const useMonthpicker: (opt?: UseMonthPickerOptions) => UseMonthPickerValue;
|
|
58
|
-
export {};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { DateRange } from "react-day-picker";
|
|
2
|
-
import { DateInputProps } from "../DateInput";
|
|
3
|
-
import { DatePickerProps } from "../datepicker/DatePicker";
|
|
4
|
-
import { DateValidationT, UseDatepickerOptions } from "./useDatepicker";
|
|
5
|
-
export declare type RangeValidationT = {
|
|
6
|
-
from: DateValidationT;
|
|
7
|
-
to: DateValidationT & {
|
|
8
|
-
isBeforeFrom?: boolean;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
interface UseRangeDatepickerOptions extends Omit<UseDatepickerOptions, "defaultSelected" | "onDateChange" | "onValidate"> {
|
|
12
|
-
/**
|
|
13
|
-
* The initially selected DateRange
|
|
14
|
-
*/
|
|
15
|
-
defaultSelected?: DateRange;
|
|
16
|
-
/**
|
|
17
|
-
* Callback for changed state
|
|
18
|
-
*/
|
|
19
|
-
onRangeChange?: (val?: DateRange) => void;
|
|
20
|
-
/**
|
|
21
|
-
* validation-callback
|
|
22
|
-
*/
|
|
23
|
-
onValidate?: (val: RangeValidationT) => void;
|
|
24
|
-
}
|
|
25
|
-
interface UseRangeDatepickerValue {
|
|
26
|
-
/**
|
|
27
|
-
* Use: <DatePicker {...datepickerProps}/>
|
|
28
|
-
*/
|
|
29
|
-
datepickerProps: DatePickerProps;
|
|
30
|
-
/**
|
|
31
|
-
* Use: <DatePicker.Input label="from" {...fromInputProps}/>
|
|
32
|
-
*/
|
|
33
|
-
fromInputProps: Pick<DateInputProps, "onChange" | "onFocus" | "onBlur" | "value">;
|
|
34
|
-
/**
|
|
35
|
-
* Use: <DatePicker.Input label="to" {...toInputProps}/>
|
|
36
|
-
*/
|
|
37
|
-
toInputProps: Pick<DateInputProps, "onChange" | "onFocus" | "onBlur" | "value">;
|
|
38
|
-
/**
|
|
39
|
-
* Resets all states (callback)
|
|
40
|
-
*/
|
|
41
|
-
reset: () => void;
|
|
42
|
-
/**
|
|
43
|
-
* Currently selected DateRange
|
|
44
|
-
* Up to user to validate values
|
|
45
|
-
*/
|
|
46
|
-
selectedRange?: DateRange;
|
|
47
|
-
/**
|
|
48
|
-
* Manually override currently selected day
|
|
49
|
-
*/
|
|
50
|
-
setSelected: (date?: DateRange) => void;
|
|
51
|
-
}
|
|
52
|
-
export declare const useRangeDatepicker: (opt?: UseRangeDatepickerOptions) => UseRangeDatepickerValue;
|
|
53
|
-
export {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Matcher } from "../utils";
|
|
3
|
-
export declare type SharedMonthContextType = {
|
|
4
|
-
hasDropdown: boolean;
|
|
5
|
-
year: Date;
|
|
6
|
-
toYear: (date: Date) => void;
|
|
7
|
-
disabled: Matcher[];
|
|
8
|
-
selected?: Date;
|
|
9
|
-
onSelect: (v?: Date) => void;
|
|
10
|
-
};
|
|
11
|
-
export declare const SharedMonthContext: React.Context<SharedMonthContextType>;
|
|
12
|
-
export declare const useSharedMonthContext: () => SharedMonthContextType;
|
|
13
|
-
export declare const SharedMonthProvider: ({ children, dropdownCaption, disabled, selected, onSelect, year: _year, onYearChange, }: {
|
|
14
|
-
children: any;
|
|
15
|
-
dropdownCaption: any;
|
|
16
|
-
disabled: any;
|
|
17
|
-
selected: any;
|
|
18
|
-
onSelect: any;
|
|
19
|
-
year: any;
|
|
20
|
-
onYearChange: any;
|
|
21
|
-
}) => JSX.Element;
|
package/esm/date/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { DateInputProps } from "./DateInput";
|
|
2
|
-
export { DatePickerProps, default as UNSAFE_DatePicker, } from "./datepicker/DatePicker";
|
|
3
|
-
export { DatePickerStandaloneProps } from "./datepicker/DatePickerStandalone";
|
|
4
|
-
export { MonthPickerStandaloneProps } from "./monthpicker/MonthPickerStandalone";
|
|
5
|
-
export { UNSAFE_useDatepicker, UNSAFE_useMonthpicker, UNSAFE_useRangeDatepicker, RangeValidationT, DateValidationT, MonthValidationT, } from "./hooks";
|
|
6
|
-
export { default as UNSAFE_MonthPicker, MonthPickerProps, } from "./monthpicker/MonthPicker";
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
interface MonthType {
|
|
3
|
-
month: Date;
|
|
4
|
-
months: Date[];
|
|
5
|
-
focus: Date | undefined;
|
|
6
|
-
setFocus: Function;
|
|
7
|
-
tabRoot?: Date;
|
|
8
|
-
setTabRoot: Function;
|
|
9
|
-
}
|
|
10
|
-
export declare const MonthButton: ({ month, months, focus, setFocus, tabRoot, setTabRoot, }: MonthType) => JSX.Element;
|
|
11
|
-
export default MonthButton;
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { DateInputType } from "../DateInput";
|
|
3
|
-
import { Matcher } from "../utils";
|
|
4
|
-
import { MonthPickerStandaloneType } from "./MonthPickerStandalone";
|
|
5
|
-
export interface MonthPickerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
6
|
-
/**
|
|
7
|
-
* Element monthpicker anchors to. Use <MonthPicker.Input /> for built-in toggle,
|
|
8
|
-
* or make your own with the open/onClose props
|
|
9
|
-
*/
|
|
10
|
-
children?: React.ReactNode;
|
|
11
|
-
/**
|
|
12
|
-
* Classname for datepicker in popover
|
|
13
|
-
*/
|
|
14
|
-
className?: string;
|
|
15
|
-
/**
|
|
16
|
-
* Classname for wrapper
|
|
17
|
-
*/
|
|
18
|
-
wrapperClassName?: string;
|
|
19
|
-
/**
|
|
20
|
-
* The earliest month to start navigation.
|
|
21
|
-
*/
|
|
22
|
-
fromDate?: Date;
|
|
23
|
-
/**
|
|
24
|
-
* The latest day to end navigation.
|
|
25
|
-
*/
|
|
26
|
-
toDate?: Date;
|
|
27
|
-
/**
|
|
28
|
-
* Changes monthpicker locale
|
|
29
|
-
* @default "nb" (norsk bokmål)
|
|
30
|
-
*/
|
|
31
|
-
locale?: "nb" | "nn" | "en";
|
|
32
|
-
/**
|
|
33
|
-
* Display dropdown for choosing year. Needs `fromDate` + `toDate` to work.
|
|
34
|
-
* @default false
|
|
35
|
-
*/
|
|
36
|
-
dropdownCaption?: boolean;
|
|
37
|
-
/**
|
|
38
|
-
* Apply the disabled modifier to the matching months. Uses a subset of React Day Picker Matcher type. https://react-day-picker.js.org/api/types/Matcher
|
|
39
|
-
*/
|
|
40
|
-
disabled?: Matcher[];
|
|
41
|
-
/**
|
|
42
|
-
* Controlled selected-month
|
|
43
|
-
*/
|
|
44
|
-
selected?: Date;
|
|
45
|
-
/**
|
|
46
|
-
* Default selected month.
|
|
47
|
-
*/
|
|
48
|
-
defaultSelected?: Date;
|
|
49
|
-
/**
|
|
50
|
-
* Open state for user-controlled state. Component controlled by default
|
|
51
|
-
*/
|
|
52
|
-
open?: boolean;
|
|
53
|
-
/**
|
|
54
|
-
* onClose callback for user-controlled state
|
|
55
|
-
*/
|
|
56
|
-
onClose?: () => void;
|
|
57
|
-
/**
|
|
58
|
-
* onOpenToggle callback for user-controlled-state. Only called if `<MonthPicker.Input />` is used
|
|
59
|
-
*/
|
|
60
|
-
onOpenToggle?: () => void;
|
|
61
|
-
/**
|
|
62
|
-
* Callback for user-controlled state
|
|
63
|
-
*/
|
|
64
|
-
onMonthSelect?: Function;
|
|
65
|
-
/**
|
|
66
|
-
* Used to set visible year programmatically. Component controlled by default
|
|
67
|
-
*/
|
|
68
|
-
year?: Date;
|
|
69
|
-
/**
|
|
70
|
-
* Event fired when the user navigates between years.
|
|
71
|
-
*/
|
|
72
|
-
onYearChange?: (y?: Date) => void;
|
|
73
|
-
}
|
|
74
|
-
interface MonthPickerComponent extends React.ForwardRefExoticComponent<MonthPickerProps> {
|
|
75
|
-
/**
|
|
76
|
-
* Variant without popover
|
|
77
|
-
*/
|
|
78
|
-
Standalone: MonthPickerStandaloneType;
|
|
79
|
-
/**
|
|
80
|
-
* Built-in Inputfield
|
|
81
|
-
*/
|
|
82
|
-
Input: DateInputType;
|
|
83
|
-
}
|
|
84
|
-
export declare const MonthPicker: MonthPickerComponent;
|
|
85
|
-
export default MonthPicker;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { MonthPickerProps } from "./MonthPicker";
|
|
3
|
-
export interface MonthPickerStandaloneProps extends Omit<MonthPickerProps, "open" | "onClose" | "onOpenToggle" | "wrapperClassName"> {
|
|
4
|
-
/**
|
|
5
|
-
* Monthpicker classname
|
|
6
|
-
*/
|
|
7
|
-
className?: string;
|
|
8
|
-
}
|
|
9
|
-
export declare type MonthPickerStandaloneType = React.ForwardRefExoticComponent<MonthPickerStandaloneProps & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
-
export declare const MonthPickerStandalone: React.ForwardRefExoticComponent<MonthPickerStandaloneProps & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
-
export default MonthPickerStandalone;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const disableDate: (disabledSelection: Date | Array<any>, date: Date) => boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const formatDateForInput: (date: Date, locale: Locale, type: "date" | "month", inputFormat?: string) => string;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export { formatDateForInput } from "./format-date";
|
|
2
|
-
export { getMonths, getYears } from "./get-dates";
|
|
3
|
-
export { labelMonthDropdown, labelYearDropdown, labels, labelNextYear, labelPrevYear, } from "./labels";
|
|
4
|
-
export { INPUT_DATE_STRING_FORMAT_DATE, INPUT_DATE_STRING_FORMAT_MONTH, parseDate, } from "./parse-date";
|
|
5
|
-
export { getLocaleFromString } from "./locale";
|
|
6
|
-
export { disableDate } from "./dates-disabled";
|
|
7
|
-
export { dateIsInCurrentMonth, isValidDate, hasNextYear } from "./check-dates";
|
|
8
|
-
export { getInitialYear } from "./get-initial-year";
|
|
9
|
-
export { isMatch, isDateInRange, Matcher } from "./is-match";
|
|
10
|
-
export { nextEnabled } from "./navigation";
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { DateAfter, DateBefore, DateRange } from "react-day-picker";
|
|
2
|
-
export declare type Matcher = ((date: Date) => boolean) | Date | Date[] | DateRange | DateBefore | DateAfter;
|
|
3
|
-
export declare function isMatch(day: Date, matchers: Matcher[]): boolean;
|
|
4
|
-
export declare function isDateInRange(date: Date, range: DateRange): boolean;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Labels } from "react-day-picker";
|
|
2
|
-
export declare const labelYearDropdown: (locale: Locale) => "År" | "Year";
|
|
3
|
-
export declare const labelMonthDropdown: (locale: Locale) => "Måned" | "Månad" | "Month";
|
|
4
|
-
export declare const labelNextYear: (localeCode: string | undefined) => "Gå til neste måned" | "Gå til neste år" | "Go to next year";
|
|
5
|
-
export declare const labelPrevYear: (localeCode: string | undefined) => string;
|
|
6
|
-
export declare const labels: Partial<Labels>;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { CheckboxProps } from "..";
|
|
3
|
-
export interface ConfirmationPanelProps extends Omit<CheckboxProps, "children" | "indeterminate" | "hideLabel" | "error"> {
|
|
4
|
-
/**
|
|
5
|
-
* Additional information on panel
|
|
6
|
-
*/
|
|
7
|
-
children?: React.ReactNode;
|
|
8
|
-
/**
|
|
9
|
-
* Checkbox label
|
|
10
|
-
*/
|
|
11
|
-
label: React.ReactNode;
|
|
12
|
-
/**
|
|
13
|
-
* Error message for element
|
|
14
|
-
*/
|
|
15
|
-
error?: React.ReactNode;
|
|
16
|
-
/**
|
|
17
|
-
* Override internal errorId
|
|
18
|
-
*/
|
|
19
|
-
errorId?: string;
|
|
20
|
-
}
|
|
21
|
-
export declare const ConfirmationPanel: React.ForwardRefExoticComponent<ConfirmationPanelProps & React.RefAttributes<HTMLInputElement>>;
|
|
22
|
-
export default ConfirmationPanel;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import React, { FieldsetHTMLAttributes } from "react";
|
|
2
|
-
import { FormFieldProps } from "../useFormField";
|
|
3
|
-
export declare type FieldsetContextProps = {
|
|
4
|
-
/**
|
|
5
|
-
* Error message applied to element,
|
|
6
|
-
*/
|
|
7
|
-
error?: React.ReactNode;
|
|
8
|
-
/**
|
|
9
|
-
* Overrides internal errorId
|
|
10
|
-
*/
|
|
11
|
-
errorId: string;
|
|
12
|
-
/**
|
|
13
|
-
* Changes paddings, margins and font-sizes
|
|
14
|
-
*/
|
|
15
|
-
size: "medium" | "small";
|
|
16
|
-
/**
|
|
17
|
-
* Sets fieldset and all form-children to disabled
|
|
18
|
-
*/
|
|
19
|
-
disabled: boolean;
|
|
20
|
-
};
|
|
21
|
-
export declare const FieldsetContext: React.Context<FieldsetContextProps | null>;
|
|
22
|
-
export interface FieldsetProps extends FormFieldProps, FieldsetHTMLAttributes<HTMLFieldSetElement> {
|
|
23
|
-
/**
|
|
24
|
-
* FormFields in Fieldset
|
|
25
|
-
*/
|
|
26
|
-
children: React.ReactNode;
|
|
27
|
-
/**
|
|
28
|
-
* Fieldset legend
|
|
29
|
-
*/
|
|
30
|
-
legend: React.ReactNode;
|
|
31
|
-
/**
|
|
32
|
-
* If enabled shows the legend and description for screenreaders only
|
|
33
|
-
*/
|
|
34
|
-
hideLegend?: boolean;
|
|
35
|
-
/**
|
|
36
|
-
* Toggles error propagation to child-elements
|
|
37
|
-
* @default true
|
|
38
|
-
*/
|
|
39
|
-
errorPropagation?: boolean;
|
|
40
|
-
}
|
|
41
|
-
export declare const Fieldset: React.ForwardRefExoticComponent<FieldsetProps & React.RefAttributes<HTMLFieldSetElement>>;
|
|
42
|
-
export default Fieldset;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Fieldset, FieldsetProps, FieldsetContext, } from "./Fieldset";
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Handles props for Fieldset in context with parent Fieldset.
|
|
3
|
-
*/
|
|
4
|
-
export declare const useFieldset: (props: any) => {
|
|
5
|
-
inputProps: {
|
|
6
|
-
"aria-invalid": boolean;
|
|
7
|
-
"aria-describedby": string | undefined;
|
|
8
|
-
};
|
|
9
|
-
showErrorMsg: boolean;
|
|
10
|
-
hasError: boolean;
|
|
11
|
-
errorId: string;
|
|
12
|
-
inputDescriptionId: string;
|
|
13
|
-
size: "medium" | "small";
|
|
14
|
-
};
|
package/esm/form/Select.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React, { SelectHTMLAttributes } from "react";
|
|
2
|
-
import { FormFieldProps } from "./useFormField";
|
|
3
|
-
export interface SelectProps extends FormFieldProps, Omit<SelectHTMLAttributes<HTMLSelectElement>, "size"> {
|
|
4
|
-
/**
|
|
5
|
-
* Collection of <option />-elements
|
|
6
|
-
*/
|
|
7
|
-
children: React.ReactNode;
|
|
8
|
-
/**
|
|
9
|
-
* Exposes the HTML size attribute
|
|
10
|
-
*/
|
|
11
|
-
htmlSize?: number;
|
|
12
|
-
/**
|
|
13
|
-
* Label for select
|
|
14
|
-
*/
|
|
15
|
-
label: React.ReactNode;
|
|
16
|
-
/**
|
|
17
|
-
* If enabled shows the label and description for screenreaders only
|
|
18
|
-
*/
|
|
19
|
-
hideLabel?: boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Sets inline-style on select wrapper
|
|
22
|
-
*/
|
|
23
|
-
style?: React.CSSProperties;
|
|
24
|
-
}
|
|
25
|
-
export declare const Select: React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<HTMLSelectElement>>;
|
|
26
|
-
export default Select;
|
package/esm/form/Switch.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import React, { InputHTMLAttributes } from "react";
|
|
2
|
-
import { FormFieldProps } from "./useFormField";
|
|
3
|
-
export interface SwitchProps extends Omit<FormFieldProps, "error" | "errorId">, Omit<InputHTMLAttributes<HTMLInputElement>, "size"> {
|
|
4
|
-
/**
|
|
5
|
-
* Switch-label
|
|
6
|
-
*/
|
|
7
|
-
children: React.ReactNode;
|
|
8
|
-
/**
|
|
9
|
-
* If enabled shows the label and description for screenreaders only
|
|
10
|
-
*/
|
|
11
|
-
hideLabel?: boolean;
|
|
12
|
-
/**
|
|
13
|
-
* Toggles loading state with loader-component on switch
|
|
14
|
-
*/
|
|
15
|
-
loading?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Positions switch on left/right side of label
|
|
18
|
-
* @default "left"
|
|
19
|
-
*/
|
|
20
|
-
position?: "left" | "right";
|
|
21
|
-
/**
|
|
22
|
-
* Adds a description to extend labling of Switch
|
|
23
|
-
*/
|
|
24
|
-
description?: string;
|
|
25
|
-
}
|
|
26
|
-
export declare const Switch: React.ForwardRefExoticComponent<SwitchProps & React.RefAttributes<HTMLInputElement>>;
|
|
27
|
-
export default Switch;
|
package/esm/form/TextField.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React, { InputHTMLAttributes } from "react";
|
|
2
|
-
import { FormFieldProps } from "./useFormField";
|
|
3
|
-
export interface TextFieldProps extends FormFieldProps, Omit<InputHTMLAttributes<HTMLInputElement>, "size"> {
|
|
4
|
-
/**
|
|
5
|
-
* Controlled value
|
|
6
|
-
*/
|
|
7
|
-
value?: string | number;
|
|
8
|
-
/**
|
|
9
|
-
* Defaults input-value without needing controlled-state
|
|
10
|
-
*/
|
|
11
|
-
defaultValue?: string | number;
|
|
12
|
-
/**
|
|
13
|
-
* Exposes the HTML size attribute
|
|
14
|
-
*/
|
|
15
|
-
htmlSize?: number;
|
|
16
|
-
/**
|
|
17
|
-
* If enabled shows the label and description for screenreaders only
|
|
18
|
-
*/
|
|
19
|
-
hideLabel?: boolean;
|
|
20
|
-
/**
|
|
21
|
-
* TextField label
|
|
22
|
-
*/
|
|
23
|
-
label: React.ReactNode;
|
|
24
|
-
/**
|
|
25
|
-
* Type of form control. Picking the correct type helps user fill inn their required information
|
|
26
|
-
* @default "text"
|
|
27
|
-
*/
|
|
28
|
-
type?: "email" | "number" | "password" | "tel" | "text" | "url";
|
|
29
|
-
}
|
|
30
|
-
export declare const TextField: React.ForwardRefExoticComponent<TextFieldProps & React.RefAttributes<HTMLInputElement>>;
|
|
31
|
-
export default TextField;
|
package/esm/form/Textarea.d.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { FormFieldProps } from "./useFormField";
|
|
3
|
-
/**
|
|
4
|
-
* TODO: Mulighet for lokalisering av sr-only/counter text
|
|
5
|
-
*/
|
|
6
|
-
export interface TextareaProps extends FormFieldProps, React.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
7
|
-
/**
|
|
8
|
-
* Allowed character-count for content
|
|
9
|
-
* @note This is just a visual validator, you need to set actual character-limits if needed
|
|
10
|
-
*/
|
|
11
|
-
maxLength?: number;
|
|
12
|
-
/**
|
|
13
|
-
* Controlled value
|
|
14
|
-
*/
|
|
15
|
-
value?: string;
|
|
16
|
-
/**
|
|
17
|
-
* Defaults input-value without needing controlled-state
|
|
18
|
-
*/
|
|
19
|
-
defaultValue?: string;
|
|
20
|
-
/**
|
|
21
|
-
* Maximum number of character rows to display.
|
|
22
|
-
* @bug Internal scrolling with `maxLength` scrolls over maxLength-text
|
|
23
|
-
*/
|
|
24
|
-
maxRows?: number;
|
|
25
|
-
/**
|
|
26
|
-
* Minimum number of character-rows to display when empty.
|
|
27
|
-
*/
|
|
28
|
-
minRows?: number;
|
|
29
|
-
/**
|
|
30
|
-
* Textarea label
|
|
31
|
-
*/
|
|
32
|
-
label: React.ReactNode;
|
|
33
|
-
/**
|
|
34
|
-
* If enabled shows the label and description for screenreaders only
|
|
35
|
-
*/
|
|
36
|
-
hideLabel?: boolean;
|
|
37
|
-
/**
|
|
38
|
-
* Enables resizing of field
|
|
39
|
-
*/
|
|
40
|
-
resize?: boolean;
|
|
41
|
-
}
|
|
42
|
-
export declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
43
|
-
export declare const Counter: ({ maxLength, currentLength, size }: {
|
|
44
|
-
maxLength: any;
|
|
45
|
-
currentLength: any;
|
|
46
|
-
size: any;
|
|
47
|
-
}) => JSX.Element;
|
|
48
|
-
export default Textarea;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import React, { InputHTMLAttributes } from "react";
|
|
2
|
-
import { FormFieldProps } from "../useFormField";
|
|
3
|
-
export interface CheckboxProps extends FormFieldProps, Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "value"> {
|
|
4
|
-
/**
|
|
5
|
-
* Adds error indication on checkbox
|
|
6
|
-
* @default false
|
|
7
|
-
*/
|
|
8
|
-
error?: boolean;
|
|
9
|
-
/**
|
|
10
|
-
* Id for error resulting in checkbox having error
|
|
11
|
-
*/
|
|
12
|
-
errorId?: string;
|
|
13
|
-
/**
|
|
14
|
-
* Checkbox label
|
|
15
|
-
*/
|
|
16
|
-
children: React.ReactNode;
|
|
17
|
-
/**
|
|
18
|
-
* Hides label and makes it viewable for screen-readers only.
|
|
19
|
-
*/
|
|
20
|
-
hideLabel?: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* The value of the HTML element.
|
|
23
|
-
*/
|
|
24
|
-
value?: any;
|
|
25
|
-
/**
|
|
26
|
-
* Specify whether the Checkbox is in an indeterminate state
|
|
27
|
-
* @default false
|
|
28
|
-
*/
|
|
29
|
-
indeterminate?: boolean;
|
|
30
|
-
/**
|
|
31
|
-
* Adds a description to extend labling of Checkbox
|
|
32
|
-
*/
|
|
33
|
-
description?: string;
|
|
34
|
-
}
|
|
35
|
-
export declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLInputElement>>;
|
|
36
|
-
export default Checkbox;
|