@bigbluebutton/bbb-ui-components-react 0.8.0 → 0.10.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 (52) hide show
  1. package/README.md +3 -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 +3 -2
  9. package/dist/components/Select.js +9 -9
  10. package/dist/components/Slider.js +2 -2
  11. package/dist/components/Spinner.js +1 -0
  12. package/dist/components/TextAreaInput.js +1 -1
  13. package/dist/components/TextInput.js +10 -10
  14. package/dist/components/Toast.js +292 -0
  15. package/dist/components/Toggle.js +20 -13
  16. package/dist/components/colors.js +1 -1
  17. package/dist/components/index.js +410 -252
  18. package/dist/esm/components/Button/component.js +7 -7
  19. package/dist/esm/components/Button/constants.js +8 -1
  20. package/dist/esm/components/Button/styles.js +6 -5
  21. package/dist/esm/components/Checkbox/component.js +7 -3
  22. package/dist/esm/components/Modal/component.js +2 -4
  23. package/dist/esm/components/Modal/styles.js +12 -1
  24. package/dist/esm/components/Spinner/styles.js +1 -0
  25. package/dist/esm/components/Toast/component.js +144 -0
  26. package/dist/esm/components/Toast/constants.js +36 -0
  27. package/dist/esm/components/Toast/index.js +1 -0
  28. package/dist/esm/components/Toast/styles.js +180 -0
  29. package/dist/esm/components/Toast/types.js +1 -0
  30. package/dist/esm/components/Toggle/component.js +20 -5
  31. package/dist/esm/components/Toggle/styles.js +13 -2
  32. package/dist/esm/components/index.js +1 -0
  33. package/dist/esm/stylesheets/palette.js +9 -3
  34. package/dist/types/components/Accordion/constants.d.ts +1 -1
  35. package/dist/types/components/Button/constants.d.ts +11 -4
  36. package/dist/types/components/Button/type.d.ts +9 -1
  37. package/dist/types/components/Checkbox/component.d.ts +1 -1
  38. package/dist/types/components/Checkbox/types.d.ts +1 -1
  39. package/dist/types/components/Modal/styles.d.ts +3 -1
  40. package/dist/types/components/Slider/styles.d.ts +1 -1
  41. package/dist/types/components/Toast/component.d.ts +14 -0
  42. package/dist/types/components/Toast/constants.d.ts +42 -0
  43. package/dist/types/components/Toast/index.d.ts +1 -0
  44. package/dist/types/components/Toast/styles.d.ts +14 -0
  45. package/dist/types/components/Toast/types.d.ts +68 -0
  46. package/dist/types/components/Toggle/component.d.ts +1 -1
  47. package/dist/types/components/Toggle/constants.d.ts +2 -2
  48. package/dist/types/components/Toggle/types.d.ts +4 -1
  49. package/dist/types/components/index.d.ts +1 -0
  50. package/dist/types/stylesheets/colors.d.ts +5 -5
  51. package/dist/types/stylesheets/palette.d.ts +7 -5
  52. package/package.json +13 -3
@@ -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,12 +19,16 @@ 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)';
24
26
  export const colorSuccess = 'var(--color-success, #2DD36F)';
25
27
  export const colorWarning = 'var(--color-warning, #F59240)';
28
+ // Darker shades of the two above, for fills that carry white text or icons - motivation: BBBToast
29
+ // warning and success which lack of contrast for displaying white icons
30
+ export const colorSuccessDark = 'var(--color-success-dark, #209B51)';
31
+ export const colorWarningDark = 'var(--color-warning-dark, #D8680B)';
26
32
  // Mapped to core css vars
27
33
  export const colorError = `var(--color-danger, ${colorError_base})`;
28
34
  export const colorErrorDark = `var(--color-danger-dark, ${colorErrorDark_base})`;
