@grasco/profile-picture 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 +385 -0
- package/dist/angular.cjs +353 -0
- package/dist/angular.cjs.map +1 -0
- package/dist/angular.d.cts +132 -0
- package/dist/angular.d.ts +132 -0
- package/dist/angular.js +353 -0
- package/dist/angular.js.map +1 -0
- package/dist/index.cjs +885 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +389 -0
- package/dist/index.d.ts +389 -0
- package/dist/index.js +885 -0
- package/dist/index.js.map +1 -0
- package/dist/standalone.d.ts +260 -0
- package/dist/standalone.standalone.js +952 -0
- package/dist/standalone.standalone.js.map +1 -0
- package/dist/styles.css +2 -0
- package/dist/svelte.cjs +353 -0
- package/dist/svelte.cjs.map +1 -0
- package/dist/svelte.d.cts +132 -0
- package/dist/svelte.d.ts +132 -0
- package/dist/svelte.js +353 -0
- package/dist/svelte.js.map +1 -0
- package/dist/vue.cjs +353 -0
- package/dist/vue.cjs.map +1 -0
- package/dist/vue.d.cts +132 -0
- package/dist/vue.d.ts +132 -0
- package/dist/vue.js +353 -0
- package/dist/vue.js.map +1 -0
- package/package.json +130 -0
- package/tailwind.safelist.js +90 -0
package/package.json
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@grasco/profile-picture",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Lightweight, tree-shakeable profile picture component with ribbon and badge support",
|
|
5
|
+
"author": "Grasco Lab",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"sideEffects": true,
|
|
9
|
+
"main": "./dist/index.cjs",
|
|
10
|
+
"module": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"import": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"default": "./dist/index.js"
|
|
17
|
+
},
|
|
18
|
+
"require": {
|
|
19
|
+
"types": "./dist/index.d.cts",
|
|
20
|
+
"default": "./dist/index.cjs"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"./standalone": {
|
|
24
|
+
"import": {
|
|
25
|
+
"types": "./dist/standalone.d.ts",
|
|
26
|
+
"default": "./dist/standalone.standalone.js"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"./vue": {
|
|
30
|
+
"import": {
|
|
31
|
+
"types": "./dist/vue.d.ts",
|
|
32
|
+
"default": "./dist/vue.js"
|
|
33
|
+
},
|
|
34
|
+
"require": {
|
|
35
|
+
"types": "./dist/vue.d.cts",
|
|
36
|
+
"default": "./dist/vue.cjs"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"./svelte": {
|
|
40
|
+
"import": {
|
|
41
|
+
"types": "./dist/svelte.d.ts",
|
|
42
|
+
"default": "./dist/svelte.js"
|
|
43
|
+
},
|
|
44
|
+
"require": {
|
|
45
|
+
"types": "./dist/svelte.d.cts",
|
|
46
|
+
"default": "./dist/svelte.cjs"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"./angular": {
|
|
50
|
+
"import": {
|
|
51
|
+
"types": "./dist/angular.d.ts",
|
|
52
|
+
"default": "./dist/angular.js"
|
|
53
|
+
},
|
|
54
|
+
"require": {
|
|
55
|
+
"types": "./dist/angular.d.cts",
|
|
56
|
+
"default": "./dist/angular.cjs"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"./tailwind.safelist": {
|
|
60
|
+
"import": "./tailwind.safelist.js",
|
|
61
|
+
"require": "./tailwind.safelist.js"
|
|
62
|
+
},
|
|
63
|
+
"./styles.css": "./dist/styles.css"
|
|
64
|
+
},
|
|
65
|
+
"files": [
|
|
66
|
+
"dist",
|
|
67
|
+
"registry",
|
|
68
|
+
"tailwind.safelist.js",
|
|
69
|
+
"TREE_SHAKING.md",
|
|
70
|
+
"OPTIMIZATION_SUMMARY.md",
|
|
71
|
+
"BEFORE_AFTER.md",
|
|
72
|
+
"CHANGES.md",
|
|
73
|
+
"QUICK_START_TREE_SHAKING.md",
|
|
74
|
+
"BUILD_VERIFICATION.md"
|
|
75
|
+
],
|
|
76
|
+
"scripts": {
|
|
77
|
+
"build": "tsup && bun run build:css",
|
|
78
|
+
"build:js": "tsup",
|
|
79
|
+
"build:css": "bunx @tailwindcss/cli -i ./src/styles.css -o ./dist/styles.css -m",
|
|
80
|
+
"dev": "tsup --watch",
|
|
81
|
+
"dev:css": "bunx @tailwindcss/cli -i ./src/styles.css -o ./dist/styles.css --watch",
|
|
82
|
+
"type-check": "tsc --noEmit",
|
|
83
|
+
"clean": "rm -rf dist",
|
|
84
|
+
"prepublishOnly": "bun run build",
|
|
85
|
+
"serve": "bunx serve -p 3334",
|
|
86
|
+
"publish:npm": "npm publish --access public"
|
|
87
|
+
},
|
|
88
|
+
"dependencies": {
|
|
89
|
+
"lit": "^3.1.0"
|
|
90
|
+
},
|
|
91
|
+
"peerDependencies": {
|
|
92
|
+
"react": ">=18.0.0"
|
|
93
|
+
},
|
|
94
|
+
"peerDependenciesMeta": {
|
|
95
|
+
"react": {
|
|
96
|
+
"optional": true
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"devDependencies": {
|
|
100
|
+
"@tailwindcss/postcss": "^4.1.18",
|
|
101
|
+
"@types/node": "^20.0.0",
|
|
102
|
+
"@types/react": "^18.2.0",
|
|
103
|
+
"autoprefixer": "^10.4.23",
|
|
104
|
+
"postcss": "^8.5.6",
|
|
105
|
+
"postcss-load-config": "^6.0.1",
|
|
106
|
+
"react": "^18.2.0",
|
|
107
|
+
"tailwindcss": "^4.1.18",
|
|
108
|
+
"tsup": "^8.0.0",
|
|
109
|
+
"typescript": "^5.3.0"
|
|
110
|
+
},
|
|
111
|
+
"keywords": [
|
|
112
|
+
"react",
|
|
113
|
+
"avatar",
|
|
114
|
+
"profile-picture",
|
|
115
|
+
"component",
|
|
116
|
+
"tailwindcss",
|
|
117
|
+
"shadcn",
|
|
118
|
+
"vue",
|
|
119
|
+
"svelte",
|
|
120
|
+
"angular"
|
|
121
|
+
],
|
|
122
|
+
"repository": {
|
|
123
|
+
"type": "git",
|
|
124
|
+
"url": "https://github.com/grasco-lab/main-backend.git",
|
|
125
|
+
"directory": "sdk/profile-picture"
|
|
126
|
+
},
|
|
127
|
+
"publishConfig": {
|
|
128
|
+
"access": "public"
|
|
129
|
+
}
|
|
130
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tailwind Safelist for @grasco/profile-picture
|
|
3
|
+
*
|
|
4
|
+
* This file documents classes that may be used dynamically and need
|
|
5
|
+
* to be safelisted for Tailwind's tree shaking.
|
|
6
|
+
*
|
|
7
|
+
* Usage in your tailwind.config.js:
|
|
8
|
+
* ```js
|
|
9
|
+
* import { safelist } from '@grasco/profile-picture/tailwind.safelist';
|
|
10
|
+
*
|
|
11
|
+
* export default {
|
|
12
|
+
* safelist,
|
|
13
|
+
* content: ['./node_modules/@grasco/profile-picture/dist/**\/*.{js,ts}'],
|
|
14
|
+
* // ... rest of config
|
|
15
|
+
* }
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
export const safelist = [
|
|
20
|
+
// Border colors - common patterns
|
|
21
|
+
// Users can pass "white" → becomes "border-white"
|
|
22
|
+
// Or pass complete class "border-white" directly
|
|
23
|
+
{
|
|
24
|
+
pattern:
|
|
25
|
+
/^border-(white|black|gray|slate|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)(-\d+)?$/,
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
// Background colors - common patterns
|
|
29
|
+
// Users can pass "blue-500" → becomes "bg-blue-500"
|
|
30
|
+
// Or pass complete class "bg-blue-500" directly
|
|
31
|
+
{
|
|
32
|
+
pattern:
|
|
33
|
+
/^bg-(white|black|gray|slate|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)(-\d+)?$/,
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
// Text colors for badges and ribbons
|
|
37
|
+
{
|
|
38
|
+
pattern:
|
|
39
|
+
/^text-(white|black|gray|slate|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)(-\d+)?$/,
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
// Gradient backgrounds
|
|
43
|
+
{
|
|
44
|
+
pattern: /^bg-gradient-(to|from|via)-(t|tr|r|br|b|bl|l|tl)$/,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
pattern:
|
|
48
|
+
/^(from|to|via)-(white|black|gray|slate|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)(-\d+)?$/,
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
// Border widths (already static, but included for completeness)
|
|
52
|
+
"border",
|
|
53
|
+
"border-2",
|
|
54
|
+
"border-[3px]",
|
|
55
|
+
"border-4",
|
|
56
|
+
|
|
57
|
+
// Variants (already static)
|
|
58
|
+
"rounded-full",
|
|
59
|
+
"rounded-lg",
|
|
60
|
+
"rounded-none",
|
|
61
|
+
|
|
62
|
+
// Default background
|
|
63
|
+
"bg-gray-100",
|
|
64
|
+
|
|
65
|
+
// Animations
|
|
66
|
+
"animate-pulse",
|
|
67
|
+
];
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Recommended: Use complete class names to avoid safelist
|
|
71
|
+
*
|
|
72
|
+
* Instead of: bgColor="blue-500" → requires safelist
|
|
73
|
+
* Prefer: bgColor="bg-blue-500" → detected by Tailwind scanner
|
|
74
|
+
*
|
|
75
|
+
* Or use hex: bgColor="#3b82f6" → uses inline style, no class
|
|
76
|
+
*/
|
|
77
|
+
export const recommendations = {
|
|
78
|
+
goodExamples: [
|
|
79
|
+
'bgColor="bg-blue-500"',
|
|
80
|
+
'borderColor="border-white"',
|
|
81
|
+
'bgGradient="bg-gradient-to-br from-purple-500 to-pink-500"',
|
|
82
|
+
'bgColor="#3b82f6"',
|
|
83
|
+
],
|
|
84
|
+
badExamples: [
|
|
85
|
+
'bgColor="blue-500"', // Missing "bg-" prefix
|
|
86
|
+
'borderColor="white"', // Missing "border-" prefix
|
|
87
|
+
],
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export default safelist;
|