facehash 0.0.2 → 0.0.3

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/README.md ADDED
@@ -0,0 +1,329 @@
1
+ # facehash
2
+
3
+ Deterministic avatar faces from any string. Zero dependencies, unstyled, React 18/19 compatible.
4
+
5
+ Following the [shadcn/ui](https://ui.shadcn.com/) philosophy: **unstyled, composable, and yours to customize**.
6
+
7
+ <p align="center">
8
+ <img src="https://cossistant.com/facehash-preview.png" alt="facehash examples" width="600" />
9
+ </p>
10
+
11
+ ## Features
12
+
13
+ - **Deterministic** - Same string always generates the same face
14
+ - **Unstyled** - Zero CSS included, bring your own Tailwind/CSS
15
+ - **Composable** - Use standalone or as part of Avatar compound component
16
+ - **Dark mode ready** - Built-in light/dark color palette support
17
+ - **Accessible** - Proper ARIA attributes included
18
+ - **Tiny** - Zero dependencies (React is a peer dep)
19
+ - **TypeScript** - Full type safety
20
+
21
+ ## Installation
22
+
23
+ ```bash
24
+ npm install facehash
25
+ # or
26
+ pnpm add facehash
27
+ # or
28
+ bun add facehash
29
+ ```
30
+
31
+ ## Quick Start
32
+
33
+ ### Standalone FacehashAvatar
34
+
35
+ The simplest way to get started - just a fun face!
36
+
37
+ ```tsx
38
+ import { FacehashAvatar } from "facehash";
39
+
40
+ function App() {
41
+ return (
42
+ <FacehashAvatar
43
+ name="John Doe"
44
+ className="w-10 h-10 rounded-full"
45
+ />
46
+ );
47
+ }
48
+ ```
49
+
50
+ ### With Avatar Compound Component
51
+
52
+ For image avatars with FacehashAvatar as fallback:
53
+
54
+ ```tsx
55
+ import { Avatar, AvatarImage, AvatarFallback } from "facehash";
56
+
57
+ function UserAvatar({ user }) {
58
+ return (
59
+ <Avatar className="w-10 h-10 rounded-full overflow-hidden">
60
+ <AvatarImage src={user.avatarUrl} alt={user.name} />
61
+ <AvatarFallback name={user.name} facehash />
62
+ </Avatar>
63
+ );
64
+ }
65
+ ```
66
+
67
+ ## Usage Examples
68
+
69
+ ### Basic Styling with Tailwind
70
+
71
+ ```tsx
72
+ <FacehashAvatar
73
+ name="Jane Smith"
74
+ className="w-12 h-12 rounded-xl bg-gray-100 dark:bg-gray-800"
75
+ />
76
+ ```
77
+
78
+ ### Custom Color Palette
79
+
80
+ ```tsx
81
+ <FacehashAvatar
82
+ name="Alex Johnson"
83
+ colors={["#264653", "#2a9d8f", "#e9c46a", "#f4a261", "#e76f51"]}
84
+ className="w-16 h-16 rounded-full"
85
+ />
86
+ ```
87
+
88
+ ### Light/Dark Mode Colors
89
+
90
+ ```tsx
91
+ <FacehashAvatar
92
+ name="Sam Wilson"
93
+ colorsLight={["#fce7f3", "#fef3c7", "#dbeafe"]}
94
+ colorsDark={["#db2777", "#d97706", "#2563eb"]}
95
+ colorScheme="auto" // Uses CSS prefers-color-scheme
96
+ className="w-10 h-10 rounded-full"
97
+ />
98
+ ```
99
+
100
+ ### Without 3D Effect
101
+
102
+ ```tsx
103
+ <FacehashAvatar
104
+ name="Chris Brown"
105
+ enable3D={false}
106
+ className="w-10 h-10 rounded-lg"
107
+ />
108
+ ```
109
+
110
+ ### Without Initial Letter
111
+
112
+ ```tsx
113
+ <FacehashAvatar
114
+ name="Taylor Swift"
115
+ showInitial={false}
116
+ className="w-10 h-10 rounded-full"
117
+ />
118
+ ```
119
+
120
+ ### Avatar with Initials Fallback
121
+
122
+ ```tsx
123
+ <Avatar className="w-10 h-10 rounded-full bg-gray-200">
124
+ <AvatarImage src="/photo.jpg" alt="User" />
125
+ <AvatarFallback name="John Doe" className="text-sm font-medium" />
126
+ </Avatar>
127
+ ```
128
+
129
+ ### Avatar with Custom Fallback
130
+
131
+ ```tsx
132
+ import { User } from "lucide-react";
133
+
134
+ <Avatar className="w-10 h-10 rounded-full bg-gray-200">
135
+ <AvatarImage src="/photo.jpg" alt="User" />
136
+ <AvatarFallback>
137
+ <User className="w-5 h-5 text-gray-500" />
138
+ </AvatarFallback>
139
+ </Avatar>
140
+ ```
141
+
142
+ ### Delayed Fallback (Prevent Flash)
143
+
144
+ ```tsx
145
+ <Avatar className="w-10 h-10 rounded-full">
146
+ <AvatarImage src="/slow-loading-image.jpg" />
147
+ <AvatarFallback name="John" facehash delayMs={600} />
148
+ </Avatar>
149
+ ```
150
+
151
+ ## Styling with CSS
152
+
153
+ ### Using CSS Variables (Dark Mode)
154
+
155
+ When using `colorScheme="auto"`, the component sets CSS custom properties:
156
+
157
+ ```css
158
+ /* Apply the background based on color scheme */
159
+ [data-facehash-avatar][data-color-scheme="auto"] {
160
+ background-color: var(--facehash-avatar-bg-light);
161
+ }
162
+
163
+ @media (prefers-color-scheme: dark) {
164
+ [data-facehash-avatar][data-color-scheme="auto"] {
165
+ background-color: var(--facehash-avatar-bg-dark);
166
+ }
167
+ }
168
+ ```
169
+
170
+ ### Using Data Attributes
171
+
172
+ All components expose data attributes for styling:
173
+
174
+ ```css
175
+ /* Root avatar */
176
+ [data-avatar] { }
177
+ [data-avatar][data-state="loading"] { }
178
+ [data-avatar][data-state="loaded"] { }
179
+ [data-avatar][data-state="error"] { }
180
+
181
+ /* Facehash avatar */
182
+ [data-facehash-avatar] { }
183
+ [data-facehash-avatar-face] { }
184
+ [data-facehash-avatar-initial] { }
185
+
186
+ /* Image and fallback */
187
+ [data-avatar-image] { }
188
+ [data-avatar-fallback] { }
189
+ ```
190
+
191
+ ## API Reference
192
+
193
+ ### FacehashAvatar
194
+
195
+ | Prop | Type | Default | Description |
196
+ |------|------|---------|-------------|
197
+ | `name` | `string` | Required | Name used to generate deterministic avatar |
198
+ | `colors` | `string[]` | Tailwind colors | Base color palette |
199
+ | `colorsLight` | `string[]` | Light variants | Colors for light mode |
200
+ | `colorsDark` | `string[]` | Dark variants | Colors for dark mode |
201
+ | `colorScheme` | `"light" \| "dark" \| "auto"` | `"auto"` | Color scheme to use |
202
+ | `showInitial` | `boolean` | `true` | Show first letter below face |
203
+ | `enable3D` | `boolean` | `true` | Enable 3D sphere rotation effect |
204
+
205
+ ### Avatar
206
+
207
+ | Prop | Type | Default | Description |
208
+ |------|------|---------|-------------|
209
+ | `asChild` | `boolean` | `false` | Render as child element (Slot pattern) |
210
+
211
+ ### AvatarImage
212
+
213
+ | Prop | Type | Default | Description |
214
+ |------|------|---------|-------------|
215
+ | `src` | `string \| null` | - | Image source URL |
216
+ | `alt` | `string` | `""` | Alt text for accessibility |
217
+ | `onLoadingStatusChange` | `(status) => void` | - | Callback on status change |
218
+
219
+ ### AvatarFallback
220
+
221
+ | Prop | Type | Default | Description |
222
+ |------|------|---------|-------------|
223
+ | `name` | `string` | `""` | Name for initials/FacehashAvatar |
224
+ | `facehash` | `boolean` | `false` | Use FacehashAvatar instead of initials |
225
+ | `facehashProps` | `FacehashAvatarProps` | - | Props to pass to FacehashAvatar |
226
+ | `delayMs` | `number` | `0` | Delay before showing fallback |
227
+ | `children` | `ReactNode` | - | Custom fallback content |
228
+
229
+ ## Exports
230
+
231
+ ```tsx
232
+ // Components
233
+ import {
234
+ FacehashAvatar,
235
+ Avatar,
236
+ AvatarImage,
237
+ AvatarFallback,
238
+ } from "facehash";
239
+
240
+ // Face components (for custom compositions)
241
+ import {
242
+ RoundFace,
243
+ CrossFace,
244
+ LineFace,
245
+ CurvedFace,
246
+ FACES,
247
+ } from "facehash";
248
+
249
+ // Utilities
250
+ import {
251
+ stringHash,
252
+ DEFAULT_COLORS,
253
+ DEFAULT_COLORS_LIGHT,
254
+ DEFAULT_COLORS_DARK,
255
+ } from "facehash";
256
+
257
+ // Hooks
258
+ import { useAvatarContext } from "facehash";
259
+ ```
260
+
261
+ ## Recipes
262
+
263
+ ### Next.js App Router
264
+
265
+ ```tsx
266
+ // components/user-avatar.tsx
267
+ "use client";
268
+
269
+ import { Avatar, AvatarImage, AvatarFallback } from "facehash";
270
+
271
+ export function UserAvatar({ user }: { user: { name: string; image?: string } }) {
272
+ return (
273
+ <Avatar className="relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full">
274
+ {user.image && <AvatarImage src={user.image} alt={user.name} />}
275
+ <AvatarFallback
276
+ name={user.name}
277
+ facehash
278
+ className="flex h-full w-full items-center justify-center"
279
+ />
280
+ </Avatar>
281
+ );
282
+ }
283
+ ```
284
+
285
+ ### Tailwind with Ring
286
+
287
+ ```tsx
288
+ <Avatar className="h-10 w-10 rounded-full ring-2 ring-white dark:ring-gray-900">
289
+ <AvatarImage src={url} />
290
+ <AvatarFallback name="John Doe" facehash />
291
+ </Avatar>
292
+ ```
293
+
294
+ ### Avatar Group
295
+
296
+ ```tsx
297
+ function AvatarGroup({ users }) {
298
+ return (
299
+ <div className="flex -space-x-2">
300
+ {users.map((user) => (
301
+ <Avatar
302
+ key={user.id}
303
+ className="h-8 w-8 rounded-full ring-2 ring-white"
304
+ >
305
+ <AvatarImage src={user.avatar} />
306
+ <AvatarFallback name={user.name} facehash />
307
+ </Avatar>
308
+ ))}
309
+ </div>
310
+ );
311
+ }
312
+ ```
313
+
314
+ ## Browser Support
315
+
316
+ - Chrome 88+
317
+ - Firefox 78+
318
+ - Safari 14+
319
+ - Edge 88+
320
+
321
+ ## Credits
322
+
323
+ Built with love by the [Cossistant](https://cossistant.com) team.
324
+
325
+ Inspired by [Boring Avatars](https://boringavatars.com/) by Josep Martins.
326
+
327
+ ## License
328
+
329
+ MIT
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/facehash.tsx","../src/avatar.tsx","../src/avatar-fallback.tsx","../src/avatar-image.tsx","../src/faces.tsx","../src/utils/hash.ts"],"sourcesContent":[],"mappings":";;;KAQY,WAAA;KACA,OAAA;AADA,UAGK,aAAA,SACR,IAJc,CAIT,KAAA,CAAM,cAJG,CAIY,cAJZ,CAAA,EAAA,UAAA,CAAA,CAAA;EACX;AAEZ;;;EAoBW,IAAA,EAAA,MAAA;EAMI;;;AA4Gf;EAAqB,IAAA,CAAA,EAAA,MAAA,GAAA,MAAA;EAAA;;;;;;YAlHV;EC7BN;AAEL;AAWA;AAUA;EAmBa,WAuCZ,CAAA,ED9Cc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F5B,SHzF4B,CAAA,EGyF5B,KAAA,CAAA,EHzF4B,CGyF5B,SHzF4B,CAAA,EGyF5B,KAAA,CAAA,EHzF4B,CGyF5B,SHzF4B,CAAA,CAAA;AAmBjC,KGwED,aAAA,GHjCX,CAAA,OGiCmC,KHjCnC,CAAA,CAAA,MAAA,CAAA;;;;;;AD3ED;AACA;AAEA;;AACoB,iBKLJ,UAAA,CLKI,GAAA,EAAA,MAAA,CAAA,EAAA,MAAA"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/facehash.tsx","../src/avatar.tsx","../src/avatar-fallback.tsx","../src/avatar-image.tsx","../src/faces.tsx","../src/utils/hash.ts"],"sourcesContent":[],"mappings":";;;KAQY,WAAA;KACA,OAAA;AADA,UAGK,aAAA,SACR,IAJc,CAIT,KAAA,CAAM,cAJG,CAIY,cAJZ,CAAA,EAAA,UAAA,CAAA,CAAA;EACX;AAEZ;;;EAoBW,IAAA,EAAA,MAAA;EAMI;;;AA4Gf;EAAqB,IAAA,CAAA,EAAA,MAAA,GAAA,MAAA;EAAA;;;;;;YAlHV;EC7BN;AAEL;AAWA;AAUA;EAmBa,WAuCZ,CAAA,ED9Cc,WC8Cd;EAvCkB;;;;;EAAA,WAAA,CAAA,EAAA,OAAA;;;;ACtCnB;EACsB,WAAA,CAAA,EAAA,OAAA;EAArB;;;;EA6BgB,MAAA,CAAA,EAAA,MAAA,EAAA;EAAI;AAsCrB;;;;EAjDY,YAAM,CAAA,EAAA,MAAA,EAAA;EAWI;;;;;EAsCK,oBAAA,CAAA,EAAA,MAAA;;;;AC1EI;AAK/B;;;;;;AA2BA;;;;;;;;;;;;AC9BY,cJ+IC,QI7IJ,EJ6IY,KAAA,CAAA,yBI7IO,CJ6IP,aI7IO,GJ6IP,KAAA,CAAA,aI7IO,CJ6IP,cI7IO,CAAA,CAAA;;;KHFvB,oBAAA;KAEO,kBAAA;EDIA,kBAAW,ECHF,oBDGE;EACX,0BAAO,EAAA,CAAA,MAAA,ECHm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EAAA,CAAA,MAAA,EGKyB,kBHLzB,EAAA,GAAA,IAAA;CAAI;AAqIb;;;;;;;;;ACjJ+B;AAI/B;AAWA;AAUY,cEOC,WFPkC,EEOvB,KAAA,CAAA,yBFPQ,CEOR,IFPsB,CEOtB,KAAA,CAAA,iBFPsB,CEOtB,gBFPsB,CAAA,EAAA,KAAA,CAAA,GAAA;EAmBjC;;;;;;;mCE3BqB;;;;KCftB,SAAA;;EJMA,KAAA,CAAA,EIJH,KAAA,CAAM,aJIQ;AACvB,CAAA;AAEA;;;AAoBW,cIrBE,SJqBF,EIrBa,KAAA,CAAM,EJqBnB,CIrBsB,SJqBtB,CAAA;;;;AAkHE,cI/GA,SJwSZ,EIxSuB,KAAA,CAAM,EJwS7B,CIxSgC,SJwShC,CAAA;;;;AAzLoB,cIvFR,QJuFQ,EIvFE,KAAA,CAAM,EJuFR,CIvFW,SJuFX,CAAA;;;;cIvDR,YAAY,KAAA,CAAM,GAAG;AH1FH;AAI/B;AAWA;AAUY,cGyFC,KHzFU,EAAA,SAAwB,CGyF7B,KAAA,CAAA,EHzF6B,CGyF7B,SHzFc,CAAA,EGyFd,KAAA,CAAA,EHzFc,CGyFd,SHzF4B,CAAA,EGyF5B,KAAA,CAAA,EHzF4B,CGyF5B,SHzF4B,CAAA,EGyF5B,KAAA,CAAA,EHzF4B,CGyF5B,SHzF4B,CAAA,CAAA;AAmBjC,KGwED,aAAA,GHjCX,CAAA,OGiCmC,KHjCnC,CAAA,CAAA,MAAA,CAAA;;;;;;AD3ED;AACA;AAEA;;AACoB,iBKLJ,UAAA,CLKI,GAAA,EAAA,MAAA,CAAA,EAAA,MAAA"}
@@ -0,0 +1,68 @@
1
+ {
2
+ "name": "facehash",
3
+ "type": "module",
4
+ "version": "0.0.3",
5
+ "private": false,
6
+ "author": "Cossistant team",
7
+ "description": "Deterministic avatar faces from any string. Lightweight, interactive, pure CSS. Works with any framework.",
8
+ "keywords": [
9
+ "facehash",
10
+ "avatar",
11
+ "react",
12
+ "react-avatar",
13
+ "deterministic",
14
+ "generative",
15
+ "profile-picture",
16
+ "profile-avatar",
17
+ "identicon",
18
+ "hash",
19
+ "face",
20
+ "3d",
21
+ "interactive",
22
+ "gradient",
23
+ "typescript",
24
+ "accessible",
25
+ "headless",
26
+ "unstyled",
27
+ "css",
28
+ "tailwind",
29
+ "boring-avatars",
30
+ "dicebear",
31
+ "jdenticon",
32
+ "gravatar-alternative",
33
+ "user-avatar",
34
+ "default-avatar"
35
+ ],
36
+ "bugs": {
37
+ "url": "https://github.com/cossistantcom/cossistant/issues"
38
+ },
39
+ "repository": {
40
+ "type": "git",
41
+ "url": "git+https://github.com/cossistantcom/cossistant.git",
42
+ "directory": "packages/facehash"
43
+ },
44
+ "license": "MIT",
45
+ "homepage": "https://cossistant.com",
46
+ "exports": {
47
+ ".": {
48
+ "types": "./index.d.ts",
49
+ "import": "./index.js"
50
+ }
51
+ },
52
+ "main": "./index.js",
53
+ "module": "./index.js",
54
+ "types": "./index.d.ts",
55
+ "peerDependencies": {
56
+ "react": ">=18 <20",
57
+ "react-dom": ">=18 <20",
58
+ "@types/react": ""
59
+ },
60
+ "peerDependenciesMeta": {
61
+ "@types/react": {
62
+ "optional": true
63
+ }
64
+ },
65
+ "publishConfig": {
66
+ "access": "public"
67
+ }
68
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "facehash",
3
3
  "type": "module",
4
- "version": "0.0.2",
4
+ "version": "0.0.3",
5
5
  "private": false,
6
6
  "author": "Cossistant team",
7
7
  "description": "Deterministic avatar faces from any string. Lightweight, interactive, pure CSS. Works with any framework.",
@@ -44,14 +44,17 @@
44
44
  "license": "MIT",
45
45
  "homepage": "https://cossistant.com",
46
46
  "exports": {
47
- ".": {
48
- "types": "./index.d.ts",
49
- "import": "./index.js"
50
- }
47
+ ".": "./src/index.ts"
48
+ },
49
+ "main": "./src/index.ts",
50
+ "module": "./src/index.ts",
51
+ "types": "./src/index.ts",
52
+ "files": [
53
+ "dist"
54
+ ],
55
+ "devDependencies": {
56
+ "@cossistant/typescript-config": "workspace:*"
51
57
  },
52
- "main": "./index.js",
53
- "module": "./index.js",
54
- "types": "./index.d.ts",
55
58
  "peerDependencies": {
56
59
  "react": ">=18 <20",
57
60
  "react-dom": ">=18 <20",
@@ -63,6 +66,15 @@
63
66
  }
64
67
  },
65
68
  "publishConfig": {
66
- "access": "public"
69
+ "access": "public",
70
+ "directory": "dist"
71
+ },
72
+ "scripts": {
73
+ "build": "tsdown && bun run prepare-package",
74
+ "prepare-package": "bun ../../scripts/prepare-package.ts",
75
+ "pub:release": "bun run build && npm publish --access public",
76
+ "pub:beta": "bun run build && npm publish --access public --tag beta --no-git-checks",
77
+ "lint": "biome check .",
78
+ "check-types": "tsc --noEmit --project tsconfig.json"
67
79
  }
68
80
  }
File without changes
File without changes
File without changes