@box/blueprint-web 9.12.2 → 9.13.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.
@@ -1088,210 +1088,6 @@ License for @react-aria/utils:
1088
1088
  limitations under the License.
1089
1089
 
1090
1090
 
1091
- License for @react-types/shared:
1092
- Apache License
1093
- Version 2.0, January 2004
1094
- http://www.apache.org/licenses/
1095
-
1096
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1097
-
1098
- 1. Definitions.
1099
-
1100
- "License" shall mean the terms and conditions for use, reproduction,
1101
- and distribution as defined by Sections 1 through 9 of this document.
1102
-
1103
- "Licensor" shall mean the copyright owner or entity authorized by
1104
- the copyright owner that is granting the License.
1105
-
1106
- "Legal Entity" shall mean the union of the acting entity and all
1107
- other entities that control, are controlled by, or are under common
1108
- control with that entity. For the purposes of this definition,
1109
- "control" means (i) the power, direct or indirect, to cause the
1110
- direction or management of such entity, whether by contract or
1111
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
1112
- outstanding shares, or (iii) beneficial ownership of such entity.
1113
-
1114
- "You" (or "Your") shall mean an individual or Legal Entity
1115
- exercising permissions granted by this License.
1116
-
1117
- "Source" form shall mean the preferred form for making modifications,
1118
- including but not limited to software source code, documentation
1119
- source, and configuration files.
1120
-
1121
- "Object" form shall mean any form resulting from mechanical
1122
- transformation or translation of a Source form, including but
1123
- not limited to compiled object code, generated documentation,
1124
- and conversions to other media types.
1125
-
1126
- "Work" shall mean the work of authorship, whether in Source or
1127
- Object form, made available under the License, as indicated by a
1128
- copyright notice that is included in or attached to the work
1129
- (an example is provided in the Appendix below).
1130
-
1131
- "Derivative Works" shall mean any work, whether in Source or Object
1132
- form, that is based on (or derived from) the Work and for which the
1133
- editorial revisions, annotations, elaborations, or other modifications
1134
- represent, as a whole, an original work of authorship. For the purposes
1135
- of this License, Derivative Works shall not include works that remain
1136
- separable from, or merely link (or bind by name) to the interfaces of,
1137
- the Work and Derivative Works thereof.
1138
-
1139
- "Contribution" shall mean any work of authorship, including
1140
- the original version of the Work and any modifications or additions
1141
- to that Work or Derivative Works thereof, that is intentionally
1142
- submitted to Licensor for inclusion in the Work by the copyright owner
1143
- or by an individual or Legal Entity authorized to submit on behalf of
1144
- the copyright owner. For the purposes of this definition, "submitted"
1145
- means any form of electronic, verbal, or written communication sent
1146
- to the Licensor or its representatives, including but not limited to
1147
- communication on electronic mailing lists, source code control systems,
1148
- and issue tracking systems that are managed by, or on behalf of, the
1149
- Licensor for the purpose of discussing and improving the Work, but
1150
- excluding communication that is conspicuously marked or otherwise
1151
- designated in writing by the copyright owner as "Not a Contribution."
1152
-
1153
- "Contributor" shall mean Licensor and any individual or Legal Entity
1154
- on behalf of whom a Contribution has been received by Licensor and
1155
- subsequently incorporated within the Work.
1156
-
1157
- 2. Grant of Copyright License. Subject to the terms and conditions of
1158
- this License, each Contributor hereby grants to You a perpetual,
1159
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
1160
- copyright license to reproduce, prepare Derivative Works of,
1161
- publicly display, publicly perform, sublicense, and distribute the
1162
- Work and such Derivative Works in Source or Object form.
1163
-
1164
- 3. Grant of Patent License. Subject to the terms and conditions of
1165
- this License, each Contributor hereby grants to You a perpetual,
1166
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
1167
- (except as stated in this section) patent license to make, have made,
1168
- use, offer to sell, sell, import, and otherwise transfer the Work,
1169
- where such license applies only to those patent claims licensable
1170
- by such Contributor that are necessarily infringed by their
1171
- Contribution(s) alone or by combination of their Contribution(s)
1172
- with the Work to which such Contribution(s) was submitted. If You
1173
- institute patent litigation against any entity (including a
1174
- cross-claim or counterclaim in a lawsuit) alleging that the Work
1175
- or a Contribution incorporated within the Work constitutes direct
1176
- or contributory patent infringement, then any patent licenses
1177
- granted to You under this License for that Work shall terminate
1178
- as of the date such litigation is filed.
1179
-
1180
- 4. Redistribution. You may reproduce and distribute copies of the
1181
- Work or Derivative Works thereof in any medium, with or without
1182
- modifications, and in Source or Object form, provided that You
1183
- meet the following conditions:
1184
-
1185
- (a) You must give any other recipients of the Work or
1186
- Derivative Works a copy of this License; and
1187
-
1188
- (b) You must cause any modified files to carry prominent notices
1189
- stating that You changed the files; and
1190
-
1191
- (c) You must retain, in the Source form of any Derivative Works
1192
- that You distribute, all copyright, patent, trademark, and
1193
- attribution notices from the Source form of the Work,
1194
- excluding those notices that do not pertain to any part of
1195
- the Derivative Works; and
1196
-
1197
- (d) If the Work includes a "NOTICE" text file as part of its
1198
- distribution, then any Derivative Works that You distribute must
1199
- include a readable copy of the attribution notices contained
1200
- within such NOTICE file, excluding those notices that do not
1201
- pertain to any part of the Derivative Works, in at least one
1202
- of the following places: within a NOTICE text file distributed
1203
- as part of the Derivative Works; within the Source form or
1204
- documentation, if provided along with the Derivative Works; or,
1205
- within a display generated by the Derivative Works, if and
1206
- wherever such third-party notices normally appear. The contents
1207
- of the NOTICE file are for informational purposes only and
1208
- do not modify the License. You may add Your own attribution
1209
- notices within Derivative Works that You distribute, alongside
1210
- or as an addendum to the NOTICE text from the Work, provided
1211
- that such additional attribution notices cannot be construed
1212
- as modifying the License.
1213
-
1214
- You may add Your own copyright statement to Your modifications and
1215
- may provide additional or different license terms and conditions
1216
- for use, reproduction, or distribution of Your modifications, or
1217
- for any such Derivative Works as a whole, provided Your use,
1218
- reproduction, and distribution of the Work otherwise complies with
1219
- the conditions stated in this License.
1220
-
1221
- 5. Submission of Contributions. Unless You explicitly state otherwise,
1222
- any Contribution intentionally submitted for inclusion in the Work
1223
- by You to the Licensor shall be under the terms and conditions of
1224
- this License, without any additional terms or conditions.
1225
- Notwithstanding the above, nothing herein shall supersede or modify
1226
- the terms of any separate license agreement you may have executed
1227
- with Licensor regarding such Contributions.
1228
-
1229
- 6. Trademarks. This License does not grant permission to use the trade
1230
- names, trademarks, service marks, or product names of the Licensor,
1231
- except as required for reasonable and customary use in describing the
1232
- origin of the Work and reproducing the content of the NOTICE file.
1233
-
1234
- 7. Disclaimer of Warranty. Unless required by applicable law or
1235
- agreed to in writing, Licensor provides the Work (and each
1236
- Contributor provides its Contributions) on an "AS IS" BASIS,
1237
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
1238
- implied, including, without limitation, any warranties or conditions
1239
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
1240
- PARTICULAR PURPOSE. You are solely responsible for determining the
1241
- appropriateness of using or redistributing the Work and assume any
1242
- risks associated with Your exercise of permissions under this License.
1243
-
1244
- 8. Limitation of Liability. In no event and under no legal theory,
1245
- whether in tort (including negligence), contract, or otherwise,
1246
- unless required by applicable law (such as deliberate and grossly
1247
- negligent acts) or agreed to in writing, shall any Contributor be
1248
- liable to You for damages, including any direct, indirect, special,
1249
- incidental, or consequential damages of any character arising as a
1250
- result of this License or out of the use or inability to use the
1251
- Work (including but not limited to damages for loss of goodwill,
1252
- work stoppage, computer failure or malfunction, or any and all
1253
- other commercial damages or losses), even if such Contributor
1254
- has been advised of the possibility of such damages.
1255
-
1256
- 9. Accepting Warranty or Additional Liability. While redistributing
1257
- the Work or Derivative Works thereof, You may choose to offer,
1258
- and charge a fee for, acceptance of support, warranty, indemnity,
1259
- or other liability obligations and/or rights consistent with this
1260
- License. However, in accepting such obligations, You may act only
1261
- on Your own behalf and on Your sole responsibility, not on behalf
1262
- of any other Contributor, and only if You agree to indemnify,
1263
- defend, and hold each Contributor harmless for any liability
1264
- incurred by, or claims asserted against, such Contributor by reason
1265
- of your accepting any such warranty or additional liability.
1266
-
1267
- END OF TERMS AND CONDITIONS
1268
-
1269
- APPENDIX: How to apply the Apache License to your work.
1270
-
1271
- To apply the Apache License to your work, attach the following
1272
- boilerplate notice, with the fields enclosed by brackets "[]"
1273
- replaced with your own identifying information. (Don't include
1274
- the brackets!) The text should be enclosed in the appropriate
1275
- comment syntax for the file format. We also recommend that a
1276
- file or class name and description of purpose be included on the
1277
- same "printed page" as the copyright notice for easier
1278
- identification within third-party archives.
1279
-
1280
- Copyright 2019 Adobe
1281
-
1282
- Licensed under the Apache License, Version 2.0 (the "License");
1283
- you may not use this file except in compliance with the License.
1284
- You may obtain a copy of the License at
1285
-
1286
- http://www.apache.org/licenses/LICENSE-2.0
1287
-
1288
- Unless required by applicable law or agreed to in writing, software
1289
- distributed under the License is distributed on an "AS IS" BASIS,
1290
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1291
- See the License for the specific language governing permissions and
1292
- limitations under the License.
1293
-
1294
-
1295
1091
  License for clsx:
