@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.
@@ -0,0 +1,441 @@
1
+ import {
2
+ borderRadius,
3
+ colors,
4
+ spacing
5
+ } from "./chunk-HAD2NPEW.mjs";
6
+
7
+ // src/native/Button.tsx
8
+ import {
9
+ Pressable,
10
+ Text,
11
+ StyleSheet
12
+ } from "react-native";
13
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
14
+ function Button({
15
+ label,
16
+ icon,
17
+ children,
18
+ variant = "outline",
19
+ size = "md",
20
+ style,
21
+ textStyle,
22
+ disabled,
23
+ ...props
24
+ }) {
25
+ return /* @__PURE__ */ jsxs(
26
+ Pressable,
27
+ {
28
+ disabled,
29
+ style: ({ pressed }) => [
30
+ styles.base,
31
+ styles[variant],
32
+ styles[`size_${size}`],
33
+ pressed && !disabled && styles.pressed,
34
+ disabled && styles.disabled,
35
+ style
36
+ ],
37
+ ...props,
38
+ children: [
39
+ icon && /* @__PURE__ */ jsx(Fragment, { children: icon }),
40
+ children ? children : label ? /* @__PURE__ */ jsx(
41
+ Text,
42
+ {
43
+ style: [
44
+ styles.text,
45
+ styles[`text_${variant}`],
46
+ styles[`textSize_${size}`],
47
+ disabled && styles.textDisabled,
48
+ icon ? styles.textWithIcon : null,
49
+ textStyle
50
+ ],
51
+ children: label
52
+ }
53
+ ) : null
54
+ ]
55
+ }
56
+ );
57
+ }
58
+ var styles = StyleSheet.create({
59
+ base: {
60
+ borderRadius: borderRadius.sm,
61
+ alignItems: "center",
62
+ justifyContent: "center",
63
+ flexDirection: "row",
64
+ gap: spacing.xs
65
+ },
66
+ size_sm: {
67
+ paddingVertical: spacing.xs,
68
+ paddingHorizontal: spacing.sm
69
+ },
70
+ size_md: {
71
+ paddingVertical: spacing.sm,
72
+ paddingHorizontal: spacing.lg
73
+ },
74
+ size_lg: {
75
+ paddingVertical: spacing.md,
76
+ paddingHorizontal: spacing.xl
77
+ },
78
+ primary: {
79
+ backgroundColor: colors.accent
80
+ },
81
+ outline: {
82
+ borderWidth: 1,
83
+ borderColor: colors.accent,
84
+ backgroundColor: "transparent"
85
+ },
86
+ ghost: {
87
+ backgroundColor: "transparent"
88
+ },
89
+ danger: {
90
+ backgroundColor: colors.danger
91
+ },
92
+ pressed: {
93
+ opacity: 0.75
94
+ },
95
+ disabled: {
96
+ opacity: 0.4
97
+ },
98
+ text: {
99
+ fontFamily: "monospace",
100
+ fontWeight: "600"
101
+ },
102
+ textWithIcon: {
103
+ marginLeft: 2
104
+ },
105
+ textSize_sm: {
106
+ fontSize: 12
107
+ },
108
+ textSize_md: {
109
+ fontSize: 14
110
+ },
111
+ textSize_lg: {
112
+ fontSize: 16
113
+ },
114
+ text_primary: {
115
+ color: colors.bg0
116
+ },
117
+ text_outline: {
118
+ color: colors.accent
119
+ },
120
+ text_ghost: {
121
+ color: colors.text0
122
+ },
123
+ text_danger: {
124
+ color: "#ffffff"
125
+ },
126
+ textDisabled: {
127
+ color: colors.textMuted
128
+ }
129
+ });
130
+
131
+ // src/native/BracketCard.tsx
132
+ import { View, StyleSheet as StyleSheet2 } from "react-native";
133
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
134
+ function BracketCard({
135
+ active = false,
136
+ style,
137
+ children,
138
+ ...props
139
+ }) {
140
+ return /* @__PURE__ */ jsxs2(
141
+ View,
142
+ {
143
+ style: [
144
+ styles2.card,
145
+ active && styles2.active,
146
+ style
147
+ ],
148
+ ...props,
149
+ children: [
150
+ /* @__PURE__ */ jsx2(View, { style: [styles2.corner, styles2.cornerTL, active && styles2.cornerActive] }),
151
+ /* @__PURE__ */ jsx2(View, { style: [styles2.corner, styles2.cornerTR, active && styles2.cornerActive] }),
152
+ /* @__PURE__ */ jsx2(View, { style: [styles2.corner, styles2.cornerBL, active && styles2.cornerActive] }),
153
+ /* @__PURE__ */ jsx2(View, { style: [styles2.corner, styles2.cornerBR, active && styles2.cornerActive] }),
154
+ children
155
+ ]
156
+ }
157
+ );
158
+ }
159
+ var styles2 = StyleSheet2.create({
160
+ card: {
161
+ backgroundColor: colors.bgCard,
162
+ borderWidth: 1,
163
+ borderColor: colors.borderSubtle,
164
+ borderRadius: borderRadius.md,
165
+ padding: spacing.md,
166
+ position: "relative"
167
+ },
168
+ active: {
169
+ borderColor: colors.accent
170
+ },
171
+ corner: {
172
+ position: "absolute",
173
+ width: 6,
174
+ height: 6,
175
+ borderColor: colors.textDim
176
+ },
177
+ cornerActive: {
178
+ borderColor: colors.accent
179
+ },
180
+ cornerTL: {
181
+ top: -1,
182
+ left: -1,
183
+ borderTopWidth: 2,
184
+ borderLeftWidth: 2
185
+ },
186
+ cornerTR: {
187
+ top: -1,
188
+ right: -1,
189
+ borderTopWidth: 2,
190
+ borderRightWidth: 2
191
+ },
192
+ cornerBL: {
193
+ bottom: -1,
194
+ left: -1,
195
+ borderBottomWidth: 2,
196
+ borderLeftWidth: 2
197
+ },
198
+ cornerBR: {
199
+ bottom: -1,
200
+ right: -1,
201
+ borderBottomWidth: 2,
202
+ borderRightWidth: 2
203
+ }
204
+ });
205
+
206
+ // src/native/Badge.tsx
207
+ import { View as View2, Text as Text2, StyleSheet as StyleSheet3 } from "react-native";
208
+ import { jsx as jsx3 } from "react/jsx-runtime";
209
+ function Badge({ label, variant = "default", style }) {
210
+ return /* @__PURE__ */ jsx3(View2, { style: [styles3.badge, styles3[variant], style], children: /* @__PURE__ */ jsx3(Text2, { style: [styles3.text, styles3[`text_${variant}`]], children: label }) });
211
+ }
212
+ var styles3 = StyleSheet3.create({
213
+ badge: {
214
+ paddingHorizontal: spacing.sm,
215
+ paddingVertical: 2,
216
+ borderRadius: borderRadius.sm,
217
+ alignSelf: "flex-start"
218
+ },
219
+ default: {
220
+ backgroundColor: colors.borderSubtle
221
+ },
222
+ accent: {
223
+ backgroundColor: colors.accentDim,
224
+ borderWidth: 1,
225
+ borderColor: colors.accent
226
+ },
227
+ teal: {
228
+ backgroundColor: colors.tealDim,
229
+ borderWidth: 1,
230
+ borderColor: colors.teal
231
+ },
232
+ purple: {
233
+ backgroundColor: "rgba(168, 85, 247, 0.15)",
234
+ borderWidth: 1,
235
+ borderColor: colors.purple
236
+ },
237
+ outline: {
238
+ borderWidth: 1,
239
+ borderColor: colors.borderLight,
240
+ backgroundColor: "transparent"
241
+ },
242
+ text: {
243
+ fontSize: 11,
244
+ fontFamily: "monospace",
245
+ fontWeight: "700",
246
+ textTransform: "uppercase"
247
+ },
248
+ text_default: {
249
+ color: colors.text1
250
+ },
251
+ text_accent: {
252
+ color: colors.accent
253
+ },
254
+ text_teal: {
255
+ color: colors.teal
256
+ },
257
+ text_purple: {
258
+ color: colors.purple
259
+ },
260
+ text_outline: {
261
+ color: colors.textDim
262
+ }
263
+ });
264
+
265
+ // src/native/Dot.tsx
266
+ import { View as View3, StyleSheet as StyleSheet4 } from "react-native";
267
+ import { jsx as jsx4 } from "react/jsx-runtime";
268
+ function Dot({ color = "accent", size = 6, style }) {
269
+ const colorMap = {
270
+ accent: colors.accent,
271
+ green: colors.success,
272
+ red: colors.danger,
273
+ teal: colors.teal,
274
+ purple: colors.purple
275
+ };
276
+ return /* @__PURE__ */ jsx4(
277
+ View3,
278
+ {
279
+ style: [
280
+ styles4.dot,
281
+ {
282
+ width: size,
283
+ height: size,
284
+ borderRadius: size / 2,
285
+ backgroundColor: colorMap[color]
286
+ },
287
+ style
288
+ ]
289
+ }
290
+ );
291
+ }
292
+ var styles4 = StyleSheet4.create({
293
+ dot: {
294
+ alignSelf: "center"
295
+ }
296
+ });
297
+
298
+ // src/native/TechLabel.tsx
299
+ import { View as View4, Text as Text3, StyleSheet as StyleSheet5 } from "react-native";
300
+ import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
301
+ function TechLabel({ label, jp, coord, style }) {
302
+ return /* @__PURE__ */ jsxs3(View4, { style: [styles5.container, style], children: [
303
+ /* @__PURE__ */ jsx5(Text3, { style: styles5.label, children: label }),
304
+ jp && /* @__PURE__ */ jsx5(Text3, { style: styles5.jp, children: jp }),
305
+ coord && /* @__PURE__ */ jsxs3(Text3, { style: styles5.coord, children: [
306
+ "[",
307
+ coord,
308
+ "]"
309
+ ] })
310
+ ] });
311
+ }
312
+ var styles5 = StyleSheet5.create({
313
+ container: {
314
+ flexDirection: "row",
315
+ alignItems: "center",
316
+ gap: spacing.xs
317
+ },
318
+ label: {
319
+ fontFamily: "monospace",
320
+ fontSize: 12,
321
+ color: colors.text0,
322
+ fontWeight: "700",
323
+ letterSpacing: 0.5
324
+ },
325
+ jp: {
326
+ fontSize: 11,
327
+ color: colors.text2
328
+ },
329
+ coord: {
330
+ fontFamily: "monospace",
331
+ fontSize: 10,
332
+ color: colors.accent
333
+ }
334
+ });
335
+
336
+ // src/native/CyberSwitch.tsx
337
+ import { View as View5, Text as Text4, Pressable as Pressable2, StyleSheet as StyleSheet6 } from "react-native";
338
+ import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
339
+ function CyberSwitch({
340
+ checked,
341
+ onChange,
342
+ label,
343
+ sublabel,
344
+ disabled = false,
345
+ style
346
+ }) {
347
+ return /* @__PURE__ */ jsxs4(
348
+ Pressable2,
349
+ {
350
+ disabled,
351
+ onPress: () => onChange(!checked),
352
+ style: [styles6.container, disabled && styles6.disabled, style],
353
+ children: [
354
+ /* @__PURE__ */ jsxs4(View5, { style: [styles6.track, checked && styles6.trackChecked], children: [
355
+ /* @__PURE__ */ jsx6(Text4, { style: [styles6.bitText, styles6.bitLeft], children: checked ? "1" : "" }),
356
+ /* @__PURE__ */ jsx6(View5, { style: [styles6.thumb, checked ? styles6.thumbChecked : styles6.thumbUnchecked] }),
357
+ /* @__PURE__ */ jsx6(Text4, { style: [styles6.bitText, styles6.bitRight], children: !checked ? "0" : "" })
358
+ ] }),
359
+ (label || sublabel) && /* @__PURE__ */ jsxs4(View5, { style: styles6.textGroup, children: [
360
+ label && /* @__PURE__ */ jsx6(Text4, { style: styles6.label, children: label }),
361
+ sublabel && /* @__PURE__ */ jsx6(Text4, { style: styles6.sublabel, children: sublabel })
362
+ ] })
363
+ ]
364
+ }
365
+ );
366
+ }
367
+ var styles6 = StyleSheet6.create({
368
+ container: {
369
+ flexDirection: "row",
370
+ alignItems: "center",
371
+ gap: spacing.sm
372
+ },
373
+ disabled: {
374
+ opacity: 0.4
375
+ },
376
+ track: {
377
+ width: 48,
378
+ height: 24,
379
+ borderRadius: borderRadius.sm,
380
+ backgroundColor: colors.bg1,
381
+ borderWidth: 1,
382
+ borderColor: colors.border,
383
+ flexDirection: "row",
384
+ alignItems: "center",
385
+ justifyContent: "space-between",
386
+ paddingHorizontal: 3,
387
+ position: "relative"
388
+ },
389
+ trackChecked: {
390
+ borderColor: colors.accent,
391
+ backgroundColor: colors.accentDim
392
+ },
393
+ thumb: {
394
+ width: 18,
395
+ height: 18,
396
+ borderRadius: borderRadius.sm - 2,
397
+ backgroundColor: colors.borderLight,
398
+ position: "absolute"
399
+ },
400
+ thumbUnchecked: {
401
+ left: 2
402
+ },
403
+ thumbChecked: {
404
+ right: 2,
405
+ backgroundColor: colors.accent
406
+ },
407
+ bitText: {
408
+ fontFamily: "monospace",
409
+ fontSize: 9,
410
+ fontWeight: "700",
411
+ color: colors.text2
412
+ },
413
+ bitLeft: {
414
+ marginLeft: 3
415
+ },
416
+ bitRight: {
417
+ marginRight: 3
418
+ },
419
+ textGroup: {
420
+ flexDirection: "column"
421
+ },
422
+ label: {
423
+ fontFamily: "monospace",
424
+ fontSize: 13,
425
+ color: colors.text0,
426
+ fontWeight: "600"
427
+ },
428
+ sublabel: {
429
+ fontSize: 11,
430
+ color: colors.text2
431
+ }
432
+ });
433
+ export {
434
+ Badge,
435
+ BracketCard,
436
+ Button,
437
+ CyberSwitch,
438
+ Dot,
439
+ TechLabel
440
+ };
441
+ //# sourceMappingURL=native.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/native/Button.tsx","../src/native/BracketCard.tsx","../src/native/Badge.tsx","../src/native/Dot.tsx","../src/native/TechLabel.tsx","../src/native/CyberSwitch.tsx"],"sourcesContent":["import React from 'react';\nimport {\n Pressable,\n Text,\n StyleSheet,\n type PressableProps,\n type StyleProp,\n type ViewStyle,\n type TextStyle,\n} from 'react-native';\nimport { colors, spacing, borderRadius } from '../tokens';\n\nexport interface NativeButtonProps extends Omit<PressableProps, 'style'> {\n label?: string;\n icon?: React.ReactNode;\n children?: React.ReactNode;\n variant?: 'primary' | 'outline' | 'ghost' | 'danger';\n size?: 'sm' | 'md' | 'lg';\n style?: StyleProp<ViewStyle>;\n textStyle?: StyleProp<TextStyle>;\n}\n\nexport function Button({\n label,\n icon,\n children,\n variant = 'outline',\n size = 'md',\n style,\n textStyle,\n disabled,\n ...props\n}: NativeButtonProps) {\n return (\n <Pressable\n disabled={disabled}\n style={({ pressed }) => [\n styles.base,\n styles[variant],\n styles[`size_${size}`],\n pressed && !disabled && styles.pressed,\n disabled && styles.disabled,\n style,\n ]}\n {...props}\n >\n {icon && <>{icon}</>}\n {children ? (\n children\n ) : label ? (\n <Text\n style={[\n styles.text,\n styles[`text_${variant}`],\n styles[`textSize_${size}`],\n disabled && styles.textDisabled,\n icon ? styles.textWithIcon : null,\n textStyle,\n ]}\n >\n {label}\n </Text>\n ) : null}\n </Pressable>\n );\n}\n\nconst styles = StyleSheet.create({\n base: {\n borderRadius: borderRadius.sm,\n alignItems: 'center',\n justifyContent: 'center',\n flexDirection: 'row',\n gap: spacing.xs,\n },\n size_sm: {\n paddingVertical: spacing.xs,\n paddingHorizontal: spacing.sm,\n },\n size_md: {\n paddingVertical: spacing.sm,\n paddingHorizontal: spacing.lg,\n },\n size_lg: {\n paddingVertical: spacing.md,\n paddingHorizontal: spacing.xl,\n },\n primary: {\n backgroundColor: colors.accent,\n },\n outline: {\n borderWidth: 1,\n borderColor: colors.accent,\n backgroundColor: 'transparent',\n },\n ghost: {\n backgroundColor: 'transparent',\n },\n danger: {\n backgroundColor: colors.danger,\n },\n pressed: {\n opacity: 0.75,\n },\n disabled: {\n opacity: 0.4,\n },\n text: {\n fontFamily: 'monospace',\n fontWeight: '600',\n },\n textWithIcon: {\n marginLeft: 2,\n },\n textSize_sm: {\n fontSize: 12,\n },\n textSize_md: {\n fontSize: 14,\n },\n textSize_lg: {\n fontSize: 16,\n },\n text_primary: {\n color: colors.bg0,\n },\n text_outline: {\n color: colors.accent,\n },\n text_ghost: {\n color: colors.text0,\n },\n text_danger: {\n color: '#ffffff',\n },\n textDisabled: {\n color: colors.textMuted,\n },\n});\n","import React from 'react';\nimport { View, StyleSheet, type ViewProps, type StyleProp, type ViewStyle } from 'react-native';\nimport { colors, spacing, borderRadius } from '../tokens';\n\nexport interface NativeBracketCardProps extends ViewProps {\n active?: boolean;\n style?: StyleProp<ViewStyle>;\n}\n\nexport function BracketCard({\n active = false,\n style,\n children,\n ...props\n}: NativeBracketCardProps) {\n return (\n <View\n style={[\n styles.card,\n active && styles.active,\n style,\n ]}\n {...props}\n >\n <View style={[styles.corner, styles.cornerTL, active && styles.cornerActive]} />\n <View style={[styles.corner, styles.cornerTR, active && styles.cornerActive]} />\n <View style={[styles.corner, styles.cornerBL, active && styles.cornerActive]} />\n <View style={[styles.corner, styles.cornerBR, active && styles.cornerActive]} />\n {children}\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n card: {\n backgroundColor: colors.bgCard,\n borderWidth: 1,\n borderColor: colors.borderSubtle,\n borderRadius: borderRadius.md,\n padding: spacing.md,\n position: 'relative',\n },\n active: {\n borderColor: colors.accent,\n },\n corner: {\n position: 'absolute',\n width: 6,\n height: 6,\n borderColor: colors.textDim,\n },\n cornerActive: {\n borderColor: colors.accent,\n },\n cornerTL: {\n top: -1,\n left: -1,\n borderTopWidth: 2,\n borderLeftWidth: 2,\n },\n cornerTR: {\n top: -1,\n right: -1,\n borderTopWidth: 2,\n borderRightWidth: 2,\n },\n cornerBL: {\n bottom: -1,\n left: -1,\n borderBottomWidth: 2,\n borderLeftWidth: 2,\n },\n cornerBR: {\n bottom: -1,\n right: -1,\n borderBottomWidth: 2,\n borderRightWidth: 2,\n },\n});\n","import React from 'react';\nimport { View, Text, StyleSheet, type ViewStyle, type StyleProp } from 'react-native';\nimport { colors, spacing, borderRadius } from '../tokens';\n\nexport interface NativeBadgeProps {\n label: string;\n variant?: 'default' | 'accent' | 'teal' | 'purple' | 'outline';\n style?: StyleProp<ViewStyle>;\n}\n\nexport function Badge({ label, variant = 'default', style }: NativeBadgeProps) {\n return (\n <View style={[styles.badge, styles[variant], style]}>\n <Text style={[styles.text, styles[`text_${variant}`]]}>{label}</Text>\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n badge: {\n paddingHorizontal: spacing.sm,\n paddingVertical: 2,\n borderRadius: borderRadius.sm,\n alignSelf: 'flex-start',\n },\n default: {\n backgroundColor: colors.borderSubtle,\n },\n accent: {\n backgroundColor: colors.accentDim,\n borderWidth: 1,\n borderColor: colors.accent,\n },\n teal: {\n backgroundColor: colors.tealDim,\n borderWidth: 1,\n borderColor: colors.teal,\n },\n purple: {\n backgroundColor: 'rgba(168, 85, 247, 0.15)',\n borderWidth: 1,\n borderColor: colors.purple,\n },\n outline: {\n borderWidth: 1,\n borderColor: colors.borderLight,\n backgroundColor: 'transparent',\n },\n text: {\n fontSize: 11,\n fontFamily: 'monospace',\n fontWeight: '700',\n textTransform: 'uppercase',\n },\n text_default: {\n color: colors.text1,\n },\n text_accent: {\n color: colors.accent,\n },\n text_teal: {\n color: colors.teal,\n },\n text_purple: {\n color: colors.purple,\n },\n text_outline: {\n color: colors.textDim,\n },\n});\n","import React from 'react';\nimport { View, StyleSheet, type ViewStyle, type StyleProp } from 'react-native';\nimport { colors } from '../tokens';\n\nexport interface NativeDotProps {\n color?: 'accent' | 'green' | 'red' | 'teal' | 'purple';\n size?: number;\n style?: StyleProp<ViewStyle>;\n}\n\nexport function Dot({ color = 'accent', size = 6, style }: NativeDotProps) {\n const colorMap = {\n accent: colors.accent,\n green: colors.success,\n red: colors.danger,\n teal: colors.teal,\n purple: colors.purple,\n };\n\n return (\n <View\n style={[\n styles.dot,\n {\n width: size,\n height: size,\n borderRadius: size / 2,\n backgroundColor: colorMap[color],\n },\n style,\n ]}\n />\n );\n}\n\nconst styles = StyleSheet.create({\n dot: {\n alignSelf: 'center',\n },\n});\n","import React from 'react';\nimport { View, Text, StyleSheet, type ViewStyle, type StyleProp } from 'react-native';\nimport { colors, spacing, borderRadius } from '../tokens';\n\nexport interface NativeTechLabelProps {\n label: string;\n jp?: string;\n coord?: string;\n style?: StyleProp<ViewStyle>;\n}\n\nexport function TechLabel({ label, jp, coord, style }: NativeTechLabelProps) {\n return (\n <View style={[styles.container, style]}>\n <Text style={styles.label}>{label}</Text>\n {jp && <Text style={styles.jp}>{jp}</Text>}\n {coord && <Text style={styles.coord}>[{coord}]</Text>}\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: spacing.xs,\n },\n label: {\n fontFamily: 'monospace',\n fontSize: 12,\n color: colors.text0,\n fontWeight: '700',\n letterSpacing: 0.5,\n },\n jp: {\n fontSize: 11,\n color: colors.text2,\n },\n coord: {\n fontFamily: 'monospace',\n fontSize: 10,\n color: colors.accent,\n },\n});\n","import React from 'react';\nimport { View, Text, Pressable, StyleSheet, type ViewStyle, type StyleProp } from 'react-native';\nimport { colors, spacing, borderRadius } from '../tokens';\n\nexport interface NativeCyberSwitchProps {\n checked: boolean;\n onChange: (checked: boolean) => void;\n label?: string;\n sublabel?: string;\n disabled?: boolean;\n style?: StyleProp<ViewStyle>;\n}\n\nexport function CyberSwitch({\n checked,\n onChange,\n label,\n sublabel,\n disabled = false,\n style,\n}: NativeCyberSwitchProps) {\n return (\n <Pressable\n disabled={disabled}\n onPress={() => onChange(!checked)}\n style={[styles.container, disabled && styles.disabled, style]}\n >\n <View style={[styles.track, checked && styles.trackChecked]}>\n <Text style={[styles.bitText, styles.bitLeft]}>{checked ? '1' : ''}</Text>\n <View style={[styles.thumb, checked ? styles.thumbChecked : styles.thumbUnchecked]} />\n <Text style={[styles.bitText, styles.bitRight]}>{!checked ? '0' : ''}</Text>\n </View>\n {(label || sublabel) && (\n <View style={styles.textGroup}>\n {label && <Text style={styles.label}>{label}</Text>}\n {sublabel && <Text style={styles.sublabel}>{sublabel}</Text>}\n </View>\n )}\n </Pressable>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: spacing.sm,\n },\n disabled: {\n opacity: 0.4,\n },\n track: {\n width: 48,\n height: 24,\n borderRadius: borderRadius.sm,\n backgroundColor: colors.bg1,\n borderWidth: 1,\n borderColor: colors.border,\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n paddingHorizontal: 3,\n position: 'relative',\n },\n trackChecked: {\n borderColor: colors.accent,\n backgroundColor: colors.accentDim,\n },\n thumb: {\n width: 18,\n height: 18,\n borderRadius: borderRadius.sm - 2,\n backgroundColor: colors.borderLight,\n position: 'absolute',\n },\n thumbUnchecked: {\n left: 2,\n },\n thumbChecked: {\n right: 2,\n backgroundColor: colors.accent,\n },\n bitText: {\n fontFamily: 'monospace',\n fontSize: 9,\n fontWeight: '700',\n color: colors.text2,\n },\n bitLeft: {\n marginLeft: 3,\n },\n bitRight: {\n marginRight: 3,\n },\n textGroup: {\n flexDirection: 'column',\n },\n label: {\n fontFamily: 'monospace',\n fontSize: 13,\n color: colors.text0,\n fontWeight: '600',\n },\n sublabel: {\n fontSize: 11,\n color: colors.text2,\n },\n});\n"],"mappings":";;;;;;;AACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AAyBH,SAYW,eAZX;AAZG,SAAS,OAAO;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAsB;AACpB,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MAC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,QAAQ;AAAA,IACR,cAAc,aAAa;AAAA,IAC3B,iBAAiB,OAAO;AAAA,IACxB,aAAa;AAAA,IACb,aAAa,OAAO;AAAA,IACpB,eAAe;AAAA,IACf,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,mBAAmB;AAAA,IACnB,UAAU;AAAA,EACZ;AAAA,EACA,cAAc;AAAA,IACZ,aAAa,OAAO;AAAA,IACpB,iBAAiB,OAAO;AAAA,EAC1B;AAAA,EACA,OAAO;AAAA,IACL,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,cAAc,aAAa,KAAK;AAAA,IAChC,iBAAiB,OAAO;AAAA,IACxB,UAAU;AAAA,EACZ;AAAA,EACA,gBAAgB;AAAA,IACd,MAAM;AAAA,EACR;AAAA,EACA,cAAc;AAAA,IACZ,OAAO;AAAA,IACP,iBAAiB,OAAO;AAAA,EAC1B;AAAA,EACA,SAAS;AAAA,IACP,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,OAAO,OAAO;AAAA,EAChB;AAAA,EACA,SAAS;AAAA,IACP,YAAY;AAAA,EACd;AAAA,EACA,UAAU;AAAA,IACR,aAAa;AAAA,EACf;AAAA,EACA,WAAW;AAAA,IACT,eAAe;AAAA,EACjB;AAAA,EACA,OAAO;AAAA,IACL,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,OAAO,OAAO;AAAA,IACd,YAAY;AAAA,EACd;AAAA,EACA,UAAU;AAAA,IACR,UAAU;AAAA,IACV,OAAO,OAAO;AAAA,EAChB;AACF,CAAC;","names":["StyleSheet","jsx","jsxs","styles","StyleSheet","View","Text","StyleSheet","jsx","View","styles","Text","StyleSheet","View","StyleSheet","jsx","View","styles","StyleSheet","View","Text","StyleSheet","jsx","jsxs","View","styles","Text","StyleSheet","View","Text","Pressable","StyleSheet","jsx","jsxs","Pressable","styles","View","Text","StyleSheet"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@krpkg/ui",
3
- "version": "0.2.0",
4
- "description": "krpkg Cyber-Minimalist UI Design System & Component Library (Web, Tauri Desktop, & Mobile)",
3
+ "version": "0.3.1",
4
+ "description": "krpkg Cyber-Minimalist UI Design System & Component Library (Web, Tauri Desktop, & React Native / Expo)",
5
5
  "license": "Apache-2.0",