@@ -32,7 +38,7 @@ export const colorBackgroundLight = `var(--color-background-light, ${colorLightG
32
38
  export const colorBackgroundBlue = `var(--color-background-blue, ${colorBrandLight_base})`;
33
39
  // Border colors
34
40
  const colorBorderDefault_base = `var(--color-border-default, ${colorNeutral3})`;
35
- export const colorBorderSelected = `var(--color-border-selected, ${colorBrand1_base})`;
41
+ export const colorBorderSelected = `var(--color-border-selected, ${colorBrand1})`;
36
42
  export const colorBorderError = `var(--color-border-error, ${colorError_base})`;
37
43
  // Mapped to core css vars
38
44
  export const colorBorderDefault = `var(--default-border, ${colorBorderDefault_base})`;
@@ -4,7 +4,7 @@ declare const TOOLTIP_PLACEMENTS: {
4
4
  readonly LEFT: "left";
5
5
  readonly RIGHT: "right";
6
6
  };
7
- declare const TOOLTIP_PLACEMENT_VALUES: ("left" | "right" | "bottom" | "top")[];
7
+ declare const TOOLTIP_PLACEMENT_VALUES: ("top" | "bottom" | "left" | "right")[];
8
8
  declare const DEFAULT_TOOLTIP_PLACEMENT: "top";
9
9
  declare const BUTTON_HEADER_POSITIONS: {
10
10
  readonly LEFT: "left";
@@ -26,17 +26,24 @@ declare const LAYOUTS: {
26
26
  readonly CIRCLE: "circle";
27
27
  readonly SQUARED: "squared";
28
28
  };
29
- declare const LAYOUT_VALUES: ("default" | "circle" | "stacked" | "squared")[];
30
- declare const DEFAULT_LAYOUT: "default" | "circle" | "stacked" | "squared";
29
+ declare const LAYOUT_VALUES: ("default" | "stacked" | "circle" | "squared")[];
30
+ declare const DEFAULT_LAYOUT: "default" | "stacked" | "circle" | "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: ("left" | "right" | "bottom" | "top")[];
37
+ declare const TOOLTIP_PLACEMENT_VALUES: ("top" | "bottom" | "left" | "right")[];
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" | "submit" | "reset")[];
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>, "color" | "size" | "disabled" | "className" | "aria-label" | "aria-labelledby" | "style" | "track" | "name" | "value" | "defaultValue" | "tabIndex" | "aria-valuetext" | "onChange" | "step" | "classes" | "slots" | "slotProps" | "sx" | "max" | "min" | "scale" | "orientation" | "components" | "componentsProps" | "disableSwap" | "getAriaLabel" | "getAriaValueText" | "marks" | "onChangeCommitted" | "shiftStep" | "valueLabelDisplay" | "valueLabelFormat"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -0,0 +1,14 @@
1
+ import { JSX } from 'react';
2
+ import { ToastProps } from './types';
3
+ /**
4
+ * A notification card for transient messages.
5
+ *
6
+ * This component renders the presentational part of a toast notification: an icon badge
7
+ * matched to `variant`, the message, optional secondary content and an optional action button.
8
+ *
9
+ * It never hides itself. Both the close button and the `autoClose` timer call `onRequestClose`,
10
+ * leaving removal to whoever owns the toast stack, so the card can live inside an external
11
+ * toast engine without leaving an empty slot behind.
12
+ */
13
+ declare function Toast({ message, variant, icon, content, showSeparator, small, disablePointer, onClick, clickAriaLabel, actionLabel, onActionClick, autoClose, paused, hideProgressBar, hideCloseButton, closeButtonAriaLabel, onRequestClose, maxHeight, dataTest, messageDataTest, closeButtonDataTest, actionButtonDataTest, onMouseEnter, onMouseLeave, onFocus, onBlur, ...rest }: ToastProps): JSX.Element;
14
+ export default Toast;
@@ -0,0 +1,42 @@
1
+ export declare const TOAST_VARIANTS: {
2
+ readonly DEFAULT: "default";
3
+ readonly INFO: "info";
4
+ readonly SUCCESS: "success";
5
+ readonly WARNING: "warning";
6
+ readonly ERROR: "error";
7
+ };
8
+ export declare const TOAST_VARIANT_VALUES: ("default" | "error" | "info" | "success" | "warning")[];
9
+ export declare const DEFAULT_TOAST_VARIANT: "default";
10
+ export declare const DEFAULT_AUTO_CLOSE = 5000;
11
+ export declare const DEFAULT_CLOSE_BUTTON_ARIA_LABEL = "Close";
12
+ export declare const INTERACTIVE_SELECTOR: string;
13
+ export declare const DEFAULT_MAX_HEIGHT = "70vh";
14
+ export declare const DEFAULT_ICONS: {
15
+ readonly default: import("react-icons/lib").IconType;
16
+ readonly info: import("react-icons/lib").IconType;
17
+ readonly success: import("react-icons/lib").IconType;
18
+ readonly warning: import("react-icons/lib").IconType;
19
+ readonly error: import("react-icons/lib").IconType;
20
+ };
21
+ export declare const VARIANT_COLORS: {
22
+ readonly default: {
23
+ readonly background: "var(--color-primary, var(--color-brand-1, #0F70D7))";
24
+ readonly glyph: "var(--color-white, var(--color-neutral-white, #FFFFFF))";
25
+ };
26
+ readonly info: {
27
+ readonly background: "var(--color-primary, var(--color-brand-1, #0F70D7))";
28
+ readonly glyph: "var(--color-white, var(--color-neutral-white, #FFFFFF))";
29
+ };
30
+ readonly success: {
31
+ readonly background: "var(--color-success-dark, #209B51)";
32
+ readonly glyph: "var(--color-white, var(--color-neutral-white, #FFFFFF))";
33
+ };
34
+ readonly warning: {
35
+ readonly background: "var(--color-warning-dark, #D8680B)";
36
+ readonly glyph: "var(--color-white, var(--color-neutral-white, #FFFFFF))";
37
+ };
38
+ readonly error: {
39
+ readonly background: "var(--color-danger, var(--color-error, #DF2721))";
40
+ readonly glyph: "var(--color-white, var(--color-neutral-white, #FFFFFF))";
41
+ };
42
+ };
@@ -0,0 +1 @@
1
+ export { default as BBBToast } from './component';
@@ -0,0 +1,14 @@
1
+ import { StyledCardActionProps, StyledIconBadgeProps, StyledProgressBarProps, StyledTextProps, StyledToastProps } from './types';
2
+ export declare const CardAction: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, StyledCardActionProps>> & string;
3
+ export declare const Container: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledToastProps>> & string;
4
+ export declare const IconSection: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
5
+ export declare const IconBand: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
6
+ export declare const Body: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
7
+ export declare const Header: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
8
+ export declare const IconBadge: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledIconBadgeProps>> & string;
9
+ export declare const Message: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledTextProps>> & string;
10
+ export declare const Content: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledTextProps>> & string;
11
+ export declare const ActionWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
12
+ export declare const CloseButtonWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
13
+ export declare const ProgressTrack: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
14
+ export declare const ProgressBar: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledProgressBarProps>> & string;
@@ -0,0 +1,68 @@
1
+ import React from 'react';
2
+ import { TOAST_VARIANT_VALUES } from './constants';
3
+ export type ToastVariant = (typeof TOAST_VARIANT_VALUES)[number];
4
+ export interface StyledToastProps {
5
+ $disablePointer: boolean;
6
+ $maxHeight: string;
7
+ }
8
+ export interface StyledProgressBarProps {
9
+ $variant: ToastVariant;
10
+ $duration: number;
11
+ $paused: boolean;
12
+ }
13
+ export interface StyledIconBadgeProps {
14
+ $variant: ToastVariant;
15
+ $small: boolean;
16
+ }
17
+ export interface StyledCardActionProps {
18
+ $visuallyHidden: boolean;
19
+ }
20
+ export interface StyledTextProps {
21
+ $small: boolean;
22
+ }
23
+ export interface ToastProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'content'> {
24
+ /** Title of the notification, rendered on its own line; usually plain text, but takes a node for inline i18n markup. */
25
+ message?: React.ReactNode;
26
+ /** Visual variant driving the default icon and the icon badge color. @default 'default' */
27
+ variant?: ToastVariant;
28
+ /** Custom icon replacing the one matched to `variant`, or `false` to hide the icon badge entirely. */
29
+ icon?: React.ReactNode | false;
30
+ /** Description or secondary content (text, links, action buttons) rendered below the title, sharing its left edge. */
31
+ content?: React.ReactNode;
32
+ /** Shows the divider between the title and `content`; only rendered when both are present. @default true */
33
+ showSeparator?: boolean;
34
+ /** Compact variant for space-constrained placements. @default false */
35
+ small?: boolean;
36
+ /** Keeps the default cursor instead of showing a pointer one, so the toast doesn't read as clickable; defaults to `false` when `onClick` is set and `true` otherwise. */
37
+ disablePointer?: boolean;
38
+ /** Click handler for the whole toast (e.g. open a related chat or panel); exposed to assistive technology as a button wrapping `message`. */
39
+ onClick?: React.MouseEventHandler<HTMLDivElement>;
40
+ /** Accessible name for the `onClick` action, overriding the `message` text; needed when `onClick` is set without a `message`, else the `content` text is used. */
41
+ clickAriaLabel?: string;
42
+ /** Label for an optional action button rendered below the content. */
43
+ actionLabel?: string;
44
+ /** Handler for the action button; only used when `actionLabel` is set. */
45
+ onActionClick?: React.MouseEventHandler<HTMLButtonElement>;
46
+ /** Auto-dismiss delay in milliseconds, paused while the toast is hovered or focused, or `false` to persist until dismissed manually. @default 5000 */
47
+ autoClose?: number | false;
48
+ /** Pauses the `autoClose` countdown from outside, on top of the card's own pause on hover and focus (e.g. while a toast engine's stack is hovered). @default false */
49
+ paused?: boolean;
50
+ /** Hides the bar at the bottom of the card that counts down `autoClose`; never shown when `autoClose` is `false`. @default false */
51
+ hideProgressBar?: boolean;
52
+ /** Hides the close (X) button, for toasts that shouldn't be manually dismissed. @default false */
53
+ hideCloseButton?: boolean;
54
+ /** Accessible name for the close button; pass a translated string in localized apps. @default 'Close' */
55
+ closeButtonAriaLabel?: string;
56
+ /** Callback fired when the toast is dismissed, by the close button or by `autoClose`. */
57
+ onRequestClose?: () => void;
58
+ /** Caps the card's height, scrolling its body past that point; any CSS length. @default '70vh' */
59
+ maxHeight?: string;
60
+ /** Value for the `data-test` attribute on the container; also the base for the derived test ids below. */
61
+ dataTest?: string;
62
+ /** Test identifier applied to the message. Defaults to `${dataTest}-message` when `dataTest` is set. */
63
+ messageDataTest?: string;
64
+ /** Test identifier applied to the close button. Defaults to `${dataTest}-close-button` when `dataTest` is set. */
65
+ closeButtonDataTest?: string;
66
+ /** Test identifier applied to the action button. Defaults to `${dataTest}-action-button` when `dataTest` is set. */
67
+ actionButtonDataTest?: string;
68
+ }
@@ -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, fullWidth, onChange, ariaLabel, ariaLabelledBy, ariaDescribedBy, id: providedId, slotProps, ...rest }: ToggleProps): JSX.Element;
11
11
  export default Toggle;
@@ -4,5 +4,5 @@ export declare const TEXT_POSITIONS: {
4
4
  readonly TOP: "top";
5
5
  readonly BOTTOM: "bottom";
6
6
  };
7
- export declare const TEXT_POSITIONS_VALUES: ("left" | "right" | "bottom" | "top")[];
8
- export declare const DEFAULT_TEXT_POSITION: "left" | "right" | "bottom" | "top";
7
+ export declare const TEXT_POSITIONS_VALUES: ("top" | "bottom" | "left" | "right")[];
8
+ export declare const DEFAULT_TEXT_POSITION: "top" | "bottom" | "left" | "right";
@@ -4,18 +4,21 @@ export type LayoutType = typeof TEXT_POSITIONS_VALUES[number];
4
4
  export type LabelPlacement = 'top' | 'bottom' | 'start' | 'end';
5
5
  export interface StyledToggleWrapperProps {
6
6
  $textPosition: LayoutType;
7
+ $fullWidth: boolean;
7
8
  }
8
9
  export interface StyledTextWrapperProps extends StyledToggleWrapperProps {
9
10
  $hasLabel: boolean;
10
11
  $hasHelperText: boolean;
11
12
  }
12
- export interface ToggleProps extends SwitchProps {
13
+ export interface ToggleProps extends Omit<SwitchProps, 'inputProps'> {
13
14
  /** Main label text displayed next to the toggle. */
14
15
  label?: string;
15
16
  /** Helper text displayed below the label. */
16
17
  helperText?: string;
17
18
  /** Position of the label/helper text relative to the toggle. @default 'right' */
18
19
  textPosition?: LayoutType;
20
+ /** Stretches the row to its container, putting the text and the switch at opposite ends; only used with `textPosition` 'left' or 'right'. @default false */
21
+ fullWidth?: boolean;
19
22
  /** Accessible name for the toggle. */
20
23
  ariaLabel?: string;
21
24
  /** ID of the element that labels the toggle; ignored when `ariaLabel` is set, and falls back to the rendered label's id when omitted. */
@@ -14,5 +14,6 @@ export { BBBSlider } from './Slider';
14
14
  export { BBBSpinner } from './Spinner';
15
15
  export { BBBTextAreaInput } from './TextAreaInput';
16
16
  export { BBBTextInput } from './TextInput';
17
+ export { BBBToast } from './Toast';
17
18
  export { BBBToggle } from './Toggle';
18
19
  export { BBBTypography } from './Typography';
@@ -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,25 @@
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
+ export declare const colorSuccessDark = "var(--color-success-dark, #209B51)";
16
+ export declare const colorWarningDark = "var(--color-warning-dark, #D8680B)";
15
17
  export declare const colorError = "var(--color-danger, var(--color-error, #DF2721))";
16
18
  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))";
19
+ export declare const colorBackgroundWhite = "var(--color-background-white, var(--color-white, var(--color-neutral-white, #FFFFFF)))";
18
20
  export declare const colorBackgroundLight = "var(--color-background-light, var(--color-light-gray, #F4F6FA))";
19
21
  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))";
22
+ export declare const colorBorderSelected = "var(--color-border-selected, var(--color-primary, var(--color-brand-1, #0F70D7)))";
21
23
  export declare const colorBorderError = "var(--color-border-error, var(--color-error, #DF2721))";
22
24
  export declare const colorBorderDefault = "var(--default-border, var(--color-border-default, var(--color-neutral-3, #B0BDC9)))";
23
25
  export declare const colorBorderFocusRing = "var(--color-border-focus-ring, rgba(29, 101, 212, 0.15))";
@@ -25,7 +27,7 @@ export declare const colorTextDefault = "var(--color-text-default, var(--color-d
25
27
  export declare const colorTextLight = "var(--color-text-light, var(--color-neutral-2, #717C91))";
26
28
  export declare const colorIconDefault = "var(--color-icon-default, var(--color-neutral-2, #717C91))";
27
29
  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))";
30
+ export declare const colorIconWhite = "var(--color-icon-white, var(--color-white, var(--color-neutral-white, #FFFFFF)))";
29
31
  export declare const colorIconDefaultDark = "var(--color-icon-default-dark, rgba(255, 255, 255, 0.35))";
30
32
  export declare const colorHoverDark = "var(--color-hover-dark, #0C57A7)";
31
33
  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.10.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/bigbluebutton/bbb-ui-components-react.git"
@@ -127,6 +127,13 @@
127
127
  "require": "./dist/components/TextInput.js",
128
128
  "default": "./dist/components/TextInput.js"
129
129
  },
130
+ "./Toast": {
131
+ "types": "./dist/types/components/Toast/index.d.ts",
132
+ "node": "./dist/components/Toast.js",
133
+ "import": "./dist/esm/components/Toast/index.js",
134
+ "require": "./dist/components/Toast.js",
135
+ "default": "./dist/components/Toast.js"
136
+ },
130
137
  "./Toggle": {
131
138
  "types": "./dist/types/components/Toggle/index.d.ts",
132
139
  "node": "./dist/components/Toggle.js",
@@ -240,6 +247,9 @@
240
247
  "TextInput": [
241
248
  "dist/types/components/TextInput/index.d.ts"
242
249
  ],
250
+ "Toast": [
251
+ "dist/types/components/Toast/index.d.ts"
252
+ ],
243
253
  "Toggle": [
244
254
  "dist/types/components/Toggle/index.d.ts"
245
255
  ],
@@ -280,8 +290,8 @@
280
290
  "peerDependencies": {
281
291
  "@emotion/react": "^11.13.0",
282
292
  "@emotion/styled": "^11.13.0",
283
- "@mui/icons-material": "^6.1.4 || ^7.0.0",
284
- "@mui/material": "^6.1.4 || ^7.0.0",
293
+ "@mui/icons-material": "^6.4.9 || ^7.0.0",
294
+ "@mui/material": "^6.4.9 || ^7.0.0",
285
295
  "prop-types": "^15.8.1",
286
296
  "react": "^18.2.0",
287
297
  "react-dom": "^18.2.0",