@bigbluebutton/bbb-ui-components-react 0.6.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.
Files changed (45) hide show
  1. package/README.md +27 -0
  2. package/dist/components/Accordion.js +7 -3
  3. package/dist/components/Hint.js +2 -2
  4. package/dist/components/Input.js +1 -1
  5. package/dist/components/Modal.js +14 -14
  6. package/dist/components/ScrollArea.js +42 -0
  7. package/dist/components/Search.js +1 -1
  8. package/dist/components/TextAreaInput.js +8 -3
  9. package/dist/components/Toggle.js +5 -5
  10. package/dist/components/colors.js +1 -0
  11. package/dist/components/index.js +283 -233
  12. package/dist/esm/components/Accordion/component.js +3 -3
  13. package/dist/esm/components/Accordion/constants.js +7 -1
  14. package/dist/esm/components/Accordion/styles.js +5 -0
  15. package/dist/esm/components/Hint/component.js +14 -3
  16. package/dist/esm/components/Input/styles.js +2 -2
  17. package/dist/esm/components/Modal/styles.js +2 -2
  18. package/dist/esm/components/ScrollArea/component.js +15 -0
  19. package/dist/esm/components/ScrollArea/constants.js +3 -0
  20. package/dist/esm/components/ScrollArea/index.js +1 -0
  21. package/dist/esm/components/ScrollArea/styles.js +69 -0
  22. package/dist/esm/components/ScrollArea/types.js +1 -0
  23. package/dist/esm/components/Search/styles.js +2 -2
  24. package/dist/esm/components/TextAreaInput/styles.js +7 -2
  25. package/dist/esm/components/Toggle/styles.js +3 -3
  26. package/dist/esm/components/index.js +1 -0
  27. package/dist/esm/index.js +1 -0
  28. package/dist/esm/stylesheets/colors.js +57 -0
  29. package/dist/esm/stylesheets/palette.js +6 -0
  30. package/dist/types/components/Accordion/component.d.ts +1 -1
  31. package/dist/types/components/Accordion/constants.d.ts +7 -1
  32. package/dist/types/components/Accordion/styles.d.ts +2 -1
  33. package/dist/types/components/Accordion/types.d.ts +7 -1
  34. package/dist/types/components/Hint/component.d.ts +2 -1
  35. package/dist/types/components/Hint/types.d.ts +6 -2
  36. package/dist/types/components/ScrollArea/component.d.ts +11 -0
  37. package/dist/types/components/ScrollArea/constants.d.ts +3 -0
  38. package/dist/types/components/ScrollArea/index.d.ts +1 -0
  39. package/dist/types/components/ScrollArea/styles.d.ts +2 -0
  40. package/dist/types/components/ScrollArea/types.d.ts +37 -0
  41. package/dist/types/components/index.d.ts +1 -0
  42. package/dist/types/index.d.ts +1 -0
  43. package/dist/types/stylesheets/colors.d.ts +57 -0
  44. package/dist/types/stylesheets/palette.d.ts +4 -0
  45. package/package.json +21 -1
@@ -3,7 +3,7 @@ import * as Styled from './styles';
3
3
  import { MdExpandMore } from 'react-icons/md';
4
4
  import Tippy from '@tippyjs/react';
5
5
  import 'tippy.js/dist/tippy.css';
6
- import { DEFAULT_TOOLTIP_PLACEMENT } from './constants';
6
+ import { DEFAULT_TOOLTIP_PLACEMENT, DEFAULT_BUTTON_HEADER_POSITION } from './constants';
7
7
  /**
8
8
  * A customizable Accordion component that allows expanding and collapsing content.
9
9
  *
@@ -11,7 +11,7 @@ import { DEFAULT_TOOLTIP_PLACEMENT } from './constants';
11
11
  * with a smooth animation. It also supports an optional tooltip on the header.
12
12
  *
13
13
  */
