@viibestack/ui 0.1.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.
- package/README.md +36 -0
- package/package.json +23 -0
- package/src/icons.tsx +299 -0
- package/src/index.ts +1 -0
package/README.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# @viibestack/ui
|
|
2
|
+
|
|
3
|
+
Dependency-free React components -- currently a Feather/Lucide-style outline icon set (~28 icons), ported from `services/portal/frontend/src/Icons.tsx`. No runtime dependencies beyond `react` itself, so it's safe to use anywhere React runs, including apps deployed on the OpenNext Cloudflare Workers adapter (no Node-native code, nothing that needs `fs`/`stream`/native bindings).
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { CheckIcon, TrashIcon, SettingsIcon } from "@viibestack/ui";
|
|
9
|
+
|
|
10
|
+
<CheckIcon size={16} color="green" />
|
|
11
|
+
<TrashIcon className="text-red-500" />
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Every icon takes the same optional props: `size` (number, default 20), `color` (default `"currentColor"`, so it follows the surrounding text color / a Tailwind `text-*` class unless overridden), and `className`.
|
|
15
|
+
|
|
16
|
+
## Consuming this from an app built outside this monorepo
|
|
17
|
+
|
|
18
|
+
This package ships raw, untranspiled `.tsx` source (same convention as `@sideblend/shared-types`) -- no build step to keep it trivial to iterate on. Next.js does **not** transpile `node_modules` by default, so any app that installs this from npm needs one line in its `next.config.ts`:
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
const nextConfig: NextConfig = {
|
|
22
|
+
transpilePackages: ["@viibestack/ui"],
|
|
23
|
+
};
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Publishing
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
npm login
|
|
30
|
+
cd packages/ui
|
|
31
|
+
npm publish
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
`publishConfig.access` is already set to `"public"` in `package.json`, so this publishes as a free public package under the `viibestack` npm organization rather than requiring a paid plan.
|
|
35
|
+
|
|
36
|
+
Bump `version` in `package.json` before each subsequent publish (npm rejects re-publishing the same version).
|
package/package.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@viibestack/ui",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Dependency-free React icon set -- Feather/Lucide-style outline glyphs, no runtime dependency on any icon library.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./src/index.ts",
|
|
7
|
+
"types": "./src/index.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"src"
|
|
10
|
+
],
|
|
11
|
+
"peerDependencies": {
|
|
12
|
+
"react": ">=18"
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"@types/react": "^19",
|
|
16
|
+
"react": "^19",
|
|
17
|
+
"typescript": "^5"
|
|
18
|
+
},
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public"
|
|
21
|
+
},
|
|
22
|
+
"license": "MIT"
|
|
23
|
+
}
|
package/src/icons.tsx
ADDED
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
// Dependency-free inline icon set -- plain Feather/Lucide-style outline
|
|
2
|
+
// glyphs, no runtime dependency on any icon library. Ported from
|
|
3
|
+
// services/portal/frontend/src/Icons.tsx (that copy stays as-is, tuned to
|
|
4
|
+
// the portal's own per-usage sizing) with a consistent, generic props API
|
|
5
|
+
// so external consumers (AI-generated apps) get predictable size/color
|
|
6
|
+
// control instead of each icon hardcoding its own width/height.
|
|
7
|
+
|
|
8
|
+
export interface IconProps {
|
|
9
|
+
size?: number;
|
|
10
|
+
color?: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function svgProps({ size = 20, color = "currentColor", className }: IconProps) {
|
|
15
|
+
return {
|
|
16
|
+
viewBox: "0 0 24 24",
|
|
17
|
+
width: size,
|
|
18
|
+
height: size,
|
|
19
|
+
fill: "none" as const,
|
|
20
|
+
stroke: color,
|
|
21
|
+
strokeWidth: 2,
|
|
22
|
+
strokeLinecap: "round" as const,
|
|
23
|
+
strokeLinejoin: "round" as const,
|
|
24
|
+
className,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function PanelIcon(props: IconProps = {}) {
|
|
29
|
+
return (
|
|
30
|
+
<svg {...svgProps(props)}>
|
|
31
|
+
<rect x="3" y="3" width="18" height="18" rx="2" />
|
|
32
|
+
<line x1="9" y1="3" x2="9" y2="21" />
|
|
33
|
+
</svg>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function CloseIcon(props: IconProps = {}) {
|
|
38
|
+
return (
|
|
39
|
+
<svg {...svgProps(props)}>
|
|
40
|
+
<line x1="5" y1="5" x2="19" y2="19" />
|
|
41
|
+
<line x1="19" y1="5" x2="5" y2="19" />
|
|
42
|
+
</svg>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function ExpandIcon(props: IconProps = {}) {
|
|
47
|
+
return (
|
|
48
|
+
<svg {...svgProps(props)}>
|
|
49
|
+
<polyline points="15 3 21 3 21 9" />
|
|
50
|
+
<polyline points="9 21 3 21 3 15" />
|
|
51
|
+
<line x1="21" y1="3" x2="14" y2="10" />
|
|
52
|
+
<line x1="3" y1="21" x2="10" y2="14" />
|
|
53
|
+
</svg>
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function CollapseIcon(props: IconProps = {}) {
|
|
58
|
+
return (
|
|
59
|
+
<svg {...svgProps(props)}>
|
|
60
|
+
<polyline points="9 3 9 9 3 9" />
|
|
61
|
+
<polyline points="21 15 15 15 15 21" />
|
|
62
|
+
<line x1="9" y1="9" x2="3" y2="3" />
|
|
63
|
+
<line x1="15" y1="15" x2="21" y2="21" />
|
|
64
|
+
</svg>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function ImageIcon(props: IconProps = {}) {
|
|
69
|
+
return (
|
|
70
|
+
<svg {...svgProps(props)}>
|
|
71
|
+
<rect x="3" y="3" width="18" height="18" rx="2" />
|
|
72
|
+
<circle cx="8.5" cy="8.5" r="1.5" />
|
|
73
|
+
<path d="M21 15l-5-5L5 21" />
|
|
74
|
+
</svg>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function SunIcon(props: IconProps = {}) {
|
|
79
|
+
return (
|
|
80
|
+
<svg {...svgProps(props)}>
|
|
81
|
+
<circle cx="12" cy="12" r="4" />
|
|
82
|
+
<line x1="12" y1="2" x2="12" y2="4" />
|
|
83
|
+
<line x1="12" y1="20" x2="12" y2="22" />
|
|
84
|
+
<line x1="4.2" y1="4.2" x2="5.6" y2="5.6" />
|
|
85
|
+
<line x1="18.4" y1="18.4" x2="19.8" y2="19.8" />
|
|
86
|
+
<line x1="2" y1="12" x2="4" y2="12" />
|
|
87
|
+
<line x1="20" y1="12" x2="22" y2="12" />
|
|
88
|
+
<line x1="4.2" y1="19.8" x2="5.6" y2="18.4" />
|
|
89
|
+
<line x1="18.4" y1="5.6" x2="19.8" y2="4.2" />
|
|
90
|
+
</svg>
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export function MoonIcon(props: IconProps = {}) {
|
|
95
|
+
return (
|
|
96
|
+
<svg {...svgProps(props)}>
|
|
97
|
+
<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" />
|
|
98
|
+
</svg>
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export function MenuIcon(props: IconProps = {}) {
|
|
103
|
+
return (
|
|
104
|
+
<svg {...svgProps(props)}>
|
|
105
|
+
<line x1="3" y1="6" x2="21" y2="6" />
|
|
106
|
+
<line x1="3" y1="12" x2="21" y2="12" />
|
|
107
|
+
<line x1="3" y1="18" x2="21" y2="18" />
|
|
108
|
+
</svg>
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export function BellIcon(props: IconProps = {}) {
|
|
113
|
+
return (
|
|
114
|
+
<svg {...svgProps(props)}>
|
|
115
|
+
<path d="M18 8a6 6 0 0 0-12 0c0 7-3 9-3 9h18s-3-2-3-9" />
|
|
116
|
+
<path d="M13.73 21a2 2 0 0 1-3.46 0" />
|
|
117
|
+
</svg>
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export function ChatIcon(props: IconProps = {}) {
|
|
122
|
+
return (
|
|
123
|
+
<svg {...svgProps(props)}>
|
|
124
|
+
<path d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z" />
|
|
125
|
+
</svg>
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export function VideoIcon(props: IconProps = {}) {
|
|
130
|
+
return (
|
|
131
|
+
<svg {...svgProps(props)}>
|
|
132
|
+
<path d="M23 7l-7 5 7 5V7z" />
|
|
133
|
+
<rect x="1" y="5" width="15" height="14" rx="2" ry="2" />
|
|
134
|
+
</svg>
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export function UsersIcon(props: IconProps = {}) {
|
|
139
|
+
return (
|
|
140
|
+
<svg {...svgProps(props)}>
|
|
141
|
+
<path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2" />
|
|
142
|
+
<circle cx="9" cy="7" r="4" />
|
|
143
|
+
<path d="M23 21v-2a4 4 0 0 0-3-3.87" />
|
|
144
|
+
<path d="M16 3.13a4 4 0 0 1 0 7.75" />
|
|
145
|
+
</svg>
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export function PlugIcon(props: IconProps = {}) {
|
|
150
|
+
return (
|
|
151
|
+
<svg {...svgProps(props)}>
|
|
152
|
+
<path d="M22 9.5 14.5 2 12 4.5l1.5 1.5-5 5L7 9.5 4.5 12l7.5 7.5L14.5 17l-1.5-1.5 5-5 1.5 1.5z" />
|
|
153
|
+
<line x1="16" y1="2" x2="18" y2="4" />
|
|
154
|
+
<line x1="2" y1="16" x2="4" y2="18" />
|
|
155
|
+
</svg>
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export function SupportIcon(props: IconProps = {}) {
|
|
160
|
+
return (
|
|
161
|
+
<svg {...svgProps(props)}>
|
|
162
|
+
<circle cx="12" cy="12" r="10" />
|
|
163
|
+
<circle cx="12" cy="12" r="4" />
|
|
164
|
+
<line x1="4.9" y1="4.9" x2="9.2" y2="9.2" />
|
|
165
|
+
<line x1="14.8" y1="14.8" x2="19.1" y2="19.1" />
|
|
166
|
+
<line x1="14.8" y1="9.2" x2="19.1" y2="4.9" />
|
|
167
|
+
<line x1="4.9" y1="19.1" x2="9.2" y2="14.8" />
|
|
168
|
+
</svg>
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export function EmailIcon(props: IconProps = {}) {
|
|
173
|
+
return (
|
|
174
|
+
<svg {...svgProps(props)}>
|
|
175
|
+
<rect x="2" y="4" width="20" height="16" rx="2" />
|
|
176
|
+
<path d="m2 6 10 7 10-7" />
|
|
177
|
+
</svg>
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export function GlobeIcon(props: IconProps = {}) {
|
|
182
|
+
return (
|
|
183
|
+
<svg {...svgProps(props)}>
|
|
184
|
+
<circle cx="12" cy="12" r="10" />
|
|
185
|
+
<line x1="2" y1="12" x2="22" y2="12" />
|
|
186
|
+
<path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z" />
|
|
187
|
+
</svg>
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export function ArrowRightIcon(props: IconProps = {}) {
|
|
192
|
+
return (
|
|
193
|
+
<svg {...svgProps(props)}>
|
|
194
|
+
<path d="M4 17l6-6-6-6" />
|
|
195
|
+
<path d="M12 19h8" />
|
|
196
|
+
</svg>
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export function ShieldIcon(props: IconProps = {}) {
|
|
201
|
+
return (
|
|
202
|
+
<svg {...svgProps(props)}>
|
|
203
|
+
<path d="M12 2 4 5v6c0 5 3.4 8.7 8 10 4.6-1.3 8-5 8-10V5z" />
|
|
204
|
+
</svg>
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export function ServerIcon(props: IconProps = {}) {
|
|
209
|
+
return (
|
|
210
|
+
<svg {...svgProps(props)}>
|
|
211
|
+
<rect x="2" y="3" width="20" height="7" rx="1.5" />
|
|
212
|
+
<rect x="2" y="14" width="20" height="7" rx="1.5" />
|
|
213
|
+
<line x1="6" y1="6.5" x2="6.01" y2="6.5" />
|
|
214
|
+
<line x1="6" y1="17.5" x2="6.01" y2="17.5" />
|
|
215
|
+
</svg>
|
|
216
|
+
);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export function CodeIcon(props: IconProps = {}) {
|
|
220
|
+
return (
|
|
221
|
+
<svg {...svgProps(props)}>
|
|
222
|
+
<polyline points="16 18 22 12 16 6" />
|
|
223
|
+
<polyline points="8 6 2 12 8 18" />
|
|
224
|
+
</svg>
|
|
225
|
+
);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
export function EditIcon(props: IconProps = {}) {
|
|
229
|
+
return (
|
|
230
|
+
<svg {...svgProps(props)}>
|
|
231
|
+
<path d="M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5z" />
|
|
232
|
+
</svg>
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
export function SettingsIcon(props: IconProps = {}) {
|
|
237
|
+
return (
|
|
238
|
+
<svg {...svgProps(props)}>
|
|
239
|
+
<circle cx="12" cy="12" r="3" />
|
|
240
|
+
<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z" />
|
|
241
|
+
</svg>
|
|
242
|
+
);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
export function GridIcon(props: IconProps = {}) {
|
|
246
|
+
return (
|
|
247
|
+
<svg {...svgProps(props)}>
|
|
248
|
+
<rect x="3" y="3" width="7" height="7" rx="1" />
|
|
249
|
+
<rect x="14" y="3" width="7" height="7" rx="1" />
|
|
250
|
+
<rect x="3" y="14" width="7" height="7" rx="1" />
|
|
251
|
+
<rect x="14" y="14" width="7" height="7" rx="1" />
|
|
252
|
+
</svg>
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
export function SparkleIcon(props: IconProps = {}) {
|
|
257
|
+
return (
|
|
258
|
+
<svg {...svgProps(props)}>
|
|
259
|
+
<path d="M12 3v4M12 17v4M3 12h4M17 12h4" />
|
|
260
|
+
<path d="M12 8a4 4 0 0 0 4 4 4 4 0 0 0-4 4 4 4 0 0 0-4-4 4 4 0 0 0 4-4z" />
|
|
261
|
+
</svg>
|
|
262
|
+
);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
export function UploadIcon(props: IconProps = {}) {
|
|
266
|
+
return (
|
|
267
|
+
<svg {...svgProps(props)}>
|
|
268
|
+
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />
|
|
269
|
+
<polyline points="17 8 12 3 7 8" />
|
|
270
|
+
<line x1="12" y1="3" x2="12" y2="15" />
|
|
271
|
+
</svg>
|
|
272
|
+
);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
export function CheckIcon(props: IconProps = {}) {
|
|
276
|
+
return (
|
|
277
|
+
<svg {...svgProps(props)}>
|
|
278
|
+
<polyline points="20 6 9 17 4 12" />
|
|
279
|
+
</svg>
|
|
280
|
+
);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
export function TrashIcon(props: IconProps = {}) {
|
|
284
|
+
return (
|
|
285
|
+
<svg {...svgProps(props)}>
|
|
286
|
+
<polyline points="3 6 5 6 21 6" />
|
|
287
|
+
<path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" />
|
|
288
|
+
</svg>
|
|
289
|
+
);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
export function SearchIcon(props: IconProps = {}) {
|
|
293
|
+
return (
|
|
294
|
+
<svg {...svgProps(props)}>
|
|
295
|
+
<circle cx="11" cy="11" r="8" />
|
|
296
|
+
<line x1="21" y1="21" x2="16.65" y2="16.65" />
|
|
297
|
+
</svg>
|
|
298
|
+
);
|
|
299
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./icons";
|