@box/blueprint-web 7.36.3 → 8.1.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.
- package/lib-esm/index.css +37 -33
- package/lib-esm/modal/modal-scrollable-container.js +15 -5
- package/lib-esm/page/index.d.ts +10 -1
- package/lib-esm/page/page-global-header-search-container.d.ts +2 -0
- package/lib-esm/page/page-global-header-side-content-container.d.ts +2 -0
- package/lib-esm/page/page-global-header.d.ts +10 -0
- package/lib-esm/primitives/chips/chip.module.js +1 -1
- package/lib-esm/side-panel/side-panel-content.js +1 -1
- package/lib-esm/side-panel/side-panel-trigger.d.ts +6 -0
- package/lib-esm/side-panel/side-panel-trigger.js +18 -0
- package/lib-esm/side-panel/side-panel.d.ts +2 -1
- package/lib-esm/side-panel/side-panel.js +3 -1
- package/lib-esm/side-panel/types.d.ts +4 -1
- package/lib-esm/text/text.js +1 -0
- package/lib-esm/utils/createSetRefWithCallback.d.ts +10 -2
- package/lib-esm/utils/scroll-context.d.ts +1 -0
- package/lib-esm/utils/scroll-context.js +11 -3
- package/package.json +2 -2
package/lib-esm/index.css
CHANGED
|
@@ -4081,7 +4081,7 @@ table.bp_inline_table_module_inlineTable--b023b tr:not(:last-child) td{
|
|
|
4081
4081
|
.bp_base_text_input_module_inlineError--4b0e7{
|
|
4082
4082
|
margin-block-start:var(--space-2);
|
|
4083
4083
|
}
|
|
4084
|
-
.bp_chip_module_chip--
|
|
4084
|
+
.bp_chip_module_chip--d387b{
|
|
4085
4085
|
align-items:center;
|
|
4086
4086
|
border:none;
|
|
4087
4087
|
border-radius:var(--radius-half);
|
|
@@ -4098,19 +4098,23 @@ table.bp_inline_table_module_inlineTable--b023b tr:not(:last-child) td{
|
|
|
4098
4098
|
text-decoration:none;
|
|
4099
4099
|
text-transform:none;
|
|
4100
4100
|
}
|
|
4101
|
-
.bp_chip_module_chip--
|
|
4101
|
+
.bp_chip_module_chip--d387b .bp_chip_module_labelText--d387b:first-child{
|
|
4102
4102
|
margin-inline-start:var(--space-4);
|
|
4103
4103
|
}
|
|
4104
|
-
.bp_chip_module_chip--
|
|
4104
|
+
.bp_chip_module_chip--d387b .bp_chip_module_labelText--d387b:last-child{
|
|
4105
4105
|
margin-inline-end:var(--space-4);
|
|
4106
4106
|
}
|
|
4107
|
-
.bp_chip_module_chip--
|
|
4107
|
+
.bp_chip_module_chip--d387b .bp_chip_module_chipStatus--d387b:first-child,.bp_chip_module_chip--d387b svg:first-child{
|
|
4108
4108
|
margin-inline-start:var(--space-2);
|
|
4109
4109
|
}
|
|
4110
|
-
.bp_chip_module_chip--
|
|
4110
|
+
.bp_chip_module_chip--d387b .bp_chip_module_chipStatus--d387b:last-child,.bp_chip_module_chip--d387b svg:last-child{
|
|
4111
4111
|
margin-inline-end:var(--space-2);
|
|
4112
4112
|
}
|
|
4113
|
-
.bp_chip_module_chip--
|
|
4113
|
+
.bp_chip_module_chip--d387b:disabled{
|
|
4114
|
+
cursor:default;
|
|
4115
|
+
pointer-events:none;
|
|
4116
|
+
}
|
|
4117
|
+
.bp_chip_module_chip--d387b .bp_chip_module_chipStatus--d387b{
|
|
4114
4118
|
align-items:center;
|
|
4115
4119
|
background-color:var(--gray-10);
|
|
4116
4120
|
border-radius:var(--radius-half);
|
|
@@ -4129,10 +4133,10 @@ table.bp_inline_table_module_inlineTable--b023b tr:not(:last-child) td{
|
|
|
4129
4133
|
text-decoration:none;
|
|
4130
4134
|
text-transform:none;
|
|
4131
4135
|
}
|
|
4132
|
-
.bp_chip_module_chip--
|
|
4136
|
+
.bp_chip_module_chip--d387b .bp_chip_module_labelText--d387b{
|
|
4133
4137
|
white-space:nowrap;
|
|
4134
4138
|
}
|
|
4135
|
-
.bp_chip_module_chip--
|
|
4139
|
+
.bp_chip_module_chip--d387b.bp_chip_module_chipButton--d387b{
|
|
4136
4140
|
background-color:var(--surface-chip-button-surface);
|
|
4137
4141
|
font-family:Lato, -apple-system, BlinkMacSystemFont, "San Francisco", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
|
|
4138
4142
|
font-size:.875rem;
|
|
@@ -4142,50 +4146,50 @@ table.bp_inline_table_module_inlineTable--b023b tr:not(:last-child) td{
|
|
|
4142
4146
|
text-decoration:none;
|
|
4143
4147
|
text-transform:none;
|
|
4144
4148
|
}
|
|
4145
|
-
.bp_chip_module_chip--
|
|
4149
|
+
.bp_chip_module_chip--d387b.bp_chip_module_chipButton--d387b:focus-visible{
|
|
4146
4150
|
box-shadow:0 0 0 var(--border-2) var(--outline-focus-on-light);
|
|
4147
4151
|
outline:none;
|
|
4148
4152
|
overflow:visible;
|
|
4149
4153
|
}
|
|
4150
|
-
.bp_chip_module_chip--
|
|
4154
|
+
.bp_chip_module_chip--d387b.bp_chip_module_chipButton--d387b .bp_chip_module_chipStatus--d387b{
|
|
4151
4155
|
background-color:var(--box-blue-100);
|
|
4152
4156
|
color:var(--text-text-on-dark);
|
|
4153
4157
|
}
|
|
4154
|
-
.bp_chip_module_chip--
|
|
4158
|
+
.bp_chip_module_chip--d387b.bp_chip_module_chipButton--d387b:focus-visible,.bp_chip_module_chip--d387b.bp_chip_module_chipButton--d387b[data-active-item]{
|
|
4155
4159
|
box-shadow:0 0 0 var(--border-2) var(--outline-focus-on-light);
|
|
4156
4160
|
outline:none;
|
|
4157
4161
|
}
|
|
4158
|
-
.bp_chip_module_chip--
|
|
4162
|
+
.bp_chip_module_chip--d387b.bp_chip_module_chipButton--d387b:disabled{
|
|
4159
4163
|
pointer-events:none;
|
|
4160
4164
|
}
|
|
4161
|
-
.bp_chip_module_chip--
|
|
4165
|
+
.bp_chip_module_chip--d387b.bp_chip_module_chipButton--d387b:disabled .bp_chip_module_chipStatus--d387b{
|
|
4162
4166
|
opacity:.4;
|
|
4163
4167
|
}
|
|
4164
|
-
.bp_chip_module_chip--
|
|
4168
|
+
.bp_chip_module_chip--d387b.bp_chip_module_chipButton--d387b:hover:enabled{
|
|
4165
4169
|
background-color:var(--surface-chip-button-surface-hover);
|
|
4166
4170
|
}
|
|
4167
|
-
.bp_chip_module_chip--
|
|
4171
|
+
.bp_chip_module_chip--d387b.bp_chip_module_singleSelectChip--d387b{
|
|
4168
4172
|
background-color:var(--surface-filterchip-surface-single);
|
|
4169
4173
|
}
|
|
4170
|
-
.bp_chip_module_chip--
|
|
4174
|
+
.bp_chip_module_chip--d387b.bp_chip_module_singleSelectChip--d387b[data-state=on]{
|
|
4171
4175
|
background-color:var(--surface-filterchip-surface-single-on);
|
|
4172
4176
|
color:var(--text-text-on-dark);
|
|
4173
4177
|
}
|
|
4174
|
-
.bp_chip_module_chip--
|
|
4178
|
+
.bp_chip_module_chip--d387b.bp_chip_module_singleSelectChip--d387b[data-state=on]:hover{
|
|
4175
4179
|
background-color:var(--surface-filterchip-surface-single-on-hover);
|
|
4176
4180
|
}
|
|
4177
|
-
.bp_chip_module_chip--
|
|
4181
|
+
.bp_chip_module_chip--d387b.bp_chip_module_singleSelectChip--d387b[data-state=on] .bp_chip_module_chipStatus--d387b{
|
|
4178
4182
|
color:var(--text-text-on-light);
|
|
4179
4183
|
}
|
|
4180
|
-
.bp_chip_module_chip--
|
|
4184
|
+
.bp_chip_module_chip--d387b.bp_chip_module_singleSelectChip--d387b:focus-visible,.bp_chip_module_chip--d387b.bp_chip_module_singleSelectChip--d387b[data-active-item]{
|
|
4181
4185
|
box-shadow:0 0 0 var(--border-2) var(--outline-focus-on-light);
|
|
4182
4186
|
outline:var(--border-1) solid var(--gray-white);
|
|
4183
4187
|
outline-offset:calc(var(--border-1)*-1);
|
|
4184
4188
|
}
|
|
4185
|
-
.bp_chip_module_chip--
|
|
4189
|
+
.bp_chip_module_chip--d387b.bp_chip_module_singleSelectChip--d387b:hover:not([data-state=on]){
|
|
4186
4190
|
background-color:var(--surface-filterchip-surface-single-hover);
|
|
4187
4191
|
}
|
|
4188
|
-
.bp_chip_module_chip--
|
|
4192
|
+
.bp_chip_module_chip--d387b.bp_chip_module_multiSelectChip--d387b{
|
|
4189
4193
|
background-color:var(--surface-filterchip-surface-multi);
|
|
4190
4194
|
border:var(--border-1) solid var(--surface-filterchip-surface-multi);
|
|
4191
4195
|
font-family:Lato, -apple-system, BlinkMacSystemFont, "San Francisco", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
|
|
@@ -4196,10 +4200,10 @@ table.bp_inline_table_module_inlineTable--b023b tr:not(:last-child) td{
|
|
|
4196
4200
|
text-decoration:none;
|
|
4197
4201
|
text-transform:none;
|
|
4198
4202
|
}
|
|
4199
|
-
.bp_chip_module_chip--
|
|
4203
|
+
.bp_chip_module_chip--d387b.bp_chip_module_multiSelectChip--d387b path{
|
|
4200
4204
|
fill:var(--icon-icon-on-light);
|
|
4201
4205
|
}
|
|
4202
|
-
.bp_chip_module_chip--
|
|
4206
|
+
.bp_chip_module_chip--d387b.bp_chip_module_multiSelectChip--d387b[data-state=on]{
|
|
4203
4207
|
background-color:var(--surface-filterchip-surface-multi-on);
|
|
4204
4208
|
border:var(--border-1) solid var(--border-filterchip-border-multi-on);
|
|
4205
4209
|
color:var(--text-cta-link);
|
|
@@ -4211,32 +4215,32 @@ table.bp_inline_table_module_inlineTable--b023b tr:not(:last-child) td{
|
|
|
4211
4215
|
text-decoration:none;
|
|
4212
4216
|
text-transform:none;
|
|
4213
4217
|
}
|
|
4214
|
-
.bp_chip_module_chip--
|
|
4218
|
+
.bp_chip_module_chip--d387b.bp_chip_module_multiSelectChip--d387b[data-state=on] path{
|
|
4215
4219
|
fill:var(--text-cta-link);
|
|
4216
4220
|
}
|
|
4217
|
-
.bp_chip_module_chip--
|
|
4221
|
+
.bp_chip_module_chip--d387b.bp_chip_module_multiSelectChip--d387b[data-state=on]:hover{
|
|
4218
4222
|
background-color:var(--surface-filterchip-surface-multi-on-hover);
|
|
4219
4223
|
}
|
|
4220
|
-
.bp_chip_module_chip--
|
|
4224
|
+
.bp_chip_module_chip--d387b.bp_chip_module_multiSelectChip--d387b[data-state=on]:focus-visible,.bp_chip_module_chip--d387b.bp_chip_module_multiSelectChip--d387b[data-state=on][data-active-item]{
|
|
4221
4225
|
border:var(--border-1) solid var(--gray-white);
|
|
4222
4226
|
box-shadow:0 0 0 var(--border-2) var(--outline-focus-on-light);
|
|
4223
4227
|
outline:var(--border-1) solid var(--border-filterchip-border-multi-on);
|
|
4224
4228
|
outline-offset:calc(var(--border-2)*-1);
|
|
4225
4229
|
}
|
|
4226
|
-
.bp_chip_module_chip--
|
|
4230
|
+
.bp_chip_module_chip--d387b.bp_chip_module_multiSelectChip--d387b[data-state=on] .bp_chip_module_chipStatus--d387b{
|
|
4227
4231
|
background-color:var(--box-blue-100);
|
|
4228
4232
|
color:var(--text-text-on-dark);
|
|
4229
4233
|
}
|
|
4230
|
-
.bp_chip_module_chip--
|
|
4234
|
+
.bp_chip_module_chip--d387b.bp_chip_module_multiSelectChip--d387b:focus-visible:not([data-state=on]),.bp_chip_module_chip--d387b.bp_chip_module_multiSelectChip--d387b[data-active-item]:not([data-state=on]){
|
|
4231
4235
|
box-shadow:0 0 0 var(--border-2) var(--outline-focus-on-light);
|
|
4232
4236
|
outline:var(--border-1) solid var(--gray-white);
|
|
4233
4237
|
outline-offset:calc(var(--border-1)*-1);
|
|
4234
4238
|
}
|
|
4235
|
-
.bp_chip_module_chip--
|
|
4239
|
+
.bp_chip_module_chip--d387b.bp_chip_module_multiSelectChip--d387b:hover:not([data-state=on]){
|
|
4236
4240
|
background-color:var(--surface-filterchip-surface-multi-hover);
|
|
4237
4241
|
border:var(--border-1) solid var(--surface-filterchip-surface-multi-hover);
|
|
4238
4242
|
}
|
|
4239
|
-
.bp_chip_module_chip--
|
|
4243
|
+
.bp_chip_module_chip--d387b.bp_chip_module_multiSelectChip--d387b span::before{
|
|
4240
4244
|
content:attr(data-text);
|
|
4241
4245
|
display:block;
|
|
4242
4246
|
font-family:Lato, -apple-system, BlinkMacSystemFont, "San Francisco", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
|
|
@@ -4251,20 +4255,20 @@ table.bp_inline_table_module_inlineTable--b023b tr:not(:last-child) td{
|
|
|
4251
4255
|
visibility:hidden;
|
|
4252
4256
|
}
|
|
4253
4257
|
|
|
4254
|
-
.bp_chip_module_chipsGroup--
|
|
4258
|
+
.bp_chip_module_chipsGroup--d387b{
|
|
4255
4259
|
display:flex;
|
|
4256
4260
|
flex-wrap:wrap;
|
|
4257
4261
|
gap:var(--space-2);
|
|
4258
4262
|
}
|
|
4259
4263
|
@media (max-width: 767px){
|
|
4260
|
-
.bp_chip_module_chipsGroup--
|
|
4264
|
+
.bp_chip_module_chipsGroup--d387b{
|
|
4261
4265
|
-ms-overflow-style:none;
|
|
4262
4266
|
flex-wrap:nowrap;
|
|
4263
4267
|
overflow-x:scroll;
|
|
4264
4268
|
padding:var(--space-05);
|
|
4265
4269
|
scrollbar-width:none;
|
|
4266
4270
|
}
|
|
4267
|
-
.bp_chip_module_chipsGroup--
|
|
4271
|
+
.bp_chip_module_chipsGroup--d387b::-webkit-scrollbar{
|
|
4268
4272
|
display:none;
|
|
4269
4273
|
}
|
|
4270
4274
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { clsx } from 'clsx';
|
|
3
|
-
import { forwardRef,
|
|
3
|
+
import { forwardRef, useCallback } from 'react';
|
|
4
4
|
import { useScrollContext } from '../utils/scroll-context.js';
|
|
5
|
-
import { useForkRef } from '../utils/useForkRef.js';
|
|
6
5
|
import styles from './modal.module.js';
|
|
7
6
|
|
|
8
7
|
/**
|
|
@@ -16,12 +15,23 @@ const ModalScrollableContainer = /*#__PURE__*/forwardRef(({
|
|
|
16
15
|
...rest
|
|
17
16
|
}, forwardedRef) => {
|
|
18
17
|
const {
|
|
19
|
-
onScroll
|
|
18
|
+
onScroll,
|
|
19
|
+
onAttach
|
|
20
20
|
} = useScrollContext();
|
|
21
|
-
const
|
|
21
|
+
const onMountRef = useCallback(node => {
|
|
22
|
+
onAttach(node);
|
|
23
|
+
if (!forwardedRef) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
if (typeof forwardedRef === 'function') {
|
|
27
|
+
forwardedRef(node);
|
|
28
|
+
} else {
|
|
29
|
+
forwardedRef.current = node;
|
|
30
|
+
}
|
|
31
|
+
}, [forwardedRef, onAttach]);
|
|
22
32
|
return jsx("div", {
|
|
23
33
|
...rest,
|
|
24
|
-
ref:
|
|
34
|
+
ref: onMountRef,
|
|
25
35
|
className: clsx(styles.scrollableContainer, className),
|
|
26
36
|
"data-testid": dataTestId,
|
|
27
37
|
onScroll: event => {
|
package/lib-esm/page/index.d.ts
CHANGED
|
@@ -3,6 +3,15 @@ export { usePage } from './page-context';
|
|
|
3
3
|
export * from './types';
|
|
4
4
|
export declare const Page: import("react").ForwardRefExoticComponent<import("./types").PageProps & import("react").RefAttributes<HTMLDivElement>> & {
|
|
5
5
|
Navigation: import("react").ForwardRefExoticComponent<import("./types").PageNavigationProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Top level landmark placed at the top of the page.
|
|
8
|
+
* Contains two subcomponents for contents:
|
|
9
|
+
* - PageGlobalHeader.SearchContainer
|
|
10
|
+
* - PageGlobalHeader.SideContentContainer
|
|
11
|
+
*/
|
|
12
|
+
GlobalHeader: import("react").ForwardRefExoticComponent<import("./types").GlobalHeaderProps & import("react").RefAttributes<HTMLDivElement>> & {
|
|
13
|
+
SearchContainer: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
14
|
+
SideContentContainer: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
15
|
+
};
|
|
7
16
|
Content: import("react").ForwardRefExoticComponent<import("./types").PageContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
8
17
|
};
|
|
@@ -1,3 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type GlobalHeaderProps } from './types';
|
|
3
3
|
export declare const PageGlobalHeader: import("react").ForwardRefExoticComponent<GlobalHeaderProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
4
|
+
export declare const GlobalHeader: import("react").ForwardRefExoticComponent<GlobalHeaderProps & import("react").RefAttributes<HTMLDivElement>> & {
|
|
5
|
+
/**
|
|
6
|
+
* Container for components related to global search.
|
|
7
|
+
*/
|
|
8
|
+
SearchContainer: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
9
|
+
/**
|
|
10
|
+
* Container for all components excluding ones related to global search.
|
|
11
|
+
*/
|
|
12
|
+
SideContentContainer: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
13
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '../../index.css';
|
|
2
|
-
var styles = {"chip":"bp_chip_module_chip--
|
|
2
|
+
var styles = {"chip":"bp_chip_module_chip--d387b","labelText":"bp_chip_module_labelText--d387b","chipStatus":"bp_chip_module_chipStatus--d387b","chipButton":"bp_chip_module_chipButton--d387b","singleSelectChip":"bp_chip_module_singleSelectChip--d387b","multiSelectChip":"bp_chip_module_multiSelectChip--d387b","chipsGroup":"bp_chip_module_chipsGroup--d387b"};
|
|
3
3
|
|
|
4
4
|
export { styles as default };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import * as RadixDialog from '@radix-ui/react-dialog';
|
|
3
|
+
import { FocusScope } from '@radix-ui/react-focus-scope';
|
|
3
4
|
import { clsx } from 'clsx';
|
|
4
5
|
import { forwardRef, useCallback } from 'react';
|
|
5
|
-
import { FocusScope } from '@radix-ui/react-focus-scope';
|
|
6
6
|
import styles from './side-panel.module.js';
|
|
7
7
|
import { useVariant } from './variant-context.js';
|
|
8
8
|
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type SidePanelTriggerProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Wrapper component for an interactive element that's responsible for opening SidePanel.
|
|
5
|
+
*/
|
|
6
|
+
export declare const SidePanelTrigger: import("react").ForwardRefExoticComponent<SidePanelTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import * as RadixDialog from '@radix-ui/react-dialog';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Wrapper component for an interactive element that's responsible for opening SidePanel.
|
|
7
|
+
*/
|
|
8
|
+
const SidePanelTrigger = /*#__PURE__*/forwardRef(function SidePanelTrigger({
|
|
9
|
+
children
|
|
10
|
+
}, forwardedRef) {
|
|
11
|
+
return jsx(RadixDialog.Trigger, {
|
|
12
|
+
ref: forwardedRef,
|
|
13
|
+
asChild: true,
|
|
14
|
+
children: children
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export { SidePanelTrigger };
|
|
@@ -22,6 +22,7 @@ export declare const SidePanel: ((props: SidePanelProps) => import("react/jsx-ru
|
|
|
22
22
|
}, "ref">) & import("react").RefAttributes<HTMLButtonElement>>;
|
|
23
23
|
};
|
|
24
24
|
Header: import("react").ForwardRefExoticComponent<Omit<import("./types").SidePanelHeaderProps, "ref"> & import("react").RefAttributes<HTMLHeadingElement>>;
|
|
25
|
-
ScrollableContainer: import("react").ForwardRefExoticComponent<Omit<import("./types").SidePanelScrollableContainerProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
26
25
|
Overlay: import("react").ForwardRefExoticComponent<Omit<import("./types").SidePanelOverlayComponentProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
26
|
+
ScrollableContainer: import("react").ForwardRefExoticComponent<Omit<import("./types").SidePanelScrollableContainerProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
27
|
+
Trigger: import("react").ForwardRefExoticComponent<import("./types").SidePanelTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
27
28
|
};
|
|
@@ -7,6 +7,7 @@ import { SidePanelFooter } from './side-panel-footer.js';
|
|
|
7
7
|
import { SidePanelHeader } from './side-panel-header.js';
|
|
8
8
|
import { SidePanelOverlay } from './side-panel-overlay.js';
|
|
9
9
|
import { SidePanelScrollableContainer } from './side-panel-scrollable-container.js';
|
|
10
|
+
import { SidePanelTrigger } from './side-panel-trigger.js';
|
|
10
11
|
import { VariantProvider } from './variant-context.js';
|
|
11
12
|
|
|
12
13
|
const Root = props => {
|
|
@@ -45,8 +46,9 @@ const SidePanel = Object.assign(Root, {
|
|
|
45
46
|
Content: SidePanelContent,
|
|
46
47
|
Footer: SidePanelFooter,
|
|
47
48
|
Header: SidePanelHeader,
|
|
49
|
+
Overlay: SidePanelOverlay,
|
|
48
50
|
ScrollableContainer: SidePanelScrollableContainer,
|
|
49
|
-
|
|
51
|
+
Trigger: SidePanelTrigger
|
|
50
52
|
});
|
|
51
53
|
|
|
52
54
|
export { SidePanel };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type DialogContentProps, type DialogPortalProps, type DialogProps } from '@radix-ui/react-dialog';
|
|
2
|
-
import { type ComponentPropsWithRef, type FunctionComponent, type PropsWithChildren, type ReactNode, type SVGProps } from 'react';
|
|
2
|
+
import { type ComponentPropsWithRef, type FunctionComponent, type PropsWithChildren, type ReactElement, type ReactNode, type SVGProps } from 'react';
|
|
3
3
|
/**
|
|
4
4
|
* 'persistent' - side panel is displayed inline with the page content
|
|
5
5
|
*
|
|
@@ -32,6 +32,9 @@ export interface SidePanelCloseProps {
|
|
|
32
32
|
/** Custom icon for Close element */
|
|
33
33
|
icon?: FunctionComponent<PropsWithChildren<SVGProps<SVGSVGElement>>>;
|
|
34
34
|
}
|
|
35
|
+
export interface SidePanelTriggerProps {
|
|
36
|
+
children: ReactElement;
|
|
37
|
+
}
|
|
35
38
|
export interface SidePanelScrollableContainerProps extends ComponentPropsWithRef<'div'> {
|
|
36
39
|
/** Content of the ScrollableContainer element */
|
|
37
40
|
children: ReactNode;
|
package/lib-esm/text/text.js
CHANGED
|
@@ -1,2 +1,10 @@
|
|
|
1
|
-
import { type ForwardedRef } from 'react';
|
|
2
|
-
|
|
1
|
+
import { type ForwardedRef, type RefCallback } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Returns function that sets ref and invokes provided ref callback function.
|
|
4
|
+
*/
|
|
5
|
+
export declare function createSetRefWithCallback<T>(forwardedRef: ForwardedRef<T>, callback?: RefCallback<T>): (node: T | null) => void;
|
|
6
|
+
/**
|
|
7
|
+
* Memoized version of createSetRefWithCallback.
|
|
8
|
+
* Returns function that sets ref and invokes provided ref callback function.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useCreateSetRefWithCallbackMemo<T>(forwardedRef: ForwardedRef<T>, callback?: RefCallback<T>): (node: T | null) => void;
|
|
@@ -3,6 +3,7 @@ interface ScrollContextType {
|
|
|
3
3
|
isScrolledUnderHeader: boolean;
|
|
4
4
|
isScrolledUnderFooter: boolean;
|
|
5
5
|
onScroll: (event: UIEvent<HTMLDivElement>) => void;
|
|
6
|
+
onAttach: (node: HTMLDivElement | null) => void;
|
|
6
7
|
}
|
|
7
8
|
export declare const ScrollProvider: ({ children }: {
|
|
8
9
|
children: React.ReactNode;
|
|
@@ -5,7 +5,8 @@ import { useState, useCallback, useMemo, useContext, createContext } from 'react
|
|
|
5
5
|
const ScrollContext = /*#__PURE__*/createContext({
|
|
6
6
|
isScrolledUnderFooter: false,
|
|
7
7
|
isScrolledUnderHeader: false,
|
|
8
|
-
onScroll: noop
|
|
8
|
+
onScroll: noop,
|
|
9
|
+
onAttach: noop
|
|
9
10
|
});
|
|
10
11
|
const ScrollProvider = ({
|
|
11
12
|
children
|
|
@@ -22,11 +23,18 @@ const ScrollProvider = ({
|
|
|
22
23
|
const scrolledToBottom = scroll >= scrollHeight - offsetHeight;
|
|
23
24
|
setScrolledUnderFooter(!scrolledToBottom);
|
|
24
25
|
}, []);
|
|
26
|
+
const onAttach = useCallback(element => {
|
|
27
|
+
if (element) {
|
|
28
|
+
setScrolledUnderFooter(element.scrollHeight > element.offsetHeight);
|
|
29
|
+
setScrolledUnderHeader(element.scrollTop > 0);
|
|
30
|
+
}
|
|
31
|
+
}, []);
|
|
25
32
|
const value = useMemo(() => ({
|
|
26
33
|
isScrolledUnderFooter,
|
|
27
34
|
isScrolledUnderHeader,
|
|
28
|
-
onScroll
|
|
29
|
-
|
|
35
|
+
onScroll,
|
|
36
|
+
onAttach
|
|
37
|
+
}), [isScrolledUnderFooter, isScrolledUnderHeader, onScroll, onAttach]);
|
|
30
38
|
return jsx(ScrollContext.Provider, {
|
|
31
39
|
value: value,
|
|
32
40
|
children: children
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/blueprint-web",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"publishConfig": {
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"react-stately": "^3.31.1",
|
|
64
64
|
"tsx": "^4.16.5"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "0493d34d7630dffade2a3d5c62b46719e425ff2b",
|
|
67
67
|
"module": "lib-esm/index.js",
|
|
68
68
|
"main": "lib-esm/index.js",
|
|
69
69
|
"exports": {
|