@bigbluebutton/bbb-ui-components-react 0.5.0 → 0.7.0
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/README.md +38 -10
- package/dist/components/Accordion.js +57 -1
- package/dist/components/Button.js +144 -1
- package/dist/components/Checkbox.js +20 -1
- package/dist/components/Divider.js +9 -1
- package/dist/components/Hint.js +51 -1
- package/dist/components/Input.js +220 -0
- package/dist/components/Modal.js +222 -1
- package/dist/components/Navigation.js +74 -1
- package/dist/components/ScrollArea.js +42 -0
- package/dist/components/Search.js +130 -1
- package/dist/components/Select.js +46 -1
- package/dist/components/Spinner.js +34 -1
- package/dist/components/TextAreaInput.js +28 -1
- package/dist/components/TextInput.js +52 -1
- package/dist/components/Toggle.js +42 -1
- package/dist/components/Typography.js +42 -1
- package/dist/components/colors.js +1 -0
- package/dist/components/index.js +789 -1
- package/dist/esm/components/Accordion/component.js +8 -9
- package/dist/esm/components/Accordion/constants.js +10 -4
- package/dist/esm/components/Accordion/styles.js +63 -17
- package/dist/esm/components/Button/component.js +52 -35
- package/dist/esm/components/Button/constants.js +21 -20
- package/dist/esm/components/Button/styles.js +187 -45
- package/dist/esm/components/Checkbox/component.js +3 -14
- package/dist/esm/components/Checkbox/constants.js +3 -3
- package/dist/esm/components/Checkbox/styles.js +23 -9
- package/dist/esm/components/Divider/styles.js +10 -7
- package/dist/esm/components/Hint/component.js +16 -16
- package/dist/esm/components/Hint/constants.js +3 -3
- package/dist/esm/components/Hint/styles.js +58 -13
- package/dist/esm/components/Input/component.js +111 -0
- package/dist/esm/components/Input/index.js +1 -0
- package/dist/esm/components/Input/styles.js +89 -0
- package/dist/esm/components/Input/types.js +1 -0
- package/dist/esm/components/Modal/component.js +8 -19
- package/dist/esm/components/Modal/styles.js +42 -20
- package/dist/esm/components/Navigation/component.js +3 -4
- package/dist/esm/components/Navigation/styles.js +36 -12
- package/dist/esm/components/ScrollArea/component.js +15 -0
- package/dist/esm/components/ScrollArea/constants.js +3 -0
- package/dist/esm/components/ScrollArea/index.js +1 -0
- package/dist/esm/components/ScrollArea/styles.js +69 -0
- package/dist/esm/components/ScrollArea/types.js +1 -0
- package/dist/esm/components/Search/component.js +16 -17
- package/dist/esm/components/Search/styles.js +103 -14
- package/dist/esm/components/Select/component.js +5 -16
- package/dist/esm/components/Select/styles.js +51 -11
- package/dist/esm/components/Spinner/component.js +1 -2
- package/dist/esm/components/Spinner/styles.js +39 -29
- package/dist/esm/components/TextAreaInput/component.js +4 -15
- package/dist/esm/components/TextAreaInput/styles.js +29 -7
- package/dist/esm/components/TextInput/component.js +2 -13
- package/dist/esm/components/TextInput/styles.js +58 -16
- package/dist/esm/components/Toggle/component.js +6 -17
- package/dist/esm/components/Toggle/constants.js +3 -3
- package/dist/esm/components/Toggle/styles.js +88 -72
- package/dist/esm/components/Typography/component.js +3 -14
- package/dist/esm/components/Typography/constants.js +1 -1
- package/dist/esm/components/Typography/styles.js +50 -17
- package/dist/esm/components/index.js +2 -0
- package/dist/esm/index.js +2 -1
- package/dist/esm/stylesheets/colors.js +57 -0
- package/dist/esm/stylesheets/palette.js +55 -0
- package/dist/esm/stylesheets/sizing.js +9 -9
- package/dist/esm/stylesheets/typography.js +7 -7
- package/dist/types/components/Accordion/component.d.ts +1 -1
- package/dist/types/components/Accordion/constants.d.ts +7 -1
- package/dist/types/components/Accordion/styles.d.ts +2 -1
- package/dist/types/components/Accordion/types.d.ts +15 -1
- package/dist/types/components/Button/constants.d.ts +3 -2
- package/dist/types/components/Button/styles.d.ts +1 -0
- package/dist/types/components/Button/type.d.ts +42 -1
- package/dist/types/components/Checkbox/types.d.ts +4 -0
- package/dist/types/components/Hint/component.d.ts +2 -1
- package/dist/types/components/Hint/types.d.ts +9 -0
- package/dist/types/components/Input/component.d.ts +12 -0
- package/dist/types/components/Input/index.d.ts +1 -0
- package/dist/types/components/Input/styles.d.ts +6 -0
- package/dist/types/components/Input/types.d.ts +69 -0
- package/dist/types/components/Modal/types.d.ts +11 -0
- package/dist/types/components/Navigation/types.d.ts +9 -0
- package/dist/types/components/ScrollArea/component.d.ts +11 -0
- package/dist/types/components/ScrollArea/constants.d.ts +3 -0
- package/dist/types/components/ScrollArea/index.d.ts +1 -0
- package/dist/types/components/ScrollArea/styles.d.ts +2 -0
- package/dist/types/components/ScrollArea/types.d.ts +37 -0
- package/dist/types/components/Search/types.d.ts +6 -24
- package/dist/types/components/Select/types.d.ts +4 -0
- package/dist/types/components/Spinner/types.d.ts +3 -0
- package/dist/types/components/TextAreaInput/types.d.ts +7 -0
- package/dist/types/components/TextInput/types.d.ts +3 -0
- package/dist/types/components/Toggle/types.d.ts +6 -0
- package/dist/types/components/Typography/types.d.ts +3 -0
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/stylesheets/colors.d.ts +57 -0
- package/dist/types/stylesheets/{pallete.d.ts → palette.d.ts} +13 -9
- package/package.json +35 -2
- package/dist/esm/stylesheets/pallete.js +0 -46
|
@@ -1,20 +1,62 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
1
|
import styled, { css } from 'styled-components';
|
|
6
2
|
import { TextField } from '@mui/material';
|
|
7
|
-
import { colorBorderDefault, colorBorderSelected, colorTextDefault, colorTextLight, colorBorderError, colorError, } from '../../stylesheets/
|
|
3
|
+
import { colorBorderDefault, colorBorderSelected, colorTextDefault, colorTextLight, colorBorderError, colorError, } from '../../stylesheets/palette';
|
|
8
4
|
import { fontSizeSmall } from '../../stylesheets/typography';
|
|
9
5
|
import { borderRadiusDefault, spacingMedium, spacingSmall } from '../../stylesheets/sizing';
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
6
|
+
export const StyledTextField = styled(TextField) `
|
|
7
|
+
.MuiInputBase-root {
|
|
8
|
+
display: flex;
|
|
9
|
+
padding: ${spacingMedium};
|
|
10
|
+
align-items: center;
|
|
11
|
+
gap: ${spacingSmall};
|
|
12
|
+
align-self: stretch;
|
|
13
|
+
border-radius: ${borderRadiusDefault};
|
|
14
|
+
border: 1px solid ${colorBorderDefault};
|
|
15
|
+
color: ${colorTextLight};
|
|
16
|
+
|
|
17
|
+
&.Mui-focused {
|
|
18
|
+
border-color: ${colorBorderSelected};
|
|
19
|
+
color: ${colorTextDefault};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
${({ $error }) => $error &&
|
|
23
|
+
css `
|
|
24
|
+
border-color: ${colorBorderError};
|
|
25
|
+
`}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.MuiInputBase-input {
|
|
29
|
+
padding: 0;
|
|
30
|
+
height: auto;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.MuiOutlinedInput-notchedOutline {
|
|
34
|
+
border: none;
|
|
35
|
+
}
|
|
36
|
+
`;
|
|
37
|
+
export const Label = styled.div `
|
|
38
|
+
color: ${colorTextDefault};
|
|
39
|
+
font-size: ${fontSizeSmall};
|
|
40
|
+
font-style: normal;
|
|
41
|
+
font-weight: 400;
|
|
42
|
+
line-height: normal;
|
|
43
|
+
`;
|
|
44
|
+
export const HelperText = styled.div `
|
|
45
|
+
color: ${colorTextDefault};
|
|
46
|
+
font-size: ${fontSizeSmall};
|
|
47
|
+
font-style: normal;
|
|
48
|
+
font-weight: 400;
|
|
49
|
+
line-height: normal;
|
|
50
|
+
padding: 0 ${spacingMedium};
|
|
51
|
+
|
|
52
|
+
${({ $error }) => $error &&
|
|
53
|
+
css `
|
|
54
|
+
color: ${colorError};
|
|
55
|
+
`}
|
|
56
|
+
`;
|
|
57
|
+
export const Container = styled.div `
|
|
58
|
+
display: flex;
|
|
59
|
+
flex-direction: column;
|
|
60
|
+
width: 100%;
|
|
61
|
+
gap: ${spacingSmall};
|
|
62
|
+
`;
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
1
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
2
|
var t = {};
|
|
14
3
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -31,16 +20,16 @@ import { DEFAULT_TEXT_POSITION } from './constants';
|
|
|
31
20
|
*
|
|
32
21
|
*/
|
|
33
22
|
function Toggle(_a) {
|
|
34
|
-
var
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
23
|
+
var { label, helperText, textPosition = DEFAULT_TEXT_POSITION, onChange, ariaLabel, ariaLabelledBy, ariaDescribedBy, id: providedId } = _a, rest = __rest(_a, ["label", "helperText", "textPosition", "onChange", "ariaLabel", "ariaLabelledBy", "ariaDescribedBy", "id"]);
|
|
24
|
+
const generatedUniqueId = useId();
|
|
25
|
+
const id = providedId !== null && providedId !== void 0 ? providedId : generatedUniqueId;
|
|
26
|
+
const labelId = label ? `${id}-label` : undefined;
|
|
27
|
+
const helperTextId = helperText ? `${id}-helper` : undefined;
|
|
39
28
|
return (React.createElement(Styled.ToggleWrapper, { "$textPosition": textPosition },
|
|
40
29
|
(label || helperText) && (React.createElement(Styled.TextWrapper, { "$textPosition": textPosition, htmlFor: id, "$hasLabel": !!label, "$hasHelperText": !!helperText },
|
|
41
30
|
label && React.createElement(Styled.Title, { id: labelId }, label),
|
|
42
31
|
helperText && React.createElement(Styled.HelperText, { id: helperTextId }, helperText))),
|
|
43
32
|
React.createElement(Styled.ToggleSwitchWrapper, null,
|
|
44
|
-
React.createElement(Styled.MaterialToggle,
|
|
33
|
+
React.createElement(Styled.MaterialToggle, Object.assign({}, rest, { id: id, onChange: onChange, "aria-label": ariaLabel, "aria-labelledby": ariaLabel ? undefined : ariaLabelledBy || labelId, "aria-describedby": ariaDescribedBy || helperTextId })))));
|
|
45
34
|
}
|
|
46
35
|
export default Toggle;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export
|
|
1
|
+
export const TEXT_POSITIONS = {
|
|
2
2
|
RIGHT: 'right',
|
|
3
3
|
LEFT: 'left',
|
|
4
4
|
TOP: 'top',
|
|
5
5
|
BOTTOM: 'bottom',
|
|
6
6
|
};
|
|
7
|
-
export
|
|
8
|
-
export
|
|
7
|
+
export const TEXT_POSITIONS_VALUES = Object.values(TEXT_POSITIONS);
|
|
8
|
+
export const DEFAULT_TEXT_POSITION = TEXT_POSITIONS_VALUES[0];
|
|
@@ -1,91 +1,107 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
var __assign = (this && this.__assign) || function () {
|
|
6
|
-
__assign = Object.assign || function(t) {
|
|
7
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
-
s = arguments[i];
|
|
9
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
-
t[p] = s[p];
|
|
11
|
-
}
|
|
12
|
-
return t;
|
|
13
|
-
};
|
|
14
|
-
return __assign.apply(this, arguments);
|
|
15
|
-
};
|
|
16
1
|
import { Switch } from '@mui/material';
|
|
17
2
|
import { styled as materialStyled } from '@mui/material/styles';
|
|
18
3
|
import styled, { css } from 'styled-components';
|
|
19
|
-
import { colorBrand1, colorIconDefault, colorTextDefault, colorTextLight, colorWhite } from '../../stylesheets/
|
|
4
|
+
import { colorBrand1, colorIconDefault, colorTextDefault, colorTextLight, colorWhite, colorShadowDefault, colorIconDefaultDark, } from '../../stylesheets/palette';
|
|
20
5
|
import { TEXT_POSITIONS } from './constants';
|
|
21
6
|
import { fontSizeBig, fontSizeDefault } from '../../stylesheets/typography';
|
|
22
|
-
export
|
|
23
|
-
|
|
7
|
+
export const ToggleWrapper = styled.div `
|
|
8
|
+
display: flex;
|
|
9
|
+
${({ $textPosition }) => {
|
|
24
10
|
if ($textPosition === TEXT_POSITIONS.TOP || $textPosition === TEXT_POSITIONS.BOTTOM) {
|
|
25
|
-
return css
|
|
11
|
+
return css `
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
gap: .1rem;
|
|
14
|
+
`;
|
|
26
15
|
}
|
|
27
|
-
|
|
16
|
+
const horizontalStyles = css `
|
|
17
|
+
flex-direction: row;
|
|
18
|
+
gap: 1rem;
|
|
19
|
+
`;
|
|
28
20
|
if ($textPosition === TEXT_POSITIONS.LEFT) {
|
|
29
|
-
return css
|
|
21
|
+
return css `
|
|
22
|
+
${horizontalStyles}
|
|
23
|
+
justify-content: end;
|
|
24
|
+
`;
|
|
30
25
|
}
|
|
31
26
|
return horizontalStyles;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export
|
|
35
|
-
|
|
27
|
+
}};
|
|
28
|
+
`;
|
|
29
|
+
export const ToggleSwitchWrapper = styled.div `
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: row;
|
|
32
|
+
align-items: start;
|
|
33
|
+
justify-content: center;
|
|
34
|
+
padding: 0.3rem 0px;
|
|
35
|
+
`;
|
|
36
|
+
export const TextWrapper = styled.label `
|
|
37
|
+
display: flex;
|
|
38
|
+
flex-direction: column;
|
|
39
|
+
order: ${({ $textPosition }) => {
|
|
36
40
|
if ($textPosition === TEXT_POSITIONS.LEFT || $textPosition === TEXT_POSITIONS.TOP) {
|
|
37
41
|
return -1;
|
|
38
42
|
}
|
|
39
43
|
return 1;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
var $textPosition = _a.$textPosition;
|
|
44
|
+
}};
|
|
45
|
+
cursor: pointer;
|
|
46
|
+
${({ $hasLabel, $hasHelperText }) => (!$hasLabel || !$hasHelperText) && `justify-content: center;`}
|
|
47
|
+
${({ $textPosition }) => {
|
|
45
48
|
if ($textPosition === TEXT_POSITIONS.TOP || $textPosition === TEXT_POSITIONS.BOTTOM) {
|
|
46
|
-
return css
|
|
49
|
+
return css `
|
|
50
|
+
align-items: center;
|
|
51
|
+
`;
|
|
47
52
|
}
|
|
48
53
|
if ($textPosition === TEXT_POSITIONS.LEFT)
|
|
49
|
-
return css
|
|
50
|
-
return css
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
54
|
+
return css `align-items: end;`;
|
|
55
|
+
return css `
|
|
56
|
+
align-items: start;
|
|
57
|
+
`;
|
|
58
|
+
}};
|
|
59
|
+
`;
|
|
60
|
+
export const Title = styled.span `
|
|
61
|
+
color: ${colorTextDefault};
|
|
62
|
+
font-size: ${fontSizeBig};
|
|
63
|
+
font-style: normal;
|
|
64
|
+
font-weight: 400;
|
|
65
|
+
line-height: normal;
|
|
66
|
+
`;
|
|
67
|
+
export const HelperText = styled.span `
|
|
68
|
+
color: ${colorTextLight};
|
|
69
|
+
font-size: ${fontSizeDefault};
|
|
70
|
+
font-style: normal;
|
|
71
|
+
font-weight: 400;
|
|
72
|
+
line-height: normal;
|
|
73
|
+
`;
|
|
74
|
+
export const MaterialToggle = materialStyled(Switch)(({ theme }) => ({
|
|
75
|
+
width: '2.3rem',
|
|
76
|
+
height: '1.2rem',
|
|
77
|
+
padding: 0,
|
|
78
|
+
display: 'flex',
|
|
79
|
+
'&:active': {
|
|
80
|
+
'& .MuiSwitch-switchBase.Mui-checked': {
|
|
81
|
+
transform: 'translateX(1.2rem)',
|
|
65
82
|
},
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
},
|
|
83
|
+
},
|
|
84
|
+
'& .MuiSwitch-switchBase': {
|
|
85
|
+
padding: '0.2rem',
|
|
86
|
+
'&.Mui-checked': {
|
|
87
|
+
transform: 'translateX(1.2rem)',
|
|
88
|
+
color: colorWhite,
|
|
89
|
+
'& + .MuiSwitch-track': Object.assign({ opacity: 1, backgroundColor: colorBrand1 }, theme.applyStyles('dark', {
|
|
90
|
+
backgroundColor: colorBrand1,
|
|
91
|
+
})),
|
|
75
92
|
},
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
})
|
|
90
|
-
});
|
|
91
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11;
|
|
93
|
+
},
|
|
94
|
+
'& .MuiSwitch-thumb': {
|
|
95
|
+
boxShadow: `0 2px 4px 0 ${colorShadowDefault}`,
|
|
96
|
+
width: '0.6rem',
|
|
97
|
+
height: '0.6rem',
|
|
98
|
+
borderRadius: '0.5rem',
|
|
99
|
+
transition: theme.transitions.create(['width'], {
|
|
100
|
+
duration: 200,
|
|
101
|
+
}),
|
|
102
|
+
transform: 'translateY(1px)',
|
|
103
|
+
},
|
|
104
|
+
'& .MuiSwitch-track': Object.assign({ borderRadius: '0.6rem', opacity: 1, backgroundColor: colorIconDefault, boxSizing: 'border-box' }, theme.applyStyles('dark', {
|
|
105
|
+
backgroundColor: colorIconDefaultDark,
|
|
106
|
+
})),
|
|
107
|
+
}));
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
1
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
2
|
var t = {};
|
|
14
3
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -29,8 +18,8 @@ import { TypographyStyled } from './styles';
|
|
|
29
18
|
* and allows overriding the rendered HTML element via the `as` prop.
|
|
30
19
|
*
|
|
31
20
|
*/
|
|
32
|
-
|
|
33
|
-
var
|
|
34
|
-
return (React.createElement(TypographyStyled,
|
|
21
|
+
const Typography = (_a) => {
|
|
22
|
+
var { children, variant = 'default', as } = _a, props = __rest(_a, ["children", "variant", "as"]);
|
|
23
|
+
return (React.createElement(TypographyStyled, Object.assign({ as: as, "$variant": variant }, props), children));
|
|
35
24
|
};
|
|
36
25
|
export default Typography;
|
|
@@ -1,20 +1,53 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
1
|
import styled, { css } from 'styled-components';
|
|
6
|
-
import { colorTextDefault, colorTextLight } from '../../stylesheets/
|
|
2
|
+
import { colorTextDefault, colorTextLight } from '../../stylesheets/palette';
|
|
7
3
|
import { fontSizeDefault, fontSizeSmall, fontSizeXSmall, fontWeightDefault, fontWeightHard, fontWeightLight, } from '../../stylesheets/typography';
|
|
8
|
-
|
|
9
|
-
default: css
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
4
|
+
const variants = {
|
|
5
|
+
default: css `
|
|
6
|
+
color: ${colorTextDefault};
|
|
7
|
+
font-size: ${fontSizeDefault};
|
|
8
|
+
font-style: normal;
|
|
9
|
+
font-weight: ${fontWeightLight};
|
|
10
|
+
line-height: normal;
|
|
11
|
+
`,
|
|
12
|
+
selected: css `
|
|
13
|
+
color: ${colorTextDefault};
|
|
14
|
+
font-size: ${fontSizeDefault};
|
|
15
|
+
font-style: normal;
|
|
16
|
+
font-weight: ${fontWeightHard};
|
|
17
|
+
line-height: normal;
|
|
18
|
+
`,
|
|
19
|
+
text2: css `
|
|
20
|
+
color: ${colorTextLight};
|
|
21
|
+
font-size: ${fontSizeSmall};
|
|
22
|
+
font-style: normal;
|
|
23
|
+
font-weight: ${fontWeightLight};
|
|
24
|
+
line-height: normal;
|
|
25
|
+
`,
|
|
26
|
+
text3: css `
|
|
27
|
+
color: ${colorTextLight};
|
|
28
|
+
font-size: ${fontSizeXSmall};
|
|
29
|
+
font-style: normal;
|
|
30
|
+
font-weight: ${fontWeightLight};
|
|
31
|
+
line-height: normal;
|
|
32
|
+
`,
|
|
33
|
+
header: css `
|
|
34
|
+
color: ${colorTextDefault};
|
|
35
|
+
font-size: ${fontSizeDefault};
|
|
36
|
+
font-style: normal;
|
|
37
|
+
font-weight: ${fontWeightHard};
|
|
38
|
+
line-height: normal;
|
|
39
|
+
text-transform: uppercase;
|
|
40
|
+
`,
|
|
41
|
+
button: css `
|
|
42
|
+
color: ${colorTextDefault};
|
|
43
|
+
font-size: ${fontSizeDefault};
|
|
44
|
+
font-style: normal;
|
|
45
|
+
font-weight: ${fontWeightDefault};
|
|
46
|
+
line-height: normal;
|
|
47
|
+
`,
|
|
15
48
|
};
|
|
16
|
-
export
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
})
|
|
20
|
-
|
|
49
|
+
export const TypographyStyled = styled.p `
|
|
50
|
+
margin: 0;
|
|
51
|
+
padding: 0;
|
|
52
|
+
${({ $variant }) => variants[$variant]}
|
|
53
|
+
`;
|
|
@@ -3,8 +3,10 @@ export { BBButton } from './Button';
|
|
|
3
3
|
export { BBBCheckbox } from './Checkbox';
|
|
4
4
|
export { BBBDivider } from './Divider';
|
|
5
5
|
export { BBBHint } from './Hint';
|
|
6
|
+
export { BBBInput } from './Input';
|
|
6
7
|
export { BBBModal } from './Modal';
|
|
7
8
|
export { BBBNavigation } from './Navigation';
|
|
9
|
+
export { BBBScrollArea } from './ScrollArea';
|
|
8
10
|
export { BBBSearch } from './Search';
|
|
9
11
|
export { BBBSelect } from './Select';
|
|
10
12
|
export { BBBSpinner } from './Spinner';
|
package/dist/esm/index.js
CHANGED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { colorNeutral2, colorNeutral3, colorNeutral4, colorWhite, colorLightGray, colorGray, colorDarkGray, colorBrand1, colorBrand2, colorBrand3, colorBrandLight, colorBrandAux, colorSuccess, colorWarning, colorError, colorErrorDark, colorBackgroundWhite, colorBackgroundLight, colorBackgroundBlue, colorBorderDefault, colorBorderSelected, colorBorderError, colorBorderFocusRing, colorTextDefault, colorTextLight, colorIconDefault, colorIconBlue, colorIconWhite, colorIconDefaultDark, colorHoverDark, colorHoverLight, colorHoverNeutral, colorOverlay, colorShadowDefault, } from './palette';
|
|
2
|
+
export const colors = {
|
|
3
|
+
neutral: {
|
|
4
|
+
neutral2: colorNeutral2,
|
|
5
|
+
neutral3: colorNeutral3,
|
|
6
|
+
neutral4: colorNeutral4,
|
|
7
|
+
white: colorWhite,
|
|
8
|
+
lightGray: colorLightGray,
|
|
9
|
+
gray: colorGray,
|
|
10
|
+
darkGray: colorDarkGray,
|
|
11
|
+
},
|
|
12
|
+
brand: {
|
|
13
|
+
brand1: colorBrand1,
|
|
14
|
+
brand2: colorBrand2,
|
|
15
|
+
brand3: colorBrand3,
|
|
16
|
+
light: colorBrandLight,
|
|
17
|
+
aux: colorBrandAux,
|
|
18
|
+
},
|
|
19
|
+
semantic: {
|
|
20
|
+
success: colorSuccess,
|
|
21
|
+
warning: colorWarning,
|
|
22
|
+
error: colorError,
|
|
23
|
+
errorDark: colorErrorDark,
|
|
24
|
+
},
|
|
25
|
+
background: {
|
|
26
|
+
white: colorBackgroundWhite,
|
|
27
|
+
light: colorBackgroundLight,
|
|
28
|
+
blue: colorBackgroundBlue,
|
|
29
|
+
},
|
|
30
|
+
border: {
|
|
31
|
+
default: colorBorderDefault,
|
|
32
|
+
selected: colorBorderSelected,
|
|
33
|
+
error: colorBorderError,
|
|
34
|
+
focusRing: colorBorderFocusRing,
|
|
35
|
+
},
|
|
36
|
+
text: {
|
|
37
|
+
default: colorTextDefault,
|
|
38
|
+
light: colorTextLight,
|
|
39
|
+
},
|
|
40
|
+
icon: {
|
|
41
|
+
default: colorIconDefault,
|
|
42
|
+
blue: colorIconBlue,
|
|
43
|
+
white: colorIconWhite,
|
|
44
|
+
defaultDark: colorIconDefaultDark,
|
|
45
|
+
},
|
|
46
|
+
hover: {
|
|
47
|
+
dark: colorHoverDark,
|
|
48
|
+
light: colorHoverLight,
|
|
49
|
+
neutral: colorHoverNeutral,
|
|
50
|
+
},
|
|
51
|
+
overlay: {
|
|
52
|
+
default: colorOverlay,
|
|
53
|
+
},
|
|
54
|
+
shadow: {
|
|
55
|
+
default: colorShadowDefault,
|
|
56
|
+
},
|
|
57
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// Neutral colors
|
|
2
|
+
export const colorNeutral2 = 'var(--color-neutral-2, #717C91)';
|
|
3
|
+
export const colorNeutral3 = 'var(--color-neutral-3, #B0BDC9)';
|
|
4
|
+
export const colorNeutral4 = 'var(--color-neutral-4, #DCE4EC)';
|
|
5
|
+
export const colorWhite = 'var(--color-neutral-white, #FFFFFF)';
|
|
6
|
+
export const colorLightGray = 'var(--color-light-gray, #F4F6FA)';
|
|
7
|
+
export const colorGray = 'var(--color-gray, #4E5A66)';
|
|
8
|
+
export const colorDarkGray = 'var(--color-dark-gray, #393C48)';
|
|
9
|
+
// Brand colors
|
|
10
|
+
// Last-resort fallbacks mirror bigbluebutton-html5's palette so that a client
|
|
11
|
+
// which doesn't override --color-primary renders library components with the
|
|
12
|
+
// same brand color as its own (non-library) components.
|
|
13
|
+
const colorBrand1_base = 'var(--color-brand-1, #0F70D7)';
|
|
14
|
+
const colorBrandLight_base = 'var(--color-brand-light, #E5EFFB)';
|
|
15
|
+
export const colorBrand1 = `var(--color-primary, ${colorBrand1_base})`;
|
|
16
|
+
export const colorBrand2 = `var(--color-brand-2, ${colorBrand1_base})`;
|
|
17
|
+
export const colorBrand3 = `var(--color-brand-3, ${colorBrand1_base})`;
|
|
18
|
+
// Mapped to core css vars
|
|
19
|
+
export const colorBrandLight = `var(--color-blue-aux, ${colorBrandLight_base})`;
|
|
20
|
+
export const colorBrandAux = `var(--color-brand-aux, ${colorBrandLight_base})`;
|
|
21
|
+
// Semantic colors
|
|
22
|
+
const colorError_base = 'var(--color-error, #DF2721)';
|
|
23
|
+
const colorErrorDark_base = 'var(--color-error-dark, #AE1010)';
|
|
24
|
+
export const colorSuccess = 'var(--color-success, #2DD36F)';
|
|
25
|
+
export const colorWarning = 'var(--color-warning, #F59240)';
|
|
26
|
+
// Mapped to core css vars
|
|
27
|
+
export const colorError = `var(--color-danger, ${colorError_base})`;
|
|
28
|
+
export const colorErrorDark = `var(--color-danger-dark, ${colorErrorDark_base})`;
|
|
29
|
+
// Background colors
|
|
30
|
+
export const colorBackgroundWhite = `var(--color-background-white, ${colorWhite})`;
|
|
31
|
+
export const colorBackgroundLight = `var(--color-background-light, ${colorLightGray})`;
|
|
32
|
+
export const colorBackgroundBlue = `var(--color-background-blue, ${colorBrandLight_base})`;
|
|
33
|
+
// Border colors
|
|
34
|
+
const colorBorderDefault_base = `var(--color-border-default, ${colorNeutral3})`;
|
|
35
|
+
export const colorBorderSelected = `var(--color-border-selected, ${colorBrand1_base})`;
|
|
36
|
+
export const colorBorderError = `var(--color-border-error, ${colorError_base})`;
|
|
37
|
+
// Mapped to core css vars
|
|
38
|
+
export const colorBorderDefault = `var(--default-border, ${colorBorderDefault_base})`;
|
|
39
|
+
export const colorBorderFocusRing = 'var(--color-border-focus-ring, rgba(29, 101, 212, 0.15))';
|
|
40
|
+
// Text colors
|
|
41
|
+
export const colorTextDefault = `var(--color-text-default, ${colorDarkGray})`;
|
|
42
|
+
export const colorTextLight = `var(--color-text-light, ${colorNeutral2})`;
|
|
43
|
+
//Icon colors
|
|
44
|
+
export const colorIconDefault = `var(--color-icon-default, ${colorNeutral2})`;
|
|
45
|
+
export const colorIconBlue = `var(--color-icon-blue, ${colorBrand1_base})`;
|
|
46
|
+
export const colorIconWhite = `var(--color-icon-white, ${colorWhite})`;
|
|
47
|
+
export const colorIconDefaultDark = 'var(--color-icon-default-dark, rgba(255, 255, 255, 0.35))';
|
|
48
|
+
//Hover colors
|
|
49
|
+
export const colorHoverDark = 'var(--color-hover-dark, #0C57A7)';
|
|
50
|
+
export const colorHoverLight = 'var(--color-hover-light, #D4E5FA)';
|
|
51
|
+
export const colorHoverNeutral = `var(--color-hover-neutral, ${colorNeutral4})`;
|
|
52
|
+
//Overlay colors
|
|
53
|
+
export const colorOverlay = 'var(--color-overlay, rgba(0, 0, 0, 0.75))';
|
|
54
|
+
//Shadow colors
|
|
55
|
+
export const colorShadowDefault = 'var(--color-shadow-default, rgb(0 35 11 / 20%))';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// Comments are based on default font-size being 16px
|
|
2
2
|
// Spacing
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
3
|
+
export const spacingXSmall = '0.25rem'; //4px
|
|
4
|
+
export const spacingSmall = '0.5rem'; // 8px
|
|
5
|
+
export const spacingSmallMedium = '0.75rem'; // 12px
|
|
6
|
+
export const spacingMedium = '1rem'; // 16px
|
|
7
|
+
export const spacingMediumLarge = '1.25rem'; // 20px
|
|
8
|
+
export const spacingLarge = '1.5rem'; // 24px
|
|
9
|
+
export const spacingXLarge = '2rem'; // 32px
|
|
10
10
|
// Border sizes
|
|
11
|
-
export
|
|
12
|
-
export
|
|
11
|
+
export const borderRadiusDefault = '1rem'; //16px
|
|
12
|
+
export const borderRadiusSmall = '0.5rem'; //8px
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Comments are based on default font-size being 16px
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
2
|
+
export const fontSizeXSmall = '0.75rem'; //12px
|
|
3
|
+
export const fontSizeSmall = '0.875rem'; //14px
|
|
4
|
+
export const fontSizeDefault = '1rem'; //16px
|
|
5
|
+
export const fontSizeBig = '1.125rem'; //18px
|
|
6
|
+
export const fontWeightHard = '700';
|
|
7
|
+
export const fontWeightDefault = '600';
|
|
8
|
+
export const fontWeightLight = '400';
|
|
@@ -8,5 +8,5 @@ import 'tippy.js/dist/tippy.css';
|
|
|
8
8
|
* with a smooth animation. It also supports an optional tooltip on the header.
|
|
9
9
|
*
|
|
10
10
|
*/
|
|
11
|
-
declare function Accordion({ title, tooltipLabel, tooltipPlacement, ariaLabel, ariaLabelledBy, ariaDescribedBy, buttonHeader, children, }: AccordionProps): JSX.Element;
|
|
11
|
+
declare function Accordion({ title, tooltipLabel, tooltipPlacement, ariaLabel, ariaLabelledBy, ariaDescribedBy, buttonHeader, buttonHeaderPosition, children, }: AccordionProps): JSX.Element;
|
|
12
12
|
export default Accordion;
|
|
@@ -6,4 +6,10 @@ declare const TOOLTIP_PLACEMENTS: {
|
|
|
6
6
|
};
|
|
7
7
|
declare const TOOLTIP_PLACEMENT_VALUES: ("top" | "bottom" | "left" | "right")[];
|
|
8
8
|
declare const DEFAULT_TOOLTIP_PLACEMENT: "top";
|
|
9
|
-
|
|
9
|
+
declare const BUTTON_HEADER_POSITIONS: {
|
|
10
|
+
readonly LEFT: "left";
|
|
11
|
+
readonly RIGHT: "right";
|
|
12
|
+
};
|
|
13
|
+
declare const BUTTON_HEADER_POSITION_VALUES: ("left" | "right")[];
|
|
14
|
+
declare const DEFAULT_BUTTON_HEADER_POSITION: "left";
|
|
15
|
+
export { TOOLTIP_PLACEMENTS, TOOLTIP_PLACEMENT_VALUES, DEFAULT_TOOLTIP_PLACEMENT, BUTTON_HEADER_POSITIONS, BUTTON_HEADER_POSITION_VALUES, DEFAULT_BUTTON_HEADER_POSITION, };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { StyledAccordionContent, StyledExpandIcon } from './types';
|
|
1
|
+
import { StyledAccordionContent, StyledExpandIcon, StyledButtonHeaderWrapper } from './types';
|
|
2
2
|
export declare const ExpandButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
|
|
3
3
|
export declare const ButtonContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
4
4
|
export declare const ExpandIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledExpandIcon>> & string;
|
|
5
|
+
export declare const ButtonHeaderWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, StyledButtonHeaderWrapper>> & string;
|
|
5
6
|
export declare const TitleText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
6
7
|
export declare const AccordionContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledAccordionContent>> & string;
|