@industry-theme/theme-editor-panel 0.1.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Your Name
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,110 @@
1
+ # Industry Theme Editor Panel
2
+
3
+ A panel extension for customizing the Industry theme colors and appearance in real-time. This panel is built with the `@principal-ade/panel-framework-core` and follows the [Panel Extension Store Specification V2](https://github.com/principal-ade/panel-framework/blob/main/PANEL_EXTENSION_STORE_SPECIFICATION_V2.md).
4
+
5
+ ## Features
6
+
7
+ - **Live Color Customization**: Modify theme colors across different categories in real-time
8
+ - **Interactive Color Picker**: Visual hex color picker with manual input support
9
+ - **Organized by Category**: Colors grouped into Primary, Background, Text, UI, and Status categories
10
+ - **Reset Functionality**: Individual color reset buttons to revert to defaults
11
+ - **Industry Theme Integration**: Seamlessly integrates with `@principal-ade/industry-theme`
12
+
13
+ ## Installation
14
+
15
+ ```bash
16
+ # Install dependencies
17
+ bun install
18
+
19
+ # Build the panel
20
+ bun run build
21
+
22
+ # Development mode (watch for changes)
23
+ bun run dev
24
+ ```
25
+
26
+ ## Development
27
+
28
+ ### Project Structure
29
+
30
+ ```
31
+ src/
32
+ ├── panels/
33
+ │ └── ThemeEditorPanel.tsx # Main theme editor component
34
+ ├── components/
35
+ │ └── ColorPickerInput.tsx # Color picker input component
36
+ ├── types/
37
+ │ └── index.ts # TypeScript type definitions
38
+ └── index.tsx # Panel exports and lifecycle hooks
39
+ ```
40
+
41
+ ### Color Categories
42
+
43
+ The theme editor organizes colors into the following categories:
44
+
45
+ - **Primary Colors**: Primary, Secondary, Accent
46
+ - **Background Colors**: Background, Background Light/Dark, Secondary, Tertiary
47
+ - **Text Colors**: Text, Text Secondary, Text Tertiary
48
+ - **UI Colors**: Border, Border Light/Dark
49
+ - **Status Colors**: Success, Warning, Error, Info
50
+
51
+ ### Running Storybook
52
+
53
+ ```bash
54
+ # Start Storybook for interactive development
55
+ bun run storybook
56
+
57
+ # Build Storybook for deployment
58
+ bun run build-storybook
59
+ ```
60
+
61
+ ## Usage
62
+
63
+ Once installed in a host application, the Theme Editor panel will be available with:
64
+
65
+ - **Panel ID**: `industry-theme.theme-editor`
66
+ - **Display Name**: Theme Editor
67
+ - **Icon**: 🎨
68
+
69
+ ## Dependencies
70
+
71
+ - **react-colorful**: Hex color picker component
72
+ - **lucide-react**: Icon library
73
+ - **@principal-ade/industry-theme**: Industry theme package
74
+ - **@principal-ade/panel-framework-core**: Panel framework integration
75
+
76
+ ## Building
77
+
78
+ ```bash
79
+ # Clean and build
80
+ bun run build
81
+
82
+ # Type checking
83
+ bun run typecheck
84
+
85
+ # Linting
86
+ bun run lint
87
+ bun run lint:fix
88
+
89
+ # Formatting
90
+ bun run format
91
+ bun run format:check
92
+ ```
93
+
94
+ ## Publishing
95
+
96
+ ```bash
97
+ # Build the package
98
+ bun run build
99
+
100
+ # Publish to NPM
101
+ npm publish --access public
102
+ ```
103
+
104
+ ## License
105
+
106
+ MIT © Principal ADE
107
+
108
+ ## Contributing
109
+
110
+ Contributions welcome! Please read the contributing guidelines first.
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ interface ColorPickerInputProps {
3
+ label: string;
4
+ value: string;
5
+ onChange: (color: string) => void;
6
+ onReset?: () => void;
7
+ defaultValue?: string;
8
+ }
9
+ export declare const ColorPickerInput: React.FC<ColorPickerInputProps>;
10
+ export {};
11
+ //# sourceMappingURL=ColorPickerInput.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColorPickerInput.d.ts","sourceRoot":"","sources":["../../src/components/ColorPickerInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAK3D,UAAU,qBAAqB;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CA8K5D,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { PanelDefinition } from './types';
2
+ /**
3
+ * Export array of panel definitions.
4
+ * This is the required export for panel extensions.
5
+ */
6
+ export declare const panels: PanelDefinition[];
7
+ /**
8
+ * Optional: Called once when the entire package is loaded.
9
+ * Use this for package-level initialization.
10
+ */
11
+ export declare const onPackageLoad: () => Promise<void>;
12
+ /**
13
+ * Optional: Called once when the package is unloaded.
14
+ * Use this for package-level cleanup.
15
+ */
16
+ export declare const onPackageUnload: () => Promise<void>;
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAqB,MAAM,SAAS,CAAC;AAElE;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE,eAAe,EA4BnC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,qBAGzB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,qBAG3B,CAAC"}
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ import type { PanelComponentProps, PanelContextValue, PanelActions, PanelEventEmitter } from '../types';
3
+ /**
4
+ * Mock Panel Context for Storybook
5
+ */
6
+ export declare const createMockContext: (overrides?: Partial<PanelContextValue>) => PanelContextValue;
7
+ /**
8
+ * Mock Panel Actions for Storybook
9
+ */
10
+ export declare const createMockActions: (overrides?: Partial<PanelActions>) => PanelActions;
11
+ /**
12
+ * Mock Event Emitter for Storybook
13
+ */
14
+ export declare const createMockEvents: () => PanelEventEmitter;
15
+ /**
16
+ * Mock Panel Props Provider
17
+ * Wraps components with mock context for Storybook
18
+ */
19
+ export declare const MockPanelProvider: React.FC<{
20
+ children: (props: PanelComponentProps) => React.ReactNode;
21
+ contextOverrides?: Partial<PanelContextValue>;
22
+ actionsOverrides?: Partial<PanelActions>;
23
+ }>;
24
+ //# sourceMappingURL=panelContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"panelContext.d.ts","sourceRoot":"","sources":["../../src/mocks/panelContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EACV,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,EACZ,iBAAiB,EAIlB,MAAM,UAAU,CAAC;AA+BlB;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAC5B,YAAY,OAAO,CAAC,iBAAiB,CAAC,KACrC,iBAiHF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAC5B,YAAY,OAAO,CAAC,YAAY,CAAC,KAChC,YAkBD,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,gBAAgB,QAAO,iBAwCnC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC;IACvC,QAAQ,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,KAAK,CAAC,SAAS,CAAC;IAC1D,gBAAgB,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC9C,gBAAgB,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;CAC1C,CAMA,CAAC"}
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import type { PanelComponentProps } from '../types';
3
+ /**
4
+ * ThemeEditorPanel - A panel for customizing the Industry theme colors.
5
+ *
6
+ * This panel allows users to:
7
+ * - Customize theme colors across different categories
8
+ * - Preview changes in real-time
9
+ * - Reset individual colors to defaults
10
+ * - Save theme customizations
11
+ */
12
+ export declare const ThemeEditorPanel: React.FC<PanelComponentProps>;
13
+ //# sourceMappingURL=ThemeEditorPanel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThemeEditorPanel.d.ts","sourceRoot":"","sources":["../../src/panels/ThemeEditorPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAgQpD;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAM1D,CAAC"}
@@ -0,0 +1,60 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ /**
3
+ * ThemeEditorPanel allows users to customize the Industry theme colors.
4
+ * It provides an interactive interface for modifying theme colors across
5
+ * different categories including primary, background, text, UI, and status colors.
6
+ */
7
+ declare const meta: {
8
+ title: string;
9
+ component: import("react").FC<import("@principal-ade/panel-framework-core").PanelComponentProps>;
10
+ parameters: {
11
+ layout: string;
12
+ docs: {
13
+ description: {
14
+ component: string;
15
+ };
16
+ };
17
+ };
18
+ tags: string[];
19
+ decorators: ((Story: import("@storybook/core/csf").PartialStoryFn<import("@storybook/react").ReactRenderer, {
20
+ context: import("@principal-ade/panel-framework-core").PanelContextValue;
21
+ actions: import("@principal-ade/panel-framework-core").PanelActions;
22
+ events: import("@principal-ade/panel-framework-core").PanelEventEmitter;
23
+ }>) => import("react/jsx-runtime").JSX.Element)[];
24
+ args: {
25
+ context: import("@principal-ade/panel-framework-core").PanelContextValue;
26
+ actions: import("@principal-ade/panel-framework-core").PanelActions;
27
+ events: import("@principal-ade/panel-framework-core").PanelEventEmitter;
28
+ };
29
+ };
30
+ export default meta;
31
+ type Story = StoryObj<typeof meta>;
32
+ /**
33
+ * Default theme editor view with all color categories
34
+ */
35
+ export declare const Default: Story;
36
+ /**
37
+ * Theme editor in a light theme context
38
+ */
39
+ export declare const LightTheme: Story;
40
+ /**
41
+ * Compact view - ideal for smaller viewports
42
+ */
43
+ export declare const CompactView: Story;
44
+ /**
45
+ * Full height view - typical panel layout
46
+ */
47
+ export declare const FullHeight: Story;
48
+ /**
49
+ * Theme editor with custom repository context
50
+ */
51
+ export declare const WithRepository: Story;
52
+ /**
53
+ * Workspace-only context (no repository)
54
+ */
55
+ export declare const WorkspaceOnly: Story;
56
+ /**
57
+ * Interactive demo with custom action handlers
58
+ */
59
+ export declare const Interactive: Story;
60
+ //# sourceMappingURL=ThemeEditorPanel.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThemeEditorPanel.stories.d.ts","sourceRoot":"","sources":["../../src/panels/ThemeEditorPanel.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AASvD;;;;GAIG;AACH,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;CAyB+B,CAAC;AAE1C,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,KAQxB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,KAQzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,KAQxB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,KAsB5B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,KAgB3B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,KAazB,CAAC"}