@navikt/ds-react 2.1.1-next.1 → 2.1.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/_docs.json +480 -312
- package/esm/accordion/Accordion.d.ts +17 -0
- package/esm/accordion/AccordionContent.d.ts +10 -0
- package/esm/accordion/AccordionHeader.d.ts +10 -0
- package/esm/accordion/AccordionItem.d.ts +26 -0
- package/esm/accordion/index.d.ts +1 -0
- package/esm/alert/Alert.d.ts +31 -0
- package/esm/alert/index.d.ts +2 -0
- package/esm/button/Button.d.ts +39 -0
- package/esm/button/index.d.ts +2 -0
- package/esm/chat/Bubble.d.ts +26 -0
- package/esm/chat/Chat.d.ts +43 -0
- package/esm/chat/index.d.ts +1 -0
- package/esm/chips/Chips.d.ts +17 -0
- package/esm/chips/Removable.d.ts +23 -0
- package/esm/chips/Toggle.d.ts +13 -0
- package/esm/chips/index.d.ts +1 -0
- package/esm/date/DateInput.d.ts +25 -0
- package/esm/date/datepicker/DatePicker.d.ts +97 -0
- package/esm/date/datepicker/DatePickerStandalone.d.ts +12 -0
- package/esm/date/datepicker/DayButton.d.ts +3 -0
- package/esm/date/datepicker/Head.d.ts +3 -0
- package/esm/date/datepicker/caption/Caption.d.ts +4 -0
- package/esm/date/datepicker/caption/DropdownCaption.d.ts +4 -0
- package/esm/date/datepicker/caption/index.d.ts +2 -0
- package/esm/date/hooks/index.d.ts +8 -0
- package/esm/date/hooks/useDateInputContext.d.ts +18 -0
- package/esm/date/hooks/useDatepicker.d.ts +73 -0
- package/esm/date/hooks/useMonthPicker.d.ts +68 -0
- package/esm/date/hooks/useRangeDatepicker.d.ts +58 -0
- package/esm/date/hooks/useSharedMonthContext.d.ts +21 -0
- package/esm/date/index.d.ts +6 -0
- package/esm/date/monthpicker/MonthButton.d.ts +11 -0
- package/esm/date/monthpicker/MonthCaption.d.ts +3 -0
- package/esm/date/monthpicker/MonthPicker.d.ts +92 -0
- package/esm/date/monthpicker/MonthPickerStandalone.d.ts +11 -0
- package/esm/date/monthpicker/MonthSelector.d.ts +3 -0
- package/esm/date/utils/check-dates.d.ts +4 -0
- package/esm/date/utils/dates-disabled.d.ts +1 -0
- package/esm/date/utils/format-date.d.ts +1 -0
- package/esm/date/utils/get-dates.d.ts +2 -0
- package/esm/date/utils/get-initial-year.d.ts +5 -0
- package/esm/date/utils/index.d.ts +10 -0
- package/esm/date/utils/is-match.d.ts +4 -0
- package/esm/date/utils/labels.d.ts +6 -0
- package/esm/date/utils/locale.d.ts +2 -0
- package/esm/date/utils/navigation.d.ts +2 -0
- package/esm/date/utils/parse-date.d.ts +3 -0
- package/esm/form/ConfirmationPanel.d.ts +22 -0
- package/esm/form/Fieldset/Fieldset.d.ts +42 -0
- package/esm/form/Fieldset/index.d.ts +1 -0
- package/esm/form/Fieldset/useFieldset.d.ts +14 -0
- package/esm/form/Select.d.ts +26 -0
- package/esm/form/Switch.d.ts +27 -0
- package/esm/form/TextField.d.ts +31 -0
- package/esm/form/Textarea.d.ts +48 -0
- package/esm/form/checkbox/Checkbox.d.ts +36 -0
- package/esm/form/checkbox/CheckboxGroup.d.ts +28 -0
- package/esm/form/checkbox/index.d.ts +2 -0
- package/esm/form/checkbox/useCheckbox.d.ts +21 -0
- package/esm/form/error-summary/ErrorSummary.d.ts +27 -0
- package/esm/form/error-summary/ErrorSummaryItem.d.ts +11 -0
- package/esm/form/error-summary/index.d.ts +2 -0
- package/esm/form/index.d.ts +10 -0
- package/esm/form/radio/Radio.d.ts +18 -0
- package/esm/form/radio/RadioGroup.d.ts +38 -0
- package/esm/form/radio/index.d.ts +2 -0
- package/esm/form/radio/useRadio.d.ts +23 -0
- package/esm/form/search/Search.d.ts +57 -0
- package/esm/form/search/SearchButton.d.ts +11 -0
- package/esm/form/search/index.d.ts +1 -0
- package/esm/form/useFormField.d.ts +44 -0
- package/esm/grid/Cell.d.ts +26 -0
- package/esm/grid/ContentContainer.d.ts +9 -0
- package/esm/grid/Grid.d.ts +9 -0
- package/esm/grid/index.d.ts +3 -0
- package/esm/guide-panel/Guide.d.ts +14 -0
- package/esm/guide-panel/GuidePanel.d.ts +18 -0
- package/esm/guide-panel/Illustration.d.ts +8 -0
- package/esm/guide-panel/index.d.ts +3 -0
- package/esm/help-text/HelpText.d.ts +17 -0
- package/esm/help-text/index.d.ts +2 -0
- package/esm/index.d.ts +27 -0
- package/esm/link/Link.d.ts +10 -0
- package/esm/link/index.d.ts +2 -0
- package/esm/link-panel/LinkPanel.d.ts +22 -0
- package/esm/link-panel/LinkPanelDescription.d.ts +7 -0
- package/esm/link-panel/LinkPanelTitle.d.ts +8 -0
- package/esm/link-panel/index.d.ts +2 -0
- package/esm/loader/Loader.d.ts +27 -0
- package/esm/loader/index.d.ts +2 -0
- package/esm/modal/Modal.d.ts +63 -0
- package/esm/modal/ModalContent.d.ts +10 -0
- package/esm/modal/index.d.ts +2 -0
- package/esm/pagination/Pagination.d.ts +53 -0
- package/esm/pagination/PaginationItem.d.ts +22 -0
- package/esm/pagination/index.d.ts +1 -0
- package/esm/panel/Panel.d.ts +16 -0
- package/esm/panel/index.d.ts +2 -0
- package/esm/popover/Popover.d.ts +47 -0
- package/esm/popover/PopoverContent.d.ts +10 -0
- package/esm/popover/index.d.ts +2 -0
- package/esm/provider/Provider.d.ts +20 -0
- package/esm/provider/index.d.ts +1 -0
- package/esm/read-more/ReadMore.d.ts +28 -0
- package/esm/read-more/index.d.ts +2 -0
- package/esm/stepper/Step.d.ts +28 -0
- package/esm/stepper/Stepper.d.ts +41 -0
- package/esm/stepper/index.d.ts +1 -0
- package/esm/table/Body.d.ts +7 -0
- package/esm/table/ColumnHeader.d.ts +17 -0
- package/esm/table/DataCell.d.ts +12 -0
- package/esm/table/ExpandableRow.d.ts +41 -0
- package/esm/table/Header.d.ts +7 -0
- package/esm/table/HeaderCell.d.ts +13 -0
- package/esm/table/Row.d.ts +17 -0
- package/esm/table/Table.d.ts +49 -0
- package/esm/table/index.d.ts +8 -0
- package/esm/tabs/Tab.d.ts +19 -0
- package/esm/tabs/TabList.d.ts +10 -0
- package/esm/tabs/TabPanel.d.ts +14 -0
- package/esm/tabs/Tabs.d.ts +52 -0
- package/esm/tabs/index.d.ts +4 -0
- package/esm/tag/Tag.d.ts +14 -0
- package/esm/tag/index.d.ts +1 -0
- package/esm/toggle-group/ToggleGroup.d.ts +38 -0
- package/esm/toggle-group/ToggleItem.d.ts +14 -0
- package/esm/toggle-group/index.d.ts +2 -0
- package/esm/tooltip/Tooltip.d.ts +53 -0
- package/esm/tooltip/index.d.ts +1 -0
- package/esm/typography/BodyLong.d.ts +19 -0
- package/esm/typography/BodyShort.d.ts +19 -0
- package/esm/typography/Detail.d.ts +22 -0
- package/esm/typography/ErrorMessage.d.ts +19 -0
- package/esm/typography/Heading.d.ts +24 -0
- package/esm/typography/Ingress.d.ts +14 -0
- package/esm/typography/Label.d.ts +19 -0
- package/esm/typography/index.d.ts +7 -0
- package/esm/util/AnimateHeight.d.ts +10 -0
- package/esm/util/OverridableComponent.d.ts +7 -0
- package/esm/util/TextareaAutoSize.d.ts +14 -0
- package/esm/util/debounce.d.ts +4 -0
- package/esm/util/index.d.ts +13 -0
- package/esm/util/mergeRefs.d.ts +2 -0
- package/esm/util/useId.d.ts +7 -0
- package/package.json +2 -2
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { OverridableComponent } from "..";
|
|
3
|
+
export interface DetailProps extends React.HTMLAttributes<HTMLParagraphElement> {
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Medium === small
|
|
6
|
+
*/
|
|
7
|
+
size?: "medium" | "small";
|
|
8
|
+
/**
|
|
9
|
+
* Paragraph text
|
|
10
|
+
*/
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Adds margin-bottom
|
|
14
|
+
*/
|
|
15
|
+
spacing?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* All caps
|
|
18
|
+
*/
|
|
19
|
+
uppercase?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare const Detail: OverridableComponent<DetailProps, HTMLParagraphElement>;
|
|
22
|
+
export default Detail;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { OverridableComponent } from "..";
|
|
3
|
+
export interface ErrorMessageProps extends React.HTMLAttributes<HTMLParagraphElement> {
|
|
4
|
+
/**
|
|
5
|
+
* medium: 18px, small: 16px
|
|
6
|
+
* @default "medium"
|
|
7
|
+
*/
|
|
8
|
+
size?: "medium" | "small";
|
|
9
|
+
/**
|
|
10
|
+
* Error text
|
|
11
|
+
*/
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Adds margin-bottom
|
|
15
|
+
*/
|
|
16
|
+
spacing?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare const ErrorMessage: OverridableComponent<ErrorMessageProps, HTMLParagraphElement>;
|
|
19
|
+
export default ErrorMessage;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { OverridableComponent } from "..";
|
|
3
|
+
export interface HeadingProps extends React.HTMLAttributes<HTMLHeadingElement> {
|
|
4
|
+
/**
|
|
5
|
+
* Heading level
|
|
6
|
+
* @default "1"
|
|
7
|
+
*/
|
|
8
|
+
level?: "1" | "2" | "3" | "4" | "5" | "6";
|
|
9
|
+
/**
|
|
10
|
+
* Changes text-sizing
|
|
11
|
+
*/
|
|
12
|
+
size: "xlarge" | "large" | "medium" | "small" | "xsmall";
|
|
13
|
+
/**
|
|
14
|
+
* Heading text
|
|
15
|
+
*/
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* Adds margin-bottom
|
|
19
|
+
* @default false
|
|
20
|
+
*/
|
|
21
|
+
spacing?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare const Heading: OverridableComponent<HeadingProps, HTMLHeadingElement>;
|
|
24
|
+
export default Heading;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { OverridableComponent } from "..";
|
|
3
|
+
export interface IngressProps extends React.HTMLAttributes<HTMLParagraphElement> {
|
|
4
|
+
/**
|
|
5
|
+
* Ingress text
|
|
6
|
+
*/
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Adds margin-bottom
|
|
10
|
+
*/
|
|
11
|
+
spacing?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare const Ingress: OverridableComponent<IngressProps, HTMLParagraphElement>;
|
|
14
|
+
export default Ingress;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { OverridableComponent } from "..";
|
|
3
|
+
export interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {
|
|
4
|
+
/**
|
|
5
|
+
* medium: 18px, small: 16px
|
|
6
|
+
* @default "medium"
|
|
7
|
+
*/
|
|
8
|
+
size?: "medium" | "small";
|
|
9
|
+
/**
|
|
10
|
+
* Paragraph text
|
|
11
|
+
*/
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Adds margin-bottom
|
|
15
|
+
*/
|
|
16
|
+
spacing?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare const Label: OverridableComponent<LabelProps, HTMLLabelElement>;
|
|
19
|
+
export default Label;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { BodyLongProps, default as BodyLong } from "./BodyLong";
|
|
2
|
+
export { BodyShortProps, default as BodyShort } from "./BodyShort";
|
|
3
|
+
export { default as Detail, DetailProps } from "./Detail";
|
|
4
|
+
export { default as ErrorMessage, ErrorMessageProps } from "./ErrorMessage";
|
|
5
|
+
export { default as Heading, HeadingProps } from "./Heading";
|
|
6
|
+
export { default as Ingress, IngressProps } from "./Ingress";
|
|
7
|
+
export { default as Label, LabelProps } from "./Label";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export type Height = "auto" | number | `${number}%`;
|
|
3
|
+
interface AnimateHeightProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
duration?: number;
|
|
5
|
+
easing?: string;
|
|
6
|
+
height: Height;
|
|
7
|
+
innerClassName?: string;
|
|
8
|
+
}
|
|
9
|
+
declare const AnimateHeight: React.FC<AnimateHeightProps>;
|
|
10
|
+
export default AnimateHeight;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface OverridableComponent<Component, Element extends HTMLElement> {
|
|
3
|
+
(props: Component & React.RefAttributes<Element>): ReturnType<React.FC>;
|
|
4
|
+
<As extends React.ElementType>(props: {
|
|
5
|
+
as: As;
|
|
6
|
+
} & Component & Omit<React.ComponentPropsWithRef<As>, keyof Component>): ReturnType<React.FC>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface TextareaAutosizeProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "children" | "rows"> {
|
|
3
|
+
/**
|
|
4
|
+
* Maximum number of rows to display.
|
|
5
|
+
*/
|
|
6
|
+
maxRows?: number;
|
|
7
|
+
/**
|
|
8
|
+
* Minimum number of rows to display.
|
|
9
|
+
* @default 1
|
|
10
|
+
*/
|
|
11
|
+
minRows?: number;
|
|
12
|
+
}
|
|
13
|
+
declare const TextareaAutosize: React.ForwardRefExoticComponent<TextareaAutosizeProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
14
|
+
export default TextareaAutosize;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useLayoutEffect } from "react";
|
|
2
|
+
export * from "./OverridableComponent";
|
|
3
|
+
export * from "./useId";
|
|
4
|
+
export { default as mergeRefs } from "./mergeRefs";
|
|
5
|
+
export { default as debounce } from "./debounce";
|
|
6
|
+
export declare const useClientLayoutEffect: typeof useLayoutEffect;
|
|
7
|
+
export declare const omit: (obj: object, props: string[]) => {};
|
|
8
|
+
export interface ListenerT {
|
|
9
|
+
addEventListener(name: string, handler: (event?: any) => void, ...args: any[]): any;
|
|
10
|
+
removeEventListener(name: string, handler: (event?: any) => void, ...args: any[]): any;
|
|
11
|
+
}
|
|
12
|
+
export declare const useEventListener: <T extends ListenerT>(name: Parameters<ListenerT["addEventListener"]>[0], handler: Parameters<ListenerT["addEventListener"]>[1], target?: Window | T | null) => void;
|
|
13
|
+
export declare const composeEventHandlers: <E>(originalEventHandler?: ((event: E) => void) | undefined, ourEventHandler?: ((event: E) => void) | undefined) => (event: E) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@navikt/ds-react",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"description": "Aksel react-components for NAV designsystem",
|
|
5
5
|
"author": "Aksel | NAV designsystem team",
|
|
6
6
|
"license": "MIT",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@floating-ui/react": "0.17.0",
|
|
40
|
-
"@navikt/ds-icons": "^2.1.
|
|
40
|
+
"@navikt/ds-icons": "^2.1.2",
|
|
41
41
|
"@radix-ui/react-tabs": "1.0.0",
|
|
42
42
|
"@radix-ui/react-toggle-group": "1.0.0",
|
|
43
43
|
"clsx": "^1.2.1",
|