@navikt/ds-react 0.18.2 → 0.18.5

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 (118) hide show
  1. package/_docs.json +186 -209
  2. package/cjs/form/ConfirmationPanel.js +10 -5
  3. package/esm/accordion/Accordion.d.ts +1 -1
  4. package/esm/accordion/AccordionContent.d.ts +3 -1
  5. package/esm/accordion/AccordionContent.js.map +1 -1
  6. package/esm/accordion/AccordionHeader.d.ts +1 -1
  7. package/esm/accordion/AccordionItem.d.ts +6 -5
  8. package/esm/accordion/AccordionItem.js.map +1 -1
  9. package/esm/alert/Alert.d.ts +3 -2
  10. package/esm/alert/Alert.js.map +1 -1
  11. package/esm/button/Button.d.ts +1 -2
  12. package/esm/button/Button.js.map +1 -1
  13. package/esm/form/ConfirmationPanel.d.ts +9 -1
  14. package/esm/form/ConfirmationPanel.js +10 -5
  15. package/esm/form/ConfirmationPanel.js.map +1 -1
  16. package/esm/form/Fieldset/Fieldset.d.ts +4 -1
  17. package/esm/form/Fieldset/Fieldset.js.map +1 -1
  18. package/esm/form/Select.d.ts +2 -2
  19. package/esm/form/Switch.d.ts +1 -0
  20. package/esm/form/Switch.js.map +1 -1
  21. package/esm/form/TextField.d.ts +4 -4
  22. package/esm/form/Textarea.d.ts +10 -3
  23. package/esm/form/Textarea.js.map +1 -1
  24. package/esm/form/checkbox/Checkbox.d.ts +2 -2
  25. package/esm/form/checkbox/CheckboxGroup.d.ts +2 -2
  26. package/esm/form/error-summary/ErrorSummary.d.ts +2 -2
  27. package/esm/form/radio/Radio.d.ts +1 -1
  28. package/esm/form/radio/RadioGroup.d.ts +4 -4
  29. package/esm/form/search/Search.d.ts +2 -2
  30. package/esm/form/useFormField.d.ts +1 -0
  31. package/esm/form/useFormField.js.map +1 -1
  32. package/esm/help-text/HelpText.d.ts +12 -1
  33. package/esm/help-text/HelpText.js.map +1 -1
  34. package/esm/link-panel/LinkPanel.d.ts +2 -1
  35. package/esm/link-panel/LinkPanel.js.map +1 -1
  36. package/esm/loader/Loader.d.ts +6 -2
  37. package/esm/loader/Loader.js.map +1 -1
  38. package/esm/modal/Modal.d.ts +4 -4
  39. package/esm/pagination/Pagination.d.ts +1 -0
  40. package/esm/pagination/Pagination.js.map +1 -1
  41. package/esm/panel/Panel.d.ts +1 -1
  42. package/esm/popover/Popover.d.ts +7 -6
  43. package/esm/popover/Popover.js.map +1 -1
  44. package/esm/speech-bubble/SpeechBubble.d.ts +3 -3
  45. package/esm/step-indicator/Step.d.ts +2 -0
  46. package/esm/step-indicator/Step.js.map +1 -1
  47. package/esm/stepper/Step.d.ts +2 -1
  48. package/esm/stepper/Step.js.map +1 -1
  49. package/esm/table/ColumnHeader.d.ts +1 -1
  50. package/esm/table/DataCell.d.ts +1 -1
  51. package/esm/table/ExpandableRow.d.ts +1 -1
  52. package/esm/table/HeaderCell.d.ts +1 -1
  53. package/esm/table/index.d.ts +1 -1
  54. package/esm/table/index.js.map +1 -1
  55. package/esm/tabs/Tab.d.ts +2 -2
  56. package/esm/tabs/TabList.d.ts +1 -1
  57. package/esm/tabs/TabPanel.d.ts +1 -1
  58. package/esm/tabs/Tabs.d.ts +1 -4
  59. package/esm/tabs/Tabs.js.map +1 -1
  60. package/esm/tag/Tag.d.ts +3 -4
  61. package/esm/tag/Tag.js.map +1 -1
  62. package/esm/toggle-group/ToggleGroup.d.ts +1 -1
  63. package/esm/tooltip/Tooltip.d.ts +8 -6
  64. package/esm/tooltip/Tooltip.js.map +1 -1
  65. package/esm/typography/BodyLong.d.ts +1 -1
  66. package/esm/typography/BodyShort.d.ts +1 -1
  67. package/esm/typography/Detail.d.ts +1 -1
  68. package/esm/typography/Heading.d.ts +2 -2
  69. package/esm/typography/Ingress.d.ts +1 -1
  70. package/esm/typography/Label.d.ts +1 -1
  71. package/package.json +2 -2
  72. package/src/accordion/Accordion.tsx +1 -1
  73. package/src/accordion/AccordionContent.tsx +3 -1
  74. package/src/accordion/AccordionHeader.tsx +1 -1
  75. package/src/accordion/AccordionItem.tsx +6 -5
  76. package/src/alert/Alert.tsx +3 -2
  77. package/src/button/Button.tsx +1 -2
  78. package/src/form/ConfirmationPanel.tsx +38 -13
  79. package/src/form/Fieldset/Fieldset.tsx +4 -1
  80. package/src/form/Select.tsx +2 -2
  81. package/src/form/Switch.tsx +1 -0
  82. package/src/form/TextField.tsx +4 -4
  83. package/src/form/Textarea.tsx +10 -3
  84. package/src/form/checkbox/Checkbox.tsx +2 -2
  85. package/src/form/checkbox/CheckboxGroup.tsx +2 -2
  86. package/src/form/error-summary/ErrorSummary.tsx +2 -2
  87. package/src/form/radio/Radio.tsx +1 -1
  88. package/src/form/radio/RadioGroup.tsx +4 -4
  89. package/src/form/search/Search.tsx +2 -2
  90. package/src/form/useFormField.ts +1 -0
  91. package/src/help-text/HelpText.tsx +12 -1
  92. package/src/link-panel/LinkPanel.tsx +2 -1
  93. package/src/loader/Loader.tsx +5 -4
  94. package/src/modal/Modal.tsx +4 -4
  95. package/src/pagination/Pagination.tsx +1 -0
  96. package/src/panel/Panel.tsx +1 -1
  97. package/src/popover/Popover.tsx +7 -6
  98. package/src/speech-bubble/SpeechBubble.tsx +3 -3
  99. package/src/step-indicator/Step.tsx +2 -0
  100. package/src/stepper/Step.tsx +2 -1
  101. package/src/table/ColumnHeader.tsx +1 -1
  102. package/src/table/DataCell.tsx +1 -1
  103. package/src/table/ExpandableRow.tsx +1 -1
  104. package/src/table/HeaderCell.tsx +1 -1
  105. package/src/table/index.ts +1 -1
  106. package/src/tabs/Tab.tsx +2 -2
  107. package/src/tabs/TabList.tsx +1 -1
  108. package/src/tabs/TabPanel.tsx +1 -1
  109. package/src/tabs/Tabs.tsx +1 -4
  110. package/src/tag/Tag.tsx +3 -4
  111. package/src/toggle-group/ToggleGroup.tsx +1 -1
  112. package/src/tooltip/Tooltip.tsx +8 -6
  113. package/src/typography/BodyLong.tsx +1 -1
  114. package/src/typography/BodyShort.tsx +1 -1
  115. package/src/typography/Detail.tsx +1 -1
  116. package/src/typography/Heading.tsx +2 -2
  117. package/src/typography/Ingress.tsx +1 -1
  118. package/src/typography/Label.tsx +1 -1
