@hzblj/kara-ui 0.1.0 → 0.2.0
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 +42 -12
- package/bin/kara-icons.js +3 -0
- package/package.json +12 -10
- package/CHANGELOG.md +0 -17
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ package includes a native module.
|
|
|
20
20
|
## Install
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
|
-
npx expo install @hzblj/kara-ui @expo/ui @
|
|
23
|
+
npx expo install @hzblj/kara-ui @expo/ui @shopify/flash-list expo-haptics expo-image react-native-reanimated react-native-worklets
|
|
24
24
|
# optional, for `@hzblj/kara-ui/router` (native tabs)
|
|
25
25
|
npx expo install expo-router
|
|
26
26
|
```
|
|
@@ -102,34 +102,64 @@ device.
|
|
|
102
102
|
|
|
103
103
|
`materialSeed: null` is the halfway house: the wallpaper's neutrals and controls, your own accent.
|
|
104
104
|
|
|
105
|
-
### iOS semantic colours
|
|
105
|
+
### iOS semantic colours
|
|
106
106
|
|
|
107
107
|
The theme decides which colour a token *uses*. To redefine what a UIKit semantic colour *is*, app-wide
|
|
108
108
|
and natively (e.g. `labelColor`), use the config plugin:
|
|
109
109
|
|
|
110
|
-
```
|
|
111
|
-
{
|
|
112
|
-
"plugins": [["@hzblj/kara-ui", {"iosSemanticColors": {"file": "./ios-colors.json"}}]]
|
|
113
|
-
}
|
|
110
|
+
```ts
|
|
111
|
+
plugins: [['@hzblj/kara-ui', {icons: {source: './assets/icons'}, iosSemanticColors: {file: './ios-colors.json'}}]]
|
|
114
112
|
```
|
|
115
113
|
|
|
116
114
|
`ios-colors.json` maps semantic names (with their `Color` suffix) to `{light, dark, highContrastLight?, highContrastDark?}`.
|
|
117
115
|
It has no Android counterpart; use `colors` in the theme for both platforms.
|
|
118
116
|
|
|
117
|
+
## Icons
|
|
118
|
+
|
|
119
|
+
kara-ui ships no icon set — your app brings its own SVGs, and kara turns them into **native assets** on both
|
|
120
|
+
platforms. No icon font, no JavaScript rendering.
|
|
121
|
+
|
|
122
|
+
```ts
|
|
123
|
+
// app.config.ts
|
|
124
|
+
plugins: [['@hzblj/kara-ui', {icons: {source: './assets/icons'}}]]
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
assets/icons/
|
|
129
|
+
bolt.svg → <Icon name="bolt" />
|
|
130
|
+
share.svg → iOS
|
|
131
|
+
share.android.svg → Android's own share glyph
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
```tsx
|
|
135
|
+
<Icon name="bolt" /> // inside <Screen> / <Island>: SwiftUI Image · Compose Icon
|
|
136
|
+
<RnIcon name="bolt" color="content.accent" /> // anywhere: UIImageView · ImageView
|
|
137
|
+
<Tabs.Screen icon="home" selectedIcon="home-filled" name="index" title="Home" />
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
- At prebuild every SVG becomes a template image set in the iOS asset catalog (vector data kept, so it scales crisply)
|
|
141
|
+
and a vector drawable in Android's resources. A new or changed icon needs `npx expo prebuild`.
|
|
142
|
+
- Whenever the app config is read — `expo start` included — the plugin writes `kara-icons.d.ts`, so `name` only accepts
|
|
143
|
+
icons that exist. `npx kara-icons ./assets/icons` does the same without Expo (CI).
|
|
144
|
+
- One single-colour glyph per file, made of `<path>`s (`fill-rule="evenodd"` is fine). Groups, clips, masks and strokes
|
|
145
|
+
must be flattened first — the plugin fails loudly rather than shipping a broken icon. The platform tints every icon
|
|
146
|
+
with the `color` token.
|
|
147
|
+
- `x.ios.svg` / `x.android.svg` replace `x.svg` on that platform, for glyphs that differ (share, back).
|
|
148
|
+
|
|
119
149
|
## Components
|
|
120
150
|
|
|
121
151
|
| Tier | |
|
|
122
152
|
| --- | --- |
|
|
123
|
-
| Atoms | `Box`, `Text`, `Button`, `IconButton`, `TextField`, `Switch`, `Checkbox`, `Slider`, `Picker`, `DatePicker`, `ColorPicker`, `SegmentedControl`, `Icon`, `Image`, `Avatar`, `Badge`, `Chip`, `Card`, `Surface`, `Progress`, `ActivityIndicator`, `Skeleton`, `Fab`, `Divider`, `Spacer`, `VStack` / `HStack` / `ZStack`, `ScrollView`, `List`, `Island`, `Pressable`, `GlassView
|
|
124
|
-
| React Native tier | `RnView`, `RnText`, `RnScrollView`, `RnFlatList`, `RnSectionList`, `FlashList` — the same `sx` surface on plain React Native views |
|
|
153
|
+
| Atoms | `Box`, `Text`, `Button`, `IconButton`, `TextField`, `Switch`, `Checkbox`, `Slider`, `Picker`, `DatePicker`, `ColorPicker`, `SegmentedControl`, `Icon`, `Image`, `Avatar`, `Badge`, `Chip`, `Card`, `Surface`, `Progress`, `ActivityIndicator`, `Skeleton`, `Fab`, `Divider`, `Spacer`, `VStack` / `HStack` / `ZStack`, `ScrollView`, `List`, `Island`, `Pressable`, `GlassView` |
|
|
154
|
+
| React Native tier | `RnView`, `RnText`, `RnIcon`, `RnScrollView`, `RnFlatList`, `RnSectionList`, `FlashList` — the same `sx` surface on plain React Native views |
|
|
125
155
|
| Molecules | `Label`, `LabeledContent`, `ListItem`, `Link`, `SearchBar`, `EmptyState`, `Collapsible`, `Pager`, `RadioGroup`, `Stepper`, `Tooltip`, `RnTooltip`, `NavigationBar`, `ScrollEdgeContainer` |
|
|
126
|
-
| Organisms | `Sheet`, `ActionSheet`, `Alert`, `Menu`, `ContextMenu`, `
|
|
156
|
+
| Organisms | `Sheet`, `ActionSheet`, `Alert`, `Menu`, `ContextMenu`, `Form`, `SwipeActions`, `Snackbar`, `FabMenu` |
|
|
127
157
|
| Templates | `Screen` |
|
|
128
158
|
|
|
129
159
|
A few come from the package's own native module rather than `@expo/ui`: `GlassView` (iOS 26 Liquid
|
|
130
160
|
Glass around React Native children), `ScrollEdgeContainer` (the iOS 26 scroll edge effect under your
|
|
131
|
-
bars), `
|
|
132
|
-
|
|
161
|
+
bars), `NavigationBar` (real `UINavigationBar` items in a sheet), `ContextMenu` (long-press menu
|
|
162
|
+
with a custom preview), `RnTooltip` (rich,
|
|
133
163
|
controlled tooltip) and `FabMenu` (Material 3 Expressive on Android). Each falls back gracefully where
|
|
134
164
|
the platform lacks the feature.
|
|
135
165
|
|
|
@@ -154,7 +184,7 @@ never need to depend on directly:
|
|
|
154
184
|
| `@hzblj/kara-native` | The `KaraUI` Expo native module (Swift/Kotlin) and its bindings |
|
|
155
185
|
| `@hzblj/kara-components` | Atoms, molecules, organisms, templates |
|
|
156
186
|
| `@hzblj/kara-router` | `Tabs`, `navigationTheme` |
|
|
157
|
-
| `@hzblj/kara-expo-plugin` | The
|
|
187
|
+
| `@hzblj/kara-expo-plugin` | The config plugin (icons, iOS semantic colours) and the `kara-icons` CLI |
|
|
158
188
|
|
|
159
189
|
## Development
|
|
160
190
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hzblj/kara-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "A native-first design system for Expo: real SwiftUI and Jetpack Compose views through @expo/ui, styled by one token-typed sx engine.",
|
|
5
5
|
"author": "Jan Blazej",
|
|
6
6
|
"license": "MIT",
|
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
"src",
|
|
59
59
|
"lib",
|
|
60
60
|
"app.plugin.js",
|
|
61
|
+
"bin",
|
|
61
62
|
"!**/*.stories.tsx",
|
|
62
63
|
"!**/contract.check.ts",
|
|
63
64
|
"!**/story-decorators.tsx",
|
|
@@ -86,16 +87,15 @@
|
|
|
86
87
|
]
|
|
87
88
|
},
|
|
88
89
|
"dependencies": {
|
|
89
|
-
"@hzblj/kara-components": "
|
|
90
|
-
"@hzblj/kara-expo-plugin": "
|
|
91
|
-
"@hzblj/kara-native": "
|
|
92
|
-
"@hzblj/kara-router": "
|
|
93
|
-
"@hzblj/kara-sx": "
|
|
94
|
-
"@hzblj/kara-theme": "
|
|
90
|
+
"@hzblj/kara-components": "workspace:^",
|
|
91
|
+
"@hzblj/kara-expo-plugin": "workspace:^",
|
|
92
|
+
"@hzblj/kara-native": "workspace:^",
|
|
93
|
+
"@hzblj/kara-router": "workspace:^",
|
|
94
|
+
"@hzblj/kara-sx": "workspace:^",
|
|
95
|
+
"@hzblj/kara-theme": "workspace:^"
|
|
95
96
|
},
|
|
96
97
|
"peerDependencies": {
|
|
97
98
|
"@expo/ui": "~57.0.0",
|
|
98
|
-
"@expo/vector-icons": "*",
|
|
99
99
|
"@shopify/flash-list": ">=2.0.0",
|
|
100
100
|
"expo": "~57.0.0",
|
|
101
101
|
"expo-haptics": "*",
|
|
@@ -112,7 +112,6 @@
|
|
|
112
112
|
},
|
|
113
113
|
"devDependencies": {
|
|
114
114
|
"@expo/ui": "~57.0.18",
|
|
115
|
-
"@expo/vector-icons": "^15.1.1",
|
|
116
115
|
"@shopify/flash-list": "^2.3.2",
|
|
117
116
|
"@types/react": "~19.2.18",
|
|
118
117
|
"expo": "~57.0.22",
|
|
@@ -128,5 +127,8 @@
|
|
|
128
127
|
},
|
|
129
128
|
"publishConfig": {
|
|
130
129
|
"access": "public"
|
|
130
|
+
},
|
|
131
|
+
"bin": {
|
|
132
|
+
"kara-icons": "./bin/kara-icons.js"
|
|
131
133
|
}
|
|
132
|
-
}
|
|
134
|
+
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# @hzblj/kara-ui
|
|
2
|
-
|
|
3
|
-
## 0.1.0
|
|
4
|
-
|
|
5
|
-
### Minor Changes
|
|
6
|
-
|
|
7
|
-
- [`f919c7b`](https://github.com/hzblj/kara-ui/commit/f919c7b06f3798cebd58eef1581076bf1ee61cd1) Thanks [@hzblj](https://github.com/hzblj)! - First release of the kara-ui design system: theme and tokens, the `sx` engine, atoms, molecules, organisms and `Screen`, native tabs (`@hzblj/kara-ui/router`), the KaraUI native module (Liquid Glass, scroll edge effect, native countdown, context menu with preview, rich tooltip, FAB menu), and `KaraProvider` with theme overrides — colours, the app's own fonts, the Material seed, and Material You dynamic colour on Android. Text uses the platform's face by default. Install `@hzblj/kara-ui`; the scoped packages are its building blocks.
|
|
8
|
-
|
|
9
|
-
### Patch Changes
|
|
10
|
-
|
|
11
|
-
- Updated dependencies [[`f919c7b`](https://github.com/hzblj/kara-ui/commit/f919c7b06f3798cebd58eef1581076bf1ee61cd1)]:
|
|
12
|
-
- @hzblj/kara-theme@0.1.0
|
|
13
|
-
- @hzblj/kara-sx@0.1.0
|
|
14
|
-
- @hzblj/kara-native@0.1.0
|
|
15
|
-
- @hzblj/kara-components@0.1.0
|
|
16
|
-
- @hzblj/kara-router@0.1.0
|
|
17
|
-
- @hzblj/kara-expo-plugin@0.1.0
|