@svp-chain-sdk/ui 0.1.4 → 0.1.5

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/dist/styles.css CHANGED
@@ -1,91 +1,109 @@
1
1
  @import "tailwindcss";
2
2
  @theme { --color-background: oklch(0.99 0.01 220); --color-foreground: oklch(0.24 0.04 235); --color-primary: oklch(0.55 0.16 220); --color-primary-foreground: oklch(0.99 0.01 220); --color-secondary: oklch(0.93 0.04 205); --color-secondary-foreground: oklch(0.28 0.07 225); --color-accent: oklch(0.9 0.06 195); --color-accent-foreground: oklch(0.25 0.07 225); --color-destructive: oklch(0.58 0.2 25); --color-destructive-foreground: white; --color-input: oklch(0.86 0.03 220); --color-ring: oklch(0.6 0.14 195); }
3
3
 
4
- /* 钱包控件与 SVP 应用保持同一视觉基线,消费方只负责摆放。 */
5
- .svp-header-wallet {
6
- display: flex;
7
- min-width: 0;
8
- align-items: center;
9
- justify-content: flex-end;
10
- font-family: "Space Grotesk", "Inter", system-ui, -apple-system, sans-serif;
4
+ @keyframes ui-notice-marquee-scroll {
5
+ from { transform: translateX(0); }
6
+ to { transform: translateX(-50%); }
11
7
  }
12
8
 
13
- .svp-header-wallet,
14
- .svp-header-wallet * {
15
- box-sizing: border-box;
9
+ .ui-notice-marquee {
10
+ width: 16rem;
11
+ overflow: hidden;
12
+ color: var(--color-foreground, #17334a);
13
+ font-size: 0.75rem;
14
+ line-height: 1rem;
16
15
  }
17
16
 
18
- .svp-wallet-group {
17
+ .ui-notice-marquee__track {
19
18
  display: flex;
20
- min-width: 0;
19
+ width: max-content;
20
+ flex-shrink: 0;
21
21
  align-items: center;
22
- gap: 0.5rem;
22
+ animation: ui-notice-marquee-scroll var(--ui-notice-marquee-duration, 32s) linear infinite;
23
+ will-change: transform;
23
24
  }
24
25
 
25
- .svp-wallet-btn,
26
- .svp-network-btn {
27
- flex: none;
28
- height: 40px;
29
- cursor: pointer;
30
- overflow: hidden;
31
- border-radius: 10px;
32
- font-family: inherit;
26
+ .ui-notice-marquee__group {
27
+ display: flex;
28
+ flex-shrink: 0;
29
+ align-items: center;
30
+ gap: 1rem;
31
+ padding-inline-end: 1rem;
32
+ }
33
+
34
+ .ui-notice-marquee__item {
35
+ flex-shrink: 0;
33
36
  white-space: nowrap;
34
- transition: opacity 150ms, background 150ms;
35
37
  }
36
38
 
37
- .svp-wallet-btn {
38
- display: inline-flex;
39
- width: 140px;
39
+ .ui-notice-marquee:hover .ui-notice-marquee__track {
40
+ animation-play-state: paused;
41
+ }
42
+
43
+ @media (prefers-reduced-motion: reduce) {
44
+ .ui-notice-marquee__track {
45
+ animation: none;
46
+ will-change: auto;
47
+ }
48
+ }
49
+
50
+ .svp-contact-fab {
51
+ position: fixed;
52
+ right: 1.25rem;
53
+ top: 50%;
54
+ transform: translateY(-50%);
55
+ z-index: 1500;
56
+ width: 54px;
57
+ height: 54px;
58
+ border-radius: 16px;
59
+ border: none;
60
+ cursor: pointer;
61
+ display: flex;
40
62
  align-items: center;
41
63
  justify-content: center;
42
- border: 0;
43
- padding: 0 1.2rem;
44
- background: linear-gradient(90deg, #2563eb, #38bdf8);
45
- box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
64
+ background: linear-gradient(135deg, var(--svp-primary, #2563eb), var(--svp-accent, #38bdf8));
46
65
  color: #fff;
47
- font-size: 0.875rem;
48
- font-weight: 700;
66
+ box-shadow: 0 12px 30px rgba(37,99,235,0.4);
67
+ transition: transform .18s ease, box-shadow .18s ease;
49
68
  }
50
69
 
51
- .svp-wallet-btn:hover {
52
- opacity: 0.9;
70
+ .svp-contact-fab:hover {
71
+ transform: translateY(-50%) scale(1.06);
72
+ box-shadow: 0 16px 40px rgba(37,99,235,0.5);
53
73
  }
54
74
 
55
- .svp-wallet-btn-error {
56
- background: linear-gradient(90deg, #ef4444, #f87171);
57
- box-shadow: 0 8px 20px rgba(239, 68, 68, 0.35);
75
+ .svp-contact-fab:active {
76
+ transform: translateY(-50%) scale(0.97);
58
77
  }
59
78
 
60
- .svp-network-btn {
61
- display: inline-flex;
62
- width: 140px;
63
- align-items: center;
64
- justify-content: center;
65
- gap: 0.4rem;
66
- border: 1px solid rgba(0, 0, 0, 0.08);
67
- padding: 0 0.9rem;
68
- background: #fff;
69
- box-shadow: 0 2px 8px rgba(15, 30, 61, 0.08);
70
- color: #0f1e3d;
71
- font-size: 0.85rem;
72
- font-weight: 600;
79
+ .svp-contact-fab:focus-visible {
80
+ outline: 2px solid var(--color-ring, #2563eb);
81
+ outline-offset: 3px;
73
82
  }
74
83
 
75
- .svp-network-btn:hover {
76
- background: #f8fafc;
84
+ .svp-contact-fab-icon {
85
+ width: 26px;
86
+ height: 26px;
87
+ flex: 0 0 auto;
88
+ fill: currentColor;
77
89
  }
78
90
 
79
- @media (max-width: 640px) {
80
- .svp-network-btn,
81
- .svp-wallet-btn {
82
- width: 93px;
83
- height: 32px;
84
- padding: 0 0.5rem;
85
- font-size: 0.75rem;
91
+ @media (max-width: 560px) {
92
+ .svp-contact-fab {
93
+ width: 48px;
94
+ height: 48px;
95
+ right: 0.85rem;
96
+ border-radius: 14px;
86
97
  }
87
98
 
88
- .svp-wallet-btn-connect {
89
- width: 104px;
99
+ .svp-contact-fab-icon {
100
+ width: 22px;
101
+ height: 22px;
102
+ }
103
+ }
104
+
105
+ @media (prefers-reduced-motion: reduce) {
106
+ .svp-contact-fab {
107
+ transition: none;
90
108
  }
91
109
  }
@@ -36,8 +36,97 @@ export declare const uiButtonComponents: {
36
36
  };
37
37
  };
38
38
  };
39
+ /** Explicit styles matching the website footer's 16rem infinite marquee. */
40
+ export declare const uiNoticeMarqueeComponents: {
41
+ '@keyframes ui-notice-marquee-scroll': {
42
+ from: {
43
+ transform: string;
44
+ };
45
+ to: {
46
+ transform: string;
47
+ };
48
+ };
49
+ '.ui-notice-marquee': {
50
+ width: string;
51
+ overflow: string;
52
+ color: string;
53
+ 'font-size': string;
54
+ 'line-height': string;
55
+ };
56
+ '.ui-notice-marquee__track': {
57
+ display: string;
58
+ width: string;
59
+ 'flex-shrink': string;
60
+ 'align-items': string;
61
+ animation: string;
62
+ 'will-change': string;
63
+ };
64
+ '.ui-notice-marquee__group': {
65
+ display: string;
66
+ 'flex-shrink': string;
67
+ 'align-items': string;
68
+ gap: string;
69
+ 'padding-inline-end': string;
70
+ };
71
+ '.ui-notice-marquee__item': {
72
+ 'flex-shrink': string;
73
+ 'white-space': string;
74
+ };
75
+ '.ui-notice-marquee:hover .ui-notice-marquee__track': {
76
+ 'animation-play-state': string;
77
+ };
78
+ '@media (prefers-reduced-motion: reduce)': {
79
+ '.ui-notice-marquee__track': {
80
+ animation: string;
81
+ 'will-change': string;
82
+ };
83
+ };
84
+ };
39
85
  /** Complete component configuration registered by the default SVP UI plugin. */
40
86
  export declare const uiComponents: {
87
+ '@keyframes ui-notice-marquee-scroll': {
88
+ from: {
89
+ transform: string;
90
+ };
91
+ to: {
92
+ transform: string;
93
+ };
94
+ };
95
+ '.ui-notice-marquee': {
96
+ width: string;
97
+ overflow: string;
98
+ color: string;
99
+ 'font-size': string;
100
+ 'line-height': string;
101
+ };
102
+ '.ui-notice-marquee__track': {
103
+ display: string;
104
+ width: string;
105
+ 'flex-shrink': string;
106
+ 'align-items': string;
107
+ animation: string;
108
+ 'will-change': string;
109
+ };
110
+ '.ui-notice-marquee__group': {
111
+ display: string;
112
+ 'flex-shrink': string;
113
+ 'align-items': string;
114
+ gap: string;
115
+ 'padding-inline-end': string;
116
+ };
117
+ '.ui-notice-marquee__item': {
118
+ 'flex-shrink': string;
119
+ 'white-space': string;
120
+ };
121
+ '.ui-notice-marquee:hover .ui-notice-marquee__track': {
122
+ 'animation-play-state': string;
123
+ };
124
+ '@media (prefers-reduced-motion: reduce)': {
125
+ '.ui-notice-marquee__track': {
126
+ animation: string;
127
+ 'will-change': string;
128
+ };
129
+ };
41
130
  '.ui-button': {
42
131
  display: string;
43
132
  'align-items': string;
@@ -74,11 +163,6 @@ export declare const uiComponents: {
74
163
  };
75
164
  };
76
165
  };
77
- /**
78
- * Tailwind provider for the framework-agnostic SVP UI classes.
79
- *
80
- * Register this once in the consuming project's Tailwind configuration, then
81
- * use `ui-button` classes from HTML, JSX, or any other markup.
82
- */
166
+ /** Tailwind provider for all framework-agnostic SVP UI classes. */
83
167
  declare const svpUiPlugin: import("tailwindcss/plugin").PluginWithConfig;
84
168
  export default svpUiPlugin;
package/dist/tailwind.js CHANGED
@@ -1,14 +1,14 @@
1
- function e(o, r) {
2
- return { handler: o, config: r };
1
+ function i(e, r) {
2
+ return { handler: e, config: r };
3
3
  }
4
- e.withOptions = function(o, r = () => ({})) {
5
- function n(t) {
6
- return { handler: o(t), config: r(t) };
4
+ i.withOptions = function(e, r = () => ({})) {
5
+ function o(n) {
6
+ return { handler: e(n), config: r(n) };
7
7
  }
8
- return n.__isOptionsFunction = !0, n;
8
+ return o.__isOptionsFunction = !0, o;
9
9
  };
10
- var i = e;
11
- const c = {
10
+ var t = i;
11
+ const a = {
12
12
  ".ui-button": {
13
13
  display: "inline-flex",
14
14
  "align-items": "center",
@@ -44,11 +44,55 @@ const c = {
44
44
  "background-color": "color-mix(in srgb, var(--color-destructive, #e5484d) 90%, transparent)"
45
45
  }
46
46
  }
47
- }, a = c, u = i(({ addBase: o, addComponents: r }) => {
48
- o({ ":root": { "--svp-ui-brand": "#159bb5" } }), r(a);
47
+ }, c = {
48
+ "@keyframes ui-notice-marquee-scroll": {
49
+ from: { transform: "translateX(0)" },
50
+ to: { transform: "translateX(-50%)" }
51
+ },
52
+ ".ui-notice-marquee": {
53
+ width: "16rem",
54
+ overflow: "hidden",
55
+ color: "var(--color-foreground, #17334a)",
56
+ "font-size": "0.75rem",
57
+ "line-height": "1rem"
58
+ },
59
+ ".ui-notice-marquee__track": {
60
+ display: "flex",
61
+ width: "max-content",
62
+ "flex-shrink": "0",
63
+ "align-items": "center",
64
+ animation: "ui-notice-marquee-scroll var(--ui-notice-marquee-duration, 32s) linear infinite",
65
+ "will-change": "transform"
66
+ },
67
+ ".ui-notice-marquee__group": {
68
+ display: "flex",
69
+ "flex-shrink": "0",
70
+ "align-items": "center",
71
+ gap: "1rem",
72
+ "padding-inline-end": "1rem"
73
+ },
74
+ ".ui-notice-marquee__item": {
75
+ "flex-shrink": "0",
76
+ "white-space": "nowrap"
77
+ },
78
+ ".ui-notice-marquee:hover .ui-notice-marquee__track": {
79
+ "animation-play-state": "paused"
80
+ },
81
+ "@media (prefers-reduced-motion: reduce)": {
82
+ ".ui-notice-marquee__track": {
83
+ animation: "none",
84
+ "will-change": "auto"
85
+ }
86
+ }
87
+ }, u = {
88
+ ...a,
89
+ ...c
90
+ }, l = t(({ addBase: e, addComponents: r }) => {
91
+ e({ ":root": { "--svp-ui-brand": "#159bb5" } }), r(u);
49
92
  });
50
93
  export {
51
- u as default,
52
- c as uiButtonComponents,
53
- a as uiComponents
94
+ l as default,
95
+ a as uiButtonComponents,
96
+ u as uiComponents,
97
+ c as uiNoticeMarqueeComponents
54
98
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@svp-chain-sdk/ui",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Accessible UI primitives for SVP Chain SDK applications.",
5
5
  "type": "module",
6
6
  "files": [
@@ -21,12 +21,8 @@
21
21
  }
22
22
  },
23
23
  "peerDependencies": {
24
- "@rainbow-me/rainbowkit": "2.2.11",
25
- "@tanstack/react-query": "^5.62.11",
26
24
  "react": ">=18",
27
- "react-dom": ">=18",
28
- "viem": "^2.21.54",
29
- "wagmi": "^2.13.11"
25
+ "react-dom": ">=18"
30
26
  },
31
27
  "dependencies": {
32
28
  "@radix-ui/react-slot": "^1.1.2",
@@ -35,12 +31,8 @@
35
31
  "tailwind-merge": "^2.6.0"
36
32
  },
37
33
  "devDependencies": {
38
- "@rainbow-me/rainbowkit": "2.2.11",
39
- "@tailwindcss/vite": "^4.1.11",
40
- "@tanstack/react-query": "^5.62.11",
41
- "@testing-library/jest-dom": "^6.6.3",
42
34
  "@testing-library/react": "^16.1.0",
43
- "@types/node": "^22.10.2",
35
+ "@testing-library/jest-dom": "^6.6.3",
44
36
  "@types/react": "^19.0.0",
45
37
  "@types/react-dom": "^19.0.0",
46
38
  "@vitejs/plugin-react": "^4.3.4",
@@ -48,11 +40,11 @@
48
40
  "react": "^19.0.0",
49
41
  "react-dom": "^19.0.0",
50
42
  "tailwindcss": "^4.1.11",
43
+ "@tailwindcss/vite": "^4.1.11",
44
+ "@types/node": "^22.10.2",
51
45
  "typescript": "^5.7.2",
52
- "viem": "^2.21.54",
53
46
  "vite": "^6.0.5",
54
- "vitest": "^2.1.8",
55
- "wagmi": "^2.13.11"
47
+ "vitest": "^2.1.8"
56
48
  },
57
49
  "scripts": {
58
50
  "build": "rm -rf dist && vite build && vite build --config vite.tailwind.config.ts && cp src/styles.css dist/styles.css && tsc",