@kbach/native 0.1.1 → 0.1.2

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 (2) hide show
  1. package/README.md +44 -41
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -85,9 +85,9 @@ npx expo start --clear
85
85
 
86
86
  ## API
87
87
 
88
- ### `className` prop
88
+ ### className prop
89
89
 
90
- Works on any React Native component — `View`, `Text`, `TouchableOpacity`, `TextInput`, and third-party components.
90
+ Works on any React Native component — View, Text, TouchableOpacity, TextInput, and third-party components.
91
91
 
92
92
  ```tsx
93
93
  <View className="flex-1 bg-gray-2 dark:bg-gray-11 p-4" />
@@ -95,9 +95,9 @@ Works on any React Native component — `View`, `Text`, `TouchableOpacity`, `Tex
95
95
  <TouchableOpacity className="bg-blue-7 pressed:bg-blue-8 rounded-xl px-6 py-3" />
96
96
  ```
97
97
 
98
- ### `styled(Component, classes)`
98
+ ### styled(Component, classes)
99
99
 
100
- Pre-style any component. Handles interaction states (`pressed:`, `focus:`, etc.) automatically.
100
+ Pre-style any component. Handles interaction states (pressed, focus, etc.) automatically.
101
101
 
102
102
  ```tsx
103
103
  import { styled } from '@kbach/native';
@@ -123,7 +123,7 @@ Pass extra classes at use time with the `tw` prop:
123
123
  </Card>
124
124
  ```
125
125
 
126
- ### `useStyles(classes)`
126
+ ### useStyles(classes)
127
127
 
128
128
  Resolve classes to a style object inside a component. Use this when you need a value for the `style` prop.
129
129
 
@@ -143,7 +143,7 @@ function Badge() {
143
143
  }
144
144
  ```
145
145
 
146
- ### `tw(classes)`
146
+ ### tw(classes)
147
147
 
148
148
  Resolve classes outside a component, for use in `StyleSheet.create()` or static contexts.
149
149
 
@@ -157,7 +157,7 @@ const styles = StyleSheet.create({
157
157
  });
158
158
  ```
159
159
 
160
- ### `cx(...classes)`
160
+ ### cx(...classes)
161
161
 
162
162
  Conditionally join class strings. Falsy values are ignored.
163
163
 
@@ -171,7 +171,7 @@ import { cx } from '@kbach/native';
171
171
  )} />
172
172
  ```
173
173
 
174
- ### `useTheme()`
174
+ ### useTheme()
175
175
 
176
176
  ```tsx
177
177
  import { useTheme } from '@kbach/native';
@@ -181,35 +181,35 @@ const { mode, resolvedMode, isDark, setMode, toggle } = useTheme();
181
181
 
182
182
  | Value | Type | Description |
183
183
  |---|---|---|
184
- | `mode` | `'light' \| 'dark' \| 'system'` | User-selected mode |
185
- | `resolvedMode` | `'light' \| 'dark'` | Resolved after system lookup |
186
- | `isDark` | `boolean` | Shorthand for `resolvedMode === 'dark'` |
187
- | `setMode(mode)` | `fn` | Set mode explicitly |
188
- | `toggle()` | `fn` | Toggle between light and dark |
184
+ | mode | `'light' \| 'dark' \| 'system'` | User-selected mode |
185
+ | resolvedMode | `'light' \| 'dark'` | Resolved after system lookup |
186
+ | isDark | boolean | Shorthand for `resolvedMode === 'dark'` |
187
+ | setMode | function | Set mode explicitly |
188
+ | toggle | function | Toggle between light and dark |
189
189
 
190
- ### `ThemeToggle`
190
+ ### ThemeToggle
191
191
 
192
192
  Drop-in toggle component that works on both web and native.
193
193
 
194
194
  ```tsx
195
- <ThemeToggle /> // button (default)
196
- <ThemeToggle variant="switch" /> // toggle switch
197
- <ThemeToggle variant="icon-button" /> // icon button
198
- <ThemeToggle variant="button" includeSystem /> // three-way selector
195
+ <ThemeToggle /> // button (default)
196
+ <ThemeToggle variant="switch" /> // toggle switch
197
+ <ThemeToggle variant="icon-button" /> // icon button
198
+ <ThemeToggle variant="button" includeSystem /> // three-way selector
199
199
  ```
200
200
 
201
201
  ## Modifiers
202
202
 
203
- Up to **3 modifiers** can be chained in any order.
203
+ Up to 3 modifiers can be chained in any order.
204
204
 
205
205
  | Modifier | Trigger |
206
206
  |---|---|
207
- | `dark:` | Dark mode active |
208
- | `light:` | Light mode active |
209
- | `pressed:` | Touch pressed |
210
- | `focus:` | Element focused |
211
- | `active:` | Element active |
212
- | `disabled:` | Element disabled |
207
+ | dark: | Dark mode active |
208
+ | light: | Light mode active |
209
+ | pressed: | Touch pressed |
210
+ | focus: | Element focused |
211
+ | active: | Element active |
212
+ | disabled: | Element disabled |
213
213
 
214
214
  ```tsx
