@doist/reactist 29.1.0 → 29.1.2
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/CHANGELOG.md +14 -0
- package/dist/reactist.cjs.development.js +6749 -1829
- package/dist/reactist.cjs.development.js.map +1 -1
- package/dist/reactist.cjs.production.min.js +1 -1
- package/dist/reactist.cjs.production.min.js.map +1 -1
- package/es/avatar/avatar.js +106 -36
- package/es/avatar/avatar.js.map +1 -1
- package/es/avatar/utils.js +17 -19
- package/es/avatar/utils.js.map +1 -1
- package/es/badge/badge.js +50 -6
- package/es/badge/badge.js.map +1 -1
- package/es/banner/banner.js +384 -41
- package/es/banner/banner.js.map +1 -1
- package/es/base-field/base-field.js +367 -77
- package/es/base-field/base-field.js.map +1 -1
- package/es/box/box.js +139 -61
- package/es/box/box.js.map +1 -1
- package/es/button/button.js +346 -36
- package/es/button/button.js.map +1 -1
- package/es/checkbox-field/checkbox-field.js +71 -48
- package/es/checkbox-field/checkbox-field.js.map +1 -1
- package/es/checkbox-field/checkbox-icon.js +88 -28
- package/es/checkbox-field/checkbox-icon.js.map +1 -1
- package/es/checkbox-field/use-fork-ref.js +15 -20
- package/es/checkbox-field/use-fork-ref.js.map +1 -1
- package/es/columns/columns.js +46 -23
- package/es/columns/columns.js.map +1 -1
- package/es/components/color-picker/color-picker.js +190 -46
- package/es/components/color-picker/color-picker.js.map +1 -1
- package/es/components/deprecated-button/deprecated-button.js +102 -9
- package/es/components/deprecated-button/deprecated-button.js.map +1 -1
- package/es/components/deprecated-button/index.js +5 -2
- package/es/components/deprecated-button/index.js.map +1 -1
- package/es/components/deprecated-dropdown/dropdown.js +234 -134
- package/es/components/deprecated-dropdown/dropdown.js.map +1 -1
- package/es/components/deprecated-dropdown/index.js +4 -1
- package/es/components/deprecated-dropdown/index.js.map +1 -1
- package/es/components/deprecated-input/index.js +5 -2
- package/es/components/deprecated-input/index.js.map +1 -1
- package/es/components/deprecated-input/input.js +27 -4
- package/es/components/deprecated-input/input.js.map +1 -1
- package/es/components/deprecated-select/select.js +110 -7
- package/es/components/deprecated-select/select.js.map +1 -1
- package/es/components/key-capturer/key-capturer.js +190 -137
- package/es/components/key-capturer/key-capturer.js.map +1 -1
- package/es/components/keyboard-shortcut/keyboard-shortcut.js +65 -45
- package/es/components/keyboard-shortcut/keyboard-shortcut.js.map +1 -1
- package/es/components/progress-bar/progress-bar.js +61 -9
- package/es/components/progress-bar/progress-bar.js.map +1 -1
- package/es/components/time/index.js +5 -2
- package/es/components/time/index.js.map +1 -1
- package/es/components/time/time-utils.js +59 -53
- package/es/components/time/time-utils.js.map +1 -1
- package/es/components/time/time.js +94 -91
- package/es/components/time/time.js.map +1 -1
- package/es/divider/divider.js +44 -5
- package/es/divider/divider.js.map +1 -1
- package/es/heading/heading.js +122 -20
- package/es/heading/heading.js.map +1 -1
- package/es/hidden/hidden.js +36 -30
- package/es/hidden/hidden.js.map +1 -1
- package/es/hidden-visually/hidden-visually.js +9 -4
- package/es/hidden-visually/hidden-visually.js.map +1 -1
- package/es/icons/alert-icon.js +145 -18
- package/es/icons/alert-icon.js.map +1 -1
- package/es/icons/banner-icon.js +213 -25
- package/es/icons/banner-icon.js.map +1 -1
- package/es/icons/close-icon.js +26 -3
- package/es/icons/close-icon.js.map +1 -1
- package/es/icons/password-hidden-icon.js +40 -6
- package/es/icons/password-hidden-icon.js.map +1 -1
- package/es/icons/password-visible-icon.js +33 -5
- package/es/icons/password-visible-icon.js.map +1 -1
- package/es/index.js +9 -9
- package/es/inline/inline.js +24 -9
- package/es/inline/inline.js.map +1 -1
- package/es/loading/loading.js +63 -17
- package/es/loading/loading.js.map +1 -1
- package/es/menu/menu.js +469 -92
- package/es/menu/menu.js.map +1 -1
- package/es/modal/modal.js +675 -112
- package/es/modal/modal.js.map +1 -1
- package/es/notice/notice.js +77 -10
- package/es/notice/notice.js.map +1 -1
- package/es/password-field/password-field.js +89 -11
- package/es/password-field/password-field.js.map +1 -1
- package/es/prose/prose.js +48 -9
- package/es/prose/prose.js.map +1 -1
- package/es/select-field/select-field.js +150 -16
- package/es/select-field/select-field.js.map +1 -1
- package/es/spinner/spinner.js +39 -6
- package/es/spinner/spinner.js.map +1 -1
- package/es/stack/stack.js +29 -17
- package/es/stack/stack.js.map +1 -1
- package/es/switch-field/switch-field.js +225 -42
- package/es/switch-field/switch-field.js.map +1 -1
- package/es/tabs/tabs.js +207 -109
- package/es/tabs/tabs.js.map +1 -1
- package/es/text/text.js +27 -17
- package/es/text/text.js.map +1 -1
- package/es/text-area/text-area.js +264 -54
- package/es/text-area/text-area.js.map +1 -1
- package/es/text-field/text-field.js +204 -31
- package/es/text-field/text-field.js.map +1 -1
- package/es/text-link/text-link.js +21 -10
- package/es/text-link/text-link.js.map +1 -1
- package/es/toast/static-toast.js +143 -25
- package/es/toast/static-toast.js.map +1 -1
- package/es/toast/toast-animation.js +159 -109
- package/es/toast/toast-animation.js.map +1 -1
- package/es/toast/use-toasts.js +309 -84
- package/es/toast/use-toasts.js.map +1 -1
- package/es/tooltip/tooltip.js +88 -32
- package/es/tooltip/tooltip.js.map +1 -1
- package/es/utils/common-helpers.js +12 -11
- package/es/utils/common-helpers.js.map +1 -1
- package/es/utils/polymorphism.js +84 -1
- package/es/utils/polymorphism.js.map +1 -1
- package/es/utils/responsive-props.js +43 -32
- package/es/utils/responsive-props.js.map +1 -1
- package/lib/avatar/avatar.js +109 -35
- package/lib/avatar/avatar.js.map +1 -1
- package/lib/avatar/utils.js +17 -19
- package/lib/avatar/utils.js.map +1 -1
- package/lib/badge/badge.js +53 -5
- package/lib/badge/badge.js.map +1 -1
- package/lib/banner/banner.js +385 -38
- package/lib/banner/banner.js.map +1 -1
- package/lib/base-field/base-field.js +366 -73
- package/lib/base-field/base-field.js.map +1 -1
- package/lib/box/box.js +141 -61
- package/lib/box/box.js.map +1 -1
- package/lib/button/button.js +347 -35
- package/lib/button/button.js.map +1 -1
- package/lib/checkbox-field/checkbox-field.js +73 -46
- package/lib/checkbox-field/checkbox-field.js.map +1 -1
- package/lib/checkbox-field/checkbox-icon.js +92 -28
- package/lib/checkbox-field/checkbox-icon.js.map +1 -1
- package/lib/checkbox-field/use-fork-ref.js +15 -20
- package/lib/checkbox-field/use-fork-ref.js.map +1 -1
- package/lib/columns/columns.js +49 -22
- package/lib/columns/columns.js.map +1 -1
- package/lib/components/color-picker/color-picker.js +189 -45
- package/lib/components/color-picker/color-picker.js.map +1 -1
- package/lib/components/deprecated-button/deprecated-button.js +104 -9
- package/lib/components/deprecated-button/deprecated-button.js.map +1 -1
- package/lib/components/deprecated-dropdown/dropdown.js +235 -133
- package/lib/components/deprecated-dropdown/dropdown.js.map +1 -1
- package/lib/components/deprecated-input/input.js +28 -4
- package/lib/components/deprecated-input/input.js.map +1 -1
- package/lib/components/deprecated-select/select.js +112 -7
- package/lib/components/deprecated-select/select.js.map +1 -1
- package/lib/components/key-capturer/key-capturer.js +188 -135
- package/lib/components/key-capturer/key-capturer.js.map +1 -1
- package/lib/components/keyboard-shortcut/keyboard-shortcut.js +67 -45
- package/lib/components/keyboard-shortcut/keyboard-shortcut.js.map +1 -1
- package/lib/components/progress-bar/progress-bar.js +60 -8
- package/lib/components/progress-bar/progress-bar.js.map +1 -1
- package/lib/components/time/time-utils.js +59 -53
- package/lib/components/time/time-utils.js.map +1 -1
- package/lib/components/time/time.js +93 -90
- package/lib/components/time/time.js.map +1 -1
- package/lib/divider/divider.js +47 -4
- package/lib/divider/divider.js.map +1 -1
- package/lib/heading/heading.js +125 -19
- package/lib/heading/heading.js.map +1 -1
- package/lib/hidden/hidden.js +39 -29
- package/lib/hidden/hidden.js.map +1 -1
- package/lib/hidden-visually/hidden-visually.js +11 -3
- package/lib/hidden-visually/hidden-visually.js.map +1 -1
- package/lib/icons/alert-icon.js +149 -18
- package/lib/icons/alert-icon.js.map +1 -1
- package/lib/icons/banner-icon.js +217 -25
- package/lib/icons/banner-icon.js.map +1 -1
- package/lib/icons/close-icon.js +29 -3
- package/lib/icons/close-icon.js.map +1 -1
- package/lib/icons/password-hidden-icon.js +43 -6
- package/lib/icons/password-hidden-icon.js.map +1 -1
- package/lib/icons/password-visible-icon.js +36 -5
- package/lib/icons/password-visible-icon.js.map +1 -1
- package/lib/inline/inline.js +27 -8
- package/lib/inline/inline.js.map +1 -1
- package/lib/loading/loading.js +67 -17
- package/lib/loading/loading.js.map +1 -1
- package/lib/menu/menu.js +471 -91
- package/lib/menu/menu.js.map +1 -1
- package/lib/modal/modal.js +671 -106
- package/lib/modal/modal.js.map +1 -1
- package/lib/notice/notice.js +75 -8
- package/lib/notice/notice.js.map +1 -1
- package/lib/password-field/password-field.js +92 -10
- package/lib/password-field/password-field.js.map +1 -1
- package/lib/prose/prose.js +51 -8
- package/lib/prose/prose.js.map +1 -1
- package/lib/select-field/select-field.js +152 -14
- package/lib/select-field/select-field.js.map +1 -1
- package/lib/spinner/spinner.js +39 -6
- package/lib/spinner/spinner.js.map +1 -1
- package/lib/stack/stack.js +29 -15
- package/lib/stack/stack.js.map +1 -1
- package/lib/switch-field/switch-field.js +225 -38
- package/lib/switch-field/switch-field.js.map +1 -1
- package/lib/tabs/tabs.js +207 -107
- package/lib/tabs/tabs.js.map +1 -1
- package/lib/text/text.js +30 -16
- package/lib/text/text.js.map +1 -1
- package/lib/text-area/text-area.js +264 -52
- package/lib/text-area/text-area.js.map +1 -1
- package/lib/text-field/text-field.js +207 -30
- package/lib/text-field/text-field.js.map +1 -1
- package/lib/text-link/text-link.js +24 -9
- package/lib/text-link/text-link.js.map +1 -1
- package/lib/toast/static-toast.js +142 -22
- package/lib/toast/static-toast.js.map +1 -1
- package/lib/toast/toast-animation.js +158 -108
- package/lib/toast/toast-animation.js.map +1 -1
- package/lib/toast/use-toasts.js +310 -82
- package/lib/toast/use-toasts.js.map +1 -1
- package/lib/tooltip/tooltip.js +87 -31
- package/lib/tooltip/tooltip.js.map +1 -1
- package/lib/utils/common-helpers.js +12 -11
- package/lib/utils/common-helpers.js.map +1 -1
- package/lib/utils/polymorphism.js +84 -1
- package/lib/utils/polymorphism.js.map +1 -1
- package/lib/utils/responsive-props.js +43 -32
- package/lib/utils/responsive-props.js.map +1 -1
- package/package.json +10 -2
package/lib/tooltip/tooltip.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var reactCompilerRuntime = require('react-compiler-runtime');
|
|
5
6
|
var React = require('react');
|
|
6
7
|
var react = require('@ariakit/react');
|
|
7
8
|
var box = require('../box/box.js');
|
|
@@ -27,39 +28,94 @@ function _interopNamespace(e) {
|
|
|
27
28
|
|
|
28
29
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
29
30
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
const defaultShowTimeout = 500;
|
|
32
|
+
const defaultHideTimeout = 100;
|
|
33
|
+
const TooltipContext = /*#__PURE__*/React__namespace.createContext({
|
|
34
|
+
showTimeout: defaultShowTimeout,
|
|
35
|
+
hideTimeout: defaultHideTimeout
|
|
35
36
|
});
|
|
36
|
-
function TooltipProvider(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
function TooltipProvider(t0) {
|
|
38
|
+
const $ = reactCompilerRuntime.c(6);
|
|
39
|
+
const {
|
|
40
|
+
showTimeout: t1,
|
|
41
|
+
hideTimeout: t2,
|
|
42
|
+
children
|
|
43
|
+
} = t0;
|
|
44
|
+
const showTimeout = t1 === undefined ? defaultShowTimeout : t1;
|
|
45
|
+
const hideTimeout = t2 === undefined ? defaultHideTimeout : t2;
|
|
46
|
+
let t3;
|
|
47
|
+
if ($[0] !== hideTimeout || $[1] !== showTimeout) {
|
|
48
|
+
t3 = {
|
|
49
|
+
showTimeout,
|
|
50
|
+
hideTimeout
|
|
51
|
+
};
|
|
52
|
+
$[0] = hideTimeout;
|
|
53
|
+
$[1] = showTimeout;
|
|
54
|
+
$[2] = t3;
|
|
55
|
+
} else {
|
|
56
|
+
t3 = $[2];
|
|
57
|
+
}
|
|
58
|
+
const value = t3;
|
|
59
|
+
let t4;
|
|
60
|
+
if ($[3] !== children || $[4] !== value) {
|
|
61
|
+
t4 = /*#__PURE__*/React__namespace.createElement(TooltipContext.Provider, {
|
|
62
|
+
value: value
|
|
63
|
+
}, children);
|
|
64
|
+
$[3] = children;
|
|
65
|
+
$[4] = value;
|
|
66
|
+
$[5] = t4;
|
|
67
|
+
} else {
|
|
68
|
+
t4 = $[5];
|
|
69
|
+
}
|
|
70
|
+
return t4;
|
|
40
71
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
72
|
+
const Tooltip = /*#__PURE__*/React__namespace.forwardRef(({
|
|
73
|
+
children,
|
|
74
|
+
content,
|
|
75
|
+
position = 'top',
|
|
76
|
+
gapSize = 3,
|
|
77
|
+
withArrow = false,
|
|
78
|
+
showTimeout,
|
|
79
|
+
hideTimeout,
|
|
80
|
+
exceptionallySetClassName
|
|
81
|
+
}, ref) => {
|
|
82
|
+
const {
|
|
83
|
+
showTimeout: globalShowTimeout,
|
|
84
|
+
hideTimeout: globalHideTimeout
|
|
85
|
+
} = React__namespace.useContext(TooltipContext);
|
|
86
|
+
const tooltip = react.useTooltipStore({
|
|
87
|
+
placement: position,
|
|
88
|
+
showTimeout: showTimeout ?? globalShowTimeout,
|
|
89
|
+
hideTimeout: hideTimeout ?? globalHideTimeout
|
|
90
|
+
});
|
|
91
|
+
React__namespace.useImperativeHandle(ref, () => tooltip, [tooltip]);
|
|
92
|
+
const isOpen = tooltip.useState('open');
|
|
93
|
+
const child = React__namespace.Children.only(children);
|
|
94
|
+
if (!child) {
|
|
95
|
+
return child;
|
|
96
|
+
}
|
|
97
|
+
if (typeof child.ref === 'string') {
|
|
98
|
+
throw new Error('Tooltip: String refs cannot be used as they cannot be forwarded');
|
|
99
|
+
}
|
|
100
|
+
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(react.TooltipAnchor, {
|
|
101
|
+
render: child,
|
|
102
|
+
store: tooltip,
|
|
103
|
+
ref: child.ref
|
|
104
|
+
}), isOpen && content ? /*#__PURE__*/React__namespace.createElement(react.Tooltip, {
|
|
105
|
+
store: tooltip,
|
|
106
|
+
gutter: gapSize,
|
|
107
|
+
render: /*#__PURE__*/React__namespace.createElement(box.Box, {
|
|
108
|
+
className: [tooltip_module["default"].tooltip, exceptionallySetClassName],
|
|
109
|
+
background: "toast",
|
|
110
|
+
borderRadius: "standard",
|
|
111
|
+
paddingX: "small",
|
|
112
|
+
paddingY: "xsmall",
|
|
113
|
+
maxWidth: "medium",
|
|
114
|
+
width: "fitContent",
|
|
115
|
+
overflow: "hidden",
|
|
116
|
+
textAlign: "center"
|
|
117
|
+
})
|
|
118
|
+
}, withArrow ? /*#__PURE__*/React__namespace.createElement(react.TooltipArrow, null) : null, typeof content === 'function' ? content() : content) : null);
|
|
63
119
|
});
|
|
64
120
|
Tooltip.displayName = 'Tooltip';
|
|
65
121
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.js","sources":["../../src/tooltip/tooltip.tsx"],"sourcesContent":[null],"names":["React","useTooltipStore","TooltipAnchor","AriakitTooltip","Box","styles","TooltipArrow"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,IAAM,kBAAkB,GAAG,GAAG,CAAA;AAC9B,IAAM,kBAAkB,GAAG,GAAG,CAAA;AAO9B,IAAM,cAAc,GAAGA,gBAAK,CAAC,aAAa,CAAsB;AAC5D,IA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EAAE,OAAO,EACf,MAAM,EACFH,gBAAA,CAAA,aAAA,CAACI,OAAG,EAAA,EACA,SAAS,EAAE,CAACC,yBAAM,CAAC,OAAO,EAAE,yBAAyB,CAAC,EACtD,UAAU,EAAC,OAAO,EAClB,YAAY,EAAC,UAAU,EACvB,QAAQ,EAAC,OAAO,EAChB,QAAQ,EAAC,QAAQ,EACjB,QAAQ,EAAC,QAAQ,EACjB,KAAK,EAAC,YAAY,EAClB,QAAQ,EAAC,QAAQ,EACjB,SAAS,EAAC,QAAQ,EACpB,CAAA,EAAA;YAGL,SAAS,GAAGL,gBAAA,CAAA,aAAA,CAACM,kBAAY,EAAG,IAAA,CAAA,GAAG,IAAI;YACnC,OAAO,OAAO,KAAK,UAAU,GAAG,OAAO,EAAE,GAAG,OAAO,CACvC,IACjB,IAAI,CACT,EACN;AACL,CAAC,EACJ;AAED,OAAO,CAAC,WAAW,GAAG,SAAS;;;;;"}
|
|
1
|
+
{"version":3,"file":"tooltip.js","sources":["../../src/tooltip/tooltip.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport {\n Tooltip as AriakitTooltip,\n TooltipAnchor,\n TooltipArrow,\n useTooltipStore,\n} from '@ariakit/react'\n\nimport { Box } from '../box'\n\nimport styles from './tooltip.module.css'\n\nimport type { TooltipStore, TooltipStoreState } from '@ariakit/react'\nimport type { ObfuscatedClassName } from '../utils/common-types'\n\nconst defaultShowTimeout = 500\nconst defaultHideTimeout = 100\n\ntype TooltipContextState = {\n showTimeout: number\n hideTimeout: number\n}\n\nconst TooltipContext = React.createContext<TooltipContextState>({\n showTimeout: defaultShowTimeout,\n hideTimeout: defaultHideTimeout,\n})\n\nfunction TooltipProvider({\n showTimeout = defaultShowTimeout,\n hideTimeout = defaultHideTimeout,\n children,\n}: React.PropsWithChildren<{\n showTimeout?: number\n hideTimeout?: number\n}>) {\n const value = React.useMemo(() => ({ showTimeout, hideTimeout }), [showTimeout, hideTimeout])\n return <TooltipContext.Provider value={value}>{children}</TooltipContext.Provider>\n}\n\ninterface TooltipProps extends ObfuscatedClassName {\n /**\n * The element that triggers the tooltip. Generally a button or link.\n *\n * It should be an interactive element accessible both via mouse and keyboard interactions.\n */\n children: React.ReactNode\n\n /**\n * The content to show in the tooltip.\n *\n * It can be rich content provided via React elements, or string content. It should not include\n * interactive elements inside it. This includes links or buttons.\n *\n * You can provide a function instead of the content itself. In this case, the function should\n * return the desired content. This is useful if the content is expensive to generate. It can\n * also be useful if the content dynamically changes often, so every time you trigger the\n * tooltip the content may have changed (e.g. if you show a ticking time clock in the tooltip).\n *\n * The trigger element will be associated to this content via `aria-describedby`. This means\n * that the tooltip content will be read by assistive technologies such as screen readers. It\n * will likely read this content right after reading the trigger element label.\n */\n content: React.ReactNode | (() => React.ReactNode)\n\n /**\n * How to place the tooltip relative to its trigger element.\n *\n * The possible values are \"top\", \"bottom\", \"left\", \"right\". Additionally, any of these values\n * can be combined with `-start` or `-end` for even more control. For instance `top-start` will\n * place the tooltip at the top, but with the start (e.g. left) side of the toolip and the\n * trigger aligned. If neither `-start` or `-end` are provided, the tooltip is centered along\n * the vertical or horizontal axis with the trigger.\n *\n * The position is enforced whenever possible, but tooltips can appear in different positions\n * if the specified one would make the tooltip intersect with the viewport edges.\n *\n * @default 'top'\n */\n position?: TooltipStoreState['placement']\n\n /**\n * The separation (in pixels) between the trigger element and the tooltip.\n * @default 3\n */\n gapSize?: number\n\n /**\n * Whether to show an arrow-like element attached to the tooltip, and pointing towards the\n * trigger element.\n * @default false\n */\n withArrow?: boolean\n\n /**\n * The amount of time in milliseconds to wait before showing the tooltip\n * Use `<TooltipContext.Provider>` to set a global value for all tooltips\n * @default 500\n */\n showTimeout?: number\n\n /**\n * The amount of time in milliseconds to wait before hiding the tooltip\n * Use `<TooltipContext.Provider>` to set a global value for all tooltips\n * @default 100\n */\n hideTimeout?: number\n}\n\nconst Tooltip = React.forwardRef<TooltipStore, TooltipProps>(\n (\n {\n children,\n content,\n position = 'top',\n gapSize = 3,\n withArrow = false,\n showTimeout,\n hideTimeout,\n exceptionallySetClassName,\n },\n ref,\n ) => {\n const { showTimeout: globalShowTimeout, hideTimeout: globalHideTimeout } =\n React.useContext(TooltipContext)\n\n const tooltip = useTooltipStore({\n placement: position,\n showTimeout: showTimeout ?? globalShowTimeout,\n hideTimeout: hideTimeout ?? globalHideTimeout,\n })\n\n React.useImperativeHandle(ref, () => tooltip, [tooltip])\n\n const isOpen = tooltip.useState('open')\n\n const child = React.Children.only(\n children as React.FunctionComponentElement<JSX.IntrinsicElements['div']> | null,\n )\n\n if (!child) {\n return child\n }\n\n if (typeof child.ref === 'string') {\n throw new Error('Tooltip: String refs cannot be used as they cannot be forwarded')\n }\n\n return (\n <>\n <TooltipAnchor render={child} store={tooltip} ref={child.ref} />\n {isOpen && content ? (\n <AriakitTooltip\n store={tooltip}\n gutter={gapSize}\n render={\n <Box\n className={[styles.tooltip, exceptionallySetClassName]}\n background=\"toast\"\n borderRadius=\"standard\"\n paddingX=\"small\"\n paddingY=\"xsmall\"\n maxWidth=\"medium\"\n width=\"fitContent\"\n overflow=\"hidden\"\n textAlign=\"center\"\n />\n }\n >\n {withArrow ? <TooltipArrow /> : null}\n {typeof content === 'function' ? content() : content}\n </AriakitTooltip>\n ) : null}\n </>\n )\n },\n)\n\nTooltip.displayName = 'Tooltip'\n\nexport type { TooltipProps }\nexport { Tooltip, TooltipProvider }\n"],"names":["defaultShowTimeout","defaultHideTimeout","TooltipContext","React","createContext","showTimeout","hideTimeout","TooltipProvider","t0","$","_c","t1","t2","children","undefined","t3","value","t4","createElement","Provider","Tooltip","forwardRef","content","position","gapSize","withArrow","exceptionallySetClassName","ref","globalShowTimeout","globalHideTimeout","useContext","tooltip","useTooltipStore","placement","useImperativeHandle","isOpen","useState","child","Children","only","Error","Fragment","TooltipAnchor","render","store","AriakitTooltip","gutter","Box","className","styles","background","borderRadius","paddingX","paddingY","maxWidth","width","overflow","textAlign","TooltipArrow","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;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ACjC,CAAC,GACjB,IACN,CAAC,CAAA;AAEX,CACJ,EAAC;AAEDF,OAAO,CAACuC,WAAW,GAAG,SAAS;;;;;"}
|
|
@@ -24,25 +24,26 @@ function _interopNamespace(e) {
|
|
|
24
24
|
|
|
25
25
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
let uid = 0;
|
|
28
28
|
function uniqueId() {
|
|
29
|
-
|
|
29
|
+
return uid++;
|
|
30
30
|
}
|
|
31
31
|
function generateElementId(prefix) {
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
const num = uniqueId();
|
|
33
|
+
return `${prefix}-${num}`;
|
|
34
34
|
}
|
|
35
|
+
|
|
35
36
|
/**
|
|
36
37
|
* @deprecated Use `useId` available from React 18 or above instead.
|
|
37
38
|
*/
|
|
38
39
|
function useId(providedId) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
const ref = React__namespace.useRef(providedId ?? null);
|
|
41
|
+
// eslint-disable-next-line react-hooks/refs
|
|
42
|
+
if (!ref.current) {
|
|
43
|
+
ref.current = generateElementId('element');
|
|
44
|
+
}
|
|
45
|
+
// eslint-disable-next-line react-hooks/refs
|
|
46
|
+
return ref.current;
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
exports.generateElementId = generateElementId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common-helpers.js","sources":["../../src/utils/common-helpers.ts"],"sourcesContent":[null],"names":["React"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,
|
|
1
|
+
{"version":3,"file":"common-helpers.js","sources":["../../src/utils/common-helpers.ts"],"sourcesContent":["import * as React from 'react'\n\nlet uid = 0\nfunction uniqueId() {\n return uid++\n}\n\nexport function generateElementId(prefix: string): string {\n const num = uniqueId()\n return `${prefix}-${num}`\n}\n\n/**\n * @deprecated Use `useId` available from React 18 or above instead.\n */\nexport function useId(providedId?: string): string {\n const ref = React.useRef<string | null>(providedId ?? null)\n // eslint-disable-next-line react-hooks/refs\n if (!ref.current) {\n ref.current = generateElementId('element')\n }\n // eslint-disable-next-line react-hooks/refs\n return ref.current\n}\n"],"names":["uid","uniqueId","generateElementId","prefix","num","useId","providedId","ref","React","useRef","current"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAIA,GAAG,GAAG,CAAC,CAAA;AACX,SAASC,QAAQA,GAAG;AAChB,EAAA,OAAOD,GAAG,EAAE,CAAA;AAChB,CAAA;AAEO,SAASE,iBAAiBA,CAACC,MAAc,EAAU;AACtD,EAAA,MAAMC,GAAG,GAAGH,QAAQ,EAAE,CAAA;AACtB,EAAA,OAAO,CAAGE,EAAAA,MAAM,CAAIC,CAAAA,EAAAA,GAAG,CAAE,CAAA,CAAA;AAC7B,CAAA;;AAEA;AACA;AACA;AACO,SAASC,KAAKA,CAACC,UAAmB,EAAU;EAC/C,MAAMC,GAAG,GAAGC,gBAAK,CAACC,MAAM,CAAgBH,UAAU,IAAI,IAAI,CAAC,CAAA;AAC3D;AACA,EAAA,IAAI,CAACC,GAAG,CAACG,OAAO,EAAE;AACdH,IAAAA,GAAG,CAACG,OAAO,GAAGR,iBAAiB,CAAC,SAAS,CAAC,CAAA;AAC9C,GAAA;AACA;EACA,OAAOK,GAAG,CAACG,OAAO,CAAA;AACtB;;;;;"}
|
|
@@ -25,6 +25,89 @@ function _interopNamespace(e) {
|
|
|
25
25
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
26
26
|
|
|
27
27
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* If a set of props include the `className` prop, we replace it with a `exceptionallySetClassName`
|
|
31
|
+
* prop instead.
|
|
32
|
+
*
|
|
33
|
+
* This can be customized via the second generic parameter, as there are cases where it may be
|
|
34
|
+
* needed to omit this behaviour and keep the `className`. You can also instruct it to remove the
|
|
35
|
+
* `className` prop while not replacing it with the `exceptionallySetClassName` one.
|
|
36
|
+
*
|
|
37
|
+
* @see ObfuscatedClassName['exceptionallySetClassName'] for details about this prop
|
|
38
|
+
* @see PolymorphicComponent for details about this feature
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Given a component or element type, and a set of additional props, this builds the entire set of
|
|
43
|
+
* props for a polymorphic component.
|
|
44
|
+
*
|
|
45
|
+
* It does three things:
|
|
46
|
+
*
|
|
47
|
+
* 1. it merges the element type props with the `OwnProps`
|
|
48
|
+
* 2. it adds the `as` prop to allow for polymorphism to happen
|
|
49
|
+
* 3. it optionally obfuscates or omits the className prop if present
|
|
50
|
+
*
|
|
51
|
+
* @see PolymorphicProp
|
|
52
|
+
* @see WithObfuscatedClassName
|
|
53
|
+
*/
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The function passed to React.forwardRef, but typed in a way that's prepared for polymorphism via
|
|
57
|
+
* the `as` prop. It also allows to specify if the `className` prop should be obfuscated or omitted.
|
|
58
|
+
*
|
|
59
|
+
* @see PolymorphicComponentProps
|
|
60
|
+
* @see WithObfuscatedClassName
|
|
61
|
+
*/
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* A component that can customize the React element type that it renders (a.k.a. a polymorphic
|
|
65
|
+
* component). This is achieved by passing a prop `as={ElementType}` or `as="html-tag-name"`.
|
|
66
|
+
*
|
|
67
|
+
* It transparently takes care of forwarding refs, and properly sets the ref type depending on the
|
|
68
|
+
* element type.
|
|
69
|
+
*
|
|
70
|
+
* ## Recognizing props based on the polymorphic type
|
|
71
|
+
*
|
|
72
|
+
* The `ComponentType` argument sets the default type for the `as` prop. Whatever the `as` prop
|
|
73
|
+
* component or HTML element is, the type system will automatically allow you to pass props that are
|
|
74
|
+
* not explicitly defined by you, but that are recognized as valid props to be passed to the
|
|
75
|
+
* component you are rendering.
|
|
76
|
+
*
|
|
77
|
+
* For instance, see the following example:
|
|
78
|
+
*
|
|
79
|
+
* ```jsx
|
|
80
|
+
* <Box as="label" htmlFor="field-id">Hello</Box>
|
|
81
|
+
* ```
|
|
82
|
+
*
|
|
83
|
+
* The `htmlFor` prop is exclusive to label elements. If you omit the `as="label"` prop, the type
|
|
84
|
+
* system will consider the `htmlFor` prop to be an error. The same happens if you pass a value of
|
|
85
|
+
* an incorrect type to such prop. For instance, the example below will issue a type error:
|
|
86
|
+
*
|
|
87
|
+
* ```jsx
|
|
88
|
+
* <Box as="label" htmlFor={123}>Hello</Box>
|
|
89
|
+
* ```
|
|
90
|
+
*
|
|
91
|
+
* ## Omitting or obfuscating the `className` prop
|
|
92
|
+
*
|
|
93
|
+
* If a set of props include the `className` prop, we replace it with a `exceptionallySetClassName`
|
|
94
|
+
* prop instead.
|
|
95
|
+
*
|
|
96
|
+
* This is to discourage customizing design system components via custom styling, while still
|
|
97
|
+
* leaving the door open to do it as an escape hatch when the design system still has shortcomings
|
|
98
|
+
* with respect to the product designs we want to achieve.
|
|
99
|
+
*
|
|
100
|
+
* The cumbersome name also serves the purpose of aiding in easily searching for the places in the
|
|
101
|
+
* code where this escape hatch was needed, in order to identify areas where the design system
|
|
102
|
+
* components need to improve to better match our needs.
|
|
103
|
+
*
|
|
104
|
+
* This behaviour can be customized via an optional second generic argument that allows to disable
|
|
105
|
+
* this feature, or to omit the `className` altogether without replacing it with the obfuscated prop
|
|
106
|
+
* name.
|
|
107
|
+
*
|
|
108
|
+
* @deprecated Use Ariakit's composition instead (https://ariakit.org/guide/composition)
|
|
109
|
+
*/
|
|
110
|
+
|
|
28
111
|
/**
|
|
29
112
|
* A wrapper to use React.forwardRef with polymorphic components in a type-safe manner. This is a
|
|
30
113
|
* convenience over merely using React.forwardRef directly, and then manually forcing the resulting
|
|
@@ -33,7 +116,7 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
|
33
116
|
* @deprecated Use Ariakit's composition instead (https://ariakit.org/guide/composition)
|
|
34
117
|
*/
|
|
35
118
|
function polymorphicComponent(render) {
|
|
36
|
-
|
|
119
|
+
return /*#__PURE__*/React__namespace.forwardRef(render);
|
|
37
120
|
}
|
|
38
121
|
|
|
39
122
|
exports.polymorphicComponent = polymorphicComponent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polymorphism.js","sources":["../../src/utils/polymorphism.ts"],"sourcesContent":[null],"names":["React"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;
|
|
1
|
+
{"version":3,"file":"polymorphism.js","sources":["../../src/utils/polymorphism.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport * as React from 'react'\n\nimport type { ObfuscatedClassName } from './common-types'\n\ntype Merge<P1, P2> = Omit<P1, keyof P2> & P2\n\ntype EmptyObject = {\n [K in any]: never\n}\n\ntype ObfuscateClassNameMode = 'keepClassName' | 'obfuscateClassName' | 'omitClassName'\n\n/**\n * If a set of props include the `className` prop, we replace it with a `exceptionallySetClassName`\n * prop instead.\n *\n * This can be customized via the second generic parameter, as there are cases where it may be\n * needed to omit this behaviour and keep the `className`. You can also instruct it to remove the\n * `className` prop while not replacing it with the `exceptionallySetClassName` one.\n *\n * @see ObfuscatedClassName['exceptionallySetClassName'] for details about this prop\n * @see PolymorphicComponent for details about this feature\n */\ntype WithObfuscatedClassName<\n Props,\n ShouldObfuscateClassName extends ObfuscateClassNameMode,\n> = 'className' extends keyof Props\n ? ShouldObfuscateClassName extends 'obfuscateClassName'\n ? Omit<Props, 'className'> & ObfuscatedClassName\n : ShouldObfuscateClassName extends 'omitClassName'\n ? Omit<Props, 'className'>\n : ShouldObfuscateClassName extends 'keepClassName'\n ? Props\n : never\n : Props\n\ntype PolymorphicProp<ComponentType extends React.ElementType> = {\n /**\n * Used to instruct this component what React element to render as. It can be both a string\n * representing a HTML tag name, or a React component.\n *\n * When using this prop, the component you apply it to will also recognize in its props types\n * all the props from the component or HTML element you are rendering it as.\n *\n * Some uses for this feature:\n *\n * - Using some of our layout components, while at the same time being able to set them to use\n * semantic HTML elements needed for accessibility purposes (e.g. `nav`, `main`, etc).\n * - Using a design system link component, but have it internally use a client-side router link\n * implemented via a React component (e.g. react-router's `Link`).\n *\n * Keep in mind that not all compositions of this kind may work well, especially when composing\n * with another React component and not with a HTML tag name. In particular, if the components\n * being composed have opposing concerns of clashing features (e.g. they have contradicting\n * styles applied to them) things may not go well. In those cases prefer to nest them instead.\n *\n * @see PolymorphicComponent\n */\n as?: ComponentType\n}\n\n/**\n * Given a component or element type, and a set of additional props, this builds the entire set of\n * props for a polymorphic component.\n *\n * It does three things:\n *\n * 1. it merges the element type props with the `OwnProps`\n * 2. it adds the `as` prop to allow for polymorphism to happen\n * 3. it optionally obfuscates or omits the className prop if present\n *\n * @see PolymorphicProp\n * @see WithObfuscatedClassName\n */\ntype PolymorphicComponentProps<\n ComponentType extends React.ElementType,\n OwnProps,\n ShouldObfuscateClassName extends ObfuscateClassNameMode,\n> = Merge<\n WithObfuscatedClassName<React.ComponentProps<ComponentType>, ShouldObfuscateClassName>,\n OwnProps & PolymorphicProp<ComponentType>\n>\n\ntype ElementTagNameMap = HTMLElementTagNameMap &\n Pick<SVGElementTagNameMap, Exclude<keyof SVGElementTagNameMap, keyof HTMLElementTagNameMap>>\n\ntype ElementByTag<TagName extends keyof ElementTagNameMap> = ElementTagNameMap[TagName]\n\ntype ElementByTagOrAny<ComponentType extends React.ElementType> =\n ComponentType extends keyof ElementTagNameMap ? ElementByTag<ComponentType> : any\n\n/**\n * The function passed to React.forwardRef, but typed in a way that's prepared for polymorphism via\n * the `as` prop. It also allows to specify if the `className` prop should be obfuscated or omitted.\n *\n * @see PolymorphicComponentProps\n * @see WithObfuscatedClassName\n */\ninterface ForwardRefFunction<\n ComponentType extends React.ElementType,\n OwnProps,\n ShouldObfuscateClassName extends ObfuscateClassNameMode,\n> {\n (\n props: PolymorphicComponentProps<ComponentType, OwnProps, ShouldObfuscateClassName>,\n ref:\n | ((instance: ElementByTagOrAny<ComponentType> | null) => void)\n | React.MutableRefObject<ElementByTagOrAny<ComponentType> | null>\n | null,\n ): React.ReactElement | null\n displayName?: string\n}\n\n/**\n * A component that can customize the React element type that it renders (a.k.a. a polymorphic\n * component). This is achieved by passing a prop `as={ElementType}` or `as=\"html-tag-name\"`.\n *\n * It transparently takes care of forwarding refs, and properly sets the ref type depending on the\n * element type.\n *\n * ## Recognizing props based on the polymorphic type\n *\n * The `ComponentType` argument sets the default type for the `as` prop. Whatever the `as` prop\n * component or HTML element is, the type system will automatically allow you to pass props that are\n * not explicitly defined by you, but that are recognized as valid props to be passed to the\n * component you are rendering.\n *\n * For instance, see the following example:\n *\n * ```jsx\n * <Box as=\"label\" htmlFor=\"field-id\">Hello</Box>\n * ```\n *\n * The `htmlFor` prop is exclusive to label elements. If you omit the `as=\"label\"` prop, the type\n * system will consider the `htmlFor` prop to be an error. The same happens if you pass a value of\n * an incorrect type to such prop. For instance, the example below will issue a type error:\n *\n * ```jsx\n * <Box as=\"label\" htmlFor={123}>Hello</Box>\n * ```\n *\n * ## Omitting or obfuscating the `className` prop\n *\n * If a set of props include the `className` prop, we replace it with a `exceptionallySetClassName`\n * prop instead.\n *\n * This is to discourage customizing design system components via custom styling, while still\n * leaving the door open to do it as an escape hatch when the design system still has shortcomings\n * with respect to the product designs we want to achieve.\n *\n * The cumbersome name also serves the purpose of aiding in easily searching for the places in the\n * code where this escape hatch was needed, in order to identify areas where the design system\n * components need to improve to better match our needs.\n *\n * This behaviour can be customized via an optional second generic argument that allows to disable\n * this feature, or to omit the `className` altogether without replacing it with the obfuscated prop\n * name.\n *\n * @deprecated Use Ariakit's composition instead (https://ariakit.org/guide/composition)\n */\ninterface PolymorphicComponent<\n ComponentType extends React.ElementType,\n OwnProps,\n ShouldObfuscateClassName extends ObfuscateClassNameMode = 'obfuscateClassName',\n> {\n <TT extends React.ElementType = ComponentType>(\n props: PolymorphicComponentProps<TT, OwnProps, ShouldObfuscateClassName>,\n ): React.ReactElement | null\n readonly $$typeof: symbol\n defaultProps?: Partial<\n PolymorphicComponentProps<ComponentType, OwnProps, ShouldObfuscateClassName>\n >\n propTypes?: React.WeakValidationMap<\n PolymorphicComponentProps<ComponentType, OwnProps, ShouldObfuscateClassName>\n >\n displayName?: string\n}\n\n/**\n * A wrapper to use React.forwardRef with polymorphic components in a type-safe manner. This is a\n * convenience over merely using React.forwardRef directly, and then manually forcing the resulting\n * value to be typed using `as PolymorphicComponent<…>`.\n *\n * @deprecated Use Ariakit's composition instead (https://ariakit.org/guide/composition)\n */\nfunction polymorphicComponent<\n ComponentType extends React.ElementType = 'div',\n OwnProps = EmptyObject,\n ShouldObfuscateClassName extends ObfuscateClassNameMode = 'obfuscateClassName',\n>(render: ForwardRefFunction<ComponentType, OwnProps, ShouldObfuscateClassName>) {\n return React.forwardRef(render) as PolymorphicComponent<\n ComponentType,\n OwnProps,\n ShouldObfuscateClassName\n >\n}\n\nexport type { PolymorphicComponent }\nexport { polymorphicComponent }\n"],"names":["polymorphicComponent","render","React","forwardRef"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAcA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAuCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAkBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAmBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,oBAAoBA,CAI3BC,MAA6E,EAAE;AAC7E,EAAA,oBAAOC,gBAAK,CAACC,UAAU,CAACF,MAAM,CAAC,CAAA;AAKnC;;;;"}
|
|
@@ -2,7 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* A responsive prop supports receiving values of its given base type, or an object mapping a
|
|
7
|
+
* responsive breakpoint name to a value from the prop's base type.
|
|
8
|
+
*
|
|
9
|
+
* Some examples:
|
|
10
|
+
*
|
|
11
|
+
* - `align={{ mobile: 'left', tablet: 'center', desktop: 'right' }}`
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
const DEBUG = process.env.NODE_ENV === 'development';
|
|
15
|
+
|
|
6
16
|
/**
|
|
7
17
|
* Builds a css module class name for a given prop + prop-value combination.
|
|
8
18
|
*
|
|
@@ -21,27 +31,28 @@ var DEBUG = process.env.NODE_ENV === 'development';
|
|
|
21
31
|
* @param value the given prop's value
|
|
22
32
|
*/
|
|
23
33
|
function getClassNames(styles, property, value) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
34
|
+
if (!value) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
const classList = [];
|
|
38
|
+
if (typeof value === 'string') {
|
|
39
|
+
classList.push(styles[`${property}-${value}`]);
|
|
40
|
+
} else {
|
|
41
|
+
if (value.mobile) classList.push(styles[`${property}-${value.mobile}`]);
|
|
42
|
+
if (value.tablet) classList.push(styles[`tablet-${property}-${value.tablet}`]);
|
|
43
|
+
if (value.desktop) classList.push(styles[`desktop-${property}-${value.desktop}`]);
|
|
44
|
+
}
|
|
45
|
+
if (DEBUG && !classList.every(Boolean)) {
|
|
46
|
+
// eslint-disable-next-line no-console
|
|
47
|
+
console.warn('Not all generated class names were found', {
|
|
48
|
+
property,
|
|
49
|
+
value,
|
|
50
|
+
classList
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
return classList;
|
|
44
54
|
}
|
|
55
|
+
|
|
45
56
|
/**
|
|
46
57
|
* A mapping over a responsive prop value.
|
|
47
58
|
*
|
|
@@ -53,17 +64,17 @@ function getClassNames(styles, property, value) {
|
|
|
53
64
|
* @param mapper the mapping function
|
|
54
65
|
*/
|
|
55
66
|
function mapResponsiveProp(fromValue, mapper) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
+
if (!fromValue) {
|
|
68
|
+
return undefined;
|
|
69
|
+
}
|
|
70
|
+
if (typeof fromValue !== 'object') {
|
|
71
|
+
return mapper(fromValue);
|
|
72
|
+
}
|
|
73
|
+
return {
|
|
74
|
+
mobile: fromValue.mobile ? mapper(fromValue.mobile) : undefined,
|
|
75
|
+
tablet: fromValue.tablet ? mapper(fromValue.tablet) : undefined,
|
|
76
|
+
desktop: fromValue.desktop ? mapper(fromValue.desktop) : undefined
|
|
77
|
+
};
|
|
67
78
|
}
|
|
68
79
|
|
|
69
80
|
exports.getClassNames = getClassNames;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"responsive-props.js","sources":["../../src/utils/responsive-props.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"responsive-props.js","sources":["../../src/utils/responsive-props.ts"],"sourcesContent":["type ResponsiveBreakpoints = 'mobile' | 'tablet' | 'desktop'\n\ntype Atom = string | number | boolean\n\n/**\n * A responsive prop supports receiving values of its given base type, or an object mapping a\n * responsive breakpoint name to a value from the prop's base type.\n *\n * Some examples:\n *\n * - `align={{ mobile: 'left', tablet: 'center', desktop: 'right' }}`\n */\ntype ResponsiveProp<AtomType extends Atom> =\n | AtomType\n | Readonly<{ [key in ResponsiveBreakpoints]?: AtomType }>\n\nconst DEBUG = process.env.NODE_ENV === 'development'\n\n/**\n * Builds a css module class name for a given prop + prop-value combination.\n *\n * We have a convention of building the internal utility-based class names system in a way that\n * resembles the prop for which it is used and the value of the prop. For instance, in a component\n * with a prop `width` with possible values `narrow` and `wide`, we encode the styles for each of\n * these alternatives in the class-names `.width-narrow` and `.width-wide`.\n *\n * Furthermore, this helper is aware of responsive prop values. For instance, if you provide the\n * `width` prop above with the value `['narrow', 'wide']` this returns `['narrow', 'tablet-wide']`.\n * That is, it returns an array of class names, following the same convention above, but also\n * prefixing by the viewport width variant (`tablet-` or `desktop-`).\n *\n * @param styles the class names mapping imported from a css module\n * @param property the prop name\n * @param value the given prop's value\n */\nfunction getClassNames(\n styles: Record<string, string>,\n property: string,\n value: ResponsiveProp<string> | null | undefined,\n): Array<string | undefined> | null {\n if (!value) {\n return null\n }\n\n const classList: Array<string | undefined> = []\n\n if (typeof value === 'string') {\n classList.push(styles[`${property}-${value}`])\n } else {\n if (value.mobile) classList.push(styles[`${property}-${value.mobile}`])\n if (value.tablet) classList.push(styles[`tablet-${property}-${value.tablet}`])\n if (value.desktop) classList.push(styles[`desktop-${property}-${value.desktop}`])\n }\n\n if (DEBUG && !classList.every(Boolean)) {\n // eslint-disable-next-line no-console\n console.warn('Not all generated class names were found', { property, value, classList })\n }\n\n return classList\n}\n\n/**\n * A mapping over a responsive prop value.\n *\n * Since response values can be an object but also a scalar value, this helper makes it easier to\n * to map the values when it's an object but keeps it consistent for the case when it is a scalar\n * value as well.\n *\n * @param fromValue the responsive prop value\n * @param mapper the mapping function\n */\nfunction mapResponsiveProp<From extends Atom, To extends Atom>(\n fromValue: ResponsiveProp<From> | undefined,\n mapper: (from: From) => To,\n): ResponsiveProp<To> | undefined {\n if (!fromValue) {\n return undefined\n }\n\n if (typeof fromValue !== 'object') {\n return mapper(fromValue)\n }\n\n return {\n mobile: fromValue.mobile ? mapper(fromValue.mobile) : undefined,\n tablet: fromValue.tablet ? mapper(fromValue.tablet) : undefined,\n desktop: fromValue.desktop ? mapper(fromValue.desktop) : undefined,\n }\n}\n\nexport type { ResponsiveBreakpoints, ResponsiveProp }\nexport { getClassNames, mapResponsiveProp }\n"],"names":["DEBUG","process","env","NODE_ENV","getClassNames","styles","property","value","classList","push","mobile","tablet","desktop","every","Boolean","console","warn","mapResponsiveProp","fromValue","mapper","undefined"],"mappings":";;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA,MAAMA,KAAK,GAAGC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,aAAa,CAAA;;AAEpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,aAAaA,CAClBC,MAA8B,EAC9BC,QAAgB,EAChBC,KAAgD,EAChB;EAChC,IAAI,CAACA,KAAK,EAAE;AACR,IAAA,OAAO,IAAI,CAAA;AACf,GAAA;EAEA,MAAMC,SAAoC,GAAG,EAAE,CAAA;AAE/C,EAAA,IAAI,OAAOD,KAAK,KAAK,QAAQ,EAAE;IAC3BC,SAAS,CAACC,IAAI,CAACJ,MAAM,CAAC,CAAGC,EAAAA,QAAQ,CAAIC,CAAAA,EAAAA,KAAK,CAAE,CAAA,CAAC,CAAC,CAAA;AAClD,GAAC,MAAM;AACH,IAAA,IAAIA,KAAK,CAACG,MAAM,EAAEF,SAAS,CAACC,IAAI,CAACJ,MAAM,CAAC,CAAA,EAAGC,QAAQ,CAAIC,CAAAA,EAAAA,KAAK,CAACG,MAAM,CAAA,CAAE,CAAC,CAAC,CAAA;AACvE,IAAA,IAAIH,KAAK,CAACI,MAAM,EAAEH,SAAS,CAACC,IAAI,CAACJ,MAAM,CAAC,CAAA,OAAA,EAAUC,QAAQ,CAAIC,CAAAA,EAAAA,KAAK,CAACI,MAAM,CAAA,CAAE,CAAC,CAAC,CAAA;AAC9E,IAAA,IAAIJ,KAAK,CAACK,OAAO,EAAEJ,SAAS,CAACC,IAAI,CAACJ,MAAM,CAAC,CAAA,QAAA,EAAWC,QAAQ,CAAIC,CAAAA,EAAAA,KAAK,CAACK,OAAO,CAAA,CAAE,CAAC,CAAC,CAAA;AACrF,GAAA;EAEA,IAAIZ,KAAK,IAAI,CAACQ,SAAS,CAACK,KAAK,CAACC,OAAO,CAAC,EAAE;AACpC;AACAC,IAAAA,OAAO,CAACC,IAAI,CAAC,0CAA0C,EAAE;MAAEV,QAAQ;MAAEC,KAAK;AAAEC,MAAAA,SAAAA;AAAU,KAAC,CAAC,CAAA;AAC5F,GAAA;AAEA,EAAA,OAAOA,SAAS,CAAA;AACpB,CAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASS,iBAAiBA,CACtBC,SAA2C,EAC3CC,MAA0B,EACI;EAC9B,IAAI,CAACD,SAAS,EAAE;AACZ,IAAA,OAAOE,SAAS,CAAA;AACpB,GAAA;AAEA,EAAA,IAAI,OAAOF,SAAS,KAAK,QAAQ,EAAE;IAC/B,OAAOC,MAAM,CAACD,SAAS,CAAC,CAAA;AAC5B,GAAA;EAEA,OAAO;AACHR,IAAAA,MAAM,EAAEQ,SAAS,CAACR,MAAM,GAAGS,MAAM,CAACD,SAAS,CAACR,MAAM,CAAC,GAAGU,SAAS;AAC/DT,IAAAA,MAAM,EAAEO,SAAS,CAACP,MAAM,GAAGQ,MAAM,CAACD,SAAS,CAACP,MAAM,CAAC,GAAGS,SAAS;IAC/DR,OAAO,EAAEM,SAAS,CAACN,OAAO,GAAGO,MAAM,CAACD,SAAS,CAACN,OAAO,CAAC,GAAGQ,SAAAA;GAC5D,CAAA;AACL;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@doist/reactist",
|
|
3
3
|
"description": "Open source React components by Doist",
|
|
4
|
-
"version": "29.1.
|
|
4
|
+
"version": "29.1.2",
|
|
5
5
|
"repository": "https://github.com/Doist/reactist",
|
|
6
6
|
"homepage": "https://github.com/Doist/reactist#readme",
|
|
7
7
|
"bugs": {
|
|
@@ -65,17 +65,20 @@
|
|
|
65
65
|
"classnames": "^2.2.5",
|
|
66
66
|
"prop-types": "^15.6.2",
|
|
67
67
|
"react": "^17.0.0 || ^18.0.0",
|
|
68
|
+
"react-compiler-runtime": "^1.0.0",
|
|
68
69
|
"react-dom": "^17.0.0 || ^18.0.0"
|
|
69
70
|
},
|
|
70
71
|
"devDependencies": {
|
|
71
72
|
"@ariakit/react": "0.4.19",
|
|
72
|
-
"@babel/
|
|
73
|
+
"@babel/cli": "7.28.3",
|
|
74
|
+
"@babel/core": "7.28.5",
|
|
73
75
|
"@babel/plugin-proposal-class-properties": "^7.10.1",
|
|
74
76
|
"@babel/plugin-proposal-export-default-from": "^7.0.0",
|
|
75
77
|
"@babel/plugin-proposal-export-namespace-from": "^7.0.0",
|
|
76
78
|
"@babel/plugin-proposal-nullish-coalescing-operator": "7.18.6",
|
|
77
79
|
"@babel/plugin-proposal-object-rest-spread": "^7.10.1",
|
|
78
80
|
"@babel/plugin-proposal-optional-chaining": "7.21.0",
|
|
81
|
+
"@babel/plugin-transform-runtime": "7.28.5",
|
|
79
82
|
"@babel/plugin-transform-spread": "^7.0.0",
|
|
80
83
|
"@babel/polyfill": "^7.0.0",
|
|
81
84
|
"@babel/preset-env": "^7.0.0",
|
|
@@ -86,6 +89,7 @@
|
|
|
86
89
|
"@doist/prettier-config": "4.0.0",
|
|
87
90
|
"@doist/tsconfig": "2.0.0",
|
|
88
91
|
"@geometricpanda/storybook-addon-badges": "^0.2.2",
|
|
92
|
+
"@rollup/plugin-babel": "6.1.0",
|
|
89
93
|
"@rollup/plugin-commonjs": "28.0.9",
|
|
90
94
|
"@rollup/plugin-node-resolve": "16.0.3",
|
|
91
95
|
"@rollup/plugin-terser": "0.4.4",
|
|
@@ -118,6 +122,7 @@
|
|
|
118
122
|
"autoprefixer": "^9.8.0",
|
|
119
123
|
"babel-core": "^7.0.0-bridge.0",
|
|
120
124
|
"babel-loader": "^8.1.0",
|
|
125
|
+
"babel-plugin-react-compiler": "1.0.0",
|
|
121
126
|
"chromatic": "^6.11.4",
|
|
122
127
|
"classnames": "^2.2.5",
|
|
123
128
|
"css-loader": "^4.2.2",
|
|
@@ -147,6 +152,7 @@
|
|
|
147
152
|
"prettier": "3.6.2",
|
|
148
153
|
"raw-loader": "^4.0.1",
|
|
149
154
|
"react": "^17.0.2",
|
|
155
|
+
"react-compiler-runtime": "1.0.0",
|
|
150
156
|
"react-docgen-typescript-loader": "^3.7.2",
|
|
151
157
|
"react-dom": "^17.0.2",
|
|
152
158
|
"react-is": "^17.0.2",
|
|
@@ -155,6 +161,7 @@
|
|
|
155
161
|
"rimraf": "^3.0.2",
|
|
156
162
|
"rollup": "2.79.2",
|
|
157
163
|
"rollup-plugin-styles": "4.0.0",
|
|
164
|
+
"rollup-plugin-visualizer": "6.0.5",
|
|
158
165
|
"style-loader": "^0.23.1",
|
|
159
166
|
"svg-url-loader": "^6.0.0",
|
|
160
167
|
"ts-loader": "^8.0.2",
|
|
@@ -163,6 +170,7 @@
|
|
|
163
170
|
"webpack": "^4.43.0"
|
|
164
171
|
},
|
|
165
172
|
"dependencies": {
|
|
173
|
+
"@babel/runtime": "^7.28.4",
|
|
166
174
|
"aria-hidden": "^1.2.1",
|
|
167
175
|
"dayjs": "^1.8.10",
|
|
168
176
|
"patch-package": "^6.4.6",
|