@jupytergis/base 0.12.1 → 0.12.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.
Files changed (52) hide show
  1. package/lib/dialogs/layerBrowserDialog.d.ts +3 -3
  2. package/lib/dialogs/layerBrowserDialog.js +9 -10
  3. package/lib/formbuilder/objectform/StoryEditorForm.js +5 -5
  4. package/lib/mainview/mainView.d.ts +8 -2
  5. package/lib/mainview/mainView.js +36 -7
  6. package/lib/mainview/mainviewwidget.js +2 -2
  7. package/lib/panelview/leftpanel.d.ts +2 -1
  8. package/lib/panelview/leftpanel.js +28 -20
  9. package/lib/panelview/rightpanel.d.ts +2 -1
  10. package/lib/panelview/rightpanel.js +12 -18
  11. package/lib/panelview/story-maps/MobileSpectaPanel.d.ts +7 -0
  12. package/lib/panelview/story-maps/MobileSpectaPanel.js +114 -0
  13. package/lib/panelview/story-maps/StoryNavBar.d.ts +3 -2
  14. package/lib/panelview/story-maps/StoryNavBar.js +18 -6
  15. package/lib/panelview/story-maps/StoryViewerPanel.d.ts +10 -0
  16. package/lib/panelview/story-maps/StoryViewerPanel.js +44 -18
  17. package/lib/panelview/story-maps/components/StoryImageSection.d.ts +2 -7
  18. package/lib/panelview/story-maps/components/StoryImageSection.js +2 -4
  19. package/lib/panelview/story-maps/components/StorySubtitleSection.d.ts +2 -6
  20. package/lib/panelview/story-maps/components/StorySubtitleSection.js +2 -4
  21. package/lib/panelview/story-maps/components/StoryTitleSection.d.ts +2 -7
  22. package/lib/panelview/story-maps/components/StoryTitleSection.js +2 -3
  23. package/lib/shared/components/Button.js +2 -2
  24. package/lib/shared/components/Calendar.js +0 -1
  25. package/lib/shared/components/Checkbox.d.ts +1 -1
  26. package/lib/shared/components/Checkbox.js +1 -1
  27. package/lib/shared/components/Dialog.d.ts +1 -1
  28. package/lib/shared/components/Dialog.js +1 -1
  29. package/lib/shared/components/Drawer.d.ts +13 -0
  30. package/lib/shared/components/Drawer.js +59 -0
  31. package/lib/shared/components/DropdownMenu.d.ts +1 -1
  32. package/lib/shared/components/DropdownMenu.js +1 -1
  33. package/lib/shared/components/Popover.d.ts +1 -1
  34. package/lib/shared/components/Popover.js +1 -1
  35. package/lib/shared/components/RadioGroup.d.ts +1 -1
  36. package/lib/shared/components/RadioGroup.js +1 -1
  37. package/lib/shared/components/Sheet.d.ts +15 -0
  38. package/lib/shared/components/Sheet.js +64 -0
  39. package/lib/shared/components/Switch.d.ts +1 -1
  40. package/lib/shared/components/Switch.js +1 -1
  41. package/lib/shared/components/Tabs.d.ts +1 -1
  42. package/lib/shared/components/Tabs.js +1 -1
  43. package/lib/shared/components/ToggleGroup.d.ts +1 -1
  44. package/lib/shared/components/ToggleGroup.js +1 -1
  45. package/lib/shared/hooks/useMediaQuery.d.ts +9 -0
  46. package/lib/shared/hooks/useMediaQuery.js +32 -0
  47. package/lib/tools.js +21 -34
  48. package/package.json +5 -12
  49. package/style/base.css +7 -0
  50. package/style/shared/drawer.css +154 -0
  51. package/style/shared/sheet.css +258 -0
  52. package/style/storyPanel.css +32 -4
@@ -1,11 +1,23 @@
1
1
  import { ChevronLeft, ChevronRight } from 'lucide-react';
2
2
  import React from 'react';
3
3
  import { Button } from "../../shared/components/Button";
