@bigbluebutton/bbb-ui-components-react 0.5.0 → 0.6.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 +11 -10
- package/dist/components/Accordion.js +53 -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/Search.js +130 -1
- package/dist/components/Select.js +46 -1
- package/dist/components/Spinner.js +34 -1
- package/dist/components/TextAreaInput.js +23 -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/index.js +739 -1
- package/dist/esm/components/Accordion/component.js +6 -7
- package/dist/esm/components/Accordion/constants.js +3 -3
- package/dist/esm/components/Accordion/styles.js +58 -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 +3 -14
- 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 +41 -19
- package/dist/esm/components/Navigation/component.js +3 -4
- package/dist/esm/components/Navigation/styles.js +36 -12
- 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 +24 -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 +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/stylesheets/palette.js +49 -0
- package/dist/esm/stylesheets/sizing.js +9 -9
- package/dist/esm/stylesheets/typography.js +7 -7
- package/dist/types/components/Accordion/types.d.ts +8 -0
- 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/types.d.ts +5 -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/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 +1 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/stylesheets/{pallete.d.ts → palette.d.ts} +9 -9
- package/package.json +15 -2
- package/dist/esm/stylesheets/pallete.js +0 -46
|
@@ -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 } 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 rgb(0 35 11 / 20%)',
|
|
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: 'rgba(255,255,255,.35)',
|
|
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,6 +3,7 @@ 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';
|
|
8
9
|
export { BBBSearch } from './Search';
|
package/dist/esm/index.js
CHANGED
|
@@ -0,0 +1,49 @@
|
|
|
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
|
+
// Text colors
|
|
40
|
+
export const colorTextDefault = `var(--color-text-default, ${colorDarkGray})`;
|
|
41
|
+
export const colorTextLight = `var(--color-text-light, ${colorNeutral2})`;
|
|
42
|
+
//Icon colors
|
|
43
|
+
export const colorIconDefault = `var(--color-icon-default, ${colorNeutral2})`;
|
|
44
|
+
export const colorIconBlue = `var(--color-icon-blue, ${colorBrand1_base})`;
|
|
45
|
+
export const colorIconWhite = `var(--color-icon-white, ${colorWhite})`;
|
|
46
|
+
//Hover colors
|
|
47
|
+
export const colorHoverDark = 'var(--color-hover-dark, #0C57A7)';
|
|
48
|
+
export const colorHoverLight = 'var(--color-hover-light, #D4E5FA)';
|
|
49
|
+
export const colorHoverNeutral = `var(--color-hover-neutral, ${colorNeutral4})`;
|
|
@@ -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';
|
|
@@ -9,13 +9,21 @@ export interface StyledAccordionContent {
|
|
|
9
9
|
}
|
|
10
10
|
type TooltipPlacementType = typeof TOOLTIP_PLACEMENT_VALUES[number];
|
|
11
11
|
export interface AccordionProps {
|
|
12
|
+
/** The text to be displayed in the accordion header. */
|
|
12
13
|
title: string;
|
|
14
|
+
/** Optional label for a tooltip that appears when hovering the header; no tooltip is shown when omitted. */
|
|
13
15
|
tooltipLabel?: string;
|
|
16
|
+
/** Placement of the tooltip when `tooltipLabel` is provided. @default 'top' */
|
|
14
17
|
tooltipPlacement?: TooltipPlacementType;
|
|
18
|
+
/** Accessible name for the expand button. */
|
|
15
19
|
ariaLabel?: string;
|
|
20
|
+
/** ID of the element that labels the expand button. */
|
|
16
21
|
ariaLabelledBy?: string;
|
|
22
|
+
/** ID of the element that describes the expand button. */
|
|
17
23
|
ariaDescribedBy?: string;
|
|
24
|
+
/** Optional React node rendered inside the button header, alongside the title. @default null */
|
|
18
25
|
buttonHeader?: React.ReactNode;
|
|
26
|
+
/** Content shown when the accordion is expanded. */
|
|
19
27
|
children?: React.ReactNode;
|
|
20
28
|
}
|
|
21
29
|
export {};
|
|
@@ -24,9 +24,10 @@ declare const LAYOUTS: {
|
|
|
24
24
|
readonly DEFAULT: "default";
|
|
25
25
|
readonly STACKED: "stacked";
|
|
26
26
|
readonly CIRCLE: "circle";
|
|
27
|
+
readonly SQUARED: "squared";
|
|
27
28
|
};
|
|
28
|
-
declare const LAYOUT_VALUES: ("
|
|
29
|
-
declare const DEFAULT_LAYOUT: "
|
|
29
|
+
declare const LAYOUT_VALUES: ("default" | "stacked" | "circle" | "squared")[];
|
|
30
|
+
declare const DEFAULT_LAYOUT: "default" | "stacked" | "circle" | "squared";
|
|
30
31
|
declare const TOOLTIP_PLACEMENTS: {
|
|
31
32
|
readonly TOP: "top";
|
|
32
33
|
readonly BOTTOM: "bottom";
|
|
@@ -4,4 +4,5 @@ export declare const Button: import("styled-components/dist/types").IStyledCompo
|
|
|
4
4
|
export declare const HelperIconContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledHelperIconContainer>> & string;
|
|
5
5
|
export declare const HelperIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
6
6
|
export declare const IconWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
7
|
+
export declare const FeedbackContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
7
8
|
export declare const ButtonText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
@@ -44,37 +44,78 @@ export interface StyledButtonProps {
|
|
|
44
44
|
disabled: boolean;
|
|
45
45
|
}
|
|
46
46
|
type BaseButtonProps = {
|
|
47
|
+
/** HTML `id` for the root element; auto-generated via `useId` when omitted, and used to derive the label's id and default `data-test` value. @default '' */
|
|
47
48
|
id?: string;
|
|
49
|
+
/** Value for the `data-test` attribute, used for test selectors; falls back to an auto-generated id based on `id`/`label` when omitted. */
|
|
48
50
|
dataTest?: string;
|
|
51
|
+
/** Text label for the button; rendered in layouts that display a label (e.g. `default`, `stacked`). */
|
|
49
52
|
label?: string;
|
|
53
|
+
/** Text shown in a tooltip; the tooltip only renders when this is provided. */
|
|
50
54
|
tooltipLabel?: string;
|
|
55
|
+
/** Placement of the tooltip relative to the button; only used when `tooltipLabel` is set. @default 'top' */
|
|
51
56
|
tooltipPlacement?: TooltipPlacementType;
|
|
57
|
+
/** Click handler for the button's primary action (required); for the `stacked` layout this is distinct from `helperOnClick`. */
|
|
52
58
|
onClick: React.MouseEventHandler<HTMLButtonElement>;
|
|
59
|
+
/** Keydown handler for the button element, for custom keyboard interactions. */
|
|
53
60
|
onKeyDown?: React.KeyboardEventHandler<HTMLButtonElement>;
|
|
61
|
+
/** Id of the element that labels the button (`aria-labelledby`); when omitted, falls back to the id of the button's own rendered label element, if any. */
|
|
54
62
|
ariaLabelledBy?: string;
|
|
63
|
+
/** Id of the element that describes the button, wired to `aria-describedby`, when provided. */
|
|
55
64
|
ariaDescribedBy?: string;
|
|
65
|
+
/** Accessible name for the button (`aria-label`); falls back to `label` when not provided. */
|
|
56
66
|
ariaLabel?: string;
|
|
67
|
+
/** Color theme for the button (affects background/border/text depending on `variant`). @default 'default' */
|
|
57
68
|
color?: ColorType;
|
|
69
|
+
/** Visual variant controlling emphasis and background/border styling. @default 'primary' */
|
|
58
70
|
variant?: VariantType;
|
|
71
|
+
/** Button size; affects padding and, for the `circle` layout, the overall diameter. @default 'md' */
|
|
59
72
|
size?: SizeType;
|
|
73
|
+
/** Disables interaction and applies disabled styling. @default false */
|
|
60
74
|
disabled?: boolean;
|
|
75
|
+
/** Additional content rendered inside the button, after the label (only used in the `default` layout). */
|
|
61
76
|
children?: React.ReactNode;
|
|
77
|
+
/**
|
|
78
|
+
* When `true`, temporarily shows `feedbackContent` in place of the button's own
|
|
79
|
+
* label/icon for `feedbackDuration` after `onClick` fires.
|
|
80
|
+
* @default false
|
|
81
|
+
*/
|
|
82
|
+
showFeedback?: boolean;
|
|
83
|
+
/** Content rendered while the click feedback is visible (e.g. a checkmark icon and "Copied"). @default <MdCheckCircle /> */
|
|
84
|
+
feedbackContent?: React.ReactNode;
|
|
85
|
+
/** How long, in milliseconds, the click feedback stays visible. @default 2000 */
|
|
86
|
+
feedbackDuration?: number;
|
|
62
87
|
};
|
|
63
88
|
type DefaultLayoutProps = BaseButtonProps & {
|
|
89
|
+
/** Layout mode for this variant — always `'default'`, the standard inline label/icon button; also the overall default. @default 'default' */
|
|
64
90
|
layout?: typeof LAYOUTS.DEFAULT;
|
|
91
|
+
/** Icon rendered before the label (left side); effective when a label is present. */
|
|
65
92
|
iconStart?: React.ReactNode;
|
|
93
|
+
/** Icon rendered after the label (right side); effective when a label is present. */
|
|
66
94
|
iconEnd?: React.ReactNode;
|
|
67
95
|
};
|
|
68
96
|
type StackedLayoutProps = BaseButtonProps & {
|
|
97
|
+
/** Layout mode for this variant — must be `'stacked'`, rendering a main icon with a label underneath plus an optional helper icon. */
|
|
69
98
|
layout: typeof LAYOUTS.STACKED;
|
|
99
|
+
/** Main icon for the button, shown above the label. */
|
|
70
100
|
icon?: React.ReactNode;
|
|
101
|
+
/** Auxiliary icon for a secondary action, shown next to the main icon; clickable via `helperOnClick`. @default MdSettings icon */
|
|
71
102
|
helperIcon?: React.ReactNode;
|
|
103
|
+
/** Hides the helper icon entirely when true. @default false */
|
|
72
104
|
hideHelperIcon?: boolean;
|
|
105
|
+
/** Click handler for the helper icon, triggering a secondary action separate from `onClick`. @default null */
|
|
73
106
|
helperOnClick?: React.MouseEventHandler<HTMLDivElement>;
|
|
74
107
|
};
|
|
75
108
|
type CircleLayoutProps = BaseButtonProps & {
|
|
109
|
+
/** Layout mode for this variant — must be `'circle'`, rendering an icon-only circular button. */
|
|
76
110
|
layout: typeof LAYOUTS.CIRCLE;
|
|
111
|
+
/** Icon rendered inside the circular button (no label is shown in this layout). */
|
|
77
112
|
icon?: React.ReactNode;
|
|
78
113
|
};
|
|
79
|
-
|
|
114
|
+
type SquaredLayoutProps = BaseButtonProps & {
|
|
115
|
+
/** Layout mode for this variant — must be `'squared'`, rendering an icon-only square button. */
|
|
116
|
+
layout: typeof LAYOUTS.SQUARED;
|
|
117
|
+
/** Icon rendered inside the square button (no label is shown in this layout). */
|
|
118
|
+
icon?: React.ReactNode;
|
|
119
|
+
};
|
|
120
|
+
export type ButtonProps = DefaultLayoutProps | StackedLayoutProps | CircleLayoutProps | SquaredLayoutProps;
|
|
80
121
|
export {};
|
|
@@ -2,9 +2,13 @@ import { CheckboxProps as MuiCheckboxProps } from '@mui/material';
|
|
|
2
2
|
import { LAYOUTS } from './constants';
|
|
3
3
|
type Layout = typeof LAYOUTS[keyof typeof LAYOUTS];
|
|
4
4
|
export interface CheckboxProps extends MuiCheckboxProps {
|
|
5
|
+
/** Text label displayed next to the checkbox. */
|
|
5
6
|
label?: string;
|
|
7
|
+
/** Position of the label relative to the checkbox. @default 'right' */
|
|
6
8
|
layout?: Layout;
|
|
9
|
+
/** When true, renders the checkbox as a round radio-style control. @default false */
|
|
7
10
|
round?: boolean;
|
|
11
|
+
/** Accessible name for the checkbox. */
|
|
8
12
|
ariaLabel?: string;
|
|
9
13
|
}
|
|
10
14
|
export {};
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
export interface HintProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
2
|
+
/** Main text content of the hint. */
|
|
2
3
|
label: string;
|
|
4
|
+
/** Optional title; if provided, shows a close button. */
|
|
3
5
|
title?: string;
|
|
6
|
+
/** Optional icon node displayed next to the title or label. @default <MdInfo /> */
|
|
4
7
|
icon?: React.ReactNode;
|
|
8
|
+
/** Callback fired when the close button is clicked. */
|
|
5
9
|
onRequestClose?: () => void;
|
|
10
|
+
/** Optional additional content rendered under the label. */
|
|
6
11
|
children?: React.ReactNode;
|
|
7
12
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
import { BBBInputProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* A labeled, auto-growing text field with an inline action button.
|
|
5
|
+
*
|
|
6
|
+
* Modeled after the core chat text input: unifies the recurring "text field +
|
|
7
|
+
* submit button" pattern used across chat, guest messages and breakouts.
|
|
8
|
+
* It supports both uncontrolled (default) and controlled usage, matching BBBSearch.
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
declare function Input({ label, placeholder, value, onChange, onSubmit, buttonIcon, buttonLabel, buttonAriaLabel, buttonVariant, dataTest, buttonDataTest, beforeButton, afterButton, submitOnEnter, showSentFeedback, sentFeedbackContent, sentFeedbackDuration, disabled, error, helperText, minRows, maxRows, maxLength, autoFocus, inputRef, id, 'aria-label': ariaLabel, 'aria-describedby': ariaDescribedBy, }: BBBInputProps): JSX.Element;
|
|
12
|
+
export default Input;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as BBBInput } from './component';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { StyledContainerProps, StyledHelperTextProps } from './types';
|
|
2
|
+
export declare const Wrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
3
|
+
export declare const Label: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, never>> & string;
|
|
4
|
+
export declare const FieldContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledContainerProps>> & string;
|
|
5
|
+
export declare const TextArea: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, never>> & string;
|
|
6
|
+
export declare const HelperText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledHelperTextProps>> & string;
|