@gofreego/tsutils 0.1.8 → 0.1.10

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/index.d.mts CHANGED
@@ -1,5 +1,6 @@
1
1
  import React, { ReactNode, CSSProperties } from 'react';
2
2
  import { AlertColor, IconButtonProps } from '@mui/material';
3
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
4
  import { Highlighter } from 'shiki';
4
5
 
5
6
  /**
@@ -193,6 +194,18 @@ declare const NotificationProvider: React.FC<NotificationProviderProps>;
193
194
  */
194
195
  declare const useNotification: () => NotificationContextType;
195
196
 
197
+ interface ConfirmDialogProps {
198
+ open: boolean;
199
+ title: string;
200
+ message: string;
201
+ confirmText?: string;
202
+ cancelText?: string;
203
+ confirmColor?: 'primary' | 'error' | 'warning' | 'success';
204
+ onConfirm: () => void;
205
+ onCancel: () => void;
206
+ }
207
+ declare const ConfirmDialog: ({ open, title, message, confirmText, cancelText, confirmColor, onConfirm, onCancel, }: ConfirmDialogProps) => react_jsx_runtime.JSX.Element;
208
+
196
209
  /**
197
210
  * Theme mode options
198
211
  * - 'light': Always use light theme
@@ -637,4 +650,4 @@ declare class PermissionManager {
637
650
  static hasPermission(permission: string): boolean;
638
651
  }
639
652
 
640
- export { type AuthContextType, AuthProvider, type AuthProviderProps, HttpClient, type HttpClientConfig, type HttpResponse, LocalStorage, type MenuItem, type Notification, type NotificationContextType, NotificationProvider, type NotificationProviderProps, PermissionManager, ReadmeViewer, type RequestConfig, type ResolvedThemeMode, SidebarLayout, type SidebarLayoutProps, type Theme, type ThemeContextValue, type ThemeMode, ThemeProvider, ThemeToggle, borderRadius, cn, darkTheme, debounce, elevation, fontSize, fontWeight, formatDate, getHighlighter, lightTheme, lineHeight, spacing, throttle, tokens, transition, useAuth, useNotification, useTheme, zIndex };
653
+ export { type AuthContextType, AuthProvider, type AuthProviderProps, ConfirmDialog, type ConfirmDialogProps, HttpClient, type HttpClientConfig, type HttpResponse, LocalStorage, type MenuItem, type Notification, type NotificationContextType, NotificationProvider, type NotificationProviderProps, PermissionManager, ReadmeViewer, type RequestConfig, type ResolvedThemeMode, SidebarLayout, type SidebarLayoutProps, type Theme, type ThemeContextValue, type ThemeMode, ThemeProvider, ThemeToggle, borderRadius, cn, darkTheme, debounce, elevation, fontSize, fontWeight, formatDate, getHighlighter, lightTheme, lineHeight, spacing, throttle, tokens, transition, useAuth, useNotification, useTheme, zIndex };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import React, { ReactNode, CSSProperties } from 'react';
2
2
  import { AlertColor, IconButtonProps } from '@mui/material';
3
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
4
  import { Highlighter } from 'shiki';
4
5
 
5
6
  /**
@@ -193,6 +194,18 @@ declare const NotificationProvider: React.FC<NotificationProviderProps>;
193
194
  */
194
195
  declare const useNotification: () => NotificationContextType;
195
196
 
197
+ interface ConfirmDialogProps {
198
+ open: boolean;
199
+ title: string;
200
+ message: string;
201
+ confirmText?: string;
202
+ cancelText?: string;
203
+ confirmColor?: 'primary' | 'error' | 'warning' | 'success';
204
+ onConfirm: () => void;
205
+ onCancel: () => void;
206
+ }
207
+ declare const ConfirmDialog: ({ open, title, message, confirmText, cancelText, confirmColor, onConfirm, onCancel, }: ConfirmDialogProps) => react_jsx_runtime.JSX.Element;
208
+
196
209
  /**
197
210
  * Theme mode options
198
211
  * - 'light': Always use light theme
@@ -637,4 +650,4 @@ declare class PermissionManager {
637
650
  static hasPermission(permission: string): boolean;
638
651
  }
639
652
 
640
- export { type AuthContextType, AuthProvider, type AuthProviderProps, HttpClient, type HttpClientConfig, type HttpResponse, LocalStorage, type MenuItem, type Notification, type NotificationContextType, NotificationProvider, type NotificationProviderProps, PermissionManager, ReadmeViewer, type RequestConfig, type ResolvedThemeMode, SidebarLayout, type SidebarLayoutProps, type Theme, type ThemeContextValue, type ThemeMode, ThemeProvider, ThemeToggle, borderRadius, cn, darkTheme, debounce, elevation, fontSize, fontWeight, formatDate, getHighlighter, lightTheme, lineHeight, spacing, throttle, tokens, transition, useAuth, useNotification, useTheme, zIndex };
653
+ export { type AuthContextType, AuthProvider, type AuthProviderProps, ConfirmDialog, type ConfirmDialogProps, HttpClient, type HttpClientConfig, type HttpResponse, LocalStorage, type MenuItem, type Notification, type NotificationContextType, NotificationProvider, type NotificationProviderProps, PermissionManager, ReadmeViewer, type RequestConfig, type ResolvedThemeMode, SidebarLayout, type SidebarLayoutProps, type Theme, type ThemeContextValue, type ThemeMode, ThemeProvider, ThemeToggle, borderRadius, cn, darkTheme, debounce, elevation, fontSize, fontWeight, formatDate, getHighlighter, lightTheme, lineHeight, spacing, throttle, tokens, transition, useAuth, useNotification, useTheme, zIndex };
package/dist/index.js CHANGED
@@ -10,6 +10,7 @@ var remarkGfm = require('remark-gfm');
10
10
  var ContentCopyIcon = require('@mui/icons-material/ContentCopy');
11
11
  var CheckIcon = require('@mui/icons-material/Check');
12
12
  var shiki = require('shiki');
13
+ var WarningAmberIcon = require('@mui/icons-material/WarningAmber');
13
14
 
14
15
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
15
16
 
@@ -17,6 +18,7 @@ var ReactMarkdown__default = /*#__PURE__*/_interopDefault(ReactMarkdown);
17
18
  var remarkGfm__default = /*#__PURE__*/_interopDefault(remarkGfm);
