@box/blueprint-web 5.31.6 → 5.32.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.
@@ -0,0 +1,37 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import clsx from 'clsx';
3
+ import { forwardRef, useRef } from 'react';
4
+ import { useScroll } from '../util-components/scrollable-container/scrollable-container.js';
5
+ import { useForkRef } from '../utils/useForkRef.js';
6
+ import styles from './data-table.module.js';
7
+
8
+ const hideActionWrapperRightOffsetPx = 30;
9
+ const DataTableWrapper = /*#__PURE__*/forwardRef((props, forwardedRef) => {
10
+ const {
11
+ children,
12
+ className,
13
+ ...rest
14
+ } = props;
15
+ const localRef = useRef(null);
16
+ const {
17
+ value: {
18
+ offsetTillEndX,
19
+ isScrolledX,
20
+ isScrolledY
21
+ },
22
+ onScrollThrottled
23
+ } = useScroll(localRef);
24
+ return jsx("div", {
25
+ ref: useForkRef(localRef, forwardedRef),
26
+ className: clsx({
27
+ [styles.hideActionWrapperRight]: offsetTillEndX <= hideActionWrapperRightOffsetPx,
28
+ [styles.isScrolledY]: isScrolledY,
29
+ [styles.isScrolledX]: isScrolledX
30
+ }, styles.dataTableWrapper, className),
31
+ onScroll: onScrollThrottled,
32
+ ...rest,
33
+ children: children
34
+ });
35
+ });
36
+
37
+ export { DataTableWrapper };
@@ -0,0 +1,4 @@
1
+ import '../index.css';
2
+ var styles = {"dataTableWrapper":"data-table-module_dataTableWrapper__VYLJf","isScrolledX":"data-table-module_isScrolledX__72L-a","isScrolledY":"data-table-module_isScrolledY__arf4n","hideActionWrapperRight":"data-table-module_hideActionWrapperRight__jjb50"};
3
+
4
+ export { styles as default };
package/lib-esm/index.css CHANGED
@@ -2845,6 +2845,116 @@
2845
2845
  border:var(--border-2) solid var(--outline-focus-on-light);
2846
2846
  padding:calc(var(--border-1) - var(--border-1)) calc(var(--space-2) - var(--border-1));
2847
2847
  }
