@dnb/eufemia 10.0.0-beta.5 → 10.0.0-beta.7

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 (78) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/cjs/components/accordion/Accordion.d.ts +3 -2
  3. package/cjs/components/accordion/AccordionHeader.d.ts +1 -1
  4. package/cjs/components/autocomplete/Autocomplete.d.ts +2 -2
  5. package/cjs/components/button/Button.d.ts +2 -1
  6. package/cjs/components/dialog/parts/DialogHeader.d.ts +2 -1
  7. package/cjs/components/dropdown/Dropdown.d.ts +1 -1
  8. package/cjs/components/help-button/HelpButton.d.ts +1 -1
  9. package/cjs/components/input/Input.d.ts +1 -1
  10. package/cjs/components/input-masked/InputMasked.d.ts +1 -1
  11. package/cjs/components/modal/ModalContent.d.ts +1 -0
  12. package/cjs/components/modal/ModalContent.js +10 -2
  13. package/cjs/components/modal/parts/CloseButton.d.ts +1 -1
  14. package/cjs/components/modal/types.d.ts +3 -3
  15. package/cjs/components/pagination/Pagination.d.ts +33 -33
  16. package/cjs/components/toggle-button/ToggleButton.d.ts +1 -1
  17. package/cjs/components/tooltip/TooltipPortal.js +20 -6
  18. package/cjs/elements/div/Div.d.ts +2 -0
  19. package/cjs/fragments/drawer-list/DrawerList.js +5 -1
  20. package/cjs/shared/Eufemia.js +1 -1
  21. package/cjs/shared/Theme.d.ts +9 -1
  22. package/cjs/shared/Theme.js +55 -30
  23. package/cjs/shared/VisibilityByTheme.js +10 -1
  24. package/components/accordion/Accordion.d.ts +3 -2
  25. package/components/accordion/AccordionHeader.d.ts +1 -1
  26. package/components/autocomplete/Autocomplete.d.ts +2 -2
  27. package/components/button/Button.d.ts +2 -1
  28. package/components/dialog/parts/DialogHeader.d.ts +2 -1
  29. package/components/dropdown/Dropdown.d.ts +1 -1
  30. package/components/help-button/HelpButton.d.ts +1 -1
  31. package/components/input/Input.d.ts +1 -1
  32. package/components/input-masked/InputMasked.d.ts +1 -1
  33. package/components/modal/ModalContent.d.ts +1 -0
  34. package/components/modal/ModalContent.js +8 -2
  35. package/components/modal/parts/CloseButton.d.ts +1 -1
  36. package/components/modal/types.d.ts +3 -3
  37. package/components/pagination/Pagination.d.ts +33 -33
  38. package/components/toggle-button/ToggleButton.d.ts +1 -1
  39. package/components/tooltip/TooltipPortal.js +18 -6
  40. package/elements/div/Div.d.ts +2 -0
  41. package/es/components/accordion/Accordion.d.ts +3 -2
  42. package/es/components/accordion/AccordionHeader.d.ts +1 -1
  43. package/es/components/autocomplete/Autocomplete.d.ts +2 -2
  44. package/es/components/button/Button.d.ts +2 -1
  45. package/es/components/dialog/parts/DialogHeader.d.ts +2 -1
  46. package/es/components/dropdown/Dropdown.d.ts +1 -1
  47. package/es/components/help-button/HelpButton.d.ts +1 -1
  48. package/es/components/input/Input.d.ts +1 -1
  49. package/es/components/input-masked/InputMasked.d.ts +1 -1
  50. package/es/components/modal/ModalContent.d.ts +1 -0
  51. package/es/components/modal/ModalContent.js +8 -2
  52. package/es/components/modal/parts/CloseButton.d.ts +1 -1
  53. package/es/components/modal/types.d.ts +3 -3
  54. package/es/components/pagination/Pagination.d.ts +33 -33
  55. package/es/components/toggle-button/ToggleButton.d.ts +1 -1
  56. package/es/components/tooltip/TooltipPortal.js +17 -5
  57. package/es/elements/div/Div.d.ts +2 -0
  58. package/es/fragments/drawer-list/DrawerList.js +4 -1
  59. package/es/shared/Eufemia.js +1 -1
  60. package/es/shared/Theme.d.ts +9 -1
  61. package/es/shared/Theme.js +52 -31
  62. package/es/shared/VisibilityByTheme.js +6 -1
  63. package/esm/dnb-ui-basis.min.mjs +1 -1
  64. package/esm/dnb-ui-components.min.mjs +1 -1
  65. package/esm/dnb-ui-elements.min.mjs +1 -1
  66. package/esm/dnb-ui-extensions.min.mjs +1 -1
  67. package/esm/dnb-ui-lib.min.mjs +1 -1
  68. package/fragments/drawer-list/DrawerList.js +4 -1
  69. package/package.json +1 -1
  70. package/shared/Eufemia.js +1 -1
  71. package/shared/Theme.d.ts +9 -1
  72. package/shared/Theme.js +52 -31
  73. package/shared/VisibilityByTheme.js +6 -1
  74. package/umd/dnb-ui-basis.min.js +1 -1
  75. package/umd/dnb-ui-components.min.js +1 -1
  76. package/umd/dnb-ui-elements.min.js +1 -1
  77. package/umd/dnb-ui-extensions.min.js +1 -1
  78. package/umd/dnb-ui-lib.min.js +1 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,33 @@
