@box/blueprint-web 6.16.0 → 6.18.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 +41 -28
- package/lib-esm/primitives/icon-button/icon-button.module.js +1 -1
- package/lib-esm/primitives/select-menu-grid/index.d.ts +1 -1
- package/lib-esm/primitives/select-menu-grid/select-menu-grid-option.js +19 -17
- package/lib-esm/primitives/select-menu-grid/select-menu-grid.d.ts +5 -1
- package/lib-esm/primitives/select-menu-grid/select-menu-grid.js +12 -9
- package/lib-esm/primitives/select-menu-grid/types.d.ts +4 -3
- package/lib-esm/toolbar/toolbar-dropdown-indicator.js +2 -2
- package/lib-esm/toolbar/toolbar.module.js +1 -1
- package/lib-esm/util-components/focus-trap/focus-trap.d.ts +0 -1
- package/lib-esm/utils/testStories.utils.d.ts +0 -1
- package/package.json +2 -2
package/lib-esm/index.css
CHANGED
|
@@ -791,7 +791,7 @@
|
|
|
791
791
|
top:0;
|
|
792
792
|
}
|
|
793
793
|
|
|
794
|
-
.icon_button_module_iconButton--
|
|
794
|
+
.icon_button_module_iconButton--5ec37{
|
|
795
795
|
align-items:center;
|
|
796
796
|
background:var(--surface-cta-surface-icon);
|
|
797
797
|
border:0;
|
|
@@ -802,44 +802,47 @@
|
|
|
802
802
|
justify-content:center;
|
|
803
803
|
padding:0;
|
|
804
804
|
}
|
|
805
|
-
.icon_button_module_iconButton--
|
|
805
|
+
.icon_button_module_iconButton--5ec37 .icon_button_module_iconColor--5ec37 *{
|
|
806
806
|
fill:var(--icon-cta-icon);
|
|
807
807
|
}
|
|
808
|
-
.icon_button_module_iconButton--
|
|
808
|
+
.icon_button_module_iconButton--5ec37[aria-disabled=true]{
|
|
809
809
|
background:var(--surface-cta-surface-icon-disabled);
|
|
810
810
|
opacity:.3;
|
|
811
811
|
}
|
|
812
|
-
.icon_button_module_iconButton--
|
|
812
|
+
.icon_button_module_iconButton--5ec37[aria-disabled=true] .icon_button_module_iconColor--5ec37 *{
|
|
813
813
|
fill:var(--gray-50);
|
|
814
814
|
}
|
|
815
|
-
.icon_button_module_iconButton--
|
|
815
|
+
.icon_button_module_iconButton--5ec37:focus-visible{
|
|
816
|
+
outline:none;
|
|
817
|
+
}
|
|
818
|
+
.icon_button_module_iconButton--5ec37[data-focus-visible]{
|
|
816
819
|
background:var(--surface-cta-surface-icon-hover);
|
|
817
820
|
outline:var(--border-2) solid var(--outline-focus-on-light);
|
|
818
821
|
}
|
|
819
|
-
.icon_button_module_iconButton--
|
|
822
|
+
.icon_button_module_iconButton--5ec37[data-focus-visible] .icon_button_module_iconColor--5ec37 *{
|
|
820
823
|
fill:var(--icon-cta-icon-hover);
|
|
821
824
|
}
|
|
822
|
-
.icon_button_module_iconButton--
|
|
825
|
+
.icon_button_module_iconButton--5ec37:hover{
|
|
823
826
|
background:var(--surface-cta-surface-icon-hover);
|
|
824
827
|
}
|
|
825
|
-
.icon_button_module_iconButton--
|
|
828
|
+
.icon_button_module_iconButton--5ec37:hover .icon_button_module_iconColor--5ec37 *{
|
|
826
829
|
fill:var(--icon-cta-icon-hover);
|
|
827
830
|
}
|
|
828
|
-
.icon_button_module_iconButton--
|
|
831
|
+
.icon_button_module_iconButton--5ec37:active,.icon_button_module_iconButton--5ec37[data-active]{
|
|
829
832
|
background:var(--surface-cta-surface-icon-pressed);
|
|
830
833
|
}
|
|
831
|
-
.icon_button_module_iconButton--
|
|
834
|
+
.icon_button_module_iconButton--5ec37:active .icon_button_module_iconColor--5ec37 *,.icon_button_module_iconButton--5ec37[data-active] .icon_button_module_iconColor--5ec37 *{
|
|
832
835
|
fill:var(--icon-cta-icon-pressed);
|
|
833
836
|
}
|
|
834
|
-
.icon_button_module_iconButton--
|
|
837
|
+
.icon_button_module_iconButton--5ec37.icon_button_module_large--5ec37{
|
|
835
838
|
height:var(--size-10);
|
|
836
839
|
width:var(--size-10);
|
|
837
840
|
}
|
|
838
|
-
.icon_button_module_iconButton--
|
|
841
|
+
.icon_button_module_iconButton--5ec37.icon_button_module_small--5ec37{
|
|
839
842
|
height:var(--size-8);
|
|
840
843
|
width:var(--size-8);
|
|
841
844
|
}
|
|
842
|
-
.icon_button_module_iconButton--
|
|
845
|
+
.icon_button_module_iconButton--5ec37.icon_button_module_x-small--5ec37{
|
|
843
846
|
height:var(--size-6);
|
|
844
847
|
width:var(--size-6);
|
|
845
848
|
}
|
|
@@ -5610,7 +5613,7 @@ table.inline_table_module_inlineTable--b023b tr:not(:last-child) td{
|
|
|
5610
5613
|
--z-index-card-tooltip:2147483647;
|
|
5611
5614
|
}
|
|
5612
5615
|
|
|
5613
|
-
.toolbar_module_toolbarRoot--
|
|
5616
|
+
.toolbar_module_toolbarRoot--d025f{
|
|
5614
5617
|
align-items:center;
|
|
5615
5618
|
background:var(--surface-surface);
|
|
5616
5619
|
border:var(--border-1) solid var(--border-card-border);
|
|
@@ -5621,19 +5624,20 @@ table.inline_table_module_inlineTable--b023b tr:not(:last-child) td{
|
|
|
5621
5624
|
padding:calc(var(--space-1) - var(--border-1));
|
|
5622
5625
|
}
|
|
5623
5626
|
|
|
5624
|
-
.toolbar_module_separator--
|
|
5627
|
+
.toolbar_module_separator--d025f{
|
|
5625
5628
|
background-color:var(--border-divider-border);
|
|
5626
5629
|
border-radius:var(--radius-2);
|
|
5627
5630
|
height:var(--size-6);
|
|
5628
5631
|
width:1px;
|
|
5629
5632
|
}
|
|
5630
5633
|
|
|
5631
|
-
.toolbar_module_toggleGroup--
|
|
5634
|
+
.toolbar_module_toggleGroup--d025f,.toolbar_module_toolbarItem--d025f{
|
|
5632
5635
|
display:flex;
|
|
5633
5636
|
gap:var(--space-1);
|
|
5634
5637
|
}
|
|
5635
5638
|
|
|
5636
|
-
.toolbar_module_toolbarItem--
|
|
5639
|
+
.toolbar_module_toolbarItem--d025f{
|
|
5640
|
+
--toolbar-item-hover-opacity:0.3;
|
|
5637
5641
|
align-items:center;
|
|
5638
5642
|
background:var(--toolbar-button-color, var(--surface-toggle-surface));
|
|
5639
5643
|
border:var(--border-1) solid #0000;
|
|
@@ -5648,39 +5652,48 @@ table.inline_table_module_inlineTable--b023b tr:not(:last-child) td{
|
|
|
5648
5652
|
-webkit-user-select:none;
|
|
5649
5653
|
user-select:none;
|
|
5650
5654
|
}
|
|
5651
|
-
.toolbar_module_toolbarItem--
|
|
5655
|
+
.toolbar_module_toolbarItem--d025f[data-disabled]{
|
|
5652
5656
|
background:var(--surface-toggle-surface);
|
|
5653
|
-
opacity
|
|
5657
|
+
opacity:var(--toolbar-item-hover-opacity);
|
|
5654
5658
|
pointer-events:none;
|
|
5655
5659
|
}
|
|
5656
|
-
.toolbar_module_toolbarItem--
|
|
5660
|
+
.toolbar_module_toolbarItem--d025f:not([data-disabled]):focus-visible{
|
|
5657
5661
|
box-shadow:0 0 0 .0625rem #fff,0 0 0 .1875rem #2486fc;
|
|
5658
5662
|
}
|
|
5659
|
-
.toolbar_module_toolbarItem--
|
|
5663
|
+
.toolbar_module_toolbarItem--d025f:not([data-disabled]):hover{
|
|
5660
5664
|
background:var(--toolbar-button-color, var(--surface-toggle-surface-hover));
|
|
5661
5665
|
border:var(--border-1) solid var(--toolbar-button-color, var(--surface-toggle-surface-hover));
|
|
5662
5666
|
}
|
|
5663
5667
|
|
|
5664
|
-
.toolbar_module_toolbarToggle--
|
|
5668
|
+
.toolbar_module_toolbarToggle--d025f[data-state=on]{
|
|
5665
5669
|
background:var(--surface-toggle-surface-pressed);
|
|
5666
5670
|
}
|
|
5667
|
-
.toolbar_module_toolbarToggle--
|
|
5671
|
+
.toolbar_module_toolbarToggle--d025f[data-state=on] svg *{
|
|
5668
5672
|
fill:var(--icon-icon-on-dark);
|
|
5669
5673
|
}
|
|
5670
|
-
.toolbar_module_toolbarToggle--
|
|
5674
|
+
.toolbar_module_toolbarToggle--d025f[data-state=on]:not([data-disabled]):hover{
|
|
5671
5675
|
background:var(--surface-toggle-surface-on-hover);
|
|
5672
5676
|
border:var(--border-1) solid var(--surface-toggle-surface-on-hover);
|
|
5673
5677
|
}
|
|
5674
5678
|
|
|
5675
|
-
.
|
|
5679
|
+
.toolbar_module_dropdownIndicator--d025f.toolbar_module_invertCaret--d025f{
|
|
5676
5680
|
transform:rotate(.5turn);
|
|
5677
5681
|
}
|
|
5678
5682
|
|
|
5679
|
-
.toolbar_module_triggerButtonSelectedWithColor--
|
|
5680
|
-
opacity
|
|
5683
|
+
.toolbar_module_triggerButtonSelectedWithColor--d025f{
|
|
5684
|
+
--trigger-button-hover-opacity:0.7;
|
|
5685
|
+
}
|
|
5686
|
+
.toolbar_module_triggerButtonSelectedWithColor--d025f[data-state=on] .toolbar_module_dropdownIndicator--d025f path{
|
|
5687
|
+
fill:var(--icon-icon-on-light);
|
|
5688
|
+
}
|
|
5689
|
+
.toolbar_module_triggerButtonSelectedWithColor--d025f[data-state=on]:hover{
|
|
5690
|
+
opacity:var(--trigger-button-hover-opacity);
|
|
5691
|
+
}
|
|
5692
|
+
.toolbar_module_triggerButtonSelectedWithColor--d025f[data-state=on] [data-disabled] .toolbar_module_dropdownIndicator--d025f path,.toolbar_module_triggerButtonSelectedWithColor--d025f[data-state=on]:focus-visible .toolbar_module_dropdownIndicator--d025f path,.toolbar_module_triggerButtonSelectedWithColor--d025f[data-state=on]:hover .toolbar_module_dropdownIndicator--d025f path{
|
|
5693
|
+
fill:var(--icon-icon-on-light-tertiary);
|
|
5681
5694
|
}
|
|
5682
5695
|
|
|
5683
|
-
.toolbar_module_toolbarIcon--
|
|
5696
|
+
.toolbar_module_toolbarIcon--d025f{
|
|
5684
5697
|
align-items:center;
|
|
5685
5698
|
display:flex;
|
|
5686
5699
|
height:var(--size-5);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '../../index.css';
|
|
2
|
-
var styles = {"iconButton":"icon_button_module_iconButton--
|
|
2
|
+
var styles = {"iconButton":"icon_button_module_iconButton--5ec37","iconColor":"icon_button_module_iconColor--5ec37","large":"icon_button_module_large--5ec37","small":"icon_button_module_small--5ec37","x-small":"icon_button_module_x-small--5ec37"};
|
|
3
3
|
|
|
4
4
|
export { styles as default };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SelectMenuGrid } from './select-menu-grid';
|
|
2
2
|
import { SelectMenuGridColorCircle, SelectMenuGridOption, SelectMenuGridSquare } from './select-menu-grid-option';
|
|
3
|
+
export { type SelectMenuGridProps, type SelectMenuOptionProps } from './types';
|
|
3
4
|
type SelectMenuOption = typeof SelectMenuGridOption & {
|
|
4
5
|
Square: typeof SelectMenuGridSquare;
|
|
5
6
|
ColorCircle: typeof SelectMenuGridColorCircle;
|
|
@@ -9,4 +10,3 @@ type SelectMenuType = {
|
|
|
9
10
|
Grid: typeof SelectMenuGrid;
|
|
10
11
|
};
|
|
11
12
|
export declare const SelectMenu: SelectMenuType;
|
|
12
|
-
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { Button } from '@ariakit/react';
|
|
2
|
+
import { CompositeItem, Button } from '@ariakit/react';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import Color from 'color';
|
|
5
5
|
import { forwardRef } from 'react';
|
|
@@ -33,22 +33,24 @@ const SelectMenuGridOption = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
33
33
|
const isButtonActive = !disabled && !loading && active;
|
|
34
34
|
const shouldShowTooltip = !isButtonDisabled;
|
|
35
35
|
// TODO: [DSYS-764] use IconButton instead of AriakitButton
|
|
36
|
-
const button =
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
36
|
+
const button = jsx(CompositeItem, {
|
|
37
|
+
render: jsxs(Button, {
|
|
38
|
+
...restProps,
|
|
39
|
+
ref: forwardedRef,
|
|
40
|
+
"aria-label": loading ? loadingAriaLabel : ariaLabel,
|
|
41
|
+
className: clsx(styles.optionButton, className, {
|
|
42
|
+
[styles.loading]: loading,
|
|
43
|
+
[styles.active]: isButtonActive
|
|
44
|
+
}),
|
|
45
|
+
disabled: isButtonDisabled,
|
|
46
|
+
children: [variant === 'colorCircle' && jsx(ColorSwatch, {
|
|
47
|
+
color: color || '',
|
|
48
|
+
loading: !!loading
|
|
49
|
+
}), variant === 'square' && jsx(Icon, {
|
|
50
|
+
loading: !!loading,
|
|
51
|
+
children: children
|
|
52
|
+
})]
|
|
53
|
+
})
|
|
52
54
|
});
|
|
53
55
|
return jsxs("div", {
|
|
54
56
|
className: styles.buttonWrapper,
|
|
@@ -2,4 +2,8 @@
|
|
|
2
2
|
export declare const SelectMenuGrid: import("react").ForwardRefExoticComponent<Omit<{
|
|
3
3
|
children: import("react").ReactNode;
|
|
4
4
|
columns: number;
|
|
5
|
-
} & import("react").
|
|
5
|
+
} & import("@ariakit/react").CompositeOptions<"div"> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
6
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
7
|
+
}, keyof import("@ariakit/react").CompositeOptions<T>> & {
|
|
8
|
+
[index: `data-${string}`]: unknown;
|
|
9
|
+
}, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { CompositeProvider, Composite, CompositeRow } from '@ariakit/react';
|
|
2
3
|
import clsx from 'clsx';
|
|
3
4
|
import chunk from 'lodash/chunk';
|
|
4
5
|
import { forwardRef, Children } from 'react';
|
|
5
6
|
import styles from './select-menu-grid.module.js';
|
|
6
7
|
|
|
7
|
-
const Row = props => jsx(
|
|
8
|
+
const Row = props => jsx(CompositeRow, {
|
|
8
9
|
...props,
|
|
9
10
|
className: styles.row,
|
|
10
11
|
role: "row"
|
|
@@ -17,14 +18,16 @@ const SelectMenuGrid = /*#__PURE__*/forwardRef((props, forwardedRef) => {
|
|
|
17
18
|
...rest
|
|
18
19
|
} = props;
|
|
19
20
|
const childrenByColumns = chunk(Children.toArray(children), columns);
|
|
20
|
-
return jsx(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
children: row
|
|
27
|
-
|
|
21
|
+
return jsx(CompositeProvider, {
|
|
22
|
+
children: jsx(Composite, {
|
|
23
|
+
...rest,
|
|
24
|
+
ref: forwardedRef,
|
|
25
|
+
className: clsx(styles.grid, className),
|
|
26
|
+
role: "grid",
|
|
27
|
+
children: childrenByColumns.map((row, i) => jsx(Row, {
|
|
28
|
+
children: row
|
|
29
|
+
}, row[0]?.key || i))
|
|
30
|
+
})
|
|
28
31
|
});
|
|
29
32
|
});
|
|
30
33
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { type ButtonProps as AriakitButtonProps } from '@ariakit/react';
|
|
2
|
+
import { type ButtonProps as AriakitButtonProps, type CompositeProps, type CompositeRowProps } from '@ariakit/react';
|
|
3
3
|
import { type RequireAllOrNone, type SetOptional } from 'type-fest';
|
|
4
4
|
type Loading = {
|
|
5
5
|
/** Loading state of the grid option. Ghost section is displaying as a placeholder. When this is true `loadingAriaLabel` must also be provided. */
|
|
@@ -23,13 +23,14 @@ export type SelectMenuGridColorCircleProps = CommonOptionProps & {
|
|
|
23
23
|
/** The color of the swatch */
|
|
24
24
|
color: string;
|
|
25
25
|
};
|
|
26
|
-
export type
|
|
26
|
+
export type SelectMenuOptionProps = SetOptional<SelectMenuGridSquareProps, keyof SelectMenuGridSquareProps> & SetOptional<SelectMenuGridColorCircleProps, keyof SelectMenuGridColorCircleProps> & {
|
|
27
27
|
variant: 'square' | 'colorCircle';
|
|
28
28
|
};
|
|
29
|
+
export type SelectMenuGridRowProps = CompositeRowProps;
|
|
29
30
|
export type SelectMenuGridProps = {
|
|
30
31
|
/** The grid options to render */
|
|
31
32
|
children: React.ReactNode;
|
|
32
33
|
/** The number of columns to slice the grid options into */
|
|
33
34
|
columns: number;
|
|
34
|
-
} &
|
|
35
|
+
} & CompositeProps;
|
|
35
36
|
export {};
|
|
@@ -13,8 +13,8 @@ const ToolbarDropdownIndicator = /*#__PURE__*/forwardRef(({
|
|
|
13
13
|
return jsx(Caret, {
|
|
14
14
|
ref: forwardedRef,
|
|
15
15
|
className: clsx({
|
|
16
|
-
[styles.
|
|
17
|
-
}, className),
|
|
16
|
+
[styles.invertCaret]: direction === 'up'
|
|
17
|
+
}, styles.dropdownIndicator, className),
|
|
18
18
|
color: color,
|
|
19
19
|
height: Size2,
|
|
20
20
|
role: "presentation",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '../index.css';
|
|
2
|
-
var styles = {"toolbarRoot":"toolbar_module_toolbarRoot--
|
|
2
|
+
var styles = {"toolbarRoot":"toolbar_module_toolbarRoot--d025f","separator":"toolbar_module_separator--d025f","toggleGroup":"toolbar_module_toggleGroup--d025f","toolbarItem":"toolbar_module_toolbarItem--d025f","toolbarToggle":"toolbar_module_toolbarToggle--d025f","dropdownIndicator":"toolbar_module_dropdownIndicator--d025f","invertCaret":"toolbar_module_invertCaret--d025f","triggerButtonSelectedWithColor":"toolbar_module_triggerButtonSelectedWithColor--d025f","toolbarIcon":"toolbar_module_toolbarIcon--d025f"};
|
|
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": "6.
|
|
3
|
+
"version": "6.18.0",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@box/storybook-utils": "^0.0.3"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "712a73b1a539afe140ea0623caf6f168a4fe2099",
|
|
61
61
|
"module": "lib-esm/index.js",
|
|
62
62
|
"main": "lib-esm/index.js",
|
|
63
63
|
"exports": {
|