@thecb/components 6.3.1-beta.5 → 6.3.1-beta.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -9,6 +9,7 @@ interface CardProps {
9
9
  extraStyles?: string;
10
10
  imgSrc?: string;
11
11
  imgHeight?: string;
12
+ imgAltText?: string;
12
13
  imgObjectFit?:
13
14
  | "contain"
14
15
  | "cover"
@@ -20,6 +21,7 @@ interface CardProps {
20
21
  | "revert"
21
22
  | "revert-layer"
22
23
  | "unset";
24
+ headerAs?: string;
23
25
  headerText?: string;
24
26
  headerVariant?: string;
25
27
  borderRadius?: string;
@@ -39,7 +41,7 @@ interface ButtonWithActionProps {
39
41
  textExtraStyles?: string;
40
42
  contentOverride?: boolean;
41
43
  extraStyles?: string;
42
- tabIndex?: number;
44
+ tabIndex?: number | string;
43
45
  }
44
46
 
45
47
  declare const ButtonWithAction: React.FC<Expand<ButtonWithActionProps> &
@@ -276,6 +278,26 @@ interface TitleProps {
276
278
  declare const Title: React.FC<Expand<TitleProps> &
277
279
  React.HTMLAttributes<HTMLElement>>;
278
280
 
281
+ interface CollapsibleSectionProps {
282
+ isOpen: boolean;
283
+ toggleSection?: () => void;
284
+ isMobile?: boolean;
285
+ supportsTouch?: boolean;
286
+ title?: string;
287
+ customPadding?: string;
288
+ initiallyOpen?: boolean;
289
+ openHeight?: string;
290
+ customTitle?: boolean;
291
+ stackTitle?: boolean;
292
+ stackTitleContent?: JSX.Element;
293
+ sectionGap?: string;
294
+ name?: string;
295
+ index?: number;
296
+ }
297
+
298
+ declare const CollapsibleSection: React.FC<Expand<CollapsibleSectionProps> &
299
+ React.HTMLAttributes<HTMLElement>>;
300
+
279
301
  interface FooterWithSubfooterProps {
280
302
  footerLargeSide?: "left" | "right";
281
303
  footerLargeSideSize?: string;
@@ -302,5 +324,5 @@ interface DefaultPageTemplateProps {
302
324
  declare const DefaultPageTemplate: React.FC<Expand<DefaultPageTemplateProps> &
303
325
  React.HTMLAttributes<HTMLElement>>;
304
326
 
305
- export { Box, BoxProps, ButtonWithAction, ButtonWithActionProps, ButtonWithLink, ButtonWithLinkProps, Card, CardProps, Center, CenterProps, Cluster, ClusterProps, Cover, CoverProps, DefaultPageTemplate, DefaultPageTemplateProps, ExternalLink, ExternalLinkProps, FooterWithSubfooter, FooterWithSubfooterProps, InternalLink, InternalLinkProps, NavFooter, NavFooterProps, NavHeader, NavHeaderProps, NavTabs, NavTabsProps, Paragraph, ParagraphProps, Stack, StackProps, Switcher, SwitcherProps, Text, TextProps, Title, TitleProps };
327
+ export { Box, BoxProps, ButtonWithAction, ButtonWithActionProps, ButtonWithLink, ButtonWithLinkProps, Card, CardProps, Center, CenterProps, Cluster, ClusterProps, CollapsibleSection, CollapsibleSectionProps, Cover, CoverProps, DefaultPageTemplate, DefaultPageTemplateProps, ExternalLink, ExternalLinkProps, FooterWithSubfooter, FooterWithSubfooterProps, InternalLink, InternalLinkProps, NavFooter, NavFooterProps, NavHeader, NavHeaderProps, NavTabs, NavTabsProps, Paragraph, ParagraphProps, Stack, StackProps, Switcher, SwitcherProps, Text, TextProps, Title, TitleProps };
306
328
  //# sourceMappingURL=index.d.ts.map
package/dist/index.esm.js CHANGED
@@ -35151,67 +35151,78 @@ var CardImage = styled.img.withConfig({
35151
35151
 
35152
35152
  var titleColor = BRIGHT_GREY;
35153
35153
  var titleWeight = FONT_WEIGHT_BOLD;
35154
- var fallbackValues$x = _defineProperty({
35154
+ var textColor$2 = BRIGHT_GREY;
35155
+ var fallbackValues$x = {
35155
35156
  titleColor: titleColor,
35156
- titleWeight: titleWeight
35157
- }, "titleWeight", titleWeight);
35157
+ titleWeight: titleWeight,
35158
+ textColor: textColor$2
35159
+ };
35158
35160
 
35159
35161
  var CardText = function CardText(_ref) {
35160
- var text = _ref.text,
35162
+ var padding = _ref.padding,
35163
+ text = _ref.text,
35161
35164
  titleText = _ref.titleText,
35162
35165
  _ref$titleVariant = _ref.titleVariant,
35163
35166
  titleVariant = _ref$titleVariant === void 0 ? "small" : _ref$titleVariant,
35164
35167
  themeValues = _ref.themeValues;
35165
- return /*#__PURE__*/React.createElement(Cover, null, /*#__PURE__*/React.createElement(Stack, null, titleText && /*#__PURE__*/React.createElement(Title$1, {
35168
+ return /*#__PURE__*/React.createElement(Box, {
35169
+ padding: padding
35170
+ }, /*#__PURE__*/React.createElement(Cover, null, /*#__PURE__*/React.createElement(Stack, null, titleText && /*#__PURE__*/React.createElement(Title$1, {
35171
+ as: "p",
35166
35172
  variant: titleVariant,
35167
35173
  color: themeValues.titleColor,
35168
- weight: themeValues === null || themeValues === void 0 ? void 0 : themeValues.titleWeight
35174
+ weight: themeValues.titleWeight
35169
35175
  }, titleText), /*#__PURE__*/React.createElement(Paragraph$1, {
35170
35176
  color: themeValues.textColor
35171
- }, text)));
35177
+ }, text))));
35172
35178
  };
35173
35179
  var CardText$1 = themeComponent(withWindowSize(CardText), "CardText", fallbackValues$x);
35174
35180
 
35175
35181
  var CardHeader = function CardHeader(_ref) {
35176
- var headerText = _ref.headerText,
35182
+ var backgroundColor = _ref.backgroundColor,
35183
+ borderRadius = _ref.borderRadius,
35184
+ as = _ref.as,
35185
+ headerText = _ref.headerText,
35177
35186
  headerColor = _ref.headerColor,
35178
35187
  headerVariant = _ref.headerVariant,
35179
- backgroundColor = _ref.backgroundColor,
35180
- padding = _ref.padding,
35181
- borderRadius = _ref.borderRadius;
35188
+ padding = _ref.padding;
35182
35189
  return /*#__PURE__*/React.createElement(Box, {
35183
35190
  padding: padding,
35184
35191
  background: backgroundColor,
35185
35192
  borderRadius: "".concat(borderRadius, " ").concat(borderRadius, " 0 0")
35186
35193
  }, /*#__PURE__*/React.createElement(Title$1, {
35194
+ as: as,
35187
35195
  variant: headerVariant,
35188
35196
  color: headerColor
35189
35197
  }, headerText));
35190
35198
  };
35191
35199
 
35192
35200
  var Card = function Card(_ref) {
35193
- var themeValues = _ref.themeValues,
35194
- children = _ref.children,
35201
+ var _ref$borderRadius = _ref.borderRadius,
35202
+ borderRadius = _ref$borderRadius === void 0 ? "4px" : _ref$borderRadius,
35195
35203
  extraStyles = _ref.extraStyles,
35196
- _ref$width = _ref.width,
35197
- width = _ref$width === void 0 ? "276px" : _ref$width,
35198
- text = _ref.text,
35199
- titleText = _ref.titleText,
35200
- _ref$titleVariant = _ref.titleVariant,
35201
- titleVariant = _ref$titleVariant === void 0 ? "small" : _ref$titleVariant,
35204
+ _ref$headerAs = _ref.headerAs,
35205
+ headerAs = _ref$headerAs === void 0 ? "h2" : _ref$headerAs,
35206
+ headerText = _ref.headerText,
35207
+ _ref$headerVariant = _ref.headerVariant,
35208
+ headerVariant = _ref$headerVariant === void 0 ? "small" : _ref$headerVariant,
35202
35209
  imgSrc = _ref.imgSrc,
35203
35210
  _ref$imgHeight = _ref.imgHeight,
35204
35211
  imgHeight = _ref$imgHeight === void 0 ? "150px" : _ref$imgHeight,
35205
35212
  _ref$imgObjectFit = _ref.imgObjectFit,
35206
35213
  imgObjectFit = _ref$imgObjectFit === void 0 ? "none" : _ref$imgObjectFit,
35207
- headerText = _ref.headerText,
35208
- _ref$headerVariant = _ref.headerVariant,
35209
- headerVariant = _ref$headerVariant === void 0 ? "small" : _ref$headerVariant,
35210
- _ref$borderRadius = _ref.borderRadius,
35211
- borderRadius = _ref$borderRadius === void 0 ? "4px" : _ref$borderRadius,
35214
+ imgAltText = _ref.imgAltText,
35212
35215
  _ref$padding = _ref.padding,
35213
- padding = _ref$padding === void 0 ? "24px" : _ref$padding;
35214
- var numberOfChildren = children.length + (imgSrc ? 1 : 0) + (text ? 1 : 0) + (headerText ? 1 : 0);
35216
+ padding = _ref$padding === void 0 ? "24px" : _ref$padding,
35217
+ text = _ref.text,
35218
+ titleText = _ref.titleText,
35219
+ _ref$titleVariant = _ref.titleVariant,
35220
+ titleVariant = _ref$titleVariant === void 0 ? "small" : _ref$titleVariant,
35221
+ themeValues = _ref.themeValues,
35222
+ _ref$width = _ref.width,
35223
+ width = _ref$width === void 0 ? "276px" : _ref$width,
35224
+ children = _ref.children;
35225
+ var numberOfChildren = (Array.isArray(children) ? children.length : 1) + (text ? 1 : 0) + (imgSrc ? 1 : 0) + (headerText ? 1 : 0);
35215
35226
  return /*#__PURE__*/React.createElement(BoxWithShadow$1, {
35216
35227
  variant: "baseStandard",
35217
35228
  background: themeValues.backgroundColor,
@@ -35221,7 +35232,8 @@ var Card = function Card(_ref) {
35221
35232
  minWidth: width,
35222
35233
  extraStyles: extraStyles
35223
35234
  }, /*#__PURE__*/React.createElement(Cover, {
35224
- singleChild: true
35235
+ singleChild: true,
35236
+ fillCenter: true
35225
35237
  }, /*#__PURE__*/React.createElement(Stack, {
35226
35238
  fullHeight: true,
35227
35239
  childGap: "0",
@@ -35232,19 +35244,20 @@ var Card = function Card(_ref) {
35232
35244
  headerVariant: headerVariant,
35233
35245
  backgroundColor: themeValues.headerBackgroundColor,
35234
35246
  borderRadius: borderRadius,
35235
- padding: padding
35247
+ padding: padding,
35248
+ as: headerAs
35236
35249
  }), imgSrc && /*#__PURE__*/React.createElement(CardImage, {
35237
35250
  height: imgHeight,
35238
35251
  objectFit: imgObjectFit,
35239
35252
  backgroundColor: themeValues.imageBackgroundColor,
35240
- src: imgSrc
35241
- }), /*#__PURE__*/React.createElement(Box, {
35242
- padding: padding
35243
- }, text && /*#__PURE__*/React.createElement(CardText$1, {
35253
+ src: imgSrc,
35254
+ alt: imgAltText
35255
+ }), text && /*#__PURE__*/React.createElement(CardText$1, {
35256
+ padding: padding,
35244
35257
  titleText: titleText,
35245
35258
  text: text,
35246
35259
  titleVariant: titleVariant
35247
- }), children))));
35260
+ }), children)));
35248
35261
  };
35249
35262
 
35250
35263
  var Card$1 = themeComponent(withWindowSize(Card), "Card", fallbackValues$w);
@@ -37966,10 +37979,10 @@ ForgotPasswordForm.reducer = reducer$4;
37966
37979
  ForgotPasswordForm.mapStateToProps = mapStateToProps$5;
37967
37980
  ForgotPasswordForm.mapDispatchToProps = mapDispatchToProps$4;
37968
37981
 
37969
- var textColor$2 = "#ffffff";
37982
+ var textColor$3 = "#ffffff";
37970
37983
  var backgroundColor$6 = "#182848";
37971
37984
  var fallbackValues$B = {
37972
- textColor: textColor$2,
37985
+ textColor: textColor$3,
37973
37986
  backgroundColor: backgroundColor$6
37974
37987
  };
37975
37988