@popmenu/common-ui 0.127.0 → 0.127.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/components/Avatar/AvatarProps.d.ts +2 -2
- package/build/cjs/components/Button/Button.d.ts +1 -1
- package/build/cjs/components/Button/ButtonProps.d.ts +1 -1
- package/build/cjs/components/Button/ButtonStyles.d.ts +1 -1
- package/build/cjs/components/Chip/Chip.d.ts +1 -1
- package/build/cjs/components/Chip/ChipProps.d.ts +2 -2
- package/build/cjs/components/CollapsibleText/CollapsibleTextStyles.d.ts +2 -2
- package/build/cjs/components/Divider/DividerProps.d.ts +1 -1
- package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationAltActions.d.ts +0 -1
- package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationBody.d.ts +0 -1
- package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationCloseButton.d.ts +0 -1
- package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationDialog.d.ts +0 -1
- package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationDialogProps.d.ts +6 -6
- package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationFooter.d.ts +0 -1
- package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationForm.d.ts +0 -1
- package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationGraphic.d.ts +0 -1
- package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationInfo.d.ts +0 -1
- package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationTitle.d.ts +0 -1
- package/build/cjs/components/FollowerAuthenticationDialog/context.d.ts +0 -1
- package/build/cjs/components/Icon/IconStyles.d.ts +1 -1
- package/build/cjs/components/IconButton/IconButtonProps.d.ts +1 -1
- package/build/cjs/components/Link/LinkStyles.d.ts +1 -1
- package/build/cjs/components/NumberField/NumberField.d.ts +0 -1
- package/build/cjs/components/NumberField/NumberFieldStyles.d.ts +1 -1
- package/build/cjs/components/SplitInput/SplitInputStyles.d.ts +1 -1
- package/build/cjs/components/Tooltip/TooltipProps.d.ts +1 -1
- package/build/cjs/components/Typography/Typography.d.ts +1 -1
- package/build/cjs/components/Typography/TypographyProps.d.ts +3 -3
- package/build/cjs/components/Typography/TypographyStyles.d.ts +1 -1
- package/build/cjs/hooks/useTabs/useTabsResult.d.ts +3 -3
- package/build/cjs/index.js +412 -437
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/types/index.d.ts +2 -2
- package/build/esm/components/Avatar/Avatar.js +9 -10
- package/build/esm/components/Avatar/Avatar.js.map +1 -1
- package/build/esm/components/Avatar/AvatarProps.d.ts +2 -2
- package/build/esm/components/Avatar/avatar.styles.js +11 -11
- package/build/esm/components/Avatar/avatar.styles.js.map +1 -1
- package/build/esm/components/Avatar/util/useImageProps.js +9 -8
- package/build/esm/components/Avatar/util/useImageProps.js.map +1 -1
- package/build/esm/components/BrowserSilhouette/BrowserSilhouette.js +2 -3
- package/build/esm/components/BrowserSilhouette/BrowserSilhouette.js.map +1 -1
- package/build/esm/components/BrowserSilhouette/browserSilhouette.styles.js +5 -5
- package/build/esm/components/BrowserSilhouette/browserSilhouette.styles.js.map +1 -1
- package/build/esm/components/Button/Button.d.ts +1 -1
- package/build/esm/components/Button/Button.js +7 -8
- package/build/esm/components/Button/Button.js.map +1 -1
- package/build/esm/components/Button/ButtonProps.d.ts +1 -1
- package/build/esm/components/Button/ButtonStyles.d.ts +1 -1
- package/build/esm/components/Button/ButtonStyles.js +3 -6
- package/build/esm/components/Button/ButtonStyles.js.map +1 -1
- package/build/esm/components/Checkbox/Checkbox.js +5 -5
- package/build/esm/components/Checkbox/Checkbox.js.map +1 -1
- package/build/esm/components/Chip/Chip.d.ts +1 -1
- package/build/esm/components/Chip/Chip.js +7 -8
- package/build/esm/components/Chip/Chip.js.map +1 -1
- package/build/esm/components/Chip/ChipProps.d.ts +2 -2
- package/build/esm/components/Chip/ChipStyles.js +19 -19
- package/build/esm/components/Chip/ChipStyles.js.map +1 -1
- package/build/esm/components/CollapsibleText/CollapsibleText.js +19 -20
- package/build/esm/components/CollapsibleText/CollapsibleText.js.map +1 -1
- package/build/esm/components/CollapsibleText/CollapsibleTextStyles.d.ts +2 -2
- package/build/esm/components/CollapsibleText/CollapsibleTextStyles.js +5 -6
- package/build/esm/components/CollapsibleText/CollapsibleTextStyles.js.map +1 -1
- package/build/esm/components/Divider/Divider.js +11 -15
- package/build/esm/components/Divider/Divider.js.map +1 -1
- package/build/esm/components/Divider/DividerProps.d.ts +1 -1
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationAltActions.d.ts +0 -1
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationAltActions.js +26 -26
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationAltActions.js.map +1 -1
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationBody.d.ts +0 -1
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationBody.js +1 -1
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationBody.js.map +1 -1
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationCloseButton.d.ts +0 -1
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationCloseButton.js +6 -6
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationCloseButton.js.map +1 -1
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationContent.js +4 -4
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationContent.js.map +1 -1
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationDialog.d.ts +0 -1
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationDialog.js +11 -15
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationDialog.js.map +1 -1
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationDialogProps.d.ts +6 -6
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationFooter.d.ts +0 -1
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationFooter.js +2 -2
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationFooter.js.map +1 -1
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationForm.d.ts +0 -1
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationForm.js +49 -52
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationForm.js.map +1 -1
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationGraphic.d.ts +0 -1
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationGraphic.js +4 -4
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationGraphic.js.map +1 -1
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationInfo.d.ts +0 -1
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationInfo.js +3 -3
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationInfo.js.map +1 -1
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationTitle.d.ts +0 -1
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationTitle.js +3 -3
- package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationTitle.js.map +1 -1
- package/build/esm/components/FollowerAuthenticationDialog/context.d.ts +0 -1
- package/build/esm/components/FollowerAuthenticationDialog/context.js +4 -4
- package/build/esm/components/FollowerAuthenticationDialog/context.js.map +1 -1
- package/build/esm/components/FollowerAuthenticationDialog/theme.js +1 -1
- package/build/esm/components/FollowerAuthenticationDialog/theme.js.map +1 -1
- package/build/esm/components/Icon/Icon.js +12 -8
- package/build/esm/components/Icon/Icon.js.map +1 -1
- package/build/esm/components/Icon/IconStyles.d.ts +1 -1
- package/build/esm/components/Icon/IconStyles.js +7 -9
- package/build/esm/components/Icon/IconStyles.js.map +1 -1
- package/build/esm/components/IconButton/IconButton.js +2 -3
- package/build/esm/components/IconButton/IconButton.js.map +1 -1
- package/build/esm/components/IconButton/IconButtonProps.d.ts +1 -1
- package/build/esm/components/Link/Link.js +4 -5
- package/build/esm/components/Link/Link.js.map +1 -1
- package/build/esm/components/Link/LinkStyles.d.ts +1 -1
- package/build/esm/components/Link/LinkStyles.js +8 -8
- package/build/esm/components/Link/LinkStyles.js.map +1 -1
- package/build/esm/components/NumberField/NumberField.d.ts +0 -1
- package/build/esm/components/NumberField/NumberField.js +14 -9
- package/build/esm/components/NumberField/NumberField.js.map +1 -1
- package/build/esm/components/NumberField/NumberFieldStyles.d.ts +1 -1
- package/build/esm/components/NumberField/NumberFieldStyles.js +4 -4
- package/build/esm/components/NumberField/NumberFieldStyles.js.map +1 -1
- package/build/esm/components/Paper/Paper.js +12 -16
- package/build/esm/components/Paper/Paper.js.map +1 -1
- package/build/esm/components/PaperContent/PaperContent.js +2 -2
- package/build/esm/components/PaperContent/PaperContent.js.map +1 -1
- package/build/esm/components/Radio/Radio.js +5 -5
- package/build/esm/components/Radio/Radio.js.map +1 -1
- package/build/esm/components/SplitInput/SplitInput.js +4 -6
- package/build/esm/components/SplitInput/SplitInput.js.map +1 -1
- package/build/esm/components/SplitInput/SplitInputStyles.d.ts +1 -1
- package/build/esm/components/SplitInput/SplitInputStyles.js +4 -4
- package/build/esm/components/SplitInput/SplitInputStyles.js.map +1 -1
- package/build/esm/components/Switch/Switch.js +6 -6
- package/build/esm/components/Switch/Switch.js.map +1 -1
- package/build/esm/components/Switch/switch.styles.js +2 -2
- package/build/esm/components/Switch/switch.styles.js.map +1 -1
- package/build/esm/components/TabPanel/TabPanel.js +2 -2
- package/build/esm/components/TabPanel/TabPanel.js.map +1 -1
- package/build/esm/components/ToggleButton/ToggleButton.js +5 -6
- package/build/esm/components/ToggleButton/ToggleButton.js.map +1 -1
- package/build/esm/components/ToggleButton/ToggleButtonStyles.js +4 -4
- package/build/esm/components/ToggleButton/ToggleButtonStyles.js.map +1 -1
- package/build/esm/components/ToggleButtonGroup/ToggleButtonGroup.js +6 -7
- package/build/esm/components/ToggleButtonGroup/ToggleButtonGroup.js.map +1 -1
- package/build/esm/components/ToggleButtonGroup/ToggleButtonGroupStyles.js +2 -2
- package/build/esm/components/ToggleButtonGroup/ToggleButtonGroupStyles.js.map +1 -1
- package/build/esm/components/Tooltip/Tooltip.js +3 -4
- package/build/esm/components/Tooltip/Tooltip.js.map +1 -1
- package/build/esm/components/Tooltip/TooltipProps.d.ts +1 -1
- package/build/esm/components/Tooltip/TooltipStyles.js +5 -8
- package/build/esm/components/Tooltip/TooltipStyles.js.map +1 -1
- package/build/esm/components/Typography/Typography.d.ts +1 -1
- package/build/esm/components/Typography/Typography.js +4 -6
- package/build/esm/components/Typography/Typography.js.map +1 -1
- package/build/esm/components/Typography/TypographyProps.d.ts +3 -3
- package/build/esm/components/Typography/TypographyStyles.d.ts +1 -1
- package/build/esm/components/Typography/TypographyStyles.js +29 -47
- package/build/esm/components/Typography/TypographyStyles.js.map +1 -1
- package/build/esm/hooks/useCollapsibleText.js +7 -7
- package/build/esm/hooks/useCollapsibleText.js.map +1 -1
- package/build/esm/hooks/useTabs/useTabs.js +15 -15
- package/build/esm/hooks/useTabs/useTabs.js.map +1 -1
- package/build/esm/hooks/useTabs/useTabsResult.d.ts +3 -3
- package/build/esm/types/index.d.ts +2 -2
- package/package.json +2 -2
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { makeStyles } from '@material-ui/core';
|
|
2
2
|
import { iconStaticClassName } from '../Icon/Icon.js';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
const weights = {
|
|
5
5
|
regular: 400,
|
|
6
6
|
medium: 500,
|
|
7
7
|
'semi-bold': 600,
|
|
8
8
|
bold: 700,
|
|
9
9
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
const getCustomColor = (theme, color) => {
|
|
11
|
+
const isCommonColor = color && ['white', 'black'].includes(color);
|
|
12
|
+
const isGreyColor = color && color.match(/^grey\.\d{3}/);
|
|
13
|
+
const isSemanticColor = color && color.match(/(primary|secondary|info|success|error|warning).?(light|dark)?/);
|
|
14
|
+
const isTextColor = color && ['textPrimary', 'textSecondary'].includes(color);
|
|
15
15
|
switch (true) {
|
|
16
16
|
case isCommonColor:
|
|
17
17
|
// @ts-expect-error - todo.
|
|
18
18
|
return theme.palette.common[color];
|
|
19
19
|
case Boolean(isGreyColor):
|
|
20
|
-
|
|
20
|
+
const scale = color.split('.')[1];
|
|
21
21
|
// @ts-expect-error - todo.
|
|
22
22
|
return theme.palette.grey[scale] || theme.palette.grey[900];
|
|
23
23
|
case Boolean(isSemanticColor):
|
|
24
|
-
|
|
24
|
+
const [paletteKey, variant = 'main'] = color.split('.');
|
|
25
25
|
// @ts-expect-error - todo.
|
|
26
26
|
return theme.palette[paletteKey][variant];
|
|
27
27
|
case isTextColor:
|
|
@@ -31,46 +31,28 @@ var getCustomColor = function (theme, color) {
|
|
|
31
31
|
return undefined;
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
padding: '0 0.125em',
|
|
42
|
-
boxSizing: 'content-box',
|
|
43
|
-
},
|
|
44
|
-
_a.fontFamily = theme.typography.fontFamily,
|
|
45
|
-
_a.fontWeight = function (_a) {
|
|
46
|
-
var variant = _a.variant, weight = _a.weight;
|
|
47
|
-
return (weight ? weights[weight] : theme.typography[variant].fontWeight);
|
|
48
|
-
},
|
|
49
|
-
_a.fontSize = function (_a) {
|
|
50
|
-
var variant = _a.variant;
|
|
51
|
-
return theme.typography[variant].fontSize;
|
|
52
|
-
},
|
|
53
|
-
_a.lineHeight = function (_a) {
|
|
54
|
-
var variant = _a.variant;
|
|
55
|
-
return theme.typography[variant].lineHeight;
|
|
56
|
-
},
|
|
57
|
-
_a.textTransform = function (_a) {
|
|
58
|
-
var variant = _a.variant;
|
|
59
|
-
return theme.typography[variant].textTransform;
|
|
60
|
-
},
|
|
61
|
-
_a.color = function (_a) {
|
|
62
|
-
var color = _a.color, variant = _a.variant;
|
|
63
|
-
return (color && getCustomColor(theme, color)) || theme.typography[variant].color;
|
|
64
|
-
},
|
|
65
|
-
_a),
|
|
66
|
-
caption: {
|
|
67
|
-
display: 'inline',
|
|
34
|
+
const useTypographyStyles = makeStyles((theme) => ({
|
|
35
|
+
root: {
|
|
36
|
+
[`& .${iconStaticClassName}`]: {
|
|
37
|
+
position: 'relative',
|
|
38
|
+
top: '0.125em',
|
|
39
|
+
padding: '0 0.125em',
|
|
40
|
+
boxSizing: 'content-box',
|
|
68
41
|
},
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
},
|
|
72
|
-
|
|
73
|
-
})
|
|
42
|
+
fontFamily: theme.typography.fontFamily,
|
|
43
|
+
fontWeight: ({ variant, weight }) => (weight ? weights[weight] : theme.typography[variant].fontWeight),
|
|
44
|
+
fontSize: ({ variant }) => theme.typography[variant].fontSize,
|
|
45
|
+
lineHeight: ({ variant }) => theme.typography[variant].lineHeight,
|
|
46
|
+
textTransform: ({ variant }) => theme.typography[variant].textTransform,
|
|
47
|
+
color: ({ color, variant }) => (color && getCustomColor(theme, color)) || theme.typography[variant].color,
|
|
48
|
+
},
|
|
49
|
+
caption: {
|
|
50
|
+
display: 'inline',
|
|
51
|
+
},
|
|
52
|
+
overline: {
|
|
53
|
+
display: 'inline',
|
|
54
|
+
},
|
|
55
|
+
}));
|
|
74
56
|
|
|
75
57
|
export { useTypographyStyles };
|
|
76
58
|
//# sourceMappingURL=TypographyStyles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypographyStyles.js","sources":["../../../../src/components/Typography/TypographyStyles.ts"],"sourcesContent":["import { makeStyles, Theme } from '@material-ui/core'\n\nimport { iconStaticClassName } from '../Icon'\nimport { TypographyProps } from './TypographyProps'\n\nconst weights = {\n regular: 400,\n medium: 500,\n 'semi-bold': 600,\n bold: 700,\n}\n\nconst getCustomColor = (theme: Theme, color: string) => {\n const isCommonColor = color && ['white', 'black'].includes(color)\n const isGreyColor = color && color.match(/^grey\\.\\d{3}/)\n const isSemanticColor = color && color.match(/(primary|secondary|info|success|error|warning).?(light|dark)?/)\n const isTextColor = color && ['textPrimary', 'textSecondary'].includes(color)\n switch (true) {\n case isCommonColor:\n // @ts-expect-error - todo.\n return theme.palette.common[color]\n case Boolean(isGreyColor):\n const scale = color.split('.')[1]\n // @ts-expect-error - todo.\n return theme.palette.grey[scale] || theme.palette.grey[900]\n case Boolean(isSemanticColor):\n const [paletteKey, variant = 'main'] = color.split('.')\n // @ts-expect-error - todo.\n return theme.palette[paletteKey][variant]\n case isTextColor:\n // @ts-expect-error - todo.\n return theme.palette.text[color.slice(4).toLowerCase()]\n default:\n return undefined\n }\n}\n\ntype StyleProps = Pick<TypographyProps, 'color' | 'weight'> & {\n variant: NonNullable<TypographyProps['variant']>\n}\n\nexport const useTypographyStyles = makeStyles<Theme, StyleProps>((theme) => ({\n root: {\n [`& .${iconStaticClassName}`]: {\n position: 'relative',\n top: '0.125em',\n padding: '0 0.125em',\n boxSizing: 'content-box',\n },\n fontFamily: theme.typography.fontFamily,\n fontWeight: ({ variant, weight }) => (weight ? weights[weight] : theme.typography[variant].fontWeight),\n fontSize: ({ variant }) => theme.typography[variant].fontSize,\n lineHeight: ({ variant }) => theme.typography[variant].lineHeight,\n textTransform: ({ variant }) => theme.typography[variant].textTransform,\n color: ({ color, variant }) => (color && getCustomColor(theme, color)) || theme.typography[variant].color,\n },\n caption: {\n display: 'inline',\n },\n overline: {\n display: 'inline',\n },\n}))\n"],"names":[],"mappings":";;;AAKA,
|
|
1
|
+
{"version":3,"file":"TypographyStyles.js","sources":["../../../../src/components/Typography/TypographyStyles.ts"],"sourcesContent":["import { makeStyles, Theme } from '@material-ui/core'\n\nimport { iconStaticClassName } from '../Icon'\nimport { TypographyProps } from './TypographyProps'\n\nconst weights = {\n regular: 400,\n medium: 500,\n 'semi-bold': 600,\n bold: 700,\n}\n\nconst getCustomColor = (theme: Theme, color: string) => {\n const isCommonColor = color && ['white', 'black'].includes(color)\n const isGreyColor = color && color.match(/^grey\\.\\d{3}/)\n const isSemanticColor = color && color.match(/(primary|secondary|info|success|error|warning).?(light|dark)?/)\n const isTextColor = color && ['textPrimary', 'textSecondary'].includes(color)\n switch (true) {\n case isCommonColor:\n // @ts-expect-error - todo.\n return theme.palette.common[color]\n case Boolean(isGreyColor):\n const scale = color.split('.')[1]\n // @ts-expect-error - todo.\n return theme.palette.grey[scale] || theme.palette.grey[900]\n case Boolean(isSemanticColor):\n const [paletteKey, variant = 'main'] = color.split('.')\n // @ts-expect-error - todo.\n return theme.palette[paletteKey][variant]\n case isTextColor:\n // @ts-expect-error - todo.\n return theme.palette.text[color.slice(4).toLowerCase()]\n default:\n return undefined\n }\n}\n\ntype StyleProps = Pick<TypographyProps, 'color' | 'weight'> & {\n variant: NonNullable<TypographyProps['variant']>\n}\n\nexport const useTypographyStyles = makeStyles<Theme, StyleProps>((theme) => ({\n root: {\n [`& .${iconStaticClassName}`]: {\n position: 'relative',\n top: '0.125em',\n padding: '0 0.125em',\n boxSizing: 'content-box',\n },\n fontFamily: theme.typography.fontFamily,\n fontWeight: ({ variant, weight }) => (weight ? weights[weight] : theme.typography[variant].fontWeight),\n fontSize: ({ variant }) => theme.typography[variant].fontSize,\n lineHeight: ({ variant }) => theme.typography[variant].lineHeight,\n textTransform: ({ variant }) => theme.typography[variant].textTransform,\n color: ({ color, variant }) => (color && getCustomColor(theme, color)) || theme.typography[variant].color,\n },\n caption: {\n display: 'inline',\n },\n overline: {\n display: 'inline',\n },\n}))\n"],"names":[],"mappings":";;;AAKA,MAAM,OAAO,GAAG;AACd,IAAA,OAAO,EAAE,GAAG;AACZ,IAAA,MAAM,EAAE,GAAG;AACX,IAAA,WAAW,EAAE,GAAG;AAChB,IAAA,IAAI,EAAE,GAAG;CACV;AAED,MAAM,cAA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
+
const collapseState = useState(false);
|
|
6
|
+
const toggle = () => collapseState[0] && setOpen(!open);
|
|
7
7
|
return {
|
|
8
8
|
collapsibleText: {
|
|
9
|
-
open
|
|
10
|
-
collapseState
|
|
9
|
+
open,
|
|
10
|
+
collapseState,
|
|
11
11
|
},
|
|
12
|
-
toggle
|
|
12
|
+
toggle,
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
15
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCollapsibleText.js","sources":["../../../src/hooks/useCollapsibleText.ts"],"sourcesContent":["import { useState } from 'react'\n\ninterface CollapsibleTextHookResult {\n collapsibleText: {\n open: boolean\n collapseState: [boolean, (collapsible: boolean) => void]\n }\n toggle: () => void\n}\n\nexport const useCollapsibleText: () => CollapsibleTextHookResult = () => {\n const [open, setOpen] = useState(false)\n const collapseState = useState(false)\n const toggle = () => collapseState[0] && setOpen(!open)\n return {\n collapsibleText: {\n open,\n collapseState,\n },\n toggle,\n }\n}\n"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"useCollapsibleText.js","sources":["../../../src/hooks/useCollapsibleText.ts"],"sourcesContent":["import { useState } from 'react'\n\ninterface CollapsibleTextHookResult {\n collapsibleText: {\n open: boolean\n collapseState: [boolean, (collapsible: boolean) => void]\n }\n toggle: () => void\n}\n\nexport const useCollapsibleText: () => CollapsibleTextHookResult = () => {\n const [open, setOpen] = useState(false)\n const collapseState = useState(false)\n const toggle = () => collapseState[0] && setOpen(!open)\n return {\n collapsibleText: {\n open,\n collapseState,\n },\n toggle,\n }\n}\n"],"names":[],"mappings":";;AAUO,MAAM,kBAAkB,GAAoC,MAAK;IACtE,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC;AACvC,IAAA,MAAM,aAAa,GAAG,QAAQ,CAAC,KAAK,CAAC;AACrC,IAAA,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,IAAI,CAAC;IACvD,OAAO;AACL,QAAA,eAAe,EAAE;YACf,IAAI;YACJ,aAAa;AACd,SAAA;QACD,MAAM;KACP;AACH;;;;"}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
3
|
+
const useTabs = (options) => {
|
|
4
|
+
const { initialTab } = options;
|
|
5
|
+
const genTabId = (id) => `tab-${id}`.toLowerCase().replace(/ /g, '-');
|
|
6
|
+
const genPanelId = (id) => `tab-panel-${id}`.toLowerCase().replace(/ /g, '-');
|
|
7
|
+
const [activeTab, setActiveTab] = useState(genTabId(initialTab));
|
|
8
|
+
const handleChange = (_, nextTab) => setActiveTab(nextTab);
|
|
9
|
+
const TabsProps = { onChange: handleChange, value: activeTab };
|
|
10
|
+
const useTab = (baseId) => {
|
|
11
|
+
const tabId = genTabId(baseId);
|
|
12
|
+
const tabPanelId = genPanelId(baseId);
|
|
13
|
+
const tabProps = {
|
|
14
14
|
id: tabId,
|
|
15
15
|
label: baseId,
|
|
16
16
|
value: tabId,
|
|
17
17
|
'aria-controls': tabPanelId,
|
|
18
18
|
};
|
|
19
|
-
|
|
19
|
+
const panelProps = {
|
|
20
20
|
id: tabPanelId,
|
|
21
21
|
role: 'tabpanel',
|
|
22
22
|
show: activeTab === tabId,
|
|
@@ -25,9 +25,9 @@ var useTabs = function (options) {
|
|
|
25
25
|
return [tabProps, panelProps];
|
|
26
26
|
};
|
|
27
27
|
return {
|
|
28
|
-
TabsProps
|
|
29
|
-
useTab
|
|
30
|
-
setActiveTab:
|
|
28
|
+
TabsProps,
|
|
29
|
+
useTab,
|
|
30
|
+
setActiveTab: (tabId) => setActiveTab(tabId),
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
33
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTabs.js","sources":["../../../../src/hooks/useTabs/useTabs.ts"],"sourcesContent":["import { SyntheticEvent, useState } from 'react'\nimport { UseTabsOptions } from './useTabsOptions'\nimport { UseTabsResult, UseTabResult } from './useTabsResult'\n\nexport const useTabs = (options: UseTabsOptions): UseTabsResult => {\n const { initialTab } = options\n const genTabId = (id: string) => `tab-${id}`.toLowerCase().replace(/ /g, '-')\n const genPanelId = (id: string) => `tab-panel-${id}`.toLowerCase().replace(/ /g, '-')\n const [activeTab, setActiveTab] = useState(genTabId(initialTab))\n const handleChange = (_: SyntheticEvent, nextTab: string) => setActiveTab(nextTab)\n const TabsProps = { onChange: handleChange, value: activeTab }\n const useTab = (baseId: string) => {\n const tabId = genTabId(baseId)\n const tabPanelId = genPanelId(baseId)\n const tabProps = {\n id: tabId,\n label: baseId,\n value: tabId,\n 'aria-controls': tabPanelId,\n }\n const panelProps = {\n id: tabPanelId,\n role: 'tabpanel',\n show: activeTab === tabId,\n 'aria-labelledby': tabId,\n }\n return [tabProps, panelProps] as UseTabResult\n }\n return {\n TabsProps,\n useTab,\n setActiveTab: (tabId: string) => setActiveTab(tabId),\n }\n}\n"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"useTabs.js","sources":["../../../../src/hooks/useTabs/useTabs.ts"],"sourcesContent":["import { SyntheticEvent, useState } from 'react'\nimport { UseTabsOptions } from './useTabsOptions'\nimport { UseTabsResult, UseTabResult } from './useTabsResult'\n\nexport const useTabs = (options: UseTabsOptions): UseTabsResult => {\n const { initialTab } = options\n const genTabId = (id: string) => `tab-${id}`.toLowerCase().replace(/ /g, '-')\n const genPanelId = (id: string) => `tab-panel-${id}`.toLowerCase().replace(/ /g, '-')\n const [activeTab, setActiveTab] = useState(genTabId(initialTab))\n const handleChange = (_: SyntheticEvent, nextTab: string) => setActiveTab(nextTab)\n const TabsProps = { onChange: handleChange, value: activeTab }\n const useTab = (baseId: string) => {\n const tabId = genTabId(baseId)\n const tabPanelId = genPanelId(baseId)\n const tabProps = {\n id: tabId,\n label: baseId,\n value: tabId,\n 'aria-controls': tabPanelId,\n }\n const panelProps = {\n id: tabPanelId,\n role: 'tabpanel',\n show: activeTab === tabId,\n 'aria-labelledby': tabId,\n }\n return [tabProps, panelProps] as UseTabResult\n }\n return {\n TabsProps,\n useTab,\n setActiveTab: (tabId: string) => setActiveTab(tabId),\n }\n}\n"],"names":[],"mappings":";;AAIa,MAAA,OAAO,GAAG,CAAC,OAAuB,KAAmB;AAChE,IAAA,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO;IAC9B,MAAM,QAAQ,GAAG,CAAC,EAAU,KAAK,OAAO,EAAE,CAAA,CAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;IAC7E,MAAM,UAAU,GAAG,CAAC,EAAU,KAAK,aAAa,EAAE,CAAA,CAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;AACrF,IAAA,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;AAChE,IAAA,MAAM,YAAY,GAAG,CAAC,CAAiB,EAAE,OAAe,KAAK,YAAY,CAAC,OAAO,CAAC;IAClF,MAAM,SAAS,GAAG,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,SAAS,EAAE;AAC9D,IAAA,MAAM,MAAM,GAAG,CAAC,MAAc,KAAI;AAChC,QAAA,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC;AAC9B,QAAA,MAAM,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC;AACrC,QAAA,MAAM,QAAQ,GAAG;AACf,YAAA,EAAE,EAAE,KAAK;AACT,YAAA,KAAK,EAAE,MAAM;AACb,YAAA,KAAK,EAAE,KAAK;AACZ,YAAA,eAAe,EAAE,UAAU;SAC5B;AACD,QAAA,MAAM,UAAU,GAAG;AACjB,YAAA,EAAE,EAAE,UAAU;AACd,YAAA,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,SAAS,KAAK,KAAK;AACzB,YAAA,iBAAiB,EAAE,KAAK;SACzB;AACD,QAAA,OAAO,CAAC,QAAQ,EAAE,UAAU,CAAiB;AAC/C,KAAC;IACD,OAAO;QACL,SAAS;QACT,MAAM;QACN,YAAY,EAAE,CAAC,KAAa,KAAK,YAAY,CAAC,KAAK,CAAC;KACrD;AACH;;;;"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
type PreConfiguredTabProps = {
|
|
2
2
|
id: string;
|
|
3
3
|
label: string;
|
|
4
4
|
value: string;
|
|
5
5
|
'aria-controls': string;
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
type PreConfiguredPanelProps = {
|
|
8
8
|
id: string;
|
|
9
9
|
role: string;
|
|
10
10
|
show: boolean;
|
|
11
11
|
'aria-labelledby': string;
|
|
12
12
|
};
|
|
13
|
-
export
|
|
13
|
+
export type UseTabResult = [PreConfiguredTabProps, PreConfiguredPanelProps];
|
|
14
14
|
export interface UseTabsResult {
|
|
15
15
|
TabsProps: {
|
|
16
16
|
onChange: (event: any, value: string) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export type ThemeColors = 'primary' | 'secondary' | 'inherit';
|
|
2
|
+
export type SeverityColors = 'info' | 'error' | 'warning' | 'success';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@popmenu/common-ui",
|
|
3
|
-
"version": "0.127.
|
|
3
|
+
"version": "0.127.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Popmenu Design System Team",
|
|
6
6
|
"description": "React components for all Popmenu apps on the web.",
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
"react": "17.x"
|
|
31
31
|
},
|
|
32
32
|
"sideEffects": false,
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "242ebcb202433c083d77f6691b8ca8116900b72e"
|
|
34
34
|
}
|