@navikt/ds-react 2.1.0 → 2.1.1-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.
Files changed (150) hide show
  1. package/_docs.json +293 -457
  2. package/esm/guide-panel/Illustration.js.map +1 -1
  3. package/esm/loader/Loader.js.map +1 -1
  4. package/package.json +1 -1
  5. package/src/guide-panel/Illustration.tsx +6 -2
  6. package/src/loader/Loader.tsx +6 -1
  7. package/esm/accordion/Accordion.d.ts +0 -17
  8. package/esm/accordion/AccordionContent.d.ts +0 -10
  9. package/esm/accordion/AccordionHeader.d.ts +0 -10
  10. package/esm/accordion/AccordionItem.d.ts +0 -26
  11. package/esm/accordion/index.d.ts +0 -1
  12. package/esm/alert/Alert.d.ts +0 -31
  13. package/esm/alert/index.d.ts +0 -2
  14. package/esm/button/Button.d.ts +0 -39
  15. package/esm/button/index.d.ts +0 -2
  16. package/esm/chat/Bubble.d.ts +0 -26
  17. package/esm/chat/Chat.d.ts +0 -43
  18. package/esm/chat/index.d.ts +0 -1
  19. package/esm/chips/Chips.d.ts +0 -17
  20. package/esm/chips/Removable.d.ts +0 -23
  21. package/esm/chips/Toggle.d.ts +0 -13
  22. package/esm/chips/index.d.ts +0 -1
  23. package/esm/date/DateInput.d.ts +0 -25
  24. package/esm/date/datepicker/DatePicker.d.ts +0 -97
  25. package/esm/date/datepicker/DatePickerStandalone.d.ts +0 -12
  26. package/esm/date/datepicker/DayButton.d.ts +0 -3
  27. package/esm/date/datepicker/Head.d.ts +0 -3
  28. package/esm/date/datepicker/caption/Caption.d.ts +0 -4
  29. package/esm/date/datepicker/caption/DropdownCaption.d.ts +0 -4
  30. package/esm/date/datepicker/caption/index.d.ts +0 -2
  31. package/esm/date/hooks/index.d.ts +0 -8
  32. package/esm/date/hooks/useDateInputContext.d.ts +0 -18
  33. package/esm/date/hooks/useDatepicker.d.ts +0 -73
  34. package/esm/date/hooks/useMonthPicker.d.ts +0 -68
  35. package/esm/date/hooks/useRangeDatepicker.d.ts +0 -58
  36. package/esm/date/hooks/useSharedMonthContext.d.ts +0 -21
  37. package/esm/date/index.d.ts +0 -6
  38. package/esm/date/monthpicker/MonthButton.d.ts +0 -11
  39. package/esm/date/monthpicker/MonthCaption.d.ts +0 -3
  40. package/esm/date/monthpicker/MonthPicker.d.ts +0 -92
  41. package/esm/date/monthpicker/MonthPickerStandalone.d.ts +0 -11
  42. package/esm/date/monthpicker/MonthSelector.d.ts +0 -3
  43. package/esm/date/utils/check-dates.d.ts +0 -4
  44. package/esm/date/utils/dates-disabled.d.ts +0 -1
  45. package/esm/date/utils/format-date.d.ts +0 -1
  46. package/esm/date/utils/get-dates.d.ts +0 -2
  47. package/esm/date/utils/get-initial-year.d.ts +0 -5
  48. package/esm/date/utils/index.d.ts +0 -10
  49. package/esm/date/utils/is-match.d.ts +0 -4
  50. package/esm/date/utils/labels.d.ts +0 -6
  51. package/esm/date/utils/locale.d.ts +0 -2
  52. package/esm/date/utils/navigation.d.ts +0 -2
  53. package/esm/date/utils/parse-date.d.ts +0 -3
  54. package/esm/form/ConfirmationPanel.d.ts +0 -22
  55. package/esm/form/Fieldset/Fieldset.d.ts +0 -42
  56. package/esm/form/Fieldset/index.d.ts +0 -1
  57. package/esm/form/Fieldset/useFieldset.d.ts +0 -14
  58. package/esm/form/Select.d.ts +0 -26
  59. package/esm/form/Switch.d.ts +0 -27
  60. package/esm/form/TextField.d.ts +0 -31
  61. package/esm/form/Textarea.d.ts +0 -48
  62. package/esm/form/checkbox/Checkbox.d.ts +0 -36
  63. package/esm/form/checkbox/CheckboxGroup.d.ts +0 -28
  64. package/esm/form/checkbox/index.d.ts +0 -2
  65. package/esm/form/checkbox/useCheckbox.d.ts +0 -21
  66. package/esm/form/error-summary/ErrorSummary.d.ts +0 -27
  67. package/esm/form/error-summary/ErrorSummaryItem.d.ts +0 -11
  68. package/esm/form/error-summary/index.d.ts +0 -2
  69. package/esm/form/index.d.ts +0 -10
  70. package/esm/form/radio/Radio.d.ts +0 -18
  71. package/esm/form/radio/RadioGroup.d.ts +0 -38
  72. package/esm/form/radio/index.d.ts +0 -2
  73. package/esm/form/radio/useRadio.d.ts +0 -23
  74. package/esm/form/search/Search.d.ts +0 -57
  75. package/esm/form/search/SearchButton.d.ts +0 -11
  76. package/esm/form/search/index.d.ts +0 -1
  77. package/esm/form/useFormField.d.ts +0 -44
  78. package/esm/grid/Cell.d.ts +0 -26
  79. package/esm/grid/ContentContainer.d.ts +0 -9
  80. package/esm/grid/Grid.d.ts +0 -9
  81. package/esm/grid/index.d.ts +0 -3
  82. package/esm/guide-panel/Guide.d.ts +0 -14
  83. package/esm/guide-panel/GuidePanel.d.ts +0 -18
  84. package/esm/guide-panel/Illustration.d.ts +0 -7
  85. package/esm/guide-panel/index.d.ts +0 -3
  86. package/esm/help-text/HelpText.d.ts +0 -17
  87. package/esm/help-text/index.d.ts +0 -2
  88. package/esm/index.d.ts +0 -27
  89. package/esm/link/Link.d.ts +0 -10
  90. package/esm/link/index.d.ts +0 -2
  91. package/esm/link-panel/LinkPanel.d.ts +0 -22
  92. package/esm/link-panel/LinkPanelDescription.d.ts +0 -7
  93. package/esm/link-panel/LinkPanelTitle.d.ts +0 -8
  94. package/esm/link-panel/index.d.ts +0 -2
  95. package/esm/loader/Loader.d.ts +0 -26
  96. package/esm/loader/index.d.ts +0 -2
  97. package/esm/modal/Modal.d.ts +0 -63
  98. package/esm/modal/ModalContent.d.ts +0 -10
  99. package/esm/modal/index.d.ts +0 -2
  100. package/esm/pagination/Pagination.d.ts +0 -53
  101. package/esm/pagination/PaginationItem.d.ts +0 -22
  102. package/esm/pagination/index.d.ts +0 -1
  103. package/esm/panel/Panel.d.ts +0 -16
  104. package/esm/panel/index.d.ts +0 -2
  105. package/esm/popover/Popover.d.ts +0 -47
  106. package/esm/popover/PopoverContent.d.ts +0 -10
  107. package/esm/popover/index.d.ts +0 -2
  108. package/esm/provider/Provider.d.ts +0 -20
  109. package/esm/provider/index.d.ts +0 -1
  110. package/esm/read-more/ReadMore.d.ts +0 -28
  111. package/esm/read-more/index.d.ts +0 -2
  112. package/esm/stepper/Step.d.ts +0 -28
  113. package/esm/stepper/Stepper.d.ts +0 -41
  114. package/esm/stepper/index.d.ts +0 -1
  115. package/esm/table/Body.d.ts +0 -7
  116. package/esm/table/ColumnHeader.d.ts +0 -17
  117. package/esm/table/DataCell.d.ts +0 -12
  118. package/esm/table/ExpandableRow.d.ts +0 -41
  119. package/esm/table/Header.d.ts +0 -7
  120. package/esm/table/HeaderCell.d.ts +0 -13
  121. package/esm/table/Row.d.ts +0 -17
  122. package/esm/table/Table.d.ts +0 -49
  123. package/esm/table/index.d.ts +0 -8
  124. package/esm/tabs/Tab.d.ts +0 -19
  125. package/esm/tabs/TabList.d.ts +0 -10
  126. package/esm/tabs/TabPanel.d.ts +0 -14
  127. package/esm/tabs/Tabs.d.ts +0 -52
  128. package/esm/tabs/index.d.ts +0 -4
  129. package/esm/tag/Tag.d.ts +0 -14
  130. package/esm/tag/index.d.ts +0 -1
  131. package/esm/toggle-group/ToggleGroup.d.ts +0 -38
  132. package/esm/toggle-group/ToggleItem.d.ts +0 -14
  133. package/esm/toggle-group/index.d.ts +0 -2
  134. package/esm/tooltip/Tooltip.d.ts +0 -53
  135. package/esm/tooltip/index.d.ts +0 -1
  136. package/esm/typography/BodyLong.d.ts +0 -19
  137. package/esm/typography/BodyShort.d.ts +0 -19
  138. package/esm/typography/Detail.d.ts +0 -22
  139. package/esm/typography/ErrorMessage.d.ts +0 -19
  140. package/esm/typography/Heading.d.ts +0 -24
  141. package/esm/typography/Ingress.d.ts +0 -14
  142. package/esm/typography/Label.d.ts +0 -19
  143. package/esm/typography/index.d.ts +0 -7
  144. package/esm/util/AnimateHeight.d.ts +0 -10
  145. package/esm/util/OverridableComponent.d.ts +0 -7
  146. package/esm/util/TextareaAutoSize.d.ts +0 -14
  147. package/esm/util/debounce.d.ts +0 -4
  148. package/esm/util/index.d.ts +0 -13
  149. package/esm/util/mergeRefs.d.ts +0 -2
  150. package/esm/util/useId.d.ts +0 -7
