@krpkg/ui 0.2.0 → 0.3.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.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @krpkg/ui
2
2
 
3
- Cyber-minimalist design system and React component library tailored for web applications, Tauri desktop apps, and mobile interfaces.
3
+ Cyber-minimalist design system and component library tailored for **Web**, **Tauri Desktop**, and **React Native / Expo Mobile**.
4
4
 
5
5
  Engineered with raw design tokens, dark tactical palettes, low-overhead styling, and modular component architecture.
6
6
 
@@ -24,44 +24,16 @@ Using pnpm:
24
24
  pnpm add @krpkg/ui
25
25
  ```
26
26
 
27
- ## Setup
27
+ ---
28
28
 
29
- Import the base CSS styles once in your application root (e.g. `main.tsx` or `App.tsx`):
29
+ ## Usage
30
30
 
31
- ```typescript
32
- import '@krpkg/ui/styles.css';
33
- ```
31
+ ### 1. Web & Tauri Desktop (DOM)
34
32
 
35
- ## Component Overview
36
-
37
- | Component | Description |
38
- |---|---|
39
- | `Button` | Tactical buttons with solid, outline, ghost, and danger variants. |
40
- | `BracketCard` | Angular card container with technical corner accents. |
41
- | `CornerFrame` | Framed container with customizable HUD corner markers. |
42
- | `TerminalWindow` | Command console and shell output viewer container. |
43
- | `TelemetryBar` | High-density status strip for metrics, latency, and system health. |
44
- | `TacticalDrawer` | Slide-out overlay drawer for details and side panels. |
45
- | `HudModal` | Centered modal dialog with tactical border styling and backdrop blur. |
46
- | `HudToast` | Compact status notification banner. |
47
- | `CyberSwitch` | Toggle switch with binary cybernetic visual cues. |
48
- | `SegmentedControl` | Multi-option tab switcher with active slider indicator. |
49
- | `Input` | Text input field with prefix, suffix, and error states. |
50
- | `KeyValGrid` | Technical key-value inspection table for telemetry and metadata. |
51
- | `Badge` | Status and category badges (accent, teal, red, green, muted). |
52
- | `Dot` | Pulsing or static status indicator dot. |
53
- | `TechLabel` | Monospace technical label with micro-formatting. |
54
- | `StickyNote` | Analog-aesthetic memo element in vintage paper tones. |
55
- | `SpoilerGate` | Blur/reveal privacy guard for sensitive or NSFW content. |
56
- | `Vinyl` | Turntable vinyl record animation component. |
57
- | `Breadcrumbs` | Tactical breadcrumb navigation trail. |
58
- | `BottomBar` | Mobile and compact viewport navigation bar. |
59
- | `Tooltip` | Contextual micro-tooltip on hover/focus. |
60
- | `Logo` | Official SVG monogram and logo variants. |
61
-
62
- ## Quick Example
33
+ Import components and the base stylesheet:
63
34
 
64
35
  ```tsx
36
+ import '@krpkg/ui/styles.css';
65
37
  import React, { useState } from 'react';