1296
1092
  MIT License
1297
1093
 
@@ -8,5 +8,6 @@ import { type CardTooltipProps } from './types';
8
8
  *
9
9
  * **IMPORTANT (2)**: Must wrap interactive component/element (such as: HTMLInputElement, HTMLAnchorElement, HTMLTextAreaElement, etc. [list of focusable elements](https://allyjs.io/data-tables/focusable.html))
10
10
  *
11
+ * @deprecated Use CardTooltipV2 instead.
11
12
  */
12
13
  export declare const CardTooltip: (props: CardTooltipProps) => import("react/jsx-runtime").JSX.Element;
@@ -15,6 +15,7 @@ import styles from './card-tooltip.module.js';
15
15
  *
16
16
  * **IMPORTANT (2)**: Must wrap interactive component/element (such as: HTMLInputElement, HTMLAnchorElement, HTMLTextAreaElement, etc. [list of focusable elements](https://allyjs.io/data-tables/focusable.html))
17
17
  *
18
+ * @deprecated Use CardTooltipV2 instead.
18
19
  */
19
20
  const CardTooltip = props => {
20
21
  const {
@@ -0,0 +1,10 @@
1
+ import { type CardTooltipV2Props } from './types';
2
+ /**
3
+ * CardTooltipV2 is a component that wraps a Card component inside a Tooltip component. The main difference between CardTooltipV2 and CardTooltip is that CardTooltipV2 uses Ariakit Tooltip component instead of Radix Tooltip component.
4
+ *
5
+ * You must only pass non-interactive content inside `content` prop.
6
+ *
7
+ * **IMPORTANT**: Must wrap interactive component/element (such as: HTMLInputElement, HTMLAnchorElement, HTMLTextAreaElement, etc. [list of focusable elements](https://allyjs.io/data-tables/focusable.html))
8
+ *
9
+ */
10
+ export declare const CardTooltipV2: import("react").ForwardRefExoticComponent<CardTooltipV2Props & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,95 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import * as Ariakit from '@ariakit/react';
3
+ import clsx from 'clsx';
4
+ import { forwardRef, useLayoutEffect, useCallback } from 'react';
5
+ import { Card } from '../card/card.js';
6
+ import { composeEventHandlers } from '../utils/composeEventHandlers.js';
7
+ import styles from './card-tooltip-v2.module.js';
8
+
9
+ /**
10
+ * CardTooltipV2 is a component that wraps a Card component inside a Tooltip component. The main difference between CardTooltipV2 and CardTooltip is that CardTooltipV2 uses Ariakit Tooltip component instead of Radix Tooltip component.
11
+ *
12
+ * You must only pass non-interactive content inside `content` prop.
13
+ *
14
+ * **IMPORTANT**: Must wrap interactive component/element (such as: HTMLInputElement, HTMLAnchorElement, HTMLTextAreaElement, etc. [list of focusable elements](https://allyjs.io/data-tables/focusable.html))
15
+ *
16
+ */
17
+ const CardTooltipV2 = /*#__PURE__*/forwardRef((props, ref) => {
18
+ const {
19
+ children,
20
+ content,
21
+ setOpen,
22
+ open,
23
+ defaultOpen,
24
+ className,
25
+ skipTimeout,
26
+ hideTooltipOnContentClick,
27
+ hideOnInteractOutside,
28
+ placement = 'bottom',
29
+ elevation = 'dropshadow-3',
30
+ ...contentProps
31
+ } = props;
32
+ const tooltipStore = Ariakit.useTooltipStore({
33
+ open,
34
+ setOpen,
35
+ defaultOpen,
36
+ placement,
37
+ showTimeout: 300,
38
+ hideTimeout: 0,
39
+ skipTimeout
40
+ });
41
+ const side = Ariakit.useStoreState(tooltipStore, 'currentPlacement').split('-')[0];
42
+ const contentId = Ariakit.useStoreState(tooltipStore, state => state.contentElement?.id);
43
+ const mounted = Ariakit.useStoreState(tooltipStore, 'mounted');
44
+ const isOpen = Ariakit.useStoreState(tooltipStore, 'open');
45
+ useLayoutEffect(() => {
46
+ if (mounted && !isOpen) {
47
+ // Make sure that tooltip disappears instantly after it is closed.
48
+ // Otherwise, once a tooltip is hovered, moving mouse to other tooltips
49
+ // could open them without honoring `showTimeout`.
50
+ tooltipStore.setState('animating', false);
51
+ }
52
+ }, [isOpen, mounted, tooltipStore]);
53
+ const handleHideOnInteractOutside = useCallback(e => {
54
+ if (typeof hideOnInteractOutside === 'function') {
55
+ hideOnInteractOutside(e);
56
+ }
57
+ if (e.type === 'focusin') {
58
+ const state = tooltipStore.getState();
59
+ const contentElement = state?.contentElement;
60
+ // If tooltip content is losing focus, do not hide it
61
+ // since it can be stolen sometimes by elements outside of it.
62
+ if (e?.relatedTarget === contentElement) {
63
+ return false;
64
+ }
65
+ }
66
+ return true;
67
+ }, [hideOnInteractOutside, tooltipStore]);
68
+ return jsxs(Ariakit.TooltipProvider, {
69
+ store: tooltipStore,
70
+ children: [jsx(Ariakit.TooltipAnchor, {
71
+ ...(mounted && {
72
+ 'aria-describedby': contentId
73
+ }),
74
+ onClick: tooltipStore.hide,
75
+ render: children
76
+ }), jsx(Ariakit.Tooltip, {
77
+ ...contentProps,
78
+ ...(hideTooltipOnContentClick && {
79
+ onClick: composeEventHandlers(tooltipStore.hide, contentProps.onClick)
80
+ }),
81
+ ref: ref,
82
+ className: clsx(styles.content, className),
83
+ "data-side": side,
84
+ fitViewport: true,
85
+ gutter: 4,
86
+ hideOnInteractOutside: handleHideOnInteractOutside,
87
+ children: jsx(Card, {
88
+ elevation: elevation,
89
+ children: content
90
+ })
91
+ })]
92
+ });
93
+ });
94
+
95
+ export { CardTooltipV2 };
@@ -0,0 +1,4 @@
1
+ import '../index.css';
2
+ var styles = {"content":"bp_card_tooltip_v2_module_content--86ebe","slideDownAndFade":"bp_card_tooltip_v2_module_slideDownAndFade--86ebe","slideLeftAndFade":"bp_card_tooltip_v2_module_slideLeftAndFade--86ebe","slideUpAndFade":"bp_card_tooltip_v2_module_slideUpAndFade--86ebe","slideRightAndFade":"bp_card_tooltip_v2_module_slideRightAndFade--86ebe"};
3
+
4
+ export { styles as default };
@@ -0,0 +1,2 @@
1
+ export { CardTooltipV2 } from './card-tooltip-v2';
2
+ export { type CardTooltipV2Props } from './types';
@@ -0,0 +1,25 @@
1
+ import { type TooltipProps, type TooltipStoreProps } from '@ariakit/react';
2
+ import { type ReactElement, type ReactNode } from 'react';
3
+ import { type CardProps } from '../card/types';
4
+ export interface CardTooltipV2Props extends Omit<TooltipProps, 'content' | 'ref'> {
5
+ /** The anchor for the tooltip. */
6
+ children: ReactElement;
7
+ /** The content of the tooltip. */
8
+ content: ReactNode;
9
+ defaultOpen?: TooltipStoreProps['defaultOpen'];
10
+ /**
11
+ * The elevation of the Card inside.
12
+ * @default dropshadow-3
13
+ */
14
+ elevation?: CardProps['elevation'];
15
+ /**
16
+ * If true, the tooltip will close itself when the content area is clicked.
17
+ * @default false
18
+ */
19
+ hideTooltipOnContentClick?: boolean;
20
+ open?: TooltipStoreProps['open'];
21
+ placement?: TooltipStoreProps['placement'];
22
+ portalElement?: TooltipProps['portalElement'];
23
+ setOpen?: TooltipStoreProps['setOpen'];
24
+ skipTimeout?: TooltipStoreProps['skipTimeout'];
25
+ }
package/lib-esm/index.css CHANGED
@@ -1031,6 +1031,82 @@
1031
1031
  }
1032
1032
  }
1033
1033
 
1034
+ .bp_card_tooltip_v2_module_content--86ebe{
1035
+ border-radius:var(--radius-1);
1036
+ font-family:Lato, -apple-system, BlinkMacSystemFont, "San Francisco", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
1037
+ font-size:.875rem;
1038
+ font-weight:400;
1039
+ letter-spacing:.01875rem;
1040
+ line-height:1.25rem;
1041
+ max-height:var(--popover-available-height);
1042
+ max-width:336px;
1043
+ min-width:168px;
1044
+ padding:var(--space-2) var(--space-3);
1045
+ position:relative;
1046
+ text-decoration:none;
1047
+ text-transform:none;
1048
+ word-break:break-word;
1049
+ z-index:2147483647;
1050
+ }
1051
+ .bp_card_tooltip_v2_module_content--86ebe[data-open]{
1052
+ animation-duration:var(--animation-duration-4);
1053
+ animation-timing-function:var(--animation-easing-ease-base);
1054
+ will-change:transform, opacity;
1055
+ }
1056
+ .bp_card_tooltip_v2_module_content--86ebe[data-open][data-side=top]{
1057
+ animation-name:bp_card_tooltip_v2_module_slideDownAndFade--86ebe;
1058
+ }
1059
+ .bp_card_tooltip_v2_module_content--86ebe[data-open][data-side=right]{
1060
+ animation-name:bp_card_tooltip_v2_module_slideLeftAndFade--86ebe;
1061
+ }
1062
+ .bp_card_tooltip_v2_module_content--86ebe[data-open][data-side=bottom]{
1063
+ animation-name:bp_card_tooltip_v2_module_slideUpAndFade--86ebe;
1064
+ }
1065
+ .bp_card_tooltip_v2_module_content--86ebe[data-open][data-side=left]{
1066
+ animation-name:bp_card_tooltip_v2_module_slideRightAndFade--86ebe;
1067
+ }
1068
+
1069
+ @keyframes bp_card_tooltip_v2_module_slideUpAndFade--86ebe{
1070
+ from{
1071
+ opacity:0;
1072
+ transform:translateY(2px);
1073
+ }
1074
+ to{
1075
+ opacity:1;
1076
+ transform:translateY(0);
1077
+ }
1078
+ }
1079
+ @keyframes bp_card_tooltip_v2_module_slideRightAndFade--86ebe{
1080
+ from{
1081
+ opacity:0;
1082
+ transform:translateX(-2px);
1083
+ }
1084
+ to{
1085
+ opacity:1;
1086
+ transform:translateX(0);
1087
+ }
1088
+ }
1089
+ @keyframes bp_card_tooltip_v2_module_slideDownAndFade--86ebe{
1090
+ from{
1091
+ opacity:0;
1092
+ transform:translateY(-2px);
1093
+ }
1094
+ to{
1095
+ opacity:1;
1096
+ transform:translateY(0);
1097
+ }
1098
+ }
1099
+ @keyframes bp_card_tooltip_v2_module_slideLeftAndFade--86ebe{
1100
+ from{
1101
+ opacity:0;
1102
+ transform:translateX(2px);
1103
+ }
1104
+ to{
1105
+ opacity:1;
1106
+ transform:translateX(0);
1107
+ }
1108
+ }
1109
+
1034
1110
  .bp_interactive_icon_module_interactiveIcon--0dec5{
1035
1111
  all:unset;
1036
1112
  background:none;
@@ -7,6 +7,7 @@ export * from './button';
7
7
  export * from './button-wrapper';
8
8
  export * from './card';
9
9
  export * from './card-tooltip';
10
+ export * from './card-tooltip-v2';
10
11
  export * from './checkbox';
11
12
  export * from './collapsible';
12
13
  export * from './combobox';
package/lib-esm/index.js CHANGED
@@ -10,6 +10,7 @@ export { Button } from './button/button.js';
10
10
  export { ButtonWrapper } from './button-wrapper/button-wrapper.js';
11
11
  export { Card } from './card/card.js';
12
12
  export { CardTooltip } from './card-tooltip/card-tooltip.js';
13
+ export { CardTooltipV2 } from './card-tooltip-v2/card-tooltip-v2.js';
13
14
  export { Checkbox } from './checkbox/index.js';
14
15
  export { CollapsibleSection } from './collapsible/collapsible-section.js';
15
16
  export { Combobox, Root } from './combobox/combobox.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/blueprint-web",
3
- "version": "9.12.2",
3
+ "version": "9.13.1",
4
4
  "type": "module",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "publishConfig": {
@@ -45,7 +45,6 @@
45
45
  "@radix-ui/react-tooltip": "1.0.7",
46
46
  "@react-aria/i18n": "^3.11.1",
47
47
  "@react-aria/utils": "^3.24.1",
48
- "@react-types/shared": "^3.23.1",
49
48
  "clsx": "^1.2.1",
50
49
  "color": "2.0.1",
51
50
  "lodash": "^4.17.15",
@@ -63,7 +62,7 @@
63
62
  "react-stately": "^3.31.1",
64
63
  "tsx": "^4.16.5"
65
64
  },
66
- "gitHead": "106c3f8b8a8362f4cdd0b6930d5d71c674511684",
65
+ "gitHead": "3a062f738a3b587842c3341c613e19ece483f879",
67
66
  "module": "lib-esm/index.js",
68
67
  "main": "lib-esm/index.js",
69
68
  "exports": {