@hzblj/kara-ui 0.1.0 → 0.2.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/CHANGELOG.md +42 -0
- package/README.md +42 -12
- package/bin/kara-icons.js +3 -0
- package/package.json +11 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,47 @@
|
|
|
1
1
|
# @hzblj/kara-ui
|
|
2
2
|
|
|
3
|
+
## 0.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`be5be81`](https://github.com/hzblj/kara-ui/commit/be5be81a3764dfbd199c3c3cf90deadc6e53d268) Thanks [@hzblj](https://github.com/hzblj)! - Installable again: 0.2.0 was published with `workspace:^` ranges between the kara packages, which no package manager outside this repository resolves. The packages now go out through Yarn, which writes the real version ranges.
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`be5be81`](https://github.com/hzblj/kara-ui/commit/be5be81a3764dfbd199c3c3cf90deadc6e53d268)]:
|
|
10
|
+
- @hzblj/kara-components@0.2.1
|
|
11
|
+
- @hzblj/kara-native@0.2.1
|
|
12
|
+
- @hzblj/kara-router@0.2.1
|
|
13
|
+
- @hzblj/kara-expo-plugin@0.2.1
|
|
14
|
+
- @hzblj/kara-sx@0.2.1
|
|
15
|
+
- @hzblj/kara-theme@0.2.1
|
|
16
|
+
|
|
17
|
+
## 0.2.0
|
|
18
|
+
|
|
19
|
+
### Minor Changes
|
|
20
|
+
|
|
21
|
+
- [`c30bef6`](https://github.com/hzblj/kara-ui/commit/c30bef6be2639deb6d385ad209d1a2799b5b656f) Thanks [@hzblj](https://github.com/hzblj)! - Icons are now fully native and the app's own: `plugins: [['@hzblj/kara-ui', {icons: {source: './assets/icons'}}]]` turns every SVG in the folder into an iOS asset-catalog template image and an Android vector drawable at prebuild (`x.ios.svg` / `x.android.svg` for per-platform glyphs), and writes `kara-icons.d.ts` so `name` only accepts icons that exist; `npx kara-icons` does the same for CI. `Icon` draws them in a host, the new `RnIcon` anywhere, and `Tabs` passes them as `xcasset` / `drawable`. The built-in SF Symbol / Material icon names and the `@expo/vector-icons` peer dependency are gone.
|
|
22
|
+
|
|
23
|
+
- [`c30bef6`](https://github.com/hzblj/kara-ui/commit/c30bef6be2639deb6d385ad209d1a2799b5b656f) Thanks [@hzblj](https://github.com/hzblj)! - Leaner, reusable-only components. `Countdown` is gone, with its native views. There is one `ContextMenu` now — the native module's long-press menu on React Native content, with a custom preview on iOS (formerly `RnContextMenu`); the `@expo/ui`-based one is removed.
|
|
24
|
+
|
|
25
|
+
Android, reworked to look and behave like Material while honouring the theme:
|
|
26
|
+
|
|
27
|
+
- `Button`, `Badge` and `Alert` render their labels; `Button` keeps Material's own shape (no iOS ring), takes `tint` as its fill with a label that contrasts with it, and draws `glass` as Material's outlined button.
|
|
28
|
+
- `Alert` is built from `AlertDialog`'s slots — title, message, the confirm action (destructive when asked) and Cancel — instead of drawing empty.
|
|
29
|
+
- `Menu` presents its actions in Material's dropdown popup, with their icons, instead of laying them out over the trigger.
|
|
30
|
+
- `Picker` is a themed Material exposed dropdown the width of its container.
|
|
31
|
+
- `Switch`, `Checkbox` and `RadioGroup` are tinted with the accent, and with a label are full-width rows that toggle as a whole; `Form` sections span the form's width.
|
|
32
|
+
- `Surface` pads its content instead of its background, and stacks its children in a column.
|
|
33
|
+
- `Fab` shows its icon, `DatePicker` opens its dialog on a tap (in the accent colour) instead of on mount, `GlassView`'s fallback is the translucent glass fill, and the `List` docs spell out that it needs a bounded height.
|
|
34
|
+
|
|
35
|
+
### Patch Changes
|
|
36
|
+
|
|
37
|
+
- Updated dependencies [[`c30bef6`](https://github.com/hzblj/kara-ui/commit/c30bef6be2639deb6d385ad209d1a2799b5b656f), [`c30bef6`](https://github.com/hzblj/kara-ui/commit/c30bef6be2639deb6d385ad209d1a2799b5b656f)]:
|
|
38
|
+
- @hzblj/kara-components@0.2.0
|
|
39
|
+
- @hzblj/kara-native@0.2.0
|
|
40
|
+
- @hzblj/kara-router@0.2.0
|
|
41
|
+
- @hzblj/kara-expo-plugin@0.2.0
|
|
42
|
+
- @hzblj/kara-theme@0.2.0
|
|
43
|
+
- @hzblj/kara-sx@0.2.0
|
|
44
|
+
|
|
3
45
|
## 0.1.0
|
|
4
46
|
|
|
5
47
|
### Minor Changes
|
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.1
|
|
3
|
+
"version": "0.2.1",
|
|
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": "^0.1
|
|
90
|
-
"@hzblj/kara-expo-plugin": "^0.1
|
|
91
|
-
"@hzblj/kara-native": "^0.1
|
|
92
|
-
"@hzblj/kara-router": "^0.1
|
|
93
|
-
"@hzblj/kara-sx": "^0.1
|
|
94
|
-
"@hzblj/kara-theme": "^0.1
|
|
90
|
+
"@hzblj/kara-components": "^0.2.1",
|
|
91
|
+
"@hzblj/kara-expo-plugin": "^0.2.1",
|
|
92
|
+
"@hzblj/kara-native": "^0.2.1",
|
|
93
|
+
"@hzblj/kara-router": "^0.2.1",
|
|
94
|
+
"@hzblj/kara-sx": "^0.2.1",
|
|
95
|
+
"@hzblj/kara-theme": "^0.2.1"
|
|
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
|
}
|