@kaizen/components 0.0.0-canary-typescript-transform-paths-3.5.2-20241113035843 → 0.0.0-canary-package-bundler-v2-20241113055116

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.
@@ -1,25 +0,0 @@
1
- import classnames from 'classnames';
2
-
3
- /**
4
- * Helper to merge classnames together with support for functions that receive state (render props).
5
- * This is useful when working with react-aria-components which have a feature where you can pass a function that receives state and returns a classname.
6
- * https://react-spectrum.adobe.com/react-aria/styling.html#render-props
7
- */
8
- var mergeClassNames = function () {
9
- var classNames = [];
10
- for (var _i = 0; _i < arguments.length; _i++) {
11
- classNames[_i] = arguments[_i];
12
- }
13
- var containsFunction = classNames.some(function (className) {
14
- return typeof className === "function";
15
- });
16
- // "as any" is used because TS is not smart enough to know that containsFunction means that ClassNameType doesn't extend Function
17
- if (!containsFunction) return classnames.apply(void 0, classNames);
18
- // "as any" is used because TS is not smart enough to know that containsFunction means that ClassNameType doesn't extend Function
19
- return function (state) {
20
- return classnames.apply(void 0, classNames.map(function (className) {
21
- return typeof className === "function" ? className(state) : className;
22
- }));
23
- };
24
- };
25
- export { mergeClassNames as m };
@@ -1,8 +0,0 @@
1
- export { T as Tooltip } from './index-offJCDcb.js';
2
- import './Tooltip-DNGasNM8.js';
3
- import 'tslib';
4
- import 'react';
5
- import 'react-dom';
6
- import 'classnames';
7
- import 'react-popper';
8
- import 'use-debounce';
@@ -1,7 +0,0 @@
1
- export { T as Tooltip } from './Tooltip-DNGasNM8.js';
2
- import 'tslib';
3
- import 'react';
4
- import 'react-dom';
5
- import 'classnames';
6
- import 'react-popper';
7
- import 'use-debounce';
@@ -1,104 +0,0 @@
1
- import { __assign, __rest } from 'tslib';
2
- import React, { forwardRef, useContext, useState, useLayoutEffect, useRef } from 'react';
3
- import { VisuallyHidden, useFocusable } from 'react-aria';
4
- import { OverlayArrow as OverlayArrow$1, useContextProps, TooltipContext, TooltipTriggerStateContext, Tooltip as Tooltip$1, TooltipTrigger as TooltipTrigger$1 } from 'react-aria-components';
5
- export { TooltipContext } from 'react-aria-components';
6
- import { m as mergeClassNames } from './mergeClassNames-BuzaWRqN.js';
7
- import { u as useReversedColors } from './ReversedColors-D9BxpiSS.js';
8
- import classnames from 'classnames';
9
- var styles$2 = {
10
- "overlayArrow": "OverlayArrow-module_overlayArrow__hoDyK",
11
- "reversed": "OverlayArrow-module_reversed__-WGcR"
12
- };
13
-
14
- /**
15
- * An OverlayArrow renders a custom arrow element relative to an overlay element
16
- * such as a popover or tooltip such that it aligns with a trigger element.
17
- */
18
- var OverlayArrow = function (props) {
19
- var reverseColors = useReversedColors();
20
- return /*#__PURE__*/React.createElement(OverlayArrow$1, __assign({}, props, {
21
- className: mergeClassNames(styles$2.overlayArrow, reverseColors && styles$2.reversed, props.className)
22
- }), /*#__PURE__*/React.createElement("svg", {
23
- width: 8,
24
- height: 8,
25
- viewBox: "0 0 8 8"
26
- }, /*#__PURE__*/React.createElement("path", {
27
- d: "M0 0 L4 4 L8 0"
28
- })));
29
- };
30
- var styles$1 = {
31
- "tooltip": "Tooltip-module_tooltip__efL1m",
32
- "reversed": "Tooltip-module_reversed__NnCbZ",
33
- "slide": "Tooltip-module_slide__lFdGA"
34
- };
35
-
36
- /**
37
- * A tooltip displays a description of an element on hover or focus.
38
- */
39
- var Tooltip = /*#__PURE__*/forwardRef(function (_a, ref) {
40
- var children = _a.children,
41
- className = _a.className,
42
- props = __rest(_a, ["children", "className"]);
43
- var triggerRef = useContextProps(__assign({
44
- children: children,
45
- className: className
46
- }, props), ref, TooltipContext)[0].triggerRef;
47
- var contextState = useContext(TooltipTriggerStateContext);
48
- var reverseColors = useReversedColors();
49
- var _b = useState(false),
50
- shouldInlineHiddenContent = _b[0],
51
- setShouldInlineHiddenContent = _b[1];
52
- useLayoutEffect(function () {
53
- var _a;
54
- setShouldInlineHiddenContent(!!((_a = triggerRef === null || triggerRef === void 0 ? void 0 : triggerRef.current) === null || _a === void 0 ? void 0 : _a.getAttribute("data-inline-hidden-content")));
55
- }, [triggerRef]);
56
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Tooltip$1, __assign({
57
- ref: ref,
58
- offset: 8
59
- }, props, {
60
- className: mergeClassNames(styles$1.tooltip, className, reverseColors && styles$1.reversed)
61
- }), function (renderProps) {
62
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(OverlayArrow, null), typeof children === "function" ? children(renderProps) : children);
63
- }), shouldInlineHiddenContent ? ( /*#__PURE__*/React.createElement(VisuallyHidden, null, typeof children === "function" ? children({
64
- placement: "center",
65
- isEntering: false,
66
- isExiting: false,
67
- state: contextState,
68
- defaultChildren: undefined
69
- }) : children)) : null);
70
- });
71
-
72
- /**
73
- * TooltipTrigger wraps around a trigger element and a Tooltip. It handles opening and closing
74
- * the Tooltip when the user hovers over or focuses the trigger, and positioning the Tooltip
75
- * relative to the trigger.
76
- */
77
- var TooltipTrigger = function (props) {
78
- return /*#__PURE__*/React.createElement(TooltipTrigger$1, __assign({
79
- delay: 300,
80
- closeDelay: 300
81
- }, props));
82
- };
83
- var styles = {
84
- "focusableWrapper": "Focusable-module_focusableWrapper__NfuIi"
85
- };
86
- var Focusable = function (_a) {
87
- var children = _a.children,
88
- className = _a.className,
89
- props = __rest(_a, ["children", "className"]);
90
- var ref = useRef(null);
91
- var focusableProps = useFocusable(props, ref).focusableProps;
92
- return /*#__PURE__*/React.createElement("div", __assign({
93
- ref: ref,
94
- className: classnames(styles.focusableWrapper, className)
95
- }, focusableProps, {
96
- "data-inline-hidden-content": true,
97
- // We want the div to be focusable for keyboard users,
98
- // but screen readers will have the VisuallyHidden content
99
- // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
100
- tabIndex: 0,
101
- "aria-describedby": undefined
102
- }, props), children);
103
- };
104
- export { Focusable, Tooltip, TooltipTrigger };
@@ -1 +0,0 @@
1
- export * from 'react-aria-components';
@@ -1 +0,0 @@
1
- export * from 'react-aria';