@tangle-network/blueprint-ui 0.1.1 → 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.
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
 
@@ -113,14 +113,48 @@ If npm does not allow configuring trusted publishing before first publish, do a
113
113
  ## Usage
114
114
 
115
115
  ```tsx
116
+ import '@tangle-network/blueprint-ui/styles.css';
117
+
116
118
  // Import hooks and utilities from the main entry
117
- 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';
118
125
 
119
126
  // Import UI components from the /components entry
120
127
  import { Button, Card, FormField } from '@tangle-network/blueprint-ui/components';
121
128
  ```
122
129
 
123
- 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.
124
158
 
125
159
  ## Peer Dependencies
126
160
 
@@ -150,7 +184,7 @@ Licensed under either of [Apache License, Version 2.0](http://www.apache.org/lic
150
184
  A React component library providing UI primitives, hooks, and contract utilities for building applications on Tangle Network.
151
185
 
152
186
  **Do I need to build this package before using it?**
153
- 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.
154
188
 
155
189
  **What framework does blueprint-ui support?**
156
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":[]}