@kawaiininja/ui 1.0.3

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 (40) hide show
  1. package/README.md +49 -0
  2. package/dist/components/card/Card.d.ts +22 -0
  3. package/dist/components/card/Card.js +14 -0
  4. package/dist/components/card/index.d.ts +1 -0
  5. package/dist/components/card/index.js +1 -0
  6. package/dist/components/index.d.ts +6 -0
  7. package/dist/components/index.js +6 -0
  8. package/dist/components/label/Label.d.ts +21 -0
  9. package/dist/components/label/Label.js +16 -0
  10. package/dist/components/label/index.d.ts +1 -0
  11. package/dist/components/label/index.js +1 -0
  12. package/dist/components/page/Page.d.ts +16 -0
  13. package/dist/components/page/Page.js +8 -0
  14. package/dist/components/page/index.d.ts +1 -0
  15. package/dist/components/page/index.js +1 -0
  16. package/dist/components/section/Section.d.ts +25 -0
  17. package/dist/components/section/Section.js +13 -0
  18. package/dist/components/section/SectionHeader.d.ts +25 -0
  19. package/dist/components/section/SectionHeader.js +8 -0
  20. package/dist/components/section/SectionLabel.d.ts +21 -0
  21. package/dist/components/section/SectionLabel.js +16 -0
  22. package/dist/components/section/index.d.ts +2 -0
  23. package/dist/components/section/index.js +2 -0
  24. package/dist/components/settings/SettingRow.d.ts +23 -0
  25. package/dist/components/settings/SettingRow.js +5 -0
  26. package/dist/components/settings/SettingsSection.d.ts +11 -0
  27. package/dist/components/settings/SettingsSection.js +5 -0
  28. package/dist/components/settings/index.d.ts +2 -0
  29. package/dist/components/settings/index.js +2 -0
  30. package/dist/components/toggle/BloomToggle.d.ts +11 -0
  31. package/dist/components/toggle/BloomToggle.js +9 -0
  32. package/dist/components/toggle/CrosshairToggle.d.ts +11 -0
  33. package/dist/components/toggle/CrosshairToggle.js +15 -0
  34. package/dist/components/toggle/Toggle.d.ts +11 -0
  35. package/dist/components/toggle/Toggle.js +7 -0
  36. package/dist/components/toggle/index.d.ts +3 -0
  37. package/dist/components/toggle/index.js +3 -0
  38. package/dist/index.d.ts +1 -0
  39. package/dist/index.js +1 -0
  40. package/package.json +68 -0
