@bigtablet/design-system 3.14.1 → 3.14.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/dist/index.js +34 -12
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -121,6 +121,15 @@ function unlockBodyScroll() {
|
|
|
121
121
|
body.dataset[COUNTER] = String(remaining);
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
|
+
|
|
125
|
+
// src/utils/spring-motion.ts
|
|
126
|
+
function springEnterFrom(reduced, transform) {
|
|
127
|
+
if (reduced) return {};
|
|
128
|
+
return { from: transform === void 0 ? { opacity: 0 } : { opacity: 0, transform } };
|
|
129
|
+
}
|
|
130
|
+
var OVERLAY_PANEL_CLOSED_TRANSFORM = "scale(0.96) translateY(-4px)";
|
|
131
|
+
var OVERLAY_PANEL_OPEN_TRANSFORM = "scale(1) translateY(0px)";
|
|
132
|
+
var OVERLAY_SPRING_CONFIG = { tension: 280, friction: 28, clamp: true };
|
|
124
133
|
var useSafeLayoutEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect;
|
|
125
134
|
|
|
126
135
|
// src/utils/use-anchored-position.ts
|
|
@@ -368,7 +377,10 @@ function useSpringPresence({
|
|
|
368
377
|
}) {
|
|
369
378
|
const reduced = useReducedMotion();
|
|
370
379
|
return useSpring({
|
|
371
|
-
from
|
|
380
|
+
// reduced-motion 에서는 `from` 을 생략한다 - 주면 첫 프레임에 from 이 DOM 에 커밋된 뒤
|
|
381
|
+
// immediate 가 목표값으로 점프해 모션 대신 한 프레임 깜빡임이 남는다. Toast 는 항상
|
|
382
|
+
// visible=true 로 마운트하므로 이 경로를 무조건 탄다. 자세한 근거는 springEnterFrom JSDoc.
|
|
383
|
+
...springEnterFrom(reduced, from),
|
|
372
384
|
to: {
|
|
373
385
|
opacity: visible ? 1 : 0,
|
|
374
386
|
transform: visible ? "translateY(0px)" : from
|
|
@@ -2815,18 +2827,22 @@ var AlertModal = ({
|
|
|
2815
2827
|
if (isOpen && !shouldRender) setShouldRender(true);
|
|
2816
2828
|
const reduced = useReducedMotion();
|
|
2817
2829
|
const overlayStyle = useSpring({
|
|
2818
|
-
|
|
2830
|
+
...springEnterFrom(reduced),
|
|
2831
|
+
to: { opacity: isOpen ? 1 : 0 },
|
|
2819
2832
|
immediate: reduced,
|
|
2820
|
-
config:
|
|
2833
|
+
config: OVERLAY_SPRING_CONFIG,
|
|
2821
2834
|
onRest: (result) => {
|
|
2822
2835
|
if (!isOpen && result.finished) setShouldRender(false);
|
|
2823
2836
|
}
|
|
2824
2837
|
});
|
|
2825
2838
|
const panelStyle = useSpring({
|
|
2826
|
-
|
|
2827
|
-
|
|
2839
|
+
...springEnterFrom(reduced, OVERLAY_PANEL_CLOSED_TRANSFORM),
|
|
2840
|
+
to: {
|
|
2841
|
+
opacity: isOpen ? 1 : 0,
|
|
2842
|
+
transform: isOpen ? OVERLAY_PANEL_OPEN_TRANSFORM : OVERLAY_PANEL_CLOSED_TRANSFORM
|
|
2843
|
+
},
|
|
2828
2844
|
immediate: reduced,
|
|
2829
|
-
config:
|
|
2845
|
+
config: OVERLAY_SPRING_CONFIG
|
|
2830
2846
|
});
|
|
2831
2847
|
React16.useEffect(() => {
|
|
2832
2848
|
if (!shouldRender) return;
|
|
@@ -2838,7 +2854,6 @@ var AlertModal = ({
|
|
|
2838
2854
|
const cancelVariant = "outline";
|
|
2839
2855
|
const modalClassName = cn("alert_modal", `alert_variant_${variant}`);
|
|
2840
2856
|
return createPortal(
|
|
2841
|
-
// biome-ignore lint/a11y/noStaticElementInteractions: modal overlay pattern
|
|
2842
2857
|
/* @__PURE__ */ jsx(
|
|
2843
2858
|
animated.div,
|
|
2844
2859
|
{
|
|
@@ -4921,9 +4936,10 @@ var Modal = ({
|
|
|
4921
4936
|
if (open && !shouldRender) setShouldRender(true);
|
|
4922
4937
|
const reduced = useReducedMotion();
|
|
4923
4938
|
const overlayStyle = useSpring({
|
|
4924
|
-
|
|
4939
|
+
...springEnterFrom(reduced),
|
|
4940
|
+
to: { opacity: open ? 1 : 0 },
|
|
4925
4941
|
immediate: reduced,
|
|
4926
|
-
config:
|
|
4942
|
+
config: OVERLAY_SPRING_CONFIG,
|
|
4927
4943
|
onRest: (result) => {
|
|
4928
4944
|
if (open || !result.finished) return;
|
|
4929
4945
|
setShouldRender(false);
|
|
@@ -4931,10 +4947,13 @@ var Modal = ({
|
|
|
4931
4947
|
}
|
|
4932
4948
|
});
|
|
4933
4949
|
const panelStyle = useSpring({
|
|
4934
|
-
|
|
4935
|
-
|
|
4950
|
+
...springEnterFrom(reduced, OVERLAY_PANEL_CLOSED_TRANSFORM),
|
|
4951
|
+
to: {
|
|
4952
|
+
opacity: open ? 1 : 0,
|
|
4953
|
+
transform: open ? OVERLAY_PANEL_OPEN_TRANSFORM : OVERLAY_PANEL_CLOSED_TRANSFORM
|
|
4954
|
+
},
|
|
4936
4955
|
immediate: reduced,
|
|
4937
|
-
config:
|
|
4956
|
+
config: OVERLAY_SPRING_CONFIG
|
|
4938
4957
|
});
|
|
4939
4958
|
React16.useEffect(() => {
|
|
4940
4959
|
if (!open) return;
|
|
@@ -4983,6 +5002,9 @@ var Modal = ({
|
|
|
4983
5002
|
// 늘어나는 정도의 비용이다.
|
|
4984
5003
|
// 다만 초기 포커스 대상에서는 제외한다 - 안쪽에 첫 입력이 있는데 빈 wrapper 에
|
|
4985
5004
|
// 포커스가 놓이면 열자마자 어디에 있는지 알 수 없다.
|
|
5005
|
+
// 스크롤 가능한 영역은 키보드로도 스크롤할 수 있어야 한다 (WCAG 2.1.1) - 포커스
|
|
5006
|
+
// 가능해야 화살표 키가 먹는다.
|
|
5007
|
+
// biome-ignore lint/a11y/noNoninteractiveTabindex: scrollable region needs keyboard scroll
|
|
4986
5008
|
/* @__PURE__ */ jsx("div", { className: "modal_body", tabIndex: 0, "data-focus-trap-skip-autofocus": "", children: content.children }),
|
|
4987
5009
|
content.footer && /* @__PURE__ */ jsx("div", { className: cn("modal_footer", `modal_footer_${footerAlign}`), children: content.footer })
|
|
4988
5010
|
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigtablet/design-system",
|
|
3
|
-
"version": "3.14.
|
|
3
|
+
"version": "3.14.2",
|
|
4
4
|
"description": "Bigtablet Design System UI Components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
"lint:css": "stylelint 'src/ui/**/*.scss' 'src/styles/**/*.scss' 'src/vanilla/**/*.scss'",
|
|
50
50
|
"check:css-vars": "scripts/check-css-vars.sh",
|
|
51
51
|
"check:prose": "scripts/check-prose-headings.sh",
|
|
52
|
+
"check:defaults": "python3 scripts/check-prop-defaults.py",
|
|
52
53
|
"size": "size-limit",
|
|
53
54
|
"prepare": "husky"
|
|
54
55
|
},
|