@blockle/blocks 0.13.0 → 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +56 -8
- package/dist/index.mjs +55 -7
- package/dist/momotaro.chunk.d.ts +288 -288
- package/dist/styles/components/overlay/Dialog/Dialog.cjs +25 -80
- package/dist/styles/components/overlay/Dialog/Dialog.mjs +29 -84
- package/dist/styles/themes/momotaro/components/dialog.css.cjs +17 -4
- package/dist/styles/themes/momotaro/components/dialog.css.mjs +17 -4
- package/dist/styles/themes/momotaro/components/link.css.cjs +6 -0
- package/dist/styles/themes/momotaro/components/link.css.mjs +6 -0
- package/dist/styles/themes/momotaro/components/popover.css.cjs +1 -0
- package/dist/styles/themes/momotaro/components/popover.css.mjs +1 -0
- package/package.json +27 -23
|
@@ -3,15 +3,6 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
|
3
3
|
const react = require("react");
|
|
4
4
|
const styles_components_display_Divider_Divider_cjs = require("../../display/Divider/Divider.cjs");
|
|
5
5
|
const styles_components_overlay_Dialog_dialog_css_cjs = require("./dialog.css.cjs");
|
|
6
|
-
const reactDom = require("react-dom");
|
|
7
|
-
const styles_components_other_BlocksProvider_BlocksProvider_cjs = require("../../other/BlocksProvider/BlocksProvider.cjs");
|
|
8
|
-
const Portal = ({ children, container }) => {
|
|
9
|
-
const context = styles_components_display_Divider_Divider_cjs.useTheme();
|
|
10
|
-
return reactDom.createPortal(
|
|
11
|
-
/* @__PURE__ */ jsxRuntime.jsx(styles_components_other_BlocksProvider_BlocksProvider_cjs.BlocksProvider, { theme: context, children }),
|
|
12
|
-
container || document.body
|
|
13
|
-
);
|
|
14
|
-
};
|
|
15
6
|
const useClickOutside = (ref, onClickOutside, { enabled = true } = {}) => {
|
|
16
7
|
react.useEffect(() => {
|
|
17
8
|
if (!enabled) {
|
|
@@ -22,8 +13,11 @@ const useClickOutside = (ref, onClickOutside, { enabled = true } = {}) => {
|
|
|
22
13
|
onClickOutside();
|
|
23
14
|
}
|
|
24
15
|
};
|
|
25
|
-
|
|
16
|
+
const rafId = requestAnimationFrame(() => {
|
|
17
|
+
document.addEventListener("click", listener);
|
|
18
|
+
});
|
|
26
19
|
return () => {
|
|
20
|
+
cancelAnimationFrame(rafId);
|
|
27
21
|
document.removeEventListener("click", listener);
|
|
28
22
|
};
|
|
29
23
|
}, [ref, onClickOutside, enabled]);
|
|
@@ -45,27 +39,6 @@ const useKeyboard = (key, callback, { enabled = true, type = "keydown" } = {}) =
|
|
|
45
39
|
};
|
|
46
40
|
}, [callback, enabled, key, type]);
|
|
47
41
|
};
|
|
48
|
-
const useLayer = () => {
|
|
49
|
-
const layerRef = react.useRef();
|
|
50
|
-
react.useEffect(
|
|
51
|
-
() => () => {
|
|
52
|
-
if (layerRef.current) {
|
|
53
|
-
layerRef.current.remove();
|
|
54
|
-
layerRef.current = void 0;
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
[]
|
|
58
|
-
);
|
|
59
|
-
return () => {
|
|
60
|
-
if (!layerRef.current) {
|
|
61
|
-
const div = document.createElement("div");
|
|
62
|
-
div.dataset.layer = "blocks";
|
|
63
|
-
layerRef.current = div;
|
|
64
|
-
document.body.append(layerRef.current);
|
|
65
|
-
}
|
|
66
|
-
return layerRef.current;
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
42
|
const usePreventBodyScroll = (enabled = true) => {
|
|
70
43
|
useIsomorphicLayoutEffect(() => {
|
|
71
44
|
if (!enabled) {
|
|
@@ -106,24 +79,15 @@ const useRestoreFocus = (active) => {
|
|
|
106
79
|
}
|
|
107
80
|
}, [active]);
|
|
108
81
|
};
|
|
109
|
-
const useVisibilityState = (open) => {
|
|
110
|
-
const [visible, setVisible] = react.useState(open);
|
|
111
|
-
const hide = react.useCallback(() => {
|
|
112
|
-
setVisible(false);
|
|
113
|
-
}, []);
|
|
114
|
-
react.useEffect(() => {
|
|
115
|
-
if (open) {
|
|
116
|
-
setVisible(true);
|
|
117
|
-
}
|
|
118
|
-
}, [open]);
|
|
119
|
-
return [visible, hide];
|
|
120
|
-
};
|
|
121
82
|
function hasAnimationDuration(element) {
|
|
122
83
|
if (!element) {
|
|
123
84
|
return false;
|
|
124
85
|
}
|
|
125
86
|
const style = window.getComputedStyle(element);
|
|
126
|
-
return style.transitionDuration
|
|
87
|
+
return hasDuration(style.transitionDuration) || hasDuration(style.animationDuration);
|
|
88
|
+
}
|
|
89
|
+
function hasDuration(duration) {
|
|
90
|
+
return duration.split(",").map((part) => Number.parseFloat(part.trim())).some((part) => part > 0);
|
|
127
91
|
}
|
|
128
92
|
const DialogContext = react.createContext(void 0);
|
|
129
93
|
const useNestedDialog = (open) => {
|
|
@@ -149,12 +113,11 @@ const Dialog = ({
|
|
|
149
113
|
}) => {
|
|
150
114
|
const dialogClassName = styles_components_display_Divider_Divider_cjs.useComponentStyles("dialog", { dialog: true, variants: { size } });
|
|
151
115
|
const dialogRef = react.useRef(null);
|
|
152
|
-
const layer = useLayer();
|
|
153
|
-
const [visible, hide] = useVisibilityState(open);
|
|
154
116
|
const [enabled, setEnabled] = react.useState(true);
|
|
117
|
+
const [visible, setVisible] = react.useState(open);
|
|
155
118
|
useRestoreFocus(open);
|
|
156
|
-
const isNested = useNestedDialog(
|
|
157
|
-
usePreventBodyScroll(
|
|
119
|
+
const isNested = useNestedDialog(open);
|
|
120
|
+
usePreventBodyScroll(open && !isNested);
|
|
158
121
|
const onEscape = react.useCallback(
|
|
159
122
|
(event) => {
|
|
160
123
|
event.preventDefault();
|
|
@@ -166,47 +129,32 @@ const Dialog = ({
|
|
|
166
129
|
useClickOutside(dialogRef, onRequestClose, { enabled: open && enabled });
|
|
167
130
|
useIsomorphicLayoutEffect(() => {
|
|
168
131
|
var _a, _b;
|
|
169
|
-
if (
|
|
170
|
-
(_a = dialogRef.current) == null ? void 0 : _a.
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
132
|
+
if (open && visible) {
|
|
133
|
+
(_a = dialogRef.current) == null ? void 0 : _a.showModal();
|
|
134
|
+
} else if (open) {
|
|
135
|
+
setVisible(true);
|
|
136
|
+
} else {
|
|
137
|
+
if (!hasAnimationDuration(dialogRef.current)) {
|
|
138
|
+
setVisible(false);
|
|
139
|
+
}
|
|
140
|
+
(_b = dialogRef.current) == null ? void 0 : _b.close();
|
|
175
141
|
}
|
|
176
|
-
let timer = requestAnimationFrame(() => {
|
|
177
|
-
timer = requestAnimationFrame(() => {
|
|
178
|
-
var _a2, _b2;
|
|
179
|
-
(_a2 = dialogRef.current) == null ? void 0 : _a2.showModal();
|
|
180
|
-
(_b2 = dialogRef.current) == null ? void 0 : _b2.setAttribute("data-open", "");
|
|
181
|
-
});
|
|
182
|
-
});
|
|
183
|
-
return () => {
|
|
184
|
-
cancelAnimationFrame(timer);
|
|
185
|
-
};
|
|
186
142
|
}, [open, visible]);
|
|
187
143
|
const onAnimationEnd = react.useCallback(() => {
|
|
188
144
|
if (!open) {
|
|
189
|
-
|
|
190
|
-
}
|
|
191
|
-
}, [hide, open]);
|
|
192
|
-
react.useEffect(() => {
|
|
193
|
-
if (open) {
|
|
194
|
-
return;
|
|
195
|
-
}
|
|
196
|
-
if (!hasAnimationDuration(dialogRef.current)) {
|
|
197
|
-
hide();
|
|
145
|
+
setVisible(false);
|
|
198
146
|
}
|
|
199
|
-
}, [
|
|
147
|
+
}, [setVisible, open]);
|
|
200
148
|
if (!visible) {
|
|
201
149
|
return null;
|
|
202
150
|
}
|
|
203
|
-
const dataOpen = typeof window === "undefined" && open ?
|
|
204
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
151
|
+
const dataOpen = typeof window === "undefined" && open ? true : void 0;
|
|
152
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(DialogContext.Provider, { value: { setEnabled }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
205
153
|
"dialog",
|
|
206
154
|
{
|
|
207
155
|
ref: dialogRef,
|
|
208
156
|
"aria-modal": "true",
|
|
209
|
-
|
|
157
|
+
open: dataOpen,
|
|
210
158
|
className: styles_components_display_Divider_Divider_cjs.classnames(styles_components_overlay_Dialog_dialog_css_cjs.dialog, dialogClassName, className),
|
|
211
159
|
onAnimationEnd,
|
|
212
160
|
onTransitionEnd: onAnimationEnd,
|
|
@@ -216,11 +164,8 @@ const Dialog = ({
|
|
|
216
164
|
) }) });
|
|
217
165
|
};
|
|
218
166
|
exports.Dialog = Dialog;
|
|
219
|
-
exports.Portal = Portal;
|
|
220
167
|
exports.hasAnimationDuration = hasAnimationDuration;
|
|
221
168
|
exports.useClickOutside = useClickOutside;
|
|
222
169
|
exports.useIsomorphicLayoutEffect = useIsomorphicLayoutEffect;
|
|
223
170
|
exports.useKeyboard = useKeyboard;
|
|
224
|
-
exports.useLayer = useLayer;
|
|
225
171
|
exports.usePreventBodyScroll = usePreventBodyScroll;
|
|
226
|
-
exports.useVisibilityState = useVisibilityState;
|
|
@@ -1,16 +1,7 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useLayoutEffect, useRef,
|
|
3
|
-
import {
|
|
1
|
+
import { jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useLayoutEffect, useRef, createContext, useContext, useState, useCallback } from "react";
|
|
3
|
+
import { useComponentStyles, classnames } from "../../display/Divider/Divider.mjs";
|
|
4
4
|
import { dialog } from "./dialog.css.mjs";
|
|
5
|
-
import { createPortal } from "react-dom";
|
|
6
|
-
import { BlocksProvider } from "../../other/BlocksProvider/BlocksProvider.mjs";
|
|
7
|
-
const Portal = ({ children, container }) => {
|
|
8
|
-
const context = useTheme();
|
|
9
|
-
return createPortal(
|
|
10
|
-
/* @__PURE__ */ jsx(BlocksProvider, { theme: context, children }),
|
|
11
|
-
container || document.body
|
|
12
|
-
);
|
|
13
|
-
};
|
|
14
5
|
const useClickOutside = (ref, onClickOutside, { enabled = true } = {}) => {
|
|
15
6
|
useEffect(() => {
|
|
16
7
|
if (!enabled) {
|
|
@@ -21,8 +12,11 @@ const useClickOutside = (ref, onClickOutside, { enabled = true } = {}) => {
|
|
|
21
12
|
onClickOutside();
|
|
22
13
|
}
|
|
23
14
|
};
|
|
24
|
-
|
|
15
|
+
const rafId = requestAnimationFrame(() => {
|
|
16
|
+
document.addEventListener("click", listener);
|
|
17
|
+
});
|
|
25
18
|
return () => {
|
|
19
|
+
cancelAnimationFrame(rafId);
|
|
26
20
|
document.removeEventListener("click", listener);
|
|
27
21
|
};
|
|
28
22
|
}, [ref, onClickOutside, enabled]);
|
|
@@ -44,27 +38,6 @@ const useKeyboard = (key, callback, { enabled = true, type = "keydown" } = {}) =
|
|
|
44
38
|
};
|
|
45
39
|
}, [callback, enabled, key, type]);
|
|
46
40
|
};
|
|
47
|
-
const useLayer = () => {
|
|
48
|
-
const layerRef = useRef();
|
|
49
|
-
useEffect(
|
|
50
|
-
() => () => {
|
|
51
|
-
if (layerRef.current) {
|
|
52
|
-
layerRef.current.remove();
|
|
53
|
-
layerRef.current = void 0;
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
[]
|
|
57
|
-
);
|
|
58
|
-
return () => {
|
|
59
|
-
if (!layerRef.current) {
|
|
60
|
-
const div = document.createElement("div");
|
|
61
|
-
div.dataset.layer = "blocks";
|
|
62
|
-
layerRef.current = div;
|
|
63
|
-
document.body.append(layerRef.current);
|
|
64
|
-
}
|
|
65
|
-
return layerRef.current;
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
41
|
const usePreventBodyScroll = (enabled = true) => {
|
|
69
42
|
useIsomorphicLayoutEffect(() => {
|
|
70
43
|
if (!enabled) {
|
|
@@ -105,24 +78,15 @@ const useRestoreFocus = (active) => {
|
|
|
105
78
|
}
|
|
106
79
|
}, [active]);
|
|
107
80
|
};
|
|
108
|
-
const useVisibilityState = (open) => {
|
|
109
|
-
const [visible, setVisible] = useState(open);
|
|
110
|
-
const hide = useCallback(() => {
|
|
111
|
-
setVisible(false);
|
|
112
|
-
}, []);
|
|
113
|
-
useEffect(() => {
|
|
114
|
-
if (open) {
|
|
115
|
-
setVisible(true);
|
|
116
|
-
}
|
|
117
|
-
}, [open]);
|
|
118
|
-
return [visible, hide];
|
|
119
|
-
};
|
|
120
81
|
function hasAnimationDuration(element) {
|
|
121
82
|
if (!element) {
|
|
122
83
|
return false;
|
|
123
84
|
}
|
|
124
85
|
const style = window.getComputedStyle(element);
|
|
125
|
-
return style.transitionDuration
|
|
86
|
+
return hasDuration(style.transitionDuration) || hasDuration(style.animationDuration);
|
|
87
|
+
}
|
|
88
|
+
function hasDuration(duration) {
|
|
89
|
+
return duration.split(",").map((part) => Number.parseFloat(part.trim())).some((part) => part > 0);
|
|
126
90
|
}
|
|
127
91
|
const DialogContext = createContext(void 0);
|
|
128
92
|
const useNestedDialog = (open) => {
|
|
@@ -148,12 +112,11 @@ const Dialog = ({
|
|
|
148
112
|
}) => {
|
|
149
113
|
const dialogClassName = useComponentStyles("dialog", { dialog: true, variants: { size } });
|
|
150
114
|
const dialogRef = useRef(null);
|
|
151
|
-
const layer = useLayer();
|
|
152
|
-
const [visible, hide] = useVisibilityState(open);
|
|
153
115
|
const [enabled, setEnabled] = useState(true);
|
|
116
|
+
const [visible, setVisible] = useState(open);
|
|
154
117
|
useRestoreFocus(open);
|
|
155
|
-
const isNested = useNestedDialog(
|
|
156
|
-
usePreventBodyScroll(
|
|
118
|
+
const isNested = useNestedDialog(open);
|
|
119
|
+
usePreventBodyScroll(open && !isNested);
|
|
157
120
|
const onEscape = useCallback(
|
|
158
121
|
(event) => {
|
|
159
122
|
event.preventDefault();
|
|
@@ -165,47 +128,32 @@ const Dialog = ({
|
|
|
165
128
|
useClickOutside(dialogRef, onRequestClose, { enabled: open && enabled });
|
|
166
129
|
useIsomorphicLayoutEffect(() => {
|
|
167
130
|
var _a, _b;
|
|
168
|
-
if (
|
|
169
|
-
(_a = dialogRef.current) == null ? void 0 : _a.
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
131
|
+
if (open && visible) {
|
|
132
|
+
(_a = dialogRef.current) == null ? void 0 : _a.showModal();
|
|
133
|
+
} else if (open) {
|
|
134
|
+
setVisible(true);
|
|
135
|
+
} else {
|
|
136
|
+
if (!hasAnimationDuration(dialogRef.current)) {
|
|
137
|
+
setVisible(false);
|
|
138
|
+
}
|
|
139
|
+
(_b = dialogRef.current) == null ? void 0 : _b.close();
|
|
174
140
|
}
|
|
175
|
-
let timer = requestAnimationFrame(() => {
|
|
176
|
-
timer = requestAnimationFrame(() => {
|
|
177
|
-
var _a2, _b2;
|
|
178
|
-
(_a2 = dialogRef.current) == null ? void 0 : _a2.showModal();
|
|
179
|
-
(_b2 = dialogRef.current) == null ? void 0 : _b2.setAttribute("data-open", "");
|
|
180
|
-
});
|
|
181
|
-
});
|
|
182
|
-
return () => {
|
|
183
|
-
cancelAnimationFrame(timer);
|
|
184
|
-
};
|
|
185
141
|
}, [open, visible]);
|
|
186
142
|
const onAnimationEnd = useCallback(() => {
|
|
187
143
|
if (!open) {
|
|
188
|
-
|
|
189
|
-
}
|
|
190
|
-
}, [hide, open]);
|
|
191
|
-
useEffect(() => {
|
|
192
|
-
if (open) {
|
|
193
|
-
return;
|
|
194
|
-
}
|
|
195
|
-
if (!hasAnimationDuration(dialogRef.current)) {
|
|
196
|
-
hide();
|
|
144
|
+
setVisible(false);
|
|
197
145
|
}
|
|
198
|
-
}, [
|
|
146
|
+
}, [setVisible, open]);
|
|
199
147
|
if (!visible) {
|
|
200
148
|
return null;
|
|
201
149
|
}
|
|
202
|
-
const dataOpen = typeof window === "undefined" && open ?
|
|
203
|
-
return /* @__PURE__ */ jsx(
|
|
150
|
+
const dataOpen = typeof window === "undefined" && open ? true : void 0;
|
|
151
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(DialogContext.Provider, { value: { setEnabled }, children: /* @__PURE__ */ jsx(
|
|
204
152
|
"dialog",
|
|
205
153
|
{
|
|
206
154
|
ref: dialogRef,
|
|
207
155
|
"aria-modal": "true",
|
|
208
|
-
|
|
156
|
+
open: dataOpen,
|
|
209
157
|
className: classnames(dialog, dialogClassName, className),
|
|
210
158
|
onAnimationEnd,
|
|
211
159
|
onTransitionEnd: onAnimationEnd,
|
|
@@ -216,12 +164,9 @@ const Dialog = ({
|
|
|
216
164
|
};
|
|
217
165
|
export {
|
|
218
166
|
Dialog,
|
|
219
|
-
Portal,
|
|
220
167
|
hasAnimationDuration,
|
|
221
168
|
useClickOutside,
|
|
222
169
|
useIsomorphicLayoutEffect,
|
|
223
170
|
useKeyboard,
|
|
224
|
-
|
|
225
|
-
usePreventBodyScroll,
|
|
226
|
-
useVisibilityState
|
|
171
|
+
usePreventBodyScroll
|
|
227
172
|
};
|
|
@@ -20,23 +20,36 @@ const dialog = styles_lib_theme_makeComponentTheme_cjs.makeComponentTheme("dialo
|
|
|
20
20
|
backgroundColor: "rgba(0, 0, 0, 0.5)"
|
|
21
21
|
},
|
|
22
22
|
selectors: {
|
|
23
|
-
"&[
|
|
23
|
+
"&[open]": {
|
|
24
24
|
transform: "translate(0, 0)",
|
|
25
25
|
opacity: 1
|
|
26
26
|
},
|
|
27
|
-
"&[
|
|
27
|
+
"&[open]::backdrop": {
|
|
28
28
|
opacity: 1
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
// Apply the animation only if the user has not requested reduced motion
|
|
32
32
|
"@media": {
|
|
33
33
|
"(prefers-reduced-motion: no-preference)": {
|
|
34
|
+
// Ending style
|
|
34
35
|
transform: "translate(0, -120px)",
|
|
35
36
|
opacity: 0,
|
|
36
|
-
|
|
37
|
+
transitionBehavior: "allow-discrete",
|
|
38
|
+
transitionProperty: "opacity, transform, overlay, display",
|
|
39
|
+
transitionDuration: "240ms, 160ms, 240ms, 240ms",
|
|
40
|
+
// @ts-expect-error - Vanilla Extract does not support @starting-style (yet)
|
|
41
|
+
"@starting-style": {
|
|
42
|
+
transform: "translate(0, -120px)",
|
|
43
|
+
opacity: 0
|
|
44
|
+
},
|
|
37
45
|
"::backdrop": {
|
|
38
46
|
opacity: 0,
|
|
39
|
-
|
|
47
|
+
transitionBehavior: "allow-discrete",
|
|
48
|
+
transitionProperty: "opacity, overlay, display",
|
|
49
|
+
transitionDuration: "160ms, 240ms, 240ms",
|
|
50
|
+
"@starting-style": {
|
|
51
|
+
opacity: 0
|
|
52
|
+
}
|
|
40
53
|
}
|
|
41
54
|
}
|
|
42
55
|
}
|
|
@@ -19,23 +19,36 @@ const dialog = makeComponentTheme("dialog", {
|
|
|
19
19
|
backgroundColor: "rgba(0, 0, 0, 0.5)"
|
|
20
20
|
},
|
|
21
21
|
selectors: {
|
|
22
|
-
"&[
|
|
22
|
+
"&[open]": {
|
|
23
23
|
transform: "translate(0, 0)",
|
|
24
24
|
opacity: 1
|
|
25
25
|
},
|
|
26
|
-
"&[
|
|
26
|
+
"&[open]::backdrop": {
|
|
27
27
|
opacity: 1
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
// Apply the animation only if the user has not requested reduced motion
|
|
31
31
|
"@media": {
|
|
32
32
|
"(prefers-reduced-motion: no-preference)": {
|
|
33
|
+
// Ending style
|
|
33
34
|
transform: "translate(0, -120px)",
|
|
34
35
|
opacity: 0,
|
|
35
|
-
|
|
36
|
+
transitionBehavior: "allow-discrete",
|
|
37
|
+
transitionProperty: "opacity, transform, overlay, display",
|
|
38
|
+
transitionDuration: "240ms, 160ms, 240ms, 240ms",
|
|
39
|
+
// @ts-expect-error - Vanilla Extract does not support @starting-style (yet)
|
|
40
|
+
"@starting-style": {
|
|
41
|
+
transform: "translate(0, -120px)",
|
|
42
|
+
opacity: 0
|
|
43
|
+
},
|
|
36
44
|
"::backdrop": {
|
|
37
45
|
opacity: 0,
|
|
38
|
-
|
|
46
|
+
transitionBehavior: "allow-discrete",
|
|
47
|
+
transitionProperty: "opacity, overlay, display",
|
|
48
|
+
transitionDuration: "160ms, 240ms, 240ms",
|
|
49
|
+
"@starting-style": {
|
|
50
|
+
opacity: 0
|
|
51
|
+
}
|
|
39
52
|
}
|
|
40
53
|
}
|
|
41
54
|
}
|
|
@@ -19,6 +19,12 @@ const link = styles_lib_theme_makeComponentTheme_cjs.makeComponentTheme("link",
|
|
|
19
19
|
textDecoration: "underline"
|
|
20
20
|
},
|
|
21
21
|
cursor: "pointer"
|
|
22
|
+
// selectors: {
|
|
23
|
+
// '&[target="_blank"]::after': {
|
|
24
|
+
// content: '"\\2197"',
|
|
25
|
+
// marginLeft: 4,
|
|
26
|
+
// },
|
|
27
|
+
// },
|
|
22
28
|
}, styles_themes_momotaro_components_helpers_css_cjs.focusable], "link_base"),
|
|
23
29
|
variants: {
|
|
24
30
|
variant: {
|
|
@@ -18,6 +18,12 @@ const link = makeComponentTheme("link", {
|
|
|
18
18
|
textDecoration: "underline"
|
|
19
19
|
},
|
|
20
20
|
cursor: "pointer"
|
|
21
|
+
// selectors: {
|
|
22
|
+
// '&[target="_blank"]::after': {
|
|
23
|
+
// content: '"\\2197"',
|
|
24
|
+
// marginLeft: 4,
|
|
25
|
+
// },
|
|
26
|
+
// },
|
|
21
27
|
}, focusable], "link_base"),
|
|
22
28
|
variants: {
|
|
23
29
|
variant: {
|
|
@@ -11,6 +11,7 @@ const popover = styles_lib_theme_makeComponentTheme_cjs.makeComponentTheme("popo
|
|
|
11
11
|
padding: "medium",
|
|
12
12
|
margin: "small",
|
|
13
13
|
// Space between the popover and the anchor element
|
|
14
|
+
width: "max-content",
|
|
14
15
|
selectors: {
|
|
15
16
|
"&[data-open]": {
|
|
16
17
|
transform: "scale(1)",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blockle/blocks",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.1",
|
|
4
4
|
"description": "Blocks design system",
|
|
5
5
|
"repository": "git@github.com:Blockle/blocks.git",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,7 +34,6 @@
|
|
|
34
34
|
"import": "./dist/themes/momotaro.mjs",
|
|
35
35
|
"require": "./dist/themes/momotaro.cjs"
|
|
36
36
|
},
|
|
37
|
-
"./dist/style.css": "./dist/style.css",
|
|
38
37
|
"./package.json": "./package.json"
|
|
39
38
|
},
|
|
40
39
|
"main": "./dist/index.cjs",
|
|
@@ -51,42 +50,48 @@
|
|
|
51
50
|
"coverage": "vitest run --coverage",
|
|
52
51
|
"fix": "crackle fix",
|
|
53
52
|
"lint": "eslint .",
|
|
54
|
-
"release": "
|
|
53
|
+
"release": "npm run ts && npm run test && npm run build && changeset publish",
|
|
55
54
|
"storybook": "storybook dev -p 6006 --no-open",
|
|
56
|
-
"test": "vitest",
|
|
57
|
-
"ts": "tsc --noemit --project ./tsconfig.json"
|
|
55
|
+
"test": "vitest --silent # ignore warnings till js-dom can parse new css features",
|
|
56
|
+
"ts": "tsc --noemit --project ./tsconfig.json",
|
|
57
|
+
"changeset": "changeset"
|
|
58
58
|
},
|
|
59
59
|
"resolutions": {
|
|
60
60
|
"string-width": "^4.2.2"
|
|
61
61
|
},
|
|
62
|
+
"dependencies": {
|
|
63
|
+
"npm": "^10.8.1"
|
|
64
|
+
},
|
|
62
65
|
"devDependencies": {
|
|
63
66
|
"@changesets/cli": "^2.27.5",
|
|
67
|
+
"@chromatic-com/storybook": "^1.8.0",
|
|
64
68
|
"@crackle/cli": "^0.15.4",
|
|
65
69
|
"@crackle/core": "^0.33.3",
|
|
66
|
-
"@storybook/addon-a11y": "^8.
|
|
70
|
+
"@storybook/addon-a11y": "^8.2.9",
|
|
67
71
|
"@storybook/addon-coverage": "^1.0.4",
|
|
68
|
-
"@storybook/addon-essentials": "^8.
|
|
69
|
-
"@storybook/addon-interactions": "^8.
|
|
70
|
-
"@storybook/addon-links": "^8.
|
|
71
|
-
"@storybook/blocks": "^8.
|
|
72
|
-
"@storybook/
|
|
73
|
-
"@storybook/react
|
|
74
|
-
"@storybook/
|
|
72
|
+
"@storybook/addon-essentials": "^8.2.9",
|
|
73
|
+
"@storybook/addon-interactions": "^8.2.9",
|
|
74
|
+
"@storybook/addon-links": "^8.2.9",
|
|
75
|
+
"@storybook/blocks": "^8.2.9",
|
|
76
|
+
"@storybook/preview-api": "^8.2.9",
|
|
77
|
+
"@storybook/react": "^8.2.9",
|
|
78
|
+
"@storybook/react-vite": "^8.2.9",
|
|
79
|
+
"@storybook/test": "^8.2.9",
|
|
75
80
|
"@testing-library/jest-dom": "^6.4.5",
|
|
76
81
|
"@testing-library/react": "^16.0.0",
|
|
77
|
-
"@types/eslint": "^8.56.
|
|
82
|
+
"@types/eslint": "^8.56.12",
|
|
78
83
|
"@types/react": "^18.3.3",
|
|
79
84
|
"@types/react-dom": "^18.3.0",
|
|
80
|
-
"@typescript-eslint/eslint-plugin": "^7.
|
|
81
|
-
"@typescript-eslint/parser": "^7.
|
|
85
|
+
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
86
|
+
"@typescript-eslint/parser": "^7.18.0",
|
|
82
87
|
"@vanilla-extract/css": "^1.15.2",
|
|
83
88
|
"@vanilla-extract/css-utils": "^0.1.4",
|
|
84
89
|
"@vanilla-extract/sprinkles": "^1.6.2",
|
|
85
90
|
"@vanilla-extract/vite-plugin": "^4.0.10",
|
|
86
|
-
"@vitest/coverage-v8": "^
|
|
91
|
+
"@vitest/coverage-v8": "^2.0.5",
|
|
87
92
|
"autoprefixer": "^10.4.19",
|
|
88
93
|
"cross-env": "^7.0.3",
|
|
89
|
-
"eslint": "^8",
|
|
94
|
+
"eslint": "^8.57.0",
|
|
90
95
|
"eslint-config-prettier": "^9.1.0",
|
|
91
96
|
"eslint-plugin-jest": "^28.6.0",
|
|
92
97
|
"eslint-plugin-prettier": "^5.1.3",
|
|
@@ -94,20 +99,19 @@
|
|
|
94
99
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
95
100
|
"eslint-plugin-storybook": "^0.8.0",
|
|
96
101
|
"eslint-plugin-unicorn": "^53.0.0",
|
|
97
|
-
"jsdom": "^
|
|
102
|
+
"jsdom": "^25.0.0",
|
|
98
103
|
"prettier": "^3.3.1",
|
|
99
104
|
"prop-types": "^15.8.1",
|
|
100
105
|
"react": "^18.3.1",
|
|
101
106
|
"react-dom": "^18.3.1",
|
|
102
|
-
"storybook": "^8.
|
|
107
|
+
"storybook": "^8.2.9",
|
|
103
108
|
"typescript": "^5.4.5",
|
|
104
|
-
"vitest": "^
|
|
109
|
+
"vitest": "^2.0.5"
|
|
105
110
|
},
|
|
106
111
|
"peerDependencies": {
|
|
107
112
|
"@vanilla-extract/css": "^1.14",
|
|
108
113
|
"@vanilla-extract/sprinkles": "^1.6",
|
|
109
114
|
"react": "^18",
|
|
110
115
|
"react-dom": "^18"
|
|
111
|
-
}
|
|
112
|
-
"packageManager": "yarn@1.22.19"
|
|
116
|
+
}
|
|
113
117
|
}
|