@bigbluebutton/bbb-ui-components-react 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Accordion.js +7 -7
- package/dist/components/Avatar.js +5 -5
- package/dist/components/Button.js +32 -29
- package/dist/components/Checkbox.js +33 -10
- package/dist/components/Input.js +64 -61
- package/dist/components/Modal.js +46 -43
- package/dist/components/Slider.js +8 -8
- package/dist/components/Toast.js +47 -44
- package/dist/components/Toggle.js +18 -18
- package/dist/components/index.js +285 -259
- package/dist/esm/components/Accordion/component.js +2 -1
- package/dist/esm/components/Avatar/component.js +2 -1
- package/dist/esm/components/Button/component.js +26 -5
- package/dist/esm/components/Button/constants.js +11 -4
- package/dist/esm/components/Button/styles.js +25 -1
- package/dist/esm/components/Checkbox/component.js +67 -12
- package/dist/esm/components/Checkbox/constants.js +8 -0
- package/dist/esm/components/Checkbox/styles.js +50 -8
- package/dist/esm/components/Slider/component.js +3 -2
- package/dist/esm/components/Slider/valueLabel.js +36 -0
- package/dist/esm/components/Toggle/component.js +87 -16
- package/dist/esm/components/Toggle/constants.js +8 -0
- package/dist/esm/components/Toggle/styles.js +19 -4
- package/dist/esm/utils/tooltip.js +20 -0
- package/dist/types/components/Accordion/constants.d.ts +1 -1
- package/dist/types/components/Button/constants.d.ts +12 -5
- package/dist/types/components/Button/styles.d.ts +2 -1
- package/dist/types/components/Button/type.d.ts +8 -1
- package/dist/types/components/Checkbox/component.d.ts +2 -1
- package/dist/types/components/Checkbox/constants.d.ts +8 -0
- package/dist/types/components/Checkbox/styles.d.ts +5 -3
- package/dist/types/components/Checkbox/types.d.ts +19 -1
- package/dist/types/components/Slider/component.d.ts +1 -1
- package/dist/types/components/Slider/styles.d.ts +1 -1
- package/dist/types/components/Slider/valueLabel.d.ts +7 -0
- package/dist/types/components/Toggle/component.d.ts +2 -1
- package/dist/types/components/Toggle/constants.d.ts +10 -2
- package/dist/types/components/Toggle/styles.d.ts +3 -3
- package/dist/types/components/Toggle/types.d.ts +11 -1
- package/dist/types/utils/tooltip.d.ts +3 -0
- package/package.json +1 -1
|
@@ -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, colorShadowDefault, colorIconDefaultDark, } from '../../stylesheets/palette';
|
|
4
|
+
import { colorBrand1, colorIconDefault, colorTextDefault, colorTextLight, colorWhite, colorShadowDefault, colorIconDefaultDark, colorNeutral3, } 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 `
|
|
@@ -46,7 +46,7 @@ export const TextWrapper = styled.label `
|
|
|
46
46
|
}
|
|
47
47
|
return 1;
|
|
48
48
|
}};
|
|
49
|
-
cursor: pointer;
|
|
49
|
+
cursor: ${({ $disabled }) => ($disabled ? 'not-allowed' : 'pointer')};
|
|
50
50
|
${({ $hasLabel, $hasHelperText }) => (!$hasLabel || !$hasHelperText) && `justify-content: center;`}
|
|
51
51
|
${({ $textPosition, $fullWidth }) => {
|
|
52
52
|
if ($textPosition === TEXT_POSITIONS.TOP || $textPosition === TEXT_POSITIONS.BOTTOM) {
|
|
@@ -69,24 +69,36 @@ export const TextWrapper = styled.label `
|
|
|
69
69
|
}};
|
|
70
70
|
`;
|
|
71
71
|
export const Title = styled.span `
|
|
72
|
-
color: ${colorTextDefault};
|
|
72
|
+
color: ${({ $disabled }) => ($disabled ? colorNeutral3 : colorTextDefault)};
|
|
73
73
|
font-size: ${fontSizeBig};
|
|
74
74
|
font-style: normal;
|
|
75
75
|
font-weight: 400;
|
|
76
76
|
line-height: normal;
|
|
77
77
|
`;
|
|
78
78
|
export const HelperText = styled.span `
|
|
79
|
-
color: ${colorTextLight};
|
|
79
|
+
color: ${({ $disabled }) => ($disabled ? colorNeutral3 : colorTextLight)};
|
|
80
80
|
font-size: ${fontSizeDefault};
|
|
81
81
|
font-style: normal;
|
|
82
82
|
font-weight: 400;
|
|
83
83
|
line-height: normal;
|
|
84
84
|
`;
|
|
85
|
+
// The checked track's `opacity: 1` outranks MUI's disabled track opacity, so the disabled
|
|
86
|
+
// opacity (MUI's light/dark values) is restated for a checked, disabled switch.
|
|
87
|
+
//
|
|
88
|
+
// MUI's focus ripple only tints the small thumb, so the outline is what makes keyboard
|
|
89
|
+
// focus visible. It goes on the root: the track is clipped by the root's overflow. MUI
|
|
90
|
+
// never sets `Mui-focusVisible` while disabled, so a focusable disabled input (one with
|
|
91
|
+
// a tooltip) is matched through `:focus-visible` instead.
|
|
85
92
|
export const MaterialToggle = materialStyled(Switch)(({ theme }) => ({
|
|
86
93
|
width: '2.3rem',
|
|
87
94
|
height: '1.2rem',
|
|
88
95
|
padding: 0,
|
|
89
96
|
display: 'flex',
|
|
97
|
+
'&:has(.Mui-focusVisible), &:has(.Mui-disabled input:focus-visible)': {
|
|
98
|
+
borderRadius: '0.6rem',
|
|
99
|
+
outline: `2px solid ${colorBrand1}`,
|
|
100
|
+
outlineOffset: '2px',
|
|
101
|
+
},
|
|
90
102
|
'&:active': {
|
|
91
103
|
'& .MuiSwitch-switchBase.Mui-checked': {
|
|
92
104
|
transform: 'translateX(1.2rem)',
|
|
@@ -100,6 +112,9 @@ export const MaterialToggle = materialStyled(Switch)(({ theme }) => ({
|
|
|
100
112
|
'& + .MuiSwitch-track': Object.assign({ opacity: 1, backgroundColor: colorBrand1 }, theme.applyStyles('dark', {
|
|
101
113
|
backgroundColor: colorBrand1,
|
|
102
114
|
})),
|
|
115
|
+
'&.Mui-disabled + .MuiSwitch-track': Object.assign({ opacity: 0.12 }, theme.applyStyles('dark', {
|
|
116
|
+
opacity: 0.2,
|
|
117
|
+
})),
|
|
103
118
|
},
|
|
104
119
|
},
|
|
105
120
|
'& .MuiSwitch-thumb': {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// WCAG 1.4.13 requires a tooltip to be dismissible without moving the pointer or focus.
|
|
2
|
+
export const hideOnEsc = {
|
|
3
|
+
name: 'hideOnEsc',
|
|
4
|
+
defaultValue: true,
|
|
5
|
+
fn({ hide }) {
|
|
6
|
+
const onKeyDown = (event) => {
|
|
7
|
+
if (event.key === 'Escape')
|
|
8
|
+
hide();
|
|
9
|
+
};
|
|
10
|
+
const stopListening = () => document.removeEventListener('keydown', onKeyDown, true);
|
|
11
|
+
return {
|
|
12
|
+
onShow() {
|
|
13
|
+
document.addEventListener('keydown', onKeyDown, true);
|
|
14
|
+
},
|
|
15
|
+
onHide: stopListening,
|
|
16
|
+
onDestroy: stopListening,
|
|
17
|
+
};
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
export const TOOLTIP_PLUGINS = [hideOnEsc];
|
|
@@ -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: ("
|
|
7
|
+
declare const TOOLTIP_PLACEMENT_VALUES: ("left" | "right" | "bottom" | "top")[];
|
|
8
8
|
declare const DEFAULT_TOOLTIP_PLACEMENT: "top";
|
|
9
9
|
declare const BUTTON_HEADER_POSITIONS: {
|
|
10
10
|
readonly LEFT: "left";
|
|
@@ -26,24 +26,31 @@ declare const LAYOUTS: {
|
|
|
26
26
|
readonly CIRCLE: "circle";
|
|
27
27
|
readonly SQUARED: "squared";
|
|
28
28
|
};
|
|
29
|
-
declare const LAYOUT_VALUES: ("default" | "
|
|
30
|
-
declare const DEFAULT_LAYOUT: "default" | "
|
|
29
|
+
declare const LAYOUT_VALUES: ("default" | "circle" | "stacked" | "squared")[];
|
|
30
|
+
declare const DEFAULT_LAYOUT: "default" | "circle" | "stacked" | "squared";
|
|
31
|
+
declare const LABEL_OVERFLOWS: {
|
|
32
|
+
readonly NOWRAP: "nowrap";
|
|
33
|
+
readonly WRAP: "wrap";
|
|
34
|
+
readonly ELLIPSIS: "ellipsis";
|
|
35
|
+
};
|
|
36
|
+
declare const LABEL_OVERFLOW_VALUES: ("ellipsis" | "nowrap" | "wrap")[];
|
|
37
|
+
declare const DEFAULT_LABEL_OVERFLOW: "nowrap";
|
|
31
38
|
declare const TOOLTIP_PLACEMENTS: {
|
|
32
39
|
readonly TOP: "top";
|
|
33
40
|
readonly BOTTOM: "bottom";
|
|
34
41
|
readonly LEFT: "left";
|
|
35
42
|
readonly RIGHT: "right";
|
|
36
43
|
};
|
|
37
|
-
declare const TOOLTIP_PLACEMENT_VALUES: ("
|
|
44
|
+
declare const TOOLTIP_PLACEMENT_VALUES: ("left" | "right" | "bottom" | "top")[];
|
|
38
45
|
declare const DEFAULT_TOOLTIP_PLACEMENT: "top";
|
|
39
46
|
declare const TYPES: {
|
|
40
47
|
readonly BUTTON: "button";
|
|
41
48
|
readonly SUBMIT: "submit";
|
|
42
49
|
readonly RESET: "reset";
|
|
43
50
|
};
|
|
44
|
-
declare const TYPE_VALUES: ("button" | "
|
|
51
|
+
declare const TYPE_VALUES: ("button" | "reset" | "submit")[];
|
|
45
52
|
declare const DEFAULT_TYPE: "button";
|
|
46
53
|
declare const CSS_COLOR_PROPERTIES: CSSColorPropertiesType;
|
|
47
54
|
declare const CSS_COLOR_PROPERTIES_DISABLED: EssentialColorProperties;
|
|
48
55
|
declare const CSS_SIZE_PROPERTIES: CSSSizePropertiesType;
|
|
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, };
|
|
56
|
+
export { VARIANTS, VARIANT_VALUES, DEFAULT_VARIANT, COLORS, COLOR_VALUES, DEFAULT_COLOR, SIZES, SIZE_VALUES, DEFAULT_SIZE, LAYOUTS, LAYOUT_VALUES, DEFAULT_LAYOUT, LABEL_OVERFLOWS, LABEL_OVERFLOW_VALUES, DEFAULT_LABEL_OVERFLOW, TOOLTIP_PLACEMENTS, TOOLTIP_PLACEMENT_VALUES, DEFAULT_TOOLTIP_PLACEMENT, TYPES, TYPE_VALUES, DEFAULT_TYPE, CSS_COLOR_PROPERTIES, CSS_COLOR_PROPERTIES_DISABLED, CSS_SIZE_PROPERTIES, };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { StyledHelperIconContainer, StyledButtonProps, StyledButtonWrapperProps } from './type';
|
|
1
|
+
import { StyledHelperIconContainer, StyledButtonProps, StyledButtonWrapperProps, StyledLabelProps } from './type';
|
|
2
2
|
export declare const ButtonWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledButtonWrapperProps>> & string;
|
|
3
3
|
export declare const Button: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, StyledButtonProps>> & string;
|
|
4
4
|
export declare const HelperIconContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledHelperIconContainer>> & string;
|
|
5
5
|
export declare const HelperIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
6
6
|
export declare const IconWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
7
7
|
export declare const FeedbackContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
8
|
+
export declare const Label: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, StyledLabelProps>> & string;
|
|
8
9
|
export declare const ButtonText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { COLOR_VALUES, LAYOUT_VALUES, SIZE_VALUES, VARIANT_VALUES, LAYOUTS, TOOLTIP_PLACEMENT_VALUES, TYPE_VALUES } from './constants';
|
|
2
|
+
import { COLOR_VALUES, LAYOUT_VALUES, SIZE_VALUES, VARIANT_VALUES, LAYOUTS, LABEL_OVERFLOW_VALUES, TOOLTIP_PLACEMENT_VALUES, TYPE_VALUES } from './constants';
|
|
3
3
|
export type EssentialColorProperties = {
|
|
4
4
|
color: string;
|
|
5
5
|
background: string | boolean;
|
|
@@ -28,6 +28,7 @@ type VariantType = typeof VARIANT_VALUES[number];
|
|
|
28
28
|
type ColorType = typeof COLOR_VALUES[number];
|
|
29
29
|
type SizeType = typeof SIZE_VALUES[number];
|
|
30
30
|
type LayoutType = typeof LAYOUT_VALUES[number];
|
|
31
|
+
type LabelOverflowType = typeof LABEL_OVERFLOW_VALUES[number];
|
|
31
32
|
type TooltipPlacementType = typeof TOOLTIP_PLACEMENT_VALUES[number];
|
|
32
33
|
type ButtonType = typeof TYPE_VALUES[number];
|
|
33
34
|
export interface StyledHelperIconContainer {
|
|
@@ -44,8 +45,12 @@ export interface StyledButtonProps {
|
|
|
44
45
|
$size?: SizeType;
|
|
45
46
|
$layout?: LayoutType;
|
|
46
47
|
$fullWidth?: boolean;
|
|
48
|
+
$labelOverflow?: LabelOverflowType;
|
|
47
49
|
disabled: boolean;
|
|
48
50
|
}
|
|
51
|
+
export interface StyledLabelProps {
|
|
52
|
+
$truncate: boolean;
|
|
53
|
+
}
|
|
49
54
|
type BaseButtonProps = {
|
|
50
55
|
/** HTML `id` for the root element; auto-generated via `useId` when omitted, and used to derive the label's id and default `data-test` value. @default '' */
|
|
51
56
|
id?: string;
|
|
@@ -101,6 +106,8 @@ type DefaultLayoutProps = BaseButtonProps & {
|
|
|
101
106
|
iconEnd?: React.ReactNode;
|
|
102
107
|
/** Makes the button fill the width of its container, keeping its content centered. @default false */
|
|
103
108
|
fullWidth?: boolean;
|
|
109
|
+
/** What happens when the label doesn't fit the button's available width: `nowrap` keeps it on one line, widening the button or overflowing it, `wrap` breaks it onto more lines, `ellipsis` truncates it and shows the full label as a tooltip unless `tooltipLabel` is set. @default 'nowrap' */
|
|
110
|
+
labelOverflow?: LabelOverflowType;
|
|
104
111
|
};
|
|
105
112
|
type StackedLayoutProps = BaseButtonProps & {
|
|
106
113
|
/** Layout mode for this variant — must be `'stacked'`, rendering a main icon with a label underneath plus an optional helper icon. */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { JSX } from 'react';
|
|
2
2
|
import { CheckboxProps } from './types';
|
|
3
|
+
import 'tippy.js/dist/tippy.css';
|
|
3
4
|
/**
|
|
4
5
|
* A customizable Checkbox component.
|
|
5
6
|
*
|
|
@@ -8,5 +9,5 @@ import { CheckboxProps } from './types';
|
|
|
8
9
|
* and clicking the label will toggle the checkbox state.
|
|
9
10
|
*
|
|
10
11
|
*/
|
|
11
|
-
declare function Checkbox({ label, layout, round, ariaLabel, id, dataTest, slotProps, ...props }: CheckboxProps): JSX.Element;
|
|
12
|
+
declare function Checkbox({ label, layout, helperText, round, ariaLabel, id, dataTest, slotProps, disabled, tooltipLabel, tooltipPlacement, ...props }: CheckboxProps): JSX.Element;
|
|
12
13
|
export default Checkbox;
|
|
@@ -4,3 +4,11 @@ export declare const LAYOUTS: {
|
|
|
4
4
|
};
|
|
5
5
|
export declare const LAYOUT_VALUES: ("left" | "right")[];
|
|
6
6
|
export declare const DEFAULT_LAYOUT: "left" | "right";
|
|
7
|
+
export declare const TOOLTIP_PLACEMENTS: {
|
|
8
|
+
readonly TOP: "top";
|
|
9
|
+
readonly BOTTOM: "bottom";
|
|
10
|
+
readonly LEFT: "left";
|
|
11
|
+
readonly RIGHT: "right";
|
|
12
|
+
};
|
|
13
|
+
export declare const TOOLTIP_PLACEMENT_VALUES: ("left" | "right" | "bottom" | "top")[];
|
|
14
|
+
export declare const DEFAULT_TOOLTIP_PLACEMENT: "top";
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Checkbox as MuiCheckbox } from '@mui/material';
|
|
2
|
-
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
2
|
+
import { StyledCheckboxProps, StyledContainerProps, StyledLabelProps } from './types';
|
|
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>, StyledContainerProps>> & string;
|
|
4
|
+
export declare const Label: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, StyledLabelProps>> & string;
|
|
5
|
+
export declare const HelperText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, StyledLabelProps>> & string;
|
|
6
|
+
export declare const StyledCheckbox: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("@mui/material").CheckboxProps, StyledCheckboxProps>> & string & Omit<typeof MuiCheckbox, keyof import("react").Component<any, {}, any>>;
|
|
@@ -1,16 +1,34 @@
|
|
|
1
1
|
import { CheckboxProps as MuiCheckboxProps } from '@mui/material';
|
|
2
|
-
import { LAYOUTS } from './constants';
|
|
2
|
+
import { LAYOUTS, TOOLTIP_PLACEMENT_VALUES } from './constants';
|
|
3
3
|
type Layout = typeof LAYOUTS[keyof typeof LAYOUTS];
|
|
4
|
+
type TooltipPlacement = typeof TOOLTIP_PLACEMENT_VALUES[number];
|
|
4
5
|
export interface CheckboxProps extends Omit<MuiCheckboxProps, 'inputProps'> {
|
|
5
6
|
/** Text label displayed next to the checkbox. */
|
|
6
7
|
label?: string;
|
|
7
8
|
/** Position of the label relative to the checkbox. @default 'right' */
|
|
8
9
|
layout?: Layout;
|
|
10
|
+
/** Secondary text displayed below the label; it is also exposed as the checkbox's accessible description. */
|
|
11
|
+
helperText?: string;
|
|
9
12
|
/** When true, renders the checkbox as a round radio-style control. @default false */
|
|
10
13
|
round?: boolean;
|
|
11
14
|
/** Accessible name for the checkbox. */
|
|
12
15
|
ariaLabel?: string;
|
|
13
16
|
/** `data-test` attribute on the underlying `<input>` element. */
|
|
14
17
|
dataTest?: string;
|
|
18
|
+
/** Text shown in a tooltip on hover and keyboard focus; when set, a disabled checkbox stays focusable (`aria-disabled`) so the tooltip can be reached. */
|
|
19
|
+
tooltipLabel?: string;
|
|
20
|
+
/** Placement of the tooltip when `tooltipLabel` is provided. @default 'top' */
|
|
21
|
+
tooltipPlacement?: TooltipPlacement;
|
|
22
|
+
}
|
|
23
|
+
export interface StyledContainerProps {
|
|
24
|
+
$layout: Layout;
|
|
25
|
+
$hasLabel: boolean;
|
|
26
|
+
$hasHelperText: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface StyledLabelProps {
|
|
29
|
+
$disabled?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface StyledCheckboxProps {
|
|
32
|
+
$round: boolean;
|
|
15
33
|
}
|
|
16
34
|
export {};
|
|
@@ -7,5 +7,5 @@ import { SliderProps } from './types';
|
|
|
7
7
|
* and keeps its accessible name and description on the underlying range input.
|
|
8
8
|
*
|
|
9
9
|
*/
|
|
10
|
-
declare function Slider({ label, helperText, iconStart, iconEnd, showMarkTicks, animate, valueLabelDisplay, onChange, onChangeCommitted, id: providedId, dataTest, ariaLabel, ariaLabelledBy, ariaDescribedBy, slotProps, ...rest }: SliderProps): JSX.Element;
|
|
10
|
+
declare function Slider({ label, helperText, iconStart, iconEnd, showMarkTicks, animate, valueLabelDisplay, onChange, onChangeCommitted, id: providedId, dataTest, ariaLabel, ariaLabelledBy, ariaDescribedBy, slots, slotProps, ...rest }: SliderProps): JSX.Element;
|
|
11
11
|
export default Slider;
|
|
@@ -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>, "
|
|
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>, {}, {}>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
import { SliderValueLabelProps } from '@mui/material';
|
|
3
|
+
import { ValueLabelDisplay } from './types';
|
|
4
|
+
declare function DismissibleValueLabel({ open, ...props }: SliderValueLabelProps & {
|
|
5
|
+
valueLabelDisplay?: ValueLabelDisplay;
|
|
6
|
+
}): JSX.Element;
|
|
7
|
+
export default DismissibleValueLabel;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { JSX } from 'react';
|
|
2
2
|
import { ToggleProps } from './types';
|
|
3
|
+
import 'tippy.js/dist/tippy.css';
|
|
3
4
|
/**
|
|
4
5
|
* A customizable Toggle switch component.
|
|
5
6
|
*
|
|
@@ -7,5 +8,5 @@ import { ToggleProps } from './types';
|
|
|
7
8
|
* It supports labels (label and helperText) and various textPosition configurations.
|
|
8
9
|
*
|
|
9
10
|
*/
|
|
10
|
-
declare function Toggle({ label, helperText, textPosition, fullWidth, onChange, ariaLabel, ariaLabelledBy, ariaDescribedBy, id: providedId, slotProps, ...rest }: ToggleProps): JSX.Element;
|
|
11
|
+
declare function Toggle({ label, helperText, textPosition, fullWidth, disabled, onChange, ariaLabel, ariaLabelledBy, ariaDescribedBy, id: providedId, slotProps, tooltipLabel, tooltipPlacement, ...rest }: ToggleProps): JSX.Element;
|
|
11
12
|
export default Toggle;
|
|
@@ -4,5 +4,13 @@ export declare const TEXT_POSITIONS: {
|
|
|
4
4
|
readonly TOP: "top";
|
|
5
5
|
readonly BOTTOM: "bottom";
|
|
6
6
|
};
|
|
7
|
-
export declare const TEXT_POSITIONS_VALUES: ("
|
|
8
|
-
export declare const DEFAULT_TEXT_POSITION: "
|
|
7
|
+
export declare const TEXT_POSITIONS_VALUES: ("left" | "right" | "bottom" | "top")[];
|
|
8
|
+
export declare const DEFAULT_TEXT_POSITION: "left" | "right" | "bottom" | "top";
|
|
9
|
+
export declare const TOOLTIP_PLACEMENTS: {
|
|
10
|
+
readonly TOP: "top";
|
|
11
|
+
readonly BOTTOM: "bottom";
|
|
12
|
+
readonly LEFT: "left";
|
|
13
|
+
readonly RIGHT: "right";
|
|
14
|
+
};
|
|
15
|
+
export declare const TOOLTIP_PLACEMENT_VALUES: ("left" | "right" | "bottom" | "top")[];
|
|
16
|
+
export declare const DEFAULT_TOOLTIP_PLACEMENT: "top";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { StyledTextWrapperProps, StyledToggleWrapperProps } from './types';
|
|
1
|
+
import { StyledTextProps, StyledTextWrapperProps, StyledToggleWrapperProps } from './types';
|
|
2
2
|
export declare const ToggleWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledToggleWrapperProps>> & string;
|
|
3
3
|
export declare const ToggleSwitchWrapper: 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 TextWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, StyledTextWrapperProps>> & string;
|
|
5
|
-
export declare const Title: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").
|
|
6
|
-
export declare const HelperText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").
|
|
5
|
+
export declare const Title: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, StyledTextProps>> & string;
|
|
6
|
+
export declare const HelperText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, StyledTextProps>> & string;
|
|
7
7
|
export declare const MaterialToggle: import("@emotion/styled").StyledComponent<import("@mui/material").SwitchProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { SwitchProps } from '@mui/material';
|
|
2
|
-
import { TEXT_POSITIONS_VALUES } from './constants';
|
|
2
|
+
import { TEXT_POSITIONS_VALUES, TOOLTIP_PLACEMENT_VALUES } from './constants';
|
|
3
3
|
export type LayoutType = typeof TEXT_POSITIONS_VALUES[number];
|
|
4
|
+
type TooltipPlacement = typeof TOOLTIP_PLACEMENT_VALUES[number];
|
|
4
5
|
export type LabelPlacement = 'top' | 'bottom' | 'start' | 'end';
|
|
5
6
|
export interface StyledToggleWrapperProps {
|
|
6
7
|
$textPosition: LayoutType;
|
|
@@ -9,6 +10,10 @@ export interface StyledToggleWrapperProps {
|
|
|
9
10
|
export interface StyledTextWrapperProps extends StyledToggleWrapperProps {
|
|
10
11
|
$hasLabel: boolean;
|
|
11
12
|
$hasHelperText: boolean;
|
|
13
|
+
$disabled?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface StyledTextProps {
|
|
16
|
+
$disabled?: boolean;
|
|
12
17
|
}
|
|
13
18
|
export interface ToggleProps extends Omit<SwitchProps, 'inputProps'> {
|
|
14
19
|
/** Main label text displayed next to the toggle. */
|
|
@@ -25,4 +30,9 @@ export interface ToggleProps extends Omit<SwitchProps, 'inputProps'> {
|
|
|
25
30
|
ariaLabelledBy?: string;
|
|
26
31
|
/** ID of the element that describes the toggle; falls back to the rendered helper text's id when omitted. */
|
|
27
32
|
ariaDescribedBy?: string;
|
|
33
|
+
/** Text shown in a tooltip on hover and keyboard focus; when set, a disabled toggle stays focusable (`aria-disabled`) so the tooltip can be reached. */
|
|
34
|
+
tooltipLabel?: string;
|
|
35
|
+
/** Placement of the tooltip when `tooltipLabel` is provided. @default 'top' */
|
|
36
|
+
tooltipPlacement?: TooltipPlacement;
|
|
28
37
|
}
|
|
38
|
+
export {};
|