@chayns-components/core 5.0.0-beta.775 → 5.0.0-beta.776

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 (63) hide show
  1. package/lib/cjs/components/color-scheme-provider/ColorSchemeProvider.js +0 -1
  2. package/lib/cjs/components/color-scheme-provider/ColorSchemeProvider.js.map +1 -1
  3. package/lib/cjs/components/context-menu/ContextMenu.js +2 -2
  4. package/lib/cjs/components/context-menu/ContextMenu.js.map +1 -1
  5. package/lib/cjs/components/popup/Popup.js +1 -1
  6. package/lib/cjs/components/popup/Popup.js.map +1 -1
  7. package/lib/cjs/index.js +0 -14
  8. package/lib/cjs/index.js.map +1 -1
  9. package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.js +0 -1
  10. package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.js.map +1 -1
  11. package/lib/esm/components/context-menu/ContextMenu.js +2 -2
  12. package/lib/esm/components/context-menu/ContextMenu.js.map +1 -1
  13. package/lib/esm/components/popup/Popup.js +1 -1
  14. package/lib/esm/components/popup/Popup.js.map +1 -1
  15. package/lib/esm/index.js +0 -2
  16. package/lib/esm/index.js.map +1 -1
  17. package/lib/types/components/accordion/Accordion.styles.d.ts +1 -1
  18. package/lib/types/components/accordion/accordion-body/AccordionBody.styles.d.ts +1 -1
  19. package/lib/types/components/accordion/accordion-head/AccordionHead.styles.d.ts +10 -10
  20. package/lib/types/components/amount-control/AmountControl.styles.d.ts +1 -1
  21. package/lib/types/components/button/Button.styles.d.ts +3 -3
  22. package/lib/types/components/color-scheme-provider/ColorSchemeProvider.d.ts +1 -1
  23. package/lib/types/components/combobox/ComboBox.styles.d.ts +1 -1
  24. package/lib/types/components/context-menu/context-menu-content/ContextMenuContent.styles.d.ts +1 -1
  25. package/lib/types/components/expandable-content/ExpandableContent.styles.d.ts +1 -1
  26. package/lib/types/components/file-input/FileInput.styles.d.ts +1 -1
  27. package/lib/types/components/filter-buttons/filter-button/FilterButton.styles.d.ts +1 -1
  28. package/lib/types/components/input/Input.styles.d.ts +3 -3
  29. package/lib/types/components/list/list-item/ListItem.styles.d.ts +1 -1
  30. package/lib/types/components/list/list-item/list-item-body/ListItemBody.styles.d.ts +1 -1
  31. package/lib/types/components/list/list-item/list-item-head/ListItemHead.styles.d.ts +4 -4
  32. package/lib/types/components/mention-finder/MentionFinder.styles.d.ts +1 -1
  33. package/lib/types/components/popup/popup-content-wrapper/PopupContentWrapper.styles.d.ts +1 -1
  34. package/lib/types/components/progress-bar/ProgressBar.styles.d.ts +1 -1
  35. package/lib/types/components/radio-button/RadioButton.styles.d.ts +1 -1
  36. package/lib/types/components/search-box/SearchBox.styles.d.ts +1 -1
  37. package/lib/types/components/search-box/search-box-body/SearchBoxBody.styles.d.ts +1 -1
  38. package/lib/types/components/search-input/SearchInput.styles.d.ts +2 -2
  39. package/lib/types/components/slider/Slider.styles.d.ts +2 -2
  40. package/lib/types/components/slider-button/SliderButton.styles.d.ts +1 -1
  41. package/lib/types/components/truncation/Truncation.styles.d.ts +1 -1
  42. package/lib/types/index.d.ts +0 -2
  43. package/package.json +2 -2
  44. package/lib/cjs/components/page-provider/PageProvider.js +0 -67
  45. package/lib/cjs/components/page-provider/PageProvider.js.map +0 -1
  46. package/lib/cjs/components/page-provider/PageProvider.styles.js +0 -34
  47. package/lib/cjs/components/page-provider/PageProvider.styles.js.map +0 -1
  48. package/lib/cjs/constants/pageProvider.js +0 -16
  49. package/lib/cjs/constants/pageProvider.js.map +0 -1
  50. package/lib/cjs/utils/pageProvider.js +0 -92
  51. package/lib/cjs/utils/pageProvider.js.map +0 -1
  52. package/lib/esm/components/page-provider/PageProvider.js +0 -59
  53. package/lib/esm/components/page-provider/PageProvider.js.map +0 -1
  54. package/lib/esm/components/page-provider/PageProvider.styles.js +0 -33
  55. package/lib/esm/components/page-provider/PageProvider.styles.js.map +0 -1
  56. package/lib/esm/constants/pageProvider.js +0 -10
  57. package/lib/esm/constants/pageProvider.js.map +0 -1
  58. package/lib/esm/utils/pageProvider.js +0 -84
  59. package/lib/esm/utils/pageProvider.js.map +0 -1
  60. package/lib/types/components/page-provider/PageProvider.d.ts +0 -14
  61. package/lib/types/components/page-provider/PageProvider.styles.d.ts +0 -7
  62. package/lib/types/constants/pageProvider.d.ts +0 -6
  63. package/lib/types/utils/pageProvider.d.ts +0 -2
@@ -7,7 +7,6 @@ export declare const StyledListItemHead: import("styled-components/dist/types").
7
7
  slot?: string | undefined;
8
8
  title?: string | undefined;
9
9
  color?: string | undefined;
10
- className?: string | undefined;
11
10
  rel?: string | undefined;
12
11
  defaultChecked?: boolean | undefined;
13
12
  defaultValue?: string | number | readonly string[] | undefined;
@@ -15,6 +14,7 @@ export declare const StyledListItemHead: import("styled-components/dist/types").
15
14
  suppressHydrationWarning?: boolean | undefined;
16
15
  accessKey?: string | undefined;
17
16
  autoFocus?: boolean | undefined;
17
+ className?: string | undefined;
18
18
  contentEditable?: "inherit" | (boolean | "false" | "true") | "plaintext-only" | undefined;
