@auth0/quantum-product 2.4.8 → 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 (45) 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 -10
  9. package/chip/chip.js +1 -1
  10. package/code/code.js +4 -3
  11. package/color-text-field/color-text-field.js +9 -9
  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 -10
  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 +9 -9
  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/page/page-header/page-header.js +1 -1
  30. package/esm/panel/panel/panel.js +2 -2
  31. package/esm/panel/panel-header/panel-header.js +14 -3
  32. package/esm/selectable-card/selectable-card.js +5 -2
  33. package/esm/text/text.js +2 -2
  34. package/esm/title-block/title-block.js +2 -2
  35. package/expansion-panel/expansion-panel-header.d.ts +2 -1
  36. package/package.json +1 -1
  37. package/page/page-header/page-header.js +1 -1
  38. package/panel/panel/panel.d.ts +5 -1
  39. package/panel/panel/panel.js +2 -2
  40. package/panel/panel-header/panel-header.d.ts +3 -1
  41. package/panel/panel-header/panel-header.js +14 -3
  42. package/selectable-card/selectable-card.d.ts +8 -0
  43. package/selectable-card/selectable-card.js +5 -2
  44. package/text/text.js +2 -2
  45. package/title-block/title-block.js +2 -2
@@ -17,6 +17,6 @@ exports.AccordionDetails = (0, styled_1.styled)(AccordionDetails_1.default, {
17
17
  gridTemplateColumns: '40% repeat(4, 15%)',
18
18
  padding: "0px ".concat(theme.spacing(2)),
19
19
  borderBottom: "1px solid ".concat(theme.tokens.color_border_default),
20
- height: theme.typography.pxToRem(72),
20
+ minHeight: theme.typography.pxToRem(72),
21
21
  };
22
22
  });
package/alert/alert.js CHANGED
@@ -218,6 +218,6 @@ exports.Alert = React.forwardRef(function (props, ref) {
218
218
  !!title && React.createElement(AlertTitle, { className: classes.title }, title),
219
219
  React.createElement(AlertMessage, { className: classes.message }, message || children)),
220
220
  hasAction && (React.createElement(AlertAction, { className: classes.action }, action ||
221
- (showCloseButton && (React.createElement(icon_button_1.IconButton, { label: "close button", color: "inherit", size: "small", variant: "link", "aria-label": closeText, onClick: onClose },
221
+ (showCloseButton && (React.createElement(icon_button_1.IconButton, { label: closeText, color: "inherit", size: "small", variant: "link", "aria-label": closeText, onClick: onClose },
222
222
  React.createElement(icon_1.XIcon, null))))))));
223
223
  });
@@ -10,6 +10,7 @@ export type IAvatarBlockProps = IStyledComponentProps<{
10
10
  TitleBlockProps?: Partial<ITitleBlockProps>;
11
11
  classes?: Partial<AvatarBlockClasses>;
12
12
  endAdornment?: React.ReactNode;
13
+ noWrap?: boolean;
13
14
  };
14
15
  defaultComponent: 'div';
15
16
  }>;
@@ -19,4 +20,5 @@ export declare const AvatarBlock: React.ForwardRefExoticComponent<Pick<ITitleBlo
19
20
  TitleBlockProps?: Partial<ITitleBlockProps> | undefined;
20
21
  classes?: Partial<Record<"root" | "avatar" | "endAdornment" | "titleBlock", string>> | undefined;
21
22
  endAdornment?: React.ReactNode;
22
- } & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "title" | "ref" | "size" | "classes" | "avatar" | "titleTypographyProps" | "endAdornment" | "description" | "descriptionTypographyProps" | "TitleBlockProps"> & import("../styled").IStyledCommonProps & React.RefAttributes<HTMLDivElement>>;
23
+ noWrap?: boolean | undefined;
24
+ } & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "title" | "ref" | "size" | "classes" | "avatar" | "titleTypographyProps" | "noWrap" | "endAdornment" | "description" | "descriptionTypographyProps" | "TitleBlockProps"> & import("../styled").IStyledCommonProps & React.RefAttributes<HTMLDivElement>>;
@@ -85,11 +85,12 @@ var titleVariantMap = {
85
85
  large: 'subtitle1',
86
86
  };
87
87
  exports.AvatarBlock = React.forwardRef(function (props, ref) {
88
- var avatar = props.avatar, title = props.title, description = props.description, titleTypographyProps = props.titleTypographyProps, descriptionTypographyProps = props.descriptionTypographyProps, _a = props.TitleBlockProps, TitleBlockProps = _a === void 0 ? {} : _a, className = props.className, _b = props.size, size = _b === void 0 ? 'medium' : _b, endAdornment = props.endAdornment, rootProps = __rest(props, ["avatar", "title", "description", "titleTypographyProps", "descriptionTypographyProps", "TitleBlockProps", "className", "size", "endAdornment"]);
88
+ var avatar = props.avatar, title = props.title, description = props.description, titleTypographyProps = props.titleTypographyProps, descriptionTypographyProps = props.descriptionTypographyProps, _a = props.TitleBlockProps, TitleBlockProps = _a === void 0 ? {} : _a, className = props.className, _b = props.size, size = _b === void 0 ? 'medium' : _b, endAdornment = props.endAdornment, _c = props.noWrap, noWrap = _c === void 0 ? false : _c, // Default to false
89
+ rootProps = __rest(props, ["avatar", "title", "description", "titleTypographyProps", "descriptionTypographyProps", "TitleBlockProps", "className", "size", "endAdornment", "noWrap"]);
89
90
  var classes = (0, classes_1.useMergedClasses)(avatar_block_classes_1.avatarBlockClasses, avatar_block_classes_1.getAvatarBlockUtilityClass, props.classes);
90
91
  var titleVariant = titleVariantMap[size];
91
92
  return (React.createElement(Root, __assign({ ownerState: { description: description, size: size }, ref: ref, className: (0, clsx_1.default)(classes.root, className) }, rootProps),
92
93
  avatar && React.createElement(Avatar, { className: classes.avatar }, avatar),
93
- React.createElement(title_block_1.TitleBlock, __assign({ className: classes.titleBlock, title: title, description: description, titleTypographyProps: __assign({ noWrap: true, component: 'p', variant: titleVariant }, titleTypographyProps), descriptionTypographyProps: descriptionTypographyProps, gutter: size === 'large' ? 0.5 : 0 }, TitleBlockProps, { sx: __assign({ flex: 1 }, TitleBlockProps.sx) })),
94
+ React.createElement(title_block_1.TitleBlock, __assign({ className: classes.titleBlock, title: title, description: description, titleTypographyProps: __assign({ component: 'p', variant: titleVariant, noWrap: noWrap, title: noWrap && typeof title === 'string' ? title : '' }, titleTypographyProps), descriptionTypographyProps: __assign({ noWrap: noWrap, title: noWrap && typeof description === 'string' ? description : '' }, descriptionTypographyProps), gutter: size === 'large' ? 0.5 : 0 }, TitleBlockProps, { sx: __assign({ flex: 1 }, TitleBlockProps.sx) })),
94
95
  !!endAdornment && React.createElement(EndAdornment, { className: classes.endAdornment }, endAdornment)));
95
96
  });
