@auth0/quantum-product 2.5.5 → 2.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/promo-banner/promo-banner-classes.js +1 -0
- package/esm/promo-banner/promo-banner.js +25 -2
- package/package.json +1 -1
- package/promo-banner/promo-banner-classes.d.ts +1 -1
- package/promo-banner/promo-banner-classes.js +1 -0
- package/promo-banner/promo-banner.d.ts +1 -0
- package/promo-banner/promo-banner.js +25 -2
|
@@ -133,6 +133,28 @@ var ImageContainer = styled('div', { name: promoBannerComponentName, slot: 'Imag
|
|
|
133
133
|
display: 'flex',
|
|
134
134
|
}, _b), imagePositionClass);
|
|
135
135
|
});
|
|
136
|
+
var DemoComponentContainer = styled('div', { name: promoBannerComponentName, slot: 'DemoComponentContainer' })(function (_a) {
|
|
137
|
+
var _b;
|
|
138
|
+
var theme = _a.theme, ownerState = _a.ownerState;
|
|
139
|
+
var imageContainerPositionTop = {
|
|
140
|
+
alignSelf: 'flex-start',
|
|
141
|
+
paddingTop: 0,
|
|
142
|
+
paddingBottom: theme.spacing(2),
|
|
143
|
+
};
|
|
144
|
+
var imageContainerPositionCenter = {
|
|
145
|
+
alignSelf: 'center',
|
|
146
|
+
paddingTop: 0,
|
|
147
|
+
paddingBottom: 0,
|
|
148
|
+
};
|
|
149
|
+
var imagePositionClass = ownerState.imagePosition === 'top'
|
|
150
|
+
? imageContainerPositionTop
|
|
151
|
+
: ownerState.imagePosition === 'center'
|
|
152
|
+
? imageContainerPositionCenter
|
|
153
|
+
: {};
|
|
154
|
+
return __assign((_b = { flex: 5, paddingRight: theme.spacing(2), paddingTop: theme.spacing(2), paddingBottom: 0, alignSelf: 'flex-start', display: 'none' }, _b[theme.breakpoints.up('md')] = {
|
|
155
|
+
display: 'flex',
|
|
156
|
+
}, _b), imagePositionClass);
|
|
157
|
+
});
|
|
136
158
|
var Img = styled(Image, { name: promoBannerComponentName, slot: 'Image' })(function (_a) {
|
|
137
159
|
var ownerState = _a.ownerState;
|
|
138
160
|
var imageFullWidthClass = {
|
|
@@ -154,7 +176,7 @@ var Content = styled(RowLayout, { name: promoBannerComponentName, slot: 'Content
|
|
|
154
176
|
_b;
|
|
155
177
|
});
|
|
156
178
|
export var PromoBanner = React.forwardRef(function (props, ref) {
|
|
157
|
-
var title = props.title, description = props.description, _a = props.color, color = _a === void 0 ? 'default' : _a, _b = props.imageFullWidth, imageFullWidth = _b === void 0 ? true : _b, className = props.className, image = props.image, imagePosition = props.imagePosition, action = props.action, actionSecondary = props.actionSecondary, sx = props.sx, propClasses = props.classes, rootProps = __rest(props, ["title", "description", "color", "imageFullWidth", "className", "image", "imagePosition", "action", "actionSecondary", "sx", "classes"]);
|
|
179
|
+
var title = props.title, description = props.description, _a = props.color, color = _a === void 0 ? 'default' : _a, _b = props.imageFullWidth, imageFullWidth = _b === void 0 ? true : _b, className = props.className, image = props.image, imagePosition = props.imagePosition, action = props.action, actionSecondary = props.actionSecondary, sx = props.sx, propClasses = props.classes, demoComponent = props.demoComponent, rootProps = __rest(props, ["title", "description", "color", "imageFullWidth", "className", "image", "imagePosition", "action", "actionSecondary", "sx", "classes", "demoComponent"]);
|
|
158
180
|
var classes = useMergedClasses(promoBannerClasses, getPromoBannerUtilityClass, propClasses);
|
|
159
181
|
return (React.createElement(Root, __assign({ ref: ref, sx: sx, elevation: color === 'default' ? 0 : 5, ownerState: { color: color }, forwardedAs: "section", className: clsx(classes.root, className) }, rootProps),
|
|
160
182
|
React.createElement(Content, { className: classes.content },
|
|
@@ -163,5 +185,6 @@ export var PromoBanner = React.forwardRef(function (props, ref) {
|
|
|
163
185
|
React.createElement(StackLayout, { gutter: 1, className: classes.actions },
|
|
164
186
|
React.createElement(StackLayoutItem, null, action && (React.createElement(PrimaryActionButton, __assign({ variant: "contained", size: "medium", color: "primary", className: clsx(classes.action, classes.primaryAction), ownerState: { color: color } }, action)))),
|
|
165
187
|
React.createElement(StackLayoutItem, null, actionSecondary && (React.createElement(SecondaryActionButton, __assign({ className: clsx(classes.action, classes.secondaryAction), color: color === 'default' ? 'primary' : undefined, ownerState: { color: color }, variant: "link", size: "medium" }, actionSecondary)))))),
|
|
166
|
-
React.createElement(ImageContainer, { className: classes.imageContainer, ownerState: { imagePosition: imagePosition } }, !!image && React.createElement(Img, __assign({ className: classes.image, ownerState: { fullWidth: imageFullWidth } }, image))))
|
|
188
|
+
!demoComponent && (React.createElement(ImageContainer, { className: classes.imageContainer, ownerState: { imagePosition: imagePosition } }, !!image && React.createElement(Img, __assign({ className: classes.image, ownerState: { fullWidth: imageFullWidth } }, image)))),
|
|
189
|
+
!image && !!demoComponent && (React.createElement(DemoComponentContainer, { className: classes.demoComponentContainer, ownerState: { imagePosition: imagePosition } }, demoComponent))));
|
|
167
190
|
});
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const promoBannerComponentName: "QuantumPromoBanner";
|
|
2
2
|
export declare function getPromoBannerUtilityClass(slot: string): string;
|
|
3
|
-
export declare const promoBannerClasses: Record<"title" | "image" | "action" | "content" | "root" | "secondaryAction" | "actions" | "description" | "primaryAction" | "imageContainer", string>;
|
|
3
|
+
export declare const promoBannerClasses: Record<"title" | "image" | "action" | "content" | "root" | "secondaryAction" | "actions" | "description" | "primaryAction" | "imageContainer" | "demoComponentContainer", string>;
|
|
4
4
|
export type PromoBannerClasses = typeof promoBannerClasses;
|
|
5
5
|
export type PromoBannerClassKey = keyof PromoBannerClasses;
|
|
@@ -17,5 +17,6 @@ export interface IPromoBannerProps extends Omit<IPaperProps, 'title'> {
|
|
|
17
17
|
imageFullWidth?: boolean;
|
|
18
18
|
image?: Pick<IImageProps, 'src' | 'alt'>;
|
|
19
19
|
classes?: Partial<PromoBannerClasses>;
|
|
20
|
+
demoComponent?: React.ReactNode;
|
|
20
21
|
}
|
|
21
22
|
export declare const PromoBanner: React.ForwardRefExoticComponent<Omit<IPromoBannerProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -162,6 +162,28 @@ var ImageContainer = (0, styled_1.styled)('div', { name: promo_banner_classes_1.
|
|
|
162
162
|
display: 'flex',
|
|
163
163
|
}, _b), imagePositionClass);
|
|
164
164
|
});
|
|
165
|
+
var DemoComponentContainer = (0, styled_1.styled)('div', { name: promo_banner_classes_1.promoBannerComponentName, slot: 'DemoComponentContainer' })(function (_a) {
|
|
166
|
+
var _b;
|
|
167
|
+
var theme = _a.theme, ownerState = _a.ownerState;
|
|
168
|
+
var imageContainerPositionTop = {
|
|
169
|
+
alignSelf: 'flex-start',
|
|
170
|
+
paddingTop: 0,
|
|
171
|
+
paddingBottom: theme.spacing(2),
|
|
172
|
+
};
|
|
173
|
+
var imageContainerPositionCenter = {
|
|
174
|
+
alignSelf: 'center',
|
|
175
|
+
paddingTop: 0,
|
|
176
|
+
paddingBottom: 0,
|
|
177
|
+
};
|
|
178
|
+
var imagePositionClass = ownerState.imagePosition === 'top'
|
|
179
|
+
? imageContainerPositionTop
|
|
180
|
+
: ownerState.imagePosition === 'center'
|
|
181
|
+
? imageContainerPositionCenter
|
|
182
|
+
: {};
|
|
183
|
+
return __assign((_b = { flex: 5, paddingRight: theme.spacing(2), paddingTop: theme.spacing(2), paddingBottom: 0, alignSelf: 'flex-start', display: 'none' }, _b[theme.breakpoints.up('md')] = {
|
|
184
|
+
display: 'flex',
|
|
185
|
+
}, _b), imagePositionClass);
|
|
186
|
+
});
|
|
165
187
|
var Img = (0, styled_1.styled)(image_1.Image, { name: promo_banner_classes_1.promoBannerComponentName, slot: 'Image' })(function (_a) {
|
|
166
188
|
var ownerState = _a.ownerState;
|
|
167
189
|
var imageFullWidthClass = {
|
|
@@ -183,7 +205,7 @@ var Content = (0, styled_1.styled)(row_layout_1.RowLayout, { name: promo_banner_
|
|
|
183
205
|
_b;
|
|
184
206
|
});
|
|
185
207
|
exports.PromoBanner = React.forwardRef(function (props, ref) {
|
|
186
|
-
var title = props.title, description = props.description, _a = props.color, color = _a === void 0 ? 'default' : _a, _b = props.imageFullWidth, imageFullWidth = _b === void 0 ? true : _b, className = props.className, image = props.image, imagePosition = props.imagePosition, action = props.action, actionSecondary = props.actionSecondary, sx = props.sx, propClasses = props.classes, rootProps = __rest(props, ["title", "description", "color", "imageFullWidth", "className", "image", "imagePosition", "action", "actionSecondary", "sx", "classes"]);
|
|
208
|
+
var title = props.title, description = props.description, _a = props.color, color = _a === void 0 ? 'default' : _a, _b = props.imageFullWidth, imageFullWidth = _b === void 0 ? true : _b, className = props.className, image = props.image, imagePosition = props.imagePosition, action = props.action, actionSecondary = props.actionSecondary, sx = props.sx, propClasses = props.classes, demoComponent = props.demoComponent, rootProps = __rest(props, ["title", "description", "color", "imageFullWidth", "className", "image", "imagePosition", "action", "actionSecondary", "sx", "classes", "demoComponent"]);
|
|
187
209
|
var classes = (0, classes_1.useMergedClasses)(promo_banner_classes_1.promoBannerClasses, promo_banner_classes_1.getPromoBannerUtilityClass, propClasses);
|
|
188
210
|
return (React.createElement(Root, __assign({ ref: ref, sx: sx, elevation: color === 'default' ? 0 : 5, ownerState: { color: color }, forwardedAs: "section", className: (0, clsx_1.default)(classes.root, className) }, rootProps),
|
|
189
211
|
React.createElement(Content, { className: classes.content },
|
|
@@ -192,5 +214,6 @@ exports.PromoBanner = React.forwardRef(function (props, ref) {
|
|
|
192
214
|
React.createElement(stack_layout_1.StackLayout, { gutter: 1, className: classes.actions },
|
|
193
215
|
React.createElement(stack_layout_1.StackLayoutItem, null, action && (React.createElement(PrimaryActionButton, __assign({ variant: "contained", size: "medium", color: "primary", className: (0, clsx_1.default)(classes.action, classes.primaryAction), ownerState: { color: color } }, action)))),
|
|
194
216
|
React.createElement(stack_layout_1.StackLayoutItem, null, actionSecondary && (React.createElement(SecondaryActionButton, __assign({ className: (0, clsx_1.default)(classes.action, classes.secondaryAction), color: color === 'default' ? 'primary' : undefined, ownerState: { color: color }, variant: "link", size: "medium" }, actionSecondary)))))),
|
|
195
|
-
React.createElement(ImageContainer, { className: classes.imageContainer, ownerState: { imagePosition: imagePosition } }, !!image && React.createElement(Img, __assign({ className: classes.image, ownerState: { fullWidth: imageFullWidth } }, image))))
|
|
217
|
+
!demoComponent && (React.createElement(ImageContainer, { className: classes.imageContainer, ownerState: { imagePosition: imagePosition } }, !!image && React.createElement(Img, __assign({ className: classes.image, ownerState: { fullWidth: imageFullWidth } }, image)))),
|
|
218
|
+
!image && !!demoComponent && (React.createElement(DemoComponentContainer, { className: classes.demoComponentContainer, ownerState: { imagePosition: imagePosition } }, demoComponent))));
|
|
196
219
|
});
|