@tangle-network/blueprint-ui 0.1.0 → 0.1.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.
Files changed (48) hide show
  1. package/README.md +47 -11
  2. package/dist/BlueprintHostPanel-6iVEh-f1.d.ts +39 -0
  3. package/dist/chunk-37ADATBT.js +55 -0
  4. package/dist/chunk-37ADATBT.js.map +1 -0
  5. package/dist/chunk-A6PJT5YQ.js +1180 -0
  6. package/dist/chunk-A6PJT5YQ.js.map +1 -0
  7. package/dist/chunk-GD3AZEJL.js +327 -0
  8. package/dist/chunk-GD3AZEJL.js.map +1 -0
  9. package/dist/components.d.ts +179 -0
  10. package/dist/components.js +1127 -0
  11. package/dist/components.js.map +1 -0
  12. package/dist/host.d.ts +96 -0
  13. package/dist/host.js +39 -0
  14. package/dist/host.js.map +1 -0
  15. package/dist/index.d.ts +8470 -0
  16. package/dist/index.js +841 -0
  17. package/dist/index.js.map +1 -0
  18. package/dist/preset.d.ts +60 -0
  19. package/dist/preset.js +7 -0
  20. package/dist/preset.js.map +1 -0
  21. package/dist/registry-JhwB9BPD.d.ts +87 -0
  22. package/dist/styles.css +559 -0
  23. package/package.json +42 -13
  24. package/src/components/layout/AppDocument.tsx +1 -1
  25. package/src/components/layout/ChainSwitcher.tsx +27 -10
  26. package/src/components/layout/Web3Shell.tsx +81 -6
  27. package/src/components/web3/ConnectWalletCta.tsx +21 -0
  28. package/src/components.ts +6 -0
  29. package/src/contracts/abi.ts +10 -1
  30. package/src/contracts/chains.ts +23 -10
  31. package/src/contracts/publicClient.ts +52 -10
  32. package/src/hooks/useOperators.ts +203 -96
  33. package/src/hooks/useProvisionProgress.ts +2 -1
  34. package/src/hooks/useQuotes.ts +69 -14
  35. package/src/hooks/useSessionAuth.ts +2 -1
  36. package/src/hooks/useSidecarAuth.ts +173 -0
  37. package/src/hooks/useWagmiSidecarAuth.ts +11 -0
  38. package/src/hooks/useWalletEthBalance.ts +68 -0
  39. package/src/host/components/BlueprintHostHero.tsx +91 -0
  40. package/src/host/components/BlueprintHostPanel.tsx +24 -0
  41. package/src/host/index.ts +42 -0
  42. package/src/host/resolver.ts +204 -0
  43. package/src/host/types.ts +111 -0
  44. package/src/index.ts +48 -2
  45. package/src/stores/infra.ts +3 -2
  46. package/src/styles.css +128 -0
  47. package/src/utils/env.ts +22 -0
  48. package/src/utils/web3.ts +9 -3
package/README.md CHANGED
@@ -11,7 +11,7 @@
11
11
 
12
12
  ---
13
13
 
14
- A TypeScript/React package that provides the building blocks for blueprint UIs on the Tangle Network. Designed to be consumed as a source dependency (no build step required) by apps using Vite or similar bundlers.
14
+ A TypeScript/React package that provides the building blocks for blueprint UIs on the Tangle Network. The package now ships compiled ESM output plus a package-owned stylesheet so consuming apps can treat it like a normal library instead of compiling its source directly.
15
15
 
16
16
  ## What's Included
17
17
 
@@ -74,28 +74,30 @@ Keep in app-local code:
74
74
  - **`registerBlueprint`** / **`getBlueprint`** — Register and look up blueprint definitions
75
75
  - **`JobDefinition`** — Declarative job schema with field types, ABI metadata, and categories
76
76
 
77
- ## Installation
78
77
  ## Installation
79
78
 
80
79
  ```bash
81
- # As a git dependency (recommended for Tangle apps)
82
- pnpm add github:tangle-network/blueprint-ui
80
+ npm install @tangle-network/blueprint-ui
81
+ # or
82
+ pnpm add @tangle-network/blueprint-ui
83
83
  ```
84
84
 
85
+ Package: https://www.npmjs.com/package/@tangle-network/blueprint-ui
86
+
85
87
  ## Publishing
86
88
 
87
89
  Automated npm publishing is configured via GitHub Actions with npm Trusted Publishing (OIDC):
88
90
  - Workflow: `.github/workflows/publish-npm.yml`
89
91
  - Triggers:
