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.
- package/dist/{chunk-FEQYHTG7.js → chunk-X5PYVHXM.js} +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/ui/index.d.ts +10 -1
- package/dist/ui/index.js +30 -1
- package/package.json +1 -1
|
@@ -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
package/dist/index.js
CHANGED
package/dist/ui/index.d.ts
CHANGED
|
@@ -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
|
-
|
|
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-
|
|
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,
|