14
- function Accordion({ title, tooltipLabel = undefined, tooltipPlacement = DEFAULT_TOOLTIP_PLACEMENT, ariaLabel, ariaLabelledBy, ariaDescribedBy, buttonHeader = null, children, }) {
14
+ function Accordion({ title, tooltipLabel = undefined, tooltipPlacement = DEFAULT_TOOLTIP_PLACEMENT, ariaLabel, ariaLabelledBy, ariaDescribedBy, buttonHeader = null, buttonHeaderPosition = DEFAULT_BUTTON_HEADER_POSITION, children, }) {
15
15
  var _a;
16
16
  const [isExpanded, setIsExpanded] = useState(false);
17
17
  const contentRef = useRef(null);
@@ -20,7 +20,7 @@ function Accordion({ title, tooltipLabel = undefined, tooltipPlacement = DEFAULT
20
20
  React.createElement(Styled.ExpandIcon, { "$expanded": isExpanded },
21
21
  React.createElement(MdExpandMore, null)),
22
22
  React.createElement(Styled.TitleText, null, title),
23
- buttonHeader)));
23
+ React.createElement(Styled.ButtonHeaderWrapper, { "$position": buttonHeaderPosition }, buttonHeader))));
24
24
  return (React.createElement(React.Fragment, null,
25
25
  tooltipLabel ? (React.createElement(Tippy, { content: tooltipLabel, placement: tooltipPlacement }, expandButton)) : (expandButton),
26
26
  React.createElement(Styled.AccordionContent, { ref: contentRef, "$expanded": isExpanded, "$scrollHeight": ((_a = contentRef.current) === null || _a === void 0 ? void 0 : _a.scrollHeight) || 0 }, children)));
@@ -6,4 +6,10 @@ const TOOLTIP_PLACEMENTS = {
6
6
  };
7
7
  const TOOLTIP_PLACEMENT_VALUES = Object.values(TOOLTIP_PLACEMENTS);
8
8
  const DEFAULT_TOOLTIP_PLACEMENT = TOOLTIP_PLACEMENTS.TOP;
9
- export { TOOLTIP_PLACEMENTS, TOOLTIP_PLACEMENT_VALUES, DEFAULT_TOOLTIP_PLACEMENT, };
9
+ const BUTTON_HEADER_POSITIONS = {
10
+ LEFT: 'left',
11
+ RIGHT: 'right',
12
+ };
13
+ const BUTTON_HEADER_POSITION_VALUES = Object.values(BUTTON_HEADER_POSITIONS);
14
+ const DEFAULT_BUTTON_HEADER_POSITION = BUTTON_HEADER_POSITIONS.LEFT;
15
+ export { TOOLTIP_PLACEMENTS, TOOLTIP_PLACEMENT_VALUES, DEFAULT_TOOLTIP_PLACEMENT, BUTTON_HEADER_POSITIONS, BUTTON_HEADER_POSITION_VALUES, DEFAULT_BUTTON_HEADER_POSITION, };
@@ -46,6 +46,11 @@ export const ExpandIcon = styled.div `
46
46
  filter: brightness(0.9);
47
47
  }
48
48
  `;
