@lax-wp/design-system 0.2.6 → 0.2.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.
Files changed (49) hide show
  1. package/dist/components/buttons/option-button/OptionButton.d.ts +79 -0
  2. package/dist/components/data-display/badge/Badge.d.ts +44 -0
  3. package/dist/components/data-display/banner/Banner.d.ts +41 -0
  4. package/dist/components/data-display/code-editor/CodeEditor.d.ts +4 -0
  5. package/dist/components/data-display/code-editor/JsonGrid.d.ts +14 -0
  6. package/dist/components/data-display/code-editor/Tabs.d.ts +12 -0
  7. package/dist/components/data-display/diff-viewer/DiffViewer.d.ts +64 -0
  8. package/dist/components/data-display/label/Label.d.ts +10 -0
  9. package/dist/components/data-display/label-value/LabelValue.d.ts +132 -0
  10. package/dist/components/data-display/modal/Modal.d.ts +77 -0
  11. package/dist/components/data-display/pdf-viewer/PdfViewer.d.ts +45 -0
  12. package/dist/components/data-display/popper/Popper.d.ts +57 -0
  13. package/dist/components/data-display/resizable-sidebar/ResizableSidebar.d.ts +54 -0
  14. package/dist/components/data-display/status-color-mapping/StatusColorMapping.d.ts +29 -0
  15. package/dist/components/data-display/tag/Tag.d.ts +53 -0
  16. package/dist/components/data-display/typography/Typography.d.ts +15 -0
  17. package/dist/components/feedback/toast/Toast.d.ts +29 -0
  18. package/dist/components/floating-bar/FloatingBar.d.ts +147 -0
  19. package/dist/components/forms/checkbox/Checkbox.d.ts +55 -0
  20. package/dist/components/forms/color-picker/ColorPicker.d.ts +60 -0
  21. package/dist/components/forms/creatable-select/CreatableSelect.d.ts +92 -0
  22. package/dist/components/forms/currency-input/CurrencyInputField.d.ts +73 -0
  23. package/dist/components/forms/currency-input/currency.constant.d.ts +12 -0
  24. package/dist/components/forms/date-range/DateRange.d.ts +72 -0
  25. package/dist/components/forms/debounce-input/DebounceInputField.d.ts +76 -0
  26. package/dist/components/forms/file-upload/FileUpload.d.ts +81 -0
  27. package/dist/components/forms/input-field/InputField.d.ts +62 -0
  28. package/dist/components/forms/multi-file-upload/MultiFileUpload.d.ts +78 -0
  29. package/dist/components/forms/percentage-input/PercentageInputField.d.ts +75 -0
  30. package/dist/components/forms/text-field/TextField.d.ts +48 -0
  31. package/dist/components/forms/toggle/Toggle.d.ts +71 -0
  32. package/dist/components/icons/CloseIcon.d.ts +16 -0
  33. package/dist/components/icons/HelpIcon.d.ts +6 -0
  34. package/dist/components/icons/SearchIcon.d.ts +6 -0
  35. package/dist/components/tooltip/Tooltip.d.ts +8 -0
  36. package/dist/constants/colors.d.ts +263 -0
  37. package/dist/hooks/useOutsideClick.d.ts +28 -0
  38. package/dist/hooks/usePythonSyntax.d.ts +28 -0
  39. package/dist/hooks/useTheme.d.ts +6 -0
  40. package/dist/index.d.ts +67 -0
  41. package/dist/index.es.js +2834 -2804
  42. package/dist/index.umd.js +47 -47
  43. package/dist/services/monacoManager.d.ts +28 -0
  44. package/dist/types/index.d.ts +66 -0
  45. package/dist/utils/formatters.d.ts +24 -0
  46. package/dist/utils/messageConstants.d.ts +16 -0
  47. package/dist/utils/tagUtils.d.ts +12 -0
  48. package/dist/utils/utilities.d.ts +13 -0
  49. package/package.json +1 -1
