@octane-xplat/bamboo 0.8.0 → 0.9.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.
Files changed (3) hide show
  1. package/README.md +31 -0
  2. package/package.json +5 -5
  3. package/src/config.ts +7 -15
package/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # `@octane-xplat/bamboo`
2
+
3
+ Bamboo CSS integration defaults for Octane xplat apps — the glue between
4
+ [`@bamboocss`](https://github.com/aleclarson/bamboo) portable utilities
5
+ and the framework stylesheet. It exports a preset scoped to the CSS subset
6
+ both NativeScript and browsers support (`xplatPortablePreset`, the `vx-*`
7
+ utility classes on framework token vars), plus layer ordering that keeps
8
+ utilities under the app's own CSS.
9
+
10
+ ```sh
11
+ pnpm add -D @octane-xplat/bamboo
12
+ ```
13
+
14
+ Two entry points:
15
+
16
+ ```ts
17
+ // bamboo.config.ts — ./ or ./config
18
+ import { xplatBambooConfig, xplatPortablePreset } from '@octane-xplat/bamboo'
19
+
20
+ // vite.config.ts — ./vite
21
+ import { xplatBamboo } from '@octane-xplat/bamboo/vite'
22
+
23
+ plugins: [xplatBamboo()] // { native: true } for the native build
24
+ ```
25
+
26
+ Preflight is off by default and tokens land on `:root, .ns-root`. The
27
+ xplat NativeScript CSS transform unwraps the emitted `@layer` blocks for
28
+ native builds (the NS parser drops unknown at-rules); browsers keep the
29
+ layers, which is what lets app CSS stay unlayered on top.
30
+
31
+ Guide: [Styling screens](../../docs/styling.md).
package/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "@octane-xplat/bamboo",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "Bamboo CSS integration defaults for Octane xplat apps",
5
5
  "keywords": [
6
6
  "bamboo",
7
7
  "css",
8
+ "nativescript",
8
9
  "octane",
9
- "xplat",
10
- "nativescript"
10
+ "xplat"
11
11
  ],
12
- "license": "MIT",
13
12
  "homepage": "https://github.com/octane-xplat/octane-xplat/tree/main/packages/bamboo",
13
+ "license": "MIT",
14
14
  "repository": {
15
15
  "type": "git",
16
- "url": "git+https://github.com/octane-xplat/octane-xplat.git",
16
+ "url": "https://github.com/octane-xplat/octane-xplat",
17
17
  "directory": "packages/bamboo"
18
18
  },
19
19
  "files": [
package/src/config.ts CHANGED
@@ -40,20 +40,12 @@ const portableProperties = [
40
40
  ] as const
41
41
 
42
42
  const colors = Object.fromEntries(
43
- [
44
- 'danger',
45
- 'onprimary',
46
- 'primary',
47
- 'surface',
48
- 'surface-secondary',
49
- 'text',
50
- 'text-secondary',
51
- ].map((name) => [name, { value: `var(--color-${name})` }]),
43
+ ['danger', 'onprimary', 'primary', 'surface', 'surface-secondary', 'text', 'text-secondary'].map(
44
+ (name) => [name, { value: `var(--color-${name})` }],
45
+ ),
52
46
  )
53
47
 
54
- const spacing = Object.fromEntries(
55
- ['4'].map((name) => [name, { value: `var(--space-${name})` }]),
56
- )
48
+ const spacing = Object.fromEntries(['4'].map((name) => [name, { value: `var(--space-${name})` }]))
57
49
 
58
50
  const radii = Object.fromEntries(
59
51
  ['sm', 'md', 'lg', 'xl'].map((name) => [name, { value: `var(--radius-${name})` }]),
@@ -112,6 +104,6 @@ export const xplatBambooConfig = {
112
104
  utilities: portableUtilities,
113
105
  theme: portableTheme,
114
106
  } satisfies Pick<
115
- UserConfig,
116
- 'preflight' | 'cssVarRoot' | 'layers' | 'presets' | 'utilities' | 'theme'
117
- >
107
+ UserConfig,
108
+ 'preflight' | 'cssVarRoot' | 'layers' | 'presets' | 'utilities' | 'theme'
109
+ >