90
- - GitHub Release published (`vX.Y.Z`)
91
- - Manual `workflow_dispatch`
92
+ - Push tag `blueprint-ui-vX.Y.Z`
93
+ - Manual `workflow_dispatch` with `version` input
92
94
 
93
95
  No long-lived npm token is required once trusted publishing is configured.
94
96
 
95
97
  Release flow:
96
98
  1. Bump `package.json` version.
97
- 2. Create and publish a GitHub release tagged `v<same-version>`.
98
- 3. Workflow typechecks and runs `npm publish --access public`.
99
+ 2. Push tag `blueprint-ui-v<same-version>`.
100
+ 3. Workflow typechecks and runs `npm publish --provenance --access public`.
99
101
 
100
102
  Trusted publishing setup (one-time in npm):
101
103
  1. Open npm package settings for `@tangle-network/blueprint-ui`.
@@ -111,14 +113,48 @@ If npm does not allow configuring trusted publishing before first publish, do a
111
113
  ## Usage
112
114
 
113
115
  ```tsx
116
+ import '@tangle-network/blueprint-ui/styles.css';
117
+
114
118
  // Import hooks and utilities from the main entry
115
- import { useSubmitJob, useJobForm, encodeJobArgs } from '@tangle-network/blueprint-ui';
119
+ import {
120
+ useSubmitJob,
121
+ useJobForm,
122
+ encodeJobArgs,
123
+ discoverOperatorsWithClient,
124
+ } from '@tangle-network/blueprint-ui';
116
125
 
117
126
  // Import UI components from the /components entry
118
127
  import { Button, Card, FormField } from '@tangle-network/blueprint-ui/components';
119
128
  ```
120
129
 
121
- The package uses source-level exports (`main` and `types` both point to `.ts` files). Your bundler must support TypeScript resolution — Vite works out of the box.
130
+ The package exports compiled files from `dist/`, so consumers do not need TypeScript-in-`node_modules` support anymore.
131
+
132
+ ## Styling Setup
133
+
134
+ Import the package stylesheet once near your app entry:
135
+
136
+ ```tsx
137
+ import '@tangle-network/blueprint-ui/styles.css';
138
+ ```
139
+
140
+ That stylesheet provides:
141
+ - package-owned helper classes used by shared components such as `glass-card`, `font-display`, and `font-data`
142
+ - generated utility CSS for the shared components themselves
143
+ - a small compatibility layer that maps generic `--bp-*` tokens to `cloud` tokens by default
144
+
145
+ If you want the generic shared components to follow a different token family, you can either set the `--bp-*` variables directly or scope them with one of the helper classes:
146
+
147
+ ```tsx
148
+ <div className="bp-tone-arena">
149
+ <SomeBlueprintUiComponent />
150
+ </div>
151
+ ```
152
+
153
+ ## Migration Notes
154
+
155
+ - Preferred path: import `@tangle-network/blueprint-ui/styles.css` and stop scanning package source from the consumer app.
156
+ - Compatibility bridge: `src/` is still published for now, and `blueprintUiContentGlobs` remains available for apps migrating off the old source-scanning setup.
157
+ - The next cleanup step in consumer apps is usually removing custom Vite/Uno workarounds that existed only to compile or scan `blueprint-ui` source.
122
158
 
123
159
  ## Peer Dependencies
124
160
 
