@bigbluebutton/bbb-ui-components-react 0.9.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/README.md +1 -0
- 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/Search.js +3 -2
- package/dist/components/Slider.js +8 -8
- package/dist/components/Spinner.js +1 -0
- package/dist/components/Toast.js +295 -0
- package/dist/components/Toggle.js +23 -16
- package/dist/components/index.js +318 -142
- 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/Spinner/styles.js +1 -0
- package/dist/esm/components/Toast/component.js +144 -0
- package/dist/esm/components/Toast/constants.js +36 -0
- package/dist/esm/components/Toast/index.js +1 -0
- package/dist/esm/components/Toast/styles.js +180 -0
- package/dist/esm/components/Toast/types.js +1 -0
- package/dist/esm/components/Toggle/component.js +88 -16
- package/dist/esm/components/Toggle/constants.js +8 -0
- package/dist/esm/components/Toggle/styles.js +32 -6
- package/dist/esm/components/index.js +1 -0
- package/dist/esm/stylesheets/palette.js +4 -0
- package/dist/esm/utils/tooltip.js +20 -0
- package/dist/types/components/Button/constants.d.ts +8 -1
- 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/valueLabel.d.ts +7 -0
- package/dist/types/components/TextInput/styles.d.ts +1 -1
- package/dist/types/components/Toast/component.d.ts +14 -0
- package/dist/types/components/Toast/constants.d.ts +42 -0
- package/dist/types/components/Toast/index.d.ts +1 -0
- package/dist/types/components/Toast/styles.d.ts +14 -0
- package/dist/types/components/Toast/types.d.ts +68 -0
- package/dist/types/components/Toggle/component.d.ts +2 -1
- package/dist/types/components/Toggle/constants.d.ts +8 -0
- package/dist/types/components/Toggle/styles.d.ts +3 -3
- package/dist/types/components/Toggle/types.d.ts +14 -1
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/stylesheets/palette.d.ts +2 -0
- package/dist/types/utils/tooltip.d.ts +3 -0
- package/package.json +11 -1
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import styled, { css, keyframes } from 'styled-components';
|
|
2
|
+
import { colorBackgroundWhite, colorBrand1, colorShadowDefault, colorTextDefault, colorTextLight, } from '../../stylesheets/palette';
|
|
3
|
+
import { borderRadiusSmall, spacingMediumLarge, spacingSmall, spacingSmallMedium, } from '../../stylesheets/sizing';
|
|
4
|
+
import { fontSizeBig, fontSizeDefault, fontSizeSmall, fontSizeXSmall, fontWeightLight, } from '../../stylesheets/typography';
|
|
5
|
+
import { VARIANT_COLORS } from './constants';
|
|
6
|
+
// `message` and `content` take arbitrary nodes, so any media a consumer passes is
|
|
7
|
+
// capped to the card instead of forcing it wider than its container.
|
|
8
|
+
const richContent = css `
|
|
9
|
+
img,
|
|
10
|
+
svg,
|
|
11
|
+
video {
|
|
12
|
+
max-width: 100%;
|
|
13
|
+
}
|
|
14
|
+
`;
|
|
15
|
+
const visuallyHidden = css `
|
|
16
|
+
position: absolute;
|
|
17
|
+
width: 1px;
|
|
18
|
+
height: 1px;
|
|
19
|
+
overflow: hidden;
|
|
20
|
+
clip-path: inset(50%);
|
|
21
|
+
white-space: nowrap;
|
|
22
|
+
`;
|
|
23
|
+
// Unstyled so the message reads as plain text; its focus ring is drawn on the whole card.
|
|
24
|
+
export const CardAction = styled.button `
|
|
25
|
+
margin: 0;
|
|
26
|
+
padding: 0;
|
|
27
|
+
border: 0;
|
|
28
|
+
background: none;
|
|
29
|
+
color: inherit;
|
|
30
|
+
font: inherit;
|
|
31
|
+
line-height: inherit;
|
|
32
|
+
text-align: start;
|
|
33
|
+
cursor: inherit;
|
|
34
|
+
|
|
35
|
+
&:focus {
|
|
36
|
+
outline: none;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
${({ $visuallyHidden }) => $visuallyHidden && visuallyHidden}
|
|
40
|
+
`;
|
|
41
|
+
export const Container = styled.div `
|
|
42
|
+
position: relative;
|
|
43
|
+
display: flex;
|
|
44
|
+
/* Fills the slot it is given even when that slot is a flex container, as toast engines'
|
|
45
|
+
wrappers usually are, so every toast in a stack has the same width. */
|
|
46
|
+
width: 100%;
|
|
47
|
+
flex-direction: row;
|
|
48
|
+
align-items: stretch;
|
|
49
|
+
gap: ${spacingSmallMedium};
|
|
50
|
+
padding: ${spacingMediumLarge};
|
|
51
|
+
background-color: ${colorBackgroundWhite};
|
|
52
|
+
border-radius: ${borderRadiusSmall};
|
|
53
|
+
box-shadow: 0 2px 8px ${colorShadowDefault};
|
|
54
|
+
overflow-wrap: break-word;
|
|
55
|
+
/* So maxHeight caps the whole card, padding included, rather than just its content box. */
|
|
56
|
+
box-sizing: border-box;
|
|
57
|
+
max-height: ${({ $maxHeight }) => $maxHeight};
|
|
58
|
+
cursor: ${({ $disablePointer }) => ($disablePointer ? 'auto' : 'pointer')};
|
|
59
|
+
|
|
60
|
+
&:has(${CardAction}:focus-visible) {
|
|
61
|
+
outline: 2px solid ${colorBrand1};
|
|
62
|
+
}
|
|
63
|
+
`;
|
|
64
|
+
// Mirrors the close button's box. The title row is sized by that button rather than by
|
|
65
|
+
// the text, so pinning the badge to the top left it riding high by half the difference —
|
|
66
|
+
// worse the smaller the badge, which is why it showed up first in the `small` variant.
|
|
67
|
+
// Giving the badge and the title row the same band centers them on one line at any size.
|
|
68
|
+
const titleRowHeight = '2.375rem';
|
|
69
|
+
// The width of BBButton's focus outline, which is drawn outside its box.
|
|
70
|
+
const focusRingWidth = '2px';
|
|
71
|
+
// The icon owns a full-height section of its own on the left; inside it, the badge is
|
|
72
|
+
// centered on the title row so it stays on the title's line as content grows.
|
|
73
|
+
export const IconSection = styled.div `
|
|
74
|
+
display: flex;
|
|
75
|
+
align-items: flex-start;
|
|
76
|
+
flex-shrink: 0;
|
|
77
|
+
`;
|
|
78
|
+
export const IconBand = styled.div `
|
|
79
|
+
display: flex;
|
|
80
|
+
align-items: center;
|
|
81
|
+
min-height: ${titleRowHeight};
|
|
82
|
+
`;
|
|
83
|
+
export const Body = styled.div `
|
|
84
|
+
display: flex;
|
|
85
|
+
flex-direction: column;
|
|
86
|
+
flex: 1;
|
|
87
|
+
min-width: 0;
|
|
88
|
+
gap: ${spacingSmall};
|
|
89
|
+
|
|
90
|
+
/* min-height lets this flex child shrink below its content so the overflow can scroll. */
|
|
91
|
+
min-height: 0;
|
|
92
|
+
overflow-y: auto;
|
|
93
|
+
overflow-x: hidden;
|
|
94
|
+
|
|
95
|
+
/* As a scroll container this clips whatever overflows it, including the focus ring of
|
|
96
|
+
the close button, which spans the full height of the title row. The padding leaves
|
|
97
|
+
room for the ring and the negative margin cancels it out of the layout. */
|
|
98
|
+
padding: ${focusRingWidth};
|
|
99
|
+
margin: -${focusRingWidth};
|
|
100
|
+
`;
|
|
101
|
+
// The close button shares this row with the title only, so it stays on the title's line
|
|
102
|
+
// instead of centering against the content below it.
|
|
103
|
+
export const Header = styled.div `
|
|
104
|
+
display: flex;
|
|
105
|
+
flex-direction: row;
|
|
106
|
+
align-items: center;
|
|
107
|
+
min-height: ${titleRowHeight};
|
|
108
|
+
gap: ${spacingSmall};
|
|
109
|
+
`;
|
|
110
|
+
export const IconBadge = styled.div `
|
|
111
|
+
display: flex;
|
|
112
|
+
align-items: center;
|
|
113
|
+
justify-content: center;
|
|
114
|
+
flex-shrink: 0;
|
|
115
|
+
border-radius: 50%;
|
|
116
|
+
aspect-ratio: 1;
|
|
117
|
+
width: ${({ $small }) => ($small ? '1.5rem' : '2rem')};
|
|
118
|
+
font-size: ${({ $small }) => ($small ? fontSizeXSmall : fontSizeBig)};
|
|
119
|
+
background-color: ${({ $variant }) => VARIANT_COLORS[$variant].background};
|
|
120
|
+
color: ${({ $variant }) => VARIANT_COLORS[$variant].glyph};
|
|
121
|
+
`;
|
|
122
|
+
export const Message = styled.div `
|
|
123
|
+
flex: 1;
|
|
124
|
+
min-width: 0;
|
|
125
|
+
color: ${colorTextDefault};
|
|
126
|
+
font-size: ${({ $small }) => ($small ? fontSizeSmall : fontSizeDefault)};
|
|
127
|
+
font-weight: ${fontWeightLight};
|
|
128
|
+
line-height: normal;
|
|
129
|
+
|
|
130
|
+
${richContent}
|
|
131
|
+
`;
|
|
132
|
+
export const Content = styled.div `
|
|
133
|
+
color: ${colorTextLight};
|
|
134
|
+
font-size: ${({ $small }) => ($small ? fontSizeXSmall : fontSizeSmall)};
|
|
135
|
+
font-weight: ${fontWeightLight};
|
|
136
|
+
line-height: normal;
|
|
137
|
+
|
|
138
|
+
${richContent}
|
|
139
|
+
`;
|
|
140
|
+
export const ActionWrapper = styled.div `
|
|
141
|
+
display: flex;
|
|
142
|
+
justify-content: flex-end;
|
|
143
|
+
`;
|
|
144
|
+
export const CloseButtonWrapper = styled.div `
|
|
145
|
+
display: flex;
|
|
146
|
+
flex-shrink: 0;
|
|
147
|
+
margin-inline-start: auto;
|
|
148
|
+
`;
|
|
149
|
+
const countdown = keyframes `
|
|
150
|
+
from {
|
|
151
|
+
transform: scaleX(1);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
to {
|
|
155
|
+
transform: scaleX(0);
|
|
156
|
+
}
|
|
157
|
+
`;
|
|
158
|
+
// Clips the bar to the card's rounded bottom corners without clipping the card's content.
|
|
159
|
+
export const ProgressTrack = styled.div `
|
|
160
|
+
position: absolute;
|
|
161
|
+
inset-inline: 0;
|
|
162
|
+
bottom: 0;
|
|
163
|
+
height: 0.25rem;
|
|
164
|
+
overflow: hidden;
|
|
165
|
+
border-end-start-radius: ${borderRadiusSmall};
|
|
166
|
+
border-end-end-radius: ${borderRadiusSmall};
|
|
167
|
+
`;
|
|
168
|
+
// Pausing the animation together with the timer keeps the two in step: both resume from
|
|
169
|
+
// where they stopped instead of restarting.
|
|
170
|
+
export const ProgressBar = styled.div `
|
|
171
|
+
height: 100%;
|
|
172
|
+
background-color: ${({ $variant }) => VARIANT_COLORS[$variant].background};
|
|
173
|
+
transform-origin: left;
|
|
174
|
+
animation: ${countdown} ${({ $duration }) => $duration}ms linear forwards;
|
|
175
|
+
animation-play-state: ${({ $paused }) => ($paused ? 'paused' : 'running')};
|
|
176
|
+
|
|
177
|
+
[dir='rtl'] & {
|
|
178
|
+
transform-origin: right;
|
|
179
|
+
}
|
|
180
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -9,9 +9,29 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
import React, { useId } from 'react';
|
|
12
|
+
import React, { useEffect, useId, useRef, useState, } from 'react';
|
|
13
|
+
import { switchClasses } from '@mui/material';
|
|
13
14
|
import * as Styled from './styles';
|
|
14
|
-
import { DEFAULT_TEXT_POSITION } from './constants';
|
|
15
|
+
import { DEFAULT_TEXT_POSITION, DEFAULT_TOOLTIP_PLACEMENT, TEXT_POSITIONS } from './constants';
|
|
16
|
+
import Tippy from '@tippyjs/react';
|
|
17
|
+
import 'tippy.js/dist/tippy.css';
|
|
18
|
+
import { TOOLTIP_PLUGINS } from '../../utils/tooltip';
|
|
19
|
+
// Cancelling the click (mouse, label or Space) keeps the switch unchanged, and MUI skips
|
|
20
|
+
// `onChange` for a prevented click. It sits on the switch because MUI drops event handlers
|
|
21
|
+
// passed through `slotProps.input`, except `onChange`.
|
|
22
|
+
const preventToggle = (event) => event.preventDefault();
|
|
23
|
+
// Bridges the gap between the text and the switch, which are separate tooltip triggers,
|
|
24
|
+
// so moving the pointer from one to the other doesn't hide and reshow the tooltip.
|
|
25
|
+
const TOOLTIP_DELAY = [0, 100];
|
|
26
|
+
const isElement = (element) => element !== null;
|
|
27
|
+
const getBoundingRect = (elements) => {
|
|
28
|
+
const rects = elements.map((element) => element.getBoundingClientRect());
|
|
29
|
+
const left = Math.min(...rects.map((rect) => rect.left));
|
|
30
|
+
const top = Math.min(...rects.map((rect) => rect.top));
|
|
31
|
+
const right = Math.max(...rects.map((rect) => rect.right));
|
|
32
|
+
const bottom = Math.max(...rects.map((rect) => rect.bottom));
|
|
33
|
+
return new DOMRect(left, top, right - left, bottom - top);
|
|
34
|
+
};
|
|
15
35
|
/**
|
|
16
36
|
* A customizable Toggle switch component.
|
|
17
37
|
*
|
|
@@ -20,30 +40,82 @@ import { DEFAULT_TEXT_POSITION } from './constants';
|
|
|
20
40
|
*
|
|
21
41
|
*/
|
|
22
42
|
function Toggle(_a) {
|
|
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"]);
|
|
43
|
+
var { label, helperText, textPosition = DEFAULT_TEXT_POSITION, fullWidth = false, disabled, onChange, ariaLabel, ariaLabelledBy, ariaDescribedBy, id: providedId, slotProps, tooltipLabel, tooltipPlacement = DEFAULT_TOOLTIP_PLACEMENT } = _a, rest = __rest(_a, ["label", "helperText", "textPosition", "fullWidth", "disabled", "onChange", "ariaLabel", "ariaLabelledBy", "ariaDescribedBy", "id", "slotProps", "tooltipLabel", "tooltipPlacement"]);
|
|
24
44
|
const generatedUniqueId = useId();
|
|
45
|
+
const titleRef = useRef(null);
|
|
46
|
+
const helperTextRef = useRef(null);
|
|
47
|
+
const switchWrapperRef = useRef(null);
|
|
48
|
+
const wrapperRef = useRef(null);
|
|
49
|
+
const [tooltipTriggers, setTooltipTriggers] = useState([]);
|
|
50
|
+
// MUI's Switch ref points at its inner button, which a disabled switch hides from the
|
|
51
|
+
// pointer; the root, which holds the track, is looked up instead.
|
|
52
|
+
const getSwitchRoot = () => {
|
|
53
|
+
var _a, _b;
|
|
54
|
+
return ((_b = (_a = switchWrapperRef.current) === null || _a === void 0 ? void 0 : _a.querySelector(`.${switchClasses.root}`)) !== null && _b !== void 0 ? _b : null);
|
|
55
|
+
};
|
|
56
|
+
// The wrapper spans the whole row, so it can't be the tooltip's trigger or anchor: the
|
|
57
|
+
// tooltip would open over empty space and center on the row. The text and the switch
|
|
58
|
+
// trigger it instead, and it points at the text, or at the switch when there is none.
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
if (!tooltipLabel)
|
|
61
|
+
return;
|
|
62
|
+
setTooltipTriggers([titleRef.current, helperTextRef.current, getSwitchRoot()].filter(isElement));
|
|
63
|
+
}, [tooltipLabel, label, helperText]);
|
|
64
|
+
const getTooltipAnchorRect = () => {
|
|
65
|
+
const textElements = [titleRef.current, helperTextRef.current].filter(isElement);
|
|
66
|
+
const anchorElements = textElements.length > 0 ? textElements : [getSwitchRoot()].filter(isElement);
|
|
67
|
+
return anchorElements.length > 0 ? getBoundingRect(anchorElements) : new DOMRect();
|
|
68
|
+
};
|
|
25
69
|
const id = providedId !== null && providedId !== void 0 ? providedId : generatedUniqueId;
|
|
26
70
|
const labelId = label ? `${id}-label` : undefined;
|
|
27
71
|
const helperTextId = helperText ? `${id}-helper` : undefined;
|
|
28
|
-
const
|
|
72
|
+
const tooltipDescriptionId = tooltipLabel ? `${id}-tooltip` : undefined;
|
|
73
|
+
const isFullWidth = fullWidth && (textPosition === TEXT_POSITIONS.LEFT || textPosition === TEXT_POSITIONS.RIGHT);
|
|
74
|
+
const explicitLabelledBy = ariaLabel ? undefined : ariaLabelledBy || labelId;
|
|
29
75
|
// Without a name source, the <label htmlFor> names the input from the helper text,
|
|
30
|
-
// so it can't also be the description.
|
|
31
|
-
|
|
76
|
+
// so it can't also be the description. The tooltip text follows the same rule when
|
|
77
|
+
// neither a label nor the helper text names the toggle.
|
|
78
|
+
const hasNameSource = !!ariaLabel || !!explicitLabelledBy;
|
|
79
|
+
const tooltipNamesToggle = Boolean(tooltipLabel && !hasNameSource && !helperText);
|
|
32
80
|
const a11yInputProps = {
|
|
33
81
|
role: 'switch',
|
|
34
82
|
'aria-label': ariaLabel,
|
|
35
|
-
'aria-labelledby':
|
|
36
|
-
'aria-describedby':
|
|
83
|
+
'aria-labelledby': tooltipNamesToggle ? tooltipDescriptionId : explicitLabelledBy,
|
|
84
|
+
'aria-describedby': [
|
|
85
|
+
ariaDescribedBy || (hasNameSource ? helperTextId : undefined),
|
|
86
|
+
!tooltipNamesToggle && tooltipDescriptionId,
|
|
87
|
+
].filter(Boolean).join(' ') || undefined,
|
|
37
88
|
};
|
|
89
|
+
// A natively disabled input leaves the tab order, so keyboard users could never reach the
|
|
90
|
+
// tooltip that explains why it is disabled. With a tooltip, the input stays focusable and is
|
|
91
|
+
// announced through aria-disabled instead; dropping `name` and `required` keeps it out of form
|
|
92
|
+
// submission and validation, as a natively disabled input would be.
|
|
93
|
+
const focusableWhileDisabled = Boolean(disabled && tooltipLabel);
|
|
94
|
+
const focusableDisabledInputProps = focusableWhileDisabled
|
|
95
|
+
? {
|
|
96
|
+
disabled: false,
|
|
97
|
+
'aria-disabled': true,
|
|
98
|
+
name: undefined,
|
|
99
|
+
required: false,
|
|
100
|
+
}
|
|
101
|
+
: {};
|
|
38
102
|
const _b = slotProps !== null && slotProps !== void 0 ? slotProps : {}, { input: consumerInputSlotProps } = _b, otherSlotProps = __rest(_b, ["input"]);
|
|
39
103
|
const inputSlotProps = typeof consumerInputSlotProps === 'function'
|
|
40
|
-
? (ownerState) => (Object.assign(Object.assign({}, a11yInputProps), consumerInputSlotProps(ownerState)))
|
|
41
|
-
: Object.assign(Object.assign({}, a11yInputProps), consumerInputSlotProps);
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
104
|
+
? (ownerState) => (Object.assign(Object.assign(Object.assign({}, a11yInputProps), consumerInputSlotProps(ownerState)), focusableDisabledInputProps))
|
|
105
|
+
: Object.assign(Object.assign(Object.assign({}, a11yInputProps), consumerInputSlotProps), focusableDisabledInputProps);
|
|
106
|
+
// Tippy sits beside the wrapper instead of wrapping it, so toggling `tooltipLabel` keeps
|
|
107
|
+
// the same root and doesn't remount the toggle (losing focus and uncontrolled state).
|
|
108
|
+
// The switch root, not the input, triggers it: MUI gives the disabled switch's input
|
|
109
|
+
// `pointer-events: none`, so hovering it reaches the root. `focusin` bubbles from the
|
|
110
|
+
// input; Tippy's `focus` would not.
|
|
111
|
+
return (React.createElement(React.Fragment, null,
|
|
112
|
+
React.createElement(Styled.ToggleWrapper, { ref: wrapperRef, "$textPosition": textPosition, "$fullWidth": isFullWidth },
|
|
113
|
+
(label || helperText) && (React.createElement(Styled.TextWrapper, { "$textPosition": textPosition, "$fullWidth": isFullWidth, htmlFor: id, "$hasLabel": !!label, "$hasHelperText": !!helperText, "$disabled": disabled },
|
|
114
|
+
label && React.createElement(Styled.Title, { ref: titleRef, id: labelId, "$disabled": disabled }, label),
|
|
115
|
+
helperText && (React.createElement(Styled.HelperText, { ref: helperTextRef, id: helperTextId, "$disabled": disabled }, helperText)))),
|
|
116
|
+
React.createElement(Styled.ToggleSwitchWrapper, { ref: switchWrapperRef },
|
|
117
|
+
React.createElement(Styled.MaterialToggle, Object.assign({}, rest, { id: id, disabled: disabled }, (focusableWhileDisabled && { onClick: preventToggle }), { onChange: onChange, slotProps: Object.assign(Object.assign({}, otherSlotProps), { input: inputSlotProps }) }))),
|
|
118
|
+
tooltipLabel && (React.createElement("span", { id: tooltipDescriptionId, hidden: true }, tooltipLabel))),
|
|
119
|
+
tooltipLabel && (React.createElement(Tippy, { reference: wrapperRef, content: tooltipLabel, placement: tooltipPlacement, trigger: "mouseenter focusin", triggerTarget: tooltipTriggers.length > 0 ? tooltipTriggers : null, getReferenceClientRect: getTooltipAnchorRect, delay: TOOLTIP_DELAY, aria: { content: null }, plugins: TOOLTIP_PLUGINS }))));
|
|
48
120
|
}
|
|
49
121
|
export default Toggle;
|
|
@@ -6,3 +6,11 @@ export const TEXT_POSITIONS = {
|
|
|
6
6
|
};
|
|
7
7
|
export const TEXT_POSITIONS_VALUES = Object.values(TEXT_POSITIONS);
|
|
8
8
|
export const DEFAULT_TEXT_POSITION = TEXT_POSITIONS_VALUES[0];
|
|
9
|
+
export const TOOLTIP_PLACEMENTS = {
|
|
10
|
+
TOP: 'top',
|
|
11
|
+
BOTTOM: 'bottom',
|
|
12
|
+
LEFT: 'left',
|
|
13
|
+
RIGHT: 'right',
|
|
14
|
+
};
|
|
15
|
+
export const TOOLTIP_PLACEMENT_VALUES = Object.values(TOOLTIP_PLACEMENTS);
|
|
16
|
+
export const DEFAULT_TOOLTIP_PLACEMENT = TOOLTIP_PLACEMENTS.TOP;
|
|
@@ -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 `
|
|
@@ -25,6 +25,10 @@ export const ToggleWrapper = styled.div `
|
|
|
25
25
|
}
|
|
26
26
|
return horizontalStyles;
|
|
27
27
|
}};
|
|
28
|
+
${({ $fullWidth }) => $fullWidth && css `
|
|
29
|
+
width: 100%;
|
|
30
|
+
justify-content: space-between;
|
|
31
|
+
`}
|
|
28
32
|
`;
|
|
29
33
|
export const ToggleSwitchWrapper = styled.div `
|
|
30
34
|
display: flex;
|
|
@@ -42,15 +46,22 @@ export const TextWrapper = styled.label `
|
|
|
42
46
|
}
|
|
43
47
|
return 1;
|
|
44
48
|
}};
|
|
45
|
-
cursor: pointer;
|
|
49
|
+
cursor: ${({ $disabled }) => ($disabled ? 'not-allowed' : 'pointer')};
|
|
46
50
|
${({ $hasLabel, $hasHelperText }) => (!$hasLabel || !$hasHelperText) && `justify-content: center;`}
|
|
47
|
-
${({ $textPosition }) => {
|
|
51
|
+
${({ $textPosition, $fullWidth }) => {
|
|
48
52
|
if ($textPosition === TEXT_POSITIONS.TOP || $textPosition === TEXT_POSITIONS.BOTTOM) {
|
|
49
53
|
return css `
|
|
50
54
|
align-items: center;
|
|
51
55
|
`;
|
|
52
56
|
}
|
|
53
|
-
|
|
57
|
+
// A full-width row aligns the text to the container's edge; otherwise it hugs the switch.
|
|
58
|
+
if ($fullWidth && $textPosition === TEXT_POSITIONS.RIGHT) {
|
|
59
|
+
return css `
|
|
60
|
+
align-items: end;
|
|
61
|
+
text-align: end;
|
|
62
|
+
`;
|
|
63
|
+
}
|
|
64
|
+
if ($textPosition === TEXT_POSITIONS.LEFT && !$fullWidth)
|
|
54
65
|
return css `align-items: end;`;
|
|
55
66
|
return css `
|
|
56
67
|
align-items: start;
|
|
@@ -58,24 +69,36 @@ export const TextWrapper = styled.label `
|
|
|
58
69
|
}};
|
|
59
70
|
`;
|
|
60
71
|
export const Title = styled.span `
|
|
61
|
-
color: ${colorTextDefault};
|
|
72
|
+
color: ${({ $disabled }) => ($disabled ? colorNeutral3 : colorTextDefault)};
|
|
62
73
|
font-size: ${fontSizeBig};
|
|
63
74
|
font-style: normal;
|
|
64
75
|
font-weight: 400;
|
|
65
76
|
line-height: normal;
|
|
66
77
|
`;
|
|
67
78
|
export const HelperText = styled.span `
|
|
68
|
-
color: ${colorTextLight};
|
|
79
|
+
color: ${({ $disabled }) => ($disabled ? colorNeutral3 : colorTextLight)};
|
|
69
80
|
font-size: ${fontSizeDefault};
|
|
70
81
|
font-style: normal;
|
|
71
82
|
font-weight: 400;
|
|
72
83
|
line-height: normal;
|
|
73
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.
|
|
74
92
|
export const MaterialToggle = materialStyled(Switch)(({ theme }) => ({
|
|
75
93
|
width: '2.3rem',
|
|
76
94
|
height: '1.2rem',
|
|
77
95
|
padding: 0,
|
|
78
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
|
+
},
|
|
79
102
|
'&:active': {
|
|
80
103
|
'& .MuiSwitch-switchBase.Mui-checked': {
|
|
81
104
|
transform: 'translateX(1.2rem)',
|
|
@@ -89,6 +112,9 @@ export const MaterialToggle = materialStyled(Switch)(({ theme }) => ({
|
|
|
89
112
|
'& + .MuiSwitch-track': Object.assign({ opacity: 1, backgroundColor: colorBrand1 }, theme.applyStyles('dark', {
|
|
90
113
|
backgroundColor: colorBrand1,
|
|
91
114
|
})),
|
|
115
|
+
'&.Mui-disabled + .MuiSwitch-track': Object.assign({ opacity: 0.12 }, theme.applyStyles('dark', {
|
|
116
|
+
opacity: 0.2,
|
|
117
|
+
})),
|
|
92
118
|
},
|
|
93
119
|
},
|
|
94
120
|
'& .MuiSwitch-thumb': {
|
|
@@ -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';
|
|
@@ -25,6 +25,10 @@ const colorError_base = 'var(--color-error, #DF2721)';
|
|
|
25
25
|
const colorErrorDark_base = 'var(--color-error-dark, #AE1010)';
|
|
26
26
|
export const colorSuccess = 'var(--color-success, #2DD36F)';
|
|
27
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)';
|
|
28
32
|
// Mapped to core css vars
|
|
29
33
|
export const colorError = `var(--color-danger, ${colorError_base})`;
|
|
30
34
|
export const colorErrorDark = `var(--color-danger-dark, ${colorErrorDark_base})`;
|
|
@@ -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];
|
|
@@ -28,6 +28,13 @@ declare const LAYOUTS: {
|
|
|
28
28
|
};
|
|
29
29
|
declare const LAYOUT_VALUES: ("default" | "circle" | "stacked" | "squared")[];
|
|
30
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";
|
|
@@ -46,4 +53,4 @@ 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;
|
|
@@ -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;
|
|
@@ -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").
|
|
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>>;
|
|
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;
|