@box/blueprint-web 12.124.0 → 12.125.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.
|
@@ -42,6 +42,12 @@ const CollapsibleSectionImpl = /*#__PURE__*/forwardRef((props, forwardedRef) =>
|
|
|
42
42
|
const BorderlessIcon = useMemo(() => collapsibleSectionOpen ? ChevronDown : ChevronRight, [collapsibleSectionOpen]);
|
|
43
43
|
const iconAriaLabel = useMemo(() => collapsibleSectionOpen ? closeSectionButtonAriaLabel : openSectionButtonAriaLabel, [collapsibleSectionOpen, closeSectionButtonAriaLabel, openSectionButtonAriaLabel]);
|
|
44
44
|
const isBorderless = variant === 'borderless';
|
|
45
|
+
const handleKeyDown = useCallback(event => {
|
|
46
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
47
|
+
event.preventDefault();
|
|
48
|
+
onCollapsibleOpenChanged(!collapsibleSectionOpen);
|
|
49
|
+
}
|
|
50
|
+
}, [collapsibleSectionOpen, onCollapsibleOpenChanged]);
|
|
45
51
|
return jsxs(Collapsible.Root, {
|
|
46
52
|
...rest,
|
|
47
53
|
ref: forwardedRef,
|
|
@@ -55,7 +61,9 @@ const CollapsibleSectionImpl = /*#__PURE__*/forwardRef((props, forwardedRef) =>
|
|
|
55
61
|
children: jsxs("div", {
|
|
56
62
|
"aria-label": isBorderless ? iconAriaLabel : undefined,
|
|
57
63
|
className: styles.collapsibleSectionHeader,
|
|
64
|
+
onKeyDown: isBorderless ? handleKeyDown : undefined,
|
|
58
65
|
role: "button",
|
|
66
|
+
tabIndex: isBorderless ? 0 : undefined,
|
|
59
67
|
children: [headerSlot?.props.children, isBorderless ? jsx(BorderlessIcon, {
|
|
60
68
|
"aria-hidden": true,
|
|
61
69
|
className: styles.collapsibleSectionHeaderArrow,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '../index.css';
|
|
2
|
-
var styles = {"collapsibleSection":"bp_collapsible_section_module_collapsibleSection--
|
|
2
|
+
var styles = {"collapsibleSection":"bp_collapsible_section_module_collapsibleSection--cb40a","collapsibleSectionHeader":"bp_collapsible_section_module_collapsibleSectionHeader--cb40a","collapsibleSectionHeaderArrow":"bp_collapsible_section_module_collapsibleSectionHeaderArrow--cb40a","collapsibleSectionContent":"bp_collapsible_section_module_collapsibleSectionContent--cb40a","collapsibleSectionBody":"bp_collapsible_section_module_collapsibleSectionBody--cb40a"};
|
|
3
3
|
|
|
4
4
|
export { styles as default };
|
package/dist/lib-esm/index.css
CHANGED
|
@@ -3125,7 +3125,7 @@
|
|
|
3125
3125
|
.bp_checkbox_module_option--ae591.bp_checkbox_module_disabled--ae591 .bp_checkbox_module_label--ae591{
|
|
3126
3126
|
cursor:default;
|
|
3127
3127
|
}
|
|
3128
|
-
.bp_collapsible_section_module_collapsibleSection--
|
|
3128
|
+
.bp_collapsible_section_module_collapsibleSection--cb40a[data-modern=false]{
|
|
3129
3129
|
--collapsible-section-header-padding:var(--space-5);
|
|
3130
3130
|
--collapsible-section-body-padding:var(--space-5);
|
|
3131
3131
|
--collapsible-section-padding:var(--space-5);
|
|
@@ -3140,7 +3140,7 @@
|
|
|
3140
3140
|
--collapsible-section-header-expanded-border-bottom:var(--border-1) solid var(--border-collapsible-border);
|
|
3141
3141
|
}
|
|
3142
3142
|
|
|
3143
|
-
.bp_collapsible_section_module_collapsibleSection--
|
|
3143
|
+
.bp_collapsible_section_module_collapsibleSection--cb40a[data-modern=true]{
|
|
3144
3144
|
--collapsible-section-header-padding:var(--bp-space-050) var(--bp-space-020);
|
|
3145
3145
|
--collapsible-section-body-padding:var(--bp-space-040) var(--bp-space-050);
|
|
3146
3146
|
--collapsible-section-padding:var(--bp-space-050);
|
|
@@ -3155,7 +3155,7 @@
|
|
|
3155
3155
|
--collapsible-section-header-expanded-border-bottom:none;
|
|
3156
3156
|
}
|
|
3157
3157
|
|
|
3158
|
-
.bp_collapsible_section_module_collapsibleSection--
|
|
3158
|
+
.bp_collapsible_section_module_collapsibleSection--cb40a[data-variant=borderless]{
|
|
3159
3159
|
--collapsible-section-border:none;
|
|
3160
3160
|
--collapsible-section-header-background-color:#0000;
|
|
3161
3161
|
--collapsible-section-content-background-color:#0000;
|
|
@@ -3165,10 +3165,10 @@
|
|
|
3165
3165
|
--collapsible-section-header-expanded-border-bottom:inherit;
|
|
3166
3166
|
}
|
|
3167
3167
|
|
|
3168
|
-
.bp_collapsible_section_module_collapsibleSection--
|
|
3168
|
+
.bp_collapsible_section_module_collapsibleSection--cb40a{
|
|
3169
3169
|
width:100%;
|
|
3170
3170
|
}
|
|
3171
|
-
.bp_collapsible_section_module_collapsibleSectionHeader--
|
|
3171
|
+
.bp_collapsible_section_module_collapsibleSectionHeader--cb40a{
|
|
3172
3172
|
align-items:center;
|
|
3173
3173
|
background:var(--collapsible-section-header-background-color);
|
|
3174
3174
|
border:var(--collapsible-section-border);
|
|
@@ -3185,7 +3185,7 @@
|
|
|
3185
3185
|
user-select:none;
|
|
3186
3186
|
width:100%;
|
|
3187
3187
|
}
|
|
3188
|
-
.bp_collapsible_section_module_collapsibleSectionHeader--
|
|
3188
|
+
.bp_collapsible_section_module_collapsibleSectionHeader--cb40a:focus::before{
|
|
3189
3189
|
border:var(--collapsible-section-outline-width) solid var(--collapsible-section-header-focus-color);
|
|
3190
3190
|
border-radius:var(--collapsible-section-outline-border-radius);
|
|
3191
3191
|
bottom:var(--collapsible-section-outline-offset);
|
|
@@ -3195,31 +3195,53 @@
|
|
|
3195
3195
|
right:var(--collapsible-section-outline-offset);
|
|
3196
3196
|
top:var(--collapsible-section-outline-offset);
|
|
3197
3197
|
}
|
|
3198
|
-
.bp_collapsible_section_module_collapsibleSectionHeader--
|
|
3198
|
+
.bp_collapsible_section_module_collapsibleSectionHeader--cb40a[aria-expanded=true],.bp_collapsible_section_module_collapsibleSectionHeader--cb40a[aria-expanded=true]::before{
|
|
3199
3199
|
border-end-end-radius:0;
|
|
3200
3200
|
border-end-start-radius:0;
|
|
3201
3201
|
}
|
|
3202
|
-
.bp_collapsible_section_module_collapsibleSectionHeader--
|
|
3202
|
+
.bp_collapsible_section_module_collapsibleSectionHeader--cb40a[aria-expanded=true]{
|
|
3203
3203
|
border-bottom:var(--collapsible-section-header-expanded-border-bottom);
|
|
3204
3204
|
padding-block:var(--collapsible-section-header-padding);
|
|
3205
3205
|
}
|
|
3206
|
-
.bp_collapsible_section_module_collapsibleSectionHeaderArrow--
|
|
3206
|
+
.bp_collapsible_section_module_collapsibleSectionHeaderArrow--cb40a{
|
|
3207
3207
|
display:block;
|
|
3208
3208
|
margin-inline-start:var(--collapsible-section-padding);
|
|
3209
3209
|
}
|
|
3210
|
-
.bp_collapsible_section_module_collapsibleSectionHeaderArrow--
|
|
3210
|
+
.bp_collapsible_section_module_collapsibleSectionHeaderArrow--cb40a > svg{
|
|
3211
3211
|
vertical-align:middle;
|
|
3212
3212
|
}
|
|
3213
|
-
.
|
|
3213
|
+
.bp_collapsible_section_module_collapsibleSection--cb40a[data-variant=borderless] .bp_collapsible_section_module_collapsibleSectionHeaderArrow--cb40a{
|
|
3214
|
+
margin-inline-start:var(--bp-space-020);
|
|
3215
|
+
}
|
|
3216
|
+
.bp_collapsible_section_module_collapsibleSection--cb40a[data-variant=borderless] .bp_collapsible_section_module_collapsibleSectionHeader--cb40a{
|
|
3217
|
+
margin-inline-start:calc(var(--collapsible-section-padding)*-1);
|
|
3218
|
+
padding-block:var(--bp-space-030);
|
|
3219
|
+
width:-moz-fit-content;
|
|
3220
|
+
width:fit-content;
|
|
3221
|
+
}
|
|
3222
|
+
.bp_collapsible_section_module_collapsibleSection--cb40a[data-variant=borderless] .bp_collapsible_section_module_collapsibleSectionHeader--cb40a:focus-visible,.bp_collapsible_section_module_collapsibleSection--cb40a[data-variant=borderless] .bp_collapsible_section_module_collapsibleSectionHeader--cb40a:hover{
|
|
3223
|
+
background:var(--bp-surface-cta-surface-tertiary-hover);
|
|
3224
|
+
}
|
|
3225
|
+
.bp_collapsible_section_module_collapsibleSection--cb40a[data-variant=borderless] .bp_collapsible_section_module_collapsibleSectionHeader--cb40a:focus-visible{
|
|
3226
|
+
outline:var(--collapsible-section-outline-width) solid var(--collapsible-section-header-focus-color);
|
|
3227
|
+
outline-offset:var(--collapsible-section-outline-offset);
|
|
3228
|
+
}
|
|
3229
|
+
.bp_collapsible_section_module_collapsibleSection--cb40a[data-variant=borderless] .bp_collapsible_section_module_collapsibleSectionHeader--cb40a:focus::before{
|
|
3230
|
+
display:none;
|
|
3231
|
+
}
|
|
3232
|
+
.bp_collapsible_section_module_collapsibleSection--cb40a[data-variant=borderless] .bp_collapsible_section_module_collapsibleSectionHeader--cb40a[aria-expanded=false],.bp_collapsible_section_module_collapsibleSection--cb40a[data-variant=borderless] .bp_collapsible_section_module_collapsibleSectionHeader--cb40a[aria-expanded=true]{
|
|
3233
|
+
border-radius:var(--collapsible-section-border-radius);
|
|
3234
|
+
}
|
|
3235
|
+
.bp_collapsible_section_module_collapsibleSectionContent--cb40a{
|
|
3214
3236
|
overflow:hidden;
|
|
3215
3237
|
}
|
|
3216
|
-
.bp_collapsible_section_module_collapsibleSectionContent--
|
|
3217
|
-
animation:bp_collapsible_section_module_slideDown--
|
|
3238
|
+
.bp_collapsible_section_module_collapsibleSectionContent--cb40a[data-state=open]{
|
|
3239
|
+
animation:bp_collapsible_section_module_slideDown--cb40a .25s ease-out;
|
|
3218
3240
|
}
|
|
3219
|
-
.bp_collapsible_section_module_collapsibleSectionContent--
|
|
3220
|
-
animation:bp_collapsible_section_module_slideUp--
|
|
3241
|
+
.bp_collapsible_section_module_collapsibleSectionContent--cb40a[data-state=closed]{
|
|
3242
|
+
animation:bp_collapsible_section_module_slideUp--cb40a .25s ease-out;
|
|
3221
3243
|
}
|
|
3222
|
-
.bp_collapsible_section_module_collapsibleSectionBody--
|
|
3244
|
+
.bp_collapsible_section_module_collapsibleSectionBody--cb40a{
|
|
3223
3245
|
align-items:center;
|
|
3224
3246
|
background:var(--collapsible-section-content-background-color);
|
|
3225
3247
|
border:var(--collapsible-section-border);
|
|
@@ -3231,29 +3253,11 @@
|
|
|
3231
3253
|
padding-block:var(--collapsible-section-body-padding);
|
|
3232
3254
|
padding-inline:var(--collapsible-section-padding);
|
|
3233
3255
|
}
|
|
3234
|
-
.bp_collapsible_section_module_collapsibleSection--
|
|
3235
|
-
padding-
|
|
3236
|
-
width:-moz-fit-content;
|
|
3237
|
-
width:fit-content;
|
|
3238
|
-
}
|
|
3239
|
-
.bp_collapsible_section_module_collapsibleSection--b26d9[data-variant=borderless] .bp_collapsible_section_module_collapsibleSectionHeader--b26d9:focus,.bp_collapsible_section_module_collapsibleSection--b26d9[data-variant=borderless] .bp_collapsible_section_module_collapsibleSectionHeader--b26d9:hover{
|
|
3240
|
-
background:var(--bp-surface-cta-surface-tertiary-hover);
|
|
3241
|
-
}
|
|
3242
|
-
.bp_collapsible_section_module_collapsibleSection--b26d9[data-variant=borderless] .bp_collapsible_section_module_collapsibleSectionHeader--b26d9:focus{
|
|
3243
|
-
outline:var(--collapsible-section-outline-width) solid var(--collapsible-section-header-focus-color);
|
|
3244
|
-
outline-offset:var(--collapsible-section-outline-offset);
|
|
3245
|
-
}
|
|
3246
|
-
.bp_collapsible_section_module_collapsibleSection--b26d9[data-variant=borderless] .bp_collapsible_section_module_collapsibleSectionHeader--b26d9:focus::before{
|
|
3247
|
-
display:none;
|
|
3248
|
-
}
|
|
3249
|
-
.bp_collapsible_section_module_collapsibleSection--b26d9[data-variant=borderless] .bp_collapsible_section_module_collapsibleSectionHeader--b26d9[aria-expanded=false],.bp_collapsible_section_module_collapsibleSection--b26d9[data-variant=borderless] .bp_collapsible_section_module_collapsibleSectionHeader--b26d9[aria-expanded=true]{
|
|
3250
|
-
border-radius:var(--collapsible-section-border-radius);
|
|
3251
|
-
}
|
|
3252
|
-
.bp_collapsible_section_module_collapsibleSection--b26d9[data-variant=borderless] .bp_collapsible_section_module_collapsibleSectionHeaderArrow--b26d9{
|
|
3253
|
-
margin-inline-start:var(--bp-space-020);
|
|
3256
|
+
.bp_collapsible_section_module_collapsibleSection--cb40a[data-variant=borderless] .bp_collapsible_section_module_collapsibleSectionBody--cb40a{
|
|
3257
|
+
padding-inline:0;
|
|
3254
3258
|
}
|
|
3255
3259
|
|
|
3256
|
-
@keyframes bp_collapsible_section_module_slideDown--
|
|
3260
|
+
@keyframes bp_collapsible_section_module_slideDown--cb40a{
|
|
3257
3261
|
from{
|
|
3258
3262
|
height:0;
|
|
3259
3263
|
}
|
|
@@ -3261,7 +3265,7 @@
|
|
|
3261
3265
|
height:var(--radix-collapsible-content-height);
|
|
3262
3266
|
}
|
|
3263
3267
|
}
|
|
3264
|
-
@keyframes bp_collapsible_section_module_slideUp--
|
|
3268
|
+
@keyframes bp_collapsible_section_module_slideUp--cb40a{
|
|
3265
3269
|
from{
|
|
3266
3270
|
height:var(--radix-collapsible-content-height);
|
|
3267
3271
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/blueprint-web",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.125.0",
|
|
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.96.
|
|
50
|
+
"@box/blueprint-web-assets": "^4.96.3",
|
|
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.
|
|
80
|
+
"@box/storybook-utils": "^0.16.14",
|
|
81
81
|
"@figma/code-connect": "1.3.12",
|
|
82
82
|
"@types/react": "^18.0.0",
|
|
83
83
|
"@types/react-dom": "^18.0.0",
|