@mario_hahn/jumpy-ui 0.14.1 → 0.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.
@@ -15947,7 +15947,7 @@ var providerStyles = `
15947
15947
  Explicit columns so a hidden menu button does not shift the title. */
15948
15948
  [data-jumpy-theme='true'] [data-jumpy-component='top-bar'][data-title-align='center'] {
15949
15949
  display: grid;
15950
- grid-template-columns: minmax(0, 1fr) minmax(0, max-content) minmax(0, 1fr);
15950
+ grid-template-columns: minmax(0, 1fr) minmax(0, max-content) minmax(max-content, 1fr);
15951
15951
  }
15952
15952
 
15953
15953
  [data-jumpy-theme='true'] [data-jumpy-component='top-bar'][data-title-align='center'] > [data-jumpy-slot='top-bar-leading'] {
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  JumpField,
3
3
  JumpyFieldContext
4
- } from "./chunk-KUCMD6DR.js";
4
+ } from "./chunk-SXBPGNRO.js";
5
5
  import {
6
6
  JumpySpacing,
7
7
  spacingValue,
8
8
  useJumpyTheme
9
- } from "./chunk-KDFNGI6Y.js";
9
+ } from "./chunk-2XOYK2JS.js";
10
10
 
11
11
  // editor.js
12
12
  import { useContext, useRef as useRef2, useState as useState2 } from "react";
@@ -18,7 +18,7 @@ import {
18
18
  textStyleValue,
19
19
  themeToCSSVariables,
20
20
  useJumpyTheme
21
- } from "./chunk-KDFNGI6Y.js";
21
+ } from "./chunk-2XOYK2JS.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: "wrap", 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)) });
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") {
@@ -74,7 +74,7 @@ import {
74
74
  getSortOrder,
75
75
  isRowFullySelected,
76
76
  useJumpSnackbar
77
- } from "./chunk-KUCMD6DR.js";
77
+ } from "./chunk-SXBPGNRO.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-KDFNGI6Y.js";
108
+ } from "./chunk-2XOYK2JS.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-KYDYZC4E.js";
5
- import "./chunk-KUCMD6DR.js";
6
- import "./chunk-KDFNGI6Y.js";
4
+ } from "./chunk-NPUCW4NM.js";
5
+ import "./chunk-SXBPGNRO.js";
6
+ import "./chunk-2XOYK2JS.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-KYDYZC4E.js";
4
+ } from "./chunk-NPUCW4NM.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-KUCMD6DR.js";
80
+ } from "./chunk-SXBPGNRO.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-KDFNGI6Y.js";
111
+ } from "./chunk-2XOYK2JS.js";
112
112
  import "./chunk-3DBKYKP2.js";
113
113
  import {
114
114
  jumpyThemeInventory
package/dist/theme.js CHANGED
@@ -30,7 +30,7 @@ import {
30
30
  textStyleValue,
31
31
  themeToCSSVariables,
32
32
  useJumpyTheme
33
- } from "./chunk-KDFNGI6Y.js";
33
+ } from "./chunk-2XOYK2JS.js";
34
34
  export {
35
35
  JumpyAnimation,
36
36
  JumpyAnimationDelay,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mario_hahn/jumpy-ui",
3
- "version": "0.14.1",
3
+ "version": "0.14.2",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": ["**/*.css"],