4
- function StoryNavBar({ onPrev, onNext, hasPrev, hasNext, isSpecta, }) {
5
- return (React.createElement("div", { className: `jgis-story-navbar ${isSpecta ? 'jgis-story-navbar-specta-mod' : ''}` },
6
- React.createElement(Button, { onClick: onPrev, disabled: !hasPrev, "aria-label": "Previous slide" },
7
- React.createElement(ChevronLeft, null)),
8
- React.createElement(Button, { onClick: onNext, disabled: !hasNext, "aria-label": "Next slide" },
9
- React.createElement(ChevronRight, null))));
4
+ function StoryNavBar({ placement, onPrev, onNext, hasPrev, hasNext, }) {
5
+ const containerClassName = placement === 'over-image'
6
+ ? 'jgis-story-viewer-nav-container'
7
+ : placement === 'subtitle-specta'
8
+ ? 'jgis-story-viewer-nav-container-specta-mod'
9
+ : placement === 'subtitle-specta-mobile'
10
+ ? 'jgis-story-viewer-nav-container-specta-mobile'
11
+ : undefined;
12
+ const navbarClassName = placement === 'subtitle-specta'
13
+ ? 'jgis-story-navbar jgis-story-navbar-specta-mod'
14
+ : 'jgis-story-navbar';
15
+ return (React.createElement("div", { className: containerClassName },
16
+ React.createElement("div", { className: navbarClassName },
17
+ React.createElement(React.Fragment, null,
18
+ React.createElement(Button, { onClick: onPrev, disabled: !hasPrev, className: "jgis-story-navbar-button", "aria-label": "Previous slide" },
19
+ React.createElement(ChevronLeft, null)),
20
+ React.createElement(Button, { onClick: onNext, disabled: !hasNext, className: "jgis-story-navbar-button", "aria-label": "Next slide" },
21
+ React.createElement(ChevronRight, null))))));
10
22
  }
11
23
  export default StoryNavBar;
@@ -3,11 +3,21 @@ import React from 'react';
3
3
  interface IStoryViewerPanelProps {
4
4
  model: IJupyterGISModel;
5
5
  isSpecta: boolean;
6
+ isMobile?: boolean;
7
+ className?: string;
6
8
  }
7
9
  export interface IStoryViewerPanelHandle {
8
10
  handlePrev: () => void;
9
11
  handleNext: () => void;
10
12
  canNavigate: boolean;
11
13
  }
14
+ /**
15
+ * Where the story nav bar should be rendered in the viewer layout.
16
+ * - below-title: normal mode, guided, no image (under the title)
17
+ * - over-image: normal mode, guided, with image (over the image)
18
+ * - subtitle-specta: specta mode desktop (next to subtitle, fixed centered)
19
+ * - subtitle-specta-mobile: specta mode mobile (in line with subtitle)
20
+ */
21
+ export type StoryNavPlacement = 'below-title' | 'over-image' | 'subtitle-specta' | 'subtitle-specta-mobile';
12
22
  declare const StoryViewerPanel: React.ForwardRefExoticComponent<IStoryViewerPanelProps & React.RefAttributes<IStoryViewerPanelHandle>>;
13
23
  export default StoryViewerPanel;
@@ -1,14 +1,32 @@
1
1
  import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState, } from 'react';
2
+ import { cn } from "../../shared/components/utils";
3
+ import StoryNavBar from './StoryNavBar';
2
4
  import StoryContentSection from './components/StoryContentSection';
3
5
  import StoryImageSection from './components/StoryImageSection';
4
6
  import StorySubtitleSection from './components/StorySubtitleSection';
5
7
  import StoryTitleSection from './components/StoryTitleSection';
