@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/src/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export type { NavLink, NavbarProps, NavbarConfig, ElectroplixConfig, } from "./lib/types";
|
|
2
|
+
export { defineConfig, defaultNavbarConfig, defaultConfig, mergeConfig, } from "./lib/config";
|
|
3
|
+
export { ElectroplixProvider, useElectroplixConfig } from "./lib/provider";
|
|
4
|
+
export type { ElectroplixProviderProps } from "./lib/provider";
|
|
5
|
+
export { Navbar } from "./lib/Navbar";
|
|
3
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAKA,YAAY,EACV,OAAO,EACP,WAAW,EACX,YAAY,EACZ,iBAAiB,GAClB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,aAAa,EACb,WAAW,GACZ,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3E,YAAY,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAG/D,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/src/lib/Navbar.d.ts
CHANGED
|
@@ -1,23 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
href: string;
|
|
5
|
-
};
|
|
6
|
-
export interface NavbarProps {
|
|
7
|
-
logoText?: string;
|
|
8
|
-
links?: NavLink[];
|
|
9
|
-
bgColor?: string;
|
|
10
|
-
textColor?: string;
|
|
11
|
-
accentColor?: string;
|
|
12
|
-
borderColor?: string;
|
|
13
|
-
fontFamily?: string;
|
|
14
|
-
height?: number;
|
|
15
|
-
padding?: number;
|
|
16
|
-
showSearch?: boolean;
|
|
17
|
-
showCTA?: boolean;
|
|
18
|
-
ctaText?: string;
|
|
19
|
-
sticky?: boolean;
|
|
20
|
-
}
|
|
21
|
-
export declare const Navbar: React.FC<NavbarProps>;
|
|
1
|
+
import type { FC } from "react";
|
|
2
|
+
import type { NavbarProps } from "./types";
|
|
3
|
+
export declare const Navbar: FC<NavbarProps>;
|
|
22
4
|
export default Navbar;
|
|
23
5
|
//# sourceMappingURL=Navbar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Navbar.d.ts","sourceRoot":"","sources":["../../../src/lib/Navbar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Navbar.d.ts","sourceRoot":"","sources":["../../../src/lib/Navbar.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,KAAK,EAAE,WAAW,EAAgB,MAAM,SAAS,CAAC;AAKzD,eAAO,MAAM,MAAM,EAAE,EAAE,CAAC,WAAW,CA8KlC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ElectroplixConfig, NavbarConfig } from "./types";
|
|
2
|
+
/** Built-in default Navbar styling / behaviour. */
|
|
3
|
+
export declare const defaultNavbarConfig: Required<NavbarConfig>;
|
|
4
|
+
/** Built-in default global configuration. */
|
|
5
|
+
export declare const defaultConfig: ElectroplixConfig;
|
|
6
|
+
/**
|
|
7
|
+
* Type-safe helper for authoring an Electroplix configuration file.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* // electroplix.config.ts
|
|
12
|
+
* import { defineConfig } from "@electroplix/components";
|
|
13
|
+
*
|
|
14
|
+
* export default defineConfig({
|
|
15
|
+
* navbar: {
|
|
16
|
+
* bgColor: "#22223B",
|
|
17
|
+
* textColor: "#F2E9E4",
|
|
18
|
+
* accentColor: "#C9ADA7",
|
|
19
|
+
* borderColor: "#4A4E69",
|
|
20
|
+
* fontFamily: "Roboto, sans-serif",
|
|
21
|
+
* height: 80,
|
|
22
|
+
* padding: 32,
|
|
23
|
+
* sticky: true,
|
|
24
|
+
* showSearch: true,
|
|
25
|
+
* showCTA: true,
|
|
26
|
+
* },
|
|
27
|
+
* });
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare function defineConfig(config: ElectroplixConfig): ElectroplixConfig;
|
|
31
|
+
/**
|
|
32
|
+
* Shallow-merge helper. Later sources win; `undefined` values in
|
|
33
|
+
* a source are ignored so partial overrides work correctly.
|
|
34
|
+
*/
|
|
35
|
+
export declare function mergeConfig<T extends Record<string, unknown>>(target: T, ...sources: Array<Partial<T> | undefined>): T;
|
|
36
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/lib/config.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAI/D,mDAAmD;AACnD,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,YAAY,CAWtD,CAAC;AAEF,6CAA6C;AAC7C,eAAO,MAAM,aAAa,EAAE,iBAE3B,CAAC;AAIF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,iBAAiB,GAAG,iBAAiB,CAEzE;AAID;;;GAGG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC3D,MAAM,EAAE,CAAC,EACT,GAAG,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,GACxC,CAAC,CAWH"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CSSProperties } from "react";
|
|
2
|
+
interface IconProps {
|
|
3
|
+
size?: number;
|
|
4
|
+
style?: CSSProperties;
|
|
5
|
+
}
|
|
6
|
+
export declare function SearchIcon({ size, style }: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function MenuIcon({ size, style }: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function ArrowRightIcon({ size, style }: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=icons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../src/lib/icons.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAiB,aAAa,EAAE,MAAM,OAAO,CAAC;AAE1D,UAAU,SAAS;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAYD,wBAAgB,UAAU,CAAC,EAAE,IAAS,EAAE,KAAK,EAAE,EAAE,SAAS,2CAOzD;AAED,wBAAgB,QAAQ,CAAC,EAAE,IAAS,EAAE,KAAK,EAAE,EAAE,SAAS,2CAQvD;AAED,wBAAgB,cAAc,CAAC,EAAE,IAAS,EAAE,KAAK,EAAE,EAAE,SAAS,2CAO7D"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { ElectroplixConfig } from "./types";
|
|
3
|
+
export interface ElectroplixProviderProps {
|
|
4
|
+
/** Global configuration for all Electroplix components. */
|
|
5
|
+
config: ElectroplixConfig;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Provides global configuration to every `@electroplix/components`
|
|
10
|
+
* component rendered inside it.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* // app/layout.tsx
|
|
15
|
+
* import { ElectroplixProvider } from "@electroplix/components";
|
|
16
|
+
* import config from "../electroplix.config";
|
|
17
|
+
*
|
|
18
|
+
* export default function RootLayout({ children }: { children: React.ReactNode }) {
|
|
19
|
+
* return (
|
|
20
|
+
* <html>
|
|
21
|
+
* <body>
|
|
22
|
+
* <ElectroplixProvider config={config}>
|
|
23
|
+
* {children}
|
|
24
|
+
* </ElectroplixProvider>
|
|
25
|
+
* </body>
|
|
26
|
+
* </html>
|
|
27
|
+
* );
|
|
28
|
+
* }
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export declare function ElectroplixProvider({ config, children, }: ElectroplixProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
/**
|
|
33
|
+
* Returns the global Electroplix configuration from the nearest
|
|
34
|
+
* `<ElectroplixProvider>`. Falls back to built-in defaults when
|
|
35
|
+
* no provider is present.
|
|
36
|
+
*/
|
|
37
|
+
export declare function useElectroplixConfig(): ElectroplixConfig;
|
|
38
|
+
//# sourceMappingURL=provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/lib/provider.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAKjD,MAAM,WAAW,wBAAwB;IACvC,2DAA2D;IAC3D,MAAM,EAAE,iBAAiB,CAAC;IAC1B,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,MAAM,EACN,QAAQ,GACT,EAAE,wBAAwB,2CAO1B;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,iBAAiB,CAExD"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/** A single navigation link. */
|
|
2
|
+
export interface NavLink {
|
|
3
|
+
label: string;
|
|
4
|
+
href: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Style / behaviour configuration for the Navbar component.
|
|
8
|
+
*
|
|
9
|
+
* These values can be set globally via `ElectroplixProvider` or
|
|
10
|
+
* per-instance through the `config` prop on `<Navbar>`.
|
|
11
|
+
*/
|
|
12
|
+
export interface NavbarConfig {
|
|
13
|
+
/** Background colour. @default "#0B0B0C" */
|
|
14
|
+
bgColor?: string;
|
|
15
|
+
/** Primary text colour. @default "#F3F4F6" */
|
|
16
|
+
textColor?: string;
|
|
17
|
+
/** Accent colour for gradients. @default "#8B5CF6" */
|
|
18
|
+
accentColor?: string;
|
|
19
|
+
/** Bottom-border colour. @default "rgba(255,255,255,0.1)" */
|
|
20
|
+
borderColor?: string;
|
|
21
|
+
/** Font family stack. @default "Inter, ui-sans-serif, system-ui" */
|
|
22
|
+
fontFamily?: string;
|
|
23
|
+
/** Height in px. @default 72 */
|
|
24
|
+
height?: number;
|
|
25
|
+
/** Inline padding in px. @default 24 */
|
|
26
|
+
padding?: number;
|
|
27
|
+
/** Stick to viewport top. @default false */
|
|
28
|
+
sticky?: boolean;
|
|
29
|
+
/** Show the search field. @default false */
|
|
30
|
+
showSearch?: boolean;
|
|
31
|
+
/** Show the call-to-action button. @default false */
|
|
32
|
+
showCTA?: boolean;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Content / data props passed directly to `<Navbar>`.
|
|
36
|
+
*
|
|
37
|
+
* Styling properties should be provided via the global config
|
|
38
|
+
* (`ElectroplixProvider`) or the per-instance `config` prop.
|
|
39
|
+
*/
|
|
40
|
+
export interface NavbarProps {
|
|
41
|
+
/** Brand / logo text. @default "Electroplix" */
|
|
42
|
+
logoText?: string;
|
|
43
|
+
/** Logo link target. @default "/" */
|
|
44
|
+
logoHref?: string;
|
|
45
|
+
/** Navigation links. @default [] */
|
|
46
|
+
links?: NavLink[];
|
|
47
|
+
/** CTA button label. @default "Get Started" */
|
|
48
|
+
ctaText?: string;
|
|
49
|
+
/** CTA button href. @default "#" */
|
|
50
|
+
ctaHref?: string;
|
|
51
|
+
/** Search placeholder text. @default "Search…" */
|
|
52
|
+
searchPlaceholder?: string;
|
|
53
|
+
/** Fires when the search input value changes. */
|
|
54
|
+
onSearch?: (query: string) => void;
|
|
55
|
+
/** Per-instance style overrides (highest priority). */
|
|
56
|
+
config?: NavbarConfig;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Global configuration object for every `@electroplix/components`
|
|
60
|
+
* component. Pass it to `<ElectroplixProvider config={…}>`.
|
|
61
|
+
*/
|
|
62
|
+
export interface ElectroplixConfig {
|
|
63
|
+
/** Navbar component configuration. */
|
|
64
|
+
navbar?: NavbarConfig;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/types.ts"],"names":[],"mappings":"AAIA,gCAAgC;AAChC,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,IAA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
|
|
2
2
|
"name": "@electroplix/components",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Parametric, config-driven UI components by Electroplix.",
|
|
4
5
|
"type": "module",
|
|
6
|
+
"sideEffects": false,
|
|
5
7
|
"main": "./dist/index.esm.js",
|
|
6
8
|
"module": "./dist/index.esm.js",
|
|
7
|
-
"types": "./dist/index.
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
8
10
|
"exports": {
|
|
9
11
|
"./package.json": "./package.json",
|
|
10
12
|
".": {
|
|
11
13
|
"@electroplix-workspace/source": "./src/index.ts",
|
|
12
|
-
"types": "./dist/index.
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
13
15
|
"import": "./dist/index.esm.js",
|
|
14
16
|
"default": "./dist/index.esm.js"
|
|
15
17
|
}
|
|
@@ -17,5 +19,24 @@
|
|
|
17
19
|
"files": [
|
|
18
20
|
"dist",
|
|
19
21
|
"!**/*.tsbuildinfo"
|
|
20
|
-
]
|
|
22
|
+
],
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"react": ">=18.0.0",
|
|
25
|
+
"react-dom": ">=18.0.0"
|
|
26
|
+
},
|
|
27
|
+
"peerDependenciesMeta": {
|
|
28
|
+
"react-dom": {
|
|
29
|
+
"optional": true
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"keywords": [
|
|
33
|
+
"react",
|
|
34
|
+
"components",
|
|
35
|
+
"ui",
|
|
36
|
+
"navbar",
|
|
37
|
+
"electroplix",
|
|
38
|
+
"configurable",
|
|
39
|
+
"parametric"
|
|
40
|
+
],
|
|
41
|
+
"license": "MIT"
|
|
21
42
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../src/lib/components.tsx"],"names":[],"mappings":"AAGA,wBAAgB,qBAAqB,4CAMpC;AAED,eAAe,qBAAqB,CAAC"}
|