49
+ export const ButtonHeaderWrapper = styled.span `
50
+ display: flex;
51
+ align-items: center;
52
+ margin-left: ${({ $position }) => ($position === 'right' ? 'auto' : '0')};
53
+ `;
49
54
  export const TitleText = styled.span `
50
55
  font-size: ${fontSizeDefault};
51
56
  font-weight: 400;
@@ -9,7 +9,7 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import React from 'react';
12
+ import React, { useState } from 'react';
13
13
  import * as Styled from './styles';
14
14
  import { MdClose, MdInfo } from 'react-icons/md';
15
15
  /**
@@ -18,9 +18,20 @@ import { MdClose, MdInfo } from 'react-icons/md';
18
18
  * This component provides a small contextual hint used to surface tips, short help text or dismissible messages.
19
19
  * It can be displayed with a title, an icon, and a close button.
20
20
  *
21
+ * Visibility is uncontrolled by default (the hint closes itself when its close button is clicked); pass `open` to control it externally instead.
21
22
  */
22
23
  function Hint(_a) {
23
- var { title, label, icon = React.createElement(MdInfo, { fontSize: "1rem" }), onRequestClose, children } = _a, rest = __rest(_a, ["title", "label", "icon", "onRequestClose", "children"]);
24
+ var { title, label, icon = React.createElement(MdInfo, { fontSize: "1rem" }), open, onRequestClose, hideCloseButton = false, children } = _a, rest = __rest(_a, ["title", "label", "icon", "open", "onRequestClose", "hideCloseButton", "children"]);
25
+ const isControlled = open !== undefined;
26
+ const [internalOpen, setInternalOpen] = useState(true);
27
+ const isOpen = isControlled ? open : internalOpen;
28
+ const handleClose = () => {
29
+ if (!isControlled)
30
+ setInternalOpen(false);
31
+ onRequestClose === null || onRequestClose === void 0 ? void 0 : onRequestClose();
32
+ };
33
+ if (!isOpen)
34
+ return null;
24
35
  const renderedLabel = React.createElement(Styled.Label, null,
25
36
  label,
26
37
  children);
@@ -30,7 +41,7 @@ function Hint(_a) {
30
41
  React.createElement(Styled.IconWrapper, { "aria-hidden": "true" }, icon),
31
42
  title && React.createElement(Styled.Title, null, title),
32
43
  !title && renderedLabel),
33
- title && (React.createElement(Styled.CloseButton, { type: "button", "aria-label": "Close", onClick: onRequestClose },
44
+ !hideCloseButton && (React.createElement(Styled.CloseButton, { type: "button", "aria-label": "Close", onClick: handleClose },
34
45
  React.createElement(MdClose, { fontSize: "1rem" })))),
35
46
  title && renderedLabel));
36
47
  }
@@ -1,5 +1,5 @@
1
1
  import styled, { css } from 'styled-components';
2
- import { colorBorderDefault, colorBorderSelected, colorBorderError, colorTextDefault, colorTextLight, colorError, colorSuccess, } from '../../stylesheets/palette';
2
+ import { colorBorderDefault, colorBorderSelected, colorBorderError, colorBorderFocusRing, colorTextDefault, colorTextLight, colorError, colorSuccess, } from '../../stylesheets/palette';
3
3
  import { borderRadiusDefault, spacingSmall, spacingMedium } from '../../stylesheets/sizing';
4
4
  import { fontSizeSmall } from '../../stylesheets/typography';
5
5
  export const Wrapper = styled.div `