6
- const StoryViewerPanel = forwardRef(({ model, isSpecta }, ref) => {
8
+ /**
9
+ * Returns which section should render the nav bar, or null if nav should be hidden.
10
+ */
11
+ function getStoryNavPlacement(isSpecta, hasImage, storyType, isMobile) {
12
+ if (isSpecta) {
13
+ return isMobile ? 'subtitle-specta-mobile' : 'subtitle-specta';
14
+ }
15
+ if (storyType !== 'guided') {
16
+ return null;
17
+ }
18
+ return hasImage ? 'over-image' : 'below-title';
19
+ }
20
+ const StoryViewerPanel = forwardRef(({ model, isSpecta, isMobile = false, className }, ref) => {
7
21
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
8
- const [currentIndexDisplayed, setCurrentIndexDisplayed] = useState(0);
22
+ const [currentIndexDisplayed, setCurrentIndexDisplayed] = useState(() => model.getCurrentSegmentIndex());
9
23
  const [storyData, setStoryData] = useState((_a = model.getSelectedStory().story) !== null && _a !== void 0 ? _a : null);
10
24
  const [imageLoaded, setImageLoaded] = useState(false);
11
25
  const panelRef = useRef(null);
26
+ const setIndex = useCallback((index) => {
27
+ model.setCurrentSegmentIndex(index);
28
+ setCurrentIndexDisplayed(index);
29
+ }, [model]);
12
30
  // Derive story segments from story data
13
31
  const storySegments = useMemo(() => {
14
32
  if (!(storyData === null || storyData === void 0 ? void 0 : storyData.storySegments)) {
@@ -53,17 +71,18 @@ const StoryViewerPanel = forwardRef(({ model, isSpecta }, ref) => {
53
71
  }, [storyData, model]);
54
72
  useEffect(() => {
55
73
  const updateStory = () => {
74
+ var _a;
56
75
  const { story } = model.getSelectedStory();
57
76
  setStoryData(story !== null && story !== void 0 ? story : null);
58
77
  // Reset to first slide when story changes
59
- setCurrentIndexDisplayed(0);
78
+ setIndex((_a = model.getCurrentSegmentIndex()) !== null && _a !== void 0 ? _a : 0);
60
79
  };
61
80
  updateStory();
62
81
  model.sharedModel.storyMapsChanged.connect(updateStory);
63
82
  return () => {
64
83
  model.sharedModel.storyMapsChanged.disconnect(updateStory);
65
84
  };
66
- }, [model]);
85
+ }, [model, setIndex]);
67
86
  // Prefetch image when slide changes
68
87
  useEffect(() => {
69
88
  var _a;
@@ -129,25 +148,23 @@ const StoryViewerPanel = forwardRef(({ model, isSpecta }, ref) => {
129
148
  if (index === undefined || index === -1) {
130
149
  return;
131
150
  }
132
- setCurrentIndexDisplayed(index);
151
+ setIndex(index);
133
152
  };
134
153
  model.sharedModel.awareness.on('change', handleSelectedStorySegmentChange);
135
154
  return () => {
136
155
  model.sharedModel.awareness.off('change', handleSelectedStorySegmentChange);
137
156
  };
138
- }, [model, storyData]);
157
+ }, [model, storyData, setIndex]);
139
158
  const handlePrev = useCallback(() => {
140
159
  if (currentIndexDisplayed > 0) {
141
- const newIndex = currentIndexDisplayed - 1;
142
- setCurrentIndexDisplayed(newIndex);
160
+ setIndex(currentIndexDisplayed - 1);
143
161
  }
144
- }, [currentIndexDisplayed]);
162
+ }, [currentIndexDisplayed, setIndex]);
145
163
  const handleNext = useCallback(() => {
146
164
  if (currentIndexDisplayed < storySegments.length - 1) {
147
- const newIndex = currentIndexDisplayed + 1;
148
- setCurrentIndexDisplayed(newIndex);
165
+ setIndex(currentIndexDisplayed + 1);
149
166
  }
150
- }, [currentIndexDisplayed, storySegments.length]);
167
+ }, [currentIndexDisplayed, storySegments.length, setIndex]);
151
168
  // Expose methods via ref for parent component to use