215
215
  <View className="dark:bg-gray-10" />
@@ -229,40 +229,41 @@ Up to **3 modifiers** can be chained in any order.
229
229
  ## Negative values
230
230
 
231
231
  ```tsx
232
- <View className="-mt-4" /> {/* marginTop: -16 */}
233
- <View className="-mx-2" /> {/* marginHorizontal: -8 */}
232
+ <View className="-mt-4" /> // marginTop: -16
233
+ <View className="-mx-2" /> // marginHorizontal: -8
234
234
  ```
235
235
 
236
236
  ## Color with opacity
237
237
 
238
238
  ```tsx
239
- <View className="bg-blue-6/50" /> {/* 50% opacity */}
240
- <View className="bg-gray-10/75" /> {/* 75% opacity */}
239
+ <View className="bg-blue-6/50" /> // 50% opacity
240
+ <View className="bg-gray-10/75" /> // 75% opacity
241
241
  ```
242
242
 
243
243
  ## Color scale
244
244
 
245
- Colors use an 11-shade scale where **1 is lightest** and **11 is darkest**.
245
+ Colors use an 11-shade scale 1 is lightest, 11 is darkest.
246
246
 
247
247
  ```
248
- bg-gray-1 (near white) bg-gray-6 (mid) bg-gray-11 (near black)
248
+ shade 1 · 2 · 3 · 4 · 5 · 6 · 7 · 8 · 9 · 10 · 11
249
+ light ─────────────────────────────────────────────────────────── dark
249
250
  ```
250
251
 
251
- Available families: `slate` `gray` `zinc` `neutral` `stone` `red` `orange` `amber` `yellow` `lime` `green` `emerald` `teal` `cyan` `sky` `blue` `indigo` `violet` `purple` `fuchsia` `pink` `rose`
252
+ Available families: slate, gray, zinc, neutral, stone, red, orange, amber, yellow, lime, green, emerald, teal, cyan, sky, blue, indigo, violet, purple, fuchsia, pink, rose.
252
253
 
253
254
  ## Common utilities
254
255
 
255
256
  | Category | Examples |
256
257
  |---|---|
257
- | **Background** | `bg-white`, `bg-gray-10`, `bg-blue-6`, `bg-[#fff]` |
258
- | **Text** | `text-sm`, `text-lg`, `text-2xl`, `text-gray-10`, `font-bold` |
259
- | **Padding** | `p-4`, `px-6`, `py-3`, `pt-2`, `pb-4` |
260
- | **Margin** | `m-4`, `mx-auto`, `mt-2`, `mb-4`, `-mt-4` |
261
- | **Size** | `w-full`, `h-12`, `w-[200px]` |
262
- | **Flex** | `flex-1`, `flex-row`, `items-center`, `justify-between`, `gap-4` |
263
- | **Border** | `border`, `border-2`, `border-gray-4`, `rounded-xl`, `rounded-full` |
264
- | **Shadow** | `shadow`, `shadow-md`, `shadow-lg` |
265
- | **Opacity** | `opacity-50`, `opacity-75` |
258
+ | Background | `bg-white`, `bg-gray-10`, `bg-blue-6`, `bg-[#fff]` |
259
+ | Text | `text-sm`, `text-2xl`, `text-gray-10`, `font-bold` |
260
+ | Padding | `p-4`, `px-6`, `py-3` |
261
+ | Margin | `m-4`, `mx-auto`, `mt-2`, `-mt-4` |
262
+ | Size | `w-full`, `h-12`, `w-[200px]` |
263
+ | Flex | `flex-1`, `flex-row`, `items-center`, `justify-between`, `gap-4` |
264
+ | Border | `border`, `border-2`, `border-gray-4`, `rounded-xl` |
265
+ | Shadow | `shadow`, `shadow-md`, `shadow-lg` |
266
+ | Opacity | `opacity-50`, `opacity-75` |
266
267
 
267
268
  ## Configuration
268
269
 
@@ -295,6 +296,8 @@ module.exports = {
295
296
  };
296
297
  ```
297
298
 
299
+ Apply at runtime:
300
+
298
301
  ```tsx
299
302
  import { updateConfig } from '@kbach/native';
300
303
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kbach/native",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Single-package Kbach install for React Native and Expo — includes core, components, Babel plugin, and Metro config",
5
5
  "source": "./src/index.ts",
6
6
  "main": "./dist/index.js",
@@ -34,7 +34,7 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@kbach/core": "0.1.0",
37
- "@kbach/react": "0.1.1",
37
+ "@kbach/react": "0.1.2",
38
38
  "babel-plugin-kbach": "0.1.0"
39
39
  },
40
40
  "devDependencies": {