@bigbluebutton/bbb-ui-components-react 0.8.0 → 0.9.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 (35) hide show
  1. package/README.md +2 -2
  2. package/dist/components/Accordion.js +1 -1
  3. package/dist/components/Avatar.js +1 -1
  4. package/dist/components/Button.js +41 -40
  5. package/dist/components/Checkbox.js +3 -3
  6. package/dist/components/Input.js +67 -66
  7. package/dist/components/Modal.js +87 -79
  8. package/dist/components/Search.js +1 -1
  9. package/dist/components/Select.js +9 -9
  10. package/dist/components/Slider.js +2 -2
  11. package/dist/components/TextAreaInput.js +1 -1
  12. package/dist/components/TextInput.js +10 -10
  13. package/dist/components/Toggle.js +12 -12
  14. package/dist/components/colors.js +1 -1
  15. package/dist/components/index.js +207 -199
  16. package/dist/esm/components/Button/component.js +7 -7
  17. package/dist/esm/components/Button/constants.js +8 -1
  18. package/dist/esm/components/Button/styles.js +6 -5
  19. package/dist/esm/components/Checkbox/component.js +7 -3
  20. package/dist/esm/components/Modal/component.js +2 -4
  21. package/dist/esm/components/Modal/styles.js +12 -1
  22. package/dist/esm/components/Toggle/component.js +16 -2
  23. package/dist/esm/stylesheets/palette.js +5 -3
  24. package/dist/types/components/Button/constants.d.ts +8 -1
  25. package/dist/types/components/Button/type.d.ts +9 -1
  26. package/dist/types/components/Checkbox/component.d.ts +1 -1
  27. package/dist/types/components/Checkbox/types.d.ts +1 -1
  28. package/dist/types/components/Modal/styles.d.ts +3 -1
  29. package/dist/types/components/Slider/styles.d.ts +1 -1
  30. package/dist/types/components/TextInput/styles.d.ts +1 -1
  31. package/dist/types/components/Toggle/component.d.ts +1 -1
  32. package/dist/types/components/Toggle/types.d.ts +1 -1
  33. package/dist/types/stylesheets/colors.d.ts +5 -5
  34. package/dist/types/stylesheets/palette.d.ts +5 -5
  35. package/package.json +3 -3
@@ -1,6 +1,6 @@
1
1
  import React, { useCallback, useEffect, useId, useRef, useState, } from 'react';
2
2
  import { MdSettings, MdCheckCircle } from 'react-icons/md';
3
- import { DEFAULT_VARIANT, DEFAULT_COLOR, DEFAULT_SIZE, DEFAULT_LAYOUT, LAYOUTS, DEFAULT_TOOLTIP_PLACEMENT, } from './constants';
3
+ import { DEFAULT_VARIANT, DEFAULT_COLOR, DEFAULT_SIZE, DEFAULT_LAYOUT, LAYOUTS, DEFAULT_TOOLTIP_PLACEMENT, DEFAULT_TYPE, } from './constants';
4
4
  import * as Styled from './styles';
5
5
  import Tippy from '@tippyjs/react';
6
6
  import 'tippy.js/dist/tippy.css';
@@ -13,7 +13,7 @@ import 'tippy.js/dist/tippy.css';
13
13
  *
14
14
  */