152
169
  useImperativeHandle(ref, () => ({
153
170
  handlePrev,
@@ -164,16 +181,25 @@ const StoryViewerPanel = forwardRef(({ model, isSpecta }, ref) => {
164
181
  hasPrev: currentIndexDisplayed > 0,
165
182
  hasNext: currentIndexDisplayed < storySegments.length - 1,
166
183
  };
184
+ const hasImage = !!(((_d = activeSlide === null || activeSlide === void 0 ? void 0 : activeSlide.content) === null || _d === void 0 ? void 0 : _d.image) && imageLoaded);
185
+ const storyType = (_e = storyData.storyType) !== null && _e !== void 0 ? _e : 'guided';
186
+ const navPlacement = getStoryNavPlacement(isSpecta, hasImage, storyType, isMobile);
187
+ const navSlot = navPlacement !== null ? (React.createElement(StoryNavBar, Object.assign({ placement: navPlacement }, navProps))) : null;
167
188
  // Get transition time from current segment, default to 0.3s
168
- const transitionTime = (_e = (_d = activeSlide === null || activeSlide === void 0 ? void 0 : activeSlide.transition) === null || _d === void 0 ? void 0 : _d.time) !== null && _e !== void 0 ? _e : 0.3;
169
- return (React.createElement("div", { ref: panelRef, className: `jgis-story-viewer-panel ${isSpecta ? 'jgis-story-viewer-panel-specta-mod' : ''}` },
189
+ const transitionTime = (_g = (_f = activeSlide === null || activeSlide === void 0 ? void 0 : activeSlide.transition) === null || _f === void 0 ? void 0 : _f.time) !== null && _g !== void 0 ? _g : 0.3;
190
+ return (React.createElement("div", { ref: panelRef, className: cn('jgis-story-viewer-panel', className), id: "jgis-story-segment-panel" },
170
191
  React.createElement("div", { key: currentIndexDisplayed, className: "jgis-story-segment-container", style: {
171
192
  animationDuration: `${transitionTime}s`,
172
193
  } },
173
- React.createElement("h1", { className: "jgis-story-viewer-title" }, layerName !== null && layerName !== void 0 ? layerName : `Slide ${currentIndexDisplayed + 1}`),
174
- ((_f = activeSlide === null || activeSlide === void 0 ? void 0 : activeSlide.content) === null || _f === void 0 ? void 0 : _f.image) && imageLoaded ? (React.createElement(StoryImageSection, Object.assign({ imageUrl: activeSlide.content.image, imageLoaded: imageLoaded, layerName: layerName !== null && layerName !== void 0 ? layerName : '', slideNumber: currentIndexDisplayed, isSpecta: isSpecta, storyType: (_g = storyData.storyType) !== null && _g !== void 0 ? _g : 'guided' }, navProps))) : (React.createElement(StoryTitleSection, Object.assign({ title: (_h = storyData.title) !== null && _h !== void 0 ? _h : '', isSpecta: isSpecta, storyType: (_j = storyData.storyType) !== null && _j !== void 0 ? _j : 'guided' }, navProps))),
175
- React.createElement(StorySubtitleSection, Object.assign({ title: (_l = (_k = activeSlide === null || activeSlide === void 0 ? void 0 : activeSlide.content) === null || _k === void 0 ? void 0 : _k.title) !== null && _l !== void 0 ? _l : '', isSpecta: isSpecta }, navProps)),
176
- React.createElement(StoryContentSection, { markdown: (_o = (_m = activeSlide === null || activeSlide === void 0 ? void 0 : activeSlide.content) === null || _m === void 0 ? void 0 : _m.markdown) !== null && _o !== void 0 ? _o : '' }))));
194
+ React.createElement("div", { id: "jgis-story-segment-header" },
195
+ React.createElement("h1", { className: "jgis-story-viewer-title" }, layerName !== null && layerName !== void 0 ? layerName : `Slide ${currentIndexDisplayed + 1}`),
196
+ ((_h = activeSlide === null || activeSlide === void 0 ? void 0 : activeSlide.content) === null || _h === void 0 ? void 0 : _h.image) && imageLoaded ? (React.createElement(StoryImageSection, { imageUrl: activeSlide.content.image, imageLoaded: imageLoaded, layerName: layerName !== null && layerName !== void 0 ? layerName : '', slideNumber: currentIndexDisplayed, navSlot: navPlacement === 'over-image' ? navSlot : null })) : (React.createElement(StoryTitleSection, { title: (_j = storyData.title) !== null && _j !== void 0 ? _j : '', navSlot: navPlacement === 'below-title' ? navSlot : null })),
197
+ React.createElement(StorySubtitleSection, { title: (_l = (_k = activeSlide === null || activeSlide === void 0 ? void 0 : activeSlide.content) === null || _k === void 0 ? void 0 : _k.title) !== null && _l !== void 0 ? _l : '', navSlot: navPlacement === 'subtitle-specta' ||
198
+ navPlacement === 'subtitle-specta-mobile'
199
+ ? navSlot
200
+ : null })),
201
+ React.createElement("div", { id: "jgis-story-segment-content" },
202
+ React.createElement(StoryContentSection, { markdown: (_o = (_m = activeSlide === null || activeSlide === void 0 ? void 0 : activeSlide.content) === null || _m === void 0 ? void 0 : _m.markdown) !== null && _o !== void 0 ? _o : '' })))));
177
203
  });
178
204
  StoryViewerPanel.displayName = 'StoryViewerPanel';
179
205
  export default StoryViewerPanel;
@@ -4,12 +4,7 @@ interface IStoryImageSectionProps {
4
4
  imageLoaded: boolean;
5
5
  layerName: string;
6
6
  slideNumber: number;
7
- isSpecta: boolean;
8
- storyType: string;
9
- onPrev: () => void;
10
- onNext: () => void;
11
- hasPrev: boolean;
12
- hasNext: boolean;
7
+ navSlot?: React.ReactNode;
13
8
  }
14
- declare function StoryImageSection({ imageUrl, imageLoaded, layerName, slideNumber, isSpecta, storyType, onPrev, onNext, hasPrev, hasNext, }: IStoryImageSectionProps): React.JSX.Element | null;
9
+ declare function StoryImageSection({ imageUrl, imageLoaded, layerName, slideNumber, navSlot, }: IStoryImageSectionProps): React.JSX.Element | null;
15
10
  export default StoryImageSection;
@@ -1,13 +1,11 @@
1
1
  import React from 'react';
2
- import StoryNavBar from '../StoryNavBar';
3
- function StoryImageSection({ imageUrl, imageLoaded, layerName, slideNumber, isSpecta, storyType, onPrev, onNext, hasPrev, hasNext, }) {
2
+ function StoryImageSection({ imageUrl, imageLoaded, layerName, slideNumber, navSlot, }) {
4
3
  if (!imageLoaded) {
5
4
  return null;
6
5
  }
7
6
  return (React.createElement("div", { className: "jgis-story-viewer-image-section" },
8
7
  React.createElement("div", { className: "jgis-story-viewer-image-container" },
9
8
  React.createElement("img", { src: imageUrl, alt: "Story map image", className: "jgis-story-viewer-image" }),
10
- !isSpecta && storyType === 'guided' && (React.createElement("div", { className: "jgis-story-viewer-nav-container" },
11
- React.createElement(StoryNavBar, { onPrev: onPrev, onNext: onNext, hasPrev: hasPrev, hasNext: hasNext, isSpecta: isSpecta }))))));
9
+ navSlot)));
12
10
  }