3
3
  All notable changes to @dnb/eufemia will be documented in this file. See
4
4
  [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [10.0.0-beta.7](https://github.com/dnbexperience/eufemia/compare/v10.0.0-beta.6...v10.0.0-beta.7) (2023-05-10)
7
+
8
+
9
+ ### :sparkles: Features
10
+
11
+ * **Accordion:** export type AccordionIconPosition ([23056cd](https://github.com/dnbexperience/eufemia/commit/23056cdd4f27b8f6ba74a43ad11c346f9ee50369))
12
+ * **Button:** export type ButtonIcon ([ad315bf](https://github.com/dnbexperience/eufemia/commit/ad315bf62ce89dfb02af1a62484c1f5ff593672a))
13
+
14
+
15
+ ### :memo: Documentation
16
+
17
+ * **v10:** adds examples for updating import of boolean props ([b598078](https://github.com/dnbexperience/eufemia/commit/b59807882164ca6136a57237c53d231d8ac11684))
18
+
19
+ ## [10.0.0-beta.6](https://github.com/dnbexperience/eufemia/compare/v10.0.0-beta.5...v10.0.0-beta.6) (2023-05-10)
20
+
21
+
22
+ ### :memo: Documentation
23
+
24
+ * **Portal:** removes Modal's new status ([#2312](https://github.com/dnbexperience/eufemia/issues/2312)) ([38016b6](https://github.com/dnbexperience/eufemia/commit/38016b6b5fb9125e8f8358990849ee986642380f))
25
+ * **v10:** add docs for HelpButton's modal_props ([#2314](https://github.com/dnbexperience/eufemia/issues/2314)) ([66132f4](https://github.com/dnbexperience/eufemia/commit/66132f4a1207e860d7ebccd1c7d586d468ac777e))
26
+ * **v10:** add example for updating import of properties ([#2313](https://github.com/dnbexperience/eufemia/issues/2313)) ([c31c679](https://github.com/dnbexperience/eufemia/commit/c31c679b1c76cd98ed0cc94b6ee79b3ce7f70f6a))
27
+
28
+
29
+ ### :sparkles: Features
30
+
31
+ * release of v10.0.0-beta.6 ([61bd05c](https://github.com/dnbexperience/eufemia/commit/61bd05cb9bc43632197811e46dfd8e795ce23bc3))
32
+
6
33
  ## [10.0.0-beta.5](https://github.com/dnbexperience/eufemia/compare/v10.0.0-beta.4...v10.0.0-beta.5) (2023-05-08)
7
34
 
8
35
 
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import type { ButtonIconPosition } from '../button';
2
+ import type { ButtonIconPosition } from '../Button';
3
3
  import type { HeadingLevel } from '../Heading';
4
4
  import type { IconIcon, IconSize } from '../Icon';
5
5
  import type { SkeletonShow } from '../Skeleton';
@@ -21,6 +21,7 @@ export type AccordionIcon =
21
21
  expanded?: React.ReactNode | ((...args: any[]) => any);
22
22
  };
23
23
  export type AccordionAttributes = string | Record<string, unknown>;
24
+ export type AccordionIconPosition = ButtonIconPosition;
24
25
  export interface AccordionProps
25
26
  extends Omit<React.HTMLProps<HTMLElement>, 'ref'>,
26
27
  SpacingProps {
@@ -129,7 +130,7 @@ export interface AccordionProps
129
130
  /**
130
131
  * Will set the placement of the icon. Defaults to `left`.
131
132
  */
132
- icon_position?: ButtonIconPosition;
133
+ icon_position?: AccordionIconPosition;
133
134
 
134
135
  /**
135
136
  * Define a different icon size. Defaults to `medium` (1.5rem).
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import type { ButtonIconPosition } from '../button';
2
+ import type { ButtonIconPosition } from '../Button';
3
3
  import type { HeadingLevel } from '../Heading';
4
4
  import type { IconSize } from '../Icon';
5
5
  import type { SkeletonShow } from '../Skeleton';
@@ -4,7 +4,7 @@ import type {
4
4
  DrawerListData,
5
5
  DrawerListOptionsRender
6
6
  } from '../../fragments/DrawerList';
7
- import type { ButtonIconPosition } from '../button';
7
+ import type { ButtonIconPosition } from '../Button';
8
8
  import type { FormLabelLabelDirection, FormLabelText } from '../FormLabel';
9
9
  import type {
10
10
  FormStatusProps,
@@ -29,7 +29,7 @@ type AutocompleteSubmitButtonIcon =
29
29
  | ((...args: any[]) => any);
30
30
  type AutocompleteInputRef =
31
31
  | ((...args: any[]) => any)
32
- | Record<string, unknown>;
32
+ | React.MutableRefObject<HTMLInputElement | undefined>;
33
33
  type AutocompleteInputIcon =
34
34
  | string
35
35
  | React.ReactNode
@@ -15,6 +15,7 @@ export type ButtonVariant =
15
15
  | 'signal'
16
16
  | 'unstyled';
17
17
  export type ButtonSize = 'default' | 'small' | 'medium' | 'large';
18
+ export type ButtonIcon = IconIcon;
18
19
  export type ButtonIconPositionTertiary = 'top';
19
20
  export type ButtonIconPosition = 'left' | 'right';
20
21
  export type ButtonIconPositionAll =
@@ -65,7 +66,7 @@ export type ButtonProps = {
65
66
  /**
66
67
  * To be included in the button. <a href="/icons/primary">Primary Icons</a> can be set as a string (e.g. `icon="chevron_right"`), other icons should be set as React elements.
67
68
  */
68
- icon?: IconIcon;
69
+ icon?: ButtonIcon;
69
70
 
70
71
  /**
71
72
  * Position of icon inside the button. Set to `left` or `right`. Tertiary button variant also supports `top`. Defaults to `right` if not set.
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { ModalHeaderProps } from '../../modal/parts/ModalHeader';
3
- interface DialogHeaderProps extends ModalHeaderProps {
3
+ import type { SpacingProps } from '../../space/types';
4
+ interface DialogHeaderProps extends ModalHeaderProps, SpacingProps {
4
5
  titleClass?: string;
5
6
  }
6
7
  export default function DialogHeader({ className, titleClass, size, ref, // eslint-disable-line
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import type { FormLabelLabelDirection, FormLabelText } from '../FormLabel';
3
- import type { ButtonIconPosition, ButtonVariant } from '../button';
3
+ import type { ButtonIconPosition, ButtonVariant } from '../Button';
4
4
  import type {
5
5
  FormStatusProps,
6
6
  FormStatusState,
@@ -3,7 +3,7 @@
3
3
  *
4
4
  */
5
5
  import React from 'react';
6
- import { ButtonProps } from '../button/Button';
6
+ import type { ButtonProps } from '../button/Button';
7
7
  import { ModalProps } from '../modal/types';
8
8
  export declare type HelpButtonProps = {
9
9
  modal_content?: React.ReactNode;
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import type { ButtonIconPosition, ButtonVariant } from '../button';
2
+ import type { ButtonIconPosition, ButtonVariant } from '../Button';
3
3
  import type {
4
4
  FormStatusProps,
5
5
  FormStatusState,
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import type { Locale } from '../../shared/Context';
3
- import type { ButtonIconPosition } from '../button';
3
+ import type { ButtonIconPosition } from '../Button';
4
4
  import type { FormLabelLabelDirection, FormLabelText } from '../FormLabel';
5
5
  import type {
6
6
  FormStatusProps,
@@ -33,6 +33,7 @@ export default class ModalContent extends React.PureComponent<ModalContentProps,
33
33
  _androidFocusTimeout: NodeJS.Timeout;
34
34
  _ii: InteractionInvalidation;
35
35
  _iiLocal: InteractionInvalidation;
36
+ static contextType: React.Context<import("../../shared/Context").ContextProps>;
36
37
  constructor(props: ModalContentProps);
37
38
  componentDidMount(): void;
38
39
  componentWillUnmount(): void;
@@ -21,6 +21,10 @@ var _helpers = require("../../shared/helpers");
21
21
 
22
22
  var _helpers2 = require("./helpers");
23
23
 
24
+ var _Theme = require("../../shared/Theme");
25
+
26
+ var _shared = require("../../shared");
27
+
24
28
  const _excluded = ["triggeredBy"],
25
29
  _excluded2 = ["hide", "title", "labelled_by", "id", "close_title", "dialog_title", "hide_close_button", "close_button_attributes", "no_animation", "no_animation_on_mobile", "fullscreen", "container_placement", "close", "content_class", "overlay_class", "content_id", "children", "dialog_role"];
26
30
 
@@ -317,6 +321,8 @@ class ModalContent extends _react.default.PureComponent {
317
321
  }
318
322
 
319
323
  render() {
324
+ var _this$context;
325
+
320
326
  const _this$props2 = this.props,
321
327
  {
322
328
  hide,
@@ -357,7 +363,7 @@ class ModalContent extends _react.default.PureComponent {
357
363
  'aria-labelledby': (0, _componentHelper.combineLabelledBy)(this.props, title ? contentId + '-title' : null, labelled_by),
358
364
  'aria-describedby': (0, _componentHelper.combineDescribedBy)(this.props, contentId + '-content'),
359
365
  'aria-label': !title && !labelled_by ? dialog_title : undefined,
360
- className: (0, _classnames.default)('dnb-modal__content', (0, _componentHelper.isTrue)(fullscreen) ? 'dnb-modal__content--fullscreen' : fullscreen === 'auto' && 'dnb-modal__content--auto-fullscreen', content_class, container_placement && `dnb-modal__content--${container_placement || 'right'}`),
366
+ className: (0, _classnames.default)('dnb-modal__content', (0, _componentHelper.isTrue)(fullscreen) ? 'dnb-modal__content--fullscreen' : fullscreen === 'auto' && 'dnb-modal__content--auto-fullscreen', (0, _Theme.getThemeClasses)((_this$context = this.context) === null || _this$context === void 0 ? void 0 : _this$context.theme), content_class, container_placement && `dnb-modal__content--${container_placement || 'right'}`),
361
367
  onMouseDown: this.onContentMouseDownHandler,
362
368
  onClick: this.onContentClickHandler
363
369
  };
@@ -394,4 +400,6 @@ class ModalContent extends _react.default.PureComponent {
394
400
 
395
401
  }
396
402
 
397
- exports.default = ModalContent;
403
+ exports.default = ModalContent;
404
+
405
+ _defineProperty(ModalContent, "contextType", _shared.Context);
@@ -3,7 +3,7 @@
3
3
  *
4
4
  */
5
5
  import React from 'react';
6
- import { ButtonProps } from '../../button';
6
+ import type { ButtonProps } from '../../button/Button';
7
7
  export declare type CloseButtonProps = {
8
8
  /**
9
9
  * The title of the close button. Defaults to <em>Close</em> or <em>Lukk</em>.
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
- import { CloseButtonProps } from './parts/CloseButton';
3
- import { ButtonProps } from '../button/Button';
4
- import { ModalRootProps } from './ModalRoot';
2
+ import type { CloseButtonProps } from './parts/CloseButton';
3
+ import type { ButtonProps } from '../button/Button';
4
+ import type { ModalRootProps } from './ModalRoot';
5
5
  export declare type ReactChildType = React.ReactNode | ((...args: any[]) => any);
6
6
  export declare type ModalFullscreen = 'auto' | boolean;
7
7
  export declare type ModalAlignContent = 'left' | 'center' | 'centered' | 'right';
@@ -34,170 +34,170 @@ type PaginationIndicatorElement =
34
34
  | ((...args: any[]) => any)
35
35
  | string;
36
36
  type PaginationChildren = React.ReactNode | ((...args: any[]) => any);
37
- interface PaginationProps
37
+ export interface PaginationProps
38
38
  extends React.HTMLProps<HTMLElement>,
39
39
  SpacingProps {
40
40
  /**
41
41
  * The page shown in the very beginning. If `current_page` is set, then it may not make too much sense to set this as well.
42
42
  */
43
43
  startup_page?: PaginationStartupPage;
44
+
44
45
  /**
45
46
  * The page shown at the moment the component renders. Defaults to `1`.
46
47
  */
47
-
48
48
  current_page?: PaginationCurrentPage;
49
+
49
50
  /**
50
51
  * The total pages count. Defaults to `1`.
51
52
  */
52
-
53
53
  page_count?: PaginationPageCount;
54
+
54
55
  /**
55
56
  * Defines how many `infinity` pages should be loaded / shown on the first render. Defaults to `1`.
56
57
  */
57
-
58
58
  startup_count?: PaginationStartupCount;
59
+
59
60
  /**
60
61
  * Defines how many `infinity` pages should be loaded / shown once the user scrolls down. Defaults to `1`.
61
62
  */
62
-
63
63
  parallel_load_count?: PaginationParallelLoadCount;
64
+
64
65
  /**
65
66
  * If set to `true`, the infinity marker will be placed before the content (on top off). This could potentially have negative side effects. But it depends really on the content if this would make more sense to use instead. Defaults to `false`.
66
67
  */
67
-
68
68
  place_maker_before_content?: boolean;
69
+
69
70
  /**
70
71
  * The minimum time to wait, if the infinity scroll was invoked under that time threshold. This prevents not intentional infinity scroll loop calls. Defaults to `400` milliseconds.
71
72
  */
72
-
73
73
  min_wait_time?: PaginationMinWaitTime;
74
+
74
75
  /**
75
76
  * If set to `true`, all pagination bar buttons are disabled.
76
77
  */
77
-
78
78
  disabled?: boolean;
79
+
79
80
  /**
80
81
  * If set to `true`, an overlaying skeleton with animation will be shown.
81
82
  */
82
-
83
83
  skeleton?: SkeletonShow;
84
+
84
85
  /**
85
86
  * If set to `infinity`, then the pagination bar will be now shown and but infinity scrolling will do the content presentation. For more information, check out the <a href="https://eufemia.dnb.no/uilib/components/pagination/infinity-scroller">Infinity Scroller</a>. Defaults to `pagination`.
86
87
  */
87
-
88
88
  mode?: PaginationMode;
89
+
89
90
  /**
90
91
  * If set to `true` it will disable the automated infinity scrolling, but shows a load more button at the of the content instead.
91
92
  */
92
-
93
93
  use_load_button?: boolean;
94
94
  items?: PaginationItems;
95
+
95
96
  /**
96
97
  * If set to `true` no indicator will be shown.
97
98
  */
98
-
99
99
  hide_progress_indicator?: boolean;
100
+
100
101
  /**
101
102
  * Callback function to get the `setContent` handler from the current pagination instance. e.g. `set_content_handler={fn => (...)}`. Use this handler to insert content during infinity mode.
102
103
  */
103
-
104
104
  set_content_handler?: PaginationSetContentHandler;
105
+
105
106
  /**
106
107
  * Callback function to get the `resetContent` handler from the current pagination instance. e.g. `reset_content_handler={fn => (...)}`. Use this handler to reset all the content. You can set it to `true`, to programmatically reset the content.
107
108
  */
108
-
109
109
  reset_content_handler?: PaginationResetContentHandler;
110
+
110
111
  /**
111
112
  * Callback function to get the `resetInfinity` handler from the current pagination instance. e.g. `reset_pagination_handler={fn => (...)}`. Use this handler to reset all the internal states. You can set it to `true`, to programmatically reset the states.
112
113
  */
113
-
114
114
  reset_pagination_handler?: PaginationResetPaginationHandler;
115
+
115
116
  /**
116
117
  * Callback function to get the `endInfinity` handler from the current pagination instance. e.g. `end_infinity_handler={fn => (...)}`. Use this handler to end the infinity scrolling procedure, in case the `page_count` is unknown.
117
118
  */
118
-
119
119
  end_infinity_handler?: PaginationEndInfinityHandler;
120
+
120
121
  /**
121
122
  * By default a `<div>` is used. Set it to any element you have to use. Adds also a class: `dnb-pagination__page` shown.
122
123
  */
123
-
124
124
  page_element?: PaginationPageElement;
125
+
125
126
  /**
126
127
  * (infinity mode) is used by the <em>indicator</em>, <em>load more</em> bar as well as by the marker. Defaults to a `div`.
127
128
  */
128
-
129
129
  fallback_element?: PaginationFallbackElement;
130
+
130
131
  /**
131
132
  * (infinity mode) is used by the internal marker. Falls back to `fallback_element` if not defined.
132
133
  */
133
-
134
134
  marker_element?: PaginationMarkerElement;
135
+
135
136
  /**
136
137
  * (infinity mode) is used by the <em>indicator</em>. Falls back to `fallback_element` if not defined.
137
138
  */
138
-
139
139
  indicator_element?: PaginationIndicatorElement;
140
+
140
141
  /**
141
142
  * Define the alignment of the pagination button bar. Can be `center`, `left` or `right`. Defaults to `left`.
142
143
  */
143
-
144
144
  align?: string;
145
+
145
146
  /**
146
147
  * The title used in every button shown in the bar. Defaults to `Side %s`.
147
148
  */
148
-
149
149
  button_title?: string;
150
+
150
151
  /**
151
152
  * The title used in the previous page button. Defaults to `Forrige side`.
152
153
  */
153
-
154
154
  prev_title?: string;
155
+
155
156
  /**
156
157
  * The title used in the next page button. Defaults to `Neste side`.
157
158
  */
158
-
159
159
  next_title?: string;
160
+
160
161
  /**
161
162
  * The title used in the dots. Relevant for screen-readers. Defaults to `%s flere sider`.
162
163
  */
163
-
164
164
  more_pages?: string;
165
+
165
166
  /**
166
167
  * Shown until new content is inserted in to the page. Defaults to `Laster nytt innhold`.
167
168
  */
168
-
169
169
  is_loading_text?: string;
170
+
170
171
  /**
171
- * Used during infinity mode. If `use_load_button` is set to true, then a button is show on the bottom. If the `startup_page` is higher than 1. Defaults to `Vis mer innhold`.
172
+ * Used during infinity mode. If `use_load_button` is set to `true`, then a button is show on the bottom. If the `startup_page` is higher than 1. Defaults to `Vis mer innhold`.
172
173
  */
173
-
174
174
  load_button_text?: string;
175
175
  class?: string;
176
176
  className?: string;
177
+
177
178
  /**
178
179
  * The given content can be either a function or a React node, depending on your needs. A function contains several helper functions. More details down below and have a look at the examples in the demos section.
179
180
  */
180
-
181
181
  children?: PaginationChildren;
182
+
182
183
  /**
183
184
  * Will be called for every page change, regardless if the mode is `mode="infinity"` or not. Returns an object with number of useful properties and methods. See below for more details.
184
185
  */
185
-
186
186
  on_change?: (...args: any[]) => any;
187
+
187
188
  /**
188
189
  * Only on "infinity" mode. Will be called once the component is ready for interaction. Returns an object with number of useful properties and methods. See below for more details. "NB:" Will be called again as soon as we reset the content by calling `resetContent()`.
189
190
  */
190
-
191
191
  on_startup?: (...args: any[]) => any;
192
+
192
193
  /**
193
194
  * Only on "infinity" mode. Will be called on every page interaction, also on the very first interaction. Returns an object with number of useful properties and methods. See below for more details.
194
195
  */
195
-
196
196
  on_load?: (...args: any[]) => any;
197
+
197
198
  /**
198
199
  * Only on "infinity" mode. Will be called once `page_count` is reached or `endInfinity` was called.
199
200
  */
200
-
201
201
  on_end?: (...args: any[]) => any;
202
202
  }
203
203
  export default class Pagination extends React.Component<
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import type { ButtonIconPosition } from '../button';
2
+ import type { ButtonIconPosition } from '../Button';
3
3
  import type { FormLabelLabelDirection, FormLabelText } from '../FormLabel';
4
4
  import type {
5
5
  FormStatusProps,
@@ -13,6 +13,10 @@ var _componentHelper = require("../../shared/component-helper");
13
13
 
14
14
  var _TooltipContainer = _interopRequireDefault(require("./TooltipContainer"));
15
15
 
16
+ var _shared = require("../../shared");
17
+
18
+ var _Theme = require("../../shared/Theme");
19
+
16
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
21
 
18
22
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
@@ -45,12 +49,13 @@ function TooltipPortal(props) {
45
49
  const isInDOM = _react.default.useRef(false);
46
50
 
47
51
  const hasGroup = props.group;
52
+ const theme = (0, _shared.useTheme)();
48
53
 
49
54
  const makePortal = () => {
50
55
  if (!tooltipPortal[id]) {
51
56
  tooltipPortal[id] = {
52
57
  count: 0,
53
- node: hasGroup ? createGroupElement(id) : createRootElement()
58
+ node: hasGroup ? createGroupElement(theme, id) : createRootElement(theme)
54
59
  };
55
60
  }
56
61
  };
@@ -76,7 +81,7 @@ function TooltipPortal(props) {
76
81
  if (hasGroup) {
77
82
  _reactDom.default.unmountComponentAtNode(ref.node);
78
83
 
79
- createRootElement().removeChild(ref.node);
84
+ createRootElement(theme).removeChild(ref.node);
80
85
  }
81
86
 
82
87
  delete tooltipPortal[id];
@@ -169,20 +174,24 @@ function TooltipPortal(props) {
169
174
  var _default = TooltipPortal;
170
175
  exports.default = _default;
171
176
 
172
- const createGroupElement = id => {
177
+ const createGroupElement = (theme, id) => {
173
178
  try {
174
179
  const elem = document.createElement('div');
175
180
  elem.classList.add('dnb-tooltip__group');
176
181
  elem.setAttribute('id', id);
177
- createRootElement().appendChild(elem);
182
+ createRootElement(theme).appendChild(elem);
178
183
  return elem;
179
184
  } catch (e) {
180
185
  (0, _componentHelper.warn)(e);
181
186
  }
182
187
  };
183
188
 
184
- const createRootElement = function () {
185
- let className = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'dnb-tooltip__portal';
189
+ const createRootElement = function (theme) {
190
+ let className = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
191
+
192
+ if (!className) {
193
+ className = 'dnb-tooltip__portal';
194
+ }
186
195
 
187
196
  try {
188
197
  const element = document.querySelector(`.${className}`);
@@ -194,6 +203,11 @@ const createRootElement = function () {
194
203
  const elem = document.createElement('div');
195
204
  elem.classList.add(className);
196
205
  elem.classList.add('dnb-core-style');
206
+
207
+ if (theme) {
208
+ elem.classList.add.call(elem.classList, ...(0, _Theme.getThemeClasses)(theme).split(' '));
209
+ }
210
+
197
211
  document.body.appendChild(elem);
198
212
  return elem;
199
213
  } catch (e) {
@@ -3,6 +3,8 @@
3
3
  *
4
4
  */
5
5
  import React from 'react';
6
+ import { SpacingProps } from '../../components/space/types';
7
+ export declare type DivProps = SpacingProps & React.HTMLAttributes<HTMLElement>;
6
8
  declare const Div: React.ForwardRefExoticComponent<import("../../components/space/types").SpacingElementProps & {
7
9
  space?: import("../../components/space/types").SpaceType | import("../../components/space/types").SpacingElementProps;
8
10
  } & React.HTMLAttributes<HTMLElement> & React.RefAttributes<unknown>>;
@@ -16,6 +16,8 @@ var _keycode = _interopRequireDefault(require("keycode"));
16
16
 
17
17
  var _componentHelper = require("../../shared/component-helper");
18
18
 
19
+ var _Theme = require("../../shared/Theme");
20
+
19
21
  var _SpacingHelper = require("../../components/space/SpacingHelper");
20
22
 
21
23
  var _DrawerListContext = _interopRequireDefault(require("./DrawerListContext"));
@@ -144,6 +146,8 @@ class DrawerListInstance extends _react.default.PureComponent {
144
146
  }
145
147
 
146
148
  render() {
149
+ var _this$context2;
150
+
147
151
  const props = (0, _componentHelper.extendPropsWithContextInClassComponent)(this.props, DrawerList.defaultProps, this.context.getTranslation(this.props).DrawerList);
148
152
 
149
153
  const {
@@ -299,7 +303,7 @@ class DrawerListInstance extends _react.default.PureComponent {
299
303
  include_owner_width: align_drawer === 'right',
300
304
  independent_width: (0, _componentHelper.isTrue)(independent_width),
301
305
  fixed_position: (0, _componentHelper.isTrue)(fixed_position),
302
- className: portal_class
306
+ className: (0, _Theme.getThemeClasses)((_this$context2 = this.context) === null || _this$context2 === void 0 ? void 0 : _this$context2.theme, portal_class)
303
307
  }, mainList) : mainList);
304
308
  }
305
309
 
@@ -9,7 +9,7 @@ function init() {
9
9
  if (typeof window !== 'undefined') {
10
10
  class Eufemia {
11
11
  get version() {
12
- return '10.0.0-beta.5';
12
+ return '10.0.0-beta.7';
13
13
  }
14
14
 
15
15
  }
@@ -13,7 +13,15 @@ export declare type ThemeProps = {
13
13
  variant?: ThemeVariants;
14
14
  size?: ThemeSizes;
15
15
  colorMapping?: ColorMapping;
16
- element?: DynamicElement;
16
+ element?: DynamicElement | false;
17
17
  };
18
18
  export declare type ThemeAllProps = ThemeProps & React.HTMLAttributes<HTMLElement>;
19
19
  export default function Theme(themeProps: ThemeAllProps): JSX.Element;
20
+ export declare function ThemeWrapper({ children, theme, element, className, ...rest }: {
21
+ [x: string]: any;
22
+ children: any;
23
+ theme: any;
24
+ element?: any;
25
+ className?: any;
26
+ }): any;
27
+ export declare function getThemeClasses(theme: ThemeProps, className?: any): any;