@@ -29,7 +29,7 @@ export const FieldContainer = styled.div `
29
29
 
30
30
  &:focus-within {
31
31
  border-color: ${colorBorderSelected};
32
- box-shadow: 0 0 0 3px var(--color-border-focus-ring, rgba(29, 101, 212, 0.15));
32
+ box-shadow: 0 0 0 3px ${colorBorderFocusRing};
33
33
  }
34
34
 
35
35
  ${({ $error }) => $error &&
@@ -1,6 +1,6 @@
1
1
  import styled from 'styled-components';
2
2
  import { spacingLarge, spacingMedium, spacingSmallMedium, borderRadiusDefault } from '../../stylesheets/sizing';
3
- import { colorWhite } from '../../stylesheets/palette';
3
+ import { colorWhite, colorOverlay } from '../../stylesheets/palette';
4
4
  export const modalStyles = {
5
5
  overlay: {
6
6
  position: 'fixed',
@@ -8,7 +8,7 @@ export const modalStyles = {
8
8
  left: 0,
9
9
  right: 0,
10
10
  bottom: 0,
11
- backgroundColor: 'rgba(0, 0, 0, 0.75)',
11
+ backgroundColor: colorOverlay,
12
12
  zIndex: 100,
13
13
  display: 'flex',
14
14
  alignItems: 'center',
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import * as Styled from './styles';
3
+ import { DEFAULT_VERTICAL_SCROLL, DEFAULT_HORIZONTAL_SCROLL, DEFAULT_FADE_EDGES } from './constants';
4
+ /**
5
+ * A wrapper that applies standardized scrollbar styling to its content.
6
+ *
7
+ * Use it around any scrollable area (chat, lists, side panels) to get a consistent
8
+ * scrollbar look, with optional axis control, size capping, and edge fading.
9
+ *
10
+ */
11
+ function ScrollArea({ children, verticalScroll = DEFAULT_VERTICAL_SCROLL, horizontalScroll = DEFAULT_HORIZONTAL_SCROLL, maxHeight, maxWidth, fadeEdges = DEFAULT_FADE_EDGES, fadeColor, paddingTop, paddingRight, paddingBottom, paddingLeft, }) {
12
+ const isScrollable = verticalScroll || horizontalScroll;
13
+ return (React.createElement(Styled.ScrollAreaWrapper, { "$verticalScroll": verticalScroll, "$horizontalScroll": horizontalScroll, "$maxHeight": maxHeight, "$maxWidth": maxWidth, "$fadeEdges": fadeEdges, "$fadeColor": fadeColor, "$paddingTop": paddingTop, "$paddingRight": paddingRight, "$paddingBottom": paddingBottom, "$paddingLeft": paddingLeft, tabIndex: isScrollable ? 0 : undefined }, children));
14
+ }
15
+ export default ScrollArea;
@@ -0,0 +1,3 @@
1
+ export const DEFAULT_VERTICAL_SCROLL = true;
2
+ export const DEFAULT_HORIZONTAL_SCROLL = false;
3
+ export const DEFAULT_FADE_EDGES = true;
@@ -0,0 +1 @@
1
+ export { default as BBBScrollArea } from './component';
@@ -0,0 +1,69 @@
1
+ import styled, { css } from 'styled-components';
2
+ const FADE_MASK_SIZE = '40px';
3
+ const FADE_SHADOW_SIZE = '14px';
4
+ const FADE_SHADOW_COLOR = 'rgba(0, 0, 0, .2)';
5
+ const verticalFadeLayers = (color) => [
6
+ { image: `linear-gradient(${color} 30%, transparent)`, position: '0 0', size: `100% ${FADE_MASK_SIZE}`, attachment: 'local' },
7
+ { image: `linear-gradient(transparent, ${color} 70%)`, position: '0 100%', size: `100% ${FADE_MASK_SIZE}`, attachment: 'local' },
8
+ { image: `radial-gradient(farthest-side at 50% 0, ${FADE_SHADOW_COLOR}, transparent)`, position: '0 0', size: `100% ${FADE_SHADOW_SIZE}`, attachment: 'scroll' },
9
+ { image: `radial-gradient(farthest-side at 50% 100%, ${FADE_SHADOW_COLOR}, transparent)`, position: '0 100%', size: `100% ${FADE_SHADOW_SIZE}`, attachment: 'scroll' },
10
+ ];
11
+ const horizontalFadeLayers = (color) => [
12
+ { image: `linear-gradient(to right, ${color} 30%, transparent)`, position: '0 0', size: `${FADE_MASK_SIZE} 100%`, attachment: 'local' },
13
+ { image: `linear-gradient(to right, transparent, ${color} 70%)`, position: '100% 0', size: `${FADE_MASK_SIZE} 100%`, attachment: 'local' },
14
+ { image: `radial-gradient(farthest-side at 0 50%, ${FADE_SHADOW_COLOR}, transparent)`, position: '0 0', size: `${FADE_SHADOW_SIZE} 100%`, attachment: 'scroll' },
15
+ { image: `radial-gradient(farthest-side at 100% 50%, ${FADE_SHADOW_COLOR}, transparent)`, position: '100% 0', size: `${FADE_SHADOW_SIZE} 100%`, attachment: 'scroll' },
16
+ ];
17
+ const fadeBackground = ({ $verticalScroll, $horizontalScroll, $fadeEdges, $fadeColor, }) => {
18
+ if (!$fadeEdges || !$fadeColor)
19
+ return '';
20
+ const layers = [
21
+ ...($verticalScroll ? verticalFadeLayers($fadeColor) : []),
22
+ ...($horizontalScroll ? horizontalFadeLayers($fadeColor) : []),
23
+ ];
24
+ if (!layers.length)
25
+ return '';
26
+ return css `
27
+ background-image: ${layers.map((layer) => layer.image).join(', ')};
28
+ background-position: ${layers.map((layer) => layer.position).join(', ')};
29
+ background-size: ${layers.map((layer) => layer.size).join(', ')};
30
+ background-attachment: ${layers.map((layer) => layer.attachment).join(', ')};
31
+ background-repeat: no-repeat;
32
+ background-color: transparent;
33
+ `;
34
+ };
35
+ export const ScrollAreaWrapper = styled.div `
36
+ overflow-y: ${({ $verticalScroll }) => ($verticalScroll ? 'auto' : 'hidden')};
37
+ overflow-x: ${({ $horizontalScroll }) => ($horizontalScroll ? 'auto' : 'hidden')};
38
+ ${({ $maxHeight }) => $maxHeight && css `max-height: ${$maxHeight};`}
39
+ ${({ $maxWidth }) => $maxWidth && css `max-width: ${$maxWidth};`}
40
+ ${({ $paddingTop }) => $paddingTop && css `padding-top: ${$paddingTop};`}
41
+ ${({ $paddingRight }) => $paddingRight && css `padding-right: ${$paddingRight};`}
42
+ ${({ $paddingBottom }) => $paddingBottom && css `padding-bottom: ${$paddingBottom};`}
43
+ ${({ $paddingLeft }) => $paddingLeft && css `padding-left: ${$paddingLeft};`}
44
+ ${fadeBackground}
45
+
46
+ &::-webkit-scrollbar {
47
+ width: 5px;
48
+ height: 5px;
49
+ }
50
+ &::-webkit-scrollbar-button {
51
+ width: 0;
52
+ height: 0;
53
+ }
54
+ &::-webkit-scrollbar-thumb {
55
+ background: rgba(0, 0, 0, .25);
56
+ border: none;
57
+ border-radius: 50px;
58
+ }
59
+ &::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, .5); }
60
+ &::-webkit-scrollbar-thumb:active { background: rgba(0, 0, 0, .25); }
61
+ &::-webkit-scrollbar-track {
62
+ background: rgba(0, 0, 0, .25);
63
+ border: none;
64
+ border-radius: 50px;
65
+ }
66
+ &::-webkit-scrollbar-track:hover { background: rgba(0, 0, 0, .25); }
67
+ &::-webkit-scrollbar-track:active { background: rgba(0, 0, 0, .25); }
68
+ &::-webkit-scrollbar-corner { background: 0 0; }
69
+ `;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,5 @@
1
1
  import styled, { css } from 'styled-components';
2
- import { colorBorderDefault, colorBorderSelected, colorTextDefault, colorTextLight, colorIconDefault, colorIconBlue, colorBrand1, } from '../../stylesheets/palette';
2
+ import { colorBorderDefault, colorBorderSelected, colorBorderFocusRing, colorTextDefault, colorTextLight, colorIconDefault, colorIconBlue, colorBrand1, } from '../../stylesheets/palette';
3
3
  import { spacingSmall, spacingMedium, borderRadiusDefault, } from '../../stylesheets/sizing';
4
4
  import { fontSizeSmall } from '../../stylesheets/typography';
5
5
  export const Container = styled.div `