@@ -13,6 +13,7 @@ export interface IButtonTypeMap<P = {}, D extends React.ElementType = 'button'>
13
13
  /** Alternative to using `props.children`. This is a convenience prop for other components using an `action` prop */
14
14
  label?: React.ReactNode;
15
15
  SpinnerProps?: Partial<ISpinnerProps>;
16
+ maxWidth?: string;
16
17
  };
17
18
  defaultComponent: D;
18
19
  }
package/button/button.js CHANGED
@@ -75,10 +75,26 @@ var ButtonSpinner = (0, styled_1.styled)(spinner_1.Spinner, {
75
75
  })({
76
76
  position: 'absolute',
77
77
  });
78
+ var LabelSpan = (0, styled_1.styled)('span')(function (_a) {
79
+ var maxWidth = _a.maxWidth;
80
+ return ({
81
+ display: 'inline-block',
82
+ overflow: 'hidden',
83
+ textOverflow: 'ellipsis',
84
+ whiteSpace: 'nowrap',
85
+ maxWidth: maxWidth || '100%', // Adjust as needed for non-fullWidth buttons
86
+ });
87
+ });
78
88
  exports.Button = React.forwardRef(function (_a, ref) {
79
- var isLoading = _a.isLoading, label = _a.label, children = _a.children, disabled = _a.disabled, _b = _a.SpinnerProps, SpinnerProps = _b === void 0 ? {} : _b, _c = _a.color, color = _c === void 0 ? 'default' : _c, variant = _a.variant, rootProps = __rest(_a, ["isLoading", "label", "children", "disabled", "SpinnerProps", "color", "variant"]);
80
- return (React.createElement(Root, __assign({}, rootProps, { disabled: disabled || isLoading, ownerState: { isLoading: isLoading }, color: color, variant: variant, ref: ref }),
81
- label || children,
82
- " ",
89
+ var isLoading = _a.isLoading, label = _a.label, children = _a.children, disabled = _a.disabled, _b = _a.SpinnerProps, SpinnerProps = _b === void 0 ? {} : _b, _c = _a.color, color = _c === void 0 ? 'default' : _c, variant = _a.variant, maxWidth = _a.maxWidth, rootProps = __rest(_a, ["isLoading", "label", "children", "disabled", "SpinnerProps", "color", "variant", "maxWidth"]);
90
+ var title = label ||
91
+ (typeof children === 'string'
92
+ ? children
93
+ : React.Children.toArray(children)
94
+ .filter(function (child) { return typeof child === 'string'; })
95
+ .join(''));
96
+ return (React.createElement(Root, __assign({}, rootProps, { disabled: disabled || isLoading, ownerState: { isLoading: isLoading }, color: color, variant: variant, ref: ref, title: String(title) }),
97
+ React.createElement(LabelSpan, { style: { maxWidth: rootProps.fullWidth ? 'none' : maxWidth || '100%' } }, label || children),
98
+ ' ',
83
99
  !!isLoading && React.createElement(ButtonSpinner, __assign({}, SpinnerProps))));
84
100
  });
@@ -43,6 +43,14 @@ export type ICardHeaderProps = IStyledComponentProps<{
43
43
  * (as long as disableTypography is not `true`).
44
44
  */
45
45
  titleTypographyProps?: ITextProps<any>;
46
+ /**
47
+ * If `true`, the text will not wrap, but instead will truncate with a text overflow ellipsis.
48
+ *
49
+ * Note that text overflow can only happen with block or inline-block level elements
50
+ * (the element needs to have a width in order to overflow).
51
+ * @default false
52
+ */
53
+ noWrap?: boolean;
46
54
  };
47
55
  defaultComponent: 'div';
48
56
  }>;
@@ -85,4 +93,12 @@ export declare const CardHeader: React.ForwardRefExoticComponent<Partial<ICardCo
85
93
  * (as long as disableTypography is not `true`).
86
94
  */
87
95
  titleTypographyProps?: ITextProps<any> | undefined;
88
- } & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "title" | "ref" | "action" | "size" | "classes" | "avatar" | "disableTypography" | "subheader" | "subheaderTypographyProps" | "titleTypographyProps"> & import("../../styled").IStyledCommonProps & React.RefAttributes<HTMLDivElement>>;
96
+ /**
97
+ * If `true`, the text will not wrap, but instead will truncate with a text overflow ellipsis.
98
+ *
99
+ * Note that text overflow can only happen with block or inline-block level elements
100
+ * (the element needs to have a width in order to overflow).
101
+ * @default false
102
+ */
103
+ noWrap?: boolean | undefined;
104
+ } & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "title" | "ref" | "action" | "size" | "classes" | "avatar" | "disableTypography" | "subheader" | "subheaderTypographyProps" | "titleTypographyProps" | "noWrap"> & import("../../styled").IStyledCommonProps & React.RefAttributes<HTMLDivElement>>;
@@ -83,21 +83,35 @@ var titleVariantMap = {
83
83
  };