66
38
  import {
67
39
  Button,
@@ -76,23 +48,56 @@ export function Dashboard() {
76
48
 
77
49
  return (
78
50
  <BracketCard title="SYSTEM_TELEMETRY">
79
- <div style={{ display: 'flex', gap: '1rem', alignItems: 'center' }}>
80
- <Badge variant="accent">ONLINE</Badge>
81
- <CyberSwitch checked={active} onChange={setActive} label="DEBUG_MODE" />
82
- <Button variant="solid" onClick={() => console.log('Ping')}>
83
- EXECUTE
84
- </Button>
85
- </div>
86
-
87
- <TerminalWindow title="STDOUT" style={{ marginTop: '1rem' }}>
51
+ <Badge variant="accent">ONLINE</Badge>
52
+ <CyberSwitch checked={active} onChange={setActive} label="DEBUG_MODE" />
53
+ <Button variant="outline" onClick={() => console.log('Ping')}>
54
+ EXECUTE
55
+ </Button>
56
+ <TerminalWindow title="STDOUT">
88
57
  <p>Telemetry stream initialized.</p>
89
- <p>Awaiting instructions...</p>
90
58
  </TerminalWindow>
91
59
  </BracketCard>
92
60
  );
93
61
  }
94
62
  ```
95
63
 
64
+ ### 2. React Native & Expo Mobile (`@krpkg/ui/native`)
65
+
66
+ Native components use native primitives (`View`, `Text`, `Pressable`, `StyleSheet`) and zero DOM overhead:
67
+
68
+ ```tsx
69
+ import React, { useState } from 'react';
70
+ import { View } from 'react-native';
71
+ import {
72
+ Button,
73
+ BracketCard,
74
+ Badge,
75
+ Dot,
76
+ TechLabel,
77
+ CyberSwitch,
78
+ } from '@krpkg/ui/native';
79
+
80
+ export function MobileScreen() {
81
+ const [active, setActive] = useState(false);
82
+
83
+ return (
84
+ <BracketCard active={active}>
85
+ <Badge label="ONLINE" variant="accent" />
86
+ <Dot color="accent" />
87
+ <TechLabel label="SYS_CORE" coord="04.81" />
88
+ <CyberSwitch checked={active} onChange={setActive} label="OVERCLOCK" />
89
+ <Button
90
+ label="ENGAGE"
91
+ variant="primary"
92
+ onPress={() => console.log('Engaged')}
93
+ />
94
+ </BracketCard>
95
+ );
96
+ }
97
+ ```
98
+
99
+ ---
100
+
96
101
  ## Design Tokens and Themes
97
102
 
98
103
  `@krpkg/ui` ships with pure token definitions accessible in TypeScript or CSS variables:
@@ -108,7 +113,7 @@ import { colors, typography, spacing, themePalettes } from '@krpkg/ui/tokens';
108
113
  - **Furina Hydro-Overture (`furina`)**: Abyssal ocean navy with vivid hydro cyan.
109
114
  - **Alley Neon-Noir (`alley`)**: Deep dark purple with electric neon magenta.
110
115
 
111
- Apply themes by setting the `data-theme` attribute on any DOM ancestor:
116
+ Apply themes on Web by setting the `data-theme` attribute on any DOM ancestor:
112
117
 
113
118
  ```html
114
119
  <html data-theme="citlali">
@@ -116,13 +121,18 @@ Apply themes by setting the `data-theme` attribute on any DOM ancestor:
116
121
  </html>
117
122
  ```
118
123
 
124
+ ---
125
+
119
126
  ## Subpath Exports
120
127
 
121
- - `@krpkg/ui`: Core React components and base styles.
122
- - `@krpkg/ui/tokens`: Design tokens, colors, themes, typography, and spacing constants.
123
- - `@krpkg/ui/utils`: Formatting helpers, number formatters, and style utilities.
124
- - `@krpkg/ui/styles.css`: Compiled CSS theme variables and baseline resets.
125
- - `@krpkg/ui/assets/*`: Static SVG icons and graphic assets.
128
+ | Export Path | Description | Target Environment |
129
+ |---|---|---|
130
+ | `@krpkg/ui` | Core HTML/DOM React components | Web & Tauri Desktop |
131
+ | `@krpkg/ui/native` | React Native & Expo primitives (`Pressable`, `View`, `Text`) | iOS & Android (Expo / RN) |
132
+ | `@krpkg/ui/tokens` | Pure JS/TS color tokens, themes, typography, & spacing | Universal (Web + Mobile) |
133
+ | `@krpkg/ui/utils` | Timestamp, duration, and number formatters | Universal (Web + Mobile) |
134
+ | `@krpkg/ui/styles.css` | Compiled CSS theme variables & baseline resets | Web & Tauri Desktop |
135
+ | `@krpkg/ui/assets/*` | Static SVG icons and graphic assets | Universal |
126
136
 
127
137
  ## License
128
138
 
package/dist/index.mjs CHANGED
@@ -1,3 +1,7 @@
1
+ import {
2
+ formatDuration,
3
+ formatRelativeTime
4
+ } from "./chunk-ZJSL4I3W.mjs";
1
5
  import {
2
6
  borderRadius,
3
7
  colors,
@@ -7,10 +11,6 @@ import {
7
11
  tokens,
8
12
  typography
9
13
  } from "./chunk-HAD2NPEW.mjs";
10
- import {
11
- formatDuration,
12
- formatRelativeTime
13
- } from "./chunk-ZJSL4I3W.mjs";
14
14
 
15
15
  // src/components/Button.tsx
16
16
  import { forwardRef } from "react";
@@ -0,0 +1,53 @@
1
+ import React from 'react';
2
+ import { PressableProps, StyleProp, ViewStyle, TextStyle, ViewProps } from 'react-native';
3
+
4
+ interface NativeButtonProps extends Omit<PressableProps, 'style'> {
5
+ label?: string;
6
+ icon?: React.ReactNode;
7
+ children?: React.ReactNode;
8
+ variant?: 'primary' | 'outline' | 'ghost' | 'danger';
9
+ size?: 'sm' | 'md' | 'lg';
10
+ style?: StyleProp<ViewStyle>;
11
+ textStyle?: StyleProp<TextStyle>;
12
+ }
13
+ declare function Button({ label, icon, children, variant, size, style, textStyle, disabled, ...props }: NativeButtonProps): React.JSX.Element;
14
+
15
+ interface NativeBracketCardProps extends ViewProps {
16
+ active?: boolean;
17
+ style?: StyleProp<ViewStyle>;
18
+ }
19
+ declare function BracketCard({ active, style, children, ...props }: NativeBracketCardProps): React.JSX.Element;
20
+
21
+ interface NativeBadgeProps {
22
+ label: string;
23
+ variant?: 'default' | 'accent' | 'teal' | 'purple' | 'outline';
24
+ style?: StyleProp<ViewStyle>;
25
+ }
26
+ declare function Badge({ label, variant, style }: NativeBadgeProps): React.JSX.Element;
27
+
28
+ interface NativeDotProps {
29
+ color?: 'accent' | 'green' | 'red' | 'teal' | 'purple';
30
+ size?: number;
31
+ style?: StyleProp<ViewStyle>;
32
+ }
33
+ declare function Dot({ color, size, style }: NativeDotProps): React.JSX.Element;
34
+
35
+ interface NativeTechLabelProps {
36
+ label: string;
37
+ jp?: string;
38
+ coord?: string;
39
+ style?: StyleProp<ViewStyle>;
40
+ }
41
+ declare function TechLabel({ label, jp, coord, style }: NativeTechLabelProps): React.JSX.Element;
42
+
43
+ interface NativeCyberSwitchProps {
44
+ checked: boolean;
45
+ onChange: (checked: boolean) => void;
46
+ label?: string;
47
+ sublabel?: string;
48
+ disabled?: boolean;
49
+ style?: StyleProp<ViewStyle>;
50
+ }
51
+ declare function CyberSwitch({ checked, onChange, label, sublabel, disabled, style, }: NativeCyberSwitchProps): React.JSX.Element;
52
+
53
+ export { Badge, BracketCard, Button, CyberSwitch, Dot, type NativeBadgeProps, type NativeBracketCardProps, type NativeButtonProps, type NativeCyberSwitchProps, type NativeDotProps, type NativeTechLabelProps, TechLabel };
@@ -0,0 +1,53 @@
1
+ import React from 'react';
2
+ import { PressableProps, StyleProp, ViewStyle, TextStyle, ViewProps } from 'react-native';
3
+
4
+ interface NativeButtonProps extends Omit<PressableProps, 'style'> {
5
+ label?: string;
6
+ icon?: React.ReactNode;
7
+ children?: React.ReactNode;
8
+ variant?: 'primary' | 'outline' | 'ghost' | 'danger';
9
+ size?: 'sm' | 'md' | 'lg';
10
+ style?: StyleProp<ViewStyle>;
11
+ textStyle?: StyleProp<TextStyle>;
12
+ }
13
+ declare function Button({ label, icon, children, variant, size, style, textStyle, disabled, ...props }: NativeButtonProps): React.JSX.Element;
14
+
15
+ interface NativeBracketCardProps extends ViewProps {
16
+ active?: boolean;
17
+ style?: StyleProp<ViewStyle>;
18
+ }
19
+ declare function BracketCard({ active, style, children, ...props }: NativeBracketCardProps): React.JSX.Element;
20
+
21
+ interface NativeBadgeProps {
22
+ label: string;
23
+ variant?: 'default' | 'accent' | 'teal' | 'purple' | 'outline';
24
+ style?: StyleProp<ViewStyle>;
25
+ }
26
+ declare function Badge({ label, variant, style }: NativeBadgeProps): React.JSX.Element;
27
+
28
+ interface NativeDotProps {
29
+ color?: 'accent' | 'green' | 'red' | 'teal' | 'purple';
30
+ size?: number;
31
+ style?: StyleProp<ViewStyle>;
32
+ }
33
+ declare function Dot({ color, size, style }: NativeDotProps): React.JSX.Element;
34
+
35
+ interface NativeTechLabelProps {
36
+ label: string;
37
+ jp?: string;
38
+ coord?: string;
39
+ style?: StyleProp<ViewStyle>;
40
+ }
41
+ declare function TechLabel({ label, jp, coord, style }: NativeTechLabelProps): React.JSX.Element;
42
+
43
+ interface NativeCyberSwitchProps {
44
+ checked: boolean;
45
+ onChange: (checked: boolean) => void;
46
+ label?: string;
47
+ sublabel?: string;
48
+ disabled?: boolean;
49
+ style?: StyleProp<ViewStyle>;
50
+ }
51
+ declare function CyberSwitch({ checked, onChange, label, sublabel, disabled, style, }: NativeCyberSwitchProps): React.JSX.Element;
52
+
53
+ export { Badge, BracketCard, Button, CyberSwitch, Dot, type NativeBadgeProps, type NativeBracketCardProps, type NativeButtonProps, type NativeCyberSwitchProps, type NativeDotProps, type NativeTechLabelProps, TechLabel };