@auth0/quantum-product 2.4.7 → 2.4.9

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 (49) hide show
  1. package/accordion/accordion-details.js +1 -1
  2. package/alert/alert.js +1 -1
  3. package/avatar-block/avatar-block.d.ts +3 -1
  4. package/avatar-block/avatar-block.js +3 -2
  5. package/button/button.d.ts +1 -0
  6. package/button/button.js +20 -4
  7. package/card/card-header/card-header.d.ts +17 -1
  8. package/card/card-header/card-header.js +24 -2
  9. package/chip/chip.js +1 -1
  10. package/code/code.js +4 -3
  11. package/color-text-field/color-text-field.js +91 -25
  12. package/copy-button/copy-button.d.ts +9 -10
  13. package/copy-button/copy-button.js +3 -3
  14. package/dialog/dialog-title/dialog-title.d.ts +1 -0
  15. package/dialog/dialog-title/dialog-title.js +2 -2
  16. package/dialog/dialog.d.ts +2 -0
  17. package/dialog/dialog.js +2 -2
  18. package/esm/accordion/accordion-details.js +1 -1
  19. package/esm/alert/alert.js +1 -1
  20. package/esm/avatar-block/avatar-block.js +3 -2
  21. package/esm/button/button.js +20 -4
  22. package/esm/card/card-header/card-header.js +24 -2
  23. package/esm/chip/chip.js +1 -1
  24. package/esm/code/code.js +4 -3
  25. package/esm/color-text-field/color-text-field.js +91 -25
  26. package/esm/copy-button/copy-button.js +3 -3
  27. package/esm/dialog/dialog-title/dialog-title.js +2 -2
  28. package/esm/dialog/dialog.js +2 -2
  29. package/esm/label/label.js +2 -2
  30. package/esm/page/page-header/page-header.js +1 -1
  31. package/esm/panel/panel/panel.js +2 -2
  32. package/esm/panel/panel-header/panel-header.js +14 -3
  33. package/esm/selectable-card/selectable-card.js +5 -2
  34. package/esm/tabs/tab/tab.js +13 -3
  35. package/esm/text/text.js +2 -2
  36. package/esm/title-block/title-block.js +2 -2
  37. package/expansion-panel/expansion-panel-header.d.ts +2 -1
  38. package/label/label.js +2 -2
  39. package/package.json +1 -1
  40. package/page/page-header/page-header.js +1 -1
  41. package/panel/panel/panel.d.ts +5 -1
  42. package/panel/panel/panel.js +2 -2
  43. package/panel/panel-header/panel-header.d.ts +3 -1
  44. package/panel/panel-header/panel-header.js +14 -3
  45. package/selectable-card/selectable-card.d.ts +8 -0
  46. package/selectable-card/selectable-card.js +5 -2
  47. package/tabs/tab/tab.js +13 -3
  48. package/text/text.js +2 -2
  49. package/title-block/title-block.js +2 -2
@@ -41,7 +41,30 @@ import { InputAdornment } from '../input';
41
41
  import { styled } from '../styled';
42
42
  import { TextField } from '../text-field';
43
43
  var colorTextFieldComponentName = 'QuantumColorTextField';