2848
+ .scrollable-container-module_scrollableContainer__KAyOF{
2849
+ overflow:auto;
2850
+ }
2851
+
2852
+ .data-table-module_dataTableWrapper__VYLJf{
2853
+ --border-radius-datatable:0;
2854
+ --outline-offset-focus-and-selected-row-datatable:-0.35rem;
2855
+ --outline-select-color-datatable:#0000;
2856
+ --sticky-element-z-index:2;
2857
+ height:100%;
2858
+ overflow:auto;
2859
+ scroll-padding-bottom:60px;
2860
+ scroll-padding-left:100px;
2861
+ scroll-padding-right:100px;
2862
+ scroll-padding-top:60px;
2863
+ width:100%;
2864
+ }
2865
+ .data-table-module_dataTableWrapper__VYLJf table > thead > tr{
2866
+ background:var(--gray-white);
2867
+ position:sticky;
2868
+ top:0;
2869
+ z-index:var(--sticky-element-z-index);
2870
+ }
2871
+ .data-table-module_dataTableWrapper__VYLJf table > thead > tr th:first-child{
2872
+ background:inherit;
2873
+ height:100%;
2874
+ left:0;
2875
+ position:sticky;
2876
+ z-index:var(--sticky-element-z-index);
2877
+ }
2878
+ .data-table-module_dataTableWrapper__VYLJf table > thead > tr th:first-child[data-focus-visible]{
2879
+ position:sticky;
2880
+ z-index:var(--sticky-element-z-index);
2881
+ }
2882
+ .data-table-module_dataTableWrapper__VYLJf table tbody > tr > td [data-actionswrapper]::after{
2883
+ background:inherit;
2884
+ content:"";
2885
+ display:block;
2886
+ height:100%;
2887
+ left:var(--size-4);
2888
+ position:absolute;
2889
+ width:100%;
2890
+ z-index:-1;
2891
+ }
2892
+ .data-table-module_dataTableWrapper__VYLJf table tbody > tr > td:first-child{
2893
+ background:inherit;
2894
+ left:0;
2895
+ position:sticky;
2896
+ z-index:var(--sticky-element-z-index);
2897
+ }
2898
+ .data-table-module_dataTableWrapper__VYLJf table tbody > tr > td:first-child[data-focus-visible]{
2899
+ position:sticky;
2900
+ z-index:var(--sticky-element-z-index);
2901
+ }
2902
+ .data-table-module_dataTableWrapper__VYLJf table tbody > tr > td:first-child[data-focus-visible]::after{
2903
+ display:none;
2904
+ }
2905
+ .data-table-module_dataTableWrapper__VYLJf table tbody > tr > td:first-child::before{
2906
+ background:inherit;
2907
+ border-radius:unset;
2908
+ box-sizing:border-box;
2909
+ content:"";
2910
+ height:inherit;
2911
+ height:100%;
2912
+ left:0;
2913
+ pointer-events:none;
2914
+ position:absolute;
2915
+ top:0;
2916
+ width:var(--space-3);
2917
+ width:calc(100% + var(--outline-offset-focus-row));
2918
+ z-index:-1;
2919
+ }
2920
+ .data-table-module_dataTableWrapper__VYLJf table tbody > tr > td:first-child::after{
2921
+ background:inherit;
2922
+ border-radius:unset;
2923
+ box-sizing:border-box;
2924
+ content:"";
2925
+ height:inherit;
2926
+ height:calc(100% + var(--outline-offset)*2);
2927
+ left:100%;
2928
+ pointer-events:none;
2929
+ position:absolute;
2930
+ top:50%;
2931
+ transform:translate(-100%, -50%);
2932
+ width:var(--space-3);
2933
+ }
2934
+ .data-table-module_dataTableWrapper__VYLJf table tbody > tr[data-focus-visible]{
2935
+ --outline-offset:var(--outline-offset-focus-row);
2936
+ }
2937
+ .data-table-module_dataTableWrapper__VYLJf table tbody > tr[data-focus-visible][aria-selected=true]{
2938
+ --outline-offset:var(--outline-offset-focus-and-selected-row);
2939
+ }
2940
+ .data-table-module_dataTableWrapper__VYLJf table tbody > tr[data-focus-visible] > td:first-child{
2941
+ background-clip:content-box;
2942
+ outline:var(--border-2) solid var(--outline-focus-on-light);
2943
+ outline-offset:var(--outline-offset);
2944
+ }
2945
+
2946
+ .data-table-module_isScrolledX__72L-a tr td:first-child,.data-table-module_isScrolledX__72L-a tr th:first-child{
2947
+ border-right:1px solid var(--border-divider-border);
2948
+ box-shadow:10px 0 7px -4px var(--item-background);
2949
+ }
2950
+
2951
+ .data-table-module_isScrolledY__arf4n table > thead > tr{
2952
+ box-shadow:0 4px 6px -2px rgba(0,0,0,.039);
2953
+ }
2954
+
2955
+ .data-table-module_hideActionWrapperRight__jjb50 table tbody > tr > td [data-actionswrapper]::after{
2956
+ display:none;
2957
+ }
2848
2958
 