84
84
  exports.CardHeader = React.forwardRef(function (props, ref) {
85
85
  var sizeContext = (0, card_context_1.useCardContext)().size;
86
- var sizeProp = props.size, _a = props.titleTypographyProps, titleTypographyProps = _a === void 0 ? {} : _a, _b = props.subheaderTypographyProps, subheaderTypographyProps = _b === void 0 ? {} : _b, title = props.title, subheader = props.subheader, propClasses = props.classes, cardProps = __rest(props, ["size", "titleTypographyProps", "subheaderTypographyProps", "title", "subheader", "classes"]);
86
+ var sizeProp = props.size, _a = props.titleTypographyProps, titleTypographyProps = _a === void 0 ? {} : _a, _b = props.subheaderTypographyProps, subheaderTypographyProps = _b === void 0 ? {} : _b, title = props.title, subheader = props.subheader, _c = props.noWrap, noWrap = _c === void 0 ? false : _c, propClasses = props.classes, cardProps = __rest(props, ["size", "titleTypographyProps", "subheaderTypographyProps", "title", "subheader", "noWrap", "classes"]);
87
87
  var classes = (0, classes_1.useMergedClasses)(card_header_classes_1.cardHeaderClasses, card_header_classes_1.getCardHeaderUtilityClass, propClasses);
88
88
  var size = sizeProp || sizeContext || card_context_1.defaultCardSize;
89
89
  var titleVariant = titleVariantMap[size];
90
+ var titleStyles = noWrap
91
+ ? {
92
+ whiteSpace: 'nowrap',
93
+ overflow: 'hidden',
94
+ textOverflow: 'ellipsis',
95
+ }
96
+ : {
97
+ whiteSpace: 'normal',
98
+ overflow: 'visible',
99
+ textOverflow: 'clip', // Don't apply ellipsis
100
+ }; // No additional styles when noWrap is false
101
+ var subheaderStyles = noWrap
102
+ ? {
103
+ whiteSpace: 'nowrap',
104
+ overflow: 'hidden',
105
+ textOverflow: 'ellipsis',
106
+ }
107
+ : {
108
+ whiteSpace: 'normal',
109
+ overflow: 'visible',
110
+ textOverflow: 'clip', // Don't apply ellipsis
111
+ };
90
112
  return (React.createElement(Root, __assign({ ref: ref, ownerState: { size: size }, classes: {
91
113
  action: classes.action,
92
114
  avatar: classes.avatar,
93
115
  content: classes.content,
94
- }, title: React.createElement(Title, __assign({ variant: titleVariant, color: "textPrimary" }, { component: 'p' }, { role: "heading", display: "block" }, titleTypographyProps, { className: (0, clsx_1.default)(classes.title, titleTypographyProps.className), ownerState: { size: size }, noWrap: true, sx: {
95
- whiteSpace: 'nowrap',
96
- overflow: 'hidden',
97
- textOverflow: 'ellipsis',
98
- }, title: title }), title), subheader: subheader ? (React.createElement(text_1.Text, __assign({ variant: "body2", color: "textSecondary", component: "p", noWrap: true, sx: {
99
- whiteSpace: 'nowrap',
100
- overflow: 'hidden',
101
- textOverflow: 'ellipsis',
102
- }, title: subheader }, subheaderTypographyProps, { className: (0, clsx_1.default)(classes.subheader, subheaderTypographyProps.className) }), subheader)) : null }, cardProps, { disableTypography: true })));
116
+ }, title: React.createElement(Title, __assign({ variant: titleVariant, color: "textPrimary" }, { component: 'p' }, { role: "heading", display: "block" }, titleTypographyProps, { className: (0, clsx_1.default)(classes.title, titleTypographyProps.className), ownerState: { size: size }, noWrap: noWrap, sx: titleStyles, title: noWrap ? title : '' }), title), subheader: subheader ? (React.createElement(text_1.Text, __assign({ variant: "body2", color: "textSecondary", component: "p", noWrap: noWrap, sx: subheaderStyles, title: noWrap ? subheader : '' }, subheaderTypographyProps, { className: (0, clsx_1.default)(classes.subheader, subheaderTypographyProps.className) }), subheader)) : null }, cardProps, { disableTypography: true })));
103
117
  });
package/chip/chip.js CHANGED
@@ -82,5 +82,5 @@ var Root = (0, styled_1.styled)(Chip_1.default, { name: exports.chipComponentNam
82
82
  });
83
83
  exports.Chip = React.forwardRef(function (props, ref) {
84
84
  var selected = props.selected, _a = props.deleteIcon, deleteIcon = _a === void 0 ? React.createElement(icon_1.XIcon, null) : _a, chipProps = __rest(props, ["selected", "deleteIcon"]);
85
- return React.createElement(Root, __assign({ ref: ref, deleteIcon: deleteIcon, ownerState: { selected: selected } }, chipProps));
85
+ return (React.createElement(Root, __assign({ ref: ref, deleteIcon: deleteIcon, ownerState: { selected: selected } }, chipProps, { title: props === null || props === void 0 ? void 0 : props.label })));
86
86
  });
package/code/code.js CHANGED
@@ -51,16 +51,17 @@ var styled_1 = require("../styled");
51
51
  var text_1 = require("../text");
52
52
  exports.CodeComponentName = 'QuantumCode';
53
53
  var Root = (0, styled_1.styled)(text_1.Text, { name: exports.CodeComponentName, slot: 'Root' })(function (_a) {
54
- var theme = _a.theme;
54
+ var theme = _a.theme, noWrap = _a.noWrap;
55
55
  return ({
56
56
  display: 'inline',
57
57
  padding: theme.spacing(0.25, 0.75),
58
58
  color: theme.tokens.color_fg_default,
59
59
  backgroundColor: theme.tokens.color_bg_layer_alternate_bold,
60
60
  borderRadius: theme.shape.borderRadius,
61
+ whiteSpace: noWrap ? 'nowrap' : 'pre-wrap', // Conditionally apply white-space
61
62
  });
62
63
  });
