@vaneui/ui 0.2.0 → 0.2.1-alpha.20250802125901.46ffce6

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/ui.css CHANGED
@@ -1170,6 +1170,10 @@
1170
1170
  --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
1171
1171
  box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
1172
1172
  }
1173
+ .ring-2 {
1174
+ --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
1175
+ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
1176
+ }
1173
1177
  .ring-\(--border-color-accent\) {
1174
1178
  --tw-ring-color: var(--border-color-accent);
1175
1179
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaneui/ui",
3
- "version": "0.2.0",
3
+ "version": "0.2.1-alpha.20250802125901.46ffce6",
4
4
  "description": "A simple and lightweight UI component library for React, built with Tailwind CSS.",
5
5
  "author": "",
6
6
  "license": "ISC",
@@ -28,9 +28,9 @@
28
28
  ],
29
29
  "exports": {
30
30
  ".": {
31
+ "types": "./dist/index.d.ts",
31
32
  "import": "./dist/index.esm.js",
32
- "require": "./dist/index.js",
33
- "types": "./dist/index.d.ts"
33
+ "require": "./dist/index.js"
34
34
  },
35
35
  "./vars": {
36
36
  "import": "./dist/vars.css",
@@ -48,7 +48,9 @@
48
48
  "build:css:vars": "npx @tailwindcss/cli -i src/components/css/vars.css -o ./dist/vars.css",
49
49
  "build:css:ui": "npx @tailwindcss/cli -i src/components/index.css -o ./dist/ui.css",
50
50
  "build": "npm run clean && npm run build:js && npm run build:css:ui && npm run build:css:vars",
51
- "test": "node node_modules/jest/bin/jest.js"
51
+ "test": "tsc --noEmit && node node_modules/jest/bin/jest.js",
52
+ "playground": "npm run build && cd playground && npm run dev",
53
+ "playground:dev": "cd playground && npm run dev"
52
54
  },
53
55
  "peerDependencies": {
54
56
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
@@ -64,6 +66,7 @@
64
66
  "@types/jest": "^29.5.14",
65
67
  "@types/react": "^19.1.0",
66
68
  "@types/react-dom": "^19.1.0",
69
+ "@vitejs/plugin-react": "^4.7.0",
67
70
  "concurrently": "^8.2.2",
68
71
  "jest": "^29.7.0",
69
72
  "jest-environment-jsdom": "^30.0.4",
@@ -78,6 +81,7 @@
78
81
  "tailwindcss": "^4.0.14",
79
82
  "ts-jest": "^29.3.1",
80
83
  "tslib": "^2.8.1",
81
- "typescript": "^5.8.2"
84
+ "typescript": "^5.8.2",
85
+ "vite": "^7.0.6"
82
86
  }
83
87
  }
@@ -1 +0,0 @@
1
- export { SocialShare } from "./sharer";
@@ -1,132 +0,0 @@
1
- import { jsx } from 'react/jsx-runtime';
2
-
3
- const buildQueryString = (params) => {
4
- const validKeys = Object.keys(params).filter(key => params[key] !== undefined && params[key] !== '');
5
- return validKeys.length > 0
6
- ? '?' +
7
- validKeys
8
- .map(key => `${key}=${encodeURIComponent(String(params[key]))}`)
9
- .join('&')
10
- : '';
11
- };
12
- const SocialShare = ({ url = window.location.href, text = '', width = 600, height = 480, isLink = false, isBlank = true, platforms, containerComponent, buttonComponent, buttonComponents, facebookProps = {}, twitterProps = {}, emailProps = {}, whatsappProps = {}, }) => {
13
- const shareConfigs = {
14
- fb: {
15
- shareUrl: 'https://www.facebook.com/sharer/sharer.php',
16
- getParams: () => ({
17
- u: url,
18
- hashtag: facebookProps.hashtag
19
- ? facebookProps.hashtag.startsWith('#')
20
- ? facebookProps.hashtag
21
- : `#${facebookProps.hashtag}`
22
- : '',
23
- quote: text,
24
- }),
25
- },
26
- li: {
27
- shareUrl: 'https://www.linkedin.com/shareArticle',
28
- getParams: () => ({
29
- url,
30
- }),
31
- },
32
- x: {
33
- shareUrl: 'https://x.com/intent/tweet',
34
- getParams: () => ({
35
- text,
36
- url,
37
- hashtags: twitterProps.hashtags,
38
- via: twitterProps.via,
39
- related: twitterProps.related,
40
- in_reply_to: twitterProps.inReplyTo,
41
- }),
42
- },
43
- th: {
44
- shareUrl: 'https://threads.net/intent/post',
45
- getParams: () => ({
46
- text: `${text} ${url}`,
47
- }),
48
- },
49
- em: {
50
- shareUrl: 'mailto:' + (emailProps.to || ''),
51
- getParams: () => ({
52
- subject: emailProps.title,
53
- body: `${text}\n${url}`,
54
- }),
55
- },
56
- wa: {
57
- shareUrl: whatsappProps.web
58
- ? 'https://web.whatsapp.com/send'
59
- : 'https://wa.me/',
60
- getParams: () => ({
61
- phone: whatsappProps.to,
62
- text: `${text} ${url}`,
63
- }),
64
- },
65
- tg: {
66
- shareUrl: 'https://t.me/share',
67
- getParams: () => ({
68
- text,
69
- url,
70
- }),
71
- },
72
- re: {
73
- shareUrl: 'https://www.reddit.com/submit',
74
- getParams: () => ({
75
- url,
76
- title: text,
77
- }),
78
- },
79
- };
80
- const platformLabels = {
81
- fb: 'Facebook',
82
- li: 'LinkedIn',
83
- x: 'X',
84
- th: 'Threads',
85
- em: 'Email',
86
- wa: 'WhatsApp',
87
- tg: 'Telegram',
88
- re: 'Reddit',
89
- };
90
- const buildShareUrl = (config) => {
91
- const params = config.getParams();
92
- const queryString = buildQueryString(params);
93
- return config.shareUrl + queryString;
94
- };
95
- const openShareWindow = (shareUrl) => {
96
- if (isLink) {
97
- if (isBlank) {
98
- window.open(shareUrl, '_blank');
99
- }
100
- else {
101
- window.location.href = shareUrl;
102
- }
103
- }
104
- else {
105
- const left = window.innerWidth / 2 - width / 2 + window.screenX;
106
- const top = window.innerHeight / 2 - height / 2 + window.screenY;
107
- const popParams = `scrollbars=no, width=${width}, height=${height}, top=${top}, left=${left}`;
108
- const newWindow = window.open(shareUrl, '', popParams);
109
- if (newWindow) {
110
- newWindow.focus();
111
- }
112
- }
113
- };
114
- const handleShare = (key) => {
115
- const config = shareConfigs[key];
116
- if (!config)
117
- return;
118
- const shareUrl = buildShareUrl(config);
119
- openShareWindow(shareUrl);
120
- };
121
- const ContainerComponent = containerComponent || 'div';
122
- const DefaultButton = buttonComponent || 'button';
123
- const platformsToShow = platforms || Object.keys(shareConfigs);
124
- return (jsx(ContainerComponent, { children: platformsToShow.map(key => {
125
- const Button = (buttonComponents && buttonComponents[key]) || DefaultButton;
126
- const label = platformLabels[key] || key;
127
- return (jsx(Button, { onClick: () => handleShare(key), title: `Share on ${label}`, children: label }, key));
128
- }) }));
129
- };
130
-
131
- export { SocialShare };
132
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}