@@ -25,6 +25,7 @@ import { useId } from "../util";
25
25
  export interface TooltipProps extends HTMLAttributes<HTMLDivElement> {
26
26
  /**
27
27
  * Element tooltip anchors to
28
+ * @note Needs to be React.ReactElement, does not support multiple children/react fragment
28
29
  */
29
30
  children: React.ReactElement & React.RefAttributes<HTMLElement>;
30
31
  /**
@@ -32,7 +33,8 @@ export interface TooltipProps extends HTMLAttributes<HTMLDivElement> {
32
33
  */
33
34
  open?: boolean;
34
35
  /**
35
- * Tells tooltip to start in open state
36
+ * Tells tooltip to start in open state.
37
+ * Use sparingly synce hover/focus on other elements will close it
36
38
  * @note "open"-prop overwrites this
37
39
  */
38
40
  defaultOpen?: boolean;
@@ -42,8 +44,8 @@ export interface TooltipProps extends HTMLAttributes<HTMLDivElement> {
42
44
  */
43
45
  placement?: "top" | "right" | "bottom" | "left";
44
46
  /**
45
- * Toggles rendering of arrow
46
- * @default true
47
+ * Toggles rendering of arrow
48
+ * @default true
47
49
  */
48
50
  arrow?: boolean;
49
51
  /**
@@ -52,17 +54,17 @@ export interface TooltipProps extends HTMLAttributes<HTMLDivElement> {
52
54
  */
53
55
  offset?: number;
54
56
  /**
55
- * Content shown in tooltip
57
+ * Text-content inside tooltip
56
58
  */
57
59
  content: string;
58
60
  /**
59
- * Sets max allowed character length
61
+ * Sets max allowed character length.
60
62
  * @default 80
61
63
  */
62
64
  maxChar?: number;
63
65
  /**
64
66
  * Adds a delay in milliseconds before opening tooltip
65
- * @default 300
67
+ * @default 150
66
68
  */
67
69
  delay?: number;
68
70
  /**
@@ -14,7 +14,7 @@ export interface BodyLongProps
14
14
  */
15
15
  children: React.ReactNode;
16
16
  /**
17
- * Adds margins to typo
17
+ * Adds margin-bottom
18
18
  */
19
19
  spacing?: boolean;
20
20
  }
@@ -14,7 +14,7 @@ export interface BodyShortProps
14
14
  */
15
15
  children: React.ReactNode;
16
16
  /**
17
- * Adds margins to typo
17
+ * Adds margin-bottom
18
18
  */
19
19
  spacing?: boolean;
20
20
  }
