@electroplix/components 0.0.2 → 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/dist/README.md +111 -2
- package/dist/index.esm.js +249 -4366
- package/dist/src/index.d.ts +5 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/lib/Navbar.d.ts +3 -21
- package/dist/src/lib/Navbar.d.ts.map +1 -1
- package/dist/src/lib/config.d.ts +36 -0
- package/dist/src/lib/config.d.ts.map +1 -0
- package/dist/src/lib/icons.d.ts +10 -0
- package/dist/src/lib/icons.d.ts.map +1 -0
- package/dist/src/lib/provider.d.ts +38 -0
- package/dist/src/lib/provider.d.ts.map +1 -0
- package/dist/src/lib/types.d.ts +66 -0
- package/dist/src/lib/types.d.ts.map +1 -0
- package/package.json +25 -4
- package/dist/src/lib/components.d.ts +0 -3
- package/dist/src/lib/components.d.ts.map +0 -1
package/dist/README.md
CHANGED
|
@@ -1,5 +1,114 @@
|
|
|
1
1
|
# @electroplix/components
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Parametric, config-driven React UI components.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @electroplix/components
|
|
9
|
+
# or
|
|
10
|
+
pnpm add @electroplix/components
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
> **Peer dependencies:** `react >=18` and `react-dom >=18`.
|
|
14
|
+
|
|
15
|
+
## Quick start
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import { Navbar } from "@electroplix/components";
|
|
19
|
+
|
|
20
|
+
export default function Page() {
|
|
21
|
+
return (
|
|
22
|
+
<Navbar
|
|
23
|
+
logoText="MyBrand"
|
|
24
|
+
links={[
|
|
25
|
+
{ label: "Home", href: "/" },
|
|
26
|
+
{ label: "Docs", href: "/docs" },
|
|
27
|
+
]}
|
|
28
|
+
ctaText="Sign Up"
|
|
29
|
+
/>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Global configuration
|
|
35
|
+
|
|
36
|
+
Create a config file and wrap your app with `ElectroplixProvider` to set
|
|
37
|
+
style defaults for **every** component instance:
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
// electroplix.config.ts
|
|
41
|
+
import { defineConfig } from "@electroplix/components";
|
|
42
|
+
|
|
43
|
+
export default defineConfig({
|
|
44
|
+
navbar: {
|
|
45
|
+
bgColor: "#22223B",
|
|
46
|
+
textColor: "#F2E9E4",
|
|
47
|
+
accentColor: "#C9ADA7",
|
|
48
|
+
borderColor: "#4A4E69",
|
|
49
|
+
fontFamily: "Roboto, sans-serif",
|
|
50
|
+
height: 80,
|
|
51
|
+
padding: 32,
|
|
52
|
+
sticky: true,
|
|
53
|
+
showSearch: true,
|
|
54
|
+
showCTA: true,
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
```tsx
|
|
60
|
+
// app/layout.tsx (Next.js App Router example)
|
|
61
|
+
import { ElectroplixProvider } from "@electroplix/components";
|
|
62
|
+
import config from "../electroplix.config";
|
|
63
|
+
|
|
64
|
+
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
|
65
|
+
return (
|
|
66
|
+
<html lang="en">
|
|
67
|
+
<body>
|
|
68
|
+
<ElectroplixProvider config={config}>
|
|
69
|
+
{children}
|
|
70
|
+
</ElectroplixProvider>
|
|
71
|
+
</body>
|
|
72
|
+
</html>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Components will merge configuration in priority order:
|
|
78
|
+
1. **Per-instance** `config` prop (highest)
|
|
79
|
+
2. **Global** `ElectroplixProvider` config
|
|
80
|
+
3. **Built-in** defaults
|
|
81
|
+
|
|
82
|
+
## API reference
|
|
83
|
+
|
|
84
|
+
### `<Navbar>`
|
|
85
|
+
|
|
86
|
+
| Prop | Type | Default | Description |
|
|
87
|
+
|------|------|---------|-------------|
|
|
88
|
+
| `logoText` | `string` | `"Electroplix"` | Brand text |
|
|
89
|
+
| `logoHref` | `string` | `"/"` | Logo link target |
|
|
90
|
+
| `links` | `NavLink[]` | `[]` | Navigation links |
|
|
91
|
+
| `ctaText` | `string` | `"Get Started"` | CTA button label |
|
|
92
|
+
| `ctaHref` | `string` | `"#"` | CTA button href |
|
|
93
|
+
| `searchPlaceholder` | `string` | `"Search…"` | Search input placeholder |
|
|
94
|
+
| `onSearch` | `(q: string) => void` | — | Search callback |
|
|
95
|
+
| `config` | `NavbarConfig` | — | Per-instance style overrides |
|
|
96
|
+
|
|
97
|
+
### `NavbarConfig` (global or per-instance)
|
|
98
|
+
|
|
99
|
+
| Key | Type | Default |
|
|
100
|
+
|-----|------|---------|
|
|
101
|
+
| `bgColor` | `string` | `"#0B0B0C"` |
|
|
102
|
+
| `textColor` | `string` | `"#F3F4F6"` |
|
|
103
|
+
| `accentColor` | `string` | `"#8B5CF6"` |
|
|
104
|
+
| `borderColor` | `string` | `"rgba(255,255,255,0.1)"` |
|
|
105
|
+
| `fontFamily` | `string` | `"Inter, ui-sans-serif, system-ui"` |
|
|
106
|
+
| `height` | `number` | `72` |
|
|
107
|
+
| `padding` | `number` | `24` |
|
|
108
|
+
| `sticky` | `boolean` | `false` |
|
|
109
|
+
| `showSearch` | `boolean` | `false` |
|
|
110
|
+
| `showCTA` | `boolean` | `false` |
|
|
111
|
+
|
|
112
|
+
## License
|
|
113
|
+
|
|
114
|
+
MIT
|