@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.
- package/lib/cjs/components/color-scheme-provider/ColorSchemeProvider.js +0 -1
- package/lib/cjs/components/color-scheme-provider/ColorSchemeProvider.js.map +1 -1
- package/lib/cjs/components/context-menu/ContextMenu.js +2 -2
- package/lib/cjs/components/context-menu/ContextMenu.js.map +1 -1
- package/lib/cjs/components/popup/Popup.js +1 -1
- package/lib/cjs/components/popup/Popup.js.map +1 -1
- package/lib/cjs/index.js +0 -14
- package/lib/cjs/index.js.map +1 -1
- package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.js +0 -1
- package/lib/esm/components/color-scheme-provider/ColorSchemeProvider.js.map +1 -1
- package/lib/esm/components/context-menu/ContextMenu.js +2 -2
- package/lib/esm/components/context-menu/ContextMenu.js.map +1 -1
- package/lib/esm/components/popup/Popup.js +1 -1
- package/lib/esm/components/popup/Popup.js.map +1 -1
- package/lib/esm/index.js +0 -2
- package/lib/esm/index.js.map +1 -1
- package/lib/types/components/accordion/Accordion.styles.d.ts +1 -1
- package/lib/types/components/accordion/accordion-body/AccordionBody.styles.d.ts +1 -1
- package/lib/types/components/accordion/accordion-head/AccordionHead.styles.d.ts +10 -10
- package/lib/types/components/amount-control/AmountControl.styles.d.ts +1 -1
- package/lib/types/components/button/Button.styles.d.ts +3 -3
- package/lib/types/components/color-scheme-provider/ColorSchemeProvider.d.ts +1 -1
- package/lib/types/components/combobox/ComboBox.styles.d.ts +1 -1
- package/lib/types/components/context-menu/context-menu-content/ContextMenuContent.styles.d.ts +1 -1
- package/lib/types/components/expandable-content/ExpandableContent.styles.d.ts +1 -1
- package/lib/types/components/file-input/FileInput.styles.d.ts +1 -1
- package/lib/types/components/filter-buttons/filter-button/FilterButton.styles.d.ts +1 -1
- package/lib/types/components/input/Input.styles.d.ts +3 -3
- package/lib/types/components/list/list-item/ListItem.styles.d.ts +1 -1
- package/lib/types/components/list/list-item/list-item-body/ListItemBody.styles.d.ts +1 -1
- package/lib/types/components/list/list-item/list-item-head/ListItemHead.styles.d.ts +4 -4
- package/lib/types/components/mention-finder/MentionFinder.styles.d.ts +1 -1
- package/lib/types/components/popup/popup-content-wrapper/PopupContentWrapper.styles.d.ts +1 -1
- package/lib/types/components/progress-bar/ProgressBar.styles.d.ts +1 -1
- package/lib/types/components/radio-button/RadioButton.styles.d.ts +1 -1
- package/lib/types/components/search-box/SearchBox.styles.d.ts +1 -1
- package/lib/types/components/search-box/search-box-body/SearchBoxBody.styles.d.ts +1 -1
- package/lib/types/components/search-input/SearchInput.styles.d.ts +2 -2
- package/lib/types/components/slider/Slider.styles.d.ts +2 -2
- package/lib/types/components/slider-button/SliderButton.styles.d.ts +1 -1
- package/lib/types/components/truncation/Truncation.styles.d.ts +1 -1
- package/lib/types/index.d.ts +0 -2
- package/package.json +2 -2
- package/lib/cjs/components/page-provider/PageProvider.js +0 -67
- package/lib/cjs/components/page-provider/PageProvider.js.map +0 -1
- package/lib/cjs/components/page-provider/PageProvider.styles.js +0 -34
- package/lib/cjs/components/page-provider/PageProvider.styles.js.map +0 -1
- package/lib/cjs/constants/pageProvider.js +0 -16
- package/lib/cjs/constants/pageProvider.js.map +0 -1
- package/lib/cjs/utils/pageProvider.js +0 -92
- package/lib/cjs/utils/pageProvider.js.map +0 -1
- package/lib/esm/components/page-provider/PageProvider.js +0 -59
- package/lib/esm/components/page-provider/PageProvider.js.map +0 -1
- package/lib/esm/components/page-provider/PageProvider.styles.js +0 -33
- package/lib/esm/components/page-provider/PageProvider.styles.js.map +0 -1
- package/lib/esm/constants/pageProvider.js +0 -10
- package/lib/esm/constants/pageProvider.js.map +0 -1
- package/lib/esm/utils/pageProvider.js +0 -84
- package/lib/esm/utils/pageProvider.js.map +0 -1
- package/lib/types/components/page-provider/PageProvider.d.ts +0 -14
- package/lib/types/components/page-provider/PageProvider.styles.d.ts +0 -7
- package/lib/types/constants/pageProvider.d.ts +0 -6
- package/lib/types/utils/pageProvider.d.ts +0 -2
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PageProvider.styles.js","names":["styled","StyledPageProvider","div","_ref","$padding","_ref2","$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,OAAOA,MAAM,MAAM,mBAAmB;AAOtC,OAAO,MAAMC,kBAAkB,GAAGD,MAAM,CAACE,GAA4B;AACrE,eAAeC,IAAA;EAAA,IAAC;IAAEC;EAAS,CAAC,GAAAD,IAAA;EAAA,OAAKC,QAAQ;AAAA;AACzC,cAAcC,KAAA;EAAA,IAAC;IAAEC;EAAc,CAAC,GAAAD,KAAA;EAAA,OAAMC,aAAa,GAAG,GAAGA,aAAa,IAAI,GAAGC,SAAS;AAAA,CAAC;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export const PAGE_BREAKPOINTS = {
|
|
2
|
-
mobile: 'screen and (max-width: 37.438em)',
|
|
3
|
-
// less than 600px
|
|
4
|
-
desktop: 'screen and (min-width: 33.5em)',
|
|
5
|
-
// more than 600px; could: and (max-width: 63.9375em)
|
|
6
|
-
desk: 'screen and (min-width: 53.125em)',
|
|
7
|
-
// more than 850px
|
|
8
|
-
retina: '(-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi), (min-resolution: 2dppx)'
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=pageProvider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pageProvider.js","names":["PAGE_BREAKPOINTS","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":"AAAA,OAAO,MAAMA,gBAAgB,GAAG;EAC5BC,MAAM,EAAE,kCAAkC;EAAE;EAC5CC,OAAO,EAAE,gCAAgC;EAAE;EAC3CC,IAAI,EAAE,kCAAkC;EAAE;EAC1CC,MAAM,EAAE;AACZ,CAAC","ignoreList":[]}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { getEnvironment, getWindowMetrics } from 'chayns-api';
|
|
2
|
-
import { PAGE_BREAKPOINTS } from '../constants/pageProvider';
|
|
3
|
-
export const getPagePadding = () => {
|
|
4
|
-
const {
|
|
5
|
-
runtimeEnvironment
|
|
6
|
-
} = getEnvironment();
|
|
7
|
-
if (typeof runtimeEnvironment === 'number' && [4, 5].includes(runtimeEnvironment)) {
|
|
8
|
-
return '0';
|
|
9
|
-
}
|
|
10
|
-
if (matchMedia(PAGE_BREAKPOINTS.desktop).matches) {
|
|
11
|
-
return '35px 43px 30px';
|
|
12
|
-
}
|
|
13
|
-
return '15px 10px 20px';
|
|
14
|
-
};
|
|
15
|
-
const getPageProviderInformation = customPadding => {
|
|
16
|
-
const padding = (customPadding ?? getPagePadding()).split(' ');
|
|
17
|
-
const parseValue = value => {
|
|
18
|
-
const parsed = parseInt(value.replace('px', ''), 10);
|
|
19
|
-
return Number.isNaN(parsed) ? 0 : parsed;
|
|
20
|
-
};
|
|
21
|
-
if (padding.length === 1) {
|
|
22
|
-
const value = parseValue(padding[0] ?? '');
|
|
23
|
-
return {
|
|
24
|
-
top: value,
|
|
25
|
-
right: value,
|
|
26
|
-
bottom: value,
|
|
27
|
-
left: value
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
if (padding.length === 2) {
|
|
31
|
-
const [vertical, horizontal] = padding.map(parseValue);
|
|
32
|
-
return {
|
|
33
|
-
top: vertical ?? 0,
|
|
34
|
-
right: horizontal ?? 0,
|
|
35
|
-
bottom: vertical ?? 0,
|
|
36
|
-
left: horizontal ?? 0
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
if (padding.length === 3) {
|
|
40
|
-
const [top, horizontal, bottom] = padding.map(parseValue);
|
|
41
|
-
return {
|
|
42
|
-
top: top ?? 0,
|
|
43
|
-
right: horizontal ?? 0,
|
|
44
|
-
bottom: bottom ?? 0,
|
|
45
|
-
left: horizontal ?? 0
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
if (padding.length === 4) {
|
|
49
|
-
const [top, right, bottom, left] = padding.map(parseValue);
|
|
50
|
-
return {
|
|
51
|
-
top: top ?? 0,
|
|
52
|
-
right: right ?? 0,
|
|
53
|
-
bottom: bottom ?? 0,
|
|
54
|
-
left: left ?? 0
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
return {
|
|
58
|
-
top: 0,
|
|
59
|
-
right: 0,
|
|
60
|
-
bottom: 0,
|
|
61
|
-
left: 0
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
export const getUsableHeight = async customPadding => {
|
|
65
|
-
let usableHeight;
|
|
66
|
-
const {
|
|
67
|
-
bottomBarHeight,
|
|
68
|
-
topBarHeight,
|
|
69
|
-
windowHeight
|
|
70
|
-
} = await getWindowMetrics();
|
|
71
|
-
const {
|
|
72
|
-
top,
|
|
73
|
-
bottom
|
|
74
|
-
} = getPageProviderInformation(customPadding);
|
|
75
|
-
usableHeight = windowHeight - bottom - top;
|
|
76
|
-
if (bottomBarHeight) {
|
|
77
|
-
usableHeight -= bottomBarHeight;
|
|
78
|
-
}
|
|
79
|
-
if (topBarHeight) {
|
|
80
|
-
usableHeight -= topBarHeight;
|
|
81
|
-
}
|
|
82
|
-
return usableHeight;
|
|
83
|
-
};
|
|
84
|
-
//# sourceMappingURL=pageProvider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pageProvider.js","names":["getEnvironment","getWindowMetrics","PAGE_BREAKPOINTS","getPagePadding","runtimeEnvironment","includes","matchMedia","desktop","matches","getPageProviderInformation","customPadding","padding","split","parseValue","value","parsed","parseInt","replace","Number","isNaN","length","top","right","bottom","left","vertical","horizontal","map","getUsableHeight","usableHeight","bottomBarHeight","topBarHeight","windowHeight"],"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,SAASA,cAAc,EAAEC,gBAAgB,QAAQ,YAAY;AAC7D,SAASC,gBAAgB,QAAQ,2BAA2B;AAE5D,OAAO,MAAMC,cAAc,GAAGA,CAAA,KAAM;EAChC,MAAM;IAAEC;EAAmB,CAAC,GAAGJ,cAAc,CAAC,CAAC;EAE/C,IAAI,OAAOI,kBAAkB,KAAK,QAAQ,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAACC,QAAQ,CAACD,kBAAkB,CAAC,EAAE;IAC/E,OAAO,GAAG;EACd;EAEA,IAAIE,UAAU,CAACJ,gBAAgB,CAACK,OAAO,CAAC,CAACC,OAAO,EAAE;IAC9C,OAAO,gBAAgB;EAC3B;EAEA,OAAO,gBAAgB;AAC3B,CAAC;AASD,MAAMC,0BAA0B,GAAIC,aAAsB,IAAoB;EAC1E,MAAMC,OAAO,GAAG,CAACD,aAAa,IAAIP,cAAc,CAAC,CAAC,EAAES,KAAK,CAAC,GAAG,CAAC;EAE9D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,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;AAED,OAAO,MAAMI,eAAe,GAAG,MAAOlB,aAAsB,IAAK;EAC7D,IAAImB,YAAY;EAEhB,MAAM;IAAEC,eAAe;IAAEC,YAAY;IAAEC;EAAa,CAAC,GAAG,MAAM/B,gBAAgB,CAAC,CAAC;EAEhF,MAAM;IAAEoB,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","ignoreList":[]}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { type ColorSchemeProviderProps } from '../color-scheme-provider/ColorSchemeProvider';
|
|
3
|
-
interface PageProviderProps extends ColorSchemeProviderProps {
|
|
4
|
-
/**
|
|
5
|
-
* Whether the padding should be removed.
|
|
6
|
-
*/
|
|
7
|
-
shouldRemovePadding?: boolean;
|
|
8
|
-
/**
|
|
9
|
-
* Whether the usable height should be used.
|
|
10
|
-
*/
|
|
11
|
-
shouldUseUsableHeight?: boolean;
|
|
12
|
-
}
|
|
13
|
-
declare const PageProvider: FC<PageProviderProps>;
|
|
14
|
-
export default PageProvider;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties } from 'react';
|
|
2
|
-
type StyledPageProviderProps = {
|
|
3
|
-
$padding?: CSSProperties['padding'];
|
|
4
|
-
$usableHeight?: CSSProperties['height'];
|
|
5
|
-
};
|
|
6
|
-
export declare const StyledPageProvider: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledPageProviderProps>> & string;
|
|
7
|
-
export {};
|