@blockle/blocks-react 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -0
- package/dist/components/accessibility/VisuallyHidden/VisuallyHidden.cjs +20 -0
- package/dist/components/accessibility/VisuallyHidden/VisuallyHidden.d.ts +6 -0
- package/dist/components/accessibility/VisuallyHidden/VisuallyHidden.js +20 -0
- package/dist/components/accessibility/VisuallyHidden/VisuallyHidden.spec.d.ts +1 -0
- package/dist/components/accessibility/VisuallyHidden/VisuallyHidden.stories.d.ts +6 -0
- package/dist/components/accessibility/VisuallyHidden/index.d.ts +1 -0
- package/dist/components/accessibility/VisuallyHidden/visually-hidden.css.cjs +16 -0
- package/dist/components/accessibility/VisuallyHidden/visually-hidden.css.d.ts +1 -0
- package/dist/components/accessibility/VisuallyHidden/visually-hidden.css.js +16 -0
- package/dist/components/display/Divider/Divider.cjs +28 -0
- package/dist/components/display/Divider/Divider.d.ts +7 -0
- package/dist/components/display/Divider/Divider.js +28 -0
- package/dist/components/display/Divider/Divider.spec.d.ts +1 -0
- package/dist/components/display/Divider/Divider.stories.d.ts +6 -0
- package/dist/components/display/Divider/divider.css.cjs +16 -0
- package/dist/components/display/Divider/divider.css.d.ts +1 -0
- package/dist/components/display/Divider/divider.css.js +16 -0
- package/dist/components/display/Divider/index.d.ts +1 -0
- package/dist/components/feedback/Progress/Progress.cjs +55 -0
- package/dist/components/feedback/Progress/Progress.d.ts +16 -0
- package/dist/components/feedback/Progress/Progress.js +55 -0
- package/dist/components/feedback/Progress/Progress.stories.d.ts +5 -0
- package/dist/components/feedback/Progress/index.d.ts +1 -0
- package/dist/components/feedback/Spinner/Spinner.cjs +27 -0
- package/dist/components/feedback/Spinner/Spinner.d.ts +10 -0
- package/dist/components/feedback/Spinner/Spinner.js +27 -0
- package/dist/components/feedback/Spinner/Spinner.stories.d.ts +5 -0
- package/dist/components/feedback/Spinner/index.d.ts +1 -0
- package/dist/components/form/Button/Button.cjs +58 -0
- package/dist/components/form/Button/Button.css.cjs +16 -0
- package/dist/components/form/Button/Button.css.d.ts +1 -0
- package/dist/components/form/Button/Button.css.js +16 -0
- package/dist/components/form/Button/Button.d.ts +21 -0
- package/dist/components/form/Button/Button.js +58 -0
- package/dist/components/form/Button/Button.spec.d.ts +1 -0
- package/dist/components/form/Button/Button.stories.d.ts +7 -0
- package/dist/components/form/Button/index.d.ts +1 -0
- package/dist/components/form/Checkbox/Checkbox.cjs +80 -0
- package/dist/components/form/Checkbox/Checkbox.d.ts +9 -0
- package/dist/components/form/Checkbox/Checkbox.js +80 -0
- package/dist/components/form/Checkbox/Checkbox.spec.d.ts +1 -0
- package/dist/components/form/Checkbox/Checkbox.stories.d.ts +5 -0
- package/dist/components/form/Checkbox/checkbox.css.cjs +32 -0
- package/dist/components/form/Checkbox/checkbox.css.d.ts +3 -0
- package/dist/components/form/Checkbox/checkbox.css.js +32 -0
- package/dist/components/form/Checkbox/index.d.ts +1 -0
- package/dist/components/form/Input/Input.cjs +52 -0
- package/dist/components/form/Input/Input.d.ts +10 -0
- package/dist/components/form/Input/Input.js +52 -0
- package/dist/components/form/Input/Input.spec.d.ts +1 -0
- package/dist/components/form/Input/Input.stories.d.ts +5 -0
- package/dist/components/form/Input/index.d.ts +1 -0
- package/dist/components/form/Input/input.css.cjs +21 -0
- package/dist/components/form/Input/input.css.d.ts +1 -0
- package/dist/components/form/Input/input.css.js +21 -0
- package/dist/components/form/Label/Label.cjs +34 -0
- package/dist/components/form/Label/Label.d.ts +18 -0
- package/dist/components/form/Label/Label.js +34 -0
- package/dist/components/form/Label/Label.spec.d.ts +1 -0
- package/dist/components/form/Label/Label.stories.d.ts +6 -0
- package/dist/components/form/Label/index.d.ts +1 -0
- package/dist/components/form/Radio/Radio.cjs +50 -0
- package/dist/components/form/Radio/Radio.d.ts +8 -0
- package/dist/components/form/Radio/Radio.js +50 -0
- package/dist/components/form/Radio/Radio.spec.d.ts +1 -0
- package/dist/components/form/Radio/Radio.stories.d.ts +6 -0
- package/dist/components/form/Radio/RadioGroup.d.ts +8 -0
- package/dist/components/form/Radio/index.d.ts +2 -0
- package/dist/components/form/Radio/radio.css.cjs +32 -0
- package/dist/components/form/Radio/radio.css.d.ts +3 -0
- package/dist/components/form/Radio/radio.css.js +32 -0
- package/dist/components/form/Select/Select.cjs +73 -0
- package/dist/components/form/Select/Select.d.ts +11 -0
- package/dist/components/form/Select/Select.js +73 -0
- package/dist/components/form/Select/Select.stories.d.ts +5 -0
- package/dist/components/form/Select/index.d.ts +1 -0
- package/dist/components/form/Select/select.css.cjs +38 -0
- package/dist/components/form/Select/select.css.d.ts +3 -0
- package/dist/components/form/Select/select.css.js +38 -0
- package/dist/components/form/Slider/Slider.cjs +139 -0
- package/dist/components/form/Slider/Slider.d.ts +22 -0
- package/dist/components/form/Slider/Slider.js +139 -0
- package/dist/components/form/Slider/Slider.spec.d.ts +1 -0
- package/dist/components/form/Slider/Slider.stories.d.ts +7 -0
- package/dist/components/form/Slider/index.d.ts +1 -0
- package/dist/components/form/Slider/slider.css.cjs +75 -0
- package/dist/components/form/Slider/slider.css.d.ts +5 -0
- package/dist/components/form/Slider/slider.css.js +75 -0
- package/dist/components/form/Slider/usePointerProgress.cjs +46 -0
- package/dist/components/form/Slider/usePointerProgress.d.ts +11 -0
- package/dist/components/form/Slider/usePointerProgress.js +46 -0
- package/dist/components/form/Switch/Switch.cjs +73 -0
- package/dist/components/form/Switch/Switch.d.ts +6 -0
- package/dist/components/form/Switch/Switch.js +73 -0
- package/dist/components/form/Switch/Switch.stories.d.ts +5 -0
- package/dist/components/form/Switch/index.d.ts +1 -0
- package/dist/components/form/Switch/switch.css.cjs +27 -0
- package/dist/components/form/Switch/switch.css.d.ts +2 -0
- package/dist/components/form/Switch/switch.css.js +27 -0
- package/dist/components/layout/Box/Box.cjs +26 -0
- package/dist/components/layout/Box/Box.d.ts +10 -0
- package/dist/components/layout/Box/Box.js +26 -0
- package/dist/components/layout/Box/Box.spec.d.ts +1 -0
- package/dist/components/layout/Box/Box.stories.d.ts +6 -0
- package/dist/components/layout/Box/index.d.ts +1 -0
- package/dist/components/layout/Inline/Inline.cjs +30 -0
- package/dist/components/layout/Inline/Inline.d.ts +12 -0
- package/dist/components/layout/Inline/Inline.js +30 -0
- package/dist/components/layout/Inline/Inline.stories.d.ts +6 -0
- package/dist/components/layout/Inline/index.d.ts +1 -0
- package/dist/components/layout/Stack/Stack.cjs +27 -0
- package/dist/components/layout/Stack/Stack.d.ts +16 -0
- package/dist/components/layout/Stack/Stack.js +27 -0
- package/dist/components/layout/Stack/Stack.stories.d.ts +6 -0
- package/dist/components/layout/Stack/index.d.ts +1 -0
- package/dist/components/navigation/Link/Link.cjs +33 -0
- package/dist/components/navigation/Link/Link.d.ts +11 -0
- package/dist/components/navigation/Link/Link.js +33 -0
- package/dist/components/navigation/Link/Link.stories.d.ts +6 -0
- package/dist/components/navigation/Link/Link.test.d.ts +1 -0
- package/dist/components/navigation/Link/index.d.ts +1 -0
- package/dist/components/overlay/Dialog/Dialog.cjs +81 -0
- package/dist/components/overlay/Dialog/Dialog.d.ts +12 -0
- package/dist/components/overlay/Dialog/Dialog.js +81 -0
- package/dist/components/overlay/Dialog/Dialog.stories.d.ts +7 -0
- package/dist/components/overlay/Dialog/Dialog.test.d.ts +1 -0
- package/dist/components/overlay/Dialog/dialog.css.cjs +22 -0
- package/dist/components/overlay/Dialog/dialog.css.d.ts +1 -0
- package/dist/components/overlay/Dialog/dialog.css.js +22 -0
- package/dist/components/overlay/Dialog/dialogHelper.cjs +21 -0
- package/dist/components/overlay/Dialog/dialogHelper.d.ts +6 -0
- package/dist/components/overlay/Dialog/dialogHelper.js +21 -0
- package/dist/components/overlay/Dialog/index.d.ts +1 -0
- package/dist/components/overlay/Popover/Popover.cjs +112 -0
- package/dist/components/overlay/Popover/Popover.d.ts +12 -0
- package/dist/components/overlay/Popover/Popover.js +112 -0
- package/dist/components/overlay/Popover/Popover.stories.d.ts +5 -0
- package/dist/components/overlay/Popover/index.d.ts +1 -0
- package/dist/components/overlay/Popover/popover-utils.cjs +62 -0
- package/dist/components/overlay/Popover/popover-utils.d.ts +2 -0
- package/dist/components/overlay/Popover/popover-utils.js +62 -0
- package/dist/components/overlay/Portal/Portal.cjs +15 -0
- package/dist/components/overlay/Portal/Portal.d.ts +5 -0
- package/dist/components/overlay/Portal/Portal.js +15 -0
- package/dist/components/overlay/Portal/index.d.ts +1 -0
- package/dist/components/overlay/Tooltip/Tooltip.cjs +73 -0
- package/dist/components/overlay/Tooltip/Tooltip.d.ts +12 -0
- package/dist/components/overlay/Tooltip/Tooltip.js +73 -0
- package/dist/components/overlay/Tooltip/Tooltip.stories.d.ts +5 -0
- package/dist/components/overlay/Tooltip/index.d.ts +1 -0
- package/dist/components/providers/BlocksProvider/BlocksProvider.cjs +35 -0
- package/dist/components/providers/BlocksProvider/BlocksProvider.d.ts +9 -0
- package/dist/components/providers/BlocksProvider/BlocksProvider.js +35 -0
- package/dist/components/providers/BlocksProvider/BlocksProvider.test.d.ts +1 -0
- package/dist/components/providers/BlocksProvider/context.cjs +5 -0
- package/dist/components/providers/BlocksProvider/context.d.ts +5 -0
- package/dist/components/providers/BlocksProvider/context.js +5 -0
- package/dist/components/providers/BlocksProvider/index.d.ts +2 -0
- package/dist/components/typography/Heading/Heading.cjs +24 -0
- package/dist/components/typography/Heading/Heading.d.ts +7 -0
- package/dist/components/typography/Heading/Heading.js +24 -0
- package/dist/components/typography/Heading/Heading.test.d.ts +1 -0
- package/dist/components/typography/Heading/heading.css.cjs +16 -0
- package/dist/components/typography/Heading/heading.css.d.ts +1 -0
- package/dist/components/typography/Heading/heading.css.js +16 -0
- package/dist/components/typography/Heading/heading.stories.d.ts +12 -0
- package/dist/components/typography/Heading/index.d.ts +1 -0
- package/dist/components/typography/Text/Text.cjs +21 -0
- package/dist/components/typography/Text/Text.d.ts +11 -0
- package/dist/components/typography/Text/Text.js +21 -0
- package/dist/components/typography/Text/Text.stories.d.ts +5 -0
- package/dist/components/typography/Text/Text.test.d.ts +1 -0
- package/dist/components/typography/Text/index.d.ts +1 -0
- package/dist/components/typography/Text/text.css.cjs +16 -0
- package/dist/components/typography/Text/text.css.d.ts +1 -0
- package/dist/components/typography/Text/text.css.js +16 -0
- package/dist/hooks/useClickOutside/useClickOutside.cjs +23 -0
- package/dist/hooks/useClickOutside/useClickOutside.d.ts +6 -0
- package/dist/hooks/useClickOutside/useClickOutside.js +23 -0
- package/dist/hooks/useComponentStyles/index.d.ts +2 -0
- package/dist/hooks/useComponentStyles/useComponentStyleDefaultProps.cjs +12 -0
- package/dist/hooks/useComponentStyles/useComponentStyleDefaultProps.d.ts +7 -0
- package/dist/hooks/useComponentStyles/useComponentStyleDefaultProps.js +12 -0
- package/dist/hooks/useComponentStyles/useComponentStyles.cjs +74 -0
- package/dist/hooks/useComponentStyles/useComponentStyles.d.ts +2 -0
- package/dist/hooks/useComponentStyles/useComponentStyles.js +74 -0
- package/dist/hooks/useControlledValue/index.d.ts +1 -0
- package/dist/hooks/useControlledValue/useControlledValue.cjs +33 -0
- package/dist/hooks/useControlledValue/useControlledValue.d.ts +8 -0
- package/dist/hooks/useControlledValue/useControlledValue.js +33 -0
- package/dist/hooks/useIsomorphicLayoutEffect/index.d.ts +1 -0
- package/dist/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.cjs +6 -0
- package/dist/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.d.ts +5 -0
- package/dist/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js +6 -0
- package/dist/hooks/useKeyboard/index.d.ts +1 -0
- package/dist/hooks/useKeyboard/useKeyboard.cjs +21 -0
- package/dist/hooks/useKeyboard/useKeyboard.d.ts +6 -0
- package/dist/hooks/useKeyboard/useKeyboard.js +21 -0
- package/dist/hooks/useLayer/index.d.ts +1 -0
- package/dist/hooks/useLayer/useLayer.cjs +27 -0
- package/dist/hooks/useLayer/useLayer.d.ts +1 -0
- package/dist/hooks/useLayer/useLayer.js +27 -0
- package/dist/hooks/usePreventBodyScroll/index.d.ts +1 -0
- package/dist/hooks/usePreventBodyScroll/usePreventBodyScroll.cjs +31 -0
- package/dist/hooks/usePreventBodyScroll/usePreventBodyScroll.d.ts +1 -0
- package/dist/hooks/usePreventBodyScroll/usePreventBodyScroll.js +31 -0
- package/dist/hooks/useRestoreFocus/index.d.ts +1 -0
- package/dist/hooks/useRestoreFocus/useRestoreFocus.cjs +19 -0
- package/dist/hooks/useRestoreFocus/useRestoreFocus.d.ts +4 -0
- package/dist/hooks/useRestoreFocus/useRestoreFocus.js +19 -0
- package/dist/hooks/useTheme/index.d.ts +1 -0
- package/dist/hooks/useTheme/useTheme.cjs +13 -0
- package/dist/hooks/useTheme/useTheme.d.ts +2 -0
- package/dist/hooks/useTheme/useTheme.js +13 -0
- package/dist/hooks/useVisibilityState/index.d.ts +1 -0
- package/dist/hooks/useVisibilityState/useVisibilityState.cjs +17 -0
- package/dist/hooks/useVisibilityState/useVisibilityState.d.ts +3 -0
- package/dist/hooks/useVisibilityState/useVisibilityState.js +17 -0
- package/dist/index.cjs +58 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +58 -0
- package/package.json +47 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { hasAnimationDuration, classnames } from "@blockle/blocks-core";
|
|
4
|
+
import { useState, useRef, useLayoutEffect, useEffect, useCallback } from "react";
|
|
5
|
+
import { useClickOutside } from "../../../hooks/useClickOutside/useClickOutside.js";
|
|
6
|
+
import { getPopoverPosition } from "./popover-utils.js";
|
|
7
|
+
import { useLayer } from "../../../hooks/useLayer/useLayer.js";
|
|
8
|
+
import { useVisibilityState } from "../../../hooks/useVisibilityState/useVisibilityState.js";
|
|
9
|
+
import { useComponentStyles } from "../../../hooks/useComponentStyles/useComponentStyles.js";
|
|
10
|
+
import { useIsomorphicLayoutEffect } from "../../../hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";
|
|
11
|
+
import { useKeyboard } from "../../../hooks/useKeyboard/useKeyboard.js";
|
|
12
|
+
import { Portal } from "../Portal/Portal.js";
|
|
13
|
+
import { Box } from "../../layout/Box/Box.js";
|
|
14
|
+
const Popover = ({
|
|
15
|
+
align = "bottom",
|
|
16
|
+
anchorElement,
|
|
17
|
+
children,
|
|
18
|
+
className,
|
|
19
|
+
onRequestClose,
|
|
20
|
+
open,
|
|
21
|
+
repositionOnScroll,
|
|
22
|
+
style,
|
|
23
|
+
...restProps
|
|
24
|
+
}) => {
|
|
25
|
+
const layer = useLayer();
|
|
26
|
+
const [visible, hide] = useVisibilityState(open);
|
|
27
|
+
const [position, setPosition] = useState({ x: 0, y: 0 });
|
|
28
|
+
const popoverRef = useRef(null);
|
|
29
|
+
const containerClassName = useComponentStyles(
|
|
30
|
+
"popover",
|
|
31
|
+
{ base: true },
|
|
32
|
+
false
|
|
33
|
+
);
|
|
34
|
+
useLayoutEffect(() => {
|
|
35
|
+
if (!visible) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const position2 = getPopoverPosition(align, anchorElement, popoverRef);
|
|
39
|
+
setPosition({ x: position2[0], y: position2[1] });
|
|
40
|
+
}, [align, anchorElement, visible]);
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
if (!open || !repositionOnScroll) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
function handleResize() {
|
|
46
|
+
const position2 = getPopoverPosition(align, anchorElement, popoverRef);
|
|
47
|
+
setPosition({ x: position2[0], y: position2[1] });
|
|
48
|
+
}
|
|
49
|
+
window.addEventListener("resize", handleResize);
|
|
50
|
+
window.addEventListener("scroll", handleResize);
|
|
51
|
+
return () => {
|
|
52
|
+
window.removeEventListener("resize", handleResize);
|
|
53
|
+
window.removeEventListener("scroll", handleResize);
|
|
54
|
+
};
|
|
55
|
+
}, [align, anchorElement, open, repositionOnScroll]);
|
|
56
|
+
useIsomorphicLayoutEffect(() => {
|
|
57
|
+
var _a;
|
|
58
|
+
if (!open) {
|
|
59
|
+
(_a = popoverRef.current) == null ? void 0 : _a.removeAttribute("data-open");
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
let timer = requestAnimationFrame(() => {
|
|
63
|
+
timer = requestAnimationFrame(() => {
|
|
64
|
+
var _a2;
|
|
65
|
+
(_a2 = popoverRef.current) == null ? void 0 : _a2.setAttribute("data-open", "");
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
return () => {
|
|
69
|
+
cancelAnimationFrame(timer);
|
|
70
|
+
};
|
|
71
|
+
}, [open, visible]);
|
|
72
|
+
const onAnimationEnd = useCallback(() => {
|
|
73
|
+
if (!open) {
|
|
74
|
+
hide();
|
|
75
|
+
}
|
|
76
|
+
}, [hide, open]);
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
if (open) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
if (!hasAnimationDuration(popoverRef.current)) {
|
|
82
|
+
hide();
|
|
83
|
+
}
|
|
84
|
+
}, [hide, open]);
|
|
85
|
+
useKeyboard("Escape", onRequestClose, { enabled: visible });
|
|
86
|
+
useClickOutside(popoverRef, onRequestClose, { enabled: visible });
|
|
87
|
+
if (!visible) {
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
const dataOpen = typeof window === "undefined" && open ? "" : void 0;
|
|
91
|
+
return /* @__PURE__ */ jsx(Portal, { container: layer(), children: /* @__PURE__ */ jsx(
|
|
92
|
+
Box,
|
|
93
|
+
{
|
|
94
|
+
ref: popoverRef,
|
|
95
|
+
"data-open": dataOpen,
|
|
96
|
+
onAnimationEnd,
|
|
97
|
+
onTransitionEnd: onAnimationEnd,
|
|
98
|
+
className: classnames(containerClassName, className),
|
|
99
|
+
position: "absolute",
|
|
100
|
+
style: {
|
|
101
|
+
...style,
|
|
102
|
+
left: position.x,
|
|
103
|
+
top: position.y
|
|
104
|
+
},
|
|
105
|
+
...restProps,
|
|
106
|
+
children
|
|
107
|
+
}
|
|
108
|
+
) });
|
|
109
|
+
};
|
|
110
|
+
export {
|
|
111
|
+
Popover
|
|
112
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Popover, type PopoverProps } from './Popover';
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
function getPopoverPosition(align, anchorRef, popoverRef) {
|
|
4
|
+
if (!anchorRef.current || !popoverRef.current) {
|
|
5
|
+
return [0, 0];
|
|
6
|
+
}
|
|
7
|
+
popoverRef.current.style.transform = "none";
|
|
8
|
+
popoverRef.current.style.transitionDuration = "0s";
|
|
9
|
+
const anchorRect = anchorRef.current.getBoundingClientRect();
|
|
10
|
+
const popoverRect = popoverRef.current.getBoundingClientRect();
|
|
11
|
+
let popoverStyles = getComputedStyle(popoverRef.current);
|
|
12
|
+
const top = popoverStyles.getPropertyValue("top");
|
|
13
|
+
const left = popoverStyles.getPropertyValue("left");
|
|
14
|
+
popoverRef.current.style.left = "0";
|
|
15
|
+
popoverRef.current.style.top = "0";
|
|
16
|
+
popoverStyles = getComputedStyle(popoverRef.current);
|
|
17
|
+
const marginTop = Number.parseFloat(
|
|
18
|
+
popoverStyles.getPropertyValue("margin-top")
|
|
19
|
+
);
|
|
20
|
+
const marginRight = Number.parseFloat(
|
|
21
|
+
popoverStyles.getPropertyValue("margin-right")
|
|
22
|
+
);
|
|
23
|
+
const marginBottom = Number.parseFloat(
|
|
24
|
+
popoverStyles.getPropertyValue("margin-bottom")
|
|
25
|
+
);
|
|
26
|
+
const marginLeft = Number.parseFloat(
|
|
27
|
+
popoverStyles.getPropertyValue("margin-left")
|
|
28
|
+
);
|
|
29
|
+
const marginY = marginTop + marginBottom;
|
|
30
|
+
const marginX = marginRight + marginLeft;
|
|
31
|
+
const docHeight = document.documentElement.clientHeight;
|
|
32
|
+
const docWidth = document.documentElement.clientWidth;
|
|
33
|
+
const docScrollTop = document.documentElement.scrollTop;
|
|
34
|
+
const docScrollLeft = document.documentElement.scrollLeft;
|
|
35
|
+
const anchorLeft = anchorRect.left + docScrollLeft;
|
|
36
|
+
const anchorTop = anchorRect.top + docScrollTop;
|
|
37
|
+
const topPosition = anchorRect.top - (popoverRect.height + marginTop);
|
|
38
|
+
const rightPosition = anchorRect.left + anchorRect.width + popoverRect.width;
|
|
39
|
+
const bottomPosition = anchorRect.top + anchorRect.height + popoverRect.height;
|
|
40
|
+
const leftPosition = anchorRect.left - popoverRect.width;
|
|
41
|
+
const offsetX = anchorLeft - marginLeft - (popoverRect.width - anchorRect.width) / 2;
|
|
42
|
+
const offsetY = anchorTop - marginTop - (popoverRect.height - anchorRect.height) / 2;
|
|
43
|
+
popoverRef.current.style.transform = "";
|
|
44
|
+
popoverRef.current.style.transitionDuration = "";
|
|
45
|
+
popoverRef.current.style.top = top;
|
|
46
|
+
popoverRef.current.style.left = left;
|
|
47
|
+
switch (align) {
|
|
48
|
+
case "top": {
|
|
49
|
+
return topPosition > 0 ? [offsetX, anchorTop - popoverRect.height - marginY] : [offsetX, anchorTop + anchorRect.height];
|
|
50
|
+
}
|
|
51
|
+
case "bottom": {
|
|
52
|
+
return bottomPosition < docHeight || topPosition < 0 ? [offsetX, anchorTop + anchorRect.height] : [offsetX, anchorTop - popoverRect.height - marginY];
|
|
53
|
+
}
|
|
54
|
+
case "left": {
|
|
55
|
+
return leftPosition > docWidth || leftPosition > 0 ? [anchorLeft - popoverRect.width - marginX, offsetY] : [anchorLeft + anchorRect.width, offsetY];
|
|
56
|
+
}
|
|
57
|
+
case "right": {
|
|
58
|
+
return rightPosition < docWidth || leftPosition < 0 ? [anchorLeft + anchorRect.width, offsetY] : [anchorLeft - popoverRect.width - marginX, offsetY];
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.getPopoverPosition = getPopoverPosition;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
function getPopoverPosition(align, anchorRef, popoverRef) {
|
|
2
|
+
if (!anchorRef.current || !popoverRef.current) {
|
|
3
|
+
return [0, 0];
|
|
4
|
+
}
|
|
5
|
+
popoverRef.current.style.transform = "none";
|
|
6
|
+
popoverRef.current.style.transitionDuration = "0s";
|
|
7
|
+
const anchorRect = anchorRef.current.getBoundingClientRect();
|
|
8
|
+
const popoverRect = popoverRef.current.getBoundingClientRect();
|
|
9
|
+
let popoverStyles = getComputedStyle(popoverRef.current);
|
|
10
|
+
const top = popoverStyles.getPropertyValue("top");
|
|
11
|
+
const left = popoverStyles.getPropertyValue("left");
|
|
12
|
+
popoverRef.current.style.left = "0";
|
|
13
|
+
popoverRef.current.style.top = "0";
|
|
14
|
+
popoverStyles = getComputedStyle(popoverRef.current);
|
|
15
|
+
const marginTop = Number.parseFloat(
|
|
16
|
+
popoverStyles.getPropertyValue("margin-top")
|
|
17
|
+
);
|
|
18
|
+
const marginRight = Number.parseFloat(
|
|
19
|
+
popoverStyles.getPropertyValue("margin-right")
|
|
20
|
+
);
|
|
21
|
+
const marginBottom = Number.parseFloat(
|
|
22
|
+
popoverStyles.getPropertyValue("margin-bottom")
|
|
23
|
+
);
|
|
24
|
+
const marginLeft = Number.parseFloat(
|
|
25
|
+
popoverStyles.getPropertyValue("margin-left")
|
|
26
|
+
);
|
|
27
|
+
const marginY = marginTop + marginBottom;
|
|
28
|
+
const marginX = marginRight + marginLeft;
|
|
29
|
+
const docHeight = document.documentElement.clientHeight;
|
|
30
|
+
const docWidth = document.documentElement.clientWidth;
|
|
31
|
+
const docScrollTop = document.documentElement.scrollTop;
|
|
32
|
+
const docScrollLeft = document.documentElement.scrollLeft;
|
|
33
|
+
const anchorLeft = anchorRect.left + docScrollLeft;
|
|
34
|
+
const anchorTop = anchorRect.top + docScrollTop;
|
|
35
|
+
const topPosition = anchorRect.top - (popoverRect.height + marginTop);
|
|
36
|
+
const rightPosition = anchorRect.left + anchorRect.width + popoverRect.width;
|
|
37
|
+
const bottomPosition = anchorRect.top + anchorRect.height + popoverRect.height;
|
|
38
|
+
const leftPosition = anchorRect.left - popoverRect.width;
|
|
39
|
+
const offsetX = anchorLeft - marginLeft - (popoverRect.width - anchorRect.width) / 2;
|
|
40
|
+
const offsetY = anchorTop - marginTop - (popoverRect.height - anchorRect.height) / 2;
|
|
41
|
+
popoverRef.current.style.transform = "";
|
|
42
|
+
popoverRef.current.style.transitionDuration = "";
|
|
43
|
+
popoverRef.current.style.top = top;
|
|
44
|
+
popoverRef.current.style.left = left;
|
|
45
|
+
switch (align) {
|
|
46
|
+
case "top": {
|
|
47
|
+
return topPosition > 0 ? [offsetX, anchorTop - popoverRect.height - marginY] : [offsetX, anchorTop + anchorRect.height];
|
|
48
|
+
}
|
|
49
|
+
case "bottom": {
|
|
50
|
+
return bottomPosition < docHeight || topPosition < 0 ? [offsetX, anchorTop + anchorRect.height] : [offsetX, anchorTop - popoverRect.height - marginY];
|
|
51
|
+
}
|
|
52
|
+
case "left": {
|
|
53
|
+
return leftPosition > docWidth || leftPosition > 0 ? [anchorLeft - popoverRect.width - marginX, offsetY] : [anchorLeft + anchorRect.width, offsetY];
|
|
54
|
+
}
|
|
55
|
+
case "right": {
|
|
56
|
+
return rightPosition < docWidth || leftPosition < 0 ? [anchorLeft + anchorRect.width, offsetY] : [anchorLeft - popoverRect.width - marginX, offsetY];
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
export {
|
|
61
|
+
getPopoverPosition
|
|
62
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
5
|
+
const reactDom = require("react-dom");
|
|
6
|
+
const useTheme = require("../../../hooks/useTheme/useTheme.cjs");
|
|
7
|
+
const BlocksProvider = require("../../providers/BlocksProvider/BlocksProvider.cjs");
|
|
8
|
+
const Portal = ({ children, container }) => {
|
|
9
|
+
const context = useTheme.useTheme();
|
|
10
|
+
return reactDom.createPortal(
|
|
11
|
+
/* @__PURE__ */ jsxRuntime.jsx(BlocksProvider.BlocksProvider, { theme: context, children }),
|
|
12
|
+
container || document.body
|
|
13
|
+
);
|
|
14
|
+
};
|
|
15
|
+
exports.Portal = Portal;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { createPortal } from "react-dom";
|
|
4
|
+
import { useTheme } from "../../../hooks/useTheme/useTheme.js";
|
|
5
|
+
import { BlocksProvider } from "../../providers/BlocksProvider/BlocksProvider.js";
|
|
6
|
+
const Portal = ({ children, container }) => {
|
|
7
|
+
const context = useTheme();
|
|
8
|
+
return createPortal(
|
|
9
|
+
/* @__PURE__ */ jsx(BlocksProvider, { theme: context, children }),
|
|
10
|
+
container || document.body
|
|
11
|
+
);
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
Portal
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Portal, type PortalProps } from './Portal';
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
5
|
+
const blocksCore = require("@blockle/blocks-core");
|
|
6
|
+
const react = require("react");
|
|
7
|
+
const useComponentStyles = require("../../../hooks/useComponentStyles/useComponentStyles.cjs");
|
|
8
|
+
const Popover = require("../Popover/Popover.cjs");
|
|
9
|
+
const Tooltip = ({
|
|
10
|
+
align = "top",
|
|
11
|
+
children,
|
|
12
|
+
label,
|
|
13
|
+
colorScheme
|
|
14
|
+
}) => {
|
|
15
|
+
const id = react.useId();
|
|
16
|
+
const ref = react.useRef(null);
|
|
17
|
+
const [open, setOpen] = react.useState(false);
|
|
18
|
+
const tooltipClassName = useComponentStyles.useComponentStyles("tooltip", {
|
|
19
|
+
base: true,
|
|
20
|
+
variants: { colorScheme }
|
|
21
|
+
});
|
|
22
|
+
react.useEffect(() => {
|
|
23
|
+
const element = ref.current;
|
|
24
|
+
if (!element) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
function onEnter() {
|
|
28
|
+
setOpen(true);
|
|
29
|
+
}
|
|
30
|
+
function onLeave() {
|
|
31
|
+
setOpen(false);
|
|
32
|
+
}
|
|
33
|
+
element.addEventListener("mouseenter", onEnter);
|
|
34
|
+
element.addEventListener("mouseleave", onLeave);
|
|
35
|
+
element.addEventListener("focusin", onEnter);
|
|
36
|
+
element.addEventListener("focusout", onLeave);
|
|
37
|
+
return () => {
|
|
38
|
+
element.removeEventListener("mouseenter", onEnter);
|
|
39
|
+
element.removeEventListener("mouseleave", onLeave);
|
|
40
|
+
element.removeEventListener("focusin", onEnter);
|
|
41
|
+
element.removeEventListener("focusout", onLeave);
|
|
42
|
+
};
|
|
43
|
+
}, []);
|
|
44
|
+
if (react.Children.count(children) !== 1) {
|
|
45
|
+
throw new Error("Tooltip component can only have one child");
|
|
46
|
+
}
|
|
47
|
+
const child = react.Children.toArray(children)[0];
|
|
48
|
+
if (!react.isValidElement(child)) {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
52
|
+
react.cloneElement(child, {
|
|
53
|
+
ref: blocksCore.composeRefs(ref, child.ref),
|
|
54
|
+
"aria-describedby": open ? id : void 0
|
|
55
|
+
}),
|
|
56
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
57
|
+
Popover.Popover,
|
|
58
|
+
{
|
|
59
|
+
id,
|
|
60
|
+
role: "tooltip",
|
|
61
|
+
anchorElement: ref,
|
|
62
|
+
open,
|
|
63
|
+
onRequestClose: () => {
|
|
64
|
+
setOpen(false);
|
|
65
|
+
},
|
|
66
|
+
align,
|
|
67
|
+
className: tooltipClassName,
|
|
68
|
+
children: label
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
] });
|
|
72
|
+
};
|
|
73
|
+
exports.Tooltip = Tooltip;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ComponentThemes } from '@blockle/blocks-core';
|
|
2
|
+
import { PopoverProps } from '../Popover';
|
|
3
|
+
type ReactElement = React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
4
|
+
type TooltipTheme = ComponentThemes['tooltip'];
|
|
5
|
+
export type TooltipProps = {
|
|
6
|
+
align?: PopoverProps['align'];
|
|
7
|
+
children: ReactElement;
|
|
8
|
+
label: React.ReactNode;
|
|
9
|
+
colorScheme?: TooltipTheme['variants']['colorScheme'];
|
|
10
|
+
};
|
|
11
|
+
export declare const Tooltip: React.FC<TooltipProps>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
3
|
+
import { composeRefs } from "@blockle/blocks-core";
|
|
4
|
+
import { useId, useRef, useState, useEffect, Children, isValidElement, cloneElement } from "react";
|
|
5
|
+
import { useComponentStyles } from "../../../hooks/useComponentStyles/useComponentStyles.js";
|
|
6
|
+
import { Popover } from "../Popover/Popover.js";
|
|
7
|
+
const Tooltip = ({
|
|
8
|
+
align = "top",
|
|
9
|
+
children,
|
|
10
|
+
label,
|
|
11
|
+
colorScheme
|
|
12
|
+
}) => {
|
|
13
|
+
const id = useId();
|
|
14
|
+
const ref = useRef(null);
|
|
15
|
+
const [open, setOpen] = useState(false);
|
|
16
|
+
const tooltipClassName = useComponentStyles("tooltip", {
|
|
17
|
+
base: true,
|
|
18
|
+
variants: { colorScheme }
|
|
19
|
+
});
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
const element = ref.current;
|
|
22
|
+
if (!element) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
function onEnter() {
|
|
26
|
+
setOpen(true);
|
|
27
|
+
}
|
|
28
|
+
function onLeave() {
|
|
29
|
+
setOpen(false);
|
|
30
|
+
}
|
|
31
|
+
element.addEventListener("mouseenter", onEnter);
|
|
32
|
+
element.addEventListener("mouseleave", onLeave);
|
|
33
|
+
element.addEventListener("focusin", onEnter);
|
|
34
|
+
element.addEventListener("focusout", onLeave);
|
|
35
|
+
return () => {
|
|
36
|
+
element.removeEventListener("mouseenter", onEnter);
|
|
37
|
+
element.removeEventListener("mouseleave", onLeave);
|
|
38
|
+
element.removeEventListener("focusin", onEnter);
|
|
39
|
+
element.removeEventListener("focusout", onLeave);
|
|
40
|
+
};
|
|
41
|
+
}, []);
|
|
42
|
+
if (Children.count(children) !== 1) {
|
|
43
|
+
throw new Error("Tooltip component can only have one child");
|
|
44
|
+
}
|
|
45
|
+
const child = Children.toArray(children)[0];
|
|
46
|
+
if (!isValidElement(child)) {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
50
|
+
cloneElement(child, {
|
|
51
|
+
ref: composeRefs(ref, child.ref),
|
|
52
|
+
"aria-describedby": open ? id : void 0
|
|
53
|
+
}),
|
|
54
|
+
/* @__PURE__ */ jsx(
|
|
55
|
+
Popover,
|
|
56
|
+
{
|
|
57
|
+
id,
|
|
58
|
+
role: "tooltip",
|
|
59
|
+
anchorElement: ref,
|
|
60
|
+
open,
|
|
61
|
+
onRequestClose: () => {
|
|
62
|
+
setOpen(false);
|
|
63
|
+
},
|
|
64
|
+
align,
|
|
65
|
+
className: tooltipClassName,
|
|
66
|
+
children: label
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
] });
|
|
70
|
+
};
|
|
71
|
+
export {
|
|
72
|
+
Tooltip
|
|
73
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Tooltip, type TooltipProps } from './Tooltip';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
5
|
+
const react = require("react");
|
|
6
|
+
const blocksCore = require("@blockle/blocks-core");
|
|
7
|
+
const blocksReactSlot = require("@blockle/blocks-react-slot");
|
|
8
|
+
const context = require("./context.cjs");
|
|
9
|
+
const [Template, Slot] = blocksReactSlot.createSlottable("div");
|
|
10
|
+
const BlocksProvider = ({
|
|
11
|
+
children,
|
|
12
|
+
theme,
|
|
13
|
+
className,
|
|
14
|
+
...restProps
|
|
15
|
+
}) => {
|
|
16
|
+
const contextValue = react.useMemo(
|
|
17
|
+
() => ({
|
|
18
|
+
theme
|
|
19
|
+
}),
|
|
20
|
+
[theme]
|
|
21
|
+
);
|
|
22
|
+
return /* @__PURE__ */ jsxRuntime.jsx(context.BlocksProviderContext, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
23
|
+
Template,
|
|
24
|
+
{
|
|
25
|
+
className: blocksCore.classnames(
|
|
26
|
+
theme.vars,
|
|
27
|
+
blocksCore.sprinkles({ fontFamily: "primary" }),
|
|
28
|
+
className
|
|
29
|
+
),
|
|
30
|
+
...restProps,
|
|
31
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Slot, { children })
|
|
32
|
+
}
|
|
33
|
+
) });
|
|
34
|
+
};
|
|
35
|
+
exports.BlocksProvider = BlocksProvider;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Theme } from '@blockle/blocks-core';
|
|
2
|
+
export type BlocksProviderProps = {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
theme: Theme;
|
|
5
|
+
className?: string;
|
|
6
|
+
style?: React.CSSProperties;
|
|
7
|
+
asChild?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const BlocksProvider: React.FC<BlocksProviderProps>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
import { classnames, sprinkles } from "@blockle/blocks-core";
|
|
5
|
+
import { createSlottable } from "@blockle/blocks-react-slot";
|
|
6
|
+
import { BlocksProviderContext } from "./context.js";
|
|
7
|
+
const [Template, Slot] = createSlottable("div");
|
|
8
|
+
const BlocksProvider = ({
|
|
9
|
+
children,
|
|
10
|
+
theme,
|
|
11
|
+
className,
|
|
12
|
+
...restProps
|
|
13
|
+
}) => {
|
|
14
|
+
const contextValue = useMemo(
|
|
15
|
+
() => ({
|
|
16
|
+
theme
|
|
17
|
+
}),
|
|
18
|
+
[theme]
|
|
19
|
+
);
|
|
20
|
+
return /* @__PURE__ */ jsx(BlocksProviderContext, { value: contextValue, children: /* @__PURE__ */ jsx(
|
|
21
|
+
Template,
|
|
22
|
+
{
|
|
23
|
+
className: classnames(
|
|
24
|
+
theme.vars,
|
|
25
|
+
sprinkles({ fontFamily: "primary" }),
|
|
26
|
+
className
|
|
27
|
+
),
|
|
28
|
+
...restProps,
|
|
29
|
+
children: /* @__PURE__ */ jsx(Slot, { children })
|
|
30
|
+
}
|
|
31
|
+
) });
|
|
32
|
+
};
|
|
33
|
+
export {
|
|
34
|
+
BlocksProvider
|
|
35
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const blocksCore = require("@blockle/blocks-core");
|
|
5
|
+
const heading_css = require("./heading.css.cjs");
|
|
6
|
+
const Box = require("../../layout/Box/Box.cjs");
|
|
7
|
+
const Heading = ({
|
|
8
|
+
className,
|
|
9
|
+
level = 1,
|
|
10
|
+
children,
|
|
11
|
+
...restProps
|
|
12
|
+
}) => {
|
|
13
|
+
const Tag = `h${level}`;
|
|
14
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
15
|
+
Box.Box,
|
|
16
|
+
{
|
|
17
|
+
asChild: true,
|
|
18
|
+
className: blocksCore.classnames(heading_css.heading, className),
|
|
19
|
+
...restProps,
|
|
20
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Tag, { children })
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
};
|
|
24
|
+
exports.Heading = Heading;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HTMLElementProps, MarginSprinkles, PaddingSprinkles, TextSprinkles } from '@blockle/blocks-core';
|
|
2
|
+
export type HeadingProps = {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
className?: string;
|
|
5
|
+
level: 1 | 2 | 3 | 4 | 5 | 6;
|
|
6
|
+
} & TextSprinkles & MarginSprinkles & PaddingSprinkles & HTMLElementProps<HTMLHeadingElement>;
|
|
7
|
+
export declare const Heading: React.FC<HeadingProps>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { classnames } from "@blockle/blocks-core";
|
|
3
|
+
import { heading } from "./heading.css.js";
|
|
4
|
+
import { Box } from "../../layout/Box/Box.js";
|
|
5
|
+
const Heading = ({
|
|
6
|
+
className,
|
|
7
|
+
level = 1,
|
|
8
|
+
children,
|
|
9
|
+
...restProps
|
|
10
|
+
}) => {
|
|
11
|
+
const Tag = `h${level}`;
|
|
12
|
+
return /* @__PURE__ */ jsx(
|
|
13
|
+
Box,
|
|
14
|
+
{
|
|
15
|
+
asChild: true,
|
|
16
|
+
className: classnames(heading, className),
|
|
17
|
+
...restProps,
|
|
18
|
+
children: /* @__PURE__ */ jsx(Tag, { children })
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
Heading
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const fileScope = require("@vanilla-extract/css/fileScope");
|
|
4
|
+
const blocksCore = require("@blockle/blocks-core");
|
|
5
|
+
const css = require("@vanilla-extract/css");
|
|
6
|
+
fileScope.setFileScope("src/components/typography/Heading/heading.css.ts", "@blockle/blocks-react");
|
|
7
|
+
const heading = css.style({
|
|
8
|
+
"@layer": {
|
|
9
|
+
[blocksCore.blocksLayer]: {
|
|
10
|
+
margin: 0,
|
|
11
|
+
padding: 0
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
fileScope.endFileScope();
|
|
16
|
+
exports.heading = heading;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const heading: string;
|