@hzblj/kara-ui 0.0.0-stage → 0.1.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/CHANGELOG.md ADDED
@@ -0,0 +1,17 @@
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
package/README.md CHANGED
@@ -1,3 +1,166 @@
1
- # Temporary Holding Version
1
+ # @hzblj/kara-ui
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ A native-first design system for Expo. Components render **real SwiftUI and Jetpack Compose views**
4
+ through [`@expo/ui`](https://docs.expo.dev/versions/latest/sdk/ui/), not styled `View`s, and every
5
+ one of them is styled through one token-typed `sx` surface — `p="s16"`, `bg="surface.primary"`,
6
+ `borderRadius="large"`. A raw number or hex does not type-check.
7
+
8
+ - **Platform colours by default.** Most tokens resolve to UIKit semantic colours on iOS and Material 3
9
+ roles on Android, so light/dark, increased contrast and Material You are the platform's job.
10
+ - **The platform's typeface by default.** SF Pro on iOS, Roboto on Android, with your own exact sizes
11
+ that still follow Dynamic Type. Bring your own font with one config entry.
12
+ - **Override anything, keep the types.** Colours, fonts and the Android seed are set once on the
13
+ provider; every token name stays the same, so every component keeps type-checking.
14
+ - **Atomic tiers.** Atoms, molecules, organisms and a `Screen` template — plus a React Native tier
15
+ (`Box`, `RnView`, `RnText`, lists) with the same `sx` surface for layouts that host native views.
16
+
17
+ React Native and Expo only (iOS and Android), Expo SDK 57. A development build is required — the
18
+ package includes a native module.
19
+
20
+ ## Install
21
+
22
+ ```bash
23
+ npx expo install @hzblj/kara-ui @expo/ui @expo/vector-icons @shopify/flash-list expo-haptics expo-image react-native-reanimated react-native-worklets
24
+ # optional, for `@hzblj/kara-ui/router` (native tabs)
25
+ npx expo install expo-router
26
+ ```
27
+
28
+ Then rebuild the native app (`npx expo prebuild` / `npx expo run:ios`).
29
+
30
+ ## Use
31
+
32
+ ```tsx
33
+ import {Button, KaraProvider, Screen, Text, VStack} from '@hzblj/kara-ui'
34
+
35
+ export default function App() {
36
+ return (
37
+ <KaraProvider>
38
+ <Screen>
39
+ <VStack p="s16" spacing="s12" wide>
40
+ <Text variant="headingS">Hello</Text>
41
+ <Button label="Continue" variant="accent" wide />
42
+ </VStack>
43
+ </Screen>
44
+ </KaraProvider>
45
+ )
46
+ }
47
+ ```
48
+
49
+ **Native views need a host.** `@expo/ui`-backed components render inside `<Screen>` (full-bleed,
50
+ one per screen) or `<Island>` (a native island inside React Native layout). Outside one they do not
51
+ appear, and development builds warn.
52
+
53
+ `KaraProvider` takes `themePreference` (`'system' | 'light' | 'dark'`). A pinned preference is pushed
54
+ down to the platform too, so the SwiftUI/Compose hosts and every `PlatformColor` agree.
55
+
56
+ ## Theme
57
+
58
+ Pass a theme to the provider. Declare it at module scope so its identity is stable:
59
+
60
+ ```tsx
61
+ import {adaptive, defineTheme, KaraProvider} from '@hzblj/kara-ui'
62
+
63
+ const theme = defineTheme({
64
+ // Override any token's value — a hex, `adaptive({light, dark})`, or `native({ios, android})`.
65
+ colors: {
66
+ content: {accent: adaptive({dark: '#a5b4fc', light: '#4338ca'})},
67
+ fill: {accent: {primary: '#4f46e5'}},
68
+ },
69
+ // Your own typeface, by role and weight — the names you registered the files under (e.g. with expo-font).
70
+ fonts: {
71
+ text: {regular: 'Inter-Regular', medium: 'Inter-Medium', semibold: 'Inter-SemiBold', bold: 'Inter-Bold'},
72
+ display: {medium: 'InterDisplay-Medium'}, // headings; falls back to `text`
73
+ },
74
+ // The colour Android's Material 3 scheme grows from.
75
+ materialSeed: '#4f46e5',
76
+ })
77
+
78
+ export const App = ({children}) => <KaraProvider theme={theme}>{children}</KaraProvider>
79
+ ```
80
+
81
+ - **Colours** are merged over the defaults; you override values, never token names. A token that
82
+ supports dimming (`fill.accent.base:o50`) only accepts a value that stays dimmable — a hex,
83
+ `adaptive(...)`, or `native({android, light, dark})` — never a UIKit semantic colour.
84
+ - **Fonts** are optional. Without them, text uses the platform's face. With them, each text variant
85
+ picks the face for its weight (falling back to the role's `regular`). Native text keeps scaling with
86
+ Dynamic Type either way.
87
+ - Read the resolved theme anywhere with `useAppTheme()`: `theme.color('content.accent')`,
88
+ `theme.typography.body`, `theme.dark`.
89
+
90
+ ### Material You (Android)
91
+
92
+ ```tsx
93
+ const theme = defineTheme({dynamicColor: true})
94
+ ```
95
+
96
+ On Android 12+ the whole Material scheme follows the device wallpaper, and the accent tokens take
97
+ Material's `primary` roles — buttons, switches, links, FABs and tinted backgrounds move with it. A new
98
+ wallpaper is picked up when the app returns to the foreground, without a restart. Below Android 12 the
99
+ scheme grows from `materialSeed` instead. iOS has no wallpaper colours and keeps your accent; every
100
+ dimmed token (`:o50`) keeps working on both. `theme.dynamicColor` tells whether it is active on this
101
+ device.
102
+
103
+ `materialSeed: null` is the halfway house: the wallpaper's neutrals and controls, your own accent.
104
+
105
+ ### iOS semantic colours (optional config plugin)
106
+
107
+ The theme decides which colour a token *uses*. To redefine what a UIKit semantic colour *is*, app-wide
108
+ and natively (e.g. `labelColor`), use the config plugin:
109
+
110
+ ```json
111
+ {
112
+ "plugins": [["@hzblj/kara-ui", {"iosSemanticColors": {"file": "./ios-colors.json"}}]]
113
+ }
114
+ ```
115
+
116
+ `ios-colors.json` maps semantic names (with their `Color` suffix) to `{light, dark, highContrastLight?, highContrastDark?}`.
117
+ It has no Android counterpart; use `colors` in the theme for both platforms.
118
+
119
+ ## Components
120
+
121
+ | Tier | |
122
+ | --- | --- |
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`, `Countdown` |
124
+ | React Native tier | `RnView`, `RnText`, `RnScrollView`, `RnFlatList`, `RnSectionList`, `FlashList` — the same `sx` surface on plain React Native views |
125
+ | Molecules | `Label`, `LabeledContent`, `ListItem`, `Link`, `SearchBar`, `EmptyState`, `Collapsible`, `Pager`, `RadioGroup`, `Stepper`, `Tooltip`, `RnTooltip`, `NavigationBar`, `ScrollEdgeContainer` |
126
+ | Organisms | `Sheet`, `ActionSheet`, `Alert`, `Menu`, `ContextMenu`, `RnContextMenu`, `Form`, `SwipeActions`, `Snackbar`, `FabMenu` |
127
+ | Templates | `Screen` |
128
+
129
+ A few come from the package's own native module rather than `@expo/ui`: `GlassView` (iOS 26 Liquid
130
+ Glass around React Native children), `ScrollEdgeContainer` (the iOS 26 scroll edge effect under your
131
+ bars), `Countdown` (ticks and rolls its digits natively), `NavigationBar` (real `UINavigationBar`
132
+ items in a sheet), `RnContextMenu` (long-press menu with a custom preview), `RnTooltip` (rich,
133
+ controlled tooltip) and `FabMenu` (Material 3 Expressive on Android). Each falls back gracefully where
134
+ the platform lacks the feature.
135
+
136
+ ## Entry points
137
+
138
+ | Import | What it is |
139
+ | --- | --- |
140
+ | `@hzblj/kara-ui` | Components, `sx`, theme, `KaraProvider`, hooks. |
141
+ | `@hzblj/kara-ui/router` | `Tabs` (native tabs on Expo Router) and `navigationTheme(theme)` for expo-router's `ThemeProvider`. Needs `expo-router`. |
142
+ | `@hzblj/kara-ui/swift-ui` | The raw SwiftUI/UIKit views and modifiers of the native module (iOS only). |
143
+ | `@hzblj/kara-ui/jetpack-compose` | The raw Compose views and modifiers of the native module (Android only). |
144
+
145
+ ## Packages
146
+
147
+ `@hzblj/kara-ui` is all you install. It is built from scoped packages, versioned together, which you
148
+ never need to depend on directly:
149
+
150
+ | Package | |
151
+ | --- | --- |
152
+ | `@hzblj/kara-theme` | Tokens, palette, typography, `defineTheme`, `KaraProvider` |
153
+ | `@hzblj/kara-sx` | The `sx` styling engine |
154
+ | `@hzblj/kara-native` | The `KaraUI` Expo native module (Swift/Kotlin) and its bindings |
155
+ | `@hzblj/kara-components` | Atoms, molecules, organisms, templates |
156
+ | `@hzblj/kara-router` | `Tabs`, `navigationTheme` |
157
+ | `@hzblj/kara-expo-plugin` | The optional config plugin |
158
+
159
+ ## Development
160
+
161
+ All of them live in the [kara-ui monorepo](https://github.com/hzblj/kara-ui) together with an example
162
+ app (Showcase, Gallery and on-device Storybook). See the repository README.
163
+
164
+ ## License
165
+
166
+ MIT
package/app.plugin.js ADDED
@@ -0,0 +1,2 @@
1
+ // The Expo config plugin: `plugins: ['@hzblj/kara-ui']`. Lives in @hzblj/kara-expo-plugin.
2
+ module.exports = require('@hzblj/kara-expo-plugin/app.plugin.js')
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ export * from '@hzblj/kara-components';
4
+ export * from '@hzblj/kara-sx';
5
+ export * from '@hzblj/kara-theme';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,cAAc,wBAAwB;AACtC,cAAc,gBAAgB;AAC9B,cAAc,mBAAmB","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ export * from '@hzblj/kara-native/jetpack-compose';
4
+ //# sourceMappingURL=jetpack-compose.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["jetpack-compose.ts"],"mappings":";;AAAA,cAAc,oCAAoC","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ export * from '@hzblj/kara-router';
4
+ //# sourceMappingURL=router.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["router.ts"],"mappings":";;AAAA,cAAc,oBAAoB","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ export * from '@hzblj/kara-native/swift-ui';
4
+ //# sourceMappingURL=swift-ui.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["swift-ui.ts"],"mappings":";;AAAA,cAAc,6BAA6B","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ export * from '@hzblj/kara-components';
2
+ export * from '@hzblj/kara-sx';
3
+ export * from '@hzblj/kara-theme';
@@ -0,0 +1 @@
1
+ export * from '@hzblj/kara-native/jetpack-compose';
@@ -0,0 +1 @@
1
+ export * from '@hzblj/kara-router';
@@ -0,0 +1 @@
1
+ export * from '@hzblj/kara-native/swift-ui';
package/package.json CHANGED
@@ -1,6 +1,132 @@
1
1
  {
2
2
  "name": "@hzblj/kara-ui",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0",
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
+ "author": "Jan Blazej",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/hzblj/kara-ui.git",
10
+ "directory": "packages/kara-ui"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/hzblj/kara-ui/issues"
14
+ },
15
+ "homepage": "https://github.com/hzblj/kara-ui#readme",
16
+ "keywords": [
17
+ "react-native",
18
+ "expo",
19
+ "expo-ui",
20
+ "swiftui",
21
+ "jetpack-compose",
22
+ "design-system",
23
+ "ui-kit",
24
+ "components",
25
+ "liquid-glass",
26
+ "material-3",
27
+ "material-you",
28
+ "theme",
29
+ "tokens"
30
+ ],
31
+ "main": "./lib/module/index.js",
32
+ "types": "./lib/typescript/index.d.ts",
33
+ "exports": {
34
+ ".": {
35
+ "source": "./src/index.ts",
36
+ "types": "./lib/typescript/index.d.ts",
37
+ "default": "./lib/module/index.js"
38
+ },
39
+ "./router": {
40
+ "source": "./src/router.ts",
41
+ "types": "./lib/typescript/router.d.ts",
42
+ "default": "./lib/module/router.js"
43
+ },
44
+ "./swift-ui": {
45
+ "source": "./src/swift-ui.ts",
46
+ "types": "./lib/typescript/swift-ui.d.ts",
47
+ "default": "./lib/module/swift-ui.js"
48
+ },
49
+ "./jetpack-compose": {
50
+ "source": "./src/jetpack-compose.ts",
51
+ "types": "./lib/typescript/jetpack-compose.d.ts",
52
+ "default": "./lib/module/jetpack-compose.js"
53
+ },
54
+ "./app.plugin.js": "./app.plugin.js",
55
+ "./package.json": "./package.json"
56
+ },
57
+ "files": [
58
+ "src",
59
+ "lib",
60
+ "app.plugin.js",
61
+ "!**/*.stories.tsx",
62
+ "!**/contract.check.ts",
63
+ "!**/story-decorators.tsx",
64
+ "!**/__tests__"
65
+ ],
66
+ "scripts": {
67
+ "build": "bob build && tsc -p ./tsconfig.build.json && node ../../scripts/fallback-declarations.mjs",
68
+ "clean": "rm -rf lib",
69
+ "prepack": "yarn run -T turbo run build --filter=$npm_package_name...",
70
+ "lint": "yarn run -T concurrently \"yarn biome:check\" \"yarn tsc:check\"",
71
+ "lint:fix": "yarn run -T biome check --write .",
72
+ "biome:check": "yarn run -T biome check .",
73
+ "tsc:check": "yarn run -T concurrently \"tsc -p ./tsconfig.ios.json\" \"tsc -p ./tsconfig.android.json\""
74
+ },
75
+ "react-native-builder-bob": {
76
+ "source": "src",
77
+ "output": "lib",
78
+ "exclude": "{**/__tests__/**,**/__fixtures__/**,**/__mocks__/**,**/*.stories.tsx,**/contract.check.ts,**/story-decorators.tsx}",
79
+ "targets": [
80
+ [
81
+ "module",
82
+ {
83
+ "esm": true
84
+ }
85
+ ]
86
+ ]
87
+ },
88
+ "dependencies": {
89
+ "@hzblj/kara-components": "^0.1.0",
90
+ "@hzblj/kara-expo-plugin": "^0.1.0",
91
+ "@hzblj/kara-native": "^0.1.0",
92
+ "@hzblj/kara-router": "^0.1.0",
93
+ "@hzblj/kara-sx": "^0.1.0",
94
+ "@hzblj/kara-theme": "^0.1.0"
95
+ },
96
+ "peerDependencies": {
97
+ "@expo/ui": "~57.0.0",
98
+ "@expo/vector-icons": "*",
99
+ "@shopify/flash-list": ">=2.0.0",
100
+ "expo": "~57.0.0",
101
+ "expo-haptics": "*",
102
+ "expo-image": "*",
103
+ "expo-router": "*",
104
+ "react": "*",
105
+ "react-native": "*",
106
+ "react-native-reanimated": ">=4.0.0"
107
+ },
108
+ "peerDependenciesMeta": {
109
+ "expo-router": {
110
+ "optional": true
111
+ }
112
+ },
113
+ "devDependencies": {
114
+ "@expo/ui": "~57.0.18",
115
+ "@expo/vector-icons": "^15.1.1",
116
+ "@shopify/flash-list": "^2.3.2",
117
+ "@types/react": "~19.2.18",
118
+ "expo": "~57.0.22",
119
+ "expo-haptics": "~57.0.3",
120
+ "expo-image": "~57.0.5",
121
+ "expo-router": "~57.0.21",
122
+ "react": "19.2.3",
123
+ "react-native": "0.86.3",
124
+ "react-native-builder-bob": "^0.43.0",
125
+ "react-native-reanimated": "4.5.1",
126
+ "react-native-worklets": "0.10.1",
127
+ "typescript": "~7.0.2"
128
+ },
129
+ "publishConfig": {
130
+ "access": "public"
131
+ }
6
132
  }
package/src/index.ts ADDED
@@ -0,0 +1,3 @@
1
+ export * from '@hzblj/kara-components'
2
+ export * from '@hzblj/kara-sx'
3
+ export * from '@hzblj/kara-theme'
@@ -0,0 +1 @@
1
+ export * from '@hzblj/kara-native/jetpack-compose'
package/src/router.ts ADDED
@@ -0,0 +1 @@
1
+ export * from '@hzblj/kara-router'
@@ -0,0 +1 @@
1
+ export * from '@hzblj/kara-native/swift-ui'