@bigbluebutton/bbb-ui-components-react 0.6.0 → 0.8.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 +30 -0
- package/dist/components/Accordion.js +7 -3
- package/dist/components/Avatar.js +30 -0
- package/dist/components/Button.js +16 -19
- package/dist/components/Checkbox.js +4 -4
- package/dist/components/Hint.js +2 -2
- package/dist/components/Input.js +22 -25
- package/dist/components/Modal.js +35 -45
- package/dist/components/ScrollArea.js +42 -0
- package/dist/components/Search.js +1 -1
- package/dist/components/Slider.js +35 -0
- package/dist/components/TextAreaInput.js +8 -3
- package/dist/components/Toggle.js +5 -5
- package/dist/components/colors.js +1 -0
- package/dist/components/index.js +353 -250
- package/dist/esm/components/Accordion/component.js +3 -3
- package/dist/esm/components/Accordion/constants.js +7 -1
- package/dist/esm/components/Accordion/styles.js +5 -0
- package/dist/esm/components/Avatar/component.js +38 -0
- package/dist/esm/components/Avatar/constants.js +13 -0
- package/dist/esm/components/Avatar/index.js +1 -0
- package/dist/esm/components/Avatar/styles.js +42 -0
- package/dist/esm/components/Avatar/types.js +1 -0
- package/dist/esm/components/Button/constants.js +4 -2
- package/dist/esm/components/Button/styles.js +15 -12
- package/dist/esm/components/Checkbox/component.js +7 -5
- package/dist/esm/components/Hint/component.js +14 -3
- package/dist/esm/components/Input/styles.js +2 -2
- package/dist/esm/components/Modal/component.js +2 -2
- package/dist/esm/components/Modal/styles.js +2 -10
- 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/styles.js +2 -2
- package/dist/esm/components/Slider/component.js +63 -0
- package/dist/esm/components/Slider/constants.js +9 -0
- package/dist/esm/components/Slider/index.js +1 -0
- package/dist/esm/components/Slider/styles.js +138 -0
- package/dist/esm/components/Slider/types.js +1 -0
- package/dist/esm/components/TextAreaInput/styles.js +7 -2
- package/dist/esm/components/Toggle/styles.js +3 -3
- package/dist/esm/components/index.js +3 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/stylesheets/colors.js +60 -0
- package/dist/esm/stylesheets/palette.js +8 -0
- package/dist/esm/stylesheets/sizing.js +1 -0
- package/dist/types/components/Accordion/component.d.ts +1 -1
- package/dist/types/components/Accordion/constants.d.ts +8 -2
- package/dist/types/components/Accordion/styles.d.ts +2 -1
- package/dist/types/components/Accordion/types.d.ts +7 -1
- package/dist/types/components/Avatar/component.d.ts +12 -0
- package/dist/types/components/Avatar/constants.d.ts +8 -0
- package/dist/types/components/Avatar/index.d.ts +1 -0
- package/dist/types/components/Avatar/styles.d.ts +3 -0
- package/dist/types/components/Avatar/types.d.ts +26 -0
- package/dist/types/components/Button/constants.d.ts +3 -3
- package/dist/types/components/Button/type.d.ts +2 -1
- package/dist/types/components/Checkbox/component.d.ts +1 -1
- package/dist/types/components/Checkbox/types.d.ts +2 -0
- package/dist/types/components/Hint/component.d.ts +2 -1
- package/dist/types/components/Hint/types.d.ts +6 -2
- package/dist/types/components/Modal/styles.d.ts +0 -1
- package/dist/types/components/Modal/types.d.ts +2 -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/Slider/component.d.ts +11 -0
- package/dist/types/components/Slider/constants.d.ts +9 -0
- package/dist/types/components/Slider/index.d.ts +1 -0
- package/dist/types/components/Slider/styles.d.ts +8 -0
- package/dist/types/components/Slider/types.d.ts +46 -0
- package/dist/types/components/Toggle/constants.d.ts +2 -2
- package/dist/types/components/index.d.ts +3 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/stylesheets/colors.d.ts +60 -0
- package/dist/types/stylesheets/palette.d.ts +5 -0
- package/dist/types/stylesheets/sizing.d.ts +1 -0
- package/package.json +41 -1
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { Slider } from '@mui/material';
|
|
2
|
+
import { styled as materialStyled } from '@mui/material/styles';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import { colorBrand1, colorNeutral3, colorWhite, colorShadowDefault, colorTextDefault, colorTextLight, colorIconDefault, colorBorderFocusRing, } from '../../stylesheets/palette';
|
|
5
|
+
import { fontSizeXSmall, fontSizeDefault, fontSizeBig, fontWeightDefault, fontWeightLight, } from '../../stylesheets/typography';
|
|
6
|
+
import { spacingXSmall, spacingSmall, spacingXLarge, borderRadiusSmall, } from '../../stylesheets/sizing';
|
|
7
|
+
const THUMB_SIZE = '1rem';
|
|
8
|
+
const TRACK_HEIGHT = '0.3125rem';
|
|
9
|
+
const MARK_SIZE = '0.25rem';
|
|
10
|
+
const ICON_SIZE = '1.5rem';
|
|
11
|
+
export const SliderWrapper = styled.div `
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
width: 100%;
|
|
15
|
+
|
|
16
|
+
${({ $valueLabelSpace }) => $valueLabelSpace && `
|
|
17
|
+
gap: ${spacingXLarge};
|
|
18
|
+
`}
|
|
19
|
+
`;
|
|
20
|
+
export const TextWrapper = styled.label `
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
`;
|
|
25
|
+
export const Title = styled.span `
|
|
26
|
+
color: ${colorTextDefault};
|
|
27
|
+
font-size: ${fontSizeBig};
|
|
28
|
+
font-weight: ${fontWeightLight};
|
|
29
|
+
`;
|
|
30
|
+
export const HelperText = styled.span `
|
|
31
|
+
color: ${colorTextLight};
|
|
32
|
+
font-size: ${fontSizeDefault};
|
|
33
|
+
font-weight: ${fontWeightLight};
|
|
34
|
+
`;
|
|
35
|
+
export const SliderRow = styled.div `
|
|
36
|
+
display: flex;
|
|
37
|
+
align-items: center;
|
|
38
|
+
gap: ${spacingSmall};
|
|
39
|
+
width: 100%;
|
|
40
|
+
|
|
41
|
+
${({ $showMarkTicks }) => !$showMarkTicks && `
|
|
42
|
+
& .MuiSlider-mark {
|
|
43
|
+
display: none;
|
|
44
|
+
}
|
|
45
|
+
`}
|
|
46
|
+
|
|
47
|
+
${({ $animate }) => !$animate && `
|
|
48
|
+
& .MuiSlider-thumb,
|
|
49
|
+
& .MuiSlider-track,
|
|
50
|
+
& .MuiSlider-valueLabel {
|
|
51
|
+
transition: none;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
& .MuiSlider-thumb:hover:not(.Mui-focusVisible),
|
|
55
|
+
& .MuiSlider-thumb.Mui-active:not(.Mui-focusVisible) {
|
|
56
|
+
box-shadow: 0 2px 4px 0 ${colorShadowDefault};
|
|
57
|
+
}
|
|
58
|
+
`}
|
|
59
|
+
|
|
60
|
+
${({ $isRtl }) => $isRtl && `
|
|
61
|
+
/* MUI only mirrors right:-anchored positioning under RTL, not the LTR transforms paired
|
|
62
|
+
with it (that half normally comes from stylis-plugin-rtl, which this library can't add) */
|
|
63
|
+
&& .MuiSlider-thumb {
|
|
64
|
+
transform: translate(50%, -50%);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&& .MuiSlider-mark {
|
|
68
|
+
transform: translate(1px, -50%);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&& .MuiSlider-markLabel {
|
|
72
|
+
transform: translateX(50%);
|
|
73
|
+
}
|
|
74
|
+
`}
|
|
75
|
+
`;
|
|
76
|
+
export const IconWrapper = styled.span `
|
|
77
|
+
display: flex;
|
|
78
|
+
align-items: center;
|
|
79
|
+
color: ${colorIconDefault};
|
|
80
|
+
font-size: ${ICON_SIZE};
|
|
81
|
+
`;
|
|
82
|
+
export const MaterialSlider = materialStyled(Slider)({
|
|
83
|
+
color: colorBrand1,
|
|
84
|
+
height: TRACK_HEIGHT,
|
|
85
|
+
'& .MuiSlider-rail': {
|
|
86
|
+
backgroundColor: 'currentColor',
|
|
87
|
+
opacity: 0.38,
|
|
88
|
+
},
|
|
89
|
+
'& .MuiSlider-track': {
|
|
90
|
+
border: '1px solid currentColor',
|
|
91
|
+
backgroundColor: colorBrand1,
|
|
92
|
+
},
|
|
93
|
+
'& .MuiSlider-thumb': {
|
|
94
|
+
height: THUMB_SIZE,
|
|
95
|
+
width: THUMB_SIZE,
|
|
96
|
+
backgroundColor: 'currentColor',
|
|
97
|
+
boxShadow: `0 2px 4px 0 ${colorShadowDefault}`,
|
|
98
|
+
'&:hover, &.Mui-focusVisible': {
|
|
99
|
+
boxShadow: `0 0 0 0.5rem ${colorBorderFocusRing}`,
|
|
100
|
+
},
|
|
101
|
+
'&.Mui-active': {
|
|
102
|
+
boxShadow: `0 0 0 0.875rem ${colorBorderFocusRing}`,
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
'& .MuiSlider-mark': {
|
|
106
|
+
width: MARK_SIZE,
|
|
107
|
+
height: MARK_SIZE,
|
|
108
|
+
borderRadius: '50%',
|
|
109
|
+
backgroundColor: colorNeutral3,
|
|
110
|
+
'&.MuiSlider-markActive': {
|
|
111
|
+
backgroundColor: colorWhite,
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
'& .MuiSlider-markLabel': {
|
|
115
|
+
color: colorTextLight,
|
|
116
|
+
fontSize: fontSizeXSmall,
|
|
117
|
+
// RTL: resolve each label's own direction so a leading minus sign doesn't get reordered
|
|
118
|
+
unicodeBidi: 'plaintext',
|
|
119
|
+
},
|
|
120
|
+
'& .MuiSlider-valueLabel': {
|
|
121
|
+
backgroundColor: colorTextDefault,
|
|
122
|
+
color: colorWhite,
|
|
123
|
+
fontSize: fontSizeXSmall,
|
|
124
|
+
fontWeight: fontWeightDefault,
|
|
125
|
+
borderRadius: borderRadiusSmall,
|
|
126
|
+
padding: `${spacingXSmall} ${spacingSmall}`,
|
|
127
|
+
'& .MuiSlider-valueLabelLabel': {
|
|
128
|
+
// RTL: resolve each label's own direction so a leading minus sign doesn't get reordered
|
|
129
|
+
unicodeBidi: 'plaintext',
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
'&.Mui-disabled': {
|
|
133
|
+
color: colorNeutral3,
|
|
134
|
+
'& .MuiSlider-track': {
|
|
135
|
+
backgroundColor: colorNeutral3,
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
-
import { colorBorderDefault, colorBrand1, colorBrand2,
|
|
2
|
+
import { colorBorderDefault, colorBrand1, colorBrand2, colorTextDefault, colorTextLight, colorWhite, } from '../../stylesheets/palette';
|
|
3
3
|
import { borderRadiusDefault } from '../../stylesheets/sizing';
|
|
4
4
|
export const TextAreaInput = styled.textarea `
|
|
5
5
|
flex: 1;
|
|
6
6
|
background: ${colorWhite};
|
|
7
7
|
background-clip: padding-box;
|
|
8
8
|
margin: 0;
|
|
9
|
-
color: ${
|
|
9
|
+
color: ${colorTextDefault};
|
|
10
10
|
padding: calc(.3rem* 2.5) calc(.75rem* 1.25);
|
|
11
11
|
resize: none;
|
|
12
12
|
-webkit-transition: none;
|
|
@@ -19,6 +19,11 @@ export const TextAreaInput = styled.textarea `
|
|
|
19
19
|
border: 1px solid ${colorBorderDefault};
|
|
20
20
|
overflow-y: hidden;
|
|
21
21
|
margin: 0.3em;
|
|
22
|
+
|
|
23
|
+
&::placeholder {
|
|
24
|
+
color: ${colorTextLight};
|
|
25
|
+
}
|
|
26
|
+
|
|
22
27
|
&:focus {
|
|
23
28
|
outline: ${colorBrand1} solid 2px;
|
|
24
29
|
box-shadow: 0 0 0 2px ${colorBrand2} inset 0 0 0 1px ${colorBrand1};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Switch } from '@mui/material';
|
|
2
2
|
import { styled as materialStyled } from '@mui/material/styles';
|
|
3
3
|
import styled, { css } from 'styled-components';
|
|
4
|
-
import { colorBrand1, colorIconDefault, colorTextDefault, colorTextLight, colorWhite } from '../../stylesheets/palette';
|
|
4
|
+
import { colorBrand1, colorIconDefault, colorTextDefault, colorTextLight, colorWhite, colorShadowDefault, colorIconDefaultDark, } from '../../stylesheets/palette';
|
|
5
5
|
import { TEXT_POSITIONS } from './constants';
|
|
6
6
|
import { fontSizeBig, fontSizeDefault } from '../../stylesheets/typography';
|
|
7
7
|
export const ToggleWrapper = styled.div `
|
|
@@ -92,7 +92,7 @@ export const MaterialToggle = materialStyled(Switch)(({ theme }) => ({
|
|
|
92
92
|
},
|
|
93
93
|
},
|
|
94
94
|
'& .MuiSwitch-thumb': {
|
|
95
|
-
boxShadow:
|
|
95
|
+
boxShadow: `0 2px 4px 0 ${colorShadowDefault}`,
|
|
96
96
|
width: '0.6rem',
|
|
97
97
|
height: '0.6rem',
|
|
98
98
|
borderRadius: '0.5rem',
|
|
@@ -102,6 +102,6 @@ export const MaterialToggle = materialStyled(Switch)(({ theme }) => ({
|
|
|
102
102
|
transform: 'translateY(1px)',
|
|
103
103
|
},
|
|
104
104
|
'& .MuiSwitch-track': Object.assign({ borderRadius: '0.6rem', opacity: 1, backgroundColor: colorIconDefault, boxSizing: 'border-box' }, theme.applyStyles('dark', {
|
|
105
|
-
backgroundColor:
|
|
105
|
+
backgroundColor: colorIconDefaultDark,
|
|
106
106
|
})),
|
|
107
107
|
}));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { BBBAccordion } from './Accordion';
|
|
2
|
+
export { BBBAvatar } from './Avatar';
|
|
2
3
|
export { BBButton } from './Button';
|
|
3
4
|
export { BBBCheckbox } from './Checkbox';
|
|
4
5
|
export { BBBDivider } from './Divider';
|
|
@@ -6,8 +7,10 @@ export { BBBHint } from './Hint';
|
|
|
6
7
|
export { BBBInput } from './Input';
|
|
7
8
|
export { BBBModal } from './Modal';
|
|
8
9
|
export { BBBNavigation } from './Navigation';
|
|
10
|
+
export { BBBScrollArea } from './ScrollArea';
|
|
9
11
|
export { BBBSearch } from './Search';
|
|
10
12
|
export { BBBSelect } from './Select';
|
|
13
|
+
export { BBBSlider } from './Slider';
|
|
11
14
|
export { BBBSpinner } from './Spinner';
|
|
12
15
|
export { BBBTextAreaInput } from './TextAreaInput';
|
|
13
16
|
export { BBBTextInput } from './TextInput';
|
package/dist/esm/index.js
CHANGED
|
@@ -0,0 +1,60 @@
|
|
|
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, colorUserYou, } 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
|
+
user: {
|
|
58
|
+
you: colorUserYou,
|
|
59
|
+
},
|
|
60
|
+
};
|
|
@@ -36,6 +36,7 @@ export const colorBorderSelected = `var(--color-border-selected, ${colorBrand1_b
|
|
|
36
36
|
export const colorBorderError = `var(--color-border-error, ${colorError_base})`;
|
|
37
37
|
// Mapped to core css vars
|
|
38
38
|
export const colorBorderDefault = `var(--default-border, ${colorBorderDefault_base})`;
|
|
39
|
+
export const colorBorderFocusRing = 'var(--color-border-focus-ring, rgba(29, 101, 212, 0.15))';
|
|
39
40
|
// Text colors
|
|
40
41
|
export const colorTextDefault = `var(--color-text-default, ${colorDarkGray})`;
|
|
41
42
|
export const colorTextLight = `var(--color-text-light, ${colorNeutral2})`;
|
|
@@ -43,7 +44,14 @@ export const colorTextLight = `var(--color-text-light, ${colorNeutral2})`;
|
|
|
43
44
|
export const colorIconDefault = `var(--color-icon-default, ${colorNeutral2})`;
|
|
44
45
|
export const colorIconBlue = `var(--color-icon-blue, ${colorBrand1_base})`;
|
|
45
46
|
export const colorIconWhite = `var(--color-icon-white, ${colorWhite})`;
|
|
47
|
+
export const colorIconDefaultDark = 'var(--color-icon-default-dark, rgba(255, 255, 255, 0.35))';
|
|
46
48
|
//Hover colors
|
|
47
49
|
export const colorHoverDark = 'var(--color-hover-dark, #0C57A7)';
|
|
48
50
|
export const colorHoverLight = 'var(--color-hover-light, #D4E5FA)';
|
|
49
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%))';
|
|
56
|
+
// User colors
|
|
57
|
+
export const colorUserYou = 'var(--color-user-you, #19237C)';
|
|
@@ -7,6 +7,7 @@ export const spacingMedium = '1rem'; // 16px
|
|
|
7
7
|
export const spacingMediumLarge = '1.25rem'; // 20px
|
|
8
8
|
export const spacingLarge = '1.5rem'; // 24px
|
|
9
9
|
export const spacingXLarge = '2rem'; // 32px
|
|
10
|
+
export const spacingXXLarge = '3rem'; // 48px
|
|
10
11
|
// Border sizes
|
|
11
12
|
export const borderRadiusDefault = '1rem'; //16px
|
|
12
13
|
export const borderRadiusSmall = '0.5rem'; //8px
|
|
@@ -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;
|
|
@@ -4,6 +4,12 @@ declare const TOOLTIP_PLACEMENTS: {
|
|
|
4
4
|
readonly LEFT: "left";
|
|
5
5
|
readonly RIGHT: "right";
|
|
6
6
|
};
|
|
7
|
-
declare const TOOLTIP_PLACEMENT_VALUES: ("
|
|
7
|
+
declare const TOOLTIP_PLACEMENT_VALUES: ("left" | "right" | "bottom" | "top")[];
|
|
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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TOOLTIP_PLACEMENT_VALUES } from './constants';
|
|
1
|
+
import { TOOLTIP_PLACEMENT_VALUES, BUTTON_HEADER_POSITION_VALUES } from './constants';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
export interface StyledExpandIcon {
|
|
4
4
|
$expanded: boolean;
|
|
@@ -7,7 +7,11 @@ export interface StyledAccordionContent {
|
|
|
7
7
|
$expanded: boolean;
|
|
8
8
|
$scrollHeight: number;
|
|
9
9
|
}
|
|
10
|
+
export interface StyledButtonHeaderWrapper {
|
|
11
|
+
$position: ButtonHeaderPositionType;
|
|
12
|
+
}
|
|
10
13
|
type TooltipPlacementType = typeof TOOLTIP_PLACEMENT_VALUES[number];
|
|
14
|
+
type ButtonHeaderPositionType = typeof BUTTON_HEADER_POSITION_VALUES[number];
|
|
11
15
|
export interface AccordionProps {
|
|
12
16
|
/** The text to be displayed in the accordion header. */
|
|
13
17
|
title: string;
|
|
@@ -23,6 +27,8 @@ export interface AccordionProps {
|
|
|
23
27
|
ariaDescribedBy?: string;
|
|
24
28
|
/** Optional React node rendered inside the button header, alongside the title. @default null */
|
|
25
29
|
buttonHeader?: React.ReactNode;
|
|
30
|
+
/** Position of `buttonHeader` within the header row. @default 'left' */
|
|
31
|
+
buttonHeaderPosition?: ButtonHeaderPositionType;
|
|
26
32
|
/** Content shown when the accordion is expanded. */
|
|
27
33
|
children?: React.ReactNode;
|
|
28
34
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
import 'tippy.js/dist/tippy.css';
|
|
3
|
+
import { AvatarProps } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* A user avatar component.
|
|
6
|
+
*
|
|
7
|
+
* Renders the user's avatar image when available, falling back to their initials on a
|
|
8
|
+
* deterministically-colored background when no image is provided or it fails to load.
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
declare function Avatar({ name, avatarUrl, color, size, isModerator, isYou, isTalking, disableTooltip, }: AvatarProps): JSX.Element;
|
|
12
|
+
export default Avatar;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const AVATAR_SIZES: {
|
|
2
|
+
readonly SMALL: "small";
|
|
3
|
+
readonly MEDIUM: "medium";
|
|
4
|
+
readonly LARGE: "large";
|
|
5
|
+
};
|
|
6
|
+
export declare const AVATAR_SIZE_VALUES: ("small" | "medium" | "large")[];
|
|
7
|
+
export declare const DEFAULT_AVATAR_SIZE: "medium";
|
|
8
|
+
export declare const AVATAR_FALLBACK_COLORS: string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as BBBAvatar } from './component';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { StyledAvatarProps } from './types';
|
|
2
|
+
export declare const AvatarInitials: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledAvatarProps>> & string;
|
|
3
|
+
export declare const AvatarImage: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, StyledAvatarProps>> & string;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { AVATAR_SIZE_VALUES } from './constants';
|
|
2
|
+
export type AvatarSize = typeof AVATAR_SIZE_VALUES[number];
|
|
3
|
+
export interface StyledAvatarProps {
|
|
4
|
+
$size: AvatarSize;
|
|
5
|
+
$color: string;
|
|
6
|
+
$isModerator: boolean;
|
|
7
|
+
$isTalking: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface AvatarProps {
|
|
10
|
+
/** Full name of the user; used to render initials, to derive a deterministic fallback color, and as the tooltip content. */
|
|
11
|
+
name: string;
|
|
12
|
+
/** URL of the user's avatar image. Falls back to initials when omitted or if the image fails to load. */
|
|
13
|
+
avatarUrl?: string;
|
|
14
|
+
/** Background color behind the initials (and border color on the image). @default a color deterministically derived from `name`, or BBB's "you" color when `isYou` is set */
|
|
15
|
+
color?: string;
|
|
16
|
+
/** Size variant of the avatar. @default 'medium' */
|
|
17
|
+
size?: AvatarSize;
|
|
18
|
+
/** Renders a rounded-square shape instead of a circle, matching BBB's moderator avatar treatment. @default false */
|
|
19
|
+
isModerator?: boolean;
|
|
20
|
+
/** Marks this avatar as belonging to the current user, applying BBB's "you" color in place of the fallback/computed color. Ignored when `color` is set. @default false */
|
|
21
|
+
isYou?: boolean;
|
|
22
|
+
/** Shows a pulsing ring around the avatar, in its own color, matching BBB's talking indicator. @default false */
|
|
23
|
+
isTalking?: boolean;
|
|
24
|
+
/** Disables the tooltip that shows the full `name` on hover. @default false */
|
|
25
|
+
disableTooltip?: boolean;
|
|
26
|
+
}
|
|
@@ -26,15 +26,15 @@ declare const LAYOUTS: {
|
|
|
26
26
|
readonly CIRCLE: "circle";
|
|
27
27
|
readonly SQUARED: "squared";
|
|
28
28
|
};
|
|
29
|
-
declare const LAYOUT_VALUES: ("default" | "
|
|
30
|
-
declare const DEFAULT_LAYOUT: "default" | "
|
|
29
|
+
declare const LAYOUT_VALUES: ("default" | "circle" | "stacked" | "squared")[];
|
|
30
|
+
declare const DEFAULT_LAYOUT: "default" | "circle" | "stacked" | "squared";
|
|
31
31
|
declare const TOOLTIP_PLACEMENTS: {
|
|
32
32
|
readonly TOP: "top";
|
|
33
33
|
readonly BOTTOM: "bottom";
|
|
34
34
|
readonly LEFT: "left";
|
|
35
35
|
readonly RIGHT: "right";
|
|
36
36
|
};
|
|
37
|
-
declare const TOOLTIP_PLACEMENT_VALUES: ("
|
|
37
|
+
declare const TOOLTIP_PLACEMENT_VALUES: ("left" | "right" | "bottom" | "top")[];
|
|
38
38
|
declare const DEFAULT_TOOLTIP_PLACEMENT: "top";
|
|
39
39
|
declare const CSS_COLOR_PROPERTIES: CSSColorPropertiesType;
|
|
40
40
|
declare const CSS_COLOR_PROPERTIES_DISABLED: EssentialColorProperties;
|
|
@@ -19,6 +19,7 @@ export type CSSColorPropertiesType = {
|
|
|
19
19
|
};
|
|
20
20
|
export type SizeProperties = {
|
|
21
21
|
padding: string;
|
|
22
|
+
iconBoxSize: string;
|
|
22
23
|
};
|
|
23
24
|
export type CSSSizePropertiesType = {
|
|
24
25
|
[key: string]: SizeProperties;
|
|
@@ -68,7 +69,7 @@ type BaseButtonProps = {
|
|
|
68
69
|
color?: ColorType;
|
|
69
70
|
/** Visual variant controlling emphasis and background/border styling. @default 'primary' */
|
|
70
71
|
variant?: VariantType;
|
|
71
|
-
/** Button size; affects padding and, for the `circle`
|
|
72
|
+
/** Button size; affects padding and, for the `circle`/`squared` layouts, the overall box size (both render at the same size). @default 'md' */
|
|
72
73
|
size?: SizeType;
|
|
73
74
|
/** Disables interaction and applies disabled styling. @default false */
|
|
74
75
|
disabled?: boolean;
|
|
@@ -8,5 +8,5 @@ import { CheckboxProps } from './types';
|
|
|
8
8
|
* and clicking the label will toggle the checkbox state.
|
|
9
9
|
*
|
|
10
10
|
*/
|
|
11
|
-
declare function Checkbox({ label, layout, round, ariaLabel, ...props }: CheckboxProps): JSX.Element;
|
|
11
|
+
declare function Checkbox({ label, layout, round, ariaLabel, id, dataTest, inputProps, ...props }: CheckboxProps): JSX.Element;
|
|
12
12
|
export default Checkbox;
|
|
@@ -6,6 +6,7 @@ import { HintProps } from './types';
|
|
|
6
6
|
* This component provides a small contextual hint used to surface tips, short help text or dismissible messages.
|
|
7
7
|
* It can be displayed with a title, an icon, and a close button.
|
|
8
8
|
*
|
|
9
|
+
* Visibility is uncontrolled by default (the hint closes itself when its close button is clicked); pass `open` to control it externally instead.
|
|
9
10
|
*/
|
|
10
|
-
declare function Hint({ title, label, icon, onRequestClose, children, ...rest }: HintProps): JSX.Element;
|
|
11
|
+
declare function Hint({ title, label, icon, open, onRequestClose, hideCloseButton, children, ...rest }: HintProps): JSX.Element | null;
|
|
11
12
|
export default Hint;
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
export interface HintProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
2
2
|
/** Main text content of the hint. */
|
|
3
3
|
label: string;
|
|
4
|
-
/** Optional title;
|
|
4
|
+
/** Optional title shown in the header; when set, `label` renders as a separate line below instead of inline. */
|
|
5
5
|
title?: string;
|
|
6
6
|
/** Optional icon node displayed next to the title or label. @default <MdInfo /> */
|
|
7
7
|
icon?: React.ReactNode;
|
|
8
|
-
/**
|
|
8
|
+
/** Whether the hint is visible. Omit to let the hint manage its own visibility, closing itself when the close button is clicked; pass a boolean to control visibility externally. */
|
|
9
|
+
open?: boolean;
|
|
10
|
+
/** Callback fired when the close button is clicked, in both controlled and uncontrolled mode. */
|
|
9
11
|
onRequestClose?: () => void;
|
|
12
|
+
/** Hides the close (X) button, for hints that shouldn't be manually dismissed. @default false */
|
|
13
|
+
hideCloseButton?: boolean;
|
|
10
14
|
/** Optional additional content rendered under the label. */
|
|
11
15
|
children?: React.ReactNode;
|
|
12
16
|
}
|
|
@@ -3,7 +3,6 @@ import * as React from 'react';
|
|
|
3
3
|
import { StyledModalBodyProps, StyledModalFooterProps } from './types';
|
|
4
4
|
export declare const modalStyles: Styles;
|
|
5
5
|
export declare const ModalHeader: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
6
|
-
export declare const CloseButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
|
|
7
6
|
export declare const ModalScrollArea: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledModalBodyProps>> & string;
|
|
8
7
|
export declare const ModalBodyContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
9
8
|
export declare const ModalFooter: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledModalFooterProps>> & string;
|
|
@@ -19,6 +19,8 @@ export interface ModalProps extends Omit<ReactModal.Props, 'style'> {
|
|
|
19
19
|
allowScroll?: boolean;
|
|
20
20
|
/** Hide the footer section. @default false */
|
|
21
21
|
noFooter?: boolean;
|
|
22
|
+
/** Hide the header close button. @default false */
|
|
23
|
+
hideCloseButton?: boolean;
|
|
22
24
|
/** When true, the footer is sticky to the bottom instead of scrolling with the body. @default true */
|
|
23
25
|
stickyFooter?: boolean;
|
|
24
26
|
/** Custom React node to render inside the footer. @default null */
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
import { ScrollAreaProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* A wrapper that applies standardized scrollbar styling to its content.
|
|
5
|
+
*
|
|
6
|
+
* Use it around any scrollable area (chat, lists, side panels) to get a consistent
|
|
7
|
+
* scrollbar look, with optional axis control, size capping, and edge fading.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
declare function ScrollArea({ children, verticalScroll, horizontalScroll, maxHeight, maxWidth, fadeEdges, fadeColor, paddingTop, paddingRight, paddingBottom, paddingLeft, }: ScrollAreaProps): JSX.Element;
|
|
11
|
+
export default ScrollArea;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as BBBScrollArea } from './component';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { StyledScrollAreaWrapperProps } from './types';
|
|
2
|
+
export declare const ScrollAreaWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledScrollAreaWrapperProps>> & string;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface StyledScrollAreaWrapperProps {
|
|
3
|
+
$verticalScroll: boolean;
|
|
4
|
+
$horizontalScroll: boolean;
|
|
5
|
+
$maxHeight?: string;
|
|
6
|
+
$maxWidth?: string;
|
|
7
|
+
$fadeEdges: boolean;
|
|
8
|
+
$fadeColor?: string;
|
|
9
|
+
$paddingTop?: string;
|
|
10
|
+
$paddingRight?: string;
|
|
11
|
+
$paddingBottom?: string;
|
|
12
|
+
$paddingLeft?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface ScrollAreaProps {
|
|
15
|
+
/** Scrollable content. */
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
/** Enables vertical scrolling. @default true */
|
|
18
|
+
verticalScroll?: boolean;
|
|
19
|
+
/** Enables horizontal scrolling. @default false */
|
|
20
|
+
horizontalScroll?: boolean;
|
|
21
|
+
/** Caps the content height; scrolling kicks in past this value (e.g. '400px', '50vh'). */
|
|
22
|
+
maxHeight?: string;
|
|
23
|
+
/** Caps the content width; scrolling kicks in past this value (e.g. '600px', '100%'). */
|
|
24
|
+
maxWidth?: string;
|
|
25
|
+
/** Fades the scrollable edges with a color mask + shadow, matching the chat's scroll style. @default true */
|
|
26
|
+
fadeEdges?: boolean;
|
|
27
|
+
/** Background color the fade blends into. Required in practice when `fadeEdges` is `true` — if omitted, the fade is silently skipped. */
|
|
28
|
+
fadeColor?: string;
|
|
29
|
+
/** Space reserved above the content, before the scrollable area's top edge (e.g. '1rem'). Keeps the first item clear of the top fade instead of butting against it. */
|
|
30
|
+
paddingTop?: string;
|
|
31
|
+
/** Space reserved to the right of the content, before the scrollable area's right edge (e.g. '1rem'). Keeps the last item clear of the right fade instead of butting against it. */
|
|
32
|
+
paddingRight?: string;
|
|
33
|
+
/** Space reserved below the content, before the scrollable area's bottom edge (e.g. '1rem'). Keeps the last item clear of the bottom fade instead of butting against it. */
|
|
34
|
+
paddingBottom?: string;
|
|
35
|
+
/** Space reserved to the left of the content, before the scrollable area's left edge (e.g. '1rem'). Keeps the first item clear of the left fade instead of butting against it. */
|
|
36
|
+
paddingLeft?: string;
|
|
37
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
import { SliderProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* A horizontal, single-thumb slider for picking a value inside a range.
|
|
5
|
+
*
|
|
6
|
+
* It supports labels (label and helperText), decorative end icons, marks and a value tooltip,
|
|
7
|
+
* and keeps its accessible name and description on the underlying range input.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
declare function Slider({ label, helperText, iconStart, iconEnd, showMarkTicks, animate, valueLabelDisplay, onChange, onChangeCommitted, id: providedId, dataTest, ariaLabel, ariaLabelledBy, ariaDescribedBy, slotProps, ...rest }: SliderProps): JSX.Element;
|
|
11
|
+
export default Slider;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const VALUE_LABEL_DISPLAYS: {
|
|
2
|
+
readonly AUTO: "auto";
|
|
3
|
+
readonly ON: "on";
|
|
4
|
+
readonly OFF: "off";
|
|
5
|
+
};
|
|
6
|
+
export declare const VALUE_LABEL_DISPLAY_VALUES: ("auto" | "off" | "on")[];
|
|
7
|
+
export declare const DEFAULT_VALUE_LABEL_DISPLAY: "auto";
|
|
8
|
+
export declare const DEFAULT_SHOW_MARK_TICKS = true;
|
|
9
|
+
export declare const DEFAULT_ANIMATE = true;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as BBBSlider } from './component';
|