@jackcrane/ui 0.1.18 → 0.1.20
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/components/Card/card.d.ts +2 -1
- package/dist/components/jcui/provider.d.ts +2 -1
- package/dist/jcui.cjs.js +177 -60
- package/dist/jcui.es.js +177 -60
- package/package.json +1 -1
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
export default function Card({ children, variant, chamfer, size, footerHeight, footer, title, ...props }: {
|
|
1
|
+
export default function Card({ children, variant, chamfer, size, collapsed, footerHeight, footer, title, ...props }: {
|
|
2
2
|
[x: string]: any;
|
|
3
3
|
children: any;
|
|
4
4
|
variant: any;
|
|
5
5
|
chamfer?: boolean;
|
|
6
6
|
size: any;
|
|
7
|
+
collapsed: any;
|
|
7
8
|
footerHeight?: number;
|
|
8
9
|
footer: any;
|
|
9
10
|
title: any;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export function JCUIProvider({ children, theme: initialTheme, className, ...props }: {
|
|
1
|
+
export function JCUIProvider({ children, theme: initialTheme, modalMobileBreakpoint, className, ...props }: {
|
|
2
2
|
[x: string]: any;
|
|
3
3
|
children: any;
|
|
4
4
|
theme?: string;
|
|
5
|
+
modalMobileBreakpoint?: number;
|
|
5
6
|
className: any;
|
|
6
7
|
}): import("react/jsx-runtime").JSX.Element;
|
package/dist/jcui.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document!="undefined"){var
|
|
1
|
+
(function(){"use strict";try{if(typeof document!="undefined"){var n=document.createElement("style");n.appendChild(document.createTextNode(`@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap");@property --button-bg {
|
|
2
2
|
syntax: "<color>";
|
|
3
3
|
inherits: true;
|
|
4
4
|
initial-value: transparent;
|
|
@@ -217,7 +217,7 @@ div.jcui_chamfer:not(.jcui_disabled):focus-within {
|
|
|
217
217
|
transform: rotate(360deg);
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
|
-
.
|
|
220
|
+
._card_1db6q_1 {
|
|
221
221
|
border-width: var(--border-thickness);
|
|
222
222
|
border-style: solid;
|
|
223
223
|
font-size: 1rem;
|
|
@@ -226,70 +226,110 @@ div.jcui_chamfer:not(.jcui_disabled):focus-within {
|
|
|
226
226
|
display: flex;
|
|
227
227
|
flex-direction: column;
|
|
228
228
|
}
|
|
229
|
-
.
|
|
229
|
+
._pageBackground_1db6q_11 {
|
|
230
230
|
--card-bg: var(--body-bg);
|
|
231
231
|
--button-bg: var(--body-bg);
|
|
232
232
|
--card-color: var(--body-color);
|
|
233
233
|
background-color: var(--body-bg);
|
|
234
234
|
}
|
|
235
|
-
.
|
|
235
|
+
._card_1db6q_1 ._title_1db6q_18 {
|
|
236
236
|
font-size: 1.25rem;
|
|
237
237
|
padding: 0.5rem 1rem;
|
|
238
238
|
border-bottom: var(--border-thickness) solid var(--border-color);
|
|
239
239
|
background-color: var(--card-bg);
|
|
240
240
|
}
|
|
241
|
-
.
|
|
241
|
+
._card_1db6q_1 ._titleCollapsed_1db6q_25 {
|
|
242
|
+
border-bottom: 0;
|
|
243
|
+
}
|
|
244
|
+
._card_1db6q_1 ._titleContent_1db6q_29 {
|
|
245
|
+
display: flex;
|
|
246
|
+
align-items: center;
|
|
247
|
+
gap: 0.5rem;
|
|
248
|
+
}
|
|
249
|
+
._card_1db6q_1 ._chevron_1db6q_35 {
|
|
250
|
+
margin-left: auto;
|
|
251
|
+
width: 0.5rem;
|
|
252
|
+
height: 0.5rem;
|
|
253
|
+
border-right: 2px solid currentColor;
|
|
254
|
+
border-bottom: 2px solid currentColor;
|
|
255
|
+
transition: transform 0.2s ease;
|
|
256
|
+
flex-shrink: 0;
|
|
257
|
+
}
|
|
258
|
+
._card_1db6q_1 ._chevronExpanded_1db6q_45 {
|
|
259
|
+
transform: rotate(45deg);
|
|
260
|
+
}
|
|
261
|
+
._card_1db6q_1 ._chevronCollapsed_1db6q_49 {
|
|
262
|
+
transform: rotate(-45deg);
|
|
263
|
+
}
|
|
264
|
+
._card_1db6q_1 ._content_1db6q_53 {
|
|
265
|
+
display: grid;
|
|
266
|
+
grid-template-rows: 1fr;
|
|
267
|
+
transition:
|
|
268
|
+
grid-template-rows 0.2s ease,
|
|
269
|
+
opacity 0.2s ease;
|
|
270
|
+
}
|
|
271
|
+
._card_1db6q_1 ._contentInner_1db6q_61 {
|
|
272
|
+
overflow: hidden;
|
|
273
|
+
min-height: 0;
|
|
274
|
+
display: flex;
|
|
275
|
+
flex-direction: column;
|
|
276
|
+
}
|
|
277
|
+
._card_1db6q_1 ._contentCollapsed_1db6q_68 {
|
|
278
|
+
grid-template-rows: 0fr;
|
|
279
|
+
opacity: 0;
|
|
280
|
+
}
|
|
281
|
+
._card_1db6q_1 ._body_1db6q_73 {
|
|
242
282
|
padding: 0.5rem 1rem;
|
|
243
283
|
width: 100%;
|
|
244
284
|
}
|
|
245
|
-
.
|
|
285
|
+
._card_1db6q_1 ._footer_1db6q_78 {
|
|
246
286
|
border-top: var(--border-thickness) solid var(--border-color);
|
|
247
287
|
flex: 1;
|
|
248
288
|
background-color: var(--card-bg);
|
|
249
289
|
padding: 0.5rem 1rem;
|
|
250
290
|
}
|
|
251
|
-
.
|
|
252
|
-
.
|
|
291
|
+
._large_1db6q_85 ._body_1db6q_73,
|
|
292
|
+
._large_1db6q_85 ._title_1db6q_18 {
|
|
253
293
|
font-size: 1.25rem;
|
|
254
294
|
padding: 0.75rem 1.25rem;
|
|
255
295
|
}
|
|
256
|
-
.
|
|
257
|
-
.
|
|
296
|
+
._small_1db6q_91 ._body_1db6q_73,
|
|
297
|
+
._small_1db6q_91 ._title_1db6q_18 {
|
|
258
298
|
font-size: 0.75rem;
|
|
259
299
|
padding: 0.25rem 0.5rem;
|
|
260
300
|
}
|
|
261
301
|
/* Variants */
|
|
262
|
-
.
|
|
302
|
+
._primary_1db6q_99 {
|
|
263
303
|
--card-bg: var(--primary-color-100);
|
|
264
304
|
--border-color: var(--primary-color-300);
|
|
265
305
|
--border-accent-color: var(--primary-color-600);
|
|
266
306
|
--card-color: var(--primary-color-800);
|
|
267
307
|
}
|
|
268
|
-
.
|
|
308
|
+
._success_1db6q_106 {
|
|
269
309
|
--card-bg: var(--success-color-100);
|
|
270
310
|
--border-color: var(--success-color-300);
|
|
271
311
|
--border-accent-color: var(--success-color-600);
|
|
272
312
|
--card-color: var(--success-color-800);
|
|
273
313
|
}
|
|
274
|
-
.
|
|
314
|
+
._warning_1db6q_113 {
|
|
275
315
|
--card-bg: var(--warning-color-100);
|
|
276
316
|
--border-color: var(--warning-color-300);
|
|
277
317
|
--border-accent-color: var(--warning-color-600);
|
|
278
318
|
--card-color: var(--warning-color-800);
|
|
279
319
|
}
|
|
280
|
-
.
|
|
320
|
+
._danger_1db6q_120 {
|
|
281
321
|
--card-bg: var(--danger-color-100);
|
|
282
322
|
--border-color: var(--danger-color-300);
|
|
283
323
|
--border-accent-color: var(--danger-color-600);
|
|
284
324
|
--card-color: var(--danger-color-800);
|
|
285
325
|
}
|
|
286
|
-
.
|
|
326
|
+
._info_1db6q_127 {
|
|
287
327
|
--card-bg: var(--info-color-100);
|
|
288
328
|
--border-color: var(--info-color-300);
|
|
289
329
|
--border-accent-color: var(--info-color-600);
|
|
290
330
|
--card-color: var(--info-color-800);
|
|
291
331
|
}
|
|
292
|
-
.
|
|
332
|
+
._secondary_1db6q_134 {
|
|
293
333
|
--card-bg: var(--secondary-color-100);
|
|
294
334
|
--border-color: var(--secondary-color-300);
|
|
295
335
|
--border-accent-color: var(--secondary-color-600);
|
|
@@ -1592,7 +1632,7 @@ div.jcui_chamfer:not(.jcui_disabled):focus-within {
|
|
|
1592
1632
|
--button-color: var(--body-color);
|
|
1593
1633
|
}
|
|
1594
1634
|
/* modal.module.css */
|
|
1595
|
-
@keyframes
|
|
1635
|
+
@keyframes _overlayIn_1fxeg_1 {
|
|
1596
1636
|
from {
|
|
1597
1637
|
opacity: 0;
|
|
1598
1638
|
}
|
|
@@ -1600,7 +1640,7 @@ div.jcui_chamfer:not(.jcui_disabled):focus-within {
|
|
|
1600
1640
|
opacity: 1;
|
|
1601
1641
|
}
|
|
1602
1642
|
}
|
|
1603
|
-
@keyframes
|
|
1643
|
+
@keyframes _overlayOut_1fxeg_1 {
|
|
1604
1644
|
from {
|
|
1605
1645
|
opacity: 1;
|
|
1606
1646
|
}
|
|
@@ -1608,7 +1648,7 @@ div.jcui_chamfer:not(.jcui_disabled):focus-within {
|
|
|
1608
1648
|
opacity: 0;
|
|
1609
1649
|
}
|
|
1610
1650
|
}
|
|
1611
|
-
@keyframes
|
|
1651
|
+
@keyframes _panelIn_1fxeg_1 {
|
|
1612
1652
|
from {
|
|
1613
1653
|
opacity: 0;
|
|
1614
1654
|
transform: translateX(400px);
|
|
@@ -1618,7 +1658,7 @@ div.jcui_chamfer:not(.jcui_disabled):focus-within {
|
|
|
1618
1658
|
transform: translateX(0);
|
|
1619
1659
|
}
|
|
1620
1660
|
}
|
|
1621
|
-
@keyframes
|
|
1661
|
+
@keyframes _panelOut_1fxeg_1 {
|
|
1622
1662
|
from {
|
|
1623
1663
|
opacity: 1;
|
|
1624
1664
|
transform: translateX(0);
|
|
@@ -1628,23 +1668,23 @@ div.jcui_chamfer:not(.jcui_disabled):focus-within {
|
|
|
1628
1668
|
transform: translateX(100%);
|
|
1629
1669
|
}
|
|
1630
1670
|
}
|
|
1631
|
-
.
|
|
1671
|
+
._overlay_1fxeg_43 {
|
|
1632
1672
|
position: fixed;
|
|
1633
1673
|
inset: 0;
|
|
1634
1674
|
z-index: 98;
|
|
1635
1675
|
}
|
|
1636
|
-
.
|
|
1676
|
+
._overlayBackdrop_1fxeg_49 {
|
|
1637
1677
|
position: absolute;
|
|
1638
1678
|
inset: 0;
|
|
1639
1679
|
background: color-mix(in srgb, var(--body-bg) 50%, transparent);
|
|
1640
1680
|
}
|
|
1641
|
-
.
|
|
1642
|
-
animation:
|
|
1681
|
+
._overlay_1fxeg_43[data-state="open"] {
|
|
1682
|
+
animation: _overlayIn_1fxeg_1 160ms ease-out;
|
|
1643
1683
|
}
|
|
1644
|
-
.
|
|
1645
|
-
animation:
|
|
1684
|
+
._overlay_1fxeg_43[data-state="closed"] {
|
|
1685
|
+
animation: _overlayOut_1fxeg_1 120ms ease-in;
|
|
1646
1686
|
}
|
|
1647
|
-
.
|
|
1687
|
+
._content_1fxeg_63 {
|
|
1648
1688
|
position: fixed;
|
|
1649
1689
|
top: 10px;
|
|
1650
1690
|
right: 10px;
|
|
@@ -1657,22 +1697,29 @@ div.jcui_chamfer:not(.jcui_disabled):focus-within {
|
|
|
1657
1697
|
display: flex;
|
|
1658
1698
|
flex-direction: column;
|
|
1659
1699
|
}
|
|
1660
|
-
.
|
|
1661
|
-
animation:
|
|
1700
|
+
._content_1fxeg_63[data-state="open"] {
|
|
1701
|
+
animation: _panelIn_1fxeg_1 180ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
1702
|
+
}
|
|
1703
|
+
._content_1fxeg_63[data-state="closed"] {
|
|
1704
|
+
animation: _panelOut_1fxeg_1 140ms ease-in;
|
|
1662
1705
|
}
|
|
1663
|
-
.
|
|
1664
|
-
|
|
1706
|
+
body.jcui-modal-mobile ._content_1fxeg_63 {
|
|
1707
|
+
top: 0;
|
|
1708
|
+
right: 0;
|
|
1709
|
+
bottom: 0;
|
|
1710
|
+
left: 0;
|
|
1711
|
+
min-width: 0;
|
|
1665
1712
|
}
|
|
1666
|
-
.
|
|
1713
|
+
._title_1fxeg_96 {
|
|
1667
1714
|
margin: 0;
|
|
1668
1715
|
}
|
|
1669
|
-
.
|
|
1716
|
+
._body_1fxeg_100 {
|
|
1670
1717
|
flex: 1;
|
|
1671
1718
|
min-height: 0;
|
|
1672
1719
|
overflow-y: auto;
|
|
1673
1720
|
padding-top: 1rem;
|
|
1674
1721
|
}
|
|
1675
|
-
.
|
|
1722
|
+
._footer_1fxeg_107 {
|
|
1676
1723
|
margin: -12px;
|
|
1677
1724
|
margin-top: 0px;
|
|
1678
1725
|
padding: 12px;
|
|
@@ -2093,7 +2140,7 @@ hr {
|
|
|
2093
2140
|
padding-left: 0.5rem;
|
|
2094
2141
|
padding-right: 0.5rem;
|
|
2095
2142
|
width: 100%;
|
|
2096
|
-
}`)),document.head.appendChild(
|
|
2143
|
+
}`)),document.head.appendChild(n)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
|
|
2097
2144
|
"use strict";
|
|
2098
2145
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2099
2146
|
const React = require("react");
|
|
@@ -2608,23 +2655,39 @@ function requireClassnames() {
|
|
|
2608
2655
|
}
|
|
2609
2656
|
var classnamesExports = requireClassnames();
|
|
2610
2657
|
const classNames = /* @__PURE__ */ getDefaultExportFromCjs(classnamesExports);
|
|
2611
|
-
const card = "
|
|
2612
|
-
const pageBackground$3 = "
|
|
2613
|
-
const title$1 = "
|
|
2614
|
-
const
|
|
2615
|
-
const
|
|
2616
|
-
const
|
|
2617
|
-
const
|
|
2618
|
-
const
|
|
2619
|
-
const
|
|
2620
|
-
const
|
|
2621
|
-
const
|
|
2622
|
-
const
|
|
2623
|
-
const
|
|
2658
|
+
const card = "_card_1db6q_1";
|
|
2659
|
+
const pageBackground$3 = "_pageBackground_1db6q_11";
|
|
2660
|
+
const title$1 = "_title_1db6q_18";
|
|
2661
|
+
const titleCollapsed = "_titleCollapsed_1db6q_25";
|
|
2662
|
+
const titleContent = "_titleContent_1db6q_29";
|
|
2663
|
+
const chevron = "_chevron_1db6q_35";
|
|
2664
|
+
const chevronExpanded = "_chevronExpanded_1db6q_45";
|
|
2665
|
+
const chevronCollapsed = "_chevronCollapsed_1db6q_49";
|
|
2666
|
+
const content$4 = "_content_1db6q_53";
|
|
2667
|
+
const contentInner = "_contentInner_1db6q_61";
|
|
2668
|
+
const contentCollapsed = "_contentCollapsed_1db6q_68";
|
|
2669
|
+
const body$1 = "_body_1db6q_73";
|
|
2670
|
+
const footer$1 = "_footer_1db6q_78";
|
|
2671
|
+
const large$7 = "_large_1db6q_85";
|
|
2672
|
+
const small$7 = "_small_1db6q_91";
|
|
2673
|
+
const primary$9 = "_primary_1db6q_99";
|
|
2674
|
+
const success$9 = "_success_1db6q_106";
|
|
2675
|
+
const warning$9 = "_warning_1db6q_113";
|
|
2676
|
+
const danger$9 = "_danger_1db6q_120";
|
|
2677
|
+
const info$9 = "_info_1db6q_127";
|
|
2678
|
+
const secondary$9 = "_secondary_1db6q_134";
|
|
2624
2679
|
const styles$b = {
|
|
2625
2680
|
card,
|
|
2626
2681
|
pageBackground: pageBackground$3,
|
|
2627
2682
|
title: title$1,
|
|
2683
|
+
titleCollapsed,
|
|
2684
|
+
titleContent,
|
|
2685
|
+
chevron,
|
|
2686
|
+
chevronExpanded,
|
|
2687
|
+
chevronCollapsed,
|
|
2688
|
+
content: content$4,
|
|
2689
|
+
contentInner,
|
|
2690
|
+
contentCollapsed,
|
|
2628
2691
|
body: body$1,
|
|
2629
2692
|
footer: footer$1,
|
|
2630
2693
|
large: large$7,
|
|
@@ -2641,12 +2704,15 @@ function Card({
|
|
|
2641
2704
|
variant,
|
|
2642
2705
|
chamfer: chamfer2 = true,
|
|
2643
2706
|
size: size2,
|
|
2707
|
+
collapsed,
|
|
2644
2708
|
footerHeight = 0,
|
|
2645
2709
|
footer: footer2,
|
|
2646
2710
|
// I hardly know her
|
|
2647
2711
|
title: title2,
|
|
2648
2712
|
...props
|
|
2649
2713
|
}) {
|
|
2714
|
+
const isCollapsible = collapsed !== void 0;
|
|
2715
|
+
const isCollapsed2 = Boolean(collapsed);
|
|
2650
2716
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
2651
2717
|
"div",
|
|
2652
2718
|
{
|
|
@@ -2660,14 +2726,44 @@ function Card({
|
|
|
2660
2726
|
),
|
|
2661
2727
|
...props,
|
|
2662
2728
|
children: [
|
|
2663
|
-
title2 && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2664
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$b.body, children: children2 }),
|
|
2665
|
-
footerHeight > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2729
|
+
(title2 || isCollapsible) && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2666
2730
|
"div",
|
|
2667
2731
|
{
|
|
2668
|
-
className: classNames(
|
|
2669
|
-
|
|
2670
|
-
|
|
2732
|
+
className: classNames(
|
|
2733
|
+
styles$b.title,
|
|
2734
|
+
hatchStyles.hatch,
|
|
2735
|
+
isCollapsed2 && styles$b.titleCollapsed
|
|
2736
|
+
),
|
|
2737
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$b.titleContent, children: [
|
|
2738
|
+
title2,
|
|
2739
|
+
isCollapsible && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2740
|
+
"span",
|
|
2741
|
+
{
|
|
2742
|
+
"aria-hidden": "true",
|
|
2743
|
+
className: classNames(
|
|
2744
|
+
styles$b.chevron,
|
|
2745
|
+
isCollapsed2 ? styles$b.chevronCollapsed : styles$b.chevronExpanded
|
|
2746
|
+
)
|
|
2747
|
+
}
|
|
2748
|
+
)
|
|
2749
|
+
] })
|
|
2750
|
+
}
|
|
2751
|
+
),
|
|
2752
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2753
|
+
"div",
|
|
2754
|
+
{
|
|
2755
|
+
className: classNames(styles$b.content, isCollapsed2 && styles$b.contentCollapsed),
|
|
2756
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$b.contentInner, children: [
|
|
2757
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$b.body, children: children2 }),
|
|
2758
|
+
footerHeight > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2759
|
+
"div",
|
|
2760
|
+
{
|
|
2761
|
+
className: classNames(hatchStyles.hatch, styles$b.footer),
|
|
2762
|
+
style: { flexBasis: footerHeight },
|
|
2763
|
+
children: footer2
|
|
2764
|
+
}
|
|
2765
|
+
)
|
|
2766
|
+
] })
|
|
2671
2767
|
}
|
|
2672
2768
|
)
|
|
2673
2769
|
]
|
|
@@ -27814,12 +27910,12 @@ var Overlay = DialogOverlay;
|
|
|
27814
27910
|
var Content = DialogContent;
|
|
27815
27911
|
var Title = DialogTitle;
|
|
27816
27912
|
var Close = DialogClose;
|
|
27817
|
-
const overlay = "
|
|
27818
|
-
const overlayBackdrop = "
|
|
27819
|
-
const content$1 = "
|
|
27820
|
-
const title = "
|
|
27821
|
-
const body = "
|
|
27822
|
-
const footer = "
|
|
27913
|
+
const overlay = "_overlay_1fxeg_43";
|
|
27914
|
+
const overlayBackdrop = "_overlayBackdrop_1fxeg_49";
|
|
27915
|
+
const content$1 = "_content_1fxeg_63";
|
|
27916
|
+
const title = "_title_1fxeg_96";
|
|
27917
|
+
const body = "_body_1fxeg_100";
|
|
27918
|
+
const footer = "_footer_1fxeg_107";
|
|
27823
27919
|
const styles$1 = {
|
|
27824
27920
|
overlay,
|
|
27825
27921
|
overlayBackdrop,
|
|
@@ -27907,6 +28003,7 @@ const global = {
|
|
|
27907
28003
|
const JCUIProvider = ({
|
|
27908
28004
|
children: children2,
|
|
27909
28005
|
theme: initialTheme = DEFAULT_THEME,
|
|
28006
|
+
modalMobileBreakpoint = 600,
|
|
27910
28007
|
className,
|
|
27911
28008
|
...props
|
|
27912
28009
|
}) => {
|
|
@@ -27926,6 +28023,26 @@ const JCUIProvider = ({
|
|
|
27926
28023
|
body2.classList.remove(themeClass, globalClass);
|
|
27927
28024
|
};
|
|
27928
28025
|
}, [themeClass, globalClass]);
|
|
28026
|
+
React.useEffect(() => {
|
|
28027
|
+
if (typeof document === "undefined" || typeof window === "undefined") {
|
|
28028
|
+
return void 0;
|
|
28029
|
+
}
|
|
28030
|
+
const body2 = document.body;
|
|
28031
|
+
const parsedBreakpoint = Number(modalMobileBreakpoint);
|
|
28032
|
+
const breakpoint = Number.isFinite(parsedBreakpoint) && parsedBreakpoint > 0 ? parsedBreakpoint : 600;
|
|
28033
|
+
const updateModalMobileState = () => {
|
|
28034
|
+
const isMobile = window.innerWidth <= breakpoint;
|
|
28035
|
+
body2.classList.toggle("jcui-modal-mobile", isMobile);
|
|
28036
|
+
body2.style.setProperty("--jcui-modal-mobile-breakpoint", `${breakpoint}px`);
|
|
28037
|
+
};
|
|
28038
|
+
updateModalMobileState();
|
|
28039
|
+
window.addEventListener("resize", updateModalMobileState);
|
|
28040
|
+
return () => {
|
|
28041
|
+
window.removeEventListener("resize", updateModalMobileState);
|
|
28042
|
+
body2.classList.remove("jcui-modal-mobile");
|
|
28043
|
+
body2.style.removeProperty("--jcui-modal-mobile-breakpoint");
|
|
28044
|
+
};
|
|
28045
|
+
}, [modalMobileBreakpoint]);
|
|
27929
28046
|
const contextValue = React.useMemo(() => ({ theme, setTheme }), [theme]);
|
|
27930
28047
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(ThemeContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
27931
28048
|
"div",
|
package/dist/jcui.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document!="undefined"){var
|
|
1
|
+
(function(){"use strict";try{if(typeof document!="undefined"){var n=document.createElement("style");n.appendChild(document.createTextNode(`@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap");@property --button-bg {
|
|
2
2
|
syntax: "<color>";
|
|
3
3
|
inherits: true;
|
|
4
4
|
initial-value: transparent;
|
|
@@ -217,7 +217,7 @@ div.jcui_chamfer:not(.jcui_disabled):focus-within {
|
|
|
217
217
|
transform: rotate(360deg);
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
|
-
.
|
|
220
|
+
._card_1db6q_1 {
|
|
221
221
|
border-width: var(--border-thickness);
|
|
222
222
|
border-style: solid;
|
|
223
223
|
font-size: 1rem;
|
|
@@ -226,70 +226,110 @@ div.jcui_chamfer:not(.jcui_disabled):focus-within {
|
|
|
226
226
|
display: flex;
|
|
227
227
|
flex-direction: column;
|
|
228
228
|
}
|
|
229
|
-
.
|
|
229
|
+
._pageBackground_1db6q_11 {
|
|
230
230
|
--card-bg: var(--body-bg);
|
|
231
231
|
--button-bg: var(--body-bg);
|
|
232
232
|
--card-color: var(--body-color);
|
|
233
233
|
background-color: var(--body-bg);
|
|
234
234
|
}
|
|
235
|
-
.
|
|
235
|
+
._card_1db6q_1 ._title_1db6q_18 {
|
|
236
236
|
font-size: 1.25rem;
|
|
237
237
|
padding: 0.5rem 1rem;
|
|
238
238
|
border-bottom: var(--border-thickness) solid var(--border-color);
|
|
239
239
|
background-color: var(--card-bg);
|
|
240
240
|
}
|
|
241
|
-
.
|
|
241
|
+
._card_1db6q_1 ._titleCollapsed_1db6q_25 {
|
|
242
|
+
border-bottom: 0;
|
|
243
|
+
}
|
|
244
|
+
._card_1db6q_1 ._titleContent_1db6q_29 {
|
|
245
|
+
display: flex;
|
|
246
|
+
align-items: center;
|
|
247
|
+
gap: 0.5rem;
|
|
248
|
+
}
|
|
249
|
+
._card_1db6q_1 ._chevron_1db6q_35 {
|
|
250
|
+
margin-left: auto;
|
|
251
|
+
width: 0.5rem;
|
|
252
|
+
height: 0.5rem;
|
|
253
|
+
border-right: 2px solid currentColor;
|
|
254
|
+
border-bottom: 2px solid currentColor;
|
|
255
|
+
transition: transform 0.2s ease;
|
|
256
|
+
flex-shrink: 0;
|
|
257
|
+
}
|
|
258
|
+
._card_1db6q_1 ._chevronExpanded_1db6q_45 {
|
|
259
|
+
transform: rotate(45deg);
|
|
260
|
+
}
|
|
261
|
+
._card_1db6q_1 ._chevronCollapsed_1db6q_49 {
|
|
262
|
+
transform: rotate(-45deg);
|
|
263
|
+
}
|
|
264
|
+
._card_1db6q_1 ._content_1db6q_53 {
|
|
265
|
+
display: grid;
|
|
266
|
+
grid-template-rows: 1fr;
|
|
267
|
+
transition:
|
|
268
|
+
grid-template-rows 0.2s ease,
|
|
269
|
+
opacity 0.2s ease;
|
|
270
|
+
}
|
|
271
|
+
._card_1db6q_1 ._contentInner_1db6q_61 {
|
|
272
|
+
overflow: hidden;
|
|
273
|
+
min-height: 0;
|
|
274
|
+
display: flex;
|
|
275
|
+
flex-direction: column;
|
|
276
|
+
}
|
|
277
|
+
._card_1db6q_1 ._contentCollapsed_1db6q_68 {
|
|
278
|
+
grid-template-rows: 0fr;
|
|
279
|
+
opacity: 0;
|
|
280
|
+
}
|
|
281
|
+
._card_1db6q_1 ._body_1db6q_73 {
|
|
242
282
|
padding: 0.5rem 1rem;
|
|
243
283
|
width: 100%;
|
|
244
284
|
}
|
|
245
|
-
.
|
|
285
|
+
._card_1db6q_1 ._footer_1db6q_78 {
|
|
246
286
|
border-top: var(--border-thickness) solid var(--border-color);
|
|
247
287
|
flex: 1;
|
|
248
288
|
background-color: var(--card-bg);
|
|
249
289
|
padding: 0.5rem 1rem;
|
|
250
290
|
}
|
|
251
|
-
.
|
|
252
|
-
.
|
|
291
|
+
._large_1db6q_85 ._body_1db6q_73,
|
|
292
|
+
._large_1db6q_85 ._title_1db6q_18 {
|
|
253
293
|
font-size: 1.25rem;
|
|
254
294
|
padding: 0.75rem 1.25rem;
|
|
255
295
|
}
|
|
256
|
-
.
|
|
257
|
-
.
|
|
296
|
+
._small_1db6q_91 ._body_1db6q_73,
|
|
297
|
+
._small_1db6q_91 ._title_1db6q_18 {
|
|
258
298
|
font-size: 0.75rem;
|
|
259
299
|
padding: 0.25rem 0.5rem;
|
|
260
300
|
}
|
|
261
301
|
/* Variants */
|
|
262
|
-
.
|
|
302
|
+
._primary_1db6q_99 {
|
|
263
303
|
--card-bg: var(--primary-color-100);
|
|
264
304
|
--border-color: var(--primary-color-300);
|
|
265
305
|
--border-accent-color: var(--primary-color-600);
|
|
266
306
|
--card-color: var(--primary-color-800);
|
|
267
307
|
}
|
|
268
|
-
.
|
|
308
|
+
._success_1db6q_106 {
|
|
269
309
|
--card-bg: var(--success-color-100);
|
|
270
310
|
--border-color: var(--success-color-300);
|
|
271
311
|
--border-accent-color: var(--success-color-600);
|
|
272
312
|
--card-color: var(--success-color-800);
|
|
273
313
|
}
|
|
274
|
-
.
|
|
314
|
+
._warning_1db6q_113 {
|
|
275
315
|
--card-bg: var(--warning-color-100);
|
|
276
316
|
--border-color: var(--warning-color-300);
|
|
277
317
|
--border-accent-color: var(--warning-color-600);
|
|
278
318
|
--card-color: var(--warning-color-800);
|
|
279
319
|
}
|
|
280
|
-
.
|
|
320
|
+
._danger_1db6q_120 {
|
|
281
321
|
--card-bg: var(--danger-color-100);
|
|
282
322
|
--border-color: var(--danger-color-300);
|
|
283
323
|
--border-accent-color: var(--danger-color-600);
|
|
284
324
|
--card-color: var(--danger-color-800);
|
|
285
325
|
}
|
|
286
|
-
.
|
|
326
|
+
._info_1db6q_127 {
|
|
287
327
|
--card-bg: var(--info-color-100);
|
|
288
328
|
--border-color: var(--info-color-300);
|
|
289
329
|
--border-accent-color: var(--info-color-600);
|
|
290
330
|
--card-color: var(--info-color-800);
|
|
291
331
|
}
|
|
292
|
-
.
|
|
332
|
+
._secondary_1db6q_134 {
|
|
293
333
|
--card-bg: var(--secondary-color-100);
|
|
294
334
|
--border-color: var(--secondary-color-300);
|
|
295
335
|
--border-accent-color: var(--secondary-color-600);
|
|
@@ -1592,7 +1632,7 @@ div.jcui_chamfer:not(.jcui_disabled):focus-within {
|
|
|
1592
1632
|
--button-color: var(--body-color);
|
|
1593
1633
|
}
|
|
1594
1634
|
/* modal.module.css */
|
|
1595
|
-
@keyframes
|
|
1635
|
+
@keyframes _overlayIn_1fxeg_1 {
|
|
1596
1636
|
from {
|
|
1597
1637
|
opacity: 0;
|
|
1598
1638
|
}
|
|
@@ -1600,7 +1640,7 @@ div.jcui_chamfer:not(.jcui_disabled):focus-within {
|
|
|
1600
1640
|
opacity: 1;
|
|
1601
1641
|
}
|
|
1602
1642
|
}
|
|
1603
|
-
@keyframes
|
|
1643
|
+
@keyframes _overlayOut_1fxeg_1 {
|
|
1604
1644
|
from {
|
|
1605
1645
|
opacity: 1;
|
|
1606
1646
|
}
|
|
@@ -1608,7 +1648,7 @@ div.jcui_chamfer:not(.jcui_disabled):focus-within {
|
|
|
1608
1648
|
opacity: 0;
|
|
1609
1649
|
}
|
|
1610
1650
|
}
|
|
1611
|
-
@keyframes
|
|
1651
|
+
@keyframes _panelIn_1fxeg_1 {
|
|
1612
1652
|
from {
|
|
1613
1653
|
opacity: 0;
|
|
1614
1654
|
transform: translateX(400px);
|
|
@@ -1618,7 +1658,7 @@ div.jcui_chamfer:not(.jcui_disabled):focus-within {
|
|
|
1618
1658
|
transform: translateX(0);
|
|
1619
1659
|
}
|
|
1620
1660
|
}
|
|
1621
|
-
@keyframes
|
|
1661
|
+
@keyframes _panelOut_1fxeg_1 {
|
|
1622
1662
|
from {
|
|
1623
1663
|
opacity: 1;
|
|
1624
1664
|
transform: translateX(0);
|
|
@@ -1628,23 +1668,23 @@ div.jcui_chamfer:not(.jcui_disabled):focus-within {
|
|
|
1628
1668
|
transform: translateX(100%);
|
|
1629
1669
|
}
|
|
1630
1670
|
}
|
|
1631
|
-
.
|
|
1671
|
+
._overlay_1fxeg_43 {
|
|
1632
1672
|
position: fixed;
|
|
1633
1673
|
inset: 0;
|
|
1634
1674
|
z-index: 98;
|
|
1635
1675
|
}
|
|
1636
|
-
.
|
|
1676
|
+
._overlayBackdrop_1fxeg_49 {
|
|
1637
1677
|
position: absolute;
|
|
1638
1678
|
inset: 0;
|
|
1639
1679
|
background: color-mix(in srgb, var(--body-bg) 50%, transparent);
|
|
1640
1680
|
}
|
|
1641
|
-
.
|
|
1642
|
-
animation:
|
|
1681
|
+
._overlay_1fxeg_43[data-state="open"] {
|
|
1682
|
+
animation: _overlayIn_1fxeg_1 160ms ease-out;
|
|
1643
1683
|
}
|
|
1644
|
-
.
|
|
1645
|
-
animation:
|
|
1684
|
+
._overlay_1fxeg_43[data-state="closed"] {
|
|
1685
|
+
animation: _overlayOut_1fxeg_1 120ms ease-in;
|
|
1646
1686
|
}
|
|
1647
|
-
.
|
|
1687
|
+
._content_1fxeg_63 {
|
|
1648
1688
|
position: fixed;
|
|
1649
1689
|
top: 10px;
|
|
1650
1690
|
right: 10px;
|
|
@@ -1657,22 +1697,29 @@ div.jcui_chamfer:not(.jcui_disabled):focus-within {
|
|
|
1657
1697
|
display: flex;
|
|
1658
1698
|
flex-direction: column;
|
|
1659
1699
|
}
|
|
1660
|
-
.
|
|
1661
|
-
animation:
|
|
1700
|
+
._content_1fxeg_63[data-state="open"] {
|
|
1701
|
+
animation: _panelIn_1fxeg_1 180ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
1702
|
+
}
|
|
1703
|
+
._content_1fxeg_63[data-state="closed"] {
|
|
1704
|
+
animation: _panelOut_1fxeg_1 140ms ease-in;
|
|
1662
1705
|
}
|
|
1663
|
-
.
|
|
1664
|
-
|
|
1706
|
+
body.jcui-modal-mobile ._content_1fxeg_63 {
|
|
1707
|
+
top: 0;
|
|
1708
|
+
right: 0;
|
|
1709
|
+
bottom: 0;
|
|
1710
|
+
left: 0;
|
|
1711
|
+
min-width: 0;
|
|
1665
1712
|
}
|
|
1666
|
-
.
|
|
1713
|
+
._title_1fxeg_96 {
|
|
1667
1714
|
margin: 0;
|
|
1668
1715
|
}
|
|
1669
|
-
.
|
|
1716
|
+
._body_1fxeg_100 {
|
|
1670
1717
|
flex: 1;
|
|
1671
1718
|
min-height: 0;
|
|
1672
1719
|
overflow-y: auto;
|
|
1673
1720
|
padding-top: 1rem;
|
|
1674
1721
|
}
|
|
1675
|
-
.
|
|
1722
|
+
._footer_1fxeg_107 {
|
|
1676
1723
|
margin: -12px;
|
|
1677
1724
|
margin-top: 0px;
|
|
1678
1725
|
padding: 12px;
|
|
@@ -2093,7 +2140,7 @@ hr {
|
|
|
2093
2140
|
padding-left: 0.5rem;
|
|
2094
2141
|
padding-right: 0.5rem;
|
|
2095
2142
|
width: 100%;
|
|
2096
|
-
}`)),document.head.appendChild(
|
|
2143
|
+
}`)),document.head.appendChild(n)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
|
|
2097
2144
|
import * as React from "react";
|
|
2098
2145
|
import React__default, { useContext, createContext as createContext$1, useId as useId$1, forwardRef, useRef, useState, useMemo, useEffect, useLayoutEffect, useCallback, createElement } from "react";
|
|
2099
2146
|
import * as ReactDOM from "react-dom";
|
|
@@ -2590,23 +2637,39 @@ function requireClassnames() {
|
|
|
2590
2637
|
}
|
|
2591
2638
|
var classnamesExports = requireClassnames();
|
|
2592
2639
|
const classNames = /* @__PURE__ */ getDefaultExportFromCjs(classnamesExports);
|
|
2593
|
-
const card = "
|
|
2594
|
-
const pageBackground$3 = "
|
|
2595
|
-
const title$1 = "
|
|
2596
|
-
const
|
|
2597
|
-
const
|
|
2598
|
-
const
|
|
2599
|
-
const
|
|
2600
|
-
const
|
|
2601
|
-
const
|
|
2602
|
-
const
|
|
2603
|
-
const
|
|
2604
|
-
const
|
|
2605
|
-
const
|
|
2640
|
+
const card = "_card_1db6q_1";
|
|
2641
|
+
const pageBackground$3 = "_pageBackground_1db6q_11";
|
|
2642
|
+
const title$1 = "_title_1db6q_18";
|
|
2643
|
+
const titleCollapsed = "_titleCollapsed_1db6q_25";
|
|
2644
|
+
const titleContent = "_titleContent_1db6q_29";
|
|
2645
|
+
const chevron = "_chevron_1db6q_35";
|
|
2646
|
+
const chevronExpanded = "_chevronExpanded_1db6q_45";
|
|
2647
|
+
const chevronCollapsed = "_chevronCollapsed_1db6q_49";
|
|
2648
|
+
const content$4 = "_content_1db6q_53";
|
|
2649
|
+
const contentInner = "_contentInner_1db6q_61";
|
|
2650
|
+
const contentCollapsed = "_contentCollapsed_1db6q_68";
|
|
2651
|
+
const body$1 = "_body_1db6q_73";
|
|
2652
|
+
const footer$1 = "_footer_1db6q_78";
|
|
2653
|
+
const large$7 = "_large_1db6q_85";
|
|
2654
|
+
const small$7 = "_small_1db6q_91";
|
|
2655
|
+
const primary$9 = "_primary_1db6q_99";
|
|
2656
|
+
const success$9 = "_success_1db6q_106";
|
|
2657
|
+
const warning$9 = "_warning_1db6q_113";
|
|
2658
|
+
const danger$9 = "_danger_1db6q_120";
|
|
2659
|
+
const info$9 = "_info_1db6q_127";
|
|
2660
|
+
const secondary$9 = "_secondary_1db6q_134";
|
|
2606
2661
|
const styles$b = {
|
|
2607
2662
|
card,
|
|
2608
2663
|
pageBackground: pageBackground$3,
|
|
2609
2664
|
title: title$1,
|
|
2665
|
+
titleCollapsed,
|
|
2666
|
+
titleContent,
|
|
2667
|
+
chevron,
|
|
2668
|
+
chevronExpanded,
|
|
2669
|
+
chevronCollapsed,
|
|
2670
|
+
content: content$4,
|
|
2671
|
+
contentInner,
|
|
2672
|
+
contentCollapsed,
|
|
2610
2673
|
body: body$1,
|
|
2611
2674
|
footer: footer$1,
|
|
2612
2675
|
large: large$7,
|
|
@@ -2623,12 +2686,15 @@ function Card({
|
|
|
2623
2686
|
variant,
|
|
2624
2687
|
chamfer: chamfer2 = true,
|
|
2625
2688
|
size: size2,
|
|
2689
|
+
collapsed,
|
|
2626
2690
|
footerHeight = 0,
|
|
2627
2691
|
footer: footer2,
|
|
2628
2692
|
// I hardly know her
|
|
2629
2693
|
title: title2,
|
|
2630
2694
|
...props
|
|
2631
2695
|
}) {
|
|
2696
|
+
const isCollapsible = collapsed !== void 0;
|
|
2697
|
+
const isCollapsed2 = Boolean(collapsed);
|
|
2632
2698
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
2633
2699
|
"div",
|
|
2634
2700
|
{
|
|
@@ -2642,14 +2708,44 @@ function Card({
|
|
|
2642
2708
|
),
|
|
2643
2709
|
...props,
|
|
2644
2710
|
children: [
|
|
2645
|
-
title2 && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2646
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$b.body, children: children2 }),
|
|
2647
|
-
footerHeight > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2711
|
+
(title2 || isCollapsible) && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2648
2712
|
"div",
|
|
2649
2713
|
{
|
|
2650
|
-
className: classNames(
|
|
2651
|
-
|
|
2652
|
-
|
|
2714
|
+
className: classNames(
|
|
2715
|
+
styles$b.title,
|
|
2716
|
+
hatchStyles.hatch,
|
|
2717
|
+
isCollapsed2 && styles$b.titleCollapsed
|
|
2718
|
+
),
|
|
2719
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$b.titleContent, children: [
|
|
2720
|
+
title2,
|
|
2721
|
+
isCollapsible && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2722
|
+
"span",
|
|
2723
|
+
{
|
|
2724
|
+
"aria-hidden": "true",
|
|
2725
|
+
className: classNames(
|
|
2726
|
+
styles$b.chevron,
|
|
2727
|
+
isCollapsed2 ? styles$b.chevronCollapsed : styles$b.chevronExpanded
|
|
2728
|
+
)
|
|
2729
|
+
}
|
|
2730
|
+
)
|
|
2731
|
+
] })
|
|
2732
|
+
}
|
|
2733
|
+
),
|
|
2734
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2735
|
+
"div",
|
|
2736
|
+
{
|
|
2737
|
+
className: classNames(styles$b.content, isCollapsed2 && styles$b.contentCollapsed),
|
|
2738
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$b.contentInner, children: [
|
|
2739
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$b.body, children: children2 }),
|
|
2740
|
+
footerHeight > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2741
|
+
"div",
|
|
2742
|
+
{
|
|
2743
|
+
className: classNames(hatchStyles.hatch, styles$b.footer),
|
|
2744
|
+
style: { flexBasis: footerHeight },
|
|
2745
|
+
children: footer2
|
|
2746
|
+
}
|
|
2747
|
+
)
|
|
2748
|
+
] })
|
|
2653
2749
|
}
|
|
2654
2750
|
)
|
|
2655
2751
|
]
|
|
@@ -27796,12 +27892,12 @@ var Overlay = DialogOverlay;
|
|
|
27796
27892
|
var Content = DialogContent;
|
|
27797
27893
|
var Title = DialogTitle;
|
|
27798
27894
|
var Close = DialogClose;
|
|
27799
|
-
const overlay = "
|
|
27800
|
-
const overlayBackdrop = "
|
|
27801
|
-
const content$1 = "
|
|
27802
|
-
const title = "
|
|
27803
|
-
const body = "
|
|
27804
|
-
const footer = "
|
|
27895
|
+
const overlay = "_overlay_1fxeg_43";
|
|
27896
|
+
const overlayBackdrop = "_overlayBackdrop_1fxeg_49";
|
|
27897
|
+
const content$1 = "_content_1fxeg_63";
|
|
27898
|
+
const title = "_title_1fxeg_96";
|
|
27899
|
+
const body = "_body_1fxeg_100";
|
|
27900
|
+
const footer = "_footer_1fxeg_107";
|
|
27805
27901
|
const styles$1 = {
|
|
27806
27902
|
overlay,
|
|
27807
27903
|
overlayBackdrop,
|
|
@@ -27889,6 +27985,7 @@ const global$1 = {
|
|
|
27889
27985
|
const JCUIProvider = ({
|
|
27890
27986
|
children: children2,
|
|
27891
27987
|
theme: initialTheme = DEFAULT_THEME,
|
|
27988
|
+
modalMobileBreakpoint = 600,
|
|
27892
27989
|
className,
|
|
27893
27990
|
...props
|
|
27894
27991
|
}) => {
|
|
@@ -27908,6 +28005,26 @@ const JCUIProvider = ({
|
|
|
27908
28005
|
body2.classList.remove(themeClass, globalClass);
|
|
27909
28006
|
};
|
|
27910
28007
|
}, [themeClass, globalClass]);
|
|
28008
|
+
useEffect(() => {
|
|
28009
|
+
if (typeof document === "undefined" || typeof window === "undefined") {
|
|
28010
|
+
return void 0;
|
|
28011
|
+
}
|
|
28012
|
+
const body2 = document.body;
|
|
28013
|
+
const parsedBreakpoint = Number(modalMobileBreakpoint);
|
|
28014
|
+
const breakpoint = Number.isFinite(parsedBreakpoint) && parsedBreakpoint > 0 ? parsedBreakpoint : 600;
|
|
28015
|
+
const updateModalMobileState = () => {
|
|
28016
|
+
const isMobile = window.innerWidth <= breakpoint;
|
|
28017
|
+
body2.classList.toggle("jcui-modal-mobile", isMobile);
|
|
28018
|
+
body2.style.setProperty("--jcui-modal-mobile-breakpoint", `${breakpoint}px`);
|
|
28019
|
+
};
|
|
28020
|
+
updateModalMobileState();
|
|
28021
|
+
window.addEventListener("resize", updateModalMobileState);
|
|
28022
|
+
return () => {
|
|
28023
|
+
window.removeEventListener("resize", updateModalMobileState);
|
|
28024
|
+
body2.classList.remove("jcui-modal-mobile");
|
|
28025
|
+
body2.style.removeProperty("--jcui-modal-mobile-breakpoint");
|
|
28026
|
+
};
|
|
28027
|
+
}, [modalMobileBreakpoint]);
|
|
27911
28028
|
const contextValue = useMemo(() => ({ theme, setTheme }), [theme]);
|
|
27912
28029
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(ThemeContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
27913
28030
|
"div",
|