15
15
  function Button(props) {
16
- const { id = '', dataTest, label, tooltipLabel, tooltipPlacement = DEFAULT_TOOLTIP_PLACEMENT, onClick, onKeyDown, ariaLabel = '', ariaLabelledBy = '', ariaDescribedBy = '', color = DEFAULT_COLOR, variant = DEFAULT_VARIANT, size = DEFAULT_SIZE, layout = DEFAULT_LAYOUT, disabled = false, children, showFeedback = false, feedbackContent = React.createElement(MdCheckCircle, { fontSize: "small" }), feedbackDuration = 2000, } = props;
16
+ const { id = '', dataTest, label, tooltipLabel, tooltipPlacement = DEFAULT_TOOLTIP_PLACEMENT, onClick, onKeyDown, ariaLabel = '', ariaLabelledBy = '', ariaDescribedBy = '', color = DEFAULT_COLOR, variant = DEFAULT_VARIANT, size = DEFAULT_SIZE, layout = DEFAULT_LAYOUT, type = DEFAULT_TYPE, disabled = false, children, showFeedback = false, feedbackContent = React.createElement(MdCheckCircle, { fontSize: "small" }), feedbackDuration = 2000, className, } = props;
17
17
  const feedbackTimeoutRef = useRef(null);
18
18
  const [isFeedbackVisible, setFeedbackVisible] = useState(false);
19
19
  useEffect(() => () => {
@@ -52,13 +52,13 @@ function Button(props) {
52
52
  if (props.layout === LAYOUTS.CIRCLE || props.layout === LAYOUTS.SQUARED) {
53
53
  const { icon } = props;
54
54
  const testId = dataTest || `button-${id || 'default'}`;
55
- return (React.createElement(Styled.Button, Object.assign({ id: id, "data-test": testId, onClick: handleClick, onKeyDown: onKeyDown }, accessibilityProps, { "$color": color, "$variant": variant, "$size": size, "$layout": layout, disabled: disabled }), isFeedbackVisible ? (React.createElement(Styled.FeedbackContent, { role: "status", "aria-live": "polite" }, feedbackContent)) : icon));
55
+ return (React.createElement(Styled.Button, Object.assign({ id: id, className: className, type: type, "data-test": testId, onClick: handleClick, onKeyDown: onKeyDown }, accessibilityProps, { "$color": color, "$variant": variant, "$size": size, "$layout": layout, disabled: disabled }), isFeedbackVisible ? (React.createElement(Styled.FeedbackContent, { role: "status", "aria-live": "polite" }, feedbackContent)) : icon));
56
56
  }
57
57
  if (props.layout === LAYOUTS.STACKED) {
58
58
  const { icon, helperIcon = React.createElement(MdSettings, { fontSize: "small" }), hideHelperIcon = false, helperOnClick = null, } = props;
59
59
  const testId = dataTest || `${LAYOUTS.STACKED}-button-${id || label || 'default'}`;
60
- return (React.createElement(Styled.ButtonWrapper, { "data-test": testId, "$layout": layout },
61
- React.createElement(Styled.Button, Object.assign({ id: id, onClick: handleClick, onKeyDown: onKeyDown }, accessibilityProps, { "$color": color, "$variant": variant, "$size": size, "$layout": layout, disabled: disabled }),
60
+ return (React.createElement(Styled.ButtonWrapper, { className: className, "data-test": testId, "$layout": layout },
61
+ React.createElement(Styled.Button, Object.assign({ id: id, type: type, onClick: handleClick, onKeyDown: onKeyDown }, accessibilityProps, { "$color": color, "$variant": variant, "$size": size, "$layout": layout, disabled: disabled }),
62
62
  !hideHelperIcon && (React.createElement(Styled.HelperIconContainer
63
63
  // Add this property only when there is a onClick function for the auxiliary icon.
64
64
  // It controls whether the auxiliary button is going to have an independent hover state.
@@ -74,9 +74,9 @@ function Button(props) {
74
74
  React.createElement(Styled.FeedbackContent, { role: "status", "aria-live": "polite" }, feedbackContent))) : (icon && React.createElement(Styled.IconWrapper, null, icon))),
75
75
  React.createElement(Styled.ButtonText, { id: defaultLabelId }, label)));
76
76
  }
77
- const { iconStart, iconEnd } = props;
77
+ const { iconStart, iconEnd, fullWidth = false } = props;
78
78
  const testId = dataTest || `button-${id || label || 'default'}`;
79
- return (React.createElement(Styled.Button, Object.assign({ id: id, "data-test": testId, onClick: handleClick, onKeyDown: onKeyDown }, accessibilityProps, { "$color": color, "$variant": variant, "$size": size, "$layout": layout, disabled: disabled }), isFeedbackVisible ? (React.createElement(Styled.FeedbackContent, { id: defaultLabelId, role: "status", "aria-live": "polite" }, feedbackContent)) : (React.createElement(React.Fragment, null,
79
+ return (React.createElement(Styled.Button, Object.assign({ id: id, className: className, type: type, "data-test": testId, onClick: handleClick, onKeyDown: onKeyDown }, accessibilityProps, { "$color": color, "$variant": variant, "$size": size, "$layout": layout, "$fullWidth": fullWidth, disabled: disabled }), isFeedbackVisible ? (React.createElement(Styled.FeedbackContent, { id: defaultLabelId, role: "status", "aria-live": "polite" }, feedbackContent)) : (React.createElement(React.Fragment, null,
80
80
  iconStart && iconStart,
81
81
  label && React.createElement("span", { id: defaultLabelId }, label),
82
82
  children,
@@ -37,6 +37,13 @@ const TOOLTIP_PLACEMENTS = {
37
37
  };
38
38
  const TOOLTIP_PLACEMENT_VALUES = Object.values(TOOLTIP_PLACEMENTS);
39
39
  const DEFAULT_TOOLTIP_PLACEMENT = TOOLTIP_PLACEMENTS.TOP;
40
+ const TYPES = {
41
+ BUTTON: 'button',
42
+ SUBMIT: 'submit',
43
+ RESET: 'reset',
44
+ };
45
+ const TYPE_VALUES = Object.values(TYPES);
46
+ const DEFAULT_TYPE = TYPES.BUTTON;
40
47
  const CSS_COLOR_PROPERTIES = {
41
48
  primary: {
42
49
  default: {
@@ -174,4 +181,4 @@ const CSS_SIZE_PROPERTIES = {
174
181
  iconBoxSize: spacingXXLarge,
175
182
  },
176
183
  };
177
- export { VARIANTS, VARIANT_VALUES, DEFAULT_VARIANT, COLORS, COLOR_VALUES, DEFAULT_COLOR, SIZES, SIZE_VALUES, DEFAULT_SIZE, LAYOUTS, LAYOUT_VALUES, DEFAULT_LAYOUT, TOOLTIP_PLACEMENTS, TOOLTIP_PLACEMENT_VALUES, DEFAULT_TOOLTIP_PLACEMENT, CSS_COLOR_PROPERTIES, CSS_COLOR_PROPERTIES_DISABLED, CSS_SIZE_PROPERTIES, };
184
+ export { VARIANTS, VARIANT_VALUES, DEFAULT_VARIANT, COLORS, COLOR_VALUES, DEFAULT_COLOR, SIZES, SIZE_VALUES, DEFAULT_SIZE, LAYOUTS, LAYOUT_VALUES, DEFAULT_LAYOUT, TOOLTIP_PLACEMENTS, TOOLTIP_PLACEMENT_VALUES, DEFAULT_TOOLTIP_PLACEMENT, TYPES, TYPE_VALUES, DEFAULT_TYPE, CSS_COLOR_PROPERTIES, CSS_COLOR_PROPERTIES_DISABLED, CSS_SIZE_PROPERTIES, };
@@ -61,14 +61,14 @@ const commonButtonStyles = css `
61
61
  color: ${color};
62
62
  }
63
63
  color: ${color};
64
- ${background ? `background-color: ${background}` : `background-color: none`};
65
- border: ${border ? `1px solid ${border}` : 'none'};
64
+ ${background ? `background-color: ${background}` : `background-color: transparent`};
65
+ border: ${border ? `1px solid ${border}` : '1px solid transparent'};
66
66
 
67
67
  &&:hover,
68
68
  &&:active {
69
69
  color: ${color};
70
- ${background ? `background-color: ${background}` : `background-color: none`};
71
- border: ${border ? `1px solid ${border}` : 'none'};
70
+ ${background ? `background-color: ${background}` : `background-color: transparent`};
71
+ border: ${border ? `1px solid ${border}` : '1px solid transparent'};
72
72
  }
73
73
 
74
74
  &&:focus {
@@ -114,7 +114,8 @@ const squaredLayoutStyles = css `
114
114
  border-radius: ${borderRadiusSmall};
115
115
  `;
116
116
  const defaultLayoutStyles = css `
117
- display: inline-flex;
117
+ display: ${({ $fullWidth }) => ($fullWidth ? 'flex' : 'inline-flex')};
118
+ ${({ $fullWidth }) => $fullWidth && 'width: 100%;'}
118
119
  justify-content: center;
119
120
  align-items: center;
120
121
  gap: ${spacingSmall};
@@ -22,11 +22,15 @@ import { RadioButtonUnchecked, RadioButtonChecked } from '@mui/icons-material';
22
22
  *
23
23
  */
24
24
  function Checkbox(_a) {
25
- var { label, layout = DEFAULT_LAYOUT, round = false, ariaLabel, id, dataTest, inputProps } = _a, props = __rest(_a, ["label", "layout", "round", "ariaLabel", "id", "dataTest", "inputProps"]);
25
+ var { label, layout = DEFAULT_LAYOUT, round = false, ariaLabel, id, dataTest, slotProps } = _a, props = __rest(_a, ["label", "layout", "round", "ariaLabel", "id", "dataTest", "slotProps"]);
26
26
  const generatedId = useId();
27
27
  const checkboxId = id !== null && id !== void 0 ? id : generatedId;
28
- const mergedInputProps = Object.assign({ 'data-test': dataTest }, inputProps);
29
- const checkbox = (React.createElement(Styled.StyledCheckbox, Object.assign({}, props, { id: checkboxId, "aria-label": ariaLabel, icon: round ? React.createElement(RadioButtonUnchecked, null) : undefined, checkedIcon: round ? React.createElement(RadioButtonChecked, null) : undefined, inputProps: mergedInputProps })));
28
+ const ownInputProps = { 'aria-label': ariaLabel, 'data-test': dataTest };
29
+ const _b = slotProps !== null && slotProps !== void 0 ? slotProps : {}, { input: consumerInputSlotProps } = _b, otherSlotProps = __rest(_b, ["input"]);
30
+ const inputSlotProps = typeof consumerInputSlotProps === 'function'
31
+ ? (ownerState) => (Object.assign(Object.assign({}, ownInputProps), consumerInputSlotProps(ownerState)))
32
+ : Object.assign(Object.assign({}, ownInputProps), consumerInputSlotProps);
33
+ const checkbox = (React.createElement(Styled.StyledCheckbox, Object.assign({}, props, { id: checkboxId, icon: round ? React.createElement(RadioButtonUnchecked, null) : undefined, checkedIcon: round ? React.createElement(RadioButtonChecked, null) : undefined, slotProps: Object.assign(Object.assign({}, otherSlotProps), { input: inputSlotProps }) })));
30
34
  if (!label) {
31
35
  return checkbox;
32
36
  }
@@ -10,9 +10,7 @@ var __rest = (this && this.__rest) || function (s, e) {
10
10
  return t;
11
11
  };
12
12
  import React, { useCallback } from 'react';
13
- import ReactModal from 'react-modal';
14
13
  import * as Styled from './styles';
15
- import { BBBTypography } from '../Typography';
16
14
  import { MdClose } from 'react-icons/md';
17
15
  import { BBBDivider } from '../Divider';
18
16
  import { BBButton } from '../Button';
@@ -32,9 +30,9 @@ const Modal = (_a) => {
32
30
  const renderFooter = useCallback((isSticky) => (React.createElement(React.Fragment, null,
33
31
  showDividers && React.createElement(BBBDivider, null),
34
32
  React.createElement(Styled.ModalFooter, { "$stickyFooter": isSticky }, footerContent))), [footerContent, showDividers]);
35
- return (React.createElement(ReactModal, Object.assign({}, rest, { isOpen: isOpen, onRequestClose: onRequestClose, contentLabel: contentLabel, style: Styled.modalStyles, shouldCloseOnOverlayClick: shouldCloseOnOverlayClick, shouldCloseOnEsc: shouldCloseOnEsc, appElement: appElement, testId: testId }),
33
+ return (React.createElement(Styled.Modal, Object.assign({}, rest, { isOpen: isOpen, onRequestClose: onRequestClose, contentLabel: contentLabel, style: Styled.modalStyles, shouldCloseOnOverlayClick: shouldCloseOnOverlayClick, shouldCloseOnEsc: shouldCloseOnEsc, appElement: appElement, testId: testId }),
36
34
  React.createElement(Styled.ModalHeader, null,
37
- React.createElement(BBBTypography, { variant: "header" }, title),
35
+ React.createElement(Styled.ModalTitle, { variant: "header" }, title),
38
36
  !hideCloseButton && (React.createElement(BBButton, Object.assign({ layout: "circle", icon: React.createElement(MdClose, { size: "1.5rem" }), onClick: onRequestClose, variant: "subtle", ariaLabel: "close" }, (_closeButtonDataTest ? { dataTest: _closeButtonDataTest } : {}))))),
39
37
  showDividers && React.createElement(BBBDivider, null),
40
38
  React.createElement(Styled.ModalScrollArea, { "$allowScroll": allowScroll },
@@ -1,6 +1,8 @@
1
1
  import styled from 'styled-components';
2
+ import ReactModal from 'react-modal';
2
3
  import { spacingLarge, spacingMedium, spacingSmallMedium, borderRadiusDefault } from '../../stylesheets/sizing';
3
4
  import { colorWhite, colorOverlay } from '../../stylesheets/palette';
5
+ import { BBBTypography } from '../Typography';
4
6
  export const modalStyles = {
5
7
  overlay: {
6
8
  position: 'fixed',
@@ -21,7 +23,6 @@ export const modalStyles = {
21
23
  right: 'auto',
22
24
  bottom: 'auto',
23
25
  borderRadius: borderRadiusDefault,
24
- background: colorWhite,
25
26
  overflow: 'hidden',
26
27
  WebkitOverflowScrolling: 'touch',
27
28
  outline: 'none',
@@ -38,6 +39,12 @@ export const ModalHeader = styled.div `
38
39
  display: flex;
39
40
  justify-content: space-between;
40
41
  align-items: center;
42
+ gap: ${spacingMedium};
43
+ `;
44
+ export const ModalTitle = styled(BBBTypography) `
45
+ flex: 1;
46
+ min-width: 0;
47
+ overflow-wrap: anywhere;
41
48
  `;
42
49
  export const ModalScrollArea = styled.div `
43
50
  flex-grow: 1;
@@ -64,3 +71,7 @@ export const ModalFooter = styled.div `
64
71
  background-color: ${colorWhite};
65
72
  `}
66
73
  `;
74
+ // Background lives in a class instead of the inline `style` so the BBB dark theme and consumers can override it.
75
+ export const Modal = styled(ReactModal) `
76
+ background: ${colorWhite};
77
+ `;
@@ -20,16 +20,30 @@ import { DEFAULT_TEXT_POSITION } from './constants';
20
20
  *
21
21
  */
22
22
  function Toggle(_a) {
23
- var { label, helperText, textPosition = DEFAULT_TEXT_POSITION, onChange, ariaLabel, ariaLabelledBy, ariaDescribedBy, id: providedId } = _a, rest = __rest(_a, ["label", "helperText", "textPosition", "onChange", "ariaLabel", "ariaLabelledBy", "ariaDescribedBy", "id"]);
23
+ var { label, helperText, textPosition = DEFAULT_TEXT_POSITION, onChange, ariaLabel, ariaLabelledBy, ariaDescribedBy, id: providedId, slotProps } = _a, rest = __rest(_a, ["label", "helperText", "textPosition", "onChange", "ariaLabel", "ariaLabelledBy", "ariaDescribedBy", "id", "slotProps"]);
24
24
  const generatedUniqueId = useId();
25
25
  const id = providedId !== null && providedId !== void 0 ? providedId : generatedUniqueId;
26
26
  const labelId = label ? `${id}-label` : undefined;
27
27
  const helperTextId = helperText ? `${id}-helper` : undefined;
28
+ const ariaLabelledByValue = ariaLabel ? undefined : ariaLabelledBy || labelId;
29
+ // Without a name source, the <label htmlFor> names the input from the helper text,
30
+ // so it can't also be the description.
31
+ const hasNameSource = !!ariaLabel || !!ariaLabelledByValue;
32
+ const a11yInputProps = {
33
+ role: 'switch',
34
+ 'aria-label': ariaLabel,
35
+ 'aria-labelledby': ariaLabelledByValue,
36
+ 'aria-describedby': ariaDescribedBy || (hasNameSource ? helperTextId : undefined),
37
+ };
38
+ const _b = slotProps !== null && slotProps !== void 0 ? slotProps : {}, { input: consumerInputSlotProps } = _b, otherSlotProps = __rest(_b, ["input"]);
39
+ const inputSlotProps = typeof consumerInputSlotProps === 'function'
40
+ ? (ownerState) => (Object.assign(Object.assign({}, a11yInputProps), consumerInputSlotProps(ownerState)))
41
+ : Object.assign(Object.assign({}, a11yInputProps), consumerInputSlotProps);
28
42
  return (React.createElement(Styled.ToggleWrapper, { "$textPosition": textPosition },
29
43
  (label || helperText) && (React.createElement(Styled.TextWrapper, { "$textPosition": textPosition, htmlFor: id, "$hasLabel": !!label, "$hasHelperText": !!helperText },
30
44
  label && React.createElement(Styled.Title, { id: labelId }, label),
31
45
  helperText && React.createElement(Styled.HelperText, { id: helperTextId }, helperText))),
32
46
  React.createElement(Styled.ToggleSwitchWrapper, null,
33
- React.createElement(Styled.MaterialToggle, Object.assign({}, rest, { id: id, onChange: onChange, "aria-label": ariaLabel, "aria-labelledby": ariaLabel ? undefined : ariaLabelledBy || labelId, "aria-describedby": ariaDescribedBy || helperTextId })))));
47
+ React.createElement(Styled.MaterialToggle, Object.assign({}, rest, { id: id, onChange: onChange, slotProps: Object.assign(Object.assign({}, otherSlotProps), { input: inputSlotProps }) })))));
34
48
  }
35
49
  export default Toggle;
@@ -2,10 +2,12 @@
2
2
  export const colorNeutral2 = 'var(--color-neutral-2, #717C91)';
3
3
  export const colorNeutral3 = 'var(--color-neutral-3, #B0BDC9)';
4
4
  export const colorNeutral4 = 'var(--color-neutral-4, #DCE4EC)';
5
- export const colorWhite = 'var(--color-neutral-white, #FFFFFF)';
6
5
  export const colorLightGray = 'var(--color-light-gray, #F4F6FA)';
7
6
  export const colorGray = 'var(--color-gray, #4E5A66)';
8
7
  export const colorDarkGray = 'var(--color-dark-gray, #393C48)';
8
+ const colorWhite_base = 'var(--color-neutral-white, #FFFFFF)';
9
+ // Mapped to core css vars
10
+ export const colorWhite = `var(--color-white, ${colorWhite_base})`;
9
11
  // Brand colors
10
12
  // Last-resort fallbacks mirror bigbluebutton-html5's palette so that a client
11
13
  // which doesn't override --color-primary renders library components with the
@@ -17,7 +19,7 @@ export const colorBrand2 = `var(--color-brand-2, ${colorBrand1_base})`;
17
19
  export const colorBrand3 = `var(--color-brand-3, ${colorBrand1_base})`;
18
20
  // Mapped to core css vars
19
21
  export const colorBrandLight = `var(--color-blue-aux, ${colorBrandLight_base})`;
20
- export const colorBrandAux = `var(--color-brand-aux, ${colorBrandLight_base})`;
22
+ export const colorBrandAux = `var(--color-brand-aux, var(--color-hover-light, ${colorBrandLight_base}))`;
21
23
  // Semantic colors
22
24
  const colorError_base = 'var(--color-error, #DF2721)';
23
25
  const colorErrorDark_base = 'var(--color-error-dark, #AE1010)';
@@ -32,7 +34,7 @@ export const colorBackgroundLight = `var(--color-background-light, ${colorLightG
32
34
  export const colorBackgroundBlue = `var(--color-background-blue, ${colorBrandLight_base})`;
33
35
  // Border colors
34
36
  const colorBorderDefault_base = `var(--color-border-default, ${colorNeutral3})`;
35
- export const colorBorderSelected = `var(--color-border-selected, ${colorBrand1_base})`;
37
+ export const colorBorderSelected = `var(--color-border-selected, ${colorBrand1})`;
36
38
  export const colorBorderError = `var(--color-border-error, ${colorError_base})`;
37
39
  // Mapped to core css vars
38
40
  export const colorBorderDefault = `var(--default-border, ${colorBorderDefault_base})`;
@@ -36,7 +36,14 @@ declare const TOOLTIP_PLACEMENTS: {
36
36
  };
37
37
  declare const TOOLTIP_PLACEMENT_VALUES: ("left" | "right" | "bottom" | "top")[];
38
38
  declare const DEFAULT_TOOLTIP_PLACEMENT: "top";
39
+ declare const TYPES: {
40
+ readonly BUTTON: "button";
41
+ readonly SUBMIT: "submit";
42
+ readonly RESET: "reset";
43
+ };
44
+ declare const TYPE_VALUES: ("button" | "reset" | "submit")[];
45
+ declare const DEFAULT_TYPE: "button";
39
46
  declare const CSS_COLOR_PROPERTIES: CSSColorPropertiesType;
40
47
  declare const CSS_COLOR_PROPERTIES_DISABLED: EssentialColorProperties;
41
48
  declare const CSS_SIZE_PROPERTIES: CSSSizePropertiesType;
42
- export { VARIANTS, VARIANT_VALUES, DEFAULT_VARIANT, COLORS, COLOR_VALUES, DEFAULT_COLOR, SIZES, SIZE_VALUES, DEFAULT_SIZE, LAYOUTS, LAYOUT_VALUES, DEFAULT_LAYOUT, TOOLTIP_PLACEMENTS, TOOLTIP_PLACEMENT_VALUES, DEFAULT_TOOLTIP_PLACEMENT, CSS_COLOR_PROPERTIES, CSS_COLOR_PROPERTIES_DISABLED, CSS_SIZE_PROPERTIES, };
49
+ export { VARIANTS, VARIANT_VALUES, DEFAULT_VARIANT, COLORS, COLOR_VALUES, DEFAULT_COLOR, SIZES, SIZE_VALUES, DEFAULT_SIZE, LAYOUTS, LAYOUT_VALUES, DEFAULT_LAYOUT, TOOLTIP_PLACEMENTS, TOOLTIP_PLACEMENT_VALUES, DEFAULT_TOOLTIP_PLACEMENT, TYPES, TYPE_VALUES, DEFAULT_TYPE, CSS_COLOR_PROPERTIES, CSS_COLOR_PROPERTIES_DISABLED, CSS_SIZE_PROPERTIES, };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { COLOR_VALUES, LAYOUT_VALUES, SIZE_VALUES, VARIANT_VALUES, LAYOUTS, TOOLTIP_PLACEMENT_VALUES } from './constants';
2
+ import { COLOR_VALUES, LAYOUT_VALUES, SIZE_VALUES, VARIANT_VALUES, LAYOUTS, TOOLTIP_PLACEMENT_VALUES, TYPE_VALUES } from './constants';
3
3
  export type EssentialColorProperties = {
4
4
  color: string;
5
5
  background: string | boolean;
@@ -29,6 +29,7 @@ type ColorType = typeof COLOR_VALUES[number];
29
29
  type SizeType = typeof SIZE_VALUES[number];
30
30
  type LayoutType = typeof LAYOUT_VALUES[number];
31
31
  type TooltipPlacementType = typeof TOOLTIP_PLACEMENT_VALUES[number];
32
+ type ButtonType = typeof TYPE_VALUES[number];
32
33
  export interface StyledHelperIconContainer {
33
34
  $hover: boolean;
34
35
  $variant: VariantType;
@@ -42,6 +43,7 @@ export interface StyledButtonProps {
42
43
  $color?: ColorType;
43
44
  $size?: SizeType;
44
45
  $layout?: LayoutType;
46
+ $fullWidth?: boolean;
45
47
  disabled: boolean;
46
48
  }
47
49
  type BaseButtonProps = {
@@ -71,6 +73,8 @@ type BaseButtonProps = {
71
73
  variant?: VariantType;
72
74
  /** Button size; affects padding and, for the `circle`/`squared` layouts, the overall box size (both render at the same size). @default 'md' */
73
75
  size?: SizeType;
76
+ /** Native `type` attribute of the `<button>`; defaults to `'button'` so it never submits an enclosing form unless `'submit'` is passed explicitly. @default 'button' */
77
+ type?: ButtonType;
74
78
  /** Disables interaction and applies disabled styling. @default false */
75
79
  disabled?: boolean;
76
80
  /** Additional content rendered inside the button, after the label (only used in the `default` layout). */
@@ -85,6 +89,8 @@ type BaseButtonProps = {
85
89
  feedbackContent?: React.ReactNode;
86
90
  /** How long, in milliseconds, the click feedback stays visible. @default 2000 */
87
91
  feedbackDuration?: number;
92
+ /** Class name forwarded to the root element (the `<button>`, or the wrapper `<div>` in the `stacked` layout), so `styled(BBButton)` works. Escape hatch while BBButton is being adopted; prefer native props and open an issue for recurring needs. */
93
+ className?: string;
88
94
  };
89
95
  type DefaultLayoutProps = BaseButtonProps & {
90
96
  /** Layout mode for this variant — always `'default'`, the standard inline label/icon button; also the overall default. @default 'default' */
@@ -93,6 +99,8 @@ type DefaultLayoutProps = BaseButtonProps & {
93
99
  iconStart?: React.ReactNode;
94
100
  /** Icon rendered after the label (right side); effective when a label is present. */
95
101
  iconEnd?: React.ReactNode;
102
+ /** Makes the button fill the width of its container, keeping its content centered. @default false */
103
+ fullWidth?: boolean;
96
104
  };
97
105
  type StackedLayoutProps = BaseButtonProps & {
98
106
  /** Layout mode for this variant — must be `'stacked'`, rendering a main icon with a label underneath plus an optional helper icon. */
@@ -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, id, dataTest, inputProps, ...props }: CheckboxProps): JSX.Element;
11
+ declare function Checkbox({ label, layout, round, ariaLabel, id, dataTest, slotProps, ...props }: CheckboxProps): JSX.Element;
12
12
  export default Checkbox;
@@ -1,7 +1,7 @@
1
1
  import { CheckboxProps as MuiCheckboxProps } from '@mui/material';
2
2
  import { LAYOUTS } from './constants';
3
3
  type Layout = typeof LAYOUTS[keyof typeof LAYOUTS];
4
- export interface CheckboxProps extends MuiCheckboxProps {
4
+ export interface CheckboxProps extends Omit<MuiCheckboxProps, 'inputProps'> {
5
5
  /** Text label displayed next to the checkbox. */
6
6
  label?: string;
7
7
  /** Position of the label relative to the checkbox. @default 'right' */
@@ -1,8 +1,10 @@
1
- import { Styles } from 'react-modal';
1
+ import ReactModal, { Styles } from 'react-modal';
2
2
  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 ModalTitle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("../Typography/types").TypographyProps, never>> & string & Omit<React.FC<import("../Typography/types").TypographyProps>, keyof React.Component<any, {}, any>>;
6
7
  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;
7
8
  export declare const ModalBodyContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
8
9
  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;
10
+ export declare const Modal: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<ReactModal.Props & React.RefAttributes<ReactModal>, never>> & string & Omit<typeof ReactModal, keyof React.Component<any, {}, any>>;
@@ -5,4 +5,4 @@ export declare const Title: import("styled-components/dist/types").IStyledCompon
5
5
  export declare const HelperText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
6
6
  export declare const SliderRow: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledSliderRowProps>> & string;
7
7
  export declare const IconWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
8
- export declare const MaterialSlider: import("@emotion/styled").StyledComponent<import("@mui/material").SliderOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "name" | "color" | "size" | "style" | "disabled" | "defaultValue" | "className" | "tabIndex" | "aria-label" | "aria-labelledby" | "aria-valuetext" | "onChange" | "track" | "value" | "classes" | "slots" | "slotProps" | "sx" | "step" | "scale" | "max" | "min" | "orientation" | "components" | "componentsProps" | "disableSwap" | "getAriaLabel" | "getAriaValueText" | "marks" | "onChangeCommitted" | "shiftStep" | "valueLabelDisplay" | "valueLabelFormat"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
8
+ export declare const MaterialSlider: import("@emotion/styled").StyledComponent<import("@mui/material").SliderOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "name" | "color" | "size" | "style" | "disabled" | "defaultValue" | "className" | "tabIndex" | "aria-label" | "aria-labelledby" | "aria-valuetext" | "onChange" | "track" | "value" | "classes" | "slots" | "slotProps" | "sx" | "step" | "max" | "min" | "scale" | "orientation" | "components" | "componentsProps" | "disableSwap" | "getAriaLabel" | "getAriaValueText" | "marks" | "onChangeCommitted" | "shiftStep" | "valueLabelDisplay" | "valueLabelFormat"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -2,7 +2,7 @@ import { TextField } from '@mui/material';
2
2
  import { StyledTextProps } from './types';
3
3
  export declare const StyledTextField: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<{
4
4
  variant?: import("@mui/material").TextFieldVariants;
5
- } & Omit<import("@mui/material").FilledTextFieldProps | import("@mui/material").OutlinedTextFieldProps | import("@mui/material").StandardTextFieldProps, "variant">, StyledTextProps>> & string & Omit<typeof TextField, keyof import("react").Component<any, {}, any>>;
5
+ } & Omit<import("@mui/material").FilledTextFieldProps | import("@mui/material").StandardTextFieldProps | import("@mui/material").OutlinedTextFieldProps, "variant">, StyledTextProps>> & string & Omit<typeof TextField, keyof import("react").Component<any, {}, any>>;
6
6
  export declare const Label: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
7
7
  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>, StyledTextProps>> & string;
8
8
  export declare const Container: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
@@ -7,5 +7,5 @@ import { ToggleProps } from './types';
7
7
  * It supports labels (label and helperText) and various textPosition configurations.
8
8
  *
9
9
  */
10
- declare function Toggle({ label, helperText, textPosition, onChange, ariaLabel, ariaLabelledBy, ariaDescribedBy, id: providedId, ...rest }: ToggleProps): JSX.Element;
10
+ declare function Toggle({ label, helperText, textPosition, onChange, ariaLabel, ariaLabelledBy, ariaDescribedBy, id: providedId, slotProps, ...rest }: ToggleProps): JSX.Element;
11
11
  export default Toggle;
@@ -9,7 +9,7 @@ export interface StyledTextWrapperProps extends StyledToggleWrapperProps {
9
9
  $hasLabel: boolean;
10
10
  $hasHelperText: boolean;
11
11
  }
12
- export interface ToggleProps extends SwitchProps {
12
+ export interface ToggleProps extends Omit<SwitchProps, 'inputProps'> {
13
13
  /** Main label text displayed next to the toggle. */
14
14
  label?: string;
15
15
  /** Helper text displayed below the label. */
@@ -3,7 +3,7 @@ export declare const colors: {
3
3
  readonly neutral2: "var(--color-neutral-2, #717C91)";
4
4
  readonly neutral3: "var(--color-neutral-3, #B0BDC9)";
5
5
  readonly neutral4: "var(--color-neutral-4, #DCE4EC)";
6
- readonly white: "var(--color-neutral-white, #FFFFFF)";
6
+ readonly white: "var(--color-white, var(--color-neutral-white, #FFFFFF))";
7
7
  readonly lightGray: "var(--color-light-gray, #F4F6FA)";
8
8
  readonly gray: "var(--color-gray, #4E5A66)";
9
9
  readonly darkGray: "var(--color-dark-gray, #393C48)";
@@ -13,7 +13,7 @@ export declare const colors: {
13
13
  readonly brand2: "var(--color-brand-2, var(--color-brand-1, #0F70D7))";
14
14
  readonly brand3: "var(--color-brand-3, var(--color-brand-1, #0F70D7))";
15
15
  readonly light: "var(--color-blue-aux, var(--color-brand-light, #E5EFFB))";
16
- readonly aux: "var(--color-brand-aux, var(--color-brand-light, #E5EFFB))";
16
+ readonly aux: "var(--color-brand-aux, var(--color-hover-light, var(--color-brand-light, #E5EFFB)))";
17
17
  };
18
18
  readonly semantic: {
19
19
  readonly success: "var(--color-success, #2DD36F)";
@@ -22,13 +22,13 @@ export declare const colors: {
22
22
  readonly errorDark: "var(--color-danger-dark, var(--color-error-dark, #AE1010))";
23
23
  };
24
24
  readonly background: {
25
- readonly white: "var(--color-background-white, var(--color-neutral-white, #FFFFFF))";
25
+ readonly white: "var(--color-background-white, var(--color-white, var(--color-neutral-white, #FFFFFF)))";
26
26
  readonly light: "var(--color-background-light, var(--color-light-gray, #F4F6FA))";
27
27
  readonly blue: "var(--color-background-blue, var(--color-brand-light, #E5EFFB))";
28
28
  };
29
29
  readonly border: {
30
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))";
31
+ readonly selected: "var(--color-border-selected, var(--color-primary, var(--color-brand-1, #0F70D7)))";
32
32
  readonly error: "var(--color-border-error, var(--color-error, #DF2721))";
33
33
  readonly focusRing: "var(--color-border-focus-ring, rgba(29, 101, 212, 0.15))";
34
34
  };
@@ -39,7 +39,7 @@ export declare const colors: {
39
39
  readonly icon: {
40
40
  readonly default: "var(--color-icon-default, var(--color-neutral-2, #717C91))";
41
41
  readonly blue: "var(--color-icon-blue, var(--color-brand-1, #0F70D7))";
42
- readonly white: "var(--color-icon-white, var(--color-neutral-white, #FFFFFF))";
42
+ readonly white: "var(--color-icon-white, var(--color-white, var(--color-neutral-white, #FFFFFF)))";
43
43
  readonly defaultDark: "var(--color-icon-default-dark, rgba(255, 255, 255, 0.35))";
44
44
  };
45
45
  readonly hover: {
@@ -1,23 +1,23 @@
1
1
  export declare const colorNeutral2 = "var(--color-neutral-2, #717C91)";
2
2
  export declare const colorNeutral3 = "var(--color-neutral-3, #B0BDC9)";
3
3
  export declare const colorNeutral4 = "var(--color-neutral-4, #DCE4EC)";
4
- export declare const colorWhite = "var(--color-neutral-white, #FFFFFF)";
5
4
  export declare const colorLightGray = "var(--color-light-gray, #F4F6FA)";
6
5
  export declare const colorGray = "var(--color-gray, #4E5A66)";
7
6
  export declare const colorDarkGray = "var(--color-dark-gray, #393C48)";
7
+ export declare const colorWhite = "var(--color-white, var(--color-neutral-white, #FFFFFF))";
8
8
  export declare const colorBrand1 = "var(--color-primary, var(--color-brand-1, #0F70D7))";
9
9
  export declare const colorBrand2 = "var(--color-brand-2, var(--color-brand-1, #0F70D7))";
10
10
  export declare const colorBrand3 = "var(--color-brand-3, var(--color-brand-1, #0F70D7))";
11
11
  export declare const colorBrandLight = "var(--color-blue-aux, var(--color-brand-light, #E5EFFB))";
12
- export declare const colorBrandAux = "var(--color-brand-aux, var(--color-brand-light, #E5EFFB))";
12
+ export declare const colorBrandAux = "var(--color-brand-aux, var(--color-hover-light, var(--color-brand-light, #E5EFFB)))";
13
13
  export declare const colorSuccess = "var(--color-success, #2DD36F)";
14
14
  export declare const colorWarning = "var(--color-warning, #F59240)";
15
15
  export declare const colorError = "var(--color-danger, var(--color-error, #DF2721))";
16
16
  export declare const colorErrorDark = "var(--color-danger-dark, var(--color-error-dark, #AE1010))";
17
- export declare const colorBackgroundWhite = "var(--color-background-white, var(--color-neutral-white, #FFFFFF))";
17
+ export declare const colorBackgroundWhite = "var(--color-background-white, var(--color-white, var(--color-neutral-white, #FFFFFF)))";
18
18
  export declare const colorBackgroundLight = "var(--color-background-light, var(--color-light-gray, #F4F6FA))";
19
19
  export declare const colorBackgroundBlue = "var(--color-background-blue, var(--color-brand-light, #E5EFFB))";
20
- export declare const colorBorderSelected = "var(--color-border-selected, var(--color-brand-1, #0F70D7))";
20
+ export declare const colorBorderSelected = "var(--color-border-selected, var(--color-primary, var(--color-brand-1, #0F70D7)))";
21
21
  export declare const colorBorderError = "var(--color-border-error, var(--color-error, #DF2721))";
22
22
  export declare const colorBorderDefault = "var(--default-border, var(--color-border-default, var(--color-neutral-3, #B0BDC9)))";
23
23
  export declare const colorBorderFocusRing = "var(--color-border-focus-ring, rgba(29, 101, 212, 0.15))";
@@ -25,7 +25,7 @@ export declare const colorTextDefault = "var(--color-text-default, var(--color-d
25
25
  export declare const colorTextLight = "var(--color-text-light, var(--color-neutral-2, #717C91))";
26
26
  export declare const colorIconDefault = "var(--color-icon-default, var(--color-neutral-2, #717C91))";
27
27
  export declare const colorIconBlue = "var(--color-icon-blue, var(--color-brand-1, #0F70D7))";
28
- export declare const colorIconWhite = "var(--color-icon-white, var(--color-neutral-white, #FFFFFF))";
28
+ export declare const colorIconWhite = "var(--color-icon-white, var(--color-white, var(--color-neutral-white, #FFFFFF)))";
29
29
  export declare const colorIconDefaultDark = "var(--color-icon-default-dark, rgba(255, 255, 255, 0.35))";
30
30
  export declare const colorHoverDark = "var(--color-hover-dark, #0C57A7)";
31
31
  export declare const colorHoverLight = "var(--color-hover-light, #D4E5FA)";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigbluebutton/bbb-ui-components-react",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/bigbluebutton/bbb-ui-components-react.git"
@@ -280,8 +280,8 @@
280
280
  "peerDependencies": {
281
281
  "@emotion/react": "^11.13.0",
282
282
  "@emotion/styled": "^11.13.0",
283
- "@mui/icons-material": "^6.1.4 || ^7.0.0",
284
- "@mui/material": "^6.1.4 || ^7.0.0",
283
+ "@mui/icons-material": "^6.4.9 || ^7.0.0",
284
+ "@mui/material": "^6.4.9 || ^7.0.0",
285
285
  "prop-types": "^15.8.1",
286
286
  "react": "^18.2.0",
287
287
  "react-dom": "^18.2.0",