6
6
  "author": "krpkg",
7
7
  "repository": {
@@ -18,6 +18,11 @@
18
18
  "import": "./dist/index.mjs",
19
19
  "require": "./dist/index.js"
20
20
  },
21
+ "./native": {
22
+ "types": "./dist/native.d.ts",
23
+ "import": "./dist/native.mjs",
24
+ "require": "./dist/native.js"
25
+ },
21
26
  "./tokens": {
22
27
  "types": "./dist/tokens.d.ts",
23
28
  "import": "./dist/tokens.mjs",
@@ -43,13 +48,24 @@
43
48
  },
44
49
  "peerDependencies": {
45
50
  "react": ">=18.0.0",
46
- "react-dom": ">=18.0.0"
51
+ "react-dom": ">=18.0.0",
52
+ "react-native": ">=0.70.0"
53
+ },
54
+ "peerDependenciesMeta": {
55
+ "react-dom": {
56
+ "optional": true
57
+ },
58
+ "react-native": {
59
+ "optional": true
60
+ }
47
61
  },
48
62
  "devDependencies": {
49
63
  "@types/react": "^19.0.0",
50
64
  "@types/react-dom": "^19.0.0",
65
+ "@types/react-native": "^0.72.8",
51
66
  "react": "^19.0.0",
52
67
  "react-dom": "^19.0.0",
68
+ "react-native": "^0.88.1",
53
69
  "tsup": "^8.3.6",
54
70
  "typescript": "^5.8.2",
55
71
  "vitest": "^3.0.7"