@joralvmel/cosmos-charts-native 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/LICENSE +21 -0
- package/README.md +11 -2
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/llms.md +23 -0
- package/package.json +56 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jorge Andrés Álvarez Melchor (joralvmel)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @joralvmel/cosmos-charts-native
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
React Native charts for [Cosmos UI](../../README.md).
|
|
4
|
+
|
|
5
|
+
> Status: early development. The API below is the current skeleton.
|
|
6
|
+
|
|
7
|
+
React Native charts (`react-native-svg`) built on `@joralvmel/cosmos-charts-core`. Currently exposes
|
|
8
|
+
`seriesColor(theme, index)` for the active Cosmos theme.
|
|
9
|
+
|
|
10
|
+
## License
|
|
11
|
+
|
|
12
|
+
MIT
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { NativeTheme } from '@joralvmel/cosmos-tokens/native';
|
|
2
|
+
export { linearScale, niceDomain, ticks } from '@joralvmel/cosmos-charts-core';
|
|
3
|
+
/** Color of a series for `react-native-svg`, taken from the active Cosmos theme. */
|
|
4
|
+
export declare function seriesColor(theme: Pick<NativeTheme, 'colors'>, index: number): string;
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAEnE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAE/E,oFAAoF;AACpF,wBAAgB,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAErF"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { seriesColorToken } from '@joralvmel/cosmos-charts-core';
|
|
2
|
+
export { linearScale, niceDomain, ticks } from '@joralvmel/cosmos-charts-core';
|
|
3
|
+
/** Color of a series for `react-native-svg`, taken from the active Cosmos theme. */
|
|
4
|
+
export function seriesColor(theme, index) {
|
|
5
|
+
return theme.colors[seriesColorToken(index)];
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAE/E,oFAAoF;AACpF,MAAM,UAAU,WAAW,CAAC,KAAkC,EAAE,KAAa;IAC3E,OAAO,KAAK,CAAC,MAAM,CAAC,gBAAgB,CAAC,KAAK,CAAgC,CAAC,CAAC;AAC9E,CAAC"}
|
package/llms.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# @joralvmel/cosmos-charts-native
|
|
2
|
+
|
|
3
|
+
React Native charts (`react-native-svg`) built on the shared chart layout.
|
|
4
|
+
|
|
5
|
+
<!-- generated:start (npm run llms, do not edit this block by hand) -->
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @joralvmel/cosmos-charts-native
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Status: early development; the API may change. Component status: https://joralvmel.github.io/cosmos-ui/components/status/
|
|
14
|
+
|
|
15
|
+
## Rules for AI assistants
|
|
16
|
+
|
|
17
|
+
- Use Cosmos components before writing custom UI; check `list_components` / the component status page for what exists.
|
|
18
|
+
- Style with Cosmos tokens: `var(--cosm-*)` in CSS or the Tailwind theme utilities (`bg-primary`, `text-fg-muted`, `rounded-md`). Never hard-code colors.
|
|
19
|
+
- Set the theme and mode with `data-theme` and `data-mode` on the root element (or `CosmosThemeProvider` on React Native).
|
|
20
|
+
- Keep accessibility: give icon-only buttons a `label`, never rely on color alone, keep keyboard support.
|
|
21
|
+
- Never render untrusted HTML (`innerHTML`, `dangerouslySetInnerHTML`) and never build class names from user input.
|
|
22
|
+
|
|
23
|
+
<!-- generated:end -->
|
package/package.json
CHANGED
|
@@ -1,6 +1,58 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@joralvmel/cosmos-charts-native",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Cosmos UI charts for React Native, built on the shared chart layout.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"charts",
|
|
7
|
+
"react-native",
|
|
8
|
+
"svg",
|
|
9
|
+
"cosmos-ui"
|
|
10
|
+
],
|
|
11
|
+
"type": "module",
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"author": "joralvmel",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/joralvmel/cosmos-ui.git",
|
|
17
|
+
"directory": "packages/charts-native"
|
|
18
|
+
},
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public"
|
|
21
|
+
},
|
|
22
|
+
"sideEffects": false,
|
|
23
|
+
"files": [
|
|
24
|
+
"dist",
|
|
25
|
+
"llms.md"
|
|
26
|
+
],
|
|
27
|
+
"main": "./dist/index.js",
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
29
|
+
"exports": {
|
|
30
|
+
".": {
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"default": "./dist/index.js"
|
|
33
|
+
},
|
|
34
|
+
"./llms.md": "./llms.md",
|
|
35
|
+
"./package.json": "./package.json"
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "tsc -p tsconfig.build.json",
|
|
39
|
+
"dev": "tsc -p tsconfig.build.json --watch --preserveWatchOutput",
|
|
40
|
+
"typecheck": "tsc -p tsconfig.json",
|
|
41
|
+
"test": "vitest run",
|
|
42
|
+
"clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\""
|
|
43
|
+
},
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"@joralvmel/cosmos-charts-core": "^0.1.0",
|
|
46
|
+
"@joralvmel/cosmos-tokens": "^0.1.0"
|
|
47
|
+
},
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"react": "^19.0.0",
|
|
50
|
+
"react-native": ">=0.80.0",
|
|
51
|
+
"react-native-svg": ">=15.0.0"
|
|
52
|
+
},
|
|
53
|
+
"peerDependenciesMeta": {
|
|
54
|
+
"react-native-svg": {
|
|
55
|
+
"optional": true
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|