@trainvent/arcubic 0.3.1 → 0.3.2

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
@@ -1,26 +1,37 @@
1
1
  # @trainvent/arcubic
2
2
 
3
- React 19 components, CSS tokens and bundled OFL fonts. Import the stylesheet once in your application layout:
3
+ React 19 components, CSS tokens and bundled OFL fonts.
4
+
5
+ Install from the public npm registry:
6
+
7
+ ```sh
8
+ npm install --save-exact @trainvent/arcubic
9
+ ```
10
+
11
+ Commit package.json and package-lock.json together. The exact version keeps deployments reproducible; Dependabot can propose new releases in a PR without manually editing either file.
12
+
13
+ Import the stylesheet once in your application layout:
4
14
 
5
15
  ```tsx
6
16
  import '@trainvent/arcubic/styles.css';
7
- import { Theme, Button } from '@trainvent/arcubic';
8
-
9
- <Theme appearance="dark"><Button>Get started</Button></Theme>
10
17
  ```
11
18
 
12
- In Next.js, render Theme inside a client provider. The package has a `use client` boundary and includes TypeScript declarations. Theme supplies the Arcubic classes, teal accent, gray neutrals, square geometry and an overlay host for themed portals. Set `appearance` to `light` or `dark`; persistence belongs to the application.
19
+ Use the components inside a theme. In Next.js, this provider component is a client component:
13
20
 
