@lax-wp/design-system 0.1.0 → 0.1.1

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 (35) hide show
  1. package/README.md +526 -16
  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/pdf-viewer/PdfViewer.d.ts +45 -0
  8. package/dist/components/data-display/popper/Popper.d.ts +57 -0
  9. package/dist/components/data-display/status-color-mapping/StatusColorMapping.d.ts +29 -0
  10. package/dist/components/data-display/typography/Typography.d.ts +15 -0
  11. package/dist/components/feedback/toast/Toast.d.ts +29 -0
  12. package/dist/components/forms/checkbox/Checkbox.d.ts +55 -0
  13. package/dist/components/forms/color-picker/ColorPicker.d.ts +60 -0
  14. package/dist/components/forms/creatable-select/CreatableSelect.d.ts +92 -0
  15. package/dist/components/forms/currency-input/CurrencyInputField.d.ts +73 -0
  16. package/dist/components/forms/currency-input/currency.constant.d.ts +6 -0
  17. package/dist/components/forms/date-range/DateRange.d.ts +72 -0
  18. package/dist/components/forms/debounce-input/DebounceInputField.d.ts +76 -0
  19. package/dist/components/forms/input-field/InputField.d.ts +62 -0
  20. package/dist/components/forms/percentage-input/PercentageInputField.d.ts +75 -0
  21. package/dist/components/forms/text-field/TextField.d.ts +48 -0
  22. package/dist/components/forms/toggle/Toggle.d.ts +71 -0
  23. package/dist/components/tooltip/Tooltip.d.ts +13 -0
  24. package/dist/design-system.css +1 -0
  25. package/dist/hooks/useOutsideClick.d.ts +28 -0
  26. package/dist/hooks/usePythonSyntax.d.ts +28 -0
  27. package/dist/hooks/useTheme.d.ts +6 -0
  28. package/dist/index.d.ts +48 -0
  29. package/dist/index.es.js +25703 -4806
  30. package/dist/index.umd.js +225 -31
  31. package/dist/services/monacoManager.d.ts +28 -0
  32. package/dist/types/index.d.ts +66 -0
  33. package/dist/utils/messageConstants.d.ts +16 -0
  34. package/dist/utils/utilities.d.ts +13 -0
  35. package/package.json +40 -13
@@ -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,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,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,11 +1,18 @@
1
1
  {
2
2
  "name": "@lax-wp/design-system",
3
3
  "private": false,
4
- "version": "0.1.0",
4
+ "version": "0.1.1",
5
5
  "type": "module",
6
- "main": "dist/index.js",
7
- "module": "dist/index.js",
6
+ "main": "dist/index.umd.js",
7
+ "module": "dist/index.es.js",
8
8
  "types": "dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.es.js",
13
+ "require": "./dist/index.umd.js"
14
+ }
15
+ },
9
16
  "files": [
10
17
  "dist"
11
18
  ],
@@ -17,16 +24,33 @@
17
24
  ],
18
25
  "scripts": {
19
26
  "dev": "vite",
20
- "build": "tsc -b && vite build",
27
+ "build": "npm run build:types && vite build",
28
+ "build:types": "tsc src/index.ts --declaration --emitDeclarationOnly --outDir dist --jsx react-jsx --moduleResolution bundler --target ES2022 --module ESNext --skipLibCheck",
21
29
  "lint": "eslint .",
22
30
  "preview": "vite preview",
23
31
  "storybook": "storybook dev -p 6006",
24
32
  "build-storybook": "storybook build"
25
33
  },
26
34
  "dependencies": {
27
- "framer-motion": "^12.23.12",
28
- "react": "^19.1.1",
29
- "react-dom": "^19.1.1"
35
+ "@codeium/react-code-editor": "^1.0.12",
36
+ "@emotion/styled": "^11.14.1",
37
+ "@monaco-editor/react": "^4.6.0",
38
+ "@mui/icons-material": "^7.3.1",
39
+ "@storybook/addon-actions": "^9.0.8",
40
+ "antd": "^5.27.0",
41
+ "classnames": "^2.5.1",
42
+ "immer": "^10.1.1",
43
+ "lodash.debounce": "^4.0.8",
44
+ "react-full-screen": "^1.1.1",
45
+ "react-icons": "^5.5.0",
46
+ "react-popper-tooltip": "^4.4.2",
47
+ "react-select": "^5.10.2",
48
+ "react-toastify": "^10.0.6"
49
+ },
50
+ "peerDependencies": {
51
+ "framer-motion": "^10.0.0 || ^11.0.0 || ^12.0.0",
52
+ "react": "^18.2.0 || ^19.0.0",
53
+ "react-dom": "^18.2.0 || ^19.0.0"
30
54
  },
31
55
  "devDependencies": {
32
56
  "@chromatic-com/storybook": "^4.0.1",
@@ -35,22 +59,25 @@
35
59
  "@storybook/addon-docs": "^9.0.18",
36
60
  "@storybook/addon-vitest": "^9.0.18",
37
61
  "@storybook/react-vite": "^9.0.18",
38
- "@types/react": "^19.1.9",
39
- "@types/react-dom": "^19.1.7",
62
+ "@types/react": "^18.2.0",
63
+ "@types/react-dom": "^18.2.0",
40
64
  "@vitejs/plugin-react": "^4.6.0",
41
65
  "@vitest/browser": "^3.2.4",
42
66
  "@vitest/coverage-v8": "^3.2.4",
43
- "autoprefixer": "^10.4.21",
67
+ "autoprefixer": "^10.4.19",
44
68
  "eslint": "^9.30.1",
45
69
  "eslint-plugin-react-hooks": "^5.2.0",
46
70
  "eslint-plugin-react-refresh": "^0.4.20",
47
71
  "eslint-plugin-storybook": "^9.0.18",
72
+ "framer-motion": "^12.23.12",
48
73
  "globals": "^16.3.0",
49
74
  "playwright": "^1.54.1",
50
- "postcss": "^8.5.6",
75
+ "postcss": "^8.4.47",
76
+ "react": "^18.2.0",
77
+ "react-dom": "^18.2.0",
51
78
  "storybook": "^9.0.18",
52
- "tailwindcss": "^4.1.11",
53
- "typescript": "~5.8.3",
79
+ "tailwindcss": "^3.4.13",
80
+ "typescript": "^5.6.3",
54
81
  "typescript-eslint": "^8.35.1",
55
82
  "vite": "^7.0.4",
56
83
  "vitest": "^3.2.4"