13
11
  export default StoryImageSection;
@@ -1,11 +1,7 @@
1
1
  import React from 'react';
2
2
  interface IStorySubtitleSectionProps {
3
3
  title: string;
4
- isSpecta: boolean;
5
- onPrev: () => void;
6
- onNext: () => void;
7
- hasPrev: boolean;
8
- hasNext: boolean;
4
+ navSlot?: React.ReactNode;
9
5
  }
10
- declare function StorySubtitleSection({ title, isSpecta, onPrev, onNext, hasPrev, hasNext, }: IStorySubtitleSectionProps): React.JSX.Element;
6
+ declare function StorySubtitleSection({ title, navSlot }: IStorySubtitleSectionProps): React.JSX.Element;
11
7
  export default StorySubtitleSection;
@@ -1,9 +1,7 @@
1
1
  import React from 'react';
2
- import StoryNavBar from '../StoryNavBar';
3
- function StorySubtitleSection({ title, isSpecta, onPrev, onNext, hasPrev, hasNext, }) {
2
+ function StorySubtitleSection({ title, navSlot }) {
4
3
  return (React.createElement("div", { className: "jgis-story-viewer-subtitle-container" },
5
4
  React.createElement("h2", { className: "jgis-story-viewer-subtitle" }, title || 'Slide Title'),
6
- isSpecta && (React.createElement("div", { className: "jgis-story-viewer-nav-container-specta-mod" },
7
- React.createElement(StoryNavBar, { onPrev: onPrev, onNext: onNext, hasPrev: hasPrev, hasNext: hasNext, isSpecta: isSpecta })))));
5
+ navSlot));
8
6
  }
9
7
  export default StorySubtitleSection;
@@ -1,12 +1,7 @@
1
1
  import React from 'react';
2
2
  interface IStoryTitleSectionProps {
3
3
  title: string;
4
- isSpecta: boolean;
5
- storyType: string;
6
- onPrev: () => void;
7
- onNext: () => void;
8
- hasPrev: boolean;
9
- hasNext: boolean;
4
+ navSlot?: React.ReactNode;
10
5
  }
11
- declare function StoryTitleSection({ title, isSpecta, storyType, onPrev, onNext, hasPrev, hasNext, }: IStoryTitleSectionProps): React.JSX.Element;
6
+ declare function StoryTitleSection({ title, navSlot }: IStoryTitleSectionProps): React.JSX.Element;
12
7
  export default StoryTitleSection;
@@ -1,8 +1,7 @@
1
1
  import React from 'react';
2
- import StoryNavBar from '../StoryNavBar';
3
- function StoryTitleSection({ title, isSpecta, storyType, onPrev, onNext, hasPrev, hasNext, }) {
2
+ function StoryTitleSection({ title, navSlot }) {
4
3
  return (React.createElement(React.Fragment, null,
5
4
  React.createElement("h1", { className: "jgis-story-viewer-title" }, title),
6
- !isSpecta && storyType === 'guided' && (React.createElement(StoryNavBar, { onPrev: onPrev, onNext: onNext, hasPrev: hasPrev, hasNext: hasNext, isSpecta: isSpecta }))));
5
+ navSlot));
7
6
  }
8
7
  export default StoryTitleSection;
@@ -9,12 +9,12 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import { Slot } from '@radix-ui/react-slot';
12
+ import { Slot } from 'radix-ui';
13
13
  import * as React from 'react';
14
14
  import { cn } from './utils';
15
15
  const Button = React.forwardRef((_a, ref) => {
16
16
  var { variant, className, size, asChild = false } = _a, props = __rest(_a, ["variant", "className", "size", "asChild"]);
17
- const Comp = asChild ? Slot : 'button';
17
+ const Comp = asChild ? Slot.Root : 'button';
18
18
  return (React.createElement(Comp, Object.assign({ "data-size": size, "data-variant": variant, className: cn('jgis-button', className), ref: ref }, props)));
19
19
  });
20
20
  Button.displayName = 'Button';
