@box/blueprint-web 5.31.6 → 5.32.1

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
@@ -417,6 +417,7 @@
417
417
  border-radius:var(--radius-2);
418
418
  display:flex;
419
419
  gap:var(--space-3);
420
+ justify-content:space-between;
420
421
  padding:var(--space-3) var(--space-4);
421
422
  }
422
423
  .base-inline-notice-module_noticeWrapper__SUUAq .base-inline-notice-module_actions__Lvs4i{
@@ -2845,6 +2846,116 @@
2845
2846
  border:var(--border-2) solid var(--outline-focus-on-light);
2846
2847
  padding:calc(var(--border-1) - var(--border-1)) calc(var(--space-2) - var(--border-1));
2847
2848
  }
2849
+ .scrollable-container-module_scrollableContainer__KAyOF{
2850
+ overflow:auto;
2851
+ }
2852
+
2853
+ .data-table-module_dataTableWrapper__VYLJf{
2854
+ --border-radius-datatable:0;
2855
+ --outline-offset-focus-and-selected-row-datatable:-0.35rem;
2856
+ --outline-select-color-datatable:#0000;
2857
+ --sticky-element-z-index:2;
2858
+ height:100%;
2859
+ overflow:auto;
2860
+ scroll-padding-bottom:60px;
2861
+ scroll-padding-left:100px;
2862
+ scroll-padding-right:100px;
2863
+ scroll-padding-top:60px;
2864
+ width:100%;
2865
+ }
2866
+ .data-table-module_dataTableWrapper__VYLJf table > thead > tr{
2867
+ background:var(--gray-white);
2868
+ position:sticky;
2869
+ top:0;
2870
+ z-index:var(--sticky-element-z-index);
2871
+ }
2872
+ .data-table-module_dataTableWrapper__VYLJf table > thead > tr th:first-child{
2873
+ background:inherit;
2874
+ height:100%;
2875
+ left:0;
2876
+ position:sticky;
2877
+ z-index:var(--sticky-element-z-index);
2878
+ }
2879
+ .data-table-module_dataTableWrapper__VYLJf table > thead > tr th:first-child[data-focus-visible]{
2880
+ position:sticky;
2881
+ z-index:var(--sticky-element-z-index);
2882
+ }
2883
+ .data-table-module_dataTableWrapper__VYLJf table tbody > tr > td [data-actionswrapper]::after{
2884
+ background:inherit;
2885
+ content:"";
2886
+ display:block;
2887
+ height:100%;
2888
+ left:var(--size-4);
2889
+ position:absolute;
2890
+ width:100%;
2891
+ z-index:-1;
2892
+ }
2893
+ .data-table-module_dataTableWrapper__VYLJf table tbody > tr > td:first-child{
2894
+ background:inherit;
2895
+ left:0;
2896
+ position:sticky;
2897
+ z-index:var(--sticky-element-z-index);
2898
+ }
2899
+ .data-table-module_dataTableWrapper__VYLJf table tbody > tr > td:first-child[data-focus-visible]{
2900
+ position:sticky;
2901
+ z-index:var(--sticky-element-z-index);
2902
+ }
2903
+ .data-table-module_dataTableWrapper__VYLJf table tbody > tr > td:first-child[data-focus-visible]::after{
2904
+ display:none;
2905
+ }
2906
+ .data-table-module_dataTableWrapper__VYLJf table tbody > tr > td:first-child::before{
2907
+ background:inherit;
2908
+ border-radius:unset;
2909
+ box-sizing:border-box;
2910
+ content:"";
2911
+ height:inherit;
2912
+ height:100%;
2913
+ left:0;
2914
+ pointer-events:none;
2915
+ position:absolute;
2916
+ top:0;
2917
+ width:var(--space-3);
2918
+ width:calc(100% + var(--outline-offset-focus-row));
2919
+ z-index:-1;
2920
+ }
2921
+ .data-table-module_dataTableWrapper__VYLJf table tbody > tr > td:first-child::after{
2922
+ background:inherit;
2923
+ border-radius:unset;
2924
+ box-sizing:border-box;
2925
+ content:"";
2926
+ height:inherit;
2927
+ height:calc(100% + var(--outline-offset)*2);
2928
+ left:100%;
2929
+ pointer-events:none;
2930
+ position:absolute;
2931
+ top:50%;
2932
+ transform:translate(-100%, -50%);
2933
+ width:var(--space-3);
2934
+ }
2935
+ .data-table-module_dataTableWrapper__VYLJf table tbody > tr[data-focus-visible]{
2936
+ --outline-offset:var(--outline-offset-focus-row);
2937
+ }
2938
+ .data-table-module_dataTableWrapper__VYLJf table tbody > tr[data-focus-visible][aria-selected=true]{
2939
+ --outline-offset:var(--outline-offset-focus-and-selected-row);
2940
+ }
2941
+ .data-table-module_dataTableWrapper__VYLJf table tbody > tr[data-focus-visible] > td:first-child{
2942
+ background-clip:content-box;
2943
+ outline:var(--border-2) solid var(--outline-focus-on-light);
2944
+ outline-offset:var(--outline-offset);
2945
+ }
2946
+
2947
+ .data-table-module_isScrolledX__72L-a tr td:first-child,.data-table-module_isScrolledX__72L-a tr th:first-child{
2948
+ border-right:1px solid var(--border-divider-border);
2949
+ box-shadow:10px 0 7px -4px var(--item-background);
2950
+ }
2951
+
2952
+ .data-table-module_isScrolledY__arf4n table > thead > tr{
2953
+ box-shadow:0 4px 6px -2px rgba(0,0,0,.039);
2954
+ }
2955
+
2956
+ .data-table-module_hideActionWrapperRight__jjb50 table tbody > tr > td [data-actionswrapper]::after{
2957
+ display:none;
2958
+ }
2848
2959
 
2849
2960
  .empty-state-module_emptyState__Qs2b2{
2850
2961
  align-items:center;
@@ -5322,7 +5433,4 @@ table.inline-table-module_inlineTable__Se38I tr:not(:last-child) td{
5322
5433
  }
5323
5434
  .text-button-module_textButton__blsjh:not(:disabled):active{
5324
5435
  color:var(--text-cta-link-pressed);
5325
- }
5326
- .scrollable-container-module_scrollableContainer__KAyOF{
5327
- overflow:auto;
5328
5436
  }
@@ -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.1",
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": "0a79f8d3f91e746fe1af2df2abb6aedfe51a3545",
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';