19
19
  contextMenu?: string | undefined;
20
20
  dir?: string | undefined;
@@ -271,7 +271,6 @@ export declare const StyledMotionListItemHeadIndicator: import("styled-component
271
271
  slot?: string | undefined;
272
272
  title?: string | undefined;
273
273
  color?: string | undefined;
274
- className?: string | undefined;
275
274
  rel?: string | undefined;
276
275
  defaultChecked?: boolean | undefined;
277
276
  defaultValue?: string | number | readonly string[] | undefined;
@@ -279,6 +278,7 @@ export declare const StyledMotionListItemHeadIndicator: import("styled-component
279
278
  suppressHydrationWarning?: boolean | undefined;
280
279
  accessKey?: string | undefined;
281
280
  autoFocus?: boolean | undefined;
281
+ className?: string | undefined;
282
282
  contentEditable?: "inherit" | (boolean | "false" | "true") | "plaintext-only" | undefined;
283
283
  contextMenu?: string | undefined;
284
284
  dir?: string | undefined;
@@ -548,7 +548,6 @@ export declare const StyledListItemHeadTitleText: import("styled-components/dist
548
548
  slot?: string | undefined;
549
549
  title?: string | undefined;
550
550
  color?: string | undefined;
551
- className?: string | undefined;
552
551
  rel?: string | undefined;
553
552
  defaultChecked?: boolean | undefined;
554
553
  defaultValue?: string | number | readonly string[] | undefined;
@@ -556,6 +555,7 @@ export declare const StyledListItemHeadTitleText: import("styled-components/dist
556
555
  suppressHydrationWarning?: boolean | undefined;
557
556
  accessKey?: string | undefined;
558
557
  autoFocus?: boolean | undefined;
558
+ className?: string | undefined;
559
559
  contentEditable?: "inherit" | (boolean | "false" | "true") | "plaintext-only" | undefined;
560
560
  contextMenu?: string | undefined;
561
561
  dir?: string | undefined;
@@ -824,7 +824,6 @@ export declare const StyledMotionListItemHeadHoverItem: import("styled-component
824
824
  slot?: string | undefined;
825
825
  title?: string | undefined;
826
826
  color?: string | undefined;
827
- className?: string | undefined;
828
827
  rel?: string | undefined;
829
828
  defaultChecked?: boolean | undefined;
830
829
  defaultValue?: string | number | readonly string[] | undefined;
@@ -832,6 +831,7 @@ export declare const StyledMotionListItemHeadHoverItem: import("styled-component
832
831
  suppressHydrationWarning?: boolean | undefined;
833
832
  accessKey?: string | undefined;
834
833
  autoFocus?: boolean | undefined;
834
+ className?: string | undefined;
835
835
  contentEditable?: "inherit" | (boolean | "false" | "true") | "plaintext-only" | undefined;
836
836
  contextMenu?: string | undefined;
837
837
  dir?: string | undefined;
@@ -8,7 +8,6 @@ export declare const StyledMotionMentionFinderPopup: import("styled-components/d
8
8
  slot?: string | undefined;
9
9
  title?: string | undefined;
10
10
  color?: string | undefined;
11
- className?: string | undefined;
12
11
  rel?: string | undefined;
13
12
  defaultChecked?: boolean | undefined;
14
13
  defaultValue?: string | number | readonly string[] | undefined;
@@ -16,6 +15,7 @@ export declare const StyledMotionMentionFinderPopup: import("styled-components/d
16
15
  suppressHydrationWarning?: boolean | undefined;
17
16
  accessKey?: string | undefined;
18
17
  autoFocus?: boolean | undefined;
18
+ className?: string | undefined;
19
19
  contentEditable?: "inherit" | (boolean | "false" | "true") | "plaintext-only" | undefined;
20
20
  contextMenu?: string | undefined;
21
21
  dir?: string | undefined;
@@ -10,7 +10,6 @@ export declare const StyledMotionPopupContentWrapper: import("styled-components/
10
10
  slot?: string | undefined;
11
11
  title?: string | undefined;
12
12
  color?: string | undefined;
13
- className?: string | undefined;
14
13
  rel?: string | undefined;
15
14
  defaultChecked?: boolean | undefined;
16
15
  defaultValue?: string | number | readonly string[] | undefined;
@@ -18,6 +17,7 @@ export declare const StyledMotionPopupContentWrapper: import("styled-components/
18
17
  suppressHydrationWarning?: boolean | undefined;
19
18
  accessKey?: string | undefined;
20
19
  autoFocus?: boolean | undefined;
20
+ className?: string | undefined;
21
21
  contentEditable?: "inherit" | (boolean | "false" | "true") | "plaintext-only" | undefined;
22
22
  contextMenu?: string | undefined;
23
23
  dir?: string | undefined;
@@ -7,7 +7,6 @@ export declare const StyledMotionProgressBarProgress: import("styled-components/
7
7
  slot?: string | undefined;
8
8
  title?: string | undefined;
9
9
  color?: string | undefined;
10
- className?: string | undefined;
11
10
  rel?: string | undefined;
12
11
  defaultChecked?: boolean | undefined;
13
12
  defaultValue?: string | number | readonly string[] | undefined;
@@ -15,6 +14,7 @@ export declare const StyledMotionProgressBarProgress: import("styled-components/
15
14
  suppressHydrationWarning?: boolean | undefined;
16
15
  accessKey?: string | undefined;
17
16
  autoFocus?: boolean | undefined;
17
+ className?: string | undefined;
18
18
  contentEditable?: "inherit" | (boolean | "false" | "true") | "plaintext-only" | undefined;
19
19
  contextMenu?: string | undefined;
20
20
  dir?: string | undefined;
@@ -29,7 +29,6 @@ export declare const StyledMotionRadioButtonChildren: import("styled-components/
29
29
  slot?: string | undefined;
30
30
  title?: string | undefined;
31
31
  color?: string | undefined;
32
- className?: string | undefined;
33
32
  rel?: string | undefined;
34
33
  defaultChecked?: boolean | undefined;
35
34
  defaultValue?: string | number | readonly string[] | undefined;
@@ -37,6 +36,7 @@ export declare const StyledMotionRadioButtonChildren: import("styled-components/
37
36
  suppressHydrationWarning?: boolean | undefined;
38
37
  accessKey?: string | undefined;
39
38
  autoFocus?: boolean | undefined;
39
+ className?: string | undefined;
40
40
  contentEditable?: "inherit" | (boolean | "false" | "true") | "plaintext-only" | undefined;
41
41
  contextMenu?: string | undefined;
42
42
  dir?: string | undefined;
@@ -10,7 +10,6 @@ export declare const StyledMotionSearchBoxBody: import("styled-components/dist/t
10
10
  slot?: string | undefined;
11
11
  title?: string | undefined;
12
12
  color?: string | undefined;
13
- className?: string | undefined;
14
13
  rel?: string | undefined;
15
14
  defaultChecked?: boolean | undefined;
16
15
  defaultValue?: string | number | readonly string[] | undefined;
@@ -18,6 +17,7 @@ export declare const StyledMotionSearchBoxBody: import("styled-components/dist/t
18
17
  suppressHydrationWarning?: boolean | undefined;
19
18
  accessKey?: string | undefined;
20
19
  autoFocus?: boolean | undefined;
20
+ className?: string | undefined;
21
21
  contentEditable?: "inherit" | (boolean | "false" | "true") | "plaintext-only" | undefined;
22
22
  contextMenu?: string | undefined;
23
23
  dir?: string | undefined;
@@ -7,7 +7,6 @@ export declare const StyledMotionSearchBoxBody: import("styled-components/dist/t
7
7
  slot?: string | undefined;
8
8
  title?: string | undefined;
9
9
  color?: string | undefined;
10
- className?: string | undefined;
11
10
  rel?: string | undefined;
12
11
  defaultChecked?: boolean | undefined;
13
12
  defaultValue?: string | number | readonly string[] | undefined;
@@ -15,6 +14,7 @@ export declare const StyledMotionSearchBoxBody: import("styled-components/dist/t
15
14
  suppressHydrationWarning?: boolean | undefined;
16
15
  accessKey?: string | undefined;
17
16
  autoFocus?: boolean | undefined;
17
+ className?: string | undefined;
18
18
  contentEditable?: "inherit" | (boolean | "false" | "true") | "plaintext-only" | undefined;
19
19
  contextMenu?: string | undefined;
20
20
  dir?: string | undefined;
@@ -7,7 +7,6 @@ export declare const StyledMotionSearchInputContentWrapper: import("styled-compo
7
7
  slot?: string | undefined;
8
8
  title?: string | undefined;
9
9
  color?: string | undefined;
10
- className?: string | undefined;
11
10
  rel?: string | undefined;
12
11
  defaultChecked?: boolean | undefined;
13
12
  defaultValue?: string | number | readonly string[] | undefined;
@@ -15,6 +14,7 @@ export declare const StyledMotionSearchInputContentWrapper: import("styled-compo
15
14
  suppressHydrationWarning?: boolean | undefined;
16
15
  accessKey?: string | undefined;
17
16
  autoFocus?: boolean | undefined;
17
+ className?: string | undefined;
18
18
  contentEditable?: "inherit" | (boolean | "false" | "true") | "plaintext-only" | undefined;
19
19
  contextMenu?: string | undefined;
20
20
  dir?: string | undefined;
@@ -273,7 +273,6 @@ export declare const StyledMotionSearchInputIconWrapperContent: import("styled-c
273
273
  slot?: string | undefined;
274
274
  title?: string | undefined;
275
275
  color?: string | undefined;
276
- className?: string | undefined;
277
276
  rel?: string | undefined;
278
277
  defaultChecked?: boolean | undefined;
279
278
  defaultValue?: string | number | readonly string[] | undefined;
@@ -281,6 +280,7 @@ export declare const StyledMotionSearchInputIconWrapperContent: import("styled-c
281
280
  suppressHydrationWarning?: boolean | undefined;
282
281
  accessKey?: string | undefined;
283
282
  autoFocus?: boolean | undefined;
283
+ className?: string | undefined;
284
284
  contentEditable?: "inherit" | (boolean | "false" | "true") | "plaintext-only" | undefined;
285
285
  contextMenu?: string | undefined;
286
286
  dir?: string | undefined;
@@ -16,7 +16,6 @@ export declare const StyledSliderInput: import("styled-components/dist/types").I
16
16
  size?: number | undefined;
17
17
  color?: string | undefined;
18
18
  type?: import("react").HTMLInputTypeAttribute | undefined;
19
- className?: string | undefined;
20
19
  rel?: string | undefined;
21
20
  defaultChecked?: boolean | undefined;
22
21
  defaultValue?: string | number | readonly string[] | undefined;
@@ -24,6 +23,7 @@ export declare const StyledSliderInput: import("styled-components/dist/types").I
24
23
  suppressHydrationWarning?: boolean | undefined;
25
24
  accessKey?: string | undefined;
26
25
  autoFocus?: boolean | undefined;
26
+ className?: string | undefined;
27
27
  contentEditable?: "inherit" | (boolean | "false" | "true") | "plaintext-only" | undefined;
28
28
  contextMenu?: string | undefined;
29
29
  dir?: string | undefined;
@@ -309,7 +309,6 @@ export declare const StyledSliderInput: import("styled-components/dist/types").I
309
309
  size?: number | undefined;
310
310
  color?: string | undefined;
311
311
  type?: import("react").HTMLInputTypeAttribute | undefined;
312
- className?: string | undefined;
313
312
  rel?: string | undefined;
314
313
  defaultChecked?: boolean | undefined;
315
314
  defaultValue?: string | number | readonly string[] | undefined;
@@ -317,6 +316,7 @@ export declare const StyledSliderInput: import("styled-components/dist/types").I
317
316
  suppressHydrationWarning?: boolean | undefined;
318
317
  accessKey?: string | undefined;
319
318
  autoFocus?: boolean | undefined;
319
+ className?: string | undefined;
320
320
  contentEditable?: "inherit" | (boolean | "false" | "true") | "plaintext-only" | undefined;
321
321
  contextMenu?: string | undefined;
322
322
  dir?: string | undefined;
@@ -21,7 +21,6 @@ export declare const StyledMotionSliderButtonThumb: import("styled-components/di
21
21
  slot?: string | undefined;
22
22
  title?: string | undefined;
23
23
  color?: string | undefined;
24
- className?: string | undefined;
25
24
  rel?: string | undefined;
26
25
  defaultChecked?: boolean | undefined;
27
26
  defaultValue?: string | number | readonly string[] | undefined;
@@ -29,6 +28,7 @@ export declare const StyledMotionSliderButtonThumb: import("styled-components/di
29
28
  suppressHydrationWarning?: boolean | undefined;
30
29
  accessKey?: string | undefined;
31
30
  autoFocus?: boolean | undefined;
31
+ className?: string | undefined;
32
32
  contentEditable?: "inherit" | (boolean | "false" | "true") | "plaintext-only" | undefined;
33
33
  contextMenu?: string | undefined;
34
34
  dir?: string | undefined;
@@ -5,7 +5,6 @@ export declare const StyledMotionTruncationContent: import("styled-components/di
5
5
  slot?: string | undefined;
6
6
  title?: string | undefined;
7
7
  color?: string | undefined;
8
- className?: string | undefined;
9
8
  rel?: string | undefined;
10
9
  defaultChecked?: boolean | undefined;
11
10
  defaultValue?: string | number | readonly string[] | undefined;
@@ -13,6 +12,7 @@ export declare const StyledMotionTruncationContent: import("styled-components/di
13
12
  suppressHydrationWarning?: boolean | undefined;
14
13
  accessKey?: string | undefined;
15
14
  autoFocus?: boolean | undefined;
15
+ className?: string | undefined;
16
16
  contentEditable?: "inherit" | (boolean | "false" | "true") | "plaintext-only" | undefined;
17
17
  contextMenu?: string | undefined;
18
18
  dir?: string | undefined;
@@ -25,7 +25,6 @@ export { default as ListItem, type ListItemElements, type ListItemProps, } from
25
25
  export { default as MentionFinder } from './components/mention-finder/MentionFinder';
26
26
  export type { MentionMember } from './components/mention-finder/MentionFinder';
27
27
  export { default as NumberInput } from './components/number-input/NumberInput';
28
- export { default as PageProvider } from './components/page-provider/PageProvider';
29
28
  export { default as Popup } from './components/popup/Popup';
30
29
  export { default as PopupContent } from './components/popup/popup-content/PopupContent';
31
30
  export { default as ProgressBar } from './components/progress-bar/ProgressBar';
@@ -67,5 +66,4 @@ export { ClampPosition } from './types/truncation';
67
66
  export { getIsTouch } from './utils/environment';
68
67
  export { getFileAsArrayBuffer, selectFiles } from './utils/fileDialog';
69
68
  export { isTobitEmployee } from './utils/isTobitEmployee';
70
- export { getUsableHeight } from './utils/pageProvider';
71
69
  export { uploadFile } from './utils/uploadFile';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chayns-components/core",
3
- "version": "5.0.0-beta.775",
3
+ "version": "5.0.0-beta.776",
4
4
  "description": "A set of beautiful React components for developing your own applications with chayns.",
5
5
  "sideEffects": false,
6
6
  "browserslist": [
@@ -85,5 +85,5 @@
85
85
  "publishConfig": {
86
86
  "access": "public"
87
87
  },
88
- "gitHead": "bd7784c84baec27d4359577fae4343ea17ce3a60"
88
+ "gitHead": "e63300a57924d14c1d1220ceb7505c4caeaa3689"
89
89
  }
@@ -1,67 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = _interopRequireWildcard(require("react"));
8
- var _styledComponents = require("styled-components");
9
- var _pageProvider = require("../../utils/pageProvider");
10
- var _ColorSchemeProvider = _interopRequireDefault(require("../color-scheme-provider/ColorSchemeProvider"));
11
- var _PageProvider = require("./PageProvider.styles");
12
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
14
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
15
- const GlobalStyle = (0, _styledComponents.createGlobalStyle)`
16
- *, *::before, *::after {
17
- box-sizing: border-box;
18
- }
19
- `;
20
- const PageProvider = ({
21
- children,
22
- color,
23
- colorMode,
24
- cssVariables = {},
25
- secondaryColor,
26
- siteId,
27
- style = {},
28
- designSettings,
29
- shouldRemovePadding,
30
- shouldUseUsableHeight
31
- }) => {
32
- const [usableHeight, setUsableHeight] = (0, _react.useState)(0);
33
- const [padding, setPadding] = (0, _react.useState)();
34
- (0, _react.useEffect)(() => {
35
- const fetchUsableHeight = async () => {
36
- const height = await (0, _pageProvider.getUsableHeight)();
37
- setUsableHeight(height);
38
- };
39
- void fetchUsableHeight();
40
- }, []);
41
- (0, _react.useEffect)(() => {
42
- const handleResize = () => {
43
- setPadding((0, _pageProvider.getPagePadding)());
44
- };
45
- setPadding((0, _pageProvider.getPagePadding)());
46
- window.addEventListener('resize', handleResize);
47
- return () => {
48
- window.removeEventListener('resize', handleResize);
49
- };
50
- }, [padding]);
51
- return /*#__PURE__*/_react.default.createElement(_PageProvider.StyledPageProvider, {
52
- className: "page-provider",
53
- $padding: shouldRemovePadding ? 0 : padding,
54
- $usableHeight: shouldUseUsableHeight ? usableHeight : undefined
55
- }, /*#__PURE__*/_react.default.createElement(_ColorSchemeProvider.default, {
56
- color: color,
57
- secondaryColor: secondaryColor,
58
- colorMode: colorMode,
59
- style: style,
60
- siteId: siteId,
61
- designSettings: designSettings,
62
- cssVariables: cssVariables
63
- }, children), /*#__PURE__*/_react.default.createElement(GlobalStyle, null));
64
- };
65
- PageProvider.displayName = 'PageProvider';
66
- var _default = exports.default = PageProvider;
67
- //# sourceMappingURL=PageProvider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PageProvider.js","names":["_react","_interopRequireWildcard","require","_styledComponents","_pageProvider","_ColorSchemeProvider","_interopRequireDefault","_PageProvider","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","GlobalStyle","createGlobalStyle","PageProvider","children","color","colorMode","cssVariables","secondaryColor","siteId","style","designSettings","shouldRemovePadding","shouldUseUsableHeight","usableHeight","setUsableHeight","useState","padding","setPadding","useEffect","fetchUsableHeight","height","getUsableHeight","handleResize","getPagePadding","window","addEventListener","removeEventListener","createElement","StyledPageProvider","className","$padding","$usableHeight","undefined","displayName","_default","exports"],"sources":["../../../../src/components/page-provider/PageProvider.tsx"],"sourcesContent":["import React, { FC, useEffect, useState, type CSSProperties } from 'react';\nimport { createGlobalStyle } from 'styled-components';\nimport { getPagePadding, getUsableHeight } from '../../utils/pageProvider';\nimport ColorSchemeProvider, {\n type ColorSchemeProviderProps,\n} from '../color-scheme-provider/ColorSchemeProvider';\nimport { StyledPageProvider } from './PageProvider.styles';\n\ninterface PageProviderProps extends ColorSchemeProviderProps {\n /**\n * Whether the padding should be removed.\n */\n shouldRemovePadding?: boolean;\n /**\n * Whether the usable height should be used.\n */\n shouldUseUsableHeight?: boolean;\n}\n\nconst GlobalStyle = createGlobalStyle`\n *, *::before, *::after {\n box-sizing: border-box;\n }\n`;\n\nconst PageProvider: FC<PageProviderProps> = ({\n children,\n color,\n colorMode,\n cssVariables = {},\n secondaryColor,\n siteId,\n style = {},\n designSettings,\n shouldRemovePadding,\n shouldUseUsableHeight,\n}) => {\n const [usableHeight, setUsableHeight] = useState(0);\n const [padding, setPadding] = useState<CSSProperties['padding']>();\n\n useEffect(() => {\n const fetchUsableHeight = async () => {\n const height = await getUsableHeight();\n setUsableHeight(height);\n };\n\n void fetchUsableHeight();\n }, []);\n\n useEffect(() => {\n const handleResize = () => {\n setPadding(getPagePadding());\n };\n\n setPadding(getPagePadding());\n\n window.addEventListener('resize', handleResize);\n\n return () => {\n window.removeEventListener('resize', handleResize);\n };\n }, [padding]);\n\n return (\n <StyledPageProvider\n className=\"page-provider\"\n $padding={shouldRemovePadding ? 0 : padding}\n $usableHeight={shouldUseUsableHeight ? usableHeight : undefined}\n >\n <ColorSchemeProvider\n color={color}\n secondaryColor={secondaryColor}\n colorMode={colorMode}\n style={style}\n siteId={siteId}\n designSettings={designSettings}\n cssVariables={cssVariables}\n >\n {children}\n </ColorSchemeProvider>\n <GlobalStyle />\n </StyledPageProvider>\n );\n};\nPageProvider.displayName = 'PageProvider';\n\nexport default PageProvider;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,oBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAGA,IAAAK,aAAA,GAAAL,OAAA;AAA2D,SAAAI,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,6BAAAI,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAD,wBAAA,YAAAA,CAAAH,CAAA,WAAAA,CAAA,GAAAM,CAAA,GAAAD,CAAA,KAAAL,CAAA;AAAA,SAAAP,wBAAAO,CAAA,EAAAK,CAAA,SAAAA,CAAA,IAAAL,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,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cAAc;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAArD,OAAA,GAE3BoB,YAAY","ignoreList":[]}
@@ -1,34 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.StyledPageProvider = void 0;
7
- var _styledComponents = _interopRequireDefault(require("styled-components"));
8
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
- const StyledPageProvider = exports.StyledPageProvider = _styledComponents.default.div`
10
- padding: ${({
11
- $padding
12
- }) => $padding};
13
- height: ${({
14
- $usableHeight
15
- }) => $usableHeight ? `${$usableHeight}px` : undefined};
16
-
17
- .color-scheme-provider:first-child:not(td) {
18
- & > h1,
19
- & > .h1,
20
- & > h2,
21
- & > .h2,
22
- & > h3,
23
- & > .h3,
24
- & > h4,
25
- & > .h4,
26
- & > h5,
27
- & > .h5 {
28
- &:first-of-type:first-child {
29
- margin-top: 0;
30
- }
31
- }
32
- }
33
- `;
34
- //# sourceMappingURL=PageProvider.styles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PageProvider.styles.js","names":["_styledComponents","_interopRequireDefault","require","e","__esModule","default","StyledPageProvider","exports","styled","div","$padding","$usableHeight","undefined"],"sources":["../../../../src/components/page-provider/PageProvider.styles.ts"],"sourcesContent":["import type { CSSProperties } from 'react';\nimport styled from 'styled-components';\n\ntype StyledPageProviderProps = {\n $padding?: CSSProperties['padding'];\n $usableHeight?: CSSProperties['height'];\n};\n\nexport const StyledPageProvider = styled.div<StyledPageProviderProps>`\n padding: ${({ $padding }) => $padding};\n height: ${({ $usableHeight }) => ($usableHeight ? `${$usableHeight}px` : undefined)};\n\n .color-scheme-provider:first-child:not(td) {\n & > h1,\n & > .h1,\n & > h2,\n & > .h2,\n & > h3,\n & > .h3,\n & > h4,\n & > .h4,\n & > h5,\n & > .h5 {\n &:first-of-type:first-child {\n margin-top: 0;\n }\n }\n }\n`;\n"],"mappings":";;;;;;AACA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAuC,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAOhC,MAAMG,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAGE,yBAAM,CAACC,GAA4B;AACrE,eAAe,CAAC;EAAEC;AAAS,CAAC,KAAKA,QAAQ;AACzC,cAAc,CAAC;EAAEC;AAAc,CAAC,KAAMA,aAAa,GAAG,GAAGA,aAAa,IAAI,GAAGC,SAAU;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
@@ -1,16 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.PAGE_BREAKPOINTS = void 0;
7
- const PAGE_BREAKPOINTS = exports.PAGE_BREAKPOINTS = {
8
- mobile: 'screen and (max-width: 37.438em)',
9
- // less than 600px
10
- desktop: 'screen and (min-width: 33.5em)',
11
- // more than 600px; could: and (max-width: 63.9375em)
12
- desk: 'screen and (min-width: 53.125em)',
13
- // more than 850px
14
- retina: '(-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi), (min-resolution: 2dppx)'
15
- };
16
- //# sourceMappingURL=pageProvider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pageProvider.js","names":["PAGE_BREAKPOINTS","exports","mobile","desktop","desk","retina"],"sources":["../../../src/constants/pageProvider.ts"],"sourcesContent":["export const PAGE_BREAKPOINTS = {\n mobile: 'screen and (max-width: 37.438em)', // less than 600px\n desktop: 'screen and (min-width: 33.5em)', // more than 600px; could: and (max-width: 63.9375em)\n desk: 'screen and (min-width: 53.125em)', // more than 850px\n retina: '(-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi), (min-resolution: 2dppx)',\n};\n"],"mappings":";;;;;;AAAO,MAAMA,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAG;EAC5BE,MAAM,EAAE,kCAAkC;EAAE;EAC5CC,OAAO,EAAE,gCAAgC;EAAE;EAC3CC,IAAI,EAAE,kCAAkC;EAAE;EAC1CC,MAAM,EAAE;AACZ,CAAC","ignoreList":[]}
@@ -1,92 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getUsableHeight = exports.getPagePadding = void 0;
7
- var _chaynsApi = require("chayns-api");
8
- var _pageProvider = require("../constants/pageProvider");
9
- const getPagePadding = () => {
10
- const {
11
- runtimeEnvironment
12
- } = (0, _chaynsApi.getEnvironment)();
13
- if (typeof runtimeEnvironment === 'number' && [4, 5].includes(runtimeEnvironment)) {
14
- return '0';
15
- }
16
- if (matchMedia(_pageProvider.PAGE_BREAKPOINTS.desktop).matches) {
17
- return '35px 43px 30px';
18
- }
19
- return '15px 10px 20px';
20
- };
21
- exports.getPagePadding = getPagePadding;
22
- const getPageProviderInformation = customPadding => {
23
- const padding = (customPadding ?? getPagePadding()).split(' ');
24
- const parseValue = value => {
25
- const parsed = parseInt(value.replace('px', ''), 10);
26
- return Number.isNaN(parsed) ? 0 : parsed;
27
- };
28
- if (padding.length === 1) {
29
- const value = parseValue(padding[0] ?? '');
30
- return {
31
- top: value,
32
- right: value,
33
- bottom: value,
34
- left: value
35
- };
36
- }
37
- if (padding.length === 2) {
38
- const [vertical, horizontal] = padding.map(parseValue);
39
- return {
40
- top: vertical ?? 0,
41
- right: horizontal ?? 0,
42
- bottom: vertical ?? 0,
43
- left: horizontal ?? 0
44
- };
45
- }
46
- if (padding.length === 3) {
47
- const [top, horizontal, bottom] = padding.map(parseValue);
48
- return {
49
- top: top ?? 0,
50
- right: horizontal ?? 0,
51
- bottom: bottom ?? 0,
52
- left: horizontal ?? 0
53
- };
54
- }
55
- if (padding.length === 4) {
56
- const [top, right, bottom, left] = padding.map(parseValue);
57
- return {
58
- top: top ?? 0,
59
- right: right ?? 0,
60
- bottom: bottom ?? 0,
61
- left: left ?? 0
62
- };
63
- }
64
- return {
65
- top: 0,
66
- right: 0,
67
- bottom: 0,
68
- left: 0
69
- };
70
- };
71
- const getUsableHeight = async customPadding => {
72
- let usableHeight;
73
- const {
74
- bottomBarHeight,
75
- topBarHeight,
76
- windowHeight
77
- } = await (0, _chaynsApi.getWindowMetrics)();
78
- const {
79
- top,
80
- bottom
81
- } = getPageProviderInformation(customPadding);
82
- usableHeight = windowHeight - bottom - top;
83
- if (bottomBarHeight) {
84
- usableHeight -= bottomBarHeight;
85
- }
86
- if (topBarHeight) {
87
- usableHeight -= topBarHeight;
88
- }
89
- return usableHeight;
90
- };
91
- exports.getUsableHeight = getUsableHeight;
92
- //# sourceMappingURL=pageProvider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pageProvider.js","names":["_chaynsApi","require","_pageProvider","getPagePadding","runtimeEnvironment","getEnvironment","includes","matchMedia","PAGE_BREAKPOINTS","desktop","matches","exports","getPageProviderInformation","customPadding","padding","split","parseValue","value","parsed","parseInt","replace","Number","isNaN","length","top","right","bottom","left","vertical","horizontal","map","getUsableHeight","usableHeight","bottomBarHeight","topBarHeight","windowHeight","getWindowMetrics"],"sources":["../../../src/utils/pageProvider.ts"],"sourcesContent":["import { getEnvironment, getWindowMetrics } from 'chayns-api';\nimport { PAGE_BREAKPOINTS } from '../constants/pageProvider';\n\nexport const getPagePadding = () => {\n const { runtimeEnvironment } = getEnvironment();\n\n if (typeof runtimeEnvironment === 'number' && [4, 5].includes(runtimeEnvironment)) {\n return '0';\n }\n\n if (matchMedia(PAGE_BREAKPOINTS.desktop).matches) {\n return '35px 43px 30px';\n }\n\n return '15px 10px 20px';\n};\n\ntype PaddingValues = {\n top: number;\n right: number;\n bottom: number;\n left: number;\n};\n\nconst getPageProviderInformation = (customPadding?: string): PaddingValues => {\n const padding = (customPadding ?? getPagePadding()).split(' ');\n\n const parseValue = (value: string): number => {\n const parsed = parseInt(value.replace('px', ''), 10);\n return Number.isNaN(parsed) ? 0 : parsed;\n };\n\n if (padding.length === 1) {\n const value = parseValue(padding[0] ?? '');\n return { top: value, right: value, bottom: value, left: value };\n }\n\n if (padding.length === 2) {\n const [vertical, horizontal] = padding.map(parseValue);\n return {\n top: vertical ?? 0,\n right: horizontal ?? 0,\n bottom: vertical ?? 0,\n left: horizontal ?? 0,\n };\n }\n\n if (padding.length === 3) {\n const [top, horizontal, bottom] = padding.map(parseValue);\n return {\n top: top ?? 0,\n right: horizontal ?? 0,\n bottom: bottom ?? 0,\n left: horizontal ?? 0,\n };\n }\n\n if (padding.length === 4) {\n const [top, right, bottom, left] = padding.map(parseValue);\n return { top: top ?? 0, right: right ?? 0, bottom: bottom ?? 0, left: left ?? 0 };\n }\n\n return { top: 0, right: 0, bottom: 0, left: 0 };\n};\n\nexport const getUsableHeight = async (customPadding?: string) => {\n let usableHeight;\n\n const { bottomBarHeight, topBarHeight, windowHeight } = await getWindowMetrics();\n\n const { top, bottom } = getPageProviderInformation(customPadding);\n\n usableHeight = windowHeight - bottom - top;\n\n if (bottomBarHeight) {\n usableHeight -= bottomBarHeight;\n }\n\n if (topBarHeight) {\n usableHeight -= topBarHeight;\n }\n\n return usableHeight;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAEO,MAAME,cAAc,GAAGA,CAAA,KAAM;EAChC,MAAM;IAAEC;EAAmB,CAAC,GAAG,IAAAC,yBAAc,EAAC,CAAC;EAE/C,IAAI,OAAOD,kBAAkB,KAAK,QAAQ,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAACE,QAAQ,CAACF,kBAAkB,CAAC,EAAE;IAC/E,OAAO,GAAG;EACd;EAEA,IAAIG,UAAU,CAACC,8BAAgB,CAACC,OAAO,CAAC,CAACC,OAAO,EAAE;IAC9C,OAAO,gBAAgB;EAC3B;EAEA,OAAO,gBAAgB;AAC3B,CAAC;AAACC,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M,EAAEA,MAAM,IAAI,CAAC;MACnBC,IAAI,EAAEE,UAAU,IAAI;IACxB,CAAC;EACL;EAEA,IAAIf,OAAO,CAACS,MAAM,KAAK,CAAC,EAAE;IACtB,MAAM,CAACC,GAAG,EAAEC,KAAK,EAAEC,MAAM,EAAEC,IAAI,CAAC,GAAGb,OAAO,CAACgB,GAAG,CAACd,UAAU,CAAC;IAC1D,OAAO;MAAEQ,GAAG,EAAEA,GAAG,IAAI,CAAC;MAAEC,KAAK,EAAEA,KAAK,IAAI,CAAC;MAAEC,MAAM,EAAEA,MAAM,IAAI,CAAC;MAAEC,IAAI,EAAEA,IAAI,IAAI;IAAE,CAAC;EACrF;EAEA,OAAO;IAAEH,GAAG,EAAE,CAAC;IAAEC,KAAK,EAAE,CAAC;IAAEC,MAAM,EAAE,CAAC;IAAEC,IAAI,EAAE;EAAE,CAAC;AACnD,CAAC;AAEM,MAAMI,eAAe,GAAG,MAAOlB,aAAsB,IAAK;EAC7D,IAAImB,YAAY;EAEhB,MAAM;IAAEC,eAAe;IAAEC,YAAY;IAAEC;EAAa,CAAC,GAAG,MAAM,IAAAC,2BAAgB,EAAC,CAAC;EAEhF,MAAM;IAAEZ,GAAG;IAAEE;EAAO,CAAC,GAAGd,0BAA0B,CAACC,aAAa,CAAC;EAEjEmB,YAAY,GAAGG,YAAY,GAAGT,MAAM,GAAGF,GAAG;EAE1C,IAAIS,eAAe,EAAE;IACjBD,YAAY,IAAIC,eAAe;EACnC;EAEA,IAAIC,YAAY,EAAE;IACdF,YAAY,IAAIE,YAAY;EAChC;EAEA,OAAOF,YAAY;AACvB,CAAC;AAACrB,OAAA,CAAAoB,eAAA,GAAAA,eAAA","ignoreList":[]}
@@ -1,59 +0,0 @@
1
- import React, { useEffect, useState } from 'react';
2
- import { createGlobalStyle } from 'styled-components';
3
- import { getPagePadding, getUsableHeight } from '../../utils/pageProvider';
4
- import ColorSchemeProvider from '../color-scheme-provider/ColorSchemeProvider';
5
- import { StyledPageProvider } from './PageProvider.styles';
6
- const GlobalStyle = createGlobalStyle`
7
- *, *::before, *::after {
8
- box-sizing: border-box;
9
- }
10
- `;
11
- const PageProvider = _ref => {
12
- let {
13
- children,
14
- color,
15
- colorMode,
16
- cssVariables = {},
17
- secondaryColor,
18
- siteId,
19
- style = {},
20
- designSettings,
21
- shouldRemovePadding,
22
- shouldUseUsableHeight
23
- } = _ref;
24
- const [usableHeight, setUsableHeight] = useState(0);
25
- const [padding, setPadding] = useState();
26
- useEffect(() => {
27
- const fetchUsableHeight = async () => {
28
- const height = await getUsableHeight();
29
- setUsableHeight(height);
30
- };
31
- void fetchUsableHeight();
32
- }, []);
33
- useEffect(() => {
34
- const handleResize = () => {
35
- setPadding(getPagePadding());
36
- };
37
- setPadding(getPagePadding());
38
- window.addEventListener('resize', handleResize);
39
- return () => {
40
- window.removeEventListener('resize', handleResize);
41
- };
42
- }, [padding]);
43
- return /*#__PURE__*/React.createElement(StyledPageProvider, {
44
- className: "page-provider",
45
- $padding: shouldRemovePadding ? 0 : padding,
46
- $usableHeight: shouldUseUsableHeight ? usableHeight : undefined
47
- }, /*#__PURE__*/React.createElement(ColorSchemeProvider, {
48
- color: color,
49
- secondaryColor: secondaryColor,
50
- colorMode: colorMode,
51
- style: style,
52
- siteId: siteId,
53
- designSettings: designSettings,
54
- cssVariables: cssVariables
55
- }, children), /*#__PURE__*/React.createElement(GlobalStyle, null));
56
- };
57
- PageProvider.displayName = 'PageProvider';
58
- export default PageProvider;
59
- //# sourceMappingURL=PageProvider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PageProvider.js","names":["React","useEffect","useState","createGlobalStyle","getPagePadding","getUsableHeight","ColorSchemeProvider","StyledPageProvider","GlobalStyle","PageProvider","_ref","children","color","colorMode","cssVariables","secondaryColor","siteId","style","designSettings","shouldRemovePadding","shouldUseUsableHeight","usableHeight","setUsableHeight","padding","setPadding","fetchUsableHeight","height","handleResize","window","addEventListener","removeEventListener","createElement","className","$padding","$usableHeight","undefined","displayName"],"sources":["../../../../src/components/page-provider/PageProvider.tsx"],"sourcesContent":["import React, { FC, useEffect, useState, type CSSProperties } from 'react';\nimport { createGlobalStyle } from 'styled-components';\nimport { getPagePadding, getUsableHeight } from '../../utils/pageProvider';\nimport ColorSchemeProvider, {\n type ColorSchemeProviderProps,\n} from '../color-scheme-provider/ColorSchemeProvider';\nimport { StyledPageProvider } from './PageProvider.styles';\n\ninterface PageProviderProps extends ColorSchemeProviderProps {\n /**\n * Whether the padding should be removed.\n */\n shouldRemovePadding?: boolean;\n /**\n * Whether the usable height should be used.\n */\n shouldUseUsableHeight?: boolean;\n}\n\nconst GlobalStyle = createGlobalStyle`\n *, *::before, *::after {\n box-sizing: border-box;\n }\n`;\n\nconst PageProvider: FC<PageProviderProps> = ({\n children,\n color,\n colorMode,\n cssVariables = {},\n secondaryColor,\n siteId,\n style = {},\n designSettings,\n shouldRemovePadding,\n shouldUseUsableHeight,\n}) => {\n const [usableHeight, setUsableHeight] = useState(0);\n const [padding, setPadding] = useState<CSSProperties['padding']>();\n\n useEffect(() => {\n const fetchUsableHeight = async () => {\n const height = await getUsableHeight();\n setUsableHeight(height);\n };\n\n void fetchUsableHeight();\n }, []);\n\n useEffect(() => {\n const handleResize = () => {\n setPadding(getPagePadding());\n };\n\n setPadding(getPagePadding());\n\n window.addEventListener('resize', handleResize);\n\n return () => {\n window.removeEventListener('resize', handleResize);\n };\n }, [padding]);\n\n return (\n <StyledPageProvider\n className=\"page-provider\"\n $padding={shouldRemovePadding ? 0 : padding}\n $usableHeight={shouldUseUsableHeight ? usableHeight : undefined}\n >\n <ColorSchemeProvider\n color={color}\n secondaryColor={secondaryColor}\n colorMode={colorMode}\n style={style}\n siteId={siteId}\n designSettings={designSettings}\n cssVariables={cssVariables}\n >\n {children}\n </ColorSchemeProvider>\n <GlobalStyle />\n </StyledPageProvider>\n );\n};\nPageProvider.displayName = 'PageProvider';\n\nexport default PageProvider;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAQC,SA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;EAEb,oBACIvB,KAAA,CAAA+B,aAAA,CAACxB,kBAAkB;IACfyB,SAAS,EAAC,eAAe;IACzBC,QAAQ,EAAEd,mBAAmB,GAAG,CAAC,GAAGI,OAAQ;IAC5CW,aAAa,EAAEd,qBAAqB,GAAGC,YAAY,GAAGc;EAAU,gBAEhEnC,KAAA,CAAA+B,aAAA,CAACzB,mBAAmB;IAChBM,KAAK,EAAEA,KAAM;IACbG,cAAc,EAAEA,cAAe;IAC/BF,SAAS,EAAEA,SAAU;IACrBI,KAAK,EAAEA,KAAM;IACbD,MAAM,EAAEA,MAAO;IACfE,cAAc,EAAEA,cAAe;IAC/BJ,YAAY,EAAEA;EAAa,GAE1BH,QACgB,CAAC,eACtBX,KAAA,CAAA+B,aAAA,CAACvB,WAAW,MAAE,CACE,CAAC;AAE7B,CAAC;AACDC,YAAY,CAAC2B,WAAW,GAAG,cAAc;AAEzC,eAAe3B,YAAY","ignoreList":[]}
@@ -1,33 +0,0 @@
1
- import styled from 'styled-components';
2
- export const StyledPageProvider = styled.div`
3
- padding: ${_ref => {
4
- let {
5
- $padding
6
- } = _ref;
7
- return $padding;
8
- }};
9
- height: ${_ref2 => {
10
- let {
11
- $usableHeight
12
- } = _ref2;
13
- return $usableHeight ? `${$usableHeight}px` : undefined;
14
- }};
15
-
16
- .color-scheme-provider:first-child:not(td) {
17
- & > h1,
18
- & > .h1,
19
- & > h2,
20
- & > .h2,
21
- & > h3,
22
- & > .h3,
23
- & > h4,
24
- & > .h4,
25
- & > h5,
26
- & > .h5 {
27
- &:first-of-type:first-child {
28
- margin-top: 0;
29
- }
30
- }
31
- }
32
- `;
33
- //# sourceMappingURL=PageProvider.styles.js.map