@box/blueprint-web 12.60.1 → 12.61.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,7 @@
1
1
  import { jsx, jsxs } from 'react/jsx-runtime';
2
2
  import { Size1, Size14, Size6, Size4, Size5, Size18 } from '@box/blueprint-web-assets/tokens/tokens';
3
3
  import clsx from 'clsx';
4
+ import { useBlueprintModernization } from '../blueprint-modernization-context/useBlueprintModernization.js';
4
5
  import { Ghost } from '../ghost/ghost.js';
5
6
  import { ContentCardBody } from './content-card-body.js';
6
7
  import { ContentCardFooter } from './content-card-footer.js';
@@ -9,8 +10,12 @@ import { ContentCardTitle } from './content-card-title.js';
9
10
  import styles from './content-card.module.js';
10
11
 
11
12
  const GhostContentCard = () => {
13
+ const {
14
+ enableModernizedComponents
15
+ } = useBlueprintModernization();
12
16
  return jsxs("div", {
13
17
  className: styles.ghostCard,
18
+ "data-modern": enableModernizedComponents,
14
19
  "data-testid": "ghost-content-card",
15
20
  children: [jsx(Ghost, {
16
21
  borderRadius: Size1,
@@ -61,6 +66,9 @@ const ContentCardComponent = ({
61
66
  onSelect,
62
67
  ...rest
63
68
  }) => {
69
+ const {
70
+ enableModernizedComponents
71
+ } = useBlueprintModernization();
64
72
  const handleKeyDown = event => {
65
73
  if (event.key === 'Enter') {
66
74
  onSelect(event);
@@ -72,6 +80,7 @@ const ContentCardComponent = ({
72
80
  return jsx("div", {
73
81
  ...rest,
74
82
  className: clsx(styles.card, className),
83
+ "data-modern": enableModernizedComponents,
75
84
  onClick: onSelect,
76
85
  onKeyDown: handleKeyDown,
77
86
  role: "link",
@@ -1,4 +1,4 @@
1
1
  import '../index.css';
2
- var styles = {"card":"bp_content_card_module_card--adb8d","cardContent":"bp_content_card_module_cardContent--adb8d","cardTitle":"bp_content_card_module_cardTitle--adb8d","cardTitleText":"bp_content_card_module_cardTitleText--adb8d","cardBody":"bp_content_card_module_cardBody--adb8d","cardBodyText":"bp_content_card_module_cardBodyText--adb8d","cardIcon":"bp_content_card_module_cardIcon--adb8d","cardBackground":"bp_content_card_module_cardBackground--adb8d","image":"bp_content_card_module_image--adb8d","ghostCard":"bp_content_card_module_ghostCard--adb8d","iconGhost":"bp_content_card_module_iconGhost--adb8d","titleGhost":"bp_content_card_module_titleGhost--adb8d","bodyGhost":"bp_content_card_module_bodyGhost--adb8d","pillGhostContainer":"bp_content_card_module_pillGhostContainer--adb8d","pillGhost":"bp_content_card_module_pillGhost--adb8d"};
2
+ var styles = {"card":"bp_content_card_module_card--cb1ea","ghostCard":"bp_content_card_module_ghostCard--cb1ea","cardContent":"bp_content_card_module_cardContent--cb1ea","cardTitle":"bp_content_card_module_cardTitle--cb1ea","cardTitleText":"bp_content_card_module_cardTitleText--cb1ea","cardBody":"bp_content_card_module_cardBody--cb1ea","cardBodyText":"bp_content_card_module_cardBodyText--cb1ea","cardIcon":"bp_content_card_module_cardIcon--cb1ea","cardBackground":"bp_content_card_module_cardBackground--cb1ea","image":"bp_content_card_module_image--cb1ea","iconGhost":"bp_content_card_module_iconGhost--cb1ea","titleGhost":"bp_content_card_module_titleGhost--cb1ea","bodyGhost":"bp_content_card_module_bodyGhost--cb1ea","pillGhostContainer":"bp_content_card_module_pillGhostContainer--cb1ea","pillGhost":"bp_content_card_module_pillGhost--cb1ea"};
3
3
 
4
4
  export { styles as default };
@@ -26,7 +26,9 @@ const EllipsizableText = /*#__PURE__*/forwardRef(({
26
26
  display: '-webkit-box',
27
27
  overflow: 'hidden',
28
28
  WebkitBoxOrient: 'vertical',
29
- WebkitLineClamp: lineClamp.toString()
29
+ WebkitLineClamp: lineClamp.toString(),
30
+ whiteSpace: lineClamp === 1 ? 'nowrap' : 'normal',
31
+ textOverflow: 'ellipsis'
30
32
  },
31
33
  children: children
32
34
  })
@@ -3275,80 +3275,124 @@
3275
3275
  margin-block:var(--select-content-viewport-option-separator-margin-block);
3276
3276
  }
3277
3277
 
3278
- .bp_content_card_module_card--adb8d{
3279
- background-color:var(--surface-surface);
3280
- border:var(--border-1) solid var(--border-card-border);
3281
- border-radius:var(--size-3);
3278
+ .bp_content_card_module_card--cb1ea[data-modern=false],.bp_content_card_module_ghostCard--cb1ea[data-modern=false]{
3279
+ --content-card-background-color:var(--surface-surface);
3280
+ --content-card-background-height:var(--size-15);
3281
+ --content-card-border-radius:var(--size-3);
3282
+ --content-card-border-size:var(--border-1);
3283
+ --content-card-content-gap:var(--size-2);
3284
+ --content-card-dropshadow:var(--dropshadow-3);
3285
+ --content-card-focused-border-color:var(--outline-focus-on-light);
3286
+ --content-card-focused-border-size:var(--border-2);
3287
+ --content-card-icon-border-size:var(--size-1);
3288
+ --content-card-icon-position:var(--size-3);
3289
+ --content-card-icon-size:var(--size-14);
3290
+ --content-card-max-width:27.8125rem;
3291
+ --content-card-min-width:13.75rem;
3292
+ --content-card-padding:var(--size-4);
3293
+ --content-card-pressed-background-color:var(--surface-card-surface-pressed);
3294
+ --content-card-text-height:var(--size-12);
3295
+ --content-card-border:var(--border-1) solid var(--border-card-border);
3296
+ --content-card-focused-border:var(--border-2) solid var(--outline-focus-on-light);
3297
+ --content-card-pressed-border:var(--border-1) solid var(--border-card-border);
3298
+ }
3299
+
3300
+ .bp_content_card_module_card--cb1ea[data-modern=true],.bp_content_card_module_ghostCard--cb1ea[data-modern=true]{
3301
+ --content-card-background-color:var(--bp-surface-card-surface);
3302
+ --content-card-background-height:var(--bp-size-150);
3303
+ --content-card-border-radius:var(--bp-radius-10);
3304
+ --content-card-border-size:var(--bp-border-01);
3305
+ --content-card-content-gap:var(--bp-space-020);
3306
+ --content-card-dropshadow:var(--dropshadow-3);
3307
+ --content-card-focused-border-color:var(--bp-outline-focus-on-light);
3308
+ --content-card-focused-border-size:var(--bp-border-02);
3309
+ --content-card-icon-border-size:var(--bp-size-010);
3310
+ --content-card-icon-position:var(--bp-size-030);
3311
+ --content-card-icon-size:var(--bp-size-140);
3312
+ --content-card-max-width:27.8125rem;
3313
+ --content-card-min-width:13.75rem;
3314
+ --content-card-padding:var(--bp-space-040);
3315
+ --content-card-pressed-background-color:var(--bp-surface-card-surface-pressed);
3316
+ --content-card-text-height:var(--bp-size-120);
3317
+ --content-card-border:var(--bp-border-01) solid var(--bp-border-card-border);
3318
+ --content-card-focused-border:var(--bp-border-02) solid var(--bp-outline-focus-on-light);
3319
+ --content-card-pressed-border:var(--bp-border-01) solid var(--bp-border-card-border);
3320
+ }
3321
+
3322
+ .bp_content_card_module_card--cb1ea{
3323
+ background-color:var(--content-card-background-color);
3324
+ border:var(--content-card-border);
3325
+ border-radius:var(--content-card-border-radius);
3282
3326
  cursor:pointer;
3283
- max-width:calc(27.8125rem - var(--size-4) - var(--border-1));
3284
- min-width:calc(13.75rem - var(--size-4) - var(--border-1));
3327
+ max-width:calc(var(--content-card-max-width) - var(--content-card-padding) - var(--content-card-border-size));
3328
+ min-width:calc(var(--content-card-min-width) - var(--content-card-padding) - var(--content-card-border-size));
3285
3329
  overflow:hidden;
3286
- padding:var(--size-4);
3330
+ padding:var(--content-card-padding);
3287
3331
  position:relative;
3288
3332
  }
3289
- .bp_content_card_module_card--adb8d:hover{
3290
- box-shadow:var(--dropshadow-3);
3333
+ .bp_content_card_module_card--cb1ea:hover{
3334
+ box-shadow:var(--content-card-dropshadow);
3291
3335
  }
3292
- .bp_content_card_module_card--adb8d:focus-visible{
3293
- border:var(--border-2) solid var(--outline-focus-on-light);
3294
- box-shadow:var(--dropshadow-3);
3336
+ .bp_content_card_module_card--cb1ea:focus-visible{
3337
+ border:var(--content-card-focused-border);
3338
+ box-shadow:var(--content-card-dropshadow);
3295
3339
  outline:none;
3296
3340
  }
3297
- .bp_content_card_module_card--adb8d:active{
3298
- background-color:var(--surface-card-surface-pressed);
3299
- border:var(--border-1) solid var(--border-card-border);
3341
+ .bp_content_card_module_card--cb1ea:active{
3342
+ background-color:var(--content-card-pressed-background-color);
3343
+ border:var(--content-card-pressed-border);
3300
3344
  box-shadow:none;
3301
3345
  }
3302
3346
 
3303
- .bp_content_card_module_cardContent--adb8d{
3347
+ .bp_content_card_module_cardContent--cb1ea{
3304
3348
  display:flex;
3305
3349
  flex-direction:column;
3306
- gap:var(--size-2);
3350
+ gap:var(--content-card-content-gap);
3307
3351
  height:100%;
3308
3352
  justify-content:space-between;
3309
- padding-block-start:calc(var(--size-14) + var(--size-2) + var(--size-1));
3353
+ padding-block-start:calc(var(--content-card-icon-size) + var(--content-card-content-gap) + var(--content-card-icon-border-size));
3310
3354
  }
3311
3355
 
3312
- .bp_content_card_module_cardTitle--adb8d{
3356
+ .bp_content_card_module_cardTitle--cb1ea{
3313
3357
  align-items:center;
3314
3358
  display:flex;
3315
- height:var(--size-12);
3359
+ height:var(--content-card-text-height);
3316
3360
  }
3317
3361
 
3318
- .bp_content_card_module_cardTitleText--adb8d{
3362
+ .bp_content_card_module_cardTitleText--cb1ea{
3319
3363
  -webkit-box-orient:vertical;
3320
3364
  -webkit-line-clamp:2;
3321
3365
  display:-webkit-inline-box;
3322
3366
  overflow:hidden;
3323
3367
  }
3324
3368
 
3325
- .bp_content_card_module_cardBody--adb8d{
3326
- height:var(--size-12);
3327
- margin-block-end:var(--size-2);
3369
+ .bp_content_card_module_cardBody--cb1ea{
3370
+ height:var(--content-card-text-height);
3371
+ margin-block-end:var(--content-card-content-gap);
3328
3372
  }
3329
3373
 
3330
- .bp_content_card_module_cardBodyText--adb8d{
3374
+ .bp_content_card_module_cardBodyText--cb1ea{
3331
3375
  -webkit-box-orient:vertical;
3332
3376
  -webkit-line-clamp:2;
3333
3377
  display:-webkit-inline-box;
3334
3378
  overflow:hidden;
3335
3379
  }
3336
3380
 
3337
- .bp_content_card_module_cardIcon--adb8d{
3338
- background-color:var(--surface-surface);
3339
- border:var(--size-1) solid var(--surface-surface);
3340
- border-radius:var(--size-3);
3341
- height:var(--size-14);
3342
- left:var(--size-3);
3381
+ .bp_content_card_module_cardIcon--cb1ea{
3382
+ background-color:var(--content-card-background-color);
3383
+ border:var(--content-card-icon-border-size) solid var(--content-card-background-color);
3384
+ border-radius:var(--content-card-border-radius);
3385
+ height:var(--content-card-icon-size);
3386
+ left:var(--content-card-icon-position);
3343
3387
  overflow:hidden;
3344
3388
  position:absolute;
3345
- top:var(--size-3);
3346
- width:var(--size-14);
3389
+ top:var(--content-card-icon-position);
3390
+ width:var(--content-card-icon-size);
3347
3391
  z-index:1;
3348
3392
  }
3349
3393
 
3350
- .bp_content_card_module_cardBackground--adb8d{
3351
- height:var(--size-15);
3394
+ .bp_content_card_module_cardBackground--cb1ea{
3395
+ height:var(--content-card-background-height);
3352
3396
  left:0;
3353
3397
  overflow:hidden;
3354
3398
  position:absolute;
@@ -3356,36 +3400,36 @@
3356
3400
  width:100%;
3357
3401
  }
3358
3402
 
3359
- .bp_content_card_module_image--adb8d{
3403
+ .bp_content_card_module_image--cb1ea{
3360
3404
  height:100%;
3361
3405
  width:100%;
3362
3406
  }
3363
3407
 
3364
- .bp_content_card_module_ghostCard--adb8d{
3408
+ .bp_content_card_module_ghostCard--cb1ea{
3365
3409
  display:flex;
3366
3410
  flex-direction:column;
3367
- max-width:calc(27.8125rem - var(--size-4));
3368
- min-width:calc(13.75rem - var(--size-4));
3369
- padding:var(--size-4);
3411
+ max-width:calc(var(--content-card-max-width) - var(--content-card-padding));
3412
+ min-width:calc(var(--content-card-min-width) - var(--content-card-padding));
3413
+ padding:var(--content-card-padding);
3370
3414
  position:relative;
3371
3415
  }
3372
3416
 
3373
- .bp_content_card_module_iconGhost--adb8d,.bp_content_card_module_titleGhost--adb8d{
3374
- margin-block-end:var(--size-4);
3417
+ .bp_content_card_module_iconGhost--cb1ea,.bp_content_card_module_titleGhost--cb1ea{
3418
+ margin-block-end:var(--content-card-padding);
3375
3419
  }
3376
3420
 
3377
- .bp_content_card_module_bodyGhost--adb8d{
3378
- margin-block-end:var(--size-2);
3421
+ .bp_content_card_module_bodyGhost--cb1ea{
3422
+ margin-block-end:var(--content-card-content-gap);
3379
3423
  }
3380
3424
 
3381
- .bp_content_card_module_pillGhostContainer--adb8d{
3425
+ .bp_content_card_module_pillGhostContainer--cb1ea{
3382
3426
  display:flex;
3383
- margin-block-end:var(--size-4);
3384
- margin-block-start:var(--size-2);
3427
+ margin-block-end:var(--content-card-padding);
3428
+ margin-block-start:var(--content-card-content-gap);
3385
3429
  }
3386
3430
 
3387
- .bp_content_card_module_pillGhost--adb8d{
3388
- margin-inline-end:var(--size-2);
3431
+ .bp_content_card_module_pillGhost--cb1ea{
3432
+ margin-inline-end:var(--content-card-content-gap);
3389
3433
  }
3390
3434
  .bp_content_field_module_contentFieldWrapper--dabac{
3391
3435
  width:100%;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/blueprint-web",
3
- "version": "12.60.1",
3
+ "version": "12.61.0",
4
4
  "type": "module",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "publishConfig": {