18
19
  var ContentCopyIcon__default = /*#__PURE__*/_interopDefault(ContentCopyIcon);
19
20
  var CheckIcon__default = /*#__PURE__*/_interopDefault(CheckIcon);
21
+ var WarningAmberIcon__default = /*#__PURE__*/_interopDefault(WarningAmberIcon);
20
22
 
21
23
  var __defProp = Object.defineProperty;
22
24
  var __export = (target, all) => {
@@ -572,6 +574,28 @@ var useNotification = () => {
572
574
  }
573
575
  return context;
574
576
  };
577
+ var ConfirmDialog = ({
578
+ open,
579
+ title,
580
+ message,
581
+ confirmText = "Confirm",
582
+ cancelText = "Cancel",
583
+ confirmColor = "primary",
584
+ onConfirm,
585
+ onCancel
586
+ }) => {
587
+ return /* @__PURE__ */ jsxRuntime.jsxs(material.Dialog, { open, onClose: onCancel, maxWidth: "xs", fullWidth: true, children: [
588
+ /* @__PURE__ */ jsxRuntime.jsx(material.DialogTitle, { children: /* @__PURE__ */ jsxRuntime.jsxs(material.Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
589
+ /* @__PURE__ */ jsxRuntime.jsx(WarningAmberIcon__default.default, { color: confirmColor }),
590
+ title
591
+ ] }) }),
592
+ /* @__PURE__ */ jsxRuntime.jsx(material.DialogContent, { children: /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "body1", children: message }) }),
593
+ /* @__PURE__ */ jsxRuntime.jsxs(material.DialogActions, { children: [
594
+ /* @__PURE__ */ jsxRuntime.jsx(material.Button, { onClick: onCancel, variant: "outlined", children: cancelText }),
595
+ /* @__PURE__ */ jsxRuntime.jsx(material.Button, { onClick: onConfirm, variant: "contained", color: confirmColor, autoFocus: true, children: confirmText })
596
+ ] })
597
+ ] });
598
+ };
575
599
 
576
600
  // src/theme/tokens.ts
577
601
  var tokens_exports = {};
@@ -740,12 +764,12 @@ var lightTheme = {
740
764
  var darkTheme = {
741
765
  colors: {
742
766
  // Primary - Vibrant Indigo (Striking on VSCode Black)
743
- primary: "#818cf8",
767
+ primary: "#a5b4fc",
768
+ // Indigo 300 (lighter for better dark mode visibility)
769
+ primaryHover: "#818cf8",
744
770
  // Indigo 400
745
- primaryHover: "#6366f1",
771
+ primaryActive: "#6366f1",
746
772
  // Indigo 500
747
- primaryActive: "#4f46e5",
748
- // Indigo 600
749
773
  // Secondary - VSCode Gray
750
774
  secondary: "#858585",
751
775
  secondaryHover: "#a6a6a6",
@@ -786,7 +810,7 @@ var darkTheme = {
786
810
  border: "#3c3c3c",
787
811
  // VSCode borders
788
812
  borderHover: "#444444",
789
- borderFocus: "#818cf8",
813
+ borderFocus: "#a5b4fc",
790
814
  // Focus border
791
815
  // Divider
792
816
  divider: "#333333",
@@ -1373,6 +1397,7 @@ var PermissionManager = class {
1373
1397
  PermissionManager.cachedPermissions = null;
1374
1398
 
1375
1399
  exports.AuthProvider = AuthProvider;
1400
+ exports.ConfirmDialog = ConfirmDialog;
1376
1401
  exports.HttpClient = HttpClient;
1377
1402
  exports.LocalStorage = LocalStorage;
1378
1403
  exports.NotificationProvider = NotificationProvider;