@@ -14,7 +14,7 @@ export interface DetailProps
14
14
  */
15
15
  children: React.ReactNode;
16
16
  /**
17
- * Adds margins to typo
17
+ * Adds margin-bottom
18
18
  */
19
19
  spacing?: boolean;
20
20
  }
@@ -9,7 +9,7 @@ export interface HeadingProps extends React.HTMLAttributes<HTMLHeadingElement> {
9
9
  */
10
10
  level?: "1" | "2" | "3" | "4" | "5" | "6";
11
11
  /**
12
- * Sizes from largest "2xl" to smallest "s"
12
+ * Changes text-sizing
13
13
  */
14
14
  size: "xlarge" | "large" | "medium" | "small" | "xsmall";
15
15
  /**
@@ -17,7 +17,7 @@ export interface HeadingProps extends React.HTMLAttributes<HTMLHeadingElement> {
17
17
  */
18
18
  children: React.ReactNode;
19
19
  /**
20
- * Adds margins to typo
20
+ * Adds margin-bottom
21
21
  * @default false
22
22
  */
23
23
  spacing?: boolean;
@@ -9,7 +9,7 @@ export interface IngressProps
9
9
  */
10
10
  children: React.ReactNode;
11
11
  /**
12
- * Adds margins to typo
12
+ * Adds margin-bottom
13
13
  */
14
14
  spacing?: boolean;
15
15
  }
@@ -13,7 +13,7 @@ export interface LabelProps extends React.HTMLAttributes<HTMLParagraphElement> {
13
13
  */
14
14
  children: React.ReactNode;
15
15
  /**
16
- * Adds margins to typo
16
+ * Adds margin-bottom
17
17
  */
18
18
  spacing?: boolean;
19
19
  }