@mario_hahn/jumpy-ui 0.14.1 → 0.14.3
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/{chunk-KDFNGI6Y.js → chunk-73UN7NZJ.js} +5 -1
- package/dist/{chunk-KUCMD6DR.js → chunk-KSMTJ2AH.js} +42 -6
- package/dist/{chunk-KYDYZC4E.js → chunk-YSO235OL.js} +2 -2
- package/dist/components.js +2 -2
- package/dist/editor.js +3 -3
- package/dist/index.js +3 -3
- package/dist/theme.js +1 -1
- package/package.json +1 -1
|
@@ -14496,6 +14496,10 @@ var providerStyles = `
|
|
|
14496
14496
|
color: var(--jumpy-cmp-base-input-value-color);
|
|
14497
14497
|
}
|
|
14498
14498
|
|
|
14499
|
+
[data-jumpy-theme='true'] [data-jumpy-component='input'][type='number']::-webkit-inner-spin-button {
|
|
14500
|
+
transform: translateY(var(--jumpy-input-spin-shift, 0px));
|
|
14501
|
+
}
|
|
14502
|
+
|
|
14499
14503
|
[data-jumpy-theme='true'] [data-jumpy-component='input'][type='search']::-webkit-search-cancel-button {
|
|
14500
14504
|
-webkit-appearance: none;
|
|
14501
14505
|
appearance: none;
|
|
@@ -15947,7 +15951,7 @@ var providerStyles = `
|
|
|
15947
15951
|
Explicit columns so a hidden menu button does not shift the title. */
|
|
15948
15952
|
[data-jumpy-theme='true'] [data-jumpy-component='top-bar'][data-title-align='center'] {
|
|
15949
15953
|
display: grid;
|
|
15950
|
-
grid-template-columns: minmax(0, 1fr) minmax(0, max-content) minmax(
|
|
15954
|
+
grid-template-columns: minmax(0, 1fr) minmax(0, max-content) minmax(max-content, 1fr);
|
|
15951
15955
|
}
|
|
15952
15956
|
|
|
15953
15957
|
[data-jumpy-theme='true'] [data-jumpy-component='top-bar'][data-title-align='center'] > [data-jumpy-slot='top-bar-leading'] {
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
textStyleValue,
|
|
19
19
|
themeToCSSVariables,
|
|
20
20
|
useJumpyTheme
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-73UN7NZJ.js";
|
|
22
22
|
import {
|
|
23
23
|
cn
|
|
24
24
|
} from "./chunk-3DBKYKP2.js";
|
|
@@ -36,6 +36,7 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
36
36
|
var JumpyTableContext = createContext2(null);
|
|
37
37
|
var JumpyExpandableContext = createContext2(null);
|
|
38
38
|
var JumpySideMenuContext = createContext2(null);
|
|
39
|
+
var JumpyAppShellNavigationContext = createContext2(false);
|
|
39
40
|
var JumpyToggleButtonGroupContext = createContext2(null);
|
|
40
41
|
var JumpySnackbarContext = createContext2({ addSnackbar: () => "", removeSnackbar: () => {
|
|
41
42
|
}, clearAll: () => {
|
|
@@ -789,6 +790,7 @@ function JumpSideMenu({ as, children, className = "", collapsed = false, selecte
|
|
|
789
790
|
const previousCollapsed = useRef(collapsed);
|
|
790
791
|
const releaseTimer = useRef(void 0);
|
|
791
792
|
const [isResizing, setIsResizing] = useState(false);
|
|
793
|
+
const fillsNavigation = useContext(JumpyAppShellNavigationContext) && !collapsed;
|
|
792
794
|
useLayoutEffect(() => {
|
|
793
795
|
if (previousCollapsed.current === collapsed) return void 0;
|
|
794
796
|
previousCollapsed.current = collapsed;
|
|
@@ -845,7 +847,7 @@ function JumpSideMenu({ as, children, className = "", collapsed = false, selecte
|
|
|
845
847
|
className: cn(className),
|
|
846
848
|
style: {
|
|
847
849
|
display: "block",
|
|
848
|
-
width: "fit-content",
|
|
850
|
+
width: fillsNavigation ? "100%" : "fit-content",
|
|
849
851
|
height: "fit-content",
|
|
850
852
|
overflowX: "hidden",
|
|
851
853
|
overflowY: "auto",
|
|
@@ -2298,7 +2300,7 @@ function JumpyAppShellActions({ actions, variant, ariaLabels }) {
|
|
|
2298
2300
|
if (!actions.length) return null;
|
|
2299
2301
|
const gap = spacingValue(theme, JumpySpacing.smallXS);
|
|
2300
2302
|
if (variant === "full") {
|
|
2301
|
-
return /* @__PURE__ */ jsx("span", { "data-jumpy-slot": "app-shell-actions", "data-variant": "full", style: { alignItems: "center", gap, flexWrap: "
|
|
2303
|
+
return /* @__PURE__ */ jsx("span", { "data-jumpy-slot": "app-shell-actions", "data-variant": "full", style: { alignItems: "center", gap, flexWrap: "nowrap", justifyContent: "flex-end" }, children: actions.map((action, index) => /* @__PURE__ */ jsx(JumpButton, { as: action.href ? "a" : void 0, href: action.href, variant: action.variant || "secondary", leadingIcon: action.icon, disabled: action.disabled, onClick: action.onClick, children: action.label }, action.id ?? index)) });
|
|
2302
2304
|
}
|
|
2303
2305
|
const visible = actions.length > 2 ? actions.slice(0, 1) : actions;
|
|
2304
2306
|
const overflow = actions.length > 2 ? actions.slice(1) : [];
|
|
@@ -2407,6 +2409,7 @@ ${shell} [data-jumpy-slot='app-shell-back'][data-variant='inline'] { display: no
|
|
|
2407
2409
|
${shell} > [data-jumpy-slot='app-shell-body'] > [data-jumpy-component='tab-bar'] { display: none; }
|
|
2408
2410
|
${shell} > [data-jumpy-slot='app-shell-body'] > [data-jumpy-component='top-bar'][data-mobile-only='true'] { display: none; }
|
|
2409
2411
|
${shell} > [data-jumpy-slot='app-shell-body'] > [data-jumpy-component='top-bar'] > [data-leading='menu'] { display: none; }
|
|
2412
|
+
${shell} > [data-jumpy-slot='app-shell-body'] > [data-jumpy-component='top-bar'][data-large-title='true'] [data-jumpy-slot='app-shell-back'][data-variant='bar'] { display: none; }
|
|
2410
2413
|
}`;
|
|
2411
2414
|
const topBarNode = /* @__PURE__ */ jsx(
|
|
2412
2415
|
JumpTopBar,
|
|
@@ -2465,7 +2468,7 @@ ${shell} [data-jumpy-slot='app-shell-back'][data-variant='inline'] { display: no
|
|
|
2465
2468
|
},
|
|
2466
2469
|
children: [
|
|
2467
2470
|
brand ? /* @__PURE__ */ jsx("div", { "data-jumpy-slot": "app-shell-brand", style: { flex: "0 0 auto", padding: spacingValue(theme, JumpySpacing.large2XL), borderBottom: `${borderWidthValue(theme, JumpyBorderWidth.small)}px solid var(--jumpy-color-border-subtle)` }, children: brand }) : null,
|
|
2468
|
-
navigation ? /* @__PURE__ */ jsx("div", { "data-jumpy-slot": "app-shell-navigation", style: { flex: "1 1 auto", minHeight: 0, overflowY: "auto", overscrollBehavior: "contain", padding: spacingValue(theme, JumpySpacing.large) }, children: navigation }) : null,
|
|
2471
|
+
navigation ? /* @__PURE__ */ jsx("div", { "data-jumpy-slot": "app-shell-navigation", style: { flex: "1 1 auto", minHeight: 0, overflowY: "auto", overscrollBehavior: "contain", padding: spacingValue(theme, JumpySpacing.large) }, children: /* @__PURE__ */ jsx(JumpyAppShellNavigationContext.Provider, { value: true, children: navigation }) }) : null,
|
|
2469
2472
|
sidebarFooter ? /* @__PURE__ */ jsx("div", { "data-jumpy-slot": "app-shell-sidebar-footer", style: { flex: "0 0 auto", padding: spacingValue(theme, JumpySpacing.large), borderTop: `${borderWidthValue(theme, JumpyBorderWidth.small)}px solid var(--jumpy-color-border-subtle)` }, children: sidebarFooter }) : null
|
|
2470
2473
|
]
|
|
2471
2474
|
}
|
|
@@ -2535,7 +2538,7 @@ ${shell} [data-jumpy-slot='app-shell-back'][data-variant='inline'] { display: no
|
|
|
2535
2538
|
title: brand
|
|
2536
2539
|
}
|
|
2537
2540
|
),
|
|
2538
|
-
/* @__PURE__ */ jsx("div", { "data-jumpy-slot": "app-shell-drawer-navigation", style: { flex: "1 1 auto", minHeight: 0, overflowY: "auto", overscrollBehavior: "contain", padding: spacingValue(theme, JumpySpacing.large) }, children: navigation }),
|
|
2541
|
+
/* @__PURE__ */ jsx("div", { "data-jumpy-slot": "app-shell-drawer-navigation", style: { flex: "1 1 auto", minHeight: 0, overflowY: "auto", overscrollBehavior: "contain", padding: spacingValue(theme, JumpySpacing.large) }, children: /* @__PURE__ */ jsx(JumpyAppShellNavigationContext.Provider, { value: true, children: navigation }) }),
|
|
2539
2542
|
sidebarFooter ? /* @__PURE__ */ jsx("div", { "data-jumpy-slot": "app-shell-drawer-footer", style: { flex: "0 0 auto", padding: `${spacingValue(theme, JumpySpacing.large)}px calc(${spacingValue(theme, JumpySpacing.large)}px + env(safe-area-inset-right, 0px)) calc(${spacingValue(theme, JumpySpacing.large)}px + env(safe-area-inset-bottom, 0px)) calc(${spacingValue(theme, JumpySpacing.large)}px + env(safe-area-inset-left, 0px))`, borderTop: `${borderWidthValue(theme, JumpyBorderWidth.small)}px solid var(--jumpy-color-border-subtle)`, backgroundColor: "var(--jumpy-color-surface-card)" }, children: sidebarFooter }) : null
|
|
2540
2543
|
]
|
|
2541
2544
|
}
|
|
@@ -2967,6 +2970,18 @@ function JumpDatePicker({ label = "Date", hint, value, defaultValue = null, onCh
|
|
|
2967
2970
|
setInternalOpen(next);
|
|
2968
2971
|
onOpenChange?.(next);
|
|
2969
2972
|
}
|
|
2973
|
+
useEffect(() => {
|
|
2974
|
+
if (!isOpen) return void 0;
|
|
2975
|
+
function dismissOutside(event) {
|
|
2976
|
+
if (!refs.reference.current?.contains(event.target) && !refs.floating.current?.contains(event.target)) setOpen(false);
|
|
2977
|
+
}
|
|
2978
|
+
document.addEventListener("pointerdown", dismissOutside);
|
|
2979
|
+
document.addEventListener("focusin", dismissOutside);
|
|
2980
|
+
return () => {
|
|
2981
|
+
document.removeEventListener("pointerdown", dismissOutside);
|
|
2982
|
+
document.removeEventListener("focusin", dismissOutside);
|
|
2983
|
+
};
|
|
2984
|
+
});
|
|
2970
2985
|
function commit(date) {
|
|
2971
2986
|
if (date && dateIsUnavailable(date, { minDate, maxDate, disabledDates, isDateDisabled })) return;
|
|
2972
2987
|
const next = coerceDateOutput(date, value ?? defaultValue);
|
|
@@ -3080,6 +3095,18 @@ function JumpTimePicker({ label = "Time", hint, value, defaultValue = null, onCh
|
|
|
3080
3095
|
setInternalOpen(next);
|
|
3081
3096
|
onOpenChange?.(next);
|
|
3082
3097
|
}
|
|
3098
|
+
useEffect(() => {
|
|
3099
|
+
if (!isOpen) return void 0;
|
|
3100
|
+
function dismissOutside(event) {
|
|
3101
|
+
if (!refs.reference.current?.contains(event.target) && !refs.floating.current?.contains(event.target)) setOpen(false);
|
|
3102
|
+
}
|
|
3103
|
+
document.addEventListener("pointerdown", dismissOutside);
|
|
3104
|
+
document.addEventListener("focusin", dismissOutside);
|
|
3105
|
+
return () => {
|
|
3106
|
+
document.removeEventListener("pointerdown", dismissOutside);
|
|
3107
|
+
document.removeEventListener("focusin", dismissOutside);
|
|
3108
|
+
};
|
|
3109
|
+
});
|
|
3083
3110
|
function commit(part, rawValue) {
|
|
3084
3111
|
const next = selectedDate ? new Date(selectedDate) : /* @__PURE__ */ new Date();
|
|
3085
3112
|
if (part === "hour") {
|
|
@@ -3776,11 +3803,18 @@ function JumpLinkButton({ href, variant = "borderless", status = "regular", clas
|
|
|
3776
3803
|
}
|
|
3777
3804
|
);
|
|
3778
3805
|
}
|
|
3806
|
+
function nativeColorScheme(theme) {
|
|
3807
|
+
const match = /^#([0-9a-f]{6})/i.exec(String(theme.color?.surfaceField || ""));
|
|
3808
|
+
if (!match) return void 0;
|
|
3809
|
+
const [r, g, b] = [0, 2, 4].map((index) => parseInt(match[1].slice(index, index + 2), 16) / 255);
|
|
3810
|
+
return 0.2126 * r + 0.7152 * g + 0.0722 * b < 0.4 ? "dark" : "light";
|
|
3811
|
+
}
|
|
3779
3812
|
var JumpInput = forwardRef(function JumpInput2({ className = "", ...props }, ref) {
|
|
3780
3813
|
const theme = useJumpyTheme();
|
|
3781
3814
|
const fieldContext = useContext(JumpyFieldContext);
|
|
3782
3815
|
const inputOffset = fieldContext?.hasLabel ? spacingValue(theme, JumpySpacing.large) : spacingValue(theme, JumpySpacing.zero);
|
|
3783
3816
|
const inputMinHeight = fieldContext ? void 0 : sizeValue(theme, JumpySize.largeXL) - spacingValue(theme, JumpySpacing.small3XS) * 2;
|
|
3817
|
+
const spinShift = props.type === "number" && inputOffset ? Math.max(0, (inputOffset - spacingValue(theme, JumpySpacing.small3XS) / 2) / 2) : 0;
|
|
3784
3818
|
const inputElement = /* @__PURE__ */ jsx(
|
|
3785
3819
|
"input",
|
|
3786
3820
|
{
|
|
@@ -3791,7 +3825,9 @@ var JumpInput = forwardRef(function JumpInput2({ className = "", ...props }, ref
|
|
|
3791
3825
|
style: {
|
|
3792
3826
|
...getFieldInputStyles(theme, props.disabled),
|
|
3793
3827
|
minHeight: inputMinHeight,
|
|
3794
|
-
marginTop: inputOffset,
|
|
3828
|
+
marginTop: inputOffset - spinShift,
|
|
3829
|
+
...spinShift ? { paddingTop: spinShift, "--jumpy-input-spin-shift": `${-spinShift}px` } : {},
|
|
3830
|
+
colorScheme: props.type === "number" ? nativeColorScheme(theme) : void 0,
|
|
3795
3831
|
...props.style || {}
|
|
3796
3832
|
}
|
|
3797
3833
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
JumpField,
|
|
3
3
|
JumpyFieldContext
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-KSMTJ2AH.js";
|
|
5
5
|
import {
|
|
6
6
|
JumpySpacing,
|
|
7
7
|
spacingValue,
|
|
8
8
|
useJumpyTheme
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-73UN7NZJ.js";
|
|
10
10
|
|
|
11
11
|
// editor.js
|
|
12
12
|
import { useContext, useRef as useRef2, useState as useState2 } from "react";
|
package/dist/components.js
CHANGED
|
@@ -74,7 +74,7 @@ import {
|
|
|
74
74
|
getSortOrder,
|
|
75
75
|
isRowFullySelected,
|
|
76
76
|
useJumpSnackbar
|
|
77
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-KSMTJ2AH.js";
|
|
78
78
|
import {
|
|
79
79
|
JumpyAnimation,
|
|
80
80
|
JumpyAnimationDelay,
|
|
@@ -105,7 +105,7 @@ import {
|
|
|
105
105
|
textStyleValue,
|
|
106
106
|
themeToCSSVariables,
|
|
107
107
|
useJumpyTheme
|
|
108
|
-
} from "./chunk-
|
|
108
|
+
} from "./chunk-73UN7NZJ.js";
|
|
109
109
|
import "./chunk-3DBKYKP2.js";
|
|
110
110
|
import {
|
|
111
111
|
jumpyThemeInventory
|
package/dist/editor.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
JumpTokenInput
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-YSO235OL.js";
|
|
5
|
+
import "./chunk-KSMTJ2AH.js";
|
|
6
|
+
import "./chunk-73UN7NZJ.js";
|
|
7
7
|
import "./chunk-3DBKYKP2.js";
|
|
8
8
|
import "./chunk-XDTVYUWG.js";
|
|
9
9
|
export {
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
JumpTokenInput
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YSO235OL.js";
|
|
5
5
|
import {
|
|
6
6
|
BrandMark,
|
|
7
7
|
JumpAppShell,
|
|
@@ -77,7 +77,7 @@ import {
|
|
|
77
77
|
getSortOrder,
|
|
78
78
|
isRowFullySelected,
|
|
79
79
|
useJumpSnackbar
|
|
80
|
-
} from "./chunk-
|
|
80
|
+
} from "./chunk-KSMTJ2AH.js";
|
|
81
81
|
import {
|
|
82
82
|
JumpyAnimation,
|
|
83
83
|
JumpyAnimationDelay,
|
|
@@ -108,7 +108,7 @@ import {
|
|
|
108
108
|
textStyleValue,
|
|
109
109
|
themeToCSSVariables,
|
|
110
110
|
useJumpyTheme
|
|
111
|
-
} from "./chunk-
|
|
111
|
+
} from "./chunk-73UN7NZJ.js";
|
|
112
112
|
import "./chunk-3DBKYKP2.js";
|
|
113
113
|
import {
|
|
114
114
|
jumpyThemeInventory
|
package/dist/theme.js
CHANGED