@@ -148,7 +184,7 @@ Licensed under either of [Apache License, Version 2.0](http://www.apache.org/lic
148
184
  A React component library providing UI primitives, hooks, and contract utilities for building applications on Tangle Network.
149
185
 
150
186
  **Do I need to build this package before using it?**
151
- No. It is designed as a source dependency consumed directly by Vite or similar bundlers with no build step required.
187
+ No. Published consumers use the compiled `dist/` output. Only this repo itself needs to run the build before publish.
152
188
 
153
189
  **What framework does blueprint-ui support?**
154
190
  React with TypeScript. Components use Radix UI primitives and Tailwind CSS for styling.
@@ -0,0 +1,39 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+ import * as class_variance_authority_types from 'class-variance-authority/types';
4
+ import { VariantProps } from 'class-variance-authority';
5
+
6
+ declare const buttonVariants: (props?: ({
7
+ variant?: "default" | "link" | "success" | "secondary" | "destructive" | "outline" | "ghost" | null | undefined;
8
+ size?: "default" | "sm" | "lg" | "icon" | "icon-sm" | null | undefined;
9
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
10
+ declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
11
+ asChild?: boolean;
12
+ }): react_jsx_runtime.JSX.Element;
13
+
14
+ type Action = {
15
+ label: string;
16
+ href?: string;
17
+ onClick?: () => void;
18
+ variant?: React.ComponentProps<typeof Button>['variant'];
19
+ disabled?: boolean;
20
+ };
21
+ type BlueprintHostHeroProps = {
22
+ title: string;
23
+ tagline?: string;
24
+ description?: string;
25
+ badges?: string[];
26
+ actions?: Action[];
27
+ children?: React.ReactNode;
28
+ className?: string;
29
+ };
30
+ declare function BlueprintHostHero({ title, tagline, description, badges, actions, children, className, }: BlueprintHostHeroProps): react_jsx_runtime.JSX.Element;
31
+
32
+ type BlueprintHostPanelProps = {
33
+ title: string;
34
+ children: React.ReactNode;
35
+ className?: string;
36
+ };
37
+ declare function BlueprintHostPanel({ title, children, className, }: BlueprintHostPanelProps): react_jsx_runtime.JSX.Element;
38
+
39
+ export { BlueprintHostHero as B, type BlueprintHostHeroProps as a, BlueprintHostPanel as b, type BlueprintHostPanelProps as c, Button as d, buttonVariants as e };
@@ -0,0 +1,55 @@
1
+ // src/preset.ts
2
+ function bpThemeTokens(prefix) {
3
+ return {
4
+ elements: {
5
+ borderColor: `var(--${prefix}-elements-borderColor)`,
6
+ borderColorActive: `var(--${prefix}-elements-borderColorActive)`,
7
+ background: {
8
+ depth: {
9
+ 1: `var(--${prefix}-elements-bg-depth-1)`,
10
+ 2: `var(--${prefix}-elements-bg-depth-2)`,
11
+ 3: `var(--${prefix}-elements-bg-depth-3)`,
12
+ 4: `var(--${prefix}-elements-bg-depth-4)`
13
+ }
14
+ },
15
+ textPrimary: `var(--${prefix}-elements-textPrimary)`,
16
+ textSecondary: `var(--${prefix}-elements-textSecondary)`,
17
+ textTertiary: `var(--${prefix}-elements-textTertiary)`,
18
+ button: {
19
+ primary: {
20
+ background: `var(--${prefix}-elements-button-primary-background)`,
21
+ backgroundHover: `var(--${prefix}-elements-button-primary-backgroundHover)`,
22
+ text: `var(--${prefix}-elements-button-primary-text)`
23
+ },
24
+ secondary: {
25
+ background: `var(--${prefix}-elements-button-secondary-background)`,
26
+ backgroundHover: `var(--${prefix}-elements-button-secondary-backgroundHover)`,
27
+ text: `var(--${prefix}-elements-button-secondary-text)`
28
+ },
29
+ danger: {
30
+ background: `var(--${prefix}-elements-button-danger-background)`,
31
+ backgroundHover: `var(--${prefix}-elements-button-danger-backgroundHover)`,
32
+ text: `var(--${prefix}-elements-button-danger-text)`
33
+ }
34
+ },
35
+ icon: {
36
+ success: `var(--${prefix}-elements-icon-success)`,
37
+ error: `var(--${prefix}-elements-icon-error)`,
38
+ warning: `var(--${prefix}-elements-icon-warning)`,
39
+ primary: `var(--${prefix}-elements-icon-primary)`,
40
+ secondary: `var(--${prefix}-elements-icon-secondary)`
41
+ },
42
+ dividerColor: `var(--${prefix}-elements-dividerColor)`,
43
+ item: {
44
+ backgroundHover: `var(--${prefix}-elements-item-backgroundHover)`,
45
+ backgroundActive: `var(--${prefix}-elements-item-backgroundActive)`
46
+ },
47
+ focus: `var(--${prefix}-elements-focus)`
48
+ }
49
+ };
50
+ }
51
+
52
+ export {
53
+ bpThemeTokens
54
+ };
55
+ //# sourceMappingURL=chunk-37ADATBT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/preset.ts"],"sourcesContent":["/**\n * Blueprint UI semantic token theme for UnoCSS.\n *\n * Components in this package use classes like `text-bp-elements-textPrimary`.\n * Each consuming app maps these to their own CSS variables by adding this\n * theme object under a `bp` key in their UnoCSS config:\n *\n * import { bpThemeTokens } from '@tangle-network/blueprint-ui/preset';\n * // theme: { colors: { bp: bpThemeTokens('cloud') } }\n * // theme: { colors: { bp: bpThemeTokens('arena') } }\n */\n\nexport function bpThemeTokens(prefix: string) {\n return {\n elements: {\n borderColor: `var(--${prefix}-elements-borderColor)`,\n borderColorActive: `var(--${prefix}-elements-borderColorActive)`,\n background: {\n depth: {\n 1: `var(--${prefix}-elements-bg-depth-1)`,\n 2: `var(--${prefix}-elements-bg-depth-2)`,\n 3: `var(--${prefix}-elements-bg-depth-3)`,\n 4: `var(--${prefix}-elements-bg-depth-4)`,\n },\n },\n textPrimary: `var(--${prefix}-elements-textPrimary)`,\n textSecondary: `var(--${prefix}-elements-textSecondary)`,\n textTertiary: `var(--${prefix}-elements-textTertiary)`,\n button: {\n primary: {\n background: `var(--${prefix}-elements-button-primary-background)`,\n backgroundHover: `var(--${prefix}-elements-button-primary-backgroundHover)`,\n text: `var(--${prefix}-elements-button-primary-text)`,\n },\n secondary: {\n background: `var(--${prefix}-elements-button-secondary-background)`,\n backgroundHover: `var(--${prefix}-elements-button-secondary-backgroundHover)`,\n text: `var(--${prefix}-elements-button-secondary-text)`,\n },\n danger: {\n background: `var(--${prefix}-elements-button-danger-background)`,\n backgroundHover: `var(--${prefix}-elements-button-danger-backgroundHover)`,\n text: `var(--${prefix}-elements-button-danger-text)`,\n },\n },\n icon: {\n success: `var(--${prefix}-elements-icon-success)`,\n error: `var(--${prefix}-elements-icon-error)`,\n warning: `var(--${prefix}-elements-icon-warning)`,\n primary: `var(--${prefix}-elements-icon-primary)`,\n secondary: `var(--${prefix}-elements-icon-secondary)`,\n },\n dividerColor: `var(--${prefix}-elements-dividerColor)`,\n item: {\n backgroundHover: `var(--${prefix}-elements-item-backgroundHover)`,\n backgroundActive: `var(--${prefix}-elements-item-backgroundActive)`,\n },\n focus: `var(--${prefix}-elements-focus)`,\n },\n };\n}\n"],"mappings":";AAYO,SAAS,cAAc,QAAgB;AAC5C,SAAO;AAAA,IACL,UAAU;AAAA,MACR,aAAa,SAAS,MAAM;AAAA,MAC5B,mBAAmB,SAAS,MAAM;AAAA,MAClC,YAAY;AAAA,QACV,OAAO;AAAA,UACL,GAAG,SAAS,MAAM;AAAA,UAClB,GAAG,SAAS,MAAM;AAAA,UAClB,GAAG,SAAS,MAAM;AAAA,UAClB,GAAG,SAAS,MAAM;AAAA,QACpB;AAAA,MACF;AAAA,MACA,aAAa,SAAS,MAAM;AAAA,MAC5B,eAAe,SAAS,MAAM;AAAA,MAC9B,cAAc,SAAS,MAAM;AAAA,MAC7B,QAAQ;AAAA,QACN,SAAS;AAAA,UACP,YAAY,SAAS,MAAM;AAAA,UAC3B,iBAAiB,SAAS,MAAM;AAAA,UAChC,MAAM,SAAS,MAAM;AAAA,QACvB;AAAA,QACA,WAAW;AAAA,UACT,YAAY,SAAS,MAAM;AAAA,UAC3B,iBAAiB,SAAS,MAAM;AAAA,UAChC,MAAM,SAAS,MAAM;AAAA,QACvB;AAAA,QACA,QAAQ;AAAA,UACN,YAAY,SAAS,MAAM;AAAA,UAC3B,iBAAiB,SAAS,MAAM;AAAA,UAChC,MAAM,SAAS,MAAM;AAAA,QACvB;AAAA,MACF;AAAA,MACA,MAAM;AAAA,QACJ,SAAS,SAAS,MAAM;AAAA,QACxB,OAAO,SAAS,MAAM;AAAA,QACtB,SAAS,SAAS,MAAM;AAAA,QACxB,SAAS,SAAS,MAAM;AAAA,QACxB,WAAW,SAAS,MAAM;AAAA,MAC5B;AAAA,MACA,cAAc,SAAS,MAAM;AAAA,MAC7B,MAAM;AAAA,QACJ,iBAAiB,SAAS,MAAM;AAAA,QAChC,kBAAkB,SAAS,MAAM;AAAA,MACnC;AAAA,MACA,OAAO,SAAS,MAAM;AAAA,IACxB;AAAA,EACF;AACF;","names":[]}