44
- var Root = styled(TextField, { name: colorTextFieldComponentName, slot: 'Root' })({});
44
+ var Root = styled(TextField, { name: colorTextFieldComponentName, slot: 'Root' })(function (_a) {
45
+ var size = _a.size;
46
+ return ({
47
+ 'input::placeholder': {
48
+ textTransform: 'uppercase',
49
+ },
50
+ '& > div:first-of-type': {
51
+ paddingLeft: size === 'small' ? '9px' : '12px',
52
+ },
53
+ '& input[type="color"]': {
54
+ cursor: 'pointer',
55
+ width: size === 'small' ? '16px' : '20px',
56
+ height: size === 'small' ? '16px' : '20px',
57
+ '&::-webkit-color-swatch, &::-webkit-color-swatch-wrapper': {
58
+ borderRadius: '2px',
59
+ padding: 0,
60
+ },
61
+ '&::-moz-color-swatch': {
62
+ borderRadius: '2px',
63
+ padding: 0,
64
+ },
65
+ },
66
+ });
67
+ });
45
68
  var ColorPicker = styled('input', { name: colorTextFieldComponentName, slot: 'ColorPicker' })(function (_a) {
46
69
  var theme = _a.theme;
47
70
  return ({
@@ -55,39 +78,82 @@ var ColorPicker = styled('input', { name: colorTextFieldComponentName, slot: 'Co
55
78
  '&:focus': __assign({ outline: 'none' }, theme.mixins.focusRing()),
56
79
  });
57
80
  });
81
+ // Normalizes HEX color values to valid 7char HEX color values
58
82
  var normalizeHex = function (hex) {
59
- if (hex.length === 4 && /^#[0-9A-F]{3}$/i.test(hex)) {
60
- return "#".concat(hex[1]).concat(hex[1]).concat(hex[2]).concat(hex[2]).concat(hex[3]).concat(hex[3]);
83
+ if (hex.startsWith('#')) {
84
+ hex = hex.slice(1);
61
85
  }
62
- return hex;
86
+ var upperHex = hex.toUpperCase();
87
+ switch (upperHex.length) {
88
+ case 0:
89
+ return '';
90
+ case 1:
91
+ return "#".concat(upperHex.repeat(6));
92
+ case 2:
93
+ return "#".concat(upperHex.repeat(3));
94
+ case 3:
95
+ case 4:
96
+ case 5:
97
+ return "#".concat(upperHex[0].repeat(2)).concat(upperHex[1].repeat(2)).concat(upperHex[2].repeat(2));
98
+ default:
99
+ return "#".concat(upperHex.padEnd(6, upperHex).slice(0, 6));
100
+ }
101
+ };
102
+ var validateHex = function (hex) {
103
+ var hexRegex = /^(#?[0-9a-fA-F]{1,6})$/;
104
+ return hexRegex.test(hex);
63
105
  };
64
106
  export var ColorTextField = React.forwardRef(function (props, ref) {
65
- var inputAdornmentProps = props.inputAdornmentProps, value = props.value, defaultValue = props.defaultValue, placeholder = props.placeholder, rootProps = __rest(props, ["inputAdornmentProps", "value", "defaultValue", "placeholder"]);
66
- var _a = __read(React.useState(normalizeHex(value || placeholder || defaultValue || '#000000')), 2), color = _a[0], setColor = _a[1];
67
- var handleColorChange = function (event) {
68
- var value = event.target.value;
69
- if (value.length === 4 && /^#[0-9A-F]{3}$/i.test(value)) {
70
- var normalizedValue = normalizeHex(value);
71
- if (props.onChange) {
72
- props.onChange(__assign(__assign({}, event), { target: __assign(__assign({}, event.target), { value: normalizedValue }) }));
73
- }
107
+ var inputAdornmentProps = props.inputAdornmentProps, value = props.value, defaultValue = props.defaultValue, error = props.error, placeholder = props.placeholder, rootProps = __rest(props, ["inputAdornmentProps", "value", "defaultValue", "error", "placeholder"]);
108
+ var getInitialColor = React.useCallback(function () { return value || placeholder || defaultValue || ''; }, [value, placeholder, defaultValue]);
109
+ var normalizedInitialColor = normalizeHex(getInitialColor());
110
+ var _a = __read(React.useState(value || defaultValue), 2), inputColor = _a[0], setInputColor = _a[1];
111
+ var _b = __read(React.useState(error || ''), 2), invalidError = _b[0], setInvalidError = _b[1];
112
+ //Derived state from inputColor (textfield value)
113
+ var colorPicker = React.useMemo(function () {
114
+ if (inputColor) {
115
+ return normalizeHex(inputColor);
74
116
  }
75
- else {
76
- if (props.onChange) {
77
- props.onChange(event);
78
- }
117
+ return normalizeHex(getInitialColor());
118
+ }, [inputColor, getInitialColor]);
119
+ var handleTextfieldChange = function (event) {
120
+ var newValue = event.target.value;
121
+ setInputColor(newValue);
122
+ };
123
+ var handleTextfieldBlur = function (event) {
124
+ var _a, _b;
125
+ if (!validateHex(event.target.value)) {
126
+ setInvalidError('Color is invalid');
127
+ return;
79
128
  }
129
+ setInvalidError('');
130
+ var newValue = normalizeHex(event.target.value);
131
+ setInputColor(newValue);
132
+ var updatedEvent = __assign(__assign({}, event), { target: __assign(__assign({}, event.target), { value: newValue || normalizedInitialColor }) });
133
+ (_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, updatedEvent);
134
+ (_b = props.onBlur) === null || _b === void 0 ? void 0 : _b.call(props, updatedEvent);
80
135
  };
81
- React.useEffect(function () {
82
- var newColor = value || placeholder || defaultValue || '#000000';
83
- if (newColor) {
84
- setColor(normalizeHex(newColor));
136
+ var handleColorPickerChange = function (event) {
137
+ var _a, _b;
138
+ if (!validateHex(event.target.value)) {
139
+ setInvalidError('Color is invalid');
140
+ return;
85
141
  }
86
- }, [value, defaultValue, placeholder]);
87
- return (React.createElement(Root, __assign({ ref: ref }, rootProps, { InputProps: {
142
+ setInvalidError('');
143
+ var newValue = (_a = event.target.value) === null || _a === void 0 ? void 0 : _a.toUpperCase();
144
+ setInputColor(newValue);
145
+ (_b = props.onChange) === null || _b === void 0 ? void 0 : _b.call(props, __assign(__assign({}, event), { target: __assign(__assign({}, event.target), { value: newValue }) }));
146
+ };
147
+ // Rerender to avoid memoized value on defaultValue change
148
+ React.useEffect(function () {
149
+ setInputColor(defaultValue);
150
+ }, [defaultValue]);
151
+ return (React.createElement(Root, __assign({ ref: ref, error: props.error || invalidError }, rootProps, { InputProps: {
88
152
  startAdornment: (React.createElement(InputAdornment, __assign({ position: "start" }, inputAdornmentProps),
89
- React.createElement(ColorPicker, { id: props.id ? "".concat(props.id, "-color-input") : undefined, name: props.name, type: "color", disabled: props.disabled, readOnly: props.readOnly, value: color, onChange: handleColorChange }))),
90
- value: value,
153
+ React.createElement(ColorPicker, { id: props.id ? "".concat(props.id, "-color-input") : undefined, name: props.name, type: "color", disabled: props.disabled, readOnly: props.readOnly, value: colorPicker, onChange: handleColorPickerChange }))),
154
+ value: inputColor,
91
155
  placeholder: placeholder,
156
+ onBlur: handleTextfieldBlur,
157
+ onChange: handleTextfieldChange,
92
158
  } })));
93
159
  });
@@ -40,8 +40,8 @@ import * as React from 'react';
40
40
  import { CopyIcon } from '../icon';
41
41
  import { IconButton } from '../icon-button';
42
42
  export var CopyButton = React.forwardRef(function (_a, ref) {
43
- var onClick = _a.onClick, label = _a.label, rootProps = __rest(_a, ["onClick", "label"]);
44
- var _b = __read(React.useState(false), 2), pressed = _b[0], setPressed = _b[1];
43
+ var onClick = _a.onClick, label = _a.label, _b = _a.copiedLabel, copiedLabel = _b === void 0 ? 'Copied!' : _b, rootProps = __rest(_a, ["onClick", "label", "copiedLabel"]);
44
+ var _c = __read(React.useState(false), 2), pressed = _c[0], setPressed = _c[1];
45
45
  React.useEffect(function () {
46
46
  if (!pressed) {
47
47
  return undefined;
@@ -59,7 +59,7 @@ export var CopyButton = React.forwardRef(function (_a, ref) {
59
59
  };
60
60
  var handleClose = function () { return setPressed(false); };
61
61
  // use title as the key to force a mount/unmount of the tooltip. This drives the feedback transition.
62
- var title = pressed ? 'Copied!' : label;
62
+ var title = pressed ? copiedLabel : label;
63
63
  return (React.createElement(IconButton, __assign({}, rootProps, { key: title, label: title, onTooltipClose: handleClose, ref: ref, tooltipPlacement: "top", onClick: handleClick }),
64
64
  React.createElement(CopyIcon, null)));
65
65
  });
@@ -39,10 +39,10 @@ var Root = styled(MuiDialogTitle, {
39
39
  justifyContent: 'space-between',
40
40
  });
41
41
  export var DialogTitle = React.forwardRef(function (props, ref) {
42
- var children = props.children, onClose = props.onClose, _a = props.disableTypography, disableTypography = _a === void 0 ? false : _a, id = props.id, className = props.className, propClasses = props.classes, dialogTitleProps = __rest(props, ["children", "onClose", "disableTypography", "id", "className", "classes"]);
42
+ var children = props.children, onClose = props.onClose, closeButtonLabel = props.closeButtonLabel, _a = props.disableTypography, disableTypography = _a === void 0 ? false : _a, id = props.id, className = props.className, propClasses = props.classes, dialogTitleProps = __rest(props, ["children", "onClose", "closeButtonLabel", "disableTypography", "id", "className", "classes"]);
43
43
  var classes = useMergedClasses(dialogTitleClasses, getDialogTitleUtilityClass, propClasses);
44
44
  return (React.createElement(Root, __assign({}, dialogTitleProps, { className: clsx(classes.root, className), ref: ref }),
45
45
  disableTypography ? (children) : (React.createElement(Text, { id: id, className: classes.title, variant: "h5", color: "textPrimary" }, children)),
46
- !!onClose && (React.createElement(IconButton, { shape: "circular", variant: "contained", "aria-label": "Close", size: "small", className: classes.closeButton, onClick: function (event) { return onClose(event, 'closeClick'); }, label: "Close" },
46
+ !!onClose && (React.createElement(IconButton, { shape: "circular", variant: "contained", "aria-label": "Close", size: "small", className: classes.closeButton, onClick: function (event) { return onClose(event, 'closeClick'); }, label: closeButtonLabel || 'Close' },
47
47
  React.createElement(XIcon, null)))));
48
48
  });
@@ -42,7 +42,7 @@ var Root = styled(MuiDialog, {
42
42
  _b);
43
43
  });
44
44
  export var Dialog = React.forwardRef(function (props, ref) {
45
- var title = props.title, actions = props.actions, children = props.children, onClose = props.onClose, idProp = props.id, disableBackdropClick = props.disableBackdropClick, _a = props.disableContentWrap, disableContentWrap = _a === void 0 ? false : _a, dialogProps = __rest(props, ["title", "actions", "children", "onClose", "id", "disableBackdropClick", "disableContentWrap"]);
45
+ var title = props.title, actions = props.actions, children = props.children, onClose = props.onClose, closeButtonLabel = props.closeButtonLabel, idProp = props.id, disableBackdropClick = props.disableBackdropClick, _a = props.disableContentWrap, disableContentWrap = _a === void 0 ? false : _a, dialogProps = __rest(props, ["title", "actions", "children", "onClose", "closeButtonLabel", "id", "disableBackdropClick", "disableContentWrap"]);
46
46
  var id = useId(props.id);
47
47
  var titleId = !!title && !!id ? "".concat(id, "-title") : undefined;
48
48
  var handleClose = function (event, reason) {
@@ -54,7 +54,7 @@ export var Dialog = React.forwardRef(function (props, ref) {
54
54
  }
55
55
  };
56
56
  return (React.createElement(Root, __assign({ PaperProps: { elevation: 4 } }, dialogProps, { id: id, ref: ref, onClose: onClose ? handleClose : undefined, "aria-labelledby": titleId }),
57
- !!title && (React.createElement(DialogTitle, { id: titleId, onClose: onClose }, title)),
57
+ !!title && (React.createElement(DialogTitle, { id: titleId, onClose: onClose, closeButtonLabel: closeButtonLabel }, title)),
58
58
  disableContentWrap ? children : React.createElement(DialogContent, null, children),
59
59
  !!actions && React.createElement(DialogActions, null, actions)));
60
60
  });
@@ -58,7 +58,7 @@ var StyledLabel = styled('span', {
58
58
  shouldForwardProp: function (prop) { return rootShouldForwardProp(prop) && prop !== 'color' && prop !== 'variant'; },
59
59
  })(function (_a) {
60
60
  var theme = _a.theme, _b = _a.ownerState, _c = _b.color, color = _c === void 0 ? 'default' : _c, _d = _b.variant, variant = _d === void 0 ? 'default' : _d;
61
- return (__assign(__assign(__assign(__assign(__assign({}, theme.typography.overline), { padding: theme.spacing(0.25, 0.75), borderRadius: 4, display: 'inline-block', verticalAlign: 'middle' }), (variant === 'default' && __assign(__assign(__assign(__assign(__assign(__assign({}, (color === 'default' && {
61
+ return (__assign(__assign(__assign(__assign(__assign({}, theme.typography.overline), { padding: theme.spacing(0.25, 0.75), borderRadius: 4, display: 'inline-block', verticalAlign: 'middle', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }), (variant === 'default' && __assign(__assign(__assign(__assign(__assign(__assign({}, (color === 'default' && {
62
62
  background: theme.tokens.color_bg_state_neutral_subtle,
63
63
  color: theme.tokens.color_fg_on_state_neutral_subtle,
64
64
  })), (color === 'primary' && {
@@ -117,5 +117,5 @@ export var Label = React.forwardRef(function (props, ref) {
117
117
  variant: variant,
118
118
  children: children,
119
119
  };
120
- return (React.createElement(StyledLabel, __assign({ ref: ref, ownerState: ownerState }, rootProps), ownerState.children));
120
+ return (React.createElement(StyledLabel, __assign({ title: ownerState.children, ref: ref, ownerState: ownerState }, rootProps), ownerState.children));
121
121
  });
@@ -84,7 +84,7 @@ export var PageHeader = React.forwardRef(function (props, ref) {
84
84
  React.createElement(AvatarBlock, { size: compact ? 'medium' : 'large', classes: {
85
85
  root: classes.avatarBlock,
86
86
  avatar: classes.avatar,
87
- }, avatar: avatar && React.createElement(AvatarContext.Provider, { value: { size: 'large' } }, avatar), titleTypographyProps: __assign({ variant: compact ? 'h5' : 'h3', component: 'h1', className: classes.title }, titleTypographyProps), title: React.createElement(React.Fragment, null,
87
+ }, avatar: avatar && React.createElement(AvatarContext.Provider, { value: { size: 'large' } }, avatar), titleTypographyProps: __assign({ variant: compact ? 'h5' : 'h3', component: 'h1', className: classes.title, noWrap: true }, titleTypographyProps), title: React.createElement(React.Fragment, null,
88
88
  title,
89
89
  !!productReleaseStage && (React.createElement(AvailabilityLabel, { className: classes.availabilityLabel, productReleaseStageAbbr: false, productReleaseStage: productReleaseStage }))), description: metadata, descriptionTypographyProps: __assign({ component: 'div', className: classes.metadata }, metadataTypographyProps), TitleBlockProps: { gutter: 0.5 }, endAdornment: !!actions && (React.createElement(Actions, { className: classes.actions, sx: { flex: 'none' } }, actions)) }))),
90
90
  !!description && (React.createElement(Text, __assign({ variant: "body2", color: "textSecondary", component: "p", className: classes.description }, descriptionTypographyProps), description))));
@@ -84,7 +84,7 @@ var CloseButton = styled(IconButton, {
84
84
  right: 24,
85
85
  });
86
86
  export var Panel = React.forwardRef(function (props, ref) {
87
- var title = props.title, isOpen = props.isOpen, _a = props.placement, placement = _a === void 0 ? 'end' : _a, _b = props.variant, variant = _b === void 0 ? 'permanent' : _b, _c = props.size, size = _c === void 0 ? 'medium' : _c, onClose = props.onClose, className = props.className, propClasses = props.classes, isFixed = props.isFixed, propOffsetTop = props.offsetTop, children = props.children, _d = props.closeIconButtonProps, closeIconButtonProps = _d === void 0 ? {} : _d, _e = props.PanelHeaderProps, PanelHeaderProps = _e === void 0 ? {} : _e, rootProps = __rest(props, ["title", "isOpen", "placement", "variant", "size", "onClose", "className", "classes", "isFixed", "offsetTop", "children", "closeIconButtonProps", "PanelHeaderProps"]);
87
+ var title = props.title, isOpen = props.isOpen, _a = props.placement, placement = _a === void 0 ? 'end' : _a, _b = props.variant, variant = _b === void 0 ? 'permanent' : _b, _c = props.size, size = _c === void 0 ? 'medium' : _c, onClose = props.onClose, closeButtonLabel = props.closeButtonLabel, className = props.className, propClasses = props.classes, isFixed = props.isFixed, propOffsetTop = props.offsetTop, children = props.children, _d = props.closeIconButtonProps, closeIconButtonProps = _d === void 0 ? {} : _d, _e = props.PanelHeaderProps, PanelHeaderProps = _e === void 0 ? {} : _e, rootProps = __rest(props, ["title", "isOpen", "placement", "variant", "size", "onClose", "closeButtonLabel", "className", "classes", "isFixed", "offsetTop", "children", "closeIconButtonProps", "PanelHeaderProps"]);
88
88
  var classes = useMergedClasses(panelClasses, getPanelUtilityClass, propClasses);
89
89
  var offsetTop = propOffsetTop != null ? propOffsetTop : isFixed ? 'appbar' : 0;
90
90
  var ownerState = {
@@ -99,7 +99,7 @@ export var Panel = React.forwardRef(function (props, ref) {
99
99
  return (React.createElement(Root, __assign({ ref: ref, ownerState: ownerState, className: clsx(classes.root, classes["size".concat(capitalize(size))], classes["variant".concat(capitalize(variant))], classes["placement".concat(capitalize(placement))], isFixed && classes.fixed, isOpen && classes.open, className) }, rootProps),
100
100
  React.createElement(PanelContext.Provider, { value: __assign(__assign({}, ownerState), { isCloseButtonVisible: showCloseButton }) },
101
101
  React.createElement(Content, { className: classes.content, ownerState: ownerState },
102
- showCloseButton && (React.createElement(CloseButton, __assign({ label: "close", className: classes.closeButton, onClick: function (e) { return onClose(e, 'closeButtonClick'); }, variant: "outlined", size: "small", shape: "circular" }, closeIconButtonProps),
102
+ showCloseButton && (React.createElement(CloseButton, __assign({ label: closeButtonLabel || 'close', className: classes.closeButton, onClick: function (e) { return onClose(e, 'closeButtonClick'); }, variant: "outlined", size: "small", shape: "circular" }, closeIconButtonProps),
103
103
  React.createElement(XIcon, null))),
104
104
  !!title && React.createElement(PanelHeader, __assign({ title: title }, PanelHeaderProps)),
105
105
  children))));
@@ -51,11 +51,22 @@ var EndAdornment = styled('div')(function (_a) {
51
51
  });
52
52
  });
53
53
  export var PanelHeader = React.forwardRef(function (props, ref) {
54
- var title = props.title, className = props.className, propClasses = props.classes, endAdornment = props.endAdornment, titleTextProps = props.titleTextProps, titleComponent = props.titleComponent, rootProps = __rest(props, ["title", "className", "classes", "endAdornment", "titleTextProps", "titleComponent"]);
54
+ var title = props.title, className = props.className, propClasses = props.classes, endAdornment = props.endAdornment, titleTextProps = props.titleTextProps, titleComponent = props.titleComponent, titleNoWrap = props.titleNoWrap, rootProps = __rest(props, ["title", "className", "classes", "endAdornment", "titleTextProps", "titleComponent", "titleNoWrap"]);
55
55
  var classes = useMergedClasses(panelHeaderClasses, getPanelHeaderUtilityClass, propClasses);
56
56
  var panelContext = usePanelContext();
57
+ var textStyles = titleNoWrap
58
+ ? {
59
+ whiteSpace: 'nowrap',
60
+ overflow: 'hidden',
61
+ textOverflow: 'ellipsis',
62
+ }
63
+ : {
64
+ whiteSpace: 'normal',
65
+ overflow: 'visible',
66
+ textOverflow: 'clip', // Don't apply ellipsis
67
+ };
57
68
  return (React.createElement(Root, __assign({ className: clsx(classes.root, className), ownerState: { isCloseButtonVisible: panelContext.isCloseButtonVisible }, ref: ref }, rootProps),
58
- React.createElement(Content, { className: classes.content },
59
- React.createElement(Text, __assign({ className: classes.title, component: titleComponent, variant: "h5" }, titleTextProps), title)),
69
+ React.createElement(Content, { className: classes.content, sx: textStyles },
70
+ React.createElement(Text, __assign({ className: classes.title, component: titleComponent, variant: "h5" }, titleTextProps, { title: titleNoWrap ? title : '', sx: textStyles }), title)),
60
71
  !!endAdornment && React.createElement(EndAdornment, { className: classes.endAdornment }, endAdornment)));
61
72
  });
@@ -49,9 +49,12 @@ var ControlRadio = createControl(Radio, 'ControlRadio');
49
49
  var ControlCheckbox = createControl(Checkbox, 'ControlCheckbox');
50
50
  var Content = styled('div', { name: selectableCardComponentName, slot: 'Content' })({
51
51
  flex: 1,
52
+ whiteSpace: 'nowrap',
53
+ overflow: 'hidden',
54
+ textOverflow: 'ellipsis',
52
55
  });
53
56
  export var SelectableCard = React.forwardRef(function (props, ref) {
54
- var avatar = props.avatar, label = props.label, propTitle = props.title, propDescription = props.description, helperText = props.helperText, value = props.value, disabled = props.disabled, name = props.name, onChange = props.onChange, checkedProp = props.checked, RadioProps = props.RadioProps, CheckboxProps = props.CheckboxProps, _a = props.controlPlacement, controlPlacement = _a === void 0 ? 'start' : _a, _b = props.size, size = _b === void 0 ? 'medium' : _b, type = props.type, _c = props.hideControl, hideControl = _c === void 0 ? false : _c, children = props.children, className = props.className, propClasses = props.classes, rootProps = __rest(props, ["avatar", "label", "title", "description", "helperText", "value", "disabled", "name", "onChange", "checked", "RadioProps", "CheckboxProps", "controlPlacement", "size", "type", "hideControl", "children", "className", "classes"]);
57
+ var avatar = props.avatar, label = props.label, propTitle = props.title, propDescription = props.description, helperText = props.helperText, value = props.value, disabled = props.disabled, name = props.name, onChange = props.onChange, checkedProp = props.checked, RadioProps = props.RadioProps, CheckboxProps = props.CheckboxProps, _a = props.controlPlacement, controlPlacement = _a === void 0 ? 'start' : _a, _b = props.size, size = _b === void 0 ? 'medium' : _b, type = props.type, _c = props.hideControl, hideControl = _c === void 0 ? false : _c, children = props.children, className = props.className, _d = props.noWrap, noWrap = _d === void 0 ? false : _d, propClasses = props.classes, rootProps = __rest(props, ["avatar", "label", "title", "description", "helperText", "value", "disabled", "name", "onChange", "checked", "RadioProps", "CheckboxProps", "controlPlacement", "size", "type", "hideControl", "children", "className", "noWrap", "classes"]);
55
58
  var inputRef = React.createRef();
56
59
  var radioGroup = useRadioGroup();
57
60
  var classes = useMergedClasses(selectableCardClasses, getSelectableCardUtilityClass, propClasses);
@@ -61,7 +64,7 @@ export var SelectableCard = React.forwardRef(function (props, ref) {
61
64
  if (radioGroup && checked == null) {
62
65
  checked = radioGroup.value === value;
63
66
  }
64
- var content = children || React.createElement(CardHeader, { avatar: avatar, title: title, subheader: description });
67
+ var content = children || React.createElement(CardHeader, { avatar: avatar, title: title, subheader: description, noWrap: noWrap });
65
68
  var Control = type === 'radio' ? ControlRadio : ControlCheckbox;
66
69
  var control = (React.createElement(Control, __assign({ value: value, inputRef: inputRef, onChange: onChange, disabled: disabled, className: type === 'radio' ? classes.controlRadio : classes.controlCheckbox, ownerState: { hidden: hideControl }, checked: checked }, (type === 'radio' ? RadioProps : CheckboxProps))));
67
70
  return (React.createElement(Root, __assign({}, { ref: ref }, { size: size, selected: checked, disabled: disabled, button: true, className: clsx(classes.root, className), component: "label" }, rootProps),
@@ -32,10 +32,20 @@ var AvailabilityLabel = styled(Label)(function (_a) {
32
32
  marginLeft: theme.spacing(1),
33
33
  });
34
34
  });
35
+ var LabelContainer = styled('div')(function (_a) {
36
+ var width = _a.width, maxWidth = _a.maxWidth;
37
+ return ({
38
+ width: width || 'auto',
39
+ maxWidth: maxWidth || 'none',
40
+ overflow: 'hidden',
41
+ whiteSpace: 'nowrap',
42
+ textOverflow: 'ellipsis',
43
+ });
44
+ });
35
45
  export var Tab = React.forwardRef(function (_a, ref) {
36
- var value = _a.value, productReleaseStage = _a.productReleaseStage, label = _a.label, tabProps = __rest(_a, ["value", "productReleaseStage", "label"]);
37
- var _b = useTabsContext(), getTabProps = _b.getTabProps, fullWidth = _b.fullWidth;
46
+ var value = _a.value, productReleaseStage = _a.productReleaseStage, label = _a.label, _b = _a.sx, sx = _b === void 0 ? {} : _b, tabProps = __rest(_a, ["value", "productReleaseStage", "label", "sx"]);
47
+ var _c = useTabsContext(), getTabProps = _c.getTabProps, fullWidth = _c.fullWidth;
38
48
  return (React.createElement(MuiTab, __assign({ ref: ref }, getTabProps(value), { value: value, label: React.createElement(StackLayout, { gutter: 0 },
39
- label,
49
+ React.createElement(LabelContainer, { width: sx === null || sx === void 0 ? void 0 : sx.width, maxWidth: sx === null || sx === void 0 ? void 0 : sx.maxWidth, title: label }, label),
40
50
  productReleaseStage && React.createElement(AvailabilityLabel, { productReleaseStage: productReleaseStage })) }, tabProps, { fullWidth: fullWidth })));
41
51
  });
package/esm/text/text.js CHANGED
@@ -86,8 +86,8 @@ var getComponentForVariant = function (_a) {
86
86
  return textVariantMapping[variant];
87
87
  };
88
88
  export var Text = React.forwardRef(function (props, ref) {
89
- var variant = props.variant, propClasses = props.classes, propComponent = props.component, className = props.className, rootProps = __rest(props, ["variant", "classes", "component", "className"]);
89
+ var variant = props.variant, propClasses = props.classes, propComponent = props.component, className = props.className, sx = props.sx, rootProps = __rest(props, ["variant", "classes", "component", "className", "sx"]);
90
90
  var classes = useUtilityClasses(variant, propClasses);
91
91
  var component = propComponent || getComponentForVariant({ variant: variant });
92
- return (React.createElement(Root, __assign({ ref: ref, variant: variant, className: clsx([classes.root, className]) }, { component: component }, rootProps)));
92
+ return (React.createElement(Root, __assign({ ref: ref, variant: variant, className: clsx([classes.root, className]) }, { component: component }, { sx: sx }, rootProps)));
93
93
  });
@@ -28,6 +28,6 @@ import { titleBlockClasses } from './title-block-classes';
28
28
  export var TitleBlock = React.forwardRef(function (_a, ref) {
29
29
  var title = _a.title, _b = _a.titleTypographyProps, titleTypographyProps = _b === void 0 ? {} : _b, description = _a.description, _c = _a.descriptionTypographyProps, descriptionTypographyProps = _c === void 0 ? {} : _c, className = _a.className, rootProps = __rest(_a, ["title", "titleTypographyProps", "description", "descriptionTypographyProps", "className"]);
30
30
  return (React.createElement(RowLayout, __assign({ gutter: 0, className: clsx(titleBlockClasses.root, className) }, rootProps, { ref: ref }),
31
- React.createElement(Text, __assign({ className: titleBlockClasses.title, variant: "subtitle2", color: "inherit" }, titleTypographyProps), title),
32
- !!description && (React.createElement(Text, __assign({ variant: "body2", color: "textSecondary", className: titleBlockClasses.description }, descriptionTypographyProps), description))));
31
+ React.createElement(Text, __assign({ className: titleBlockClasses.title, variant: "subtitle2", color: "inherit" }, titleTypographyProps, { title: (titleTypographyProps === null || titleTypographyProps === void 0 ? void 0 : titleTypographyProps.noWrap) && typeof title === 'string' ? title : '' }), title),
32
+ !!description && (React.createElement(Text, __assign({ variant: "body2", color: "textSecondary", className: titleBlockClasses.description }, descriptionTypographyProps, { title: (descriptionTypographyProps === null || descriptionTypographyProps === void 0 ? void 0 : descriptionTypographyProps.noWrap) && typeof title === 'string' ? description : '' }), description))));
33
33
  });
@@ -10,4 +10,5 @@ export declare const ExpansionPanelHeader: import("styled-components").StyledCom
10
10
  subheaderTypographyProps?: import("..").ITextProps<any> | undefined;
11
11
  title?: import("react").ReactNode;
12
12
  titleTypographyProps?: import("..").ITextProps<any> | undefined;
13
- } & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "title" | "ref" | "action" | "size" | "classes" | "avatar" | "disableTypography" | "subheader" | "subheaderTypographyProps" | "titleTypographyProps"> & import("../styled").IStyledCommonProps & import("react").RefAttributes<HTMLDivElement>>, import("..").ITheme, import("@mui/system").MUIStyledCommonProps<import("..").ITheme>, never>;
13
+ noWrap?: boolean | undefined;
14
+ } & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "title" | "ref" | "action" | "size" | "classes" | "avatar" | "disableTypography" | "subheader" | "subheaderTypographyProps" | "titleTypographyProps" | "noWrap"> & import("../styled").IStyledCommonProps & import("react").RefAttributes<HTMLDivElement>>, import("..").ITheme, import("@mui/system").MUIStyledCommonProps<import("..").ITheme>, never>;
package/label/label.js CHANGED
@@ -84,7 +84,7 @@ var StyledLabel = (0, styled_1.styled)('span', {
84
84
  shouldForwardProp: function (prop) { return (0, styled_1.rootShouldForwardProp)(prop) && prop !== 'color' && prop !== 'variant'; },
85
85
  })(function (_a) {
86
86
  var theme = _a.theme, _b = _a.ownerState, _c = _b.color, color = _c === void 0 ? 'default' : _c, _d = _b.variant, variant = _d === void 0 ? 'default' : _d;
87
- return (__assign(__assign(__assign(__assign(__assign({}, theme.typography.overline), { padding: theme.spacing(0.25, 0.75), borderRadius: 4, display: 'inline-block', verticalAlign: 'middle' }), (variant === 'default' && __assign(__assign(__assign(__assign(__assign(__assign({}, (color === 'default' && {
87
+ return (__assign(__assign(__assign(__assign(__assign({}, theme.typography.overline), { padding: theme.spacing(0.25, 0.75), borderRadius: 4, display: 'inline-block', verticalAlign: 'middle', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }), (variant === 'default' && __assign(__assign(__assign(__assign(__assign(__assign({}, (color === 'default' && {
88
88
  background: theme.tokens.color_bg_state_neutral_subtle,
89
89
  color: theme.tokens.color_fg_on_state_neutral_subtle,
90
90
  })), (color === 'primary' && {
@@ -143,5 +143,5 @@ exports.Label = React.forwardRef(function (props, ref) {
143
143
  variant: variant,
144
144
  children: children,
145
145
  };
146
- return (React.createElement(StyledLabel, __assign({ ref: ref, ownerState: ownerState }, rootProps), ownerState.children));
146
+ return (React.createElement(StyledLabel, __assign({ title: ownerState.children, ref: ref, ownerState: ownerState }, rootProps), ownerState.children));
147
147
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@auth0/quantum-product",
3
- "version": "2.4.7",
3
+ "version": "2.4.9",
4
4
  "sideEffects": false,
5
5
  "license": "Apache-2.0",
6
6
  "publishConfig": {
@@ -113,7 +113,7 @@ exports.PageHeader = React.forwardRef(function (props, ref) {
113
113
  React.createElement(avatar_block_1.AvatarBlock, { size: compact ? 'medium' : 'large', classes: {
114
114
  root: classes.avatarBlock,
115
115
  avatar: classes.avatar,
116
- }, avatar: avatar && React.createElement(avatar_1.AvatarContext.Provider, { value: { size: 'large' } }, avatar), titleTypographyProps: __assign({ variant: compact ? 'h5' : 'h3', component: 'h1', className: classes.title }, titleTypographyProps), title: React.createElement(React.Fragment, null,
116
+ }, avatar: avatar && React.createElement(avatar_1.AvatarContext.Provider, { value: { size: 'large' } }, avatar), titleTypographyProps: __assign({ variant: compact ? 'h5' : 'h3', component: 'h1', className: classes.title, noWrap: true }, titleTypographyProps), title: React.createElement(React.Fragment, null,
117
117
  title,
118
118
  !!productReleaseStage && (React.createElement(AvailabilityLabel, { className: classes.availabilityLabel, productReleaseStageAbbr: false, productReleaseStage: productReleaseStage }))), description: metadata, descriptionTypographyProps: __assign({ component: 'div', className: classes.metadata }, metadataTypographyProps), TitleBlockProps: { gutter: 0.5 }, endAdornment: !!actions && (React.createElement(exports.Actions, { className: classes.actions, sx: { flex: 'none' } }, actions)) }))),
119
119
  !!description && (React.createElement(text_1.Text, __assign({ variant: "body2", color: "textSecondary", component: "p", className: classes.description }, descriptionTypographyProps), description))));
@@ -16,6 +16,8 @@ export type IPanelProps = IStyledComponentProps<{
16
16
  children?: React.ReactNode;
17
17
  /** Event fired when panel tries to close. */
18
18
  onClose?(event: React.MouseEvent<HTMLButtonElement>, reason: 'closeButtonClick'): void;
19
+ /** convenience prop for rendering the label for close button with a Panel component */
20
+ closeButtonLabel?: string;
19
21
  classes?: Partial<PanelClasses>;
20
22
  closeIconButtonProps?: Partial<IIconButtonProps>;
21
23
  PanelHeaderProps?: Partial<IPanelHeaderProps>;
@@ -29,7 +31,9 @@ export declare const Panel: React.ForwardRefExoticComponent<Partial<IPanelOwnerS
29
31
  children?: React.ReactNode;
30
32
  /** Event fired when panel tries to close. */
31
33
  onClose?(event: React.MouseEvent<HTMLButtonElement>, reason: 'closeButtonClick'): void;
34
+ /** convenience prop for rendering the label for close button with a Panel component */
35
+ closeButtonLabel?: string | undefined;
32
36
  classes?: Partial<Record<"fixed" | "content" | "open" | "root" | "sizeSmall" | "sizeMedium" | "sizeLarge" | "closeButton" | "variantFloating" | "variantPersistent" | "variantPermanent" | "placementStart" | "placementEnd", string>> | undefined;
33
37
  closeIconButtonProps?: Partial<IIconButtonProps<"button", {}>> | undefined;
34
38
  PanelHeaderProps?: Partial<IPanelHeaderProps> | undefined;
35
- } & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "title" | "ref" | "size" | "classes" | "children" | "variant" | "onClose" | "placement" | "offsetTop" | "isOpen" | "isFixed" | "closeIconButtonProps" | "PanelHeaderProps"> & import("../../styled").IStyledCommonProps & React.RefAttributes<HTMLDivElement>>;
39
+ } & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "title" | "ref" | "size" | "classes" | "children" | "variant" | "onClose" | "placement" | "offsetTop" | "closeButtonLabel" | "isOpen" | "isFixed" | "closeIconButtonProps" | "PanelHeaderProps"> & import("../../styled").IStyledCommonProps & React.RefAttributes<HTMLDivElement>>;
@@ -110,7 +110,7 @@ var CloseButton = (0, styled_1.styled)(icon_button_1.IconButton, {
110
110
  right: 24,
111
111
  });
112
112
  exports.Panel = React.forwardRef(function (props, ref) {
113
- var title = props.title, isOpen = props.isOpen, _a = props.placement, placement = _a === void 0 ? 'end' : _a, _b = props.variant, variant = _b === void 0 ? 'permanent' : _b, _c = props.size, size = _c === void 0 ? 'medium' : _c, onClose = props.onClose, className = props.className, propClasses = props.classes, isFixed = props.isFixed, propOffsetTop = props.offsetTop, children = props.children, _d = props.closeIconButtonProps, closeIconButtonProps = _d === void 0 ? {} : _d, _e = props.PanelHeaderProps, PanelHeaderProps = _e === void 0 ? {} : _e, rootProps = __rest(props, ["title", "isOpen", "placement", "variant", "size", "onClose", "className", "classes", "isFixed", "offsetTop", "children", "closeIconButtonProps", "PanelHeaderProps"]);
113
+ var title = props.title, isOpen = props.isOpen, _a = props.placement, placement = _a === void 0 ? 'end' : _a, _b = props.variant, variant = _b === void 0 ? 'permanent' : _b, _c = props.size, size = _c === void 0 ? 'medium' : _c, onClose = props.onClose, closeButtonLabel = props.closeButtonLabel, className = props.className, propClasses = props.classes, isFixed = props.isFixed, propOffsetTop = props.offsetTop, children = props.children, _d = props.closeIconButtonProps, closeIconButtonProps = _d === void 0 ? {} : _d, _e = props.PanelHeaderProps, PanelHeaderProps = _e === void 0 ? {} : _e, rootProps = __rest(props, ["title", "isOpen", "placement", "variant", "size", "onClose", "closeButtonLabel", "className", "classes", "isFixed", "offsetTop", "children", "closeIconButtonProps", "PanelHeaderProps"]);
114
114
  var classes = (0, classes_1.useMergedClasses)(panel_classes_1.panelClasses, panel_classes_1.getPanelUtilityClass, propClasses);
115
115
  var offsetTop = propOffsetTop != null ? propOffsetTop : isFixed ? 'appbar' : 0;
116
116
  var ownerState = {
@@ -125,7 +125,7 @@ exports.Panel = React.forwardRef(function (props, ref) {
125
125
  return (React.createElement(Root, __assign({ ref: ref, ownerState: ownerState, className: (0, utils_1.clsx)(classes.root, classes["size".concat((0, utils_1.capitalize)(size))], classes["variant".concat((0, utils_1.capitalize)(variant))], classes["placement".concat((0, utils_1.capitalize)(placement))], isFixed && classes.fixed, isOpen && classes.open, className) }, rootProps),
126
126
  React.createElement(panel_context_1.PanelContext.Provider, { value: __assign(__assign({}, ownerState), { isCloseButtonVisible: showCloseButton }) },
127
127
  React.createElement(Content, { className: classes.content, ownerState: ownerState },
128
- showCloseButton && (React.createElement(CloseButton, __assign({ label: "close", className: classes.closeButton, onClick: function (e) { return onClose(e, 'closeButtonClick'); }, variant: "outlined", size: "small", shape: "circular" }, closeIconButtonProps),
128
+ showCloseButton && (React.createElement(CloseButton, __assign({ label: closeButtonLabel || 'close', className: classes.closeButton, onClick: function (e) { return onClose(e, 'closeButtonClick'); }, variant: "outlined", size: "small", shape: "circular" }, closeIconButtonProps),
129
129
  React.createElement(icon_1.XIcon, null))),
130
130
  !!title && React.createElement(panel_header_1.PanelHeader, __assign({ title: title }, PanelHeaderProps)),
131
131
  children))));
@@ -10,6 +10,7 @@ export type IPanelHeaderProps = IStyledComponentProps<{
10
10
  titleTextProps?: Partial<ITextProps>;
11
11
  endAdornment?: React.ReactNode;
12
12
  classes?: Partial<PanelHeaderClasses>;
13
+ titleNoWrap?: boolean;
13
14
  };
14
15
  defaultComponent: 'div';
15
16
  }>;
@@ -19,4 +20,5 @@ export declare const PanelHeader: React.ForwardRefExoticComponent<{
19
20
  titleTextProps?: Partial<ITextProps<"span">> | undefined;
20
21
  endAdornment?: React.ReactNode;
21
22
  classes?: Partial<Record<"title" | "content" | "root" | "endAdornment", string>> | undefined;
22
- } & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "title" | "ref" | "classes" | "endAdornment" | "titleComponent" | "titleTextProps"> & import("../../styled").IStyledCommonProps & React.RefAttributes<HTMLDivElement>>;
23
+ titleNoWrap?: boolean | undefined;
24
+ } & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "title" | "ref" | "classes" | "endAdornment" | "titleComponent" | "titleTextProps" | "titleNoWrap"> & import("../../styled").IStyledCommonProps & React.RefAttributes<HTMLDivElement>>;
@@ -77,11 +77,22 @@ var EndAdornment = (0, styled_1.styled)('div')(function (_a) {
77
77
  });
78
78
  });
79
79
  exports.PanelHeader = React.forwardRef(function (props, ref) {
80
- var title = props.title, className = props.className, propClasses = props.classes, endAdornment = props.endAdornment, titleTextProps = props.titleTextProps, titleComponent = props.titleComponent, rootProps = __rest(props, ["title", "className", "classes", "endAdornment", "titleTextProps", "titleComponent"]);
80
+ var title = props.title, className = props.className, propClasses = props.classes, endAdornment = props.endAdornment, titleTextProps = props.titleTextProps, titleComponent = props.titleComponent, titleNoWrap = props.titleNoWrap, rootProps = __rest(props, ["title", "className", "classes", "endAdornment", "titleTextProps", "titleComponent", "titleNoWrap"]);
81
81
  var classes = (0, classes_1.useMergedClasses)(panel_header_classes_1.panelHeaderClasses, panel_header_classes_1.getPanelHeaderUtilityClass, propClasses);
82
82
  var panelContext = (0, panel_context_1.usePanelContext)();
83
+ var textStyles = titleNoWrap
84
+ ? {
85
+ whiteSpace: 'nowrap',
86
+ overflow: 'hidden',
87
+ textOverflow: 'ellipsis',
88
+ }
89
+ : {
90
+ whiteSpace: 'normal',
91
+ overflow: 'visible',
92
+ textOverflow: 'clip', // Don't apply ellipsis
93
+ };
83
94
  return (React.createElement(Root, __assign({ className: (0, utils_1.clsx)(classes.root, className), ownerState: { isCloseButtonVisible: panelContext.isCloseButtonVisible }, ref: ref }, rootProps),
84
- React.createElement(Content, { className: classes.content },
85
- React.createElement(text_1.Text, __assign({ className: classes.title, component: titleComponent, variant: "h5" }, titleTextProps), title)),
95
+ React.createElement(Content, { className: classes.content, sx: textStyles },
96
+ React.createElement(text_1.Text, __assign({ className: classes.title, component: titleComponent, variant: "h5" }, titleTextProps, { title: titleNoWrap ? title : '', sx: textStyles }), title)),
86
97
  !!endAdornment && React.createElement(EndAdornment, { className: classes.endAdornment }, endAdornment)));
87
98
  });
@@ -49,6 +49,14 @@ export interface ISelectableCardProps extends Omit<ICardProps, SelectableControl
49
49
  * value. Mainly used for radio control type
50
50
  */
51
51
  value?: string;
52
+ /**
53
+ * If `true`, the text will not wrap, but instead will truncate with a text overflow ellipsis.
54
+ *
55
+ * Note that text overflow can only happen with block or inline-block level elements
56
+ * (the element needs to have a width in order to overflow).
57
+ * @default false
58
+ */
59
+ noWrap?: boolean;
52
60
  }
53
61
  export declare const SelectableCard: React.ForwardRefExoticComponent<ISelectableCardProps & React.RefAttributes<HTMLLabelElement>>;
54
62
  export {};
@@ -78,9 +78,12 @@ var ControlRadio = createControl(radio_1.Radio, 'ControlRadio');
78
78
  var ControlCheckbox = createControl(checkbox_1.Checkbox, 'ControlCheckbox');
79
79
  var Content = (0, styled_1.styled)('div', { name: selectable_card_classes_1.selectableCardComponentName, slot: 'Content' })({
80
80
  flex: 1,
81
+ whiteSpace: 'nowrap',
82
+ overflow: 'hidden',
83
+ textOverflow: 'ellipsis',
81
84
  });
82
85
  exports.SelectableCard = React.forwardRef(function (props, ref) {
83
- var avatar = props.avatar, label = props.label, propTitle = props.title, propDescription = props.description, helperText = props.helperText, value = props.value, disabled = props.disabled, name = props.name, onChange = props.onChange, checkedProp = props.checked, RadioProps = props.RadioProps, CheckboxProps = props.CheckboxProps, _a = props.controlPlacement, controlPlacement = _a === void 0 ? 'start' : _a, _b = props.size, size = _b === void 0 ? 'medium' : _b, type = props.type, _c = props.hideControl, hideControl = _c === void 0 ? false : _c, children = props.children, className = props.className, propClasses = props.classes, rootProps = __rest(props, ["avatar", "label", "title", "description", "helperText", "value", "disabled", "name", "onChange", "checked", "RadioProps", "CheckboxProps", "controlPlacement", "size", "type", "hideControl", "children", "className", "classes"]);
86
+ var avatar = props.avatar, label = props.label, propTitle = props.title, propDescription = props.description, helperText = props.helperText, value = props.value, disabled = props.disabled, name = props.name, onChange = props.onChange, checkedProp = props.checked, RadioProps = props.RadioProps, CheckboxProps = props.CheckboxProps, _a = props.controlPlacement, controlPlacement = _a === void 0 ? 'start' : _a, _b = props.size, size = _b === void 0 ? 'medium' : _b, type = props.type, _c = props.hideControl, hideControl = _c === void 0 ? false : _c, children = props.children, className = props.className, _d = props.noWrap, noWrap = _d === void 0 ? false : _d, propClasses = props.classes, rootProps = __rest(props, ["avatar", "label", "title", "description", "helperText", "value", "disabled", "name", "onChange", "checked", "RadioProps", "CheckboxProps", "controlPlacement", "size", "type", "hideControl", "children", "className", "noWrap", "classes"]);
84
87
  var inputRef = React.createRef();
85
88
  var radioGroup = (0, radio_1.useRadioGroup)();
86
89
  var classes = (0, classes_1.useMergedClasses)(selectable_card_classes_1.selectableCardClasses, selectable_card_classes_1.getSelectableCardUtilityClass, propClasses);
@@ -90,7 +93,7 @@ exports.SelectableCard = React.forwardRef(function (props, ref) {
90
93
  if (radioGroup && checked == null) {
91
94
  checked = radioGroup.value === value;
92
95
  }
93
- var content = children || React.createElement(card_1.CardHeader, { avatar: avatar, title: title, subheader: description });
96
+ var content = children || React.createElement(card_1.CardHeader, { avatar: avatar, title: title, subheader: description, noWrap: noWrap });
94
97
  var Control = type === 'radio' ? ControlRadio : ControlCheckbox;
95
98
  var control = (React.createElement(Control, __assign({ value: value, inputRef: inputRef, onChange: onChange, disabled: disabled, className: type === 'radio' ? classes.controlRadio : classes.controlCheckbox, ownerState: { hidden: hideControl }, checked: checked }, (type === 'radio' ? RadioProps : CheckboxProps))));
96
99
  return (React.createElement(Root, __assign({}, { ref: ref }, { size: size, selected: checked, disabled: disabled, button: true, className: (0, clsx_1.default)(classes.root, className), component: "label" }, rootProps),
package/tabs/tab/tab.js CHANGED
@@ -61,10 +61,20 @@ var AvailabilityLabel = (0, styled_1.styled)(label_1.Label)(function (_a) {
61
61
  marginLeft: theme.spacing(1),
62
62
  });
63
63
  });
64
+ var LabelContainer = (0, styled_1.styled)('div')(function (_a) {
65
+ var width = _a.width, maxWidth = _a.maxWidth;
66
+ return ({
67
+ width: width || 'auto',
68
+ maxWidth: maxWidth || 'none',
69
+ overflow: 'hidden',
70
+ whiteSpace: 'nowrap',
71
+ textOverflow: 'ellipsis',
72
+ });
73
+ });
64
74
  exports.Tab = React.forwardRef(function (_a, ref) {
65
- var value = _a.value, productReleaseStage = _a.productReleaseStage, label = _a.label, tabProps = __rest(_a, ["value", "productReleaseStage", "label"]);
66
- var _b = (0, tabs_context_1.useTabsContext)(), getTabProps = _b.getTabProps, fullWidth = _b.fullWidth;
75
+ var value = _a.value, productReleaseStage = _a.productReleaseStage, label = _a.label, _b = _a.sx, sx = _b === void 0 ? {} : _b, tabProps = __rest(_a, ["value", "productReleaseStage", "label", "sx"]);
76
+ var _c = (0, tabs_context_1.useTabsContext)(), getTabProps = _c.getTabProps, fullWidth = _c.fullWidth;
67
77
  return (React.createElement(Tab_1.default, __assign({ ref: ref }, getTabProps(value), { value: value, label: React.createElement(stack_layout_1.StackLayout, { gutter: 0 },
68
- label,
78
+ React.createElement(LabelContainer, { width: sx === null || sx === void 0 ? void 0 : sx.width, maxWidth: sx === null || sx === void 0 ? void 0 : sx.maxWidth, title: label }, label),
69
79
  productReleaseStage && React.createElement(AvailabilityLabel, { productReleaseStage: productReleaseStage })) }, tabProps, { fullWidth: fullWidth })));
70
80
  });
package/text/text.js CHANGED
@@ -115,8 +115,8 @@ var getComponentForVariant = function (_a) {
115
115
  return exports.textVariantMapping[variant];
116
116
  };
117
117
  exports.Text = React.forwardRef(function (props, ref) {
118
- var variant = props.variant, propClasses = props.classes, propComponent = props.component, className = props.className, rootProps = __rest(props, ["variant", "classes", "component", "className"]);
118
+ var variant = props.variant, propClasses = props.classes, propComponent = props.component, className = props.className, sx = props.sx, rootProps = __rest(props, ["variant", "classes", "component", "className", "sx"]);
119
119
  var classes = useUtilityClasses(variant, propClasses);
120
120
  var component = propComponent || getComponentForVariant({ variant: variant });
121
- return (React.createElement(Root, __assign({ ref: ref, variant: variant, className: (0, clsx_1.default)([classes.root, className]) }, { component: component }, rootProps)));
121
+ return (React.createElement(Root, __assign({ ref: ref, variant: variant, className: (0, clsx_1.default)([classes.root, className]) }, { component: component }, { sx: sx }, rootProps)));
122
122
  });
@@ -57,6 +57,6 @@ var title_block_classes_1 = require("./title-block-classes");
57
57
  exports.TitleBlock = React.forwardRef(function (_a, ref) {
58
58
  var title = _a.title, _b = _a.titleTypographyProps, titleTypographyProps = _b === void 0 ? {} : _b, description = _a.description, _c = _a.descriptionTypographyProps, descriptionTypographyProps = _c === void 0 ? {} : _c, className = _a.className, rootProps = __rest(_a, ["title", "titleTypographyProps", "description", "descriptionTypographyProps", "className"]);
59
59
  return (React.createElement(row_layout_1.RowLayout, __assign({ gutter: 0, className: (0, clsx_1.default)(title_block_classes_1.titleBlockClasses.root, className) }, rootProps, { ref: ref }),
60
- React.createElement(text_1.Text, __assign({ className: title_block_classes_1.titleBlockClasses.title, variant: "subtitle2", color: "inherit" }, titleTypographyProps), title),
61
- !!description && (React.createElement(text_1.Text, __assign({ variant: "body2", color: "textSecondary", className: title_block_classes_1.titleBlockClasses.description }, descriptionTypographyProps), description))));
60
+ React.createElement(text_1.Text, __assign({ className: title_block_classes_1.titleBlockClasses.title, variant: "subtitle2", color: "inherit" }, titleTypographyProps, { title: (titleTypographyProps === null || titleTypographyProps === void 0 ? void 0 : titleTypographyProps.noWrap) && typeof title === 'string' ? title : '' }), title),
61
+ !!description && (React.createElement(text_1.Text, __assign({ variant: "body2", color: "textSecondary", className: title_block_classes_1.titleBlockClasses.description }, descriptionTypographyProps, { title: (descriptionTypographyProps === null || descriptionTypographyProps === void 0 ? void 0 : descriptionTypographyProps.noWrap) && typeof title === 'string' ? description : '' }), description))));
62
62
  });