@@ -1,53 +0,0 @@
1
- import React, { HTMLAttributes } from "react";
2
- export interface TooltipProps extends HTMLAttributes<HTMLDivElement> {
3
- /**
4
- * Element tooltip anchors to
5
- * @note Needs to be React.ReactElement, does not support multiple children/react fragment
6
- */
7
- children: React.ReactElement & React.RefAttributes<HTMLElement>;
8
- /**
9
- * Open state for contolled tooltip
10
- */
11
- open?: boolean;
12
- /**
13
- * Tells tooltip to start in open state.
14
- * Use sparingly synce hover/focus on other elements will close it
15
- * @note "open"-prop overwrites this
16
- */
17
- defaultOpen?: boolean;
18
- /**
19
- * Orientation for tooltip
20
- * @default "top"
21
- */
22
- placement?: "top" | "right" | "bottom" | "left";
23
- /**
24
- * Toggles rendering of arrow
25
- * @default true
26
- */
27
- arrow?: boolean;
28
- /**
29
- * Distance from anchor to tooltip
30
- * @default 10px with arrow, 2px without arrow
31
- */
32
- offset?: number;
33
- /**
34
- * Text-content inside tooltip
35
- */
36
- content: string;
37
- /**
38
- * Sets max allowed character length.
39
- * @default 80
40
- */
41
- maxChar?: number;
42
- /**
43
- * Adds a delay in milliseconds before opening tooltip
44
- * @default 150
45
- */
46
- delay?: number;
47
- /**
48
- * List of Keyboard-keys for shortcuts
49
- */
50
- keys?: string[];
51
- }
52
- export declare const Tooltip: React.ForwardRefExoticComponent<TooltipProps & React.RefAttributes<HTMLDivElement>>;
53
- export default Tooltip;
@@ -1 +0,0 @@
1
- export { default as Tooltip, TooltipProps } from "./Tooltip";
@@ -1,19 +0,0 @@
1
- import React from "react";
2
- import { OverridableComponent } from "..";
3
- export interface BodyLongProps extends React.HTMLAttributes<HTMLParagraphElement> {
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 BodyLong: OverridableComponent<BodyLongProps, HTMLParagraphElement>;
19
- export default BodyLong;
@@ -1,19 +0,0 @@
1
- import React from "react";
2
- import { OverridableComponent } from "..";
3
- export interface BodyShortProps extends React.HTMLAttributes<HTMLParagraphElement> {
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 BodyShort: OverridableComponent<BodyShortProps, HTMLParagraphElement>;
19
- export default BodyShort;
@@ -1,22 +0,0 @@
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;
@@ -1,19 +0,0 @@
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;
@@ -1,24 +0,0 @@
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;
@@ -1,14 +0,0 @@
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;
@@ -1,19 +0,0 @@
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;
@@ -1,7 +0,0 @@
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";
@@ -1,10 +0,0 @@
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;
@@ -1,7 +0,0 @@
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
- }
@@ -1,14 +0,0 @@
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;
@@ -1,4 +0,0 @@
1
- export default function debounce(func: any, wait?: number): {
2
- (this: any, ...args: any[]): void;
3
- clear(): void;
4
- };
@@ -1,13 +0,0 @@
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;
@@ -1,2 +0,0 @@
1
- import React from "react";
2
- export default function mergeRefs<T = any>(refs: Array<React.MutableRefObject<T> | React.LegacyRef<T>>): React.RefCallback<T>;
@@ -1,7 +0,0 @@
1
- /**
2
- *
3
- * @example <div id={useId()} />
4
- * @param idOverride
5
- * @returns {string}
6
- */
7
- export declare function useId(idOverride?: string): string | undefined;