package/README.md ADDED
@@ -0,0 +1,49 @@
1
+ # @kawaiininja/ui
2
+
3
+ A premium React UI component library for building beautiful web applications.
4
+
5
+ ## Component Structure
6
+
7
+ ```
8
+ ui/
9
+ ├── dist/ # Compiled output
10
+ └── src/
11
+ └── components/
12
+ └── section/ # Section layout components
13
+ ├── Section.tsx
14
+ ├── SectionHeader.tsx
15
+ └── SectionLabel.tsx
16
+ ```
17
+
18
+ ## Installation
19
+
20
+ ```bash
21
+ npm install @kawaiininja/ui
22
+ ```
23
+
24
+ ## Usage
25
+
26
+ ```tsx
27
+ import { Section, SectionHeader, SectionLabel } from "@kawaiininja/ui";
28
+
29
+ function MyPage() {
30
+ return (
31
+ <Section space="lg">
32
+ <SectionHeader title="My Section" subtitle="This is a subtitle" />
33
+ <SectionLabel>Label</SectionLabel>
34
+ <div>Content goes here...</div>
35
+ </Section>
36
+ );
37
+ }
38
+ ```
39
+
40
+ ## Features
41
+
42
+ - **TypeScript Support**: Fully typed components.
43
+ - **Modern Design**: Built for premium user interfaces.
44
+ - **Flexible**: customizable props and styling.
45
+
46
+ ## Scripts
47
+
48
+ - `npm run build`: Build the package (TypeScript compilation).
49
+ - `npm publish`: Publish to npm (use the provided `publish-ui-*.bat` scripts in the root).
@@ -0,0 +1,22 @@
1
+ import React from "react";
2
+ /**
3
+ * Props for the Card component
4
+ */
5
+ interface CardProps {
6
+ /** The content to render inside the card */
7
+ children: React.ReactNode;
8
+ /** Additional CSS classes */
9
+ className?: string;
10
+ /** Optional ID for navigation */
11
+ id?: string;
12
+ /** Optional aria-label for accessibility */
13
+ "aria-label"?: string;
14
+ /** Optional title for the card */
15
+ title?: string;
16
+ }
17
+ /**
18
+ * A container component for grouping related content.
19
+ * Renders an aside element with default styling for background, border, and padding.
20
+ */
21
+ export declare function Card({ children, className, id, "aria-label": ariaLabel, title, }: CardProps): import("react/jsx-runtime").JSX.Element;
22
+ export {};
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * A container component for grouping related content.
4
+ * Renders an aside element with default styling for background, border, and padding.
5
+ */
6
+ export function Card({ children, className = "", id, "aria-label": ariaLabel, title, }) {
7
+ return (_jsxs("aside", { id: id, "aria-label": ariaLabel, className: `
8
+ rounded-lg
9
+ border border-slate-700
10
+ bg-slate-800
11
+ p-4
12
+ ${className}
13
+ `, children: [title && (_jsx("h3", { className: "mb-4 text-sm font-semibold text-white uppercase tracking-widest", children: title })), children] }));
14
+ }
@@ -0,0 +1 @@
1
+ export * from "./Card";
@@ -0,0 +1 @@
1
+ export * from "./Card";
@@ -0,0 +1,6 @@
1
+ export * from "./card";
2
+ export * from "./label";
3
+ export * from "./page";
4
+ export * from "./section";
5
+ export * from "./settings";
6
+ export * from "./toggle";
@@ -0,0 +1,6 @@
1
+ export * from "./card";
2
+ export * from "./label";
3
+ export * from "./page";
4
+ export * from "./section";
5
+ export * from "./settings";
6
+ export * from "./toggle";
@@ -0,0 +1,21 @@
1
+ import React from "react";
2
+ /**
3
+ * Props for the Label component
4
+ */
5
+ interface LabelProps {
6
+ /**
7
+ * The HTML element to render as
8
+ * @default "p"
9
+ */
10
+ as?: React.ElementType;
11
+ /** The content of the label */
12
+ children: React.ReactNode;
13
+ /** Additional CSS classes */
14
+ className?: string;
15
+ }
16
+ /**
17
+ * A consistent label component generally used for subsections or small headers within a card.
18
+ * Applies uppercase, bold, and tracking styles.
19
+ */
20
+ export declare function Label({ as: Tag, children, className }: LabelProps): import("react/jsx-runtime").JSX.Element;
21
+ export {};
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * A consistent label component generally used for subsections or small headers within a card.
4
+ * Applies uppercase, bold, and tracking styles.
5
+ */
6
+ export function Label({ as: Tag = "p", children, className = "" }) {
7
+ return (_jsx(Tag, { className: `
8
+ text-xs
9
+ font-bold
10
+ uppercase
11
+ tracking-widest
12
+ text-muted
13
+ mb-2.5 ml-1
14
+ ${className}
15
+ `, children: children }));
16
+ }
@@ -0,0 +1 @@
1
+ export * from "./Label";
@@ -0,0 +1 @@
1
+ export * from "./Label";
@@ -0,0 +1,16 @@
1
+ import React from "react";
2
+ /**
3
+ * Props for the Page component
4
+ */
5
+ interface PageProps {
6
+ /** The content to render inside the page */
7
+ children: React.ReactNode;
8
+ /** Additional CSS classes */
9
+ className?: string;
10
+ }
11
+ /**
12
+ * A top-level container component for a page.
13
+ * Renders a main element to semantically identify the main content of the document.
14
+ */
15
+ export declare function Page({ children, className }: PageProps): import("react/jsx-runtime").JSX.Element;
16
+ export {};
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * A top-level container component for a page.
4
+ * Renders a main element to semantically identify the main content of the document.
5
+ */
6
+ export function Page({ children, className = "" }) {
7
+ return (_jsx("main", { className: `flex min-h-screen flex-col p-6 ${className}`, children: children }));
8
+ }
@@ -0,0 +1 @@
1
+ export * from "./Page";
@@ -0,0 +1 @@
1
+ export * from "./Page";
@@ -0,0 +1,25 @@
1
+ import React from "react";
2
+ /**
3
+ * Props for the Section component
4
+ */
5
+ interface SectionProps {
6
+ /** The content to render inside the section */
7
+ children: React.ReactNode;
8
+ /**
9
+ * Vertical spacing between children
10
+ * @default "md"
11
+ */
12
+ space?: "sm" | "md" | "lg";
13
+ /** Optional ID for navigation */
14
+ id?: string;
15
+ /** Optional aria-label for accessibility */
16
+ "aria-label"?: string;
17
+ /** Additional CSS classes */
18
+ className?: string;
19
+ }
20
+ /**
21
+ * A container component that applies consistent vertical spacing between its children.
22
+ * Useful for grouping related content with uniform gaps.
23
+ */
24
+ export declare function Section({ children, space, id, "aria-label": ariaLabel, className, }: SectionProps): import("react/jsx-runtime").JSX.Element;
25
+ export {};
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * A container component that applies consistent vertical spacing between its children.
4
+ * Useful for grouping related content with uniform gaps.
5
+ */
6
+ export function Section({ children, space = "md", id, "aria-label": ariaLabel, className = "", }) {
7
+ const gaps = {
8
+ sm: "gap-2",
9
+ md: "gap-4",
10
+ lg: "gap-6",
11
+ };
12
+ return (_jsx("section", { id: id, "aria-label": ariaLabel, className: `flex flex-col ${gaps[space]} ${className}`, children: children }));
13
+ }
@@ -0,0 +1,25 @@
1
+ type HeadingTag = "h2" | "h3" | "h4";
2
+ /**
3
+ * Props for the SectionHeader component
4
+ */
5
+ interface SectionHeaderProps {
6
+ /** Main title text */
7
+ title: string;
8
+ /** Optional subtitle text to display below the title */
9
+ subtitle?: string;
10
+ /** Additional CSS classes */
11
+ className?: string;
12
+ /**
13
+ * The semantic heading tag to use for the title.
14
+ * - Use `h2` for main section titles.
15
+ * - Use `h3` for nested subsections.
16
+ * @default "h2"
17
+ */
18
+ as?: HeadingTag;
19
+ }
20
+ /**
21
+ * A header component designed for sections, featuring a primary title and an optional subtitle.
22
+ * Uses consistent uppercase text styling.
23
+ */
24
+ export declare function SectionHeader({ title, subtitle, className, as: Tag, }: SectionHeaderProps): import("react/jsx-runtime").JSX.Element;
25
+ export {};
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * A header component designed for sections, featuring a primary title and an optional subtitle.
4
+ * Uses consistent uppercase text styling.
5
+ */
6
+ export function SectionHeader({ title, subtitle, className = "", as: Tag = "h2", }) {
7
+ return (_jsxs("header", { className: `flex flex-col gap-1 ${className}`, children: [_jsx(Tag, { className: "text-md font-bold uppercase tracking-widest text-primary", children: title }), subtitle && (_jsx("p", { className: "text-sm uppercase tracking-widest leading-snug text-muted", children: subtitle }))] }));
8
+ }
@@ -0,0 +1,21 @@
1
+ import React from "react";
2
+ /**
3
+ * Props for the SectionLabel component
4
+ */
5
+ interface SectionLabelProps {
6
+ /**
7
+ * The HTML element to render as
8
+ * @default "p"
9
+ */
10
+ as?: React.ElementType;
11
+ /** The content of the label */
12
+ children: React.ReactNode;
13
+ /** Additional CSS classes */
14
+ className?: string;
15
+ }
16
+ /**
17
+ * A consistent label component generally used for subsections or small headers within a card.
18
+ * Applies uppercase, bold, and tracking styles.
19
+ */
20
+ export declare function SectionLabel({ as: Tag, children, className, }: SectionLabelProps): import("react/jsx-runtime").JSX.Element;
21
+ export {};
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * A consistent label component generally used for subsections or small headers within a card.
4
+ * Applies uppercase, bold, and tracking styles.
5
+ */
6
+ export function SectionLabel({ as: Tag = "p", children, className = "", }) {
7
+ return (_jsx(Tag, { className: `
8
+ text-xs
9
+ font-bold
10
+ uppercase
11
+ tracking-widest
12
+ text-muted
13
+ mb-2.5 ml-1
14
+ ${className}
15
+ `, children: children }));
16
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./Section";
2
+ export * from "./SectionHeader";
@@ -0,0 +1,2 @@
1
+ export * from "./Section";
2
+ export * from "./SectionHeader";
@@ -0,0 +1,23 @@
1
+ import React from "react";
2
+ interface SettingRowProps {
3
+ /** Lucide icon component to display */
4
+ icon: React.ComponentType<{
5
+ size?: number | string;
6
+ className?: string;
7
+ }>;
8
+ /** Primary label text */
9
+ label: string;
10
+ /** Optional secondary description text */
11
+ description?: string;
12
+ /** Right-aligned content (e.g. Toggle, Chevron) */
13
+ children?: React.ReactNode;
14
+ /** Optional click handler for the row */
15
+ onClick?: () => void;
16
+ /** Additional CSS classes */
17
+ className?: string;
18
+ }
19
+ /**
20
+ * A standard row for settings interfaces, featuring an icon, label, description, and action area.
21
+ */
22
+ export declare const SettingRow: React.FC<SettingRowProps>;
23
+ export {};
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * A standard row for settings interfaces, featuring an icon, label, description, and action area.
4
+ */
5
+ export const SettingRow = ({ icon: Icon, label, description, children, onClick, className = "", }) => (_jsxs("div", { onClick: onClick, className: `flex items-center justify-between p-4 border-b border-zinc-800 last:border-0 hover:bg-zinc-800/30 transition-colors ${onClick ? "cursor-pointer" : ""} ${className}`, children: [_jsxs("div", { className: "flex items-center gap-4", children: [_jsx("div", { className: "p-2 bg-zinc-800 rounded-lg text-blue-500", children: _jsx(Icon, { size: 20 }) }), _jsxs("div", { children: [_jsx("p", { className: "text-zinc-100 font-medium", children: label }), description && _jsx("p", { className: "text-zinc-500 text-xs", children: description })] })] }), _jsx("div", { className: "flex items-center", children: children })] }));
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ interface SettingsSectionProps {
3
+ title: string;
4
+ children: React.ReactNode;
5
+ className?: string;
6
+ }
7
+ /**
8
+ * A container for grouping related setting rows with a labeled header.
9
+ */
10
+ export declare const SettingsSection: React.FC<SettingsSectionProps>;
11
+ export {};
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * A container for grouping related setting rows with a labeled header.
4
+ */
5
+ export const SettingsSection = ({ title, children, className = "", }) => (_jsxs("div", { className: `mb-8 ${className}`, children: [_jsx("h3", { className: "text-blue-500 font-bold text-sm uppercase tracking-widest mb-4 px-2", children: title }), _jsx("div", { className: "bg-zinc-900/50 border border-zinc-800 rounded-2xl overflow-hidden", children: children })] }));
@@ -0,0 +1,2 @@
1
+ export * from "./SettingRow";
2
+ export * from "./SettingsSection";
@@ -0,0 +1,2 @@
1
+ export * from "./SettingRow";
2
+ export * from "./SettingsSection";
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ interface ToggleProps {
3
+ enabled: boolean;
4
+ setEnabled: (enabled: boolean) => void;
5
+ className?: string;
6
+ }
7
+ /**
8
+ * A minimalist toggle with a circular "bloom" animation effect.
9
+ */
10
+ export declare const BloomToggle: React.FC<ToggleProps>;
11
+ export {};
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * A minimalist toggle with a circular "bloom" animation effect.
4
+ */
5
+ export const BloomToggle = ({ enabled, setEnabled, className = "", }) => (_jsxs("button", { onClick: () => setEnabled(!enabled), className: `relative w-12 h-12 flex items-center justify-center ${className}`, children: [_jsx("div", { className: `absolute inset-0 rounded-full transition-all duration-700 ${enabled
6
+ ? "bg-[#FF8A1F]/20 scale-100 opacity-100"
7
+ : "bg-transparent scale-0 opacity-0"}` }), _jsx("div", { className: `w-4 h-4 rounded-full border-2 transition-all duration-500 ${enabled
8
+ ? "bg-[#FF8A1F] border-transparent scale-125"
9
+ : "bg-transparent border-blue-500 scale-100"}` })] }));
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ interface ToggleProps {
3
+ enabled: boolean;
4
+ setEnabled: (enabled: boolean) => void;
5
+ className?: string;
6
+ }
7
+ /**
8
+ * A unique crosshair-style toggle with tactical UI elements and corner indicators.
9
+ */
10
+ export declare const CrosshairToggle: React.FC<ToggleProps>;
11
+ export {};
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * A unique crosshair-style toggle with tactical UI elements and corner indicators.
4
+ */
5
+ export const CrosshairToggle = ({ enabled, setEnabled, className = "", }) => (_jsxs("button", { onClick: () => setEnabled(!enabled), className: `relative w-12 h-12 flex items-center justify-center group ${className}`, children: [_jsx("div", { className: `absolute top-0 left-0 w-3 h-3 border-t-2 border-l-2 transition-all duration-300 ${enabled
6
+ ? "border-[#FF8A1F] translate-x-2 translate-y-2"
7
+ : "border-blue-500/30"}` }), _jsx("div", { className: `absolute top-0 right-0 w-3 h-3 border-t-2 border-r-2 transition-all duration-300 ${enabled
8
+ ? "border-[#FF8A1F] -translate-x-2 translate-y-2"
9
+ : "border-blue-500/30"}` }), _jsx("div", { className: `absolute bottom-0 left-0 w-3 h-3 border-b-2 border-l-2 transition-all duration-300 ${enabled
10
+ ? "border-[#FF8A1F] translate-x-2 -translate-y-2"
11
+ : "border-blue-500/30"}` }), _jsx("div", { className: `absolute bottom-0 right-0 w-3 h-3 border-b-2 border-r-2 transition-all duration-300 ${enabled
12
+ ? "border-[#FF8A1F] -translate-x-2 -translate-y-2"
13
+ : "border-blue-500/30"}` }), _jsx("div", { className: `w-1 h-1 rounded-full transition-all duration-300 ${enabled
14
+ ? "bg-[#FF8A1F] scale-[3] shadow-[0_0_10px_#FF8A1F]"
15
+ : "bg-blue-500/20 scale-100"}` })] }));
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ interface ToggleProps {
3
+ enabled: boolean;
4
+ setEnabled: (enabled: boolean) => void;
5
+ className?: string;
6
+ }
7
+ /**
8
+ * A sleek, modern toggle switch with a sliding indicator and subtle glow effects.
9
+ */
10
+ export declare const Toggle: React.FC<ToggleProps>;
11
+ export {};
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * A sleek, modern toggle switch with a sliding indicator and subtle glow effects.
4
+ */
5
+ export const Toggle = ({ enabled, setEnabled, className = "", }) => (_jsxs("button", { onClick: () => setEnabled(!enabled), className: `relative w-14 h-6 border transition-all duration-300 overflow-hidden ${enabled ? "border-[#FF8A1F]" : "border-blue-500/30"} ${className}`, children: [_jsx("div", { className: `absolute inset-y-0 left-0 transition-all duration-500 bg-[#FF8A1F]/20 ${enabled ? "w-full" : "w-0"}` }), _jsx("div", { className: `absolute top-0 bottom-0 w-4 transition-all duration-300 flex items-center justify-center ${enabled
6
+ ? "left-10 bg-[#FF8A1F] shadow-[-4px_0_12px_#FF8A1F]"
7
+ : "left-0 bg-blue-500"}`, children: _jsx("div", { className: "w-[1px] h-3 bg-black/30" }) })] }));
@@ -0,0 +1,3 @@
1
+ export * from "./BloomToggle";
2
+ export * from "./CrosshairToggle";
3
+ export * from "./Toggle";
@@ -0,0 +1,3 @@
1
+ export * from "./BloomToggle";
2
+ export * from "./CrosshairToggle";
3
+ export * from "./Toggle";
@@ -0,0 +1 @@
1
+ export * from "./components";
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ export * from "./components";
package/package.json ADDED
@@ -0,0 +1,68 @@
1
+ {
2
+ "name": "@kawaiininja/ui",
3
+ "version": "1.0.3",
4
+ "description": "A modern React component library with 45+ premium components for building beautiful web applications",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "module": "dist/index.js",
8
+ "type": "module",
9
+ "exports": {
10
+ ".": "./dist/index.js"
11
+ },
12
+ "files": [
13
+ "dist",
14
+ "README.md",
15
+ "LICENSE"
16
+ ],
17
+ "scripts": {
18
+ "build": "tsc",
19
+ "prepublishOnly": "echo 'Publishing @kawaiininja/ui to npm...'"
20
+ },
21
+ "keywords": [
22
+ "react",
23
+ "components",
24
+ "ui",
25
+ "framework",
26
+ "onyx",
27
+ "kawaiininja",
28
+ "design-system",
29
+ "dashboard",
30
+ "admin",
31
+ "charts",
32
+ "notifications",
33
+ "dark-mode",
34
+ "modern-ui"
35
+ ],
36
+ "author": "Vinay (4kawaiininja)",
37
+ "license": "MIT",
38
+ "repository": {
39
+ "type": "git",
40
+ "url": "git+https://github.com/4kawaiininja/onyx-framework.git"
41
+ },
42
+ "bugs": {
43
+ "url": "https://github.com/4kawaiininja/onyx-framework/issues"
44
+ },
45
+ "homepage": "https://github.com/4kawaiininja/onyx-framework#readme",
46
+ "peerDependencies": {
47
+ "lucide-react": ">=0.263.0",
48
+ "react": "^18.0.0 || ^19.0.0",
49
+ "react-dom": "^18.0.0 || ^19.0.0",
50
+ "recharts": "^2.0.0"
51
+ },
52
+ "peerDependenciesMeta": {
53
+ "recharts": {
54
+ "optional": true
55
+ },
56
+ "lucide-react": {
57
+ "optional": true
58
+ }
59
+ },
60
+ "publishConfig": {
61
+ "access": "public"
62
+ },
63
+ "devDependencies": {
64
+ "@types/react": "^19.2.7",
65
+ "@types/react-dom": "^19.2.3",
66
+ "typescript": "^5.9.3"
67
+ }
68
+ }