@@ -0,0 +1,28 @@
1
+ import { type Monaco } from '@monaco-editor/react';
2
+ declare class MonacoManager {
3
+ private static instance;
4
+ private monaco;
5
+ private initialized;
6
+ private initializationPromise;
7
+ static getInstance(): MonacoManager;
8
+ initialize(): Promise<Monaco>;
9
+ private performInitialization;
10
+ getMonaco(): Monaco | null;
11
+ isInitialized(): boolean;
12
+ /**
13
+ * Safely get an editor instance by index
14
+ */
15
+ getEditorInstance(index?: number): any;
16
+ /**
17
+ * Get the first available editor instance
18
+ */
19
+ getFirstEditorInstance(): Monaco | null;
20
+ /**
21
+ * Safely dispose of disposables with error handling
22
+ */
23
+ static safeDispose(disposables: Array<{
24
+ dispose: () => void;
25
+ } | null | undefined>): void;
26
+ }
27
+ export declare const monacoManager: MonacoManager;
28
+ export type { Monaco };
@@ -0,0 +1,66 @@
1
+ export type JsonValue = string | number | boolean | null | JsonObject | JsonArray;
2
+ export type JsonObject = {
3
+ [key: string]: JsonValue;
4
+ };
5
+ export type JsonArray = JsonValue[];
6
+ export interface Tab<T extends string> {
7
+ name: T;
8
+ is_default: boolean;
9
+ is_hidden: boolean;
10
+ is_pinned: boolean;
11
+ }
12
+ export interface CodeEditorProps {
13
+ value: string;
14
+ onChange?: (value: string) => void;
15
+ withFullScreen?: boolean;
16
+ withTheme?: boolean;
17
+ isEditMode?: boolean;
18
+ height?: string;
19
+ language?: 'json' | 'python';
20
+ monacoEditor?: any;
21
+ setIsDisableSave?: (flag: boolean) => void;
22
+ isShowCopy?: boolean;
23
+ isShowDownload?: boolean;
24
+ withJsonGrid?: boolean;
25
+ }
26
+ export interface ThemeContextType {
27
+ theme: 'light' | 'dark';
28
+ editorTheme: 'vs' | 'vs-dark';
29
+ setEditorTheme: (theme: 'vs' | 'vs-dark') => void;
30
+ }
31
+ export interface UsePythonSyntaxProps {
32
+ monacoEditor: any;
33
+ currentEditorModel: any;
34
+ code: string;
35
+ setCode: (code: string) => void;
36
+ enable: boolean;
37
+ }
38
+ export interface PythonError {
39
+ message: string;
40
+ line?: number;
41
+ column?: number;
42
+ }
43
+ export interface JsonGridContextType {
44
+ allExpanded: boolean;
45
+ toggleAll: () => void;
46
+ isEditMode: boolean;
47
+ isDarkMode: boolean;
48
+ selectedPaths: string[];
49
+ setSelectedPaths: (paths: string[]) => void;
50
+ selectedTopLevelPaths: string[];
51
+ setSelectedTopLevelPaths: (paths: string[]) => void;
52
+ selectedPathModification: string | null;
53
+ setSelectedPathModification: (path: string | null) => void;
54
+ selectedPathForEdit: string | null;
55
+ setSelectedPathForEdit: (path: string | null) => void;
56
+ jsonData: JsonObject | JsonArray;
57
+ setJsonData: (data: JsonObject | JsonArray) => void;
58
+ error: string | null;
59
+ setError: (error: string | null) => void;
60
+ handleDelete: (paths: string[]) => void;
61
+ handleDuplicate: (paths: string[]) => void;
62
+ handleCopy: (paths: string[]) => Promise<boolean>;
63
+ handleAddKey: (path: string, key: string, value: JsonValue | undefined) => Promise<void>;
64
+ setIsAddKeyModalOpen: (open: boolean) => void;
65
+ isAddKeyModalOpen: boolean;
66
+ }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Format a boolean value to display text
3
+ */
4
+ export declare const formatBooleanValue: (value: any) => string;
5
+ /**
6
+ * Format a currency value
7
+ */
8
+ export declare const formatCurrency: (value: any, currencyCode?: string) => string;
9
+ /**
10
+ * Format a date value
11
+ */
12
+ export declare const formatDate: (date?: string, config?: {
13
+ format?: string;
14
+ timezone?: string;
15
+ relative?: boolean;
16
+ withTime?: boolean;
17
+ fallback?: string;
18
+ skipTimezone?: boolean;
19
+ onlyTime?: boolean;
20
+ }) => string;
21
+ /**
22
+ * Check if a value is a valid ISO date string
23
+ */
24
+ export declare const isISODateString: (value: string) => boolean;
@@ -0,0 +1,16 @@
1
+ export declare const systemMessages: {
2
+ createSuccess: (value: string) => string;
3
+ createFailure: (value: string) => string;
4
+ updateSuccess: (value: string) => string;
5
+ updateFailure: (value: string) => string;
6
+ copySuccess: (value: string) => string;
7
+ copyFailure: (value: string) => string;
8
+ copyToClipboard: (value: string) => string;
9
+ deleteSuccess: (value: string) => string;
10
+ deleteFailure: (value: string) => string;
11
+ errorMessage: string;
12
+ requiredFieldError: string;
13
+ noItemSelected: string;
14
+ invalidFileType: string;
15
+ formatFailed: string;
16
+ };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Generate a consistent hash color from a string
3
+ */
4
+ export declare const getHashColor: (str: string) => string;
5
+ /**
6
+ * Lighten a hex color by a percentage
7
+ */
8
+ export declare const getLighterColor: (hex: string, percent?: number) => string;
9
+ /**
10
+ * Darken a hex color by a percentage
11
+ */
12
+ export declare const getDarkerColor: (hex: string, percent?: number) => string;
@@ -0,0 +1,13 @@
1
+ import { type JsonValue } from '../types';
2
+ /**
3
+ * Parse JSON string safely
4
+ */
5
+ export declare const parseJson: (value: string) => JsonValue;
6
+ /**
7
+ * Filter top level paths from an array of paths
8
+ */
9
+ export declare const filterTopLevelPaths: (paths: string[]) => string[];
10
+ /**
11
+ * Generate a random hex string
12
+ */
13
+ export declare const randomHexString: (length: number) => string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lax-wp/design-system",
3
3
  "private": false,
4
- "version": "0.2.6",
4
+ "version": "0.2.7",
5
5
  "type": "module",
6
6
  "main": "dist/index.umd.js",
7
7
  "module": "dist/index.es.js",