@@ -19,7 +19,7 @@ export const Container = styled.div `
19
19
 
20
20
  &:focus-within {
21
21
  border-color: ${colorBorderSelected};
22
- box-shadow: 0 0 0 3px var(--color-border-focus-ring, rgba(29, 101, 212, 0.15));
22
+ box-shadow: 0 0 0 3px ${colorBorderFocusRing};
23
23
  }
24
24
 
25
25
  ${({ $disabled }) => $disabled &&
@@ -1,12 +1,12 @@
1
1
  import styled from 'styled-components';
2
- import { colorBorderDefault, colorBrand1, colorBrand2, colorLightGray, colorWhite } from '../../stylesheets/palette';
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: ${colorLightGray};
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: '0 2px 4px 0 rgb(0 35 11 / 20%)',
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: 'rgba(255,255,255,.35)',
105
+ backgroundColor: colorIconDefaultDark,
106
106
  })),
107
107
  }));
@@ -6,6 +6,7 @@ export { BBBHint } from './Hint';
6
6
  export { BBBInput } from './Input';
7
7
  export { BBBModal } from './Modal';
8
8
  export { BBBNavigation } from './Navigation';
9
+ export { BBBScrollArea } from './ScrollArea';
9
10
  export { BBBSearch } from './Search';
10
11
  export { BBBSelect } from './Select';
11
12
  export { BBBSpinner } from './Spinner';
package/dist/esm/index.js CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './components';
2
2
  export * from './stylesheets/palette';
3
3
  export * from './stylesheets/sizing';
4
+ export * from './stylesheets/colors';
@@ -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
+ };
@@ -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,12 @@ 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%))';
@@ -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
- export { TOOLTIP_PLACEMENTS, TOOLTIP_PLACEMENT_VALUES, DEFAULT_TOOLTIP_PLACEMENT, };
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
  }
@@ -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; if provided, shows a close button. */
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
- /** Callback fired when the close button is clicked. */
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
  }
@@ -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,3 @@
1
+ export declare const DEFAULT_VERTICAL_SCROLL = true;
2
+ export declare const DEFAULT_HORIZONTAL_SCROLL = false;
3
+ export declare const DEFAULT_FADE_EDGES = true;
@@ -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
+ }
@@ -6,6 +6,7 @@ export { BBBHint } from './Hint';
6
6
  export { BBBInput } from './Input';
7
7
  export { BBBModal } from './Modal';
8
8
  export { BBBNavigation } from './Navigation';
9
+ export { BBBScrollArea } from './ScrollArea';
9
10
  export { BBBSearch } from './Search';
10
11
  export { BBBSelect } from './Select';
11
12
  export { BBBSpinner } from './Spinner';
@@ -1,3 +1,4 @@
1
1
  export * from './components';
2
2
  export * from './stylesheets/palette';
3
3
  export * from './stylesheets/sizing';
4
+ export * from './stylesheets/colors';
@@ -0,0 +1,57 @@
1
+ export declare const colors: {
2
+ readonly neutral: {
3
+ readonly neutral2: "var(--color-neutral-2, #717C91)";
4
+ readonly neutral3: "var(--color-neutral-3, #B0BDC9)";
5
+ readonly neutral4: "var(--color-neutral-4, #DCE4EC)";
6
+ readonly white: "var(--color-neutral-white, #FFFFFF)";
7
+ readonly lightGray: "var(--color-light-gray, #F4F6FA)";
8
+ readonly gray: "var(--color-gray, #4E5A66)";
9
+ readonly darkGray: "var(--color-dark-gray, #393C48)";
10
+ };
11
+ readonly brand: {
12
+ readonly brand1: "var(--color-primary, var(--color-brand-1, #0F70D7))";
13
+ readonly brand2: "var(--color-brand-2, var(--color-brand-1, #0F70D7))";
14
+ readonly brand3: "var(--color-brand-3, var(--color-brand-1, #0F70D7))";
15
+ readonly light: "var(--color-blue-aux, var(--color-brand-light, #E5EFFB))";
16
+ readonly aux: "var(--color-brand-aux, var(--color-brand-light, #E5EFFB))";
17
+ };
18
+ readonly semantic: {
19
+ readonly success: "var(--color-success, #2DD36F)";
20
+ readonly warning: "var(--color-warning, #F59240)";
21
+ readonly error: "var(--color-danger, var(--color-error, #DF2721))";
22
+ readonly errorDark: "var(--color-danger-dark, var(--color-error-dark, #AE1010))";
23
+ };
24
+ readonly background: {
25
+ readonly white: "var(--color-background-white, var(--color-neutral-white, #FFFFFF))";
26
+ readonly light: "var(--color-background-light, var(--color-light-gray, #F4F6FA))";
27
+ readonly blue: "var(--color-background-blue, var(--color-brand-light, #E5EFFB))";
28
+ };
29
+ readonly border: {
30
+ readonly default: "var(--default-border, var(--color-border-default, var(--color-neutral-3, #B0BDC9)))";
31
+ readonly selected: "var(--color-border-selected, var(--color-brand-1, #0F70D7))";
32
+ readonly error: "var(--color-border-error, var(--color-error, #DF2721))";
33
+ readonly focusRing: "var(--color-border-focus-ring, rgba(29, 101, 212, 0.15))";
34
+ };
35
+ readonly text: {
36
+ readonly default: "var(--color-text-default, var(--color-dark-gray, #393C48))";
37
+ readonly light: "var(--color-text-light, var(--color-neutral-2, #717C91))";
38
+ };
39
+ readonly icon: {
40
+ readonly default: "var(--color-icon-default, var(--color-neutral-2, #717C91))";
41
+ readonly blue: "var(--color-icon-blue, var(--color-brand-1, #0F70D7))";
42
+ readonly white: "var(--color-icon-white, var(--color-neutral-white, #FFFFFF))";
43
+ readonly defaultDark: "var(--color-icon-default-dark, rgba(255, 255, 255, 0.35))";
44
+ };
45
+ readonly hover: {
46
+ readonly dark: "var(--color-hover-dark, #0C57A7)";
47
+ readonly light: "var(--color-hover-light, #D4E5FA)";
48
+ readonly neutral: "var(--color-hover-neutral, var(--color-neutral-4, #DCE4EC))";
49
+ };
50
+ readonly overlay: {
51
+ readonly default: "var(--color-overlay, rgba(0, 0, 0, 0.75))";
52
+ };
53
+ readonly shadow: {
54
+ readonly default: "var(--color-shadow-default, rgb(0 35 11 / 20%))";
55
+ };
56
+ };
57
+ export type Colors = typeof colors;