63
64
  exports.Code = React.forwardRef(function (props, ref) {
64
- var children = props.children, _a = props.variant, variant = _a === void 0 ? 'code2' : _a, textProps = __rest(props, ["children", "variant"]);
65
- return (React.createElement(Root, __assign({ ref: ref }, { component: 'span' }, { color: "textSecondary", variant: variant }, textProps), children));
65
+ var children = props.children, _a = props.variant, variant = _a === void 0 ? 'code2' : _a, _b = props.noWrap, noWrap = _b === void 0 ? true : _b, textProps = __rest(props, ["children", "variant", "noWrap"]);
66
+ return (React.createElement(Root, __assign({ ref: ref }, { component: 'span' }, { color: "textSecondary", variant: variant, noWrap: noWrap }, textProps), children));
66
67
  });
@@ -130,18 +130,18 @@ var validateHex = function (hex) {
130
130
  return hexRegex.test(hex);
131
131
  };
132
132
  exports.ColorTextField = React.forwardRef(function (props, ref) {
133
- var inputAdornmentProps = props.inputAdornmentProps, value = props.value, defaultValue = props.defaultValue, placeholder = props.placeholder, rootProps = __rest(props, ["inputAdornmentProps", "value", "defaultValue", "placeholder"]);
134
- var getInitialColor = function () { return value || placeholder || defaultValue || ''; };
133
+ var inputAdornmentProps = props.inputAdornmentProps, value = props.value, defaultValue = props.defaultValue, error = props.error, placeholder = props.placeholder, rootProps = __rest(props, ["inputAdornmentProps", "value", "defaultValue", "error", "placeholder"]);
134
+ var getInitialColor = React.useCallback(function () { return value || placeholder || defaultValue || ''; }, [value, placeholder, defaultValue]);
135
135
  var normalizedInitialColor = normalizeHex(getInitialColor());
136
136
  var _a = __read(React.useState(value || defaultValue), 2), inputColor = _a[0], setInputColor = _a[1];
137
- var _b = __read(React.useState(null), 2), error = _b[0], setError = _b[1];
137
+ var _b = __read(React.useState(error || ''), 2), invalidError = _b[0], setInvalidError = _b[1];
138
138
  //Derived state from inputColor (textfield value)
139
139
  var colorPicker = React.useMemo(function () {
140
140
  if (inputColor) {
141
141
  return normalizeHex(inputColor);
142
142
  }
143
143
  return normalizeHex(getInitialColor());
144
- }, [inputColor, value, placeholder, defaultValue]);
144
+ }, [inputColor, getInitialColor]);
145
145
  var handleTextfieldChange = function (event) {
146
146
  var newValue = event.target.value;
147
147
  setInputColor(newValue);
@@ -149,10 +149,10 @@ exports.ColorTextField = React.forwardRef(function (props, ref) {
149
149
  var handleTextfieldBlur = function (event) {
150
150
  var _a, _b;
151
151
  if (!validateHex(event.target.value)) {
152
- setError('Color is invalid');
152
+ setInvalidError('Color is invalid');
153
153
  return;
154
154
  }
155
- setError(null);
155
+ setInvalidError('');
156
156
  var newValue = normalizeHex(event.target.value);
157
157
  setInputColor(newValue);
158
158
  var updatedEvent = __assign(__assign({}, event), { target: __assign(__assign({}, event.target), { value: newValue || normalizedInitialColor }) });
@@ -162,10 +162,10 @@ exports.ColorTextField = React.forwardRef(function (props, ref) {
162
162
  var handleColorPickerChange = function (event) {
163
163
  var _a, _b;
164
164
  if (!validateHex(event.target.value)) {
165
- setError('Color is invalid');
165
+ setInvalidError('Color is invalid');
166
166
  return;
167
167
  }
168
- setError(null);
168
+ setInvalidError('');
169
169
  var newValue = (_a = event.target.value) === null || _a === void 0 ? void 0 : _a.toUpperCase();
170
170
  setInputColor(newValue);
171
171
  (_b = props.onChange) === null || _b === void 0 ? void 0 : _b.call(props, __assign(__assign({}, event), { target: __assign(__assign({}, event.target), { value: newValue }) }));
@@ -174,7 +174,7 @@ exports.ColorTextField = React.forwardRef(function (props, ref) {
174
174
  React.useEffect(function () {
175
175
  setInputColor(defaultValue);
176
176
  }, [defaultValue]);
177
- return (React.createElement(Root, __assign({ ref: ref, error: error }, rootProps, { InputProps: {
177
+ return (React.createElement(Root, __assign({ ref: ref, error: props.error || invalidError }, rootProps, { InputProps: {
178
178
  startAdornment: (React.createElement(input_1.InputAdornment, __assign({ position: "start" }, inputAdornmentProps),
179
179
  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 }))),
180
180
  value: inputColor,
@@ -1,12 +1,11 @@
1
1
  import * as React from 'react';
2
2
  import { IIconButtonProps } from '../icon-button';
3
- export type ICopyButtonProps = IIconButtonProps;
4
- export declare const CopyButton: React.ForwardRefExoticComponent<{
5
- variant?: "link" | "outlined" | "contained" | undefined;
6
- shape?: "default" | "circular" | undefined;
7
- tooltipPlacement?: "left" | "right" | "bottom" | "top" | "bottom-end" | "bottom-start" | "left-end" | "left-start" | "right-end" | "right-start" | "top-end" | "top-start" | undefined;
8
- onTooltipClose?: ((event: Event | React.SyntheticEvent<Element, Event>) => void) | undefined;
9
- href?: string | undefined;
10
- label: string;
11
- target?: string | undefined;
12
- } & import("@mui/material").IconButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "label" | "ref" | "action" | "variant" | "tabIndex" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "href" | keyof import("@mui/material").IconButtonOwnProps | "target" | "shape" | "tooltipPlacement" | "onTooltipClose"> & React.RefAttributes<HTMLButtonElement>>;
3
+ export interface ICopyButtonProps extends IIconButtonProps {
4
+ /**
5
+ * Custom label to display on the button after content is copied to the clipboard.
6
+ *
7
+ * @default 'Copied!'
8
+ */
9
+ copiedLabel?: string;
10
+ }
11
+ export declare const CopyButton: React.ForwardRefExoticComponent<ICopyButtonProps & React.RefAttributes<HTMLButtonElement>>;
@@ -66,8 +66,8 @@ var React = __importStar(require("react"));
66
66
  var icon_1 = require("../icon");
67
67
  var icon_button_1 = require("../icon-button");
68
68
  exports.CopyButton = React.forwardRef(function (_a, ref) {
69
- var onClick = _a.onClick, label = _a.label, rootProps = __rest(_a, ["onClick", "label"]);
70
- var _b = __read(React.useState(false), 2), pressed = _b[0], setPressed = _b[1];
69
+ var onClick = _a.onClick, label = _a.label, _b = _a.copiedLabel, copiedLabel = _b === void 0 ? 'Copied!' : _b, rootProps = __rest(_a, ["onClick", "label", "copiedLabel"]);
70
+ var _c = __read(React.useState(false), 2), pressed = _c[0], setPressed = _c[1];
71
71
  React.useEffect(function () {
72
72
  if (!pressed) {
73
73
  return undefined;
@@ -85,7 +85,7 @@ exports.CopyButton = React.forwardRef(function (_a, ref) {
85
85
  };
86
86
  var handleClose = function () { return setPressed(false); };
87
87
  // use title as the key to force a mount/unmount of the tooltip. This drives the feedback transition.
88
- var title = pressed ? 'Copied!' : label;
88
+ var title = pressed ? copiedLabel : label;
89
89
  return (React.createElement(icon_button_1.IconButton, __assign({}, rootProps, { key: title, label: title, onTooltipClose: handleClose, ref: ref, tooltipPlacement: "top", onClick: handleClick }),
90
90
  React.createElement(icon_1.CopyIcon, null)));
91
91
  });
@@ -4,6 +4,7 @@ import { DialogTitleClasses } from './dialog-title-classes';
4
4
  export interface IDialogTitleProps extends Omit<DialogTitleProps, 'classes'> {
5
5
  disableTypography?: boolean;
6
6
  onClose?(event: {}, reason: 'closeClick'): void;
7
+ closeButtonLabel?: string;
7
8
  classes?: Partial<DialogTitleClasses>;
8
9
  }
9
10
  export declare const DialogTitle: React.ForwardRefExoticComponent<Omit<IDialogTitleProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
@@ -68,10 +68,10 @@ var Root = (0, styled_1.styled)(DialogTitle_1.default, {
68
68
  justifyContent: 'space-between',
69
69
  });
70
70
  exports.DialogTitle = React.forwardRef(function (props, ref) {
71
- 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"]);
71
+ 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"]);
72
72
  var classes = (0, classes_1.useMergedClasses)(dialog_title_classes_1.dialogTitleClasses, dialog_title_classes_1.getDialogTitleUtilityClass, propClasses);
73
73
  return (React.createElement(Root, __assign({}, dialogTitleProps, { className: (0, clsx_1.default)(classes.root, className), ref: ref }),
74
74
  disableTypography ? (children) : (React.createElement(text_1.Text, { id: id, className: classes.title, variant: "h5", color: "textPrimary" }, children)),
75
- !!onClose && (React.createElement(icon_button_1.IconButton, { shape: "circular", variant: "contained", "aria-label": "Close", size: "small", className: classes.closeButton, onClick: function (event) { return onClose(event, 'closeClick'); }, label: "Close" },
75
+ !!onClose && (React.createElement(icon_button_1.IconButton, { shape: "circular", variant: "contained", "aria-label": "Close", size: "small", className: classes.closeButton, onClick: function (event) { return onClose(event, 'closeClick'); }, label: closeButtonLabel || 'Close' },
76
76
  React.createElement(icon_1.XIcon, null)))));
77
77
  });
@@ -10,6 +10,8 @@ export interface IDialogProps extends Omit<DialogProps, 'title' | 'onClose'> {
10
10
  disableContentWrap?: boolean;
11
11
  /** callback for when the dialog is closed. The reason is given as the second argument */
12
12
  onClose?(event: {}, reason: 'backdropClick' | 'escapeKeyDown' | 'closeClick'): void;
13
+ /** convenience prop for rendering the label for close button with a DialogTitle component */
14
+ closeButtonLabel?: string;
13
15
  }
14
16
  export declare const dialogComponentName = "QuantumDialog";
15
17
  export declare const Dialog: React.ForwardRefExoticComponent<Omit<IDialogProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
package/dialog/dialog.js CHANGED
@@ -71,7 +71,7 @@ var Root = (0, styled_1.styled)(Dialog_1.default, {
71
71
  _b);
72
72
  });
73
73
  exports.Dialog = React.forwardRef(function (props, ref) {
74
- 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"]);
74
+ 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"]);
75
75
  var id = (0, use_id_1.useId)(props.id);
76
76
  var titleId = !!title && !!id ? "".concat(id, "-title") : undefined;
77
77
  var handleClose = function (event, reason) {
@@ -83,7 +83,7 @@ exports.Dialog = React.forwardRef(function (props, ref) {
83
83
  }
84
84
  };
85
85
  return (React.createElement(Root, __assign({ PaperProps: { elevation: 4 } }, dialogProps, { id: id, ref: ref, onClose: onClose ? handleClose : undefined, "aria-labelledby": titleId }),
86
- !!title && (React.createElement(dialog_title_1.DialogTitle, { id: titleId, onClose: onClose }, title)),
86
+ !!title && (React.createElement(dialog_title_1.DialogTitle, { id: titleId, onClose: onClose, closeButtonLabel: closeButtonLabel }, title)),
87
87
  disableContentWrap ? children : React.createElement(dialog_content_1.DialogContent, null, children),
88
88
  !!actions && React.createElement(dialog_actions_1.DialogActions, null, actions)));
89
89
  });
@@ -11,6 +11,6 @@ export var AccordionDetails = styled(MuiAccordionDetails, {
11
11
  gridTemplateColumns: '40% repeat(4, 15%)',
12
12
  padding: "0px ".concat(theme.spacing(2)),
13
13
  borderBottom: "1px solid ".concat(theme.tokens.color_border_default),
14
- height: theme.typography.pxToRem(72),
14
+ minHeight: theme.typography.pxToRem(72),
15
15
  };
16
16
  });
@@ -189,6 +189,6 @@ export var Alert = React.forwardRef(function (props, ref) {
189
189
  !!title && React.createElement(AlertTitle, { className: classes.title }, title),
190
190
  React.createElement(AlertMessage, { className: classes.message }, message || children)),
191
191
  hasAction && (React.createElement(AlertAction, { className: classes.action }, action ||
192
- (showCloseButton && (React.createElement(IconButton, { label: "close button", color: "inherit", size: "small", variant: "link", "aria-label": closeText, onClick: onClose },
192
+ (showCloseButton && (React.createElement(IconButton, { label: closeText, color: "inherit", size: "small", variant: "link", "aria-label": closeText, onClick: onClose },
193
193
  React.createElement(XIcon, null))))))));
194
194
  });
@@ -56,11 +56,12 @@ var titleVariantMap = {
56
56
  large: 'subtitle1',
57
57
  };
58
58
  export var AvatarBlock = React.forwardRef(function (props, ref) {
59
- var avatar = props.avatar, title = props.title, description = props.description, titleTypographyProps = props.titleTypographyProps, descriptionTypographyProps = props.descriptionTypographyProps, _a = props.TitleBlockProps, TitleBlockProps = _a === void 0 ? {} : _a, className = props.className, _b = props.size, size = _b === void 0 ? 'medium' : _b, endAdornment = props.endAdornment, rootProps = __rest(props, ["avatar", "title", "description", "titleTypographyProps", "descriptionTypographyProps", "TitleBlockProps", "className", "size", "endAdornment"]);
59
+ var avatar = props.avatar, title = props.title, description = props.description, titleTypographyProps = props.titleTypographyProps, descriptionTypographyProps = props.descriptionTypographyProps, _a = props.TitleBlockProps, TitleBlockProps = _a === void 0 ? {} : _a, className = props.className, _b = props.size, size = _b === void 0 ? 'medium' : _b, endAdornment = props.endAdornment, _c = props.noWrap, noWrap = _c === void 0 ? false : _c, // Default to false
60
+ rootProps = __rest(props, ["avatar", "title", "description", "titleTypographyProps", "descriptionTypographyProps", "TitleBlockProps", "className", "size", "endAdornment", "noWrap"]);
60
61
  var classes = useMergedClasses(avatarBlockClasses, getAvatarBlockUtilityClass, props.classes);
61
62
  var titleVariant = titleVariantMap[size];
62
63
  return (React.createElement(Root, __assign({ ownerState: { description: description, size: size }, ref: ref, className: clsx(classes.root, className) }, rootProps),
63
64
  avatar && React.createElement(Avatar, { className: classes.avatar }, avatar),
64
- React.createElement(TitleBlock, __assign({ className: classes.titleBlock, title: title, description: description, titleTypographyProps: __assign({ noWrap: true, component: 'p', variant: titleVariant }, titleTypographyProps), descriptionTypographyProps: descriptionTypographyProps, gutter: size === 'large' ? 0.5 : 0 }, TitleBlockProps, { sx: __assign({ flex: 1 }, TitleBlockProps.sx) })),
65
+ React.createElement(TitleBlock, __assign({ className: classes.titleBlock, title: title, description: description, titleTypographyProps: __assign({ component: 'p', variant: titleVariant, noWrap: noWrap, title: noWrap && typeof title === 'string' ? title : '' }, titleTypographyProps), descriptionTypographyProps: __assign({ noWrap: noWrap, title: noWrap && typeof description === 'string' ? description : '' }, descriptionTypographyProps), gutter: size === 'large' ? 0.5 : 0 }, TitleBlockProps, { sx: __assign({ flex: 1 }, TitleBlockProps.sx) })),
65
66
  !!endAdornment && React.createElement(EndAdornment, { className: classes.endAdornment }, endAdornment)));
66
67
  });
@@ -49,10 +49,26 @@ var ButtonSpinner = styled(Spinner, {
49
49
  })({
50
50
  position: 'absolute',
51
51
  });
52
+ var LabelSpan = styled('span')(function (_a) {
53
+ var maxWidth = _a.maxWidth;
54
+ return ({
55
+ display: 'inline-block',
56
+ overflow: 'hidden',
57
+ textOverflow: 'ellipsis',
58
+ whiteSpace: 'nowrap',
59
+ maxWidth: maxWidth || '100%', // Adjust as needed for non-fullWidth buttons
60
+ });
61
+ });
52
62
  export var Button = React.forwardRef(function (_a, ref) {
53
- var isLoading = _a.isLoading, label = _a.label, children = _a.children, disabled = _a.disabled, _b = _a.SpinnerProps, SpinnerProps = _b === void 0 ? {} : _b, _c = _a.color, color = _c === void 0 ? 'default' : _c, variant = _a.variant, rootProps = __rest(_a, ["isLoading", "label", "children", "disabled", "SpinnerProps", "color", "variant"]);
54
- return (React.createElement(Root, __assign({}, rootProps, { disabled: disabled || isLoading, ownerState: { isLoading: isLoading }, color: color, variant: variant, ref: ref }),
55
- label || children,
56
- " ",
63
+ var isLoading = _a.isLoading, label = _a.label, children = _a.children, disabled = _a.disabled, _b = _a.SpinnerProps, SpinnerProps = _b === void 0 ? {} : _b, _c = _a.color, color = _c === void 0 ? 'default' : _c, variant = _a.variant, maxWidth = _a.maxWidth, rootProps = __rest(_a, ["isLoading", "label", "children", "disabled", "SpinnerProps", "color", "variant", "maxWidth"]);
64
+ var title = label ||
65
+ (typeof children === 'string'
66
+ ? children
67
+ : React.Children.toArray(children)
68
+ .filter(function (child) { return typeof child === 'string'; })
69
+ .join(''));
70
+ return (React.createElement(Root, __assign({}, rootProps, { disabled: disabled || isLoading, ownerState: { isLoading: isLoading }, color: color, variant: variant, ref: ref, title: String(title) }),
71
+ React.createElement(LabelSpan, { style: { maxWidth: rootProps.fullWidth ? 'none' : maxWidth || '100%' } }, label || children),
72
+ ' ',
57
73
  !!isLoading && React.createElement(ButtonSpinner, __assign({}, SpinnerProps))));
58
74
  });
@@ -54,21 +54,35 @@ var titleVariantMap = {
54
54
  };
55
55
  export var CardHeader = React.forwardRef(function (props, ref) {
56
56
  var sizeContext = useCardContext().size;
57
- var sizeProp = props.size, _a = props.titleTypographyProps, titleTypographyProps = _a === void 0 ? {} : _a, _b = props.subheaderTypographyProps, subheaderTypographyProps = _b === void 0 ? {} : _b, title = props.title, subheader = props.subheader, propClasses = props.classes, cardProps = __rest(props, ["size", "titleTypographyProps", "subheaderTypographyProps", "title", "subheader", "classes"]);
57
+ var sizeProp = props.size, _a = props.titleTypographyProps, titleTypographyProps = _a === void 0 ? {} : _a, _b = props.subheaderTypographyProps, subheaderTypographyProps = _b === void 0 ? {} : _b, title = props.title, subheader = props.subheader, _c = props.noWrap, noWrap = _c === void 0 ? false : _c, propClasses = props.classes, cardProps = __rest(props, ["size", "titleTypographyProps", "subheaderTypographyProps", "title", "subheader", "noWrap", "classes"]);
58
58
  var classes = useMergedClasses(cardHeaderClasses, getCardHeaderUtilityClass, propClasses);
59
59
  var size = sizeProp || sizeContext || defaultCardSize;
60
60
  var titleVariant = titleVariantMap[size];
61
+ var titleStyles = noWrap
62
+ ? {
63
+ whiteSpace: 'nowrap',
64
+ overflow: 'hidden',
65
+ textOverflow: 'ellipsis',
66
+ }
67
+ : {
68
+ whiteSpace: 'normal',
69
+ overflow: 'visible',
70
+ textOverflow: 'clip', // Don't apply ellipsis
71
+ }; // No additional styles when noWrap is false
72
+ var subheaderStyles = noWrap
73
+ ? {
74
+ whiteSpace: 'nowrap',
75
+ overflow: 'hidden',
76
+ textOverflow: 'ellipsis',
77
+ }
78
+ : {
79
+ whiteSpace: 'normal',
80
+ overflow: 'visible',
81
+ textOverflow: 'clip', // Don't apply ellipsis
82
+ };
61
83
  return (React.createElement(Root, __assign({ ref: ref, ownerState: { size: size }, classes: {
62
84
  action: classes.action,
63
85
  avatar: classes.avatar,
64
86
  content: classes.content,
65
- }, title: React.createElement(Title, __assign({ variant: titleVariant, color: "textPrimary" }, { component: 'p' }, { role: "heading", display: "block" }, titleTypographyProps, { className: clsx(classes.title, titleTypographyProps.className), ownerState: { size: size }, noWrap: true, sx: {
66
- whiteSpace: 'nowrap',
67
- overflow: 'hidden',
68
- textOverflow: 'ellipsis',
69
- }, title: title }), title), subheader: subheader ? (React.createElement(Text, __assign({ variant: "body2", color: "textSecondary", component: "p", noWrap: true, sx: {
70
- whiteSpace: 'nowrap',
71
- overflow: 'hidden',
72
- textOverflow: 'ellipsis',
73
- }, title: subheader }, subheaderTypographyProps, { className: clsx(classes.subheader, subheaderTypographyProps.className) }), subheader)) : null }, cardProps, { disableTypography: true })));
87
+ }, title: React.createElement(Title, __assign({ variant: titleVariant, color: "textPrimary" }, { component: 'p' }, { role: "heading", display: "block" }, titleTypographyProps, { className: clsx(classes.title, titleTypographyProps.className), ownerState: { size: size }, noWrap: noWrap, sx: titleStyles, title: noWrap ? title : '' }), title), subheader: subheader ? (React.createElement(Text, __assign({ variant: "body2", color: "textSecondary", component: "p", noWrap: noWrap, sx: subheaderStyles, title: noWrap ? subheader : '' }, subheaderTypographyProps, { className: clsx(classes.subheader, subheaderTypographyProps.className) }), subheader)) : null }, cardProps, { disableTypography: true })));
74
88
  });
package/esm/chip/chip.js CHANGED
@@ -56,5 +56,5 @@ var Root = styled(MuiChip, { name: chipComponentName, slot: 'Root' })(function (
56
56
  });
57
57
  export var Chip = React.forwardRef(function (props, ref) {
58
58
  var selected = props.selected, _a = props.deleteIcon, deleteIcon = _a === void 0 ? React.createElement(XIcon, null) : _a, chipProps = __rest(props, ["selected", "deleteIcon"]);
59
- return React.createElement(Root, __assign({ ref: ref, deleteIcon: deleteIcon, ownerState: { selected: selected } }, chipProps));
59
+ return (React.createElement(Root, __assign({ ref: ref, deleteIcon: deleteIcon, ownerState: { selected: selected } }, chipProps, { title: props === null || props === void 0 ? void 0 : props.label })));
60
60
  });
package/esm/code/code.js CHANGED
@@ -25,16 +25,17 @@ import { styled } from '../styled';
25
25
  import { Text } from '../text';
26
26
  export var CodeComponentName = 'QuantumCode';
27
27
  var Root = styled(Text, { name: CodeComponentName, slot: 'Root' })(function (_a) {
28
- var theme = _a.theme;
28
+ var theme = _a.theme, noWrap = _a.noWrap;
29
29
  return ({
30
30
  display: 'inline',
31
31
  padding: theme.spacing(0.25, 0.75),
32
32
  color: theme.tokens.color_fg_default,
33
33
  backgroundColor: theme.tokens.color_bg_layer_alternate_bold,
34
34
  borderRadius: theme.shape.borderRadius,
35
+ whiteSpace: noWrap ? 'nowrap' : 'pre-wrap', // Conditionally apply white-space
35
36
  });
36
37
  });
37
38
  export var Code = React.forwardRef(function (props, ref) {
38
- var children = props.children, _a = props.variant, variant = _a === void 0 ? 'code2' : _a, textProps = __rest(props, ["children", "variant"]);
39
- return (React.createElement(Root, __assign({ ref: ref }, { component: 'span' }, { color: "textSecondary", variant: variant }, textProps), children));
39
+ var children = props.children, _a = props.variant, variant = _a === void 0 ? 'code2' : _a, _b = props.noWrap, noWrap = _b === void 0 ? true : _b, textProps = __rest(props, ["children", "variant", "noWrap"]);
40
+ return (React.createElement(Root, __assign({ ref: ref }, { component: 'span' }, { color: "textSecondary", variant: variant, noWrap: noWrap }, textProps), children));
40
41
  });
@@ -104,18 +104,18 @@ var validateHex = function (hex) {
104
104
  return hexRegex.test(hex);
105
105
  };
106
106
  export var ColorTextField = React.forwardRef(function (props, ref) {
107
- var inputAdornmentProps = props.inputAdornmentProps, value = props.value, defaultValue = props.defaultValue, placeholder = props.placeholder, rootProps = __rest(props, ["inputAdornmentProps", "value", "defaultValue", "placeholder"]);
108
- var getInitialColor = function () { return value || placeholder || defaultValue || ''; };
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
109
  var normalizedInitialColor = normalizeHex(getInitialColor());
110
110
  var _a = __read(React.useState(value || defaultValue), 2), inputColor = _a[0], setInputColor = _a[1];
111
- var _b = __read(React.useState(null), 2), error = _b[0], setError = _b[1];
111
+ var _b = __read(React.useState(error || ''), 2), invalidError = _b[0], setInvalidError = _b[1];
112
112
  //Derived state from inputColor (textfield value)
113
113
  var colorPicker = React.useMemo(function () {
114
114
  if (inputColor) {
115
115
  return normalizeHex(inputColor);
116
116
  }
117
117
  return normalizeHex(getInitialColor());
118
- }, [inputColor, value, placeholder, defaultValue]);
118
+ }, [inputColor, getInitialColor]);
119
119
  var handleTextfieldChange = function (event) {
120
120
  var newValue = event.target.value;
121
121
  setInputColor(newValue);
@@ -123,10 +123,10 @@ export var ColorTextField = React.forwardRef(function (props, ref) {
123
123
  var handleTextfieldBlur = function (event) {
124
124
  var _a, _b;
125
125
  if (!validateHex(event.target.value)) {
126
- setError('Color is invalid');
126
+ setInvalidError('Color is invalid');
127
127
  return;
128
128
  }
129
- setError(null);
129
+ setInvalidError('');
130
130
  var newValue = normalizeHex(event.target.value);
131
131
  setInputColor(newValue);
132
132
  var updatedEvent = __assign(__assign({}, event), { target: __assign(__assign({}, event.target), { value: newValue || normalizedInitialColor }) });
@@ -136,10 +136,10 @@ export var ColorTextField = React.forwardRef(function (props, ref) {
136
136
  var handleColorPickerChange = function (event) {
137
137
  var _a, _b;
138
138
  if (!validateHex(event.target.value)) {
139
- setError('Color is invalid');
139
+ setInvalidError('Color is invalid');
140
140
  return;
141
141
  }
142
- setError(null);
142
+ setInvalidError('');
143
143
  var newValue = (_a = event.target.value) === null || _a === void 0 ? void 0 : _a.toUpperCase();
144
144
  setInputColor(newValue);
145
145
  (_b = props.onChange) === null || _b === void 0 ? void 0 : _b.call(props, __assign(__assign({}, event), { target: __assign(__assign({}, event.target), { value: newValue }) }));
@@ -148,7 +148,7 @@ export var ColorTextField = React.forwardRef(function (props, ref) {
148
148
  React.useEffect(function () {
149
149
  setInputColor(defaultValue);
150
150
  }, [defaultValue]);
151
- return (React.createElement(Root, __assign({ ref: ref, error: error }, rootProps, { InputProps: {
151
+ return (React.createElement(Root, __assign({ ref: ref, error: props.error || invalidError }, rootProps, { InputProps: {
152
152
  startAdornment: (React.createElement(InputAdornment, __assign({ position: "start" }, inputAdornmentProps),
153
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
154
  value: inputColor,
@@ -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
  });
@@ -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),
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: title }), title),
32
- !!description && (React.createElement(Text, __assign({ variant: "body2", color: "textSecondary", className: titleBlockClasses.description }, descriptionTypographyProps, { title: description }), 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@auth0/quantum-product",
3
- "version": "2.4.8",
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/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: title }), title),
61
- !!description && (React.createElement(text_1.Text, __assign({ variant: "body2", color: "textSecondary", className: title_block_classes_1.titleBlockClasses.description }, descriptionTypographyProps, { title: description }), 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
  });