@box/blueprint-web 6.10.0 → 6.11.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 CHANGED
@@ -4859,6 +4859,69 @@ table.inline_table_module_inlineTable--b023b tr:not(:last-child) td{
4859
4859
  .switch_module_option--f1dbf.switch_module_disabled--f1dbf .switch_module_switch--f1dbf{
4860
4860
  opacity:60%;
4861
4861
  }
4862
+
4863
+ .text_button_module_textButton--581e7{
4864
+ align-items:center;
4865
+ background:#0000;
4866
+ border:none;
4867
+ border-radius:calc(var(--radius-1)/2);
4868
+ color:var(--text-cta-link);
4869
+ cursor:pointer;
4870
+ display:inline-flex;
4871
+ font-family:Lato, -apple-system, BlinkMacSystemFont, "San Francisco", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
4872
+ font-size:.875rem;
4873
+ font-weight:700;
4874
+ letter-spacing:.01875rem;
4875
+ line-height:1.25rem;
4876
+ outline:0;
4877
+ padding:0;
4878
+ text-decoration:none;
4879
+ text-transform:none;
4880
+ -webkit-user-select:text;
4881
+ user-select:text;
4882
+ }
4883
+ .text_button_module_textButton--581e7.text_button_module_isFontInherited--581e7{
4884
+ border-radius:.125em;
4885
+ font:inherit;
4886
+ }
4887
+ .text_button_module_textButton--581e7.text_button_module_isFontInherited--581e7.text_button_module_isIconButton--581e7{
4888
+ gap:.25em;
4889
+ }
4890
+ .text_button_module_textButton--581e7.text_button_module_isFontInherited--581e7:not(:disabled)[data-focus-visible]{
4891
+ box-shadow:0 0 0 .125em var(--outline-focus-on-light);
4892
+ }
4893
+ .text_button_module_textButton--581e7 .text_button_module_scaleLoader--581e7 div{
4894
+ border-radius:.375em;
4895
+ height:.625em;
4896
+ width:.125em;
4897
+ }
4898
+ .text_button_module_textButton--581e7 .text_button_module_icon--581e7{
4899
+ align-items:center;
4900
+ display:flex;
4901
+ }
4902
+ .text_button_module_textButton--581e7 .text_button_module_hideTextContent--581e7{
4903
+ visibility:hidden;
4904
+ }
4905
+ .text_button_module_textButton--581e7.text_button_module_isIconButton--581e7{
4906
+ gap:var(--space-1);
4907
+ }
4908
+ .text_button_module_textButton--581e7.text_button_module_visuallyHidden--581e7{
4909
+ color:#0000;
4910
+ pointer-events:none;
4911
+ position:relative;
4912
+ }
4913
+ .text_button_module_textButton--581e7:disabled{
4914
+ opacity:.3;
4915
+ }
4916
+ .text_button_module_textButton--581e7:not(:disabled):hover,.text_button_module_textButton--581e7:not(:disabled)[data-focus-visible]{
4917
+ color:var(--text-cta-link-hover);
4918
+ }
4919
+ .text_button_module_textButton--581e7:not(:disabled)[data-focus-visible]{
4920
+ box-shadow:0 0 0 var(--border-2) var(--outline-focus-on-light);
4921
+ }
4922
+ .text_button_module_textButton--581e7:not(:disabled):active{
4923
+ color:var(--text-cta-link-pressed);
4924
+ }
4862
4925
  :root{
4863
4926
  --notification-default-paragraph-indent:0rem;
4864
4927
  --notification-default-paragraph-spacing:0;
@@ -5542,65 +5605,69 @@ table.inline_table_module_inlineTable--b023b tr:not(:last-child) td{
5542
5605
  --z-index-card-tooltip:2147483647;
5543
5606
  }
5544
5607
 
5545
- .text_button_module_textButton--581e7{
5546
- align-items:center;
5547
- background:#0000;
5548
- border:none;
5549
- border-radius:calc(var(--radius-1)/2);
5550
- color:var(--text-cta-link);
5551
- cursor:pointer;
5552
- display:inline-flex;
5553
- font-family:Lato, -apple-system, BlinkMacSystemFont, "San Francisco", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
5554
- font-size:.875rem;
5555
- font-weight:700;
5556
- letter-spacing:.01875rem;
5557
- line-height:1.25rem;
5558
- outline:0;
5559
- padding:0;
5560
- text-decoration:none;
5561
- text-transform:none;
5562
- -webkit-user-select:text;
5563
- user-select:text;
5564
- }
5565
- .text_button_module_textButton--581e7.text_button_module_isFontInherited--581e7{
5566
- border-radius:.125em;
5567
- font:inherit;
5568
- }
5569
- .text_button_module_textButton--581e7.text_button_module_isFontInherited--581e7.text_button_module_isIconButton--581e7{
5570
- gap:.25em;
5608
+ .toolbar_module_root--afeab{
5609
+ background:var(--surface-surface);
5610
+ border:var(--border-1) solid var(--border-card-border);
5611
+ border-radius:var(--radius-4);
5612
+ box-shadow:var(--dropshadow-3);
5613
+ display:flex;
5614
+ gap:var(--space-1);
5615
+ padding:var(--space-1);
5571
5616
  }
5572
- .text_button_module_textButton--581e7.text_button_module_isFontInherited--581e7:not(:disabled)[data-focus-visible]{
5573
- box-shadow:0 0 0 .125em var(--outline-focus-on-light);
5617
+
5618
+ .toolbar_module_separator--afeab{
5619
+ background-color:var(--border-divider-border);
5620
+ border-radius:var(--radius-2);
5621
+ width:1px;
5574
5622
  }
5575
- .text_button_module_textButton--581e7 .text_button_module_scaleLoader--581e7 div{
5576
- border-radius:.375em;
5577
- height:.625em;
5578
- width:.125em;
5623
+
5624
+ .toolbar_module_toggleGroup--afeab,.toolbar_module_toolbarItem--afeab{
5625
+ display:flex;
5626
+ gap:var(--space-1);
5579
5627
  }
5580
- .text_button_module_textButton--581e7 .text_button_module_icon--581e7{
5628
+
5629
+ .toolbar_module_toolbarItem--afeab{
5581
5630
  align-items:center;
5582
- display:flex;
5631
+ background:var(--toolbar-button-color, --surface-toggle-surface);
5632
+ border:var(--border-1) solid #0000;
5633
+ border-radius:var(--radius-2);
5634
+ cursor:pointer;
5635
+ justify-content:center;
5636
+ min-height:var(--size-8);
5637
+ min-width:var(--size-8);
5638
+ outline:none;
5639
+ padding:calc(var(--space-1) - var(--border-1));
5640
+ -webkit-user-select:none;
5641
+ user-select:none;
5583
5642
  }
5584
- .text_button_module_textButton--581e7 .text_button_module_hideTextContent--581e7{
5585
- visibility:hidden;
5643
+ .toolbar_module_toolbarItem--afeab[data-disabled]{
5644
+ background:var(--surface-toggle-surface);
5645
+ opacity:.3;
5646
+ pointer-events:none;
5586
5647
  }
5587
- .text_button_module_textButton--581e7.text_button_module_isIconButton--581e7{
5588
- gap:var(--space-1);
5648
+ .toolbar_module_toolbarItem--afeab:not([data-disabled]):focus{
5649
+ box-shadow:0 0 0 .0625rem #fff,0 0 0 .1875rem #2486fc;
5589
5650
  }
5590
- .text_button_module_textButton--581e7.text_button_module_visuallyHidden--581e7{
5591
- color:#0000;
5592
- pointer-events:none;
5593
- position:relative;
5651
+ .toolbar_module_toolbarItem--afeab:not([data-disabled]):hover{
5652
+ background:var(--toolbar-button-color, --surface-toggle-surface-hover);
5653
+ border:var(--border-1) solid var(--toolbar-button-color, --surface-toggle-surface-hover);
5594
5654
  }
5595
- .text_button_module_textButton--581e7:disabled{
5596
- opacity:.3;
5655
+
5656
+ .toolbar_module_toolbarToggle--afeab[data-state=on]{
5657
+ background:var(--surface-toggle-surface-pressed);
5597
5658
  }
5598
- .text_button_module_textButton--581e7:not(:disabled):hover,.text_button_module_textButton--581e7:not(:disabled)[data-focus-visible]{
5599
- color:var(--text-cta-link-hover);
5659
+ .toolbar_module_toolbarToggle--afeab[data-state=on] svg *{
5660
+ fill:var(--icon-icon-on-dark);
5600
5661
  }
5601
- .text_button_module_textButton--581e7:not(:disabled)[data-focus-visible]{
5602
- box-shadow:0 0 0 var(--border-2) var(--outline-focus-on-light);
5662
+ .toolbar_module_toolbarToggle--afeab[data-state=on]:not([data-disabled]):hover{
5663
+ background:var(--surface-toggle-surface-on-hover);
5664
+ border:var(--border-1) solid var(--surface-toggle-surface-on-hover);
5603
5665
  }
5604
- .text_button_module_textButton--581e7:not(:disabled):active{
5605
- color:var(--text-cta-link-pressed);
5666
+
5667
+ .toolbar_module_invertDropdownIndicator--afeab{
5668
+ transform:rotate(.5turn);
5669
+ }
5670
+
5671
+ .toolbar_module_triggerButtonSelectedWithColor--afeab[data-state=on]:hover{
5672
+ opacity:.7;
5606
5673
  }
@@ -50,6 +50,7 @@ export * from './switch';
50
50
  export * from './text';
51
51
  export * from './text-area';
52
52
  export * from './text-button';
53
+ export * from './toolbar';
53
54
  export * from './tooltip';
54
55
  export * from './trigger-button';
55
56
  export * from './util-components/scrollable-container/scrollable-container';
package/lib-esm/index.js CHANGED
@@ -62,6 +62,7 @@ export { Switch } from './switch/index.js';
62
62
  export { Text } from './text/text.js';
63
63
  export { TextArea } from './text-area/text-area.js';
64
64
  export { TextButton } from './text-button/text-button.js';
65
+ export { Toolbar } from './toolbar/index.js';
65
66
  export { Tooltip, TooltipProvider } from './tooltip/tooltip.js';
66
67
  export { TriggerButton } from './trigger-button/trigger-button.js';
67
68
  export { ScrollContext, ScrollableContainer, useScroll, useScrollContext } from './util-components/scrollable-container/scrollable-container.js';
@@ -0,0 +1,56 @@
1
+ /// <reference types="react" />
2
+ export { type ToolbarButtonProps, type ToolbarIconProps, type ToolbarProps, type ToolbarSeparatorProps, type ToolbarToggleGroupProps, type ToolbarToggleItemProps, type ToolbarTriggerButtonProps, } from './types';
3
+ /**
4
+ * A container for grouping a set of controls, such as buttons, toggle groups or dropdowns.
5
+ * @example
6
+ * <Toolbar.Root>
7
+ * <Toolbar.ToggleGroup type="single">
8
+ * <Toolbar.ToggleItem aria-label="draw" icon={Pencil} value="pencil" />
9
+ * <Toolbar.ToggleItem aria-label="stop-drawing" icon={PencilCrossed} value="pencilCrossed" />
10
+ * </Toolbar.ToggleGroup>
11
+ * <Toolbar.Separator />
12
+ *
13
+ * <Toolbar.Button>
14
+ * share
15
+ * </Toolbar.Button>
16
+ * <Toolbar.Separator />
17
+ *
18
+ * <Toolbar.Button aria-label="delete" >
19
+ * Upload <Toolbar.DropdownIndicator direction="down" />
20
+ * </Toolbar.Button>
21
+ * </Toolbar.Root>
22
+ */
23
+ export declare const Toolbar: {
24
+ /**
25
+ * Contains all parts of the toolbar component.
26
+ */
27
+ Root: import("react").ForwardRefExoticComponent<import("@radix-ui/react-toolbar").ToolbarProps & import("react").RefAttributes<HTMLDivElement>>;
28
+ /**
29
+ * Two-state button that can be toggled on or off.
30
+ */
31
+ ToggleItem: import("react").ForwardRefExoticComponent<import("./types").ToolbarToggleItemProps & import("react").RefAttributes<HTMLButtonElement>>;
32
+ /**
33
+ * Parent for a set of `Toolbar.ToggleItem` subcomponents.
34
+ */
35
+ ToggleGroup: import("react").ForwardRefExoticComponent<import("@radix-ui/react-toolbar").ToggleGroupProps & import("react").RefAttributes<HTMLDivElement>>;
36
+ /**
37
+ * A button that is used as a trigger for dropdown elements.
38
+ */
39
+ DropdownTriggerButton: import("react").ForwardRefExoticComponent<import("./types").ToolbarTriggerButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
40
+ /**
41
+ * SVG element used to render icon in buttons.
42
+ */
43
+ Icon: import("react").ForwardRefExoticComponent<import("./types").ToolbarIconProps & import("react").RefAttributes<SVGSVGElement>>;
44
+ /**
45
+ * A button item.
46
+ */
47
+ Button: import("react").ForwardRefExoticComponent<import("./types").ToolbarButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
48
+ /**
49
+ * Component used to visually separate options in the Toolbar.
50
+ */
51
+ Separator: import("react").ForwardRefExoticComponent<import("@radix-ui/react-toolbar").ToolbarSeparatorProps & import("react").RefAttributes<HTMLDivElement>>;
52
+ /**
53
+ * Caret icon indicating dropdown.
54
+ */
55
+ DropdownIndicator: import("react").ForwardRefExoticComponent<import("./types").ToolbarDropdownIndicatorProps & import("react").RefAttributes<SVGSVGElement>>;
56
+ };
@@ -0,0 +1,65 @@
1
+ import { ToolbarButton } from './toolbar-button.js';
2
+ import { ToolbarDropdownIndicator } from './toolbar-dropdown-indicator.js';
3
+ import { ToolbarIcon } from './toolbar-icon.js';
4
+ import { ToolbarRoot } from './toolbar-root.js';
5
+ import { ToolbarSeparator } from './toolbar-separator.js';
6
+ import { ToolbarToggleGroup } from './toolbar-toggle-group.js';
7
+ import { ToolbarToggleItem } from './toolbar-toggle-item.js';
8
+ import { ToolbarTriggerButton } from './toolbar-trigger-button.js';
9
+
10
+ /**
11
+ * A container for grouping a set of controls, such as buttons, toggle groups or dropdowns.
12
+ * @example
13
+ * <Toolbar.Root>
14
+ * <Toolbar.ToggleGroup type="single">
15
+ * <Toolbar.ToggleItem aria-label="draw" icon={Pencil} value="pencil" />
16
+ * <Toolbar.ToggleItem aria-label="stop-drawing" icon={PencilCrossed} value="pencilCrossed" />
17
+ * </Toolbar.ToggleGroup>
18
+ * <Toolbar.Separator />
19
+ *
20
+ * <Toolbar.Button>
21
+ * share
22
+ * </Toolbar.Button>
23
+ * <Toolbar.Separator />
24
+ *
25
+ * <Toolbar.Button aria-label="delete" >
26
+ * Upload <Toolbar.DropdownIndicator direction="down" />
27
+ * </Toolbar.Button>
28
+ * </Toolbar.Root>
29
+ */
30
+ const Toolbar = {
31
+ /**
32
+ * Contains all parts of the toolbar component.
33
+ */
34
+ Root: ToolbarRoot,
35
+ /**
36
+ * Two-state button that can be toggled on or off.
37
+ */
38
+ ToggleItem: ToolbarToggleItem,
39
+ /**
40
+ * Parent for a set of `Toolbar.ToggleItem` subcomponents.
41
+ */
42
+ ToggleGroup: ToolbarToggleGroup,
43
+ /**
44
+ * A button that is used as a trigger for dropdown elements.
45
+ */
46
+ DropdownTriggerButton: ToolbarTriggerButton,
47
+ /**
48
+ * SVG element used to render icon in buttons.
49
+ */
50
+ Icon: ToolbarIcon,
51
+ /**
52
+ * A button item.
53
+ */
54
+ Button: ToolbarButton,
55
+ /**
56
+ * Component used to visually separate options in the Toolbar.
57
+ */
58
+ Separator: ToolbarSeparator,
59
+ /**
60
+ * Caret icon indicating dropdown.
61
+ */
62
+ DropdownIndicator: ToolbarDropdownIndicator
63
+ };
64
+
65
+ export { Toolbar };
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { type ToolbarButtonProps } from './types';
3
+ export declare const ToolbarButton: import("react").ForwardRefExoticComponent<ToolbarButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,27 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import * as ToolbarPrimitive from '@radix-ui/react-toolbar';
3
+ import clsx from 'clsx';
4
+ import { forwardRef } from 'react';
5
+ import styles from './toolbar.module.js';
6
+
7
+ const ToolbarButton = /*#__PURE__*/forwardRef((props, forwardedRef) => {
8
+ const {
9
+ children,
10
+ style,
11
+ backgroundColor,
12
+ className,
13
+ ...rest
14
+ } = props;
15
+ return jsx(ToolbarPrimitive.Button, {
16
+ ...rest,
17
+ ref: forwardedRef,
18
+ className: clsx(styles.toolbarItem, className),
19
+ style: {
20
+ '--toolbar-button-color': backgroundColor,
21
+ ...style
22
+ },
23
+ children: children
24
+ });
25
+ });
26
+
27
+ export { ToolbarButton };
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { type ToolbarDropdownIndicatorProps } from './types';
3
+ export declare const ToolbarDropdownIndicator: import("react").ForwardRefExoticComponent<ToolbarDropdownIndicatorProps & import("react").RefAttributes<SVGSVGElement>>;
@@ -0,0 +1,25 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { Caret } from '@box/blueprint-web-assets/icons/Fill';
3
+ import { Size3 } from '@box/blueprint-web-assets/tokens/tokens';
4
+ import clsx from 'clsx';
5
+ import { forwardRef } from 'react';
6
+ import styles from './toolbar.module.js';
7
+
8
+ const ToolbarDropdownIndicator = /*#__PURE__*/forwardRef(({
9
+ direction = 'down',
10
+ className,
11
+ color
12
+ }, forwardedRef) => {
13
+ return jsx(Caret, {
14
+ ref: forwardedRef,
15
+ className: clsx({
16
+ [styles.invertDropdownIndicator]: direction === 'up'
17
+ }, className),
18
+ color: color,
19
+ height: Size3,
20
+ role: "presentation",
21
+ width: Size3
22
+ });
23
+ });
24
+
25
+ export { ToolbarDropdownIndicator };
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { type ToolbarIconProps } from './types';
3
+ export declare const ToolbarIcon: React.ForwardRefExoticComponent<ToolbarIconProps & React.RefAttributes<SVGSVGElement>>;
@@ -0,0 +1,20 @@
1
+ import { Size5, IconIconOnLight } from '@box/blueprint-web-assets/tokens/tokens';
2
+ import React__default, { forwardRef } from 'react';
3
+
4
+ const ToolbarIcon = /*#__PURE__*/forwardRef((props, forwardedRef) => {
5
+ const {
6
+ icon,
7
+ className,
8
+ color = IconIconOnLight
9
+ } = props;
10
+ return /*#__PURE__*/React__default.createElement(icon, {
11
+ ref: forwardedRef,
12
+ width: Size5,
13
+ height: Size5,
14
+ role: 'presentation',
15
+ className,
16
+ color
17
+ });
18
+ });
19
+
20
+ export { ToolbarIcon };
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import * as ToolbarPrimitive from '@radix-ui/react-toolbar';
3
+ export declare const ToolbarRoot: import("react").ForwardRefExoticComponent<ToolbarPrimitive.ToolbarProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,21 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import * as ToolbarPrimitive from '@radix-ui/react-toolbar';
3
+ import clsx from 'clsx';
4
+ import { forwardRef } from 'react';
5
+ import styles from './toolbar.module.js';
6
+
7
+ const ToolbarRoot = /*#__PURE__*/forwardRef((props, forwardedRef) => {
8
+ const {
9
+ children,
10
+ className,
11
+ ...rest
12
+ } = props;
13
+ return jsx(ToolbarPrimitive.Root, {
14
+ ...rest,
15
+ ref: forwardedRef,
16
+ className: clsx(styles.root, className),
17
+ children: children
18
+ });
19
+ });
20
+
21
+ export { ToolbarRoot };
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import * as ToolbarPrimitive from '@radix-ui/react-toolbar';
3
+ export declare const ToolbarSeparator: import("react").ForwardRefExoticComponent<ToolbarPrimitive.ToolbarSeparatorProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,20 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import * as ToolbarPrimitive from '@radix-ui/react-toolbar';
3
+ import clsx from 'clsx';
4
+ import { forwardRef } from 'react';
5
+ import styles from './toolbar.module.js';
6
+
7
+ const ToolbarSeparator = /*#__PURE__*/forwardRef((props, forwardedRef) => {
8
+ const {
9
+ children,
10
+ className,
11
+ ...rest
12
+ } = props;
13
+ return jsx(ToolbarPrimitive.Separator, {
14
+ ...rest,
15
+ ref: forwardedRef,
16
+ className: clsx(styles.separator, className)
17
+ });
18
+ });
19
+
20
+ export { ToolbarSeparator };
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import * as ToolbarPrimitive from '@radix-ui/react-toolbar';
3
+ export declare const ToolbarToggleGroup: import("react").ForwardRefExoticComponent<ToolbarPrimitive.ToggleGroupProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,21 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import * as ToolbarPrimitive from '@radix-ui/react-toolbar';
3
+ import clsx from 'clsx';
4
+ import { forwardRef } from 'react';
5
+ import styles from './toolbar.module.js';
6
+
7
+ const ToolbarToggleGroup = /*#__PURE__*/forwardRef((props, forwardedRef) => {
8
+ const {
9
+ children,
10
+ className,
11
+ ...rest
12
+ } = props;
13
+ return jsx(ToolbarPrimitive.ToggleGroup, {
14
+ ...rest,
15
+ ref: forwardedRef,
16
+ className: clsx(styles.toggleGroup, className),
17
+ children: children
18
+ });
19
+ });
20
+
21
+ export { ToolbarToggleGroup };
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { type ToolbarToggleItemProps } from './types';
3
+ export declare const ToolbarToggleItem: import("react").ForwardRefExoticComponent<ToolbarToggleItemProps & import("react").RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,28 @@
1
+ import { jsxs } from 'react/jsx-runtime';
2
+ import { Size6, IconIconOnLight } from '@box/blueprint-web-assets/tokens/tokens';
3
+ import * as ToolbarPrimitive from '@radix-ui/react-toolbar';
4
+ import clsx from 'clsx';
5
+ import { forwardRef, createElement } from 'react';
6
+ import styles from './toolbar.module.js';
7
+
8
+ const ToolbarToggleItem = /*#__PURE__*/forwardRef((props, forwardedRef) => {
9
+ const {
10
+ children,
11
+ icon,
12
+ color = IconIconOnLight,
13
+ ...rest
14
+ } = props;
15
+ return jsxs(ToolbarPrimitive.ToggleItem, {
16
+ ...rest,
17
+ ref: forwardedRef,
18
+ className: clsx(styles.toolbarItem, styles.toolbarToggle),
19
+ children: [children, /*#__PURE__*/createElement(icon, {
20
+ height: Size6,
21
+ width: Size6,
22
+ role: 'presentation',
23
+ color
24
+ })]
25
+ });
26
+ });
27
+
28
+ export { ToolbarToggleItem };
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { type ToolbarTriggerButtonProps } from './types';
3
+ export declare const ToolbarTriggerButton: import("react").ForwardRefExoticComponent<ToolbarTriggerButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,29 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import clsx from 'clsx';
3
+ import { forwardRef } from 'react';
4
+ import { ToolbarButton } from './toolbar-button.js';
5
+ import styles from './toolbar.module.js';
6
+
7
+ const ToolbarTriggerButton = /*#__PURE__*/forwardRef((props, forwardedRef) => {
8
+ const {
9
+ children,
10
+ selected = false,
11
+ className,
12
+ ...rest
13
+ } = props;
14
+ const selectionStateAttrs = {
15
+ 'data-state': selected ? 'on' : 'off',
16
+ 'aria-pressed': Boolean(selected)
17
+ };
18
+ return jsx(ToolbarButton, {
19
+ ...rest,
20
+ ...selectionStateAttrs,
21
+ ref: forwardedRef,
22
+ className: clsx(className, {
23
+ [styles.triggerButtonSelectedWithColor]: props.backgroundColor && selected
24
+ }),
25
+ children: children
26
+ });
27
+ });
28
+
29
+ export { ToolbarTriggerButton };
@@ -0,0 +1,4 @@
1
+ import '../index.css';
2
+ var styles = {"root":"toolbar_module_root--afeab","separator":"toolbar_module_separator--afeab","toggleGroup":"toolbar_module_toggleGroup--afeab","toolbarItem":"toolbar_module_toolbarItem--afeab","toolbarToggle":"toolbar_module_toolbarToggle--afeab","invertDropdownIndicator":"toolbar_module_invertDropdownIndicator--afeab","triggerButtonSelectedWithColor":"toolbar_module_triggerButtonSelectedWithColor--afeab"};
3
+
4
+ export { styles as default };
@@ -0,0 +1,39 @@
1
+ import { type ToggleGroupProps as ToolbarToggleGroupPrimitiveProps, type ToolbarButtonProps as ToolbarPrimitiveButtonProps, type ToolbarProps as ToolbarPrimitiveProps, type ToolbarSeparatorProps as ToolbarPrimitiveSeparatorProps, type ToolbarToggleItemProps as ToolbarPrimitiveToggleItemProps } from '@radix-ui/react-toolbar';
2
+ import { type CSSProperties, type FunctionComponent, type HTMLAttributes, type PropsWithChildren, type SVGProps } from 'react';
3
+ export type ToolbarProps = ToolbarPrimitiveProps;
4
+ export type ToolbarSeparatorProps = ToolbarPrimitiveSeparatorProps;
5
+ export type ToolbarToggleGroupProps = ToolbarToggleGroupPrimitiveProps;
6
+ interface ToolbarButtonCSS extends CSSProperties {
7
+ '--toolbar-button-color'?: string;
8
+ }
9
+ export interface ToolbarButtonProps extends Omit<ToolbarPrimitiveButtonProps, 'style'> {
10
+ /** Sets background color of button element. */
11
+ backgroundColor?: CSSProperties['backgroundColor'];
12
+ style?: ToolbarButtonCSS;
13
+ }
14
+ export interface ToolbarTriggerButtonProps extends ToolbarButtonProps {
15
+ /** Selection state of group opened with button.
16
+ * @default false
17
+ */
18
+ selected?: boolean;
19
+ }
20
+ export interface ToolbarToggleItemProps extends ToolbarPrimitiveToggleItemProps {
21
+ /** Icon rendered by the component. */
22
+ icon: FunctionComponent<PropsWithChildren<SVGProps<SVGSVGElement>>>;
23
+ 'aria-label': NonNullable<HTMLAttributes<HTMLButtonElement>['aria-label']>;
24
+ }
25
+ export type ToolbarIconProps = {
26
+ color?: React.SVGProps<SVGSVGElement>['color'];
27
+ className?: string;
28
+ /** Icon rendered by the component. */
29
+ icon: React.FunctionComponent<React.PropsWithChildren<React.SVGProps<SVGSVGElement>>>;
30
+ };
31
+ export type ToolbarDropdownIndicatorProps = {
32
+ /** Direction in which by indicator is pointing.
33
+ * @default 'down'
34
+ */
35
+ direction?: 'up' | 'down';
36
+ color?: React.SVGProps<SVGSVGElement>['color'];
37
+ className?: string;
38
+ };
39
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/blueprint-web",
3
- "version": "6.10.0",
3
+ "version": "6.11.0",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -45,6 +45,7 @@
45
45
  "@radix-ui/react-switch": "^1.0.3",
46
46
  "@radix-ui/react-toast": "1.1.4",
47
47
  "@radix-ui/react-toggle-group": "^1.0.4",
48
+ "@radix-ui/react-toolbar": "^1.0.4",
48
49
  "@radix-ui/react-tooltip": "1.0.6",
49
50
  "@radix-ui/react-visually-hidden": "^1.0.3",
50
51
  "clsx": "^1.2.1",
@@ -56,7 +57,7 @@
56
57
  "devDependencies": {
57
58
  "@box/storybook-utils": "^0.0.3"
58
59
  },
59
- "gitHead": "6dd474f7b770509844935c8eedd80bc2e61750bd",
60
+ "gitHead": "efa215e8d6bd57e23276f66c3f9b6ff60ed77271",
60
61
  "module": "lib-esm/index.js",
61
62
  "main": "lib-esm/index.js",
62
63
  "exports": {