@box/blueprint-web 12.126.0 → 12.127.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/dist/lib-esm/index.css
CHANGED
|
@@ -10223,7 +10223,7 @@ div[data-radix-popper-content-wrapper]:has([role=menu]):has([data-state=open]):h
|
|
|
10223
10223
|
.bp_tabs_module_tabsListContainer--1c0ce .bp_tabs_module_tabList--1c0ce .bp_tabs_module_tab--1c0ce[aria-disabled=true]{
|
|
10224
10224
|
opacity:.5;
|
|
10225
10225
|
}
|
|
10226
|
-
.bp_radio_group_module_root--
|
|
10226
|
+
.bp_radio_group_module_root--4220f[data-modern=false]{
|
|
10227
10227
|
--radio-line-height:var(--body-default-line-height);
|
|
10228
10228
|
font-family:var(--body-default-font-family);
|
|
10229
10229
|
font-size:var(--body-default-font-size);
|
|
@@ -10235,7 +10235,7 @@ div[data-radix-popper-content-wrapper]:has([role=menu]):has([data-state=open]):h
|
|
|
10235
10235
|
text-transform:var(--body-default-text-case);
|
|
10236
10236
|
}
|
|
10237
10237
|
|
|
10238
|
-
.bp_radio_group_module_root--
|
|
10238
|
+
.bp_radio_group_module_root--4220f[data-modern=true]{
|
|
10239
10239
|
--radio-line-height:var(--bp-font-line-height-04);
|
|
10240
10240
|
font-family:var(--bp-font-font-family), -apple-system, BlinkMacSystemFont, "San Francisco", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
|
|
10241
10241
|
font-size:var(--bp-font-size-05);
|
|
@@ -10245,36 +10245,38 @@ div[data-radix-popper-content-wrapper]:has([role=menu]):has([data-state=open]):h
|
|
|
10245
10245
|
line-height:var(--bp-font-line-height-04);
|
|
10246
10246
|
}
|
|
10247
10247
|
|
|
10248
|
-
.bp_radio_group_module_root--
|
|
10248
|
+
.bp_radio_group_module_root--4220f{
|
|
10249
10249
|
display:flex;
|
|
10250
10250
|
flex-direction:column;
|
|
10251
10251
|
gap:var(--space-2);
|
|
10252
10252
|
}
|
|
10253
10253
|
|
|
10254
|
-
.bp_radio_group_module_horizontal--
|
|
10254
|
+
.bp_radio_group_module_horizontal--4220f{
|
|
10255
10255
|
flex-direction:row;
|
|
10256
10256
|
gap:1.625rem;
|
|
10257
10257
|
}
|
|
10258
10258
|
|
|
10259
|
-
.bp_radio_group_module_radioOption--
|
|
10259
|
+
.bp_radio_group_module_radioOption--4220f{
|
|
10260
10260
|
display:flex;
|
|
10261
10261
|
flex-direction:column;
|
|
10262
10262
|
}
|
|
10263
|
-
.bp_radio_group_module_radioOption--
|
|
10263
|
+
.bp_radio_group_module_radioOption--4220f .bp_radio_group_module_label--4220f{
|
|
10264
10264
|
align-items:flex-start;
|
|
10265
10265
|
cursor:pointer;
|
|
10266
10266
|
display:inline-flex;
|
|
10267
10267
|
gap:var(--size-3);
|
|
10268
|
+
width:-moz-fit-content;
|
|
10269
|
+
width:fit-content;
|
|
10268
10270
|
}
|
|
10269
|
-
.bp_radio_group_module_radioOption--
|
|
10271
|
+
.bp_radio_group_module_radioOption--4220f .bp_radio_group_module_description--4220f{
|
|
10270
10272
|
padding-left:calc(var(--size-4) + var(--size-3));
|
|
10271
10273
|
}
|
|
10272
|
-
.bp_radio_group_module_radioOption--
|
|
10274
|
+
.bp_radio_group_module_radioOption--4220f.bp_radio_group_module_disabled--4220f .bp_radio_group_module_label--4220f,[role=radiogroup][data-disabled] .bp_radio_group_module_radioOption--4220f .bp_radio_group_module_label--4220f{
|
|
10273
10275
|
color:var(--text-text-on-light-secondary);
|
|
10274
10276
|
cursor:default;
|
|
10275
10277
|
}
|
|
10276
10278
|
|
|
10277
|
-
.bp_radio_group_module_radioButton--
|
|
10279
|
+
.bp_radio_group_module_radioButton--4220f{
|
|
10278
10280
|
all:unset;
|
|
10279
10281
|
align-items:center;
|
|
10280
10282
|
background-color:var(--surface-radio-surface);
|
|
@@ -10288,33 +10290,33 @@ div[data-radix-popper-content-wrapper]:has([role=menu]):has([data-state=open]):h
|
|
|
10288
10290
|
margin:calc((var(--radio-line-height) - var(--size-4))/2) 0 0 0;
|
|
10289
10291
|
width:var(--size-4);
|
|
10290
10292
|
}
|
|
10291
|
-
.bp_radio_group_module_radioButton--
|
|
10293
|
+
.bp_radio_group_module_radioButton--4220f .bp_radio_group_module_indicator--4220f{
|
|
10292
10294
|
background-color:var(--surface-radio-surface-selected);
|
|
10293
10295
|
border-radius:50%;
|
|
10294
10296
|
height:var(--size-2);
|
|
10295
10297
|
transition:transform .1s;
|
|
10296
10298
|
width:var(--size-2);
|
|
10297
10299
|
}
|
|
10298
|
-
.bp_radio_group_module_radioButton--
|
|
10300
|
+
.bp_radio_group_module_radioButton--4220f:focus-visible{
|
|
10299
10301
|
box-shadow:0 0 0 var(--border-1, 1px) var(--background-background), 0 0 0 var(--border-3) var(--outline-focus-on-light);
|
|
10300
10302
|
}
|
|
10301
|
-
.bp_radio_group_module_radioButton--
|
|
10303
|
+
.bp_radio_group_module_radioButton--4220f[data-disabled]{
|
|
10302
10304
|
opacity:60%;
|
|
10303
10305
|
}
|
|
10304
|
-
.bp_radio_group_module_radioButton--
|
|
10306
|
+
.bp_radio_group_module_radioButton--4220f[data-state=unchecked]{
|
|
10305
10307
|
background-color:var(--surface-radio-surface);
|
|
10306
10308
|
border:var(--border-2) solid var(--border-radio-border);
|
|
10307
10309
|
}
|
|
10308
|
-
.bp_radio_group_module_radioButton--
|
|
10310
|
+
.bp_radio_group_module_radioButton--4220f[data-state=unchecked] .bp_radio_group_module_indicator--4220f{
|
|
10309
10311
|
transform:scale(0);
|
|
10310
10312
|
}
|
|
10311
|
-
.bp_radio_group_module_radioButton--
|
|
10313
|
+
.bp_radio_group_module_radioButton--4220f:not([data-disabled]):focus-visible,.bp_radio_group_module_radioButton--4220f:not([data-disabled]):hover{
|
|
10312
10314
|
border:var(--border-2) solid var(--border-radio-border-hover);
|
|
10313
10315
|
}
|
|
10314
|
-
.bp_radio_group_module_radioButton--
|
|
10316
|
+
.bp_radio_group_module_radioButton--4220f:not([data-disabled]):focus-visible[data-state=checked],.bp_radio_group_module_radioButton--4220f:not([data-disabled]):hover[data-state=checked]{
|
|
10315
10317
|
border:var(--border-2) solid var(--border-radio-border-selected-hover);
|
|
10316
10318
|
}
|
|
10317
|
-
.bp_radio_group_module_radioButton--
|
|
10319
|
+
.bp_radio_group_module_radioButton--4220f:not([data-disabled]):focus-visible[data-state=checked] .bp_radio_group_module_indicator--4220f,.bp_radio_group_module_radioButton--4220f:not([data-disabled]):hover[data-state=checked] .bp_radio_group_module_indicator--4220f{
|
|
10318
10320
|
background-color:var(--surface-radio-surface-selected-hover);
|
|
10319
10321
|
}
|
|
10320
10322
|
.bp_radio_tiles_option_module_radioTileOption--07c71[data-modern=false]{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type AlertModalProps } from './alert-modal.types';
|
|
2
2
|
export declare const AlertModal: {
|
|
3
|
-
({ children, closeButtonAriaLabel, closeButtonDisabled, container, heading, onOpenChange, open, size, textContent, ...props }: AlertModalProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
({ children, closeButtonAriaLabel, closeButtonDisabled, container, heading, onOpenChange, open, size, textContent, trigger, ...props }: AlertModalProps): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
displayName: string;
|
|
5
5
|
} & {
|
|
6
6
|
PrimaryButton: import("react").ForwardRefExoticComponent<(Omit<import("../primitives/base-button").BaseButtonInterface & Required<Pick<import("../primitives/base-button").Loading, keyof import("../primitives/base-button").Loading>> & Omit<import("../primitives/base-button").Loading, keyof import("../primitives/base-button").Loading> & {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { useId, Children, isValidElement } from 'react';
|
|
3
3
|
import { Modal } from './modal.js';
|
|
4
4
|
import { ModalFooter } from './modal-footer.js';
|
|
@@ -26,6 +26,7 @@ const validateChildren = children => {
|
|
|
26
26
|
* - Has role="alertdialog" for accessibility
|
|
27
27
|
* - Announces the content of the modal to the user when it is opened
|
|
28
28
|
* - Always includes a close button with i18n support (disabled state can be controlled via closeButtonDisabled prop)
|
|
29
|
+
* - Optionally accepts a trigger element
|
|
29
30
|
*
|
|
30
31
|
* @example
|
|
31
32
|
* <AlertModal
|
|
@@ -35,6 +36,7 @@ const validateChildren = children => {
|
|
|
35
36
|
* closeButtonDisabled={isSubmittingRequest}
|
|
36
37
|
* textContent="Are you sure you want to delete this item?"
|
|
37
38
|
* closeButtonAriaLabel={formatMessage(commonMessages.closeButtonText)}
|
|
39
|
+
* trigger={<Button>Open</Button>}
|
|
38
40
|
* >
|
|
39
41
|
* <AlertModal.SecondaryButton onClick={() => setIsOpen(false)}>
|
|
40
42
|
* Cancel
|
|
@@ -54,15 +56,18 @@ const AlertModalComponent = ({
|
|
|
54
56
|
open,
|
|
55
57
|
size = 'small',
|
|
56
58
|
textContent,
|
|
59
|
+
trigger,
|
|
57
60
|
...props
|
|
58
61
|
}) => {
|
|
59
62
|
const textContentId = useId();
|
|
60
63
|
validateChildren(children);
|
|
61
|
-
return
|
|
64
|
+
return jsxs(Modal, {
|
|
62
65
|
onOpenChange: onOpenChange,
|
|
63
66
|
open: open,
|
|
64
67
|
...props,
|
|
65
|
-
children:
|
|
68
|
+
children: [trigger && jsx(Modal.Trigger, {
|
|
69
|
+
children: trigger
|
|
70
|
+
}), jsxs(Modal.Content, {
|
|
66
71
|
"aria-describedby": textContentId,
|
|
67
72
|
container: container,
|
|
68
73
|
role: "alertdialog",
|
|
@@ -80,7 +85,7 @@ const AlertModalComponent = ({
|
|
|
80
85
|
"aria-label": closeButtonAriaLabel,
|
|
81
86
|
disabled: closeButtonDisabled
|
|
82
87
|
})]
|
|
83
|
-
})
|
|
88
|
+
})]
|
|
84
89
|
});
|
|
85
90
|
};
|
|
86
91
|
AlertModalComponent.displayName = 'AlertModal';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type DialogPortalProps, type DialogProps } from '@radix-ui/react-dialog';
|
|
2
|
-
import { type ReactNode } from 'react';
|
|
2
|
+
import { type ReactElement, type ReactNode } from 'react';
|
|
3
3
|
import { type ModalContentSize } from './types';
|
|
4
4
|
export interface AlertModalProps extends Omit<DialogProps, 'modal'>, Pick<DialogPortalProps, 'container'> {
|
|
5
5
|
/** The text content to display in the modal body. Should be an i18n string (e.g., from formatMessage). */
|
|
@@ -14,4 +14,6 @@ export interface AlertModalProps extends Omit<DialogProps, 'modal'>, Pick<Dialog
|
|
|
14
14
|
closeButtonAriaLabel: string;
|
|
15
15
|
/** Whether to disable the close button. Defaults to false. */
|
|
16
16
|
closeButtonDisabled?: boolean;
|
|
17
|
+
/** Optional trigger element to open the modal. Must be a single React element (e.g., <button>Open</button>). */
|
|
18
|
+
trigger?: ReactElement;
|
|
17
19
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '../index.css';
|
|
2
|
-
var styles = {"root":"bp_radio_group_module_root--
|
|
2
|
+
var styles = {"root":"bp_radio_group_module_root--4220f","horizontal":"bp_radio_group_module_horizontal--4220f","radioOption":"bp_radio_group_module_radioOption--4220f","label":"bp_radio_group_module_label--4220f","description":"bp_radio_group_module_description--4220f","disabled":"bp_radio_group_module_disabled--4220f","radioButton":"bp_radio_group_module_radioButton--4220f","indicator":"bp_radio_group_module_indicator--4220f"};
|
|
3
3
|
|
|
4
4
|
export { styles as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/blueprint-web",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.127.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.7",
|
|
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.18",
|
|
81
81
|
"@figma/code-connect": "1.3.12",
|
|
82
82
|
"@types/react": "^18.0.0",
|
|
83
83
|
"@types/react-dom": "^18.0.0",
|