@box/blueprint-web 13.6.0 → 13.6.1

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,5 +1,5 @@
1
1
  import { type CollapsibleSectionProps } from './types';
2
- type CollapsibleSectionSlotName = 'header' | 'content';
2
+ type CollapsibleSectionSlotName = 'header' | 'content' | 'action';
3
3
  export declare const CollapsibleSection: import("react").ForwardRefExoticComponent<Omit<CollapsibleSectionProps, "ref"> & import("react").RefAttributes<HTMLDivElement>> & {
4
4
  Slot: (props: {
5
5
  name: CollapsibleSectionSlotName;
@@ -26,7 +26,7 @@ const CollapsibleSectionImpl = /*#__PURE__*/forwardRef((props, forwardedRef) =>
26
26
  enableModernizedComponents
27
27
  } = useBlueprintModernization();
28
28
  const [collapsibleSectionOpen, setCollapsibleSectionOpen] = useState(open);
29
- const [headerSlot, contentSlot] = useNamedSlots(children, ['header', 'content']);
29
+ const [headerSlot, contentSlot, actionSlot] = useNamedSlots(children, ['header', 'content', 'action']);
30
30
  useEffect(() => {
31
31
  setCollapsibleSectionOpen(open);
32
32
  }, [open]);
@@ -56,20 +56,30 @@ const CollapsibleSectionImpl = /*#__PURE__*/forwardRef((props, forwardedRef) =>
56
56
  "data-variant": variant,
57
57
  onOpenChange: onCollapsibleOpenChanged,
58
58
  open: collapsibleSectionOpen,
59
- children: [jsx(Collapsible.Trigger, {
59
+ children: [isBorderless ? jsxs("div", {
60
+ className: styles.collapsibleSectionHeaderRow,
61
+ children: [jsx(Collapsible.Trigger, {
62
+ asChild: true,
63
+ children: jsxs("div", {
64
+ "aria-label": iconAriaLabel,
65
+ className: styles.collapsibleSectionHeader,
66
+ onKeyDown: handleKeyDown,
67
+ role: "button",
68
+ tabIndex: 0,
69
+ children: [headerSlot?.props.children, jsx(BorderlessIcon, {
70
+ "aria-hidden": true,
71
+ className: styles.collapsibleSectionHeaderArrow,
72
+ height: Size4,
73
+ width: Size4
74
+ })]
75
+ })
76
+ }), collapsibleSectionOpen && actionSlot?.props.children]
77
+ }) : jsx(Collapsible.Trigger, {
60
78
  asChild: true,
61
79
  children: jsxs("div", {
62
- "aria-label": isBorderless ? iconAriaLabel : undefined,
63
80
  className: styles.collapsibleSectionHeader,
64
- onKeyDown: isBorderless ? handleKeyDown : undefined,
65
81
  role: "button",
66
- tabIndex: isBorderless ? 0 : undefined,
67
- children: [headerSlot?.props.children, isBorderless ? jsx(BorderlessIcon, {
68
- "aria-hidden": true,
69
- className: styles.collapsibleSectionHeaderArrow,
70
- height: Size4,
71
- width: Size4
72
- }) : jsx(IconButton, {
82
+ children: [headerSlot?.props.children, jsx(IconButton, {
73
83
  "aria-label": iconAriaLabel,
74
84
  className: styles.collapsibleSectionHeaderArrow,
75
85
  icon: collapsibleSectionOpen ? icon.up : icon.down,
@@ -1,4 +1,4 @@
1
1
  import '../index.css';
2
- var styles = {"collapsibleSection":"bp_collapsible_section_module_collapsibleSection--acc50","collapsibleSectionHeader":"bp_collapsible_section_module_collapsibleSectionHeader--acc50","collapsibleSectionHeaderArrow":"bp_collapsible_section_module_collapsibleSectionHeaderArrow--acc50","collapsibleSectionContent":"bp_collapsible_section_module_collapsibleSectionContent--acc50","collapsibleSectionBody":"bp_collapsible_section_module_collapsibleSectionBody--acc50"};
2
+ var styles = {"collapsibleSection":"bp_collapsible_section_module_collapsibleSection--8d19b","collapsibleSectionHeaderRow":"bp_collapsible_section_module_collapsibleSectionHeaderRow--8d19b","collapsibleSectionHeader":"bp_collapsible_section_module_collapsibleSectionHeader--8d19b","collapsibleSectionHeaderArrow":"bp_collapsible_section_module_collapsibleSectionHeaderArrow--8d19b","collapsibleSectionContent":"bp_collapsible_section_module_collapsibleSectionContent--8d19b","collapsibleSectionBody":"bp_collapsible_section_module_collapsibleSectionBody--8d19b"};
3
3
 
4
4
  export { styles as default };
@@ -12,7 +12,8 @@ export type CollapsibleSectionProps = RadixCollapsibleSectionProps & React.Compo
12
12
  /**
13
13
  * Visual variant of the collapsible section
14
14
  * - default: Full width with border and background
15
- * - borderless: No border, header fits content width
15
+ * - borderless: No border, header fits content width. Supports an optional
16
+ * "action" slot rendered beside the header, visible only when the section is open.
16
17
  * @default 'default'
17
18
  */
18
19
  variant?: CollapsibleSectionVariant;
@@ -3254,7 +3254,7 @@
3254
3254
  transition:none;
3255
3255
  }
3256
3256
  }
3257
- .bp_collapsible_section_module_collapsibleSection--acc50[data-modern=false]{
3257
+ .bp_collapsible_section_module_collapsibleSection--8d19b[data-modern=false]{
3258
3258
  --collapsible-section-header-padding:var(--space-5);
3259
3259
  --collapsible-section-body-padding:var(--space-5);
3260
3260
  --collapsible-section-padding:var(--space-5);
@@ -3269,7 +3269,7 @@
3269
3269
  --collapsible-section-header-expanded-border-bottom:var(--border-1) solid var(--border-collapsible-border);
3270
3270
  }
3271
3271
 
3272
- .bp_collapsible_section_module_collapsibleSection--acc50[data-modern=true]{
3272
+ .bp_collapsible_section_module_collapsibleSection--8d19b[data-modern=true]{
3273
3273
  --collapsible-section-header-padding:var(--bp-space-050) var(--bp-space-020);
3274
3274
  --collapsible-section-body-padding:var(--bp-space-040) var(--bp-space-050);
3275
3275
  --collapsible-section-padding:var(--bp-space-050);
@@ -3284,7 +3284,7 @@
3284
3284
  --collapsible-section-header-expanded-border-bottom:none;
3285
3285
  }
3286
3286
 
3287
- .bp_collapsible_section_module_collapsibleSection--acc50[data-modern=false][data-variant=borderless]{
3287
+ .bp_collapsible_section_module_collapsibleSection--8d19b[data-modern=false][data-variant=borderless]{
3288
3288
  --collapsible-section-border:none;
3289
3289
  --collapsible-section-header-background-color:#0000;
3290
3290
  --collapsible-section-content-background-color:#0000;
@@ -3298,7 +3298,7 @@
3298
3298
  --collapsible-section-borderless-header-hover-background:var(--surface-cta-surface-tertiary-hover);
3299
3299
  }
3300
3300
 
3301
- .bp_collapsible_section_module_collapsibleSection--acc50[data-modern=true][data-variant=borderless]{
3301
+ .bp_collapsible_section_module_collapsibleSection--8d19b[data-modern=true][data-variant=borderless]{
3302
3302
  --collapsible-section-border:none;
3303
3303
  --collapsible-section-header-background-color:#0000;
3304
3304
  --collapsible-section-content-background-color:#0000;
@@ -3312,81 +3312,83 @@
3312
3312
  --collapsible-section-borderless-header-hover-background:var(--bp-surface-cta-surface-tertiary-hover);
3313
3313
  }
3314
3314
 
3315
- .bp_collapsible_section_module_collapsibleSection--acc50{
3315
+ .bp_collapsible_section_module_collapsibleSection--8d19b{
3316
3316
  width:100%;
3317
3317
  }
3318
- .bp_collapsible_section_module_collapsibleSectionHeader--acc50{
3318
+ .bp_collapsible_section_module_collapsibleSectionHeader--8d19b,.bp_collapsible_section_module_collapsibleSectionHeaderRow--8d19b{
3319
3319
  align-items:center;
3320
+ display:flex;
3321
+ justify-content:space-between;
3322
+ width:100%;
3323
+ }
3324
+ .bp_collapsible_section_module_collapsibleSectionHeader--8d19b{
3320
3325
  background:var(--collapsible-section-header-background-color);
3321
3326
  border:var(--collapsible-section-border);
3322
3327
  border-radius:var(--collapsible-section-border-radius);
3323
3328
  box-sizing:border-box;
3324
3329
  cursor:pointer;
3325
- display:flex;
3326
- justify-content:space-between;
3327
3330
  outline:0;
3328
3331
  padding-block:var(--collapsible-section-padding);
3329
3332
  padding-inline:var(--collapsible-section-padding);
3330
3333
  position:relative;
3331
3334
  -webkit-user-select:none;
3332
3335
  user-select:none;
3333
- width:100%;
3334
3336
  }
3335
- .bp_collapsible_section_module_collapsibleSectionHeader--acc50:focus::before{
3337
+ .bp_collapsible_section_module_collapsibleSectionHeader--8d19b:focus::before{
3336
3338
  border:var(--collapsible-section-outline-width) solid var(--collapsible-section-header-focus-color);
3337
3339
  border-radius:var(--collapsible-section-outline-border-radius);
3338
3340
  content:"";
3339
3341
  inset:var(--collapsible-section-outline-offset);
3340
3342
  position:absolute;
3341
3343
  }
3342
- .bp_collapsible_section_module_collapsibleSectionHeader--acc50[aria-expanded=true],.bp_collapsible_section_module_collapsibleSectionHeader--acc50[aria-expanded=true]::before{
3344
+ .bp_collapsible_section_module_collapsibleSectionHeader--8d19b[aria-expanded=true],.bp_collapsible_section_module_collapsibleSectionHeader--8d19b[aria-expanded=true]::before{
3343
3345
  border-end-end-radius:0;
3344
3346
  border-end-start-radius:0;
3345
3347
  }
3346
- .bp_collapsible_section_module_collapsibleSectionHeader--acc50[aria-expanded=true]{
3348
+ .bp_collapsible_section_module_collapsibleSectionHeader--8d19b[aria-expanded=true]{
3347
3349
  border-bottom:var(--collapsible-section-header-expanded-border-bottom);
3348
3350
  padding-block:var(--collapsible-section-header-padding);
3349
3351
  }
3350
- .bp_collapsible_section_module_collapsibleSectionHeaderArrow--acc50{
3352
+ .bp_collapsible_section_module_collapsibleSectionHeaderArrow--8d19b{
3351
3353
  display:block;
3352
3354
  margin-inline-start:var(--collapsible-section-padding);
3353
3355
  }
3354
- .bp_collapsible_section_module_collapsibleSectionHeaderArrow--acc50 > svg{
3356
+ .bp_collapsible_section_module_collapsibleSectionHeaderArrow--8d19b > svg{
3355
3357
  vertical-align:middle;
3356
3358
  }
3357
- .bp_collapsible_section_module_collapsibleSection--acc50[data-variant=borderless] .bp_collapsible_section_module_collapsibleSectionHeaderArrow--acc50{
3359
+ .bp_collapsible_section_module_collapsibleSection--8d19b[data-variant=borderless] .bp_collapsible_section_module_collapsibleSectionHeaderArrow--8d19b{
3358
3360
  margin-inline-start:var(--collapsible-section-borderless-arrow-margin);
3359
3361
  }
3360
- .bp_collapsible_section_module_collapsibleSection--acc50[data-variant=borderless] .bp_collapsible_section_module_collapsibleSectionHeader--acc50{
3362
+ .bp_collapsible_section_module_collapsibleSection--8d19b[data-variant=borderless] .bp_collapsible_section_module_collapsibleSectionHeader--8d19b{
3361
3363
  margin-inline-start:calc(var(--collapsible-section-padding)*-1);
3362
3364
  padding-block:var(--collapsible-section-borderless-header-padding-block);
3363
3365
  padding-inline:var(--collapsible-section-borderless-header-padding-inline-start) .875rem;
3364
3366
  width:-moz-fit-content;
3365
3367
  width:fit-content;
3366
3368
  }
3367
- .bp_collapsible_section_module_collapsibleSection--acc50[data-variant=borderless] .bp_collapsible_section_module_collapsibleSectionHeader--acc50:focus-visible,.bp_collapsible_section_module_collapsibleSection--acc50[data-variant=borderless] .bp_collapsible_section_module_collapsibleSectionHeader--acc50:hover{
3369
+ .bp_collapsible_section_module_collapsibleSection--8d19b[data-variant=borderless] .bp_collapsible_section_module_collapsibleSectionHeader--8d19b:focus-visible,.bp_collapsible_section_module_collapsibleSection--8d19b[data-variant=borderless] .bp_collapsible_section_module_collapsibleSectionHeader--8d19b:hover{
3368
3370
  background:var(--collapsible-section-borderless-header-hover-background);
3369
3371
  }
3370
- .bp_collapsible_section_module_collapsibleSection--acc50[data-variant=borderless] .bp_collapsible_section_module_collapsibleSectionHeader--acc50:focus-visible{
3372
+ .bp_collapsible_section_module_collapsibleSection--8d19b[data-variant=borderless] .bp_collapsible_section_module_collapsibleSectionHeader--8d19b:focus-visible{
3371
3373
  outline:var(--collapsible-section-outline-width) solid var(--collapsible-section-header-focus-color);
3372
3374
  outline-offset:var(--collapsible-section-outline-offset);
3373
3375
  }
3374
- .bp_collapsible_section_module_collapsibleSection--acc50[data-variant=borderless] .bp_collapsible_section_module_collapsibleSectionHeader--acc50:focus::before{
3376
+ .bp_collapsible_section_module_collapsibleSection--8d19b[data-variant=borderless] .bp_collapsible_section_module_collapsibleSectionHeader--8d19b:focus::before{
3375
3377
  display:none;
3376
3378
  }
3377
- .bp_collapsible_section_module_collapsibleSection--acc50[data-variant=borderless] .bp_collapsible_section_module_collapsibleSectionHeader--acc50[aria-expanded=false],.bp_collapsible_section_module_collapsibleSection--acc50[data-variant=borderless] .bp_collapsible_section_module_collapsibleSectionHeader--acc50[aria-expanded=true]{
3379
+ .bp_collapsible_section_module_collapsibleSection--8d19b[data-variant=borderless] .bp_collapsible_section_module_collapsibleSectionHeader--8d19b[aria-expanded=false],.bp_collapsible_section_module_collapsibleSection--8d19b[data-variant=borderless] .bp_collapsible_section_module_collapsibleSectionHeader--8d19b[aria-expanded=true]{
3378
3380
  border-radius:var(--collapsible-section-border-radius);
3379
3381
  }
3380
- .bp_collapsible_section_module_collapsibleSectionContent--acc50{
3382
+ .bp_collapsible_section_module_collapsibleSectionContent--8d19b{
3381
3383
  overflow:hidden;
3382
3384
  }
3383
- .bp_collapsible_section_module_collapsibleSectionContent--acc50[data-state=open]{
3384
- animation:bp_collapsible_section_module_slideDown--acc50 .25s ease-out;
3385
+ .bp_collapsible_section_module_collapsibleSectionContent--8d19b[data-state=open]{
3386
+ animation:bp_collapsible_section_module_slideDown--8d19b .25s ease-out;
3385
3387
  }
3386
- .bp_collapsible_section_module_collapsibleSectionContent--acc50[data-state=closed]{
3387
- animation:bp_collapsible_section_module_slideUp--acc50 .25s ease-out;
3388
+ .bp_collapsible_section_module_collapsibleSectionContent--8d19b[data-state=closed]{
3389
+ animation:bp_collapsible_section_module_slideUp--8d19b .25s ease-out;
3388
3390
  }
3389
- .bp_collapsible_section_module_collapsibleSectionBody--acc50{
3391
+ .bp_collapsible_section_module_collapsibleSectionBody--8d19b{
3390
3392
  align-items:center;
3391
3393
  background:var(--collapsible-section-content-background-color);
3392
3394
  border:var(--collapsible-section-border);
@@ -3398,11 +3400,11 @@
3398
3400
  padding-block:var(--collapsible-section-body-padding);
3399
3401
  padding-inline:var(--collapsible-section-padding);
3400
3402
  }
3401
- .bp_collapsible_section_module_collapsibleSection--acc50[data-variant=borderless] .bp_collapsible_section_module_collapsibleSectionBody--acc50{
3403
+ .bp_collapsible_section_module_collapsibleSection--8d19b[data-variant=borderless] .bp_collapsible_section_module_collapsibleSectionBody--8d19b{
3402
3404
  padding-inline:0;
3403
3405
  }
3404
3406
 
3405
- @keyframes bp_collapsible_section_module_slideDown--acc50{
3407
+ @keyframes bp_collapsible_section_module_slideDown--8d19b{
3406
3408
  from{
3407
3409
  height:0;
3408
3410
  }
@@ -3410,7 +3412,7 @@
3410
3412
  height:var(--radix-collapsible-content-height);
3411
3413
  }
3412
3414
  }
3413
- @keyframes bp_collapsible_section_module_slideUp--acc50{
3415
+ @keyframes bp_collapsible_section_module_slideUp--8d19b{
3414
3416
  from{
3415
3417
  height:var(--radix-collapsible-content-height);
3416
3418
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/blueprint-web",
3
- "version": "13.6.0",
3
+ "version": "13.6.1",
4
4
  "type": "module",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "publishConfig": {
@@ -47,7 +47,7 @@
47
47
  "dependencies": {
48
48
  "@ariakit/react": "0.4.15",
49
49
  "@ariakit/react-core": "0.4.15",
50
- "@box/blueprint-web-assets": "^4.104.9",
50
+ "@box/blueprint-web-assets": "^4.104.10",
51
51
  "@internationalized/date": "^3.7.0",
52
52
  "@radix-ui/react-accordion": "1.1.2",
53
53
  "@radix-ui/react-checkbox": "1.0.4",
@@ -77,7 +77,7 @@
77
77
  "type-fest": "^3.2.0"
78
78
  },
79
79
  "devDependencies": {
80
- "@box/storybook-utils": "^0.16.70",
80
+ "@box/storybook-utils": "^0.16.71",
81
81
  "@figma/code-connect": "1.3.12",
82
82
  "@types/react": "^18.0.0",
83
83
  "@types/react-dom": "^18.0.0",