2849
2959
  .empty-state-module_emptyState__Qs2b2{
2850
2960
  align-items:center;
@@ -5322,7 +5432,4 @@ table.inline-table-module_inlineTable__Se38I tr:not(:last-child) td{
5322
5432
  }
5323
5433
  .text-button-module_textButton__blsjh:not(:disabled):active{
5324
5434
  color:var(--text-cta-link-pressed);
5325
- }
5326
- .scrollable-container-module_scrollableContainer__KAyOF{
5327
- overflow:auto;
5328
5435
  }
@@ -16,6 +16,7 @@ export * from './checkbox';
16
16
  export * from './combobox';
17
17
  export * from './content-card';
18
18
  export * from './content-field';
19
+ export * from './data-table/data-table-wrapper';
19
20
  export * from './empty-state';
20
21
  export * from './ghost';
21
22
  export * from './guided-tooltip';
@@ -51,5 +52,5 @@ export * from './text-area';
51
52
  export * from './text-button';
52
53
  export * from './tooltip';
53
54
  export * from './trigger-button';
54
- export * from './utils/useBreakpoint';
55
55
  export * from './util-components/scrollable-container/scrollable-container';
56
+ export * from './utils/useBreakpoint';
package/lib-esm/index.js CHANGED
@@ -17,6 +17,7 @@ export { Checkbox } from './checkbox/index.js';
17
17
  export { Combobox, Root } from './combobox/combobox.js';
18
18
  export { ContentCard } from './content-card/content-card.js';
19
19
  export { ContentField } from './content-field/content-field.js';
20
+ export { DataTableWrapper } from './data-table/data-table-wrapper.js';
20
21
  export { EmptyState } from './empty-state/empty-state.js';
21
22
  export { Ghost } from './ghost/ghost.js';
22
23
  export { GuidedTooltip } from './guided-tooltip/guided-tooltip.js';
@@ -56,7 +57,7 @@ export { TextArea } from './text-area/text-area.js';
56
57
  export { TextButton } from './text-button/text-button.js';
57
58
  export { Tooltip, TooltipProvider } from './tooltip/tooltip.js';
58
59
  export { TriggerButton } from './trigger-button/trigger-button.js';
59
- export { Breakpoint, useBreakpoint } from './utils/useBreakpoint.js';
60
60
  export { ScrollableContainer, useScroll, useScrollContext } from './util-components/scrollable-container/scrollable-container.js';
61
+ export { Breakpoint, useBreakpoint } from './utils/useBreakpoint.js';
61
62
  export { useNotification } from './primitives/notification/notification-provider.js';
62
63
  export { useTabs } from './primitives/tabs/use-tabs.js';
@@ -43,11 +43,11 @@ const InputChip = /*#__PURE__*/forwardRef((props, ref) => {
43
43
  children: label
44
44
  }), jsx("span", {
45
45
  className: styles.deleteIcon,
46
+ onClick: onDelete,
46
47
  children: jsx(XMark, {
47
48
  "aria-hidden": true,
48
49
  "data-testid": "delete-icon",
49
50
  height: Size4,
50
- onClick: onDelete,
51
51
  width: Size4
52
52
  })
53
53
  })]
@@ -1,17 +1,19 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { BoxBlue100 } from '@box/blueprint-web-assets/tokens/tokens';
3
+ import clsx from 'clsx';
3
4
  import { forwardRef, createElement } from 'react';
4
5
  import styles from './interactive-icon.module.js';
5
6
 
6
7
  const InteractiveIcon = /*#__PURE__*/forwardRef((props, forwardedRef) => {
7
8
  const {
8
9
  icon,
10
+ className,
9
11
  ...rest
10
12
  } = props;
11
13
  return jsx("button", {
12
14
  ...rest,
13
15
  ref: forwardedRef,
14
- className: styles.interactiveIcon,
16
+ className: clsx(styles.interactiveIcon, className),
15
17
  type: "button",
16
18
  children: /*#__PURE__*/createElement(icon, {
17
19
  color: BoxBlue100,
@@ -21,12 +21,10 @@ const TextWithInfoBadge = props => {
21
21
  className: styles.badgeContainer,
22
22
  children: jsx(Tooltip, {
23
23
  content: infoText,
24
- children: jsx("span", {
24
+ children: jsx(InteractiveIcon, {
25
+ "aria-label": infoBadgeAriaLabel,
25
26
  className: styles.badge,
26
- children: jsx(InteractiveIcon, {
27
- "aria-label": infoBadgeAriaLabel,
28
- icon: InfoBadge
29
- })
27
+ icon: InfoBadge
30
28
  })
31
29
  })
32
30
  })]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/blueprint-web",
3
- "version": "5.31.6",
3
+ "version": "5.32.0",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -27,7 +27,7 @@
27
27
  "**/*.scss"
28
28
  ],
29
29
  "dependencies": {
30
- "@box/blueprint-web-assets": "^4.3.1",
30
+ "@box/blueprint-web-assets": "^4.4.0",
31
31
  "@ariakit/react": "0.3.14",
32
32
  "@ariakit/react-core": "0.3.14",
33
33
  "@radix-ui/react-accordion": "1.1.2",
@@ -57,7 +57,7 @@
57
57
  "devDependencies": {
58
58
  "@box/storybook-utils": "^0.0.2"
59
59
  },
60
- "gitHead": "f39040b937ca2efe6e1fe6b2eaf650f4b21ce277",
60
+ "gitHead": "8e4d56d62068b218d97a606d3b9eb3f3e6a47721",
61
61
  "module": "lib-esm/index.js",
62
62
  "type": "module",
63
63
  "main": "lib-esm/index.js",
@@ -1 +0,0 @@
1
- export { DataTableWrapper } from './data-table-wrapper';