@@ -1,4 +1,3 @@
1
- 'use client';
2
1
  var __rest = (this && this.__rest) || function (s, e) {
3
2
  var t = {};
4
3
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -1,4 +1,4 @@
1
- import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
1
+ import { Checkbox as CheckboxPrimitive } from 'radix-ui';
2
2
  import * as React from 'react';
3
3
  declare const Checkbox: React.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
4
4
  export default Checkbox;
@@ -9,8 +9,8 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
13
12
  import { Check } from 'lucide-react';
13
+ import { Checkbox as CheckboxPrimitive } from 'radix-ui';
14
14
  import * as React from 'react';
15
15
  const Checkbox = React.forwardRef((_a, ref) => {
16
16
  var props = __rest(_a, []);
@@ -1,4 +1,4 @@
1
- import * as DialogPrimitive from '@radix-ui/react-dialog';
1
+ import { Dialog as DialogPrimitive } from 'radix-ui';
2
2
  import * as React from 'react';
3
3
  declare function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): React.JSX.Element;
4
4
  declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>): React.JSX.Element;
@@ -9,8 +9,8 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import * as DialogPrimitive from '@radix-ui/react-dialog';
13
12
  import { XIcon } from 'lucide-react';
13
+ import { Dialog as DialogPrimitive } from 'radix-ui';
14
14
  import * as React from 'react';
15
15
  import { cn } from './utils';
16
16
  function Dialog(_a) {
@@ -0,0 +1,13 @@
1
+ import * as React from 'react';
2
+ import { Drawer as DrawerPrimitive } from 'vaul';
3
+ declare function Drawer({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>): React.JSX.Element;
4
+ declare function DrawerTrigger({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Trigger>): React.JSX.Element;
5
+ declare function DrawerPortal({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Portal>): React.JSX.Element;
6
+ declare function DrawerClose({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Close>): React.JSX.Element;
7
+ declare function DrawerOverlay({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Overlay>): React.JSX.Element;
8
+ declare function DrawerContent({ className, children, ...props }: React.ComponentProps<typeof DrawerPrimitive.Content>): React.JSX.Element;
9
+ declare function DrawerHeader({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
10
+ declare function DrawerFooter({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
11
+ declare function DrawerTitle({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Title>): React.JSX.Element;
12
+ declare function DrawerDescription({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Description>): React.JSX.Element;
13
+ export { Drawer, DrawerPortal, DrawerOverlay, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription, };
@@ -0,0 +1,59 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import * as React from 'react';
13
+ import { Drawer as DrawerPrimitive } from 'vaul';
14
+ import { cn } from './utils';
15
+ function Drawer(_a) {
16
+ var props = __rest(_a, []);
17
+ return React.createElement(DrawerPrimitive.Root, Object.assign({ "data-slot": "drawer" }, props));
18
+ }
19
+ function DrawerTrigger(_a) {
20
+ var props = __rest(_a, []);
21
+ return React.createElement(DrawerPrimitive.Trigger, Object.assign({ "data-slot": "drawer-trigger" }, props));
22
+ }
23
+ function DrawerPortal(_a) {
24
+ var props = __rest(_a, []);
25
+ return React.createElement(DrawerPrimitive.Portal, Object.assign({ "data-slot": "drawer-portal" }, props));
26
+ }
27
+ function DrawerClose(_a) {
28
+ var props = __rest(_a, []);
29
+ return React.createElement(DrawerPrimitive.Close, Object.assign({ "data-slot": "drawer-close" }, props));
30
+ }
31
+ function DrawerOverlay(_a) {
32
+ var { className } = _a, props = __rest(_a, ["className"]);
33
+ return (React.createElement(DrawerPrimitive.Overlay, Object.assign({ "data-slot": "drawer-overlay", className: cn('jgis-drawer-overlay', className) }, props)));
34
+ }
35
+ function DrawerContent(_a) {
36
+ var { className, children } = _a, props = __rest(_a, ["className", "children"]);
37
+ return (React.createElement(DrawerPortal, { "data-slot": "drawer-portal" },
38
+ React.createElement(DrawerOverlay, null),
39
+ React.createElement(DrawerPrimitive.Content, Object.assign({ "data-slot": "drawer-content", className: cn('jgis-drawer-content', className) }, props),
40
+ React.createElement("div", { className: "jgis-drawer-handle" }),
41
+ children)));
42
+ }
43
+ function DrawerHeader(_a) {
44
+ var { className } = _a, props = __rest(_a, ["className"]);
45
+ return (React.createElement("div", Object.assign({ "data-slot": "drawer-header", className: cn('jgis-drawer-header', className) }, props)));
46
+ }
47
+ function DrawerFooter(_a) {
48
+ var { className } = _a, props = __rest(_a, ["className"]);
49
+ return (React.createElement("div", Object.assign({ "data-slot": "drawer-footer", className: cn('jgis-drawer-footer', className) }, props)));
50
+ }
51
+ function DrawerTitle(_a) {
52
+ var { className } = _a, props = __rest(_a, ["className"]);
53
+ return (React.createElement(DrawerPrimitive.Title, Object.assign({ "data-slot": "drawer-title", className: cn('jgis-drawer-title', className) }, props)));
54
+ }
55
+ function DrawerDescription(_a) {
56
+ var { className } = _a, props = __rest(_a, ["className"]);
57
+ return (React.createElement(DrawerPrimitive.Description, Object.assign({ "data-slot": "drawer-description", className: cn('jgis-drawer-description', className) }, props)));
58
+ }
59
+ export { Drawer, DrawerPortal, DrawerOverlay, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription, };
@@ -1,4 +1,4 @@
1
- import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
1
+ import { DropdownMenu as DropdownMenuPrimitive } from 'radix-ui';
2
2
  import * as React from 'react';
3
3
  declare const DropdownMenu: React.FC<DropdownMenuPrimitive.DropdownMenuProps>;
4
4
  declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
@@ -9,8 +9,8 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
13
12
  import { Check, ChevronRight, Circle } from 'lucide-react';
13
+ import { DropdownMenu as DropdownMenuPrimitive } from 'radix-ui';
14
14
  import * as React from 'react';
15
15
  const DropdownMenu = DropdownMenuPrimitive.Root;
16
16
  const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
@@ -1,4 +1,4 @@
1
- import * as PopoverPrimitive from '@radix-ui/react-popover';
1
+ import { Popover as PopoverPrimitive } from 'radix-ui';
2
2
  import * as React from 'react';
3
3
  declare const Popover: React.FC<React.ComponentProps<typeof PopoverPrimitive.Root>>;
4
4
  declare const PopoverTrigger: React.FC<React.ComponentProps<typeof PopoverPrimitive.Trigger>>;
@@ -9,7 +9,7 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import * as PopoverPrimitive from '@radix-ui/react-popover';
12
+ import { Popover as PopoverPrimitive } from 'radix-ui';
13
13
  import * as React from 'react';
14
14
  import { cn } from './utils';
15
15
  const Popover = (_a) => {
@@ -1,4 +1,4 @@
1
- import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
1
+ import { RadioGroup as RadioGroupPrimitive } from 'radix-ui';
2
2
  import * as React from 'react';
3
3
  declare function RadioGroup({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Root>): React.JSX.Element;
4
4
  declare function RadioGroupItem({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Item>): React.JSX.Element;
@@ -9,8 +9,8 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
13
12
  import { CircleIcon } from 'lucide-react';
13
+ import { RadioGroup as RadioGroupPrimitive } from 'radix-ui';
14
14
  import * as React from 'react';
15
15
  import { cn } from './utils';
16
16
  function RadioGroup(_a) {
@@ -0,0 +1,15 @@
1
+ import { Dialog as SheetPrimitive } from 'radix-ui';
2
+ import * as React from 'react';
3
+ declare function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>): React.JSX.Element;
4
+ declare function SheetTrigger({ ...props }: React.ComponentProps<typeof SheetPrimitive.Trigger>): React.JSX.Element;
5
+ declare function SheetClose({ ...props }: React.ComponentProps<typeof SheetPrimitive.Close>): React.JSX.Element;
6
+ declare function SheetContent({ className, children, side, showCloseButton, container, ...props }: React.ComponentProps<typeof SheetPrimitive.Content> & {
7
+ side?: 'top' | 'right' | 'bottom' | 'left';
8
+ showCloseButton?: boolean;
9
+ container: HTMLElement;
10
+ }): React.JSX.Element;
11
+ declare function SheetHeader({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
12
+ declare function SheetFooter({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
13
+ declare function SheetTitle({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Title>): React.JSX.Element;
14
+ declare function SheetDescription({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Description>): React.JSX.Element;
15
+ export { Sheet, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, };
@@ -0,0 +1,64 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { XIcon } from 'lucide-react';
13
+ import { Dialog as SheetPrimitive } from 'radix-ui';
14
+ import * as React from 'react';
15
+ import { Button } from './Button';
16
+ import { cn } from './utils';
17
+ function Sheet(_a) {
18
+ var props = __rest(_a, []);
19
+ return React.createElement(SheetPrimitive.Root, Object.assign({ "data-slot": "sheet" }, props));
20
+ }
21
+ function SheetTrigger(_a) {
22
+ var props = __rest(_a, []);
23
+ return React.createElement(SheetPrimitive.Trigger, Object.assign({ "data-slot": "sheet-trigger" }, props));
24
+ }
25
+ function SheetClose(_a) {
26
+ var props = __rest(_a, []);
27
+ return React.createElement(SheetPrimitive.Close, Object.assign({ "data-slot": "sheet-close" }, props));
28
+ }
29
+ function SheetPortal(_a) {
30
+ var props = __rest(_a, []);
31
+ return React.createElement(SheetPrimitive.Portal, Object.assign({ "data-slot": "sheet-portal" }, props));
32
+ }
33
+ function SheetOverlay(_a) {
34
+ var { className } = _a, props = __rest(_a, ["className"]);
35
+ return (React.createElement(SheetPrimitive.Overlay, Object.assign({ "data-slot": "sheet-overlay", className: cn('jgis-sheet-overlay', className) }, props)));
36
+ }
37
+ function SheetContent(_a) {
38
+ var { className, children, side = 'right', showCloseButton = true, container } = _a, props = __rest(_a, ["className", "children", "side", "showCloseButton", "container"]);
39
+ return (React.createElement(SheetPortal, null,
40
+ React.createElement(SheetOverlay, null),
41
+ React.createElement(SheetPrimitive.Content, Object.assign({ "data-slot": "sheet-content", "data-side": side, className: cn('jgis-sheet-content', className) }, props),
42
+ children,
43
+ showCloseButton && (React.createElement(SheetPrimitive.Close, { "data-slot": "sheet-close", asChild: true },
44
+ React.createElement(Button, { variant: "ghost", className: "jgis-sheet-close", size: "icon-sm" },
45
+ React.createElement(XIcon, null),
46
+ React.createElement("span", { className: "jgis-sr-only" }, "Close")))))));
47
+ }
48
+ function SheetHeader(_a) {
49
+ var { className } = _a, props = __rest(_a, ["className"]);
50
+ return (React.createElement("div", Object.assign({ "data-slot": "sheet-header", className: cn('jgis-sheet-header', className) }, props)));
51
+ }
52
+ function SheetFooter(_a) {
53
+ var { className } = _a, props = __rest(_a, ["className"]);
54
+ return (React.createElement("div", Object.assign({ "data-slot": "sheet-footer", className: cn('jgis-sheet-footer', className) }, props)));
55
+ }
56
+ function SheetTitle(_a) {
57
+ var { className } = _a, props = __rest(_a, ["className"]);
58
+ return (React.createElement(SheetPrimitive.Title, Object.assign({ "data-slot": "sheet-title", className: cn('jgis-sheet-title', className) }, props)));
59
+ }
60
+ function SheetDescription(_a) {
61
+ var { className } = _a, props = __rest(_a, ["className"]);
62
+ return (React.createElement(SheetPrimitive.Description, Object.assign({ "data-slot": "sheet-description", className: cn('jgis-sheet-description', className) }, props)));
63
+ }
64
+ export { Sheet, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, };
@@ -1,4 +1,4 @@
1
- import * as SwitchPrimitive from '@radix-ui/react-switch';
1
+ import { Switch as SwitchPrimitive } from 'radix-ui';
2
2
  import * as React from 'react';
3
3
  declare function Switch({ className, ...props }: React.ComponentProps<typeof SwitchPrimitive.Root>): React.JSX.Element;
4
4
  export { Switch };
@@ -9,7 +9,7 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import * as SwitchPrimitive from '@radix-ui/react-switch';
12
+ import { Switch as SwitchPrimitive } from 'radix-ui';
13
13
  import * as React from 'react';
14
14
  import { cn } from './utils';
15
15
  function Switch(_a) {
@@ -1,4 +1,4 @@
1
- import * as TabsPrimitive from '@radix-ui/react-tabs';
1
+ import { Tabs as TabsPrimitive } from 'radix-ui';
2
2
  import * as React from 'react';
3
3
  interface IPanelTabProps {
4
4
  className: string;
@@ -9,7 +9,7 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import * as TabsPrimitive from '@radix-ui/react-tabs';
12
+ import { Tabs as TabsPrimitive } from 'radix-ui';
13
13
  import * as React from 'react';
14
14
  import { cn } from './utils';
15
15
  const Tabs = (_a) => {
@@ -1,5 +1,5 @@
1
- import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
2
1
  import { type VariantProps } from 'class-variance-authority';
2
+ import { ToggleGroup as ToggleGroupPrimitive } from 'radix-ui';
3
3
  import * as React from 'react';
4
4
  declare const ToggleGroup: React.ForwardRefExoticComponent<((Omit<ToggleGroupPrimitive.ToggleGroupSingleProps & React.RefAttributes<HTMLDivElement>, "ref"> | Omit<ToggleGroupPrimitive.ToggleGroupMultipleProps & React.RefAttributes<HTMLDivElement>, "ref">) & VariantProps<(props?: ({
5
5
  variant?: "default" | "outline" | null | undefined;
@@ -9,8 +9,8 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
13
12
  import { cva } from 'class-variance-authority';
13
+ import { ToggleGroup as ToggleGroupPrimitive } from 'radix-ui';
14
14
  import * as React from 'react';
15
15
  import { cn } from './utils';
16
16
  const toggleVariants = cva('jgis-toggle', {
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Subscribes to a media query and returns whether it currently matches.
3
+ * Updates when the viewport changes (resize, orientation).
4
+ *
5
+ * @param query - Media query string (e.g. '(max-width: 768px)').
6
+ * @returns True if the query matches, false otherwise (and when window is unavailable).
7
+ */
8
+ declare function useMediaQuery(query: string): boolean;
9
+ export default useMediaQuery;