@gryt/ui-native 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
CHANGED
|
@@ -3,19 +3,34 @@
|
|
|
3
3
|
Gryt's design system on React Native. The same tokens as `@gryt/ui`, a different
|
|
4
4
|
renderer.
|
|
5
5
|
|
|
6
|
+
## Install
|
|
7
|
+
|
|
8
|
+
```sh
|
|
9
|
+
npm install @gryt/ui-native
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
bun add @gryt/ui-native
|
|
14
|
+
pnpm add @gryt/ui-native
|
|
15
|
+
yarn add @gryt/ui-native
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Your app provides `react` and `react-native`. `@gryt/ui` comes with it, for the
|
|
19
|
+
colour maths described below, and nothing from its main entry is loaded.
|
|
20
|
+
|
|
6
21
|
## Status
|
|
7
22
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
a reason to install it.
|
|
23
|
+
Thirty-three components across the overlays, the form controls, and the layout
|
|
24
|
+
and feedback set.
|
|
11
25
|
|
|
12
|
-
|
|
13
|
-
Composer,
|
|
14
|
-
PreviewCard
|
|
15
|
-
|
|
26
|
+
Ten are still missing, against 42 in `@gryt/ui`: Autocomplete, Combobox,
|
|
27
|
+
Composer, ContextMenu, ConversationItem, Form, IconButton, MessageBubble,
|
|
28
|
+
NavigationMenu and PreviewCard. Most of them are Gryt-specific and want a screen
|
|
29
|
+
to design against rather than a web component to copy.
|
|
16
30
|
|
|
17
31
|
Tracked in GRYT-342. The goal is 1:1 with `@gryt/ui`: every component, matching
|
|
18
|
-
behaviour, no mobile-only limits.
|
|
32
|
+
behaviour, no mobile-only limits. The exceptions below are the honest distance
|
|
33
|
+
from that.
|
|
19
34
|
|
|
20
35
|
## The tokens are imported, not copied
|
|
21
36
|
|
|
@@ -76,11 +91,14 @@ goal, so the honest list is worth more than a claim of parity that isn't one.
|
|
|
76
91
|
|
|
77
92
|
## Not Node-importable
|
|
78
93
|
|
|
79
|
-
The build is unbundled `tsc` output
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
94
|
+
The build is unbundled `tsc` output, which is what Metro wants: it resolves
|
|
95
|
+
`.native.ts` and `.web.ts` per file, and a bundle would have no files left to
|
|
96
|
+
pick between. A post-build step appends the `.js` extensions Node's resolver
|
|
97
|
+
needs, so the module graph resolves rather than only working under a bundler.
|
|
98
|
+
|
|
99
|
+
Importing `dist/index.js` from plain Node still fails, on `react-native`, which
|
|
100
|
+
Node cannot load either. Nothing is lost by that, but do not add a Node-side
|
|
101
|
+
consumer expecting it to work.
|
|
84
102
|
|
|
85
103
|
The theme layer is testable without a native runtime, which is what
|
|
86
104
|
`createNativeTheme.test.ts` covers.
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { grytTokens } from "@gryt/
|
|
1
|
+
import { grytTokens } from "@gryt/theme";
|
|
2
2
|
/**
|
|
3
3
|
* The same theme, without CSS.
|
|
4
4
|
*
|
|
5
|
-
* `createGrytTheme` in `@gryt/
|
|
5
|
+
* `createGrytTheme` in `@gryt/theme` returns `CSSProperties` — a map of
|
|
6
6
|
* `--gryt-accent-9` style custom properties. React Native has no custom
|
|
7
7
|
* properties and no cascade, so it cannot consume that at all.
|
|
8
8
|
*
|
|
9
9
|
* What it can consume is the maths underneath. `neutralScale`, `hueScale` and
|
|
10
|
-
* `alphaScale` are exported from `@gryt/
|
|
10
|
+
* `alphaScale` are exported from `@gryt/theme` for exactly this, so the two
|
|
11
11
|
* renderers compute their ramps from one implementation of the OKLab
|
|
12
12
|
* conversions rather than two. A copy here would drift the moment somebody
|
|
13
13
|
* tunes a curve on the web.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createNativeTheme.d.ts","sourceRoot":"","sources":["../../src/theme/createNativeTheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,EAKX,MAAM,
|
|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AAM,EAAE;QACN,OAAO,EAAE,IAAI,CAAC;QACd,MAAM,EAAE,IAAI,CAAC;QACb,SAAS,EAAE,IAAI,CAAC;QAChB,OAAO,EAAE,IAAI,CAAC;QACd,MAAM,EAAE,IAAI,CAAC;QACb,OAAO,EAAE,IAAI,CAAC;KACf,CAAC;IACF;;;;;;OAMG;IACH,KAAK,EAAE;QACL,OAAO,EAAE,IAAI,CAAC;QACd,MAAM,EAAE,IAAI,CAAC;KACd,CAAC;IACF,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACzE,4EAA4E;IAC5E,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CAClC;AAID,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,kBAAuB,GAAG,WAAW,CAkE/E;AAED,eAAO,MAAM,SAAS,aAAsB,CAAC;AAC7C,eAAO,MAAM,UAAU,aAA6C,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { alphaScale, grytLightTokens, grytTokens, hueScale, hueScaleLight, neutralScale, neutralScaleLight, } from "@gryt/
|
|
1
|
+
import { alphaScale, grytLightTokens, grytTokens, hueScale, hueScaleLight, neutralScale, neutralScaleLight, } from "@gryt/theme";
|
|
2
2
|
const SPACE_UNIT = 4;
|
|
3
3
|
export function createNativeTheme(options = {}) {
|
|
4
4
|
const light = options.appearance === "light";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gryt/ui-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Gryt's design system on React Native. Same tokens as @gryt/ui, a different renderer.",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"react-native": ">=0.76.0"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@gryt/
|
|
38
|
+
"@gryt/theme": "^0.1.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@types/react": "^19.0.0",
|