giggles 0.3.6 → 0.3.7

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.
@@ -457,6 +457,7 @@ import { createContext as createContext4, useContext as useContext4 } from "reac
457
457
  import { jsx as jsx6 } from "react/jsx-runtime";
458
458
  var defaultTheme = {
459
459
  accentColor: "#6B9FD4",
460
+ borderColor: "#5C5C5C",
460
461
  selectedColor: "#8FBF7F",
461
462
  hintColor: "#8A8A8A",
462
463
  hintDimColor: "#5C5C5C",
package/dist/index.d.ts CHANGED
@@ -11,6 +11,7 @@ declare class GigglesError extends Error {
11
11
 
12
12
  type GigglesTheme = {
13
13
  accentColor: string;
14
+ borderColor: string;
14
15
  selectedColor: string;
15
16
  hintColor: string;
16
17
  hintDimColor: string;
package/dist/index.js CHANGED
@@ -16,7 +16,7 @@ import {
16
16
  useKeybindingRegistry,
17
17
  useKeybindings,
18
18
  useTheme
19
- } from "./chunk-FEQYHTG7.js";
19
+ } from "./chunk-X5PYVHXM.js";
20
20
 
21
21
  // src/core/GigglesProvider.tsx
22
22
  import { jsx } from "react/jsx-runtime";
@@ -159,4 +159,13 @@ type ViewportProps<T> = {
159
159
  };
160
160
  declare function Viewport<T>({ items, maxVisible, showLineNumbers, gap, paginatorStyle, render }: ViewportProps<T>): react_jsx_runtime.JSX.Element;
161
161
 
162
- export { Autocomplete, type AutocompleteRenderProps, CommandPalette, type CommandPaletteRenderProps, Confirm, MultiSelect, type MultiSelectRenderProps, Paginator, type PaginatorStyle, Select, type SelectOption, type SelectRenderProps, TextInput, type TextInputRenderProps, Viewport, type ViewportRenderProps, VirtualList, type VirtualListRenderProps };
162
+ type BorderStyle = 'single' | 'double' | 'round' | 'bold' | 'singleDouble' | 'doubleSingle' | 'classic' | 'arrow';
163
+ type ModalProps = {
164
+ children: React__default.ReactNode;
165
+ onClose: () => void;
166
+ title?: string;
167
+ borderStyle?: BorderStyle;
168
+ };
169
+ declare function Modal({ children, onClose, title, borderStyle }: ModalProps): react_jsx_runtime.JSX.Element;
170
+
171
+ export { Autocomplete, type AutocompleteRenderProps, CommandPalette, type CommandPaletteRenderProps, Confirm, Modal, MultiSelect, type MultiSelectRenderProps, Paginator, type PaginatorStyle, Select, type SelectOption, type SelectRenderProps, TextInput, type TextInputRenderProps, Viewport, type ViewportRenderProps, VirtualList, type VirtualListRenderProps };
package/dist/ui/index.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  useKeybindingRegistry,
6
6
  useKeybindings,
7
7
  useTheme
8
- } from "../chunk-FEQYHTG7.js";
8
+ } from "../chunk-X5PYVHXM.js";
9
9
 
10
10
  // src/ui/CommandPalette.tsx
11
11
  import { useState } from "react";
@@ -728,10 +728,39 @@ function Viewport({ items, maxVisible, showLineNumbers, gap, paginatorStyle, ren
728
728
  }
729
729
  );
730
730
  }
731
+
732
+ // src/ui/Modal.tsx
733
+ import { Box as Box7, Text as Text9 } from "ink";
734
+ import { jsx as jsx9, jsxs as jsxs10 } from "react/jsx-runtime";
735
+ function ModalInner({ children, onClose, title, borderStyle = "round" }) {
736
+ const focus = useFocus();
737
+ const theme = useTheme();
738
+ useKeybindings(focus, {
739
+ escape: onClose
740
+ });
741
+ return /* @__PURE__ */ jsxs10(
742
+ Box7,
743
+ {
744
+ flexDirection: "column",
745
+ alignSelf: "flex-start",
746
+ borderStyle,
747
+ borderColor: theme.borderColor,
748
+ paddingX: 1,
749
+ children: [
750
+ title != null && /* @__PURE__ */ jsx9(Text9, { bold: true, children: title }),
751
+ children
752
+ ]
753
+ }
754
+ );
755
+ }
756
+ function Modal({ children, onClose, title, borderStyle }) {
757
+ return /* @__PURE__ */ jsx9(FocusTrap, { children: /* @__PURE__ */ jsx9(ModalInner, { onClose, title, borderStyle, children }) });
758
+ }
731
759
  export {
732
760
  Autocomplete,
733
761
  CommandPalette,
734
762
  Confirm,
763
+ Modal,
735
764
  MultiSelect,
736
765
  Paginator,
737
766
  Select,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "giggles",
3
- "version": "0.3.6",
3
+ "version": "0.3.7",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",