14
- Install from the public npm registry:
21
+ ```tsx
22
+ 'use client';
15
23
 
16
- ```sh
17
- npm install --save-exact @trainvent/arcubic
24
+ import { Theme, Button } from '@trainvent/arcubic';
25
+
26
+ export default function Example() {
27
+ return <Theme appearance="dark"><Button>Get started</Button></Theme>;
28
+ }
18
29
  ```
19
30
 
20
- Commit package.json and package-lock.json together. The exact version keeps deployments reproducible; Dependabot can propose new releases in a PR without manually editing either file.
31
+ In Next.js, render Theme inside a client provider. The package has a `use client` boundary and includes TypeScript declarations. Theme supplies the Arcubic classes, teal accent, gray neutrals, square geometry and an overlay host for themed portals. Set `appearance` to `light` or `dark`; persistence belongs to the application.
21
32
 
22
33
  Build with `npm run build:react` or create an installable archive with `npm run pack:react` from the repository root (Node 24). The package version follows the root version. `npm run package:release` includes the React archive with the other theme artifacts. Pushing a numeric version tag matching package.json publishes to npm through `.github/workflows/publish-npm.yml` and creates companion downloads through `.github/workflows/release.yml`.
23
34
 
24
- Maintainer setup is documented in `docs/npm-publishing.md`. GitHub release archives remain an alternative download format; consumers do not need their URLs for normal npm installation.
35
+ See the [maintainer release guide](https://github.com/trainvent/arcubic/blob/main/docs/npm-publishing.md) for the configured publishing workflow. GitHub release archives remain an alternative download format; consumers do not need their URLs for normal npm installation.
25
36
 
26
37
  `styles.css` includes Radix base styles, tokens, components and local fonts. `tokens.css` and `fonts.css` are separate exports for applications needing only those layers. Chakra Petch is the interface font, Lora the reading font, and Geist Mono the code font. Font licenses ship beside the font files.
package/dist/styles.css CHANGED
@@ -27109,8 +27109,8 @@ SOFTWARE.
27109
27109
  --arc-switch-thumb-ratio: 0.8181818181818182;
27110
27110
  --arc-switch-inset-ratio: 0.18181818181818182;
27111
27111
  --arc-switch-travel-ratio: 0.7272727272727273;
27112
- --arc-switch-triangle-width-ratio: 0.5909090909090909;
27113
- --arc-switch-triangle-height-ratio: 0.5;
27112
+ --arc-switch-triangle-width-ratio: 0.7272727272727273;
27113
+ --arc-switch-triangle-height-ratio: 0.6298366572977735;
27114
27114
  --arc-switch-slant-ratio: 0.5773502691896257;
27115
27115
  }
27116
27116
 
@@ -27625,10 +27625,14 @@ SOFTWARE.
27625
27625
  --ds-inset:calc(var(--direction-switch-height) * var(--arc-switch-inset-ratio,.1818181818));
27626
27626
  --ds-travel:calc(var(--direction-switch-height) * var(--arc-switch-travel-ratio,.7272727273));
27627
27627
  --ds-slant:calc(var(--direction-switch-height) * var(--arc-switch-slant-ratio,.5773502692));
27628
- --ds-inner-height:calc(var(--direction-switch-height) - var(--ds-rim) * 2);
27629
- --ds-inner-slant:calc(var(--ds-inner-height) * .5773502692);
27628
+ --ds-corner:var(--ds-rim);
27629
+ --ds-inner-slant:calc(var(--ds-chamber-height) * var(--arc-switch-slant-ratio,.5773502692));
27630
27630
  --ds-triangle-width:calc(var(--direction-switch-height) * var(--arc-switch-triangle-width-ratio,.5909090909));
27631
27631
  --ds-triangle-height:calc(var(--direction-switch-height) * var(--arc-switch-triangle-height-ratio,.5));
27632
+ --ds-chamber-width:calc(var(--ds-width) - var(--ds-rim) * 3.5);
27633
+ --ds-chamber-height:calc(var(--direction-switch-height) - var(--ds-rim));
27634
+ --ds-travel-x:calc(var(--ds-chamber-width) - var(--ds-triangle-width));
27635
+ --ds-travel-y:calc(var(--ds-chamber-height) - var(--ds-triangle-height));
27632
27636
  width:var(--ds-width);min-width:var(--ds-width);height:var(--direction-switch-height);
27633
27637
  position:relative;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;vertical-align:middle;
27634
27638
  border:0!important;border-radius:0;padding:0;overflow:visible;isolation:isolate;box-shadow:none!important;
@@ -27636,7 +27640,7 @@ SOFTWARE.
27636
27640
  background:linear-gradient(120deg,var(--ui-high) 0%,var(--ui-high) 25%,var(--gray-6) 46%,var(--ui-low) 72%,var(--ui-low) 100%)!important;
27637
27641
  }
27638
27642
  .arcubic-ui .rt-SwitchRoot::before{
27639
- content:'';position:absolute;inset:var(--ds-rim);z-index:-1;border:0;border-radius:0;
27643
+ content:'';position:absolute;inset:var(--ds-rim);width:var(--ds-chamber-width);height:var(--ds-chamber-height);z-index:-1;border:0;border-radius:0;
27640
27644
  clip-path:polygon(0 0,calc(100% - var(--ds-inner-slant)) 0,100% 100%,var(--ds-inner-slant) 100%);
27641
27645
  background:linear-gradient(180deg,var(--gray-2),var(--gray-4));
27642
27646
  box-shadow:inset 0 calc(var(--ds-rim) * .5) var(--ds-rim) #00000040!important;
@@ -27647,18 +27651,17 @@ SOFTWARE.
27647
27651
  }
27648
27652
  .arcubic-ui .rt-SwitchRoot[data-state=checked]::before{background:linear-gradient(180deg,var(--teal-2),var(--teal-4))}
27649
27653
  .arcubic-ui .rt-SwitchThumb{
27650
- position:absolute!important;inset:auto!important;left:var(--ds-inset)!important;top:var(--ds-rim)!important;
27651
- width:var(--ds-thumb)!important;height:var(--ds-thumb)!important;
27654
+ position:absolute!important;inset:auto!important;left:var(--ds-corner)!important;top:var(--ds-rim)!important;
27655
+ width:var(--ds-triangle-width)!important;height:var(--ds-triangle-height)!important;
27652
27656
  display:grid;place-items:center;flex:none;border:0!important;border-radius:0!important;
27653
27657
  background:transparent!important;box-shadow:none!important;pointer-events:none;
27654
27658
  transform:translateX(0)!important;transition:transform .25s cubic-bezier(.2,.8,.2,1);
27655
27659
  }
27656
- .arcubic-ui .rt-SwitchRoot[data-state=checked] .rt-SwitchThumb{transform:translateX(var(--ds-travel))!important}
27660
+ .arcubic-ui .rt-SwitchRoot[data-state=checked] .rt-SwitchThumb{transform:translate(var(--ds-travel-x),var(--ds-travel-y))!important}
27657
27661
  .arcubic-ui .rt-SwitchThumb::after{
27658
27662
  content:'';display:block;width:var(--ds-triangle-width);height:var(--ds-triangle-height);pointer-events:none;
27659
27663
  clip-path:polygon(50% 0,100% 100%,0 100%);transform:rotate(180deg);transform-origin:50% 50%;
27660
27664
  background:linear-gradient(145deg,var(--gray-12) 20%,var(--gray-10) 85%);
27661
- filter:drop-shadow(0 calc(var(--ds-rim) * .5) 0 var(--ui-low));
27662
27665
  transition:transform .25s cubic-bezier(.2,.8,.2,1),background-color .18s ease;
27663
27666
  }
27664
27667
  .arcubic-ui .rt-SwitchRoot[data-state=checked] .rt-SwitchThumb::after{
package/dist/tokens.css CHANGED
@@ -41,8 +41,8 @@ SOFTWARE.
41
41
  --arc-switch-thumb-ratio: 0.8181818181818182;
42
42
  --arc-switch-inset-ratio: 0.18181818181818182;
43
43
  --arc-switch-travel-ratio: 0.7272727272727273;
44
- --arc-switch-triangle-width-ratio: 0.5909090909090909;
45
- --arc-switch-triangle-height-ratio: 0.5;
44
+ --arc-switch-triangle-width-ratio: 0.7272727272727273;
45
+ --arc-switch-triangle-height-ratio: 0.6298366572977735;
46
46
  --arc-switch-slant-ratio: 0.5773502691896257;
47
47
  }
48
48
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trainvent/arcubic",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "files": [