@kbach/react 0.1.2 → 0.1.4

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 +22 -22
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Tailwind-like utility classes for **React (web)**. Classes are converted to inline styles at render time through a custom JSX runtime — no stylesheet required.
4
4
 
5
- ```tsx
5
+ ```
6
6
  /** @jsxImportSource @kbach/react */
7
7
 
8
8
  <div className="bg-white dark:bg-gray-10 p-4 rounded-xl shadow" />
@@ -12,7 +12,7 @@ Tailwind-like utility classes for **React (web)**. Classes are converted to inli
12
12
 
13
13
  ## Install
14
14
 
15
- ```bash
15
+ ```
16
16
  npm install @kbach/react
17
17
  ```
18
18
 
@@ -22,7 +22,7 @@ npm install @kbach/react
22
22
 
23
23
  **tsconfig.json**
24
24
 
25
- ```jsonc
25
+ ```
26
26
  {
27
27
  "compilerOptions": {
28
28
  "jsx": "react-jsx",
@@ -33,7 +33,7 @@ npm install @kbach/react
33
33
 
34
34
  **Vite**
35
35
 
36
- ```ts
36
+ ```
37
37
  // vite.config.ts
38
38
  import { defineConfig } from 'vite';
39
39
  import react from '@vitejs/plugin-react';
@@ -45,7 +45,7 @@ export default defineConfig({
45
45
 
46
46
  **Babel**
47
47
 
48
- ```js
48
+ ```
49
49
  // babel.config.js
50
50
  module.exports = {
51
51
  presets: [
@@ -56,13 +56,13 @@ module.exports = {
56
56
 
57
57
  **Per-file pragma** (no config change required)
58
58
 
59
- ```tsx
59
+ ```
60
60
  /** @jsxImportSource @kbach/react */
61
61
  ```
62
62
 
63
63
  ### 2. Wrap your app
64
64
 
65
- ```tsx
65
+ ```
66
66
  import { ThemeProvider } from '@kbach/react';
67
67
 
68
68
  export default function Root() {
@@ -80,7 +80,7 @@ export default function Root() {
80
80
 
81
81
  Works on any HTML element or React component once the JSX runtime is configured.
82
82
 
83
- ```tsx
83
+ ```
84
84
  <div className="bg-white dark:bg-gray-10 p-4 rounded-xl" />
85
85
  <p className="text-gray-10 dark:text-white text-lg font-bold" />
86
86
  <button className="bg-blue-7 hover:bg-blue-8 pressed:bg-blue-8 rounded-lg px-4 py-2" />
@@ -90,7 +90,7 @@ Works on any HTML element or React component once the JSX runtime is configured.
90
90
 
91
91
  Pre-style any component. Returns a new component that merges the base classes with any `className` or `tw` prop passed at use time.
92
92
 
93
- ```tsx
93
+ ```
94
94
  import { styled } from '@kbach/react';
95
95
 
96
96
  const Card = styled('div', 'bg-white dark:bg-gray-9 rounded-2xl p-6 shadow');
@@ -110,7 +110,7 @@ const Button = styled(
110
110
 
111
111
  Resolve classes to a style object inside a component.
112
112
 
113
- ```tsx
113
+ ```
114
114
  import { useStyles } from '@kbach/react';
115
115
 
116
116
  function Badge() {
@@ -123,7 +123,7 @@ function Badge() {
123
123
 
124
124
  Resolve classes outside a component (static contexts).
125
125
 
126
- ```tsx
126
+ ```
127
127
  import { tw } from '@kbach/react';
128
128
 
129
129
  const cardStyle = tw('bg-white p-4 rounded-xl') as React.CSSProperties;
@@ -133,7 +133,7 @@ const cardStyle = tw('bg-white p-4 rounded-xl') as React.CSSProperties;
133
133
 
134
134
  Conditionally join class strings. Falsy values are ignored.
135
135
 
136
- ```tsx
136
+ ```
137
137
  import { cx } from '@kbach/react';
138
138
 
139
139
  <div className={cx(
@@ -145,7 +145,7 @@ import { cx } from '@kbach/react';
145
145
 
146
146
  ### useTheme()
147
147
 
148
- ```tsx
148
+ ```
149
149
  import { useTheme } from '@kbach/react';
150
150
 
151
151
  const { mode, resolvedMode, isDark, setMode, toggle } = useTheme();
@@ -163,10 +163,10 @@ const { mode, resolvedMode, isDark, setMode, toggle } = useTheme();
163
163
 
164
164
  Drop-in toggle component.
165
165
 
166
- ```tsx
167
- <ThemeToggle /> // button (default)
168
- <ThemeToggle variant="switch" /> // toggle switch
169
- <ThemeToggle variant="icon-button" /> // icon button
166
+ ```
167
+ <ThemeToggle /> // button (default)
168
+ <ThemeToggle variant="switch" /> // toggle switch
169
+ <ThemeToggle variant="icon-button" /> // icon button
170
170
  <ThemeToggle variant="button" includeSystem /> // three-way selector
171
171
  ```
172
172
 
@@ -184,14 +184,14 @@ Up to 3 modifiers can be chained in any order.
184
184
  | active: | Element active |
185
185
  | disabled: | Element disabled |
186
186
 
187
- ```tsx
187
+ ```
188
188
  <div className="dark:hover:bg-gray-9" />
189
189
  <button className="dark:pressed:bg-indigo-8" />
190
190
  ```
191
191
 
192
192
  ## Arbitrary values
193
193
 
194
- ```tsx
194
+ ```
195
195
  <div className="bg-[#6366f1]" />
196
196
  <div className="p-[14px]" />
197
197
  <div className="text-[18px]" />
@@ -200,7 +200,7 @@ Up to 3 modifiers can be chained in any order.
200
200
 
201
201
  ## Color with opacity
202
202
 
203
- ```tsx
203
+ ```
204
204
  <div className="bg-blue-6/50" /> // 50% opacity
205
205
  <div className="bg-gray-10/75" /> // 75% opacity
206
206
  ```
@@ -232,7 +232,7 @@ Available families: slate, gray, zinc, neutral, stone, red, orange, amber, yello
232
232
 
233
233
  ## Configuration
234
234
 
235
- ```js
235
+ ```
236
236
  // kbach.config.js
237
237
  module.exports = {
238
238
  darkMode: 'attribute', // 'attribute' | 'class' | 'media'
@@ -263,7 +263,7 @@ module.exports = {
263
263
 
264
264
  Apply at runtime:
265
265
 
266
- ```tsx
266
+ ```
267
267
  import { updateConfig } from '@kbach/react';
268
268
 
269
269
  updateConfig({ extend: { theme: { colors: { brand: { 6: '#6366f1' } } } } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kbach/react",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "React / React Native components and hooks for the Kbach framework",
5
5
  "source": "./src/index.ts",
6
6
  "main": "./dist/index.js",