@thangnqdev/ui 0.2.1 → 0.2.2
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/LICENSE +21 -21
- package/README.md +144 -142
- package/bin/cli.js +125 -125
- package/dist/bento/index.cjs.map +1 -1
- package/dist/bento/index.js +2 -2
- package/dist/buttons/index.cjs.map +1 -1
- package/dist/buttons/index.js +3 -3
- package/dist/{chunk-77KTYOMQ.js → chunk-2OXZK6IP.js} +3 -3
- package/dist/chunk-2OXZK6IP.js.map +1 -0
- package/dist/{chunk-4CRFNALF.js → chunk-4GNFT2ZJ.js} +7 -7
- package/dist/chunk-4GNFT2ZJ.js.map +1 -0
- package/dist/{chunk-2YJBW4E2.js → chunk-4S6L5V7X.js} +2 -2
- package/dist/chunk-4S6L5V7X.js.map +1 -0
- package/dist/{chunk-I2FQBMVW.js → chunk-66VWUJEI.js} +3 -3
- package/dist/chunk-66VWUJEI.js.map +1 -0
- package/dist/{chunk-YOCGBORV.js → chunk-7NMB2Y64.js} +4 -4
- package/dist/chunk-7NMB2Y64.js.map +1 -0
- package/dist/{chunk-V52JOSDF.js → chunk-A7P3O5Z5.js} +3 -3
- package/dist/chunk-A7P3O5Z5.js.map +1 -0
- package/dist/{chunk-ME4XILG5.js → chunk-ATYGDTMK.js} +5 -5
- package/dist/chunk-ATYGDTMK.js.map +1 -0
- package/dist/{chunk-S6XJMYME.js → chunk-C4SUXMI3.js} +3 -3
- package/dist/chunk-C4SUXMI3.js.map +1 -0
- package/dist/{chunk-EXFR2BFJ.js → chunk-DUPPPGXY.js} +7 -7
- package/dist/chunk-DUPPPGXY.js.map +1 -0
- package/dist/{chunk-I5O2WCGF.js → chunk-EU2LPUYP.js} +3 -3
- package/dist/chunk-EU2LPUYP.js.map +1 -0
- package/dist/{chunk-D7FB3TCA.js → chunk-GXI2H5XA.js} +3 -3
- package/dist/chunk-GXI2H5XA.js.map +1 -0
- package/dist/{chunk-ADO3SVUA.js → chunk-IABPUCAQ.js} +2 -2
- package/dist/chunk-IABPUCAQ.js.map +1 -0
- package/dist/{chunk-PC5SZFZC.js → chunk-JOKEKOP3.js} +8 -8
- package/dist/chunk-JOKEKOP3.js.map +1 -0
- package/dist/{chunk-GXWB6BSY.js → chunk-KUQWUTZA.js} +4 -4
- package/dist/chunk-KUQWUTZA.js.map +1 -0
- package/dist/{chunk-ZEDXARXW.js → chunk-U3J4UPV3.js} +2 -2
- package/dist/chunk-U3J4UPV3.js.map +1 -0
- package/dist/{chunk-DSEL7ELZ.js → chunk-VE2PNSDQ.js} +4 -4
- package/dist/chunk-VE2PNSDQ.js.map +1 -0
- package/dist/{chunk-YJ64RI7J.js → chunk-WAFHC4DQ.js} +3 -3
- package/dist/chunk-WAFHC4DQ.js.map +1 -0
- package/dist/{chunk-W5WNWTQC.js → chunk-YJ67WYVW.js} +5 -5
- package/dist/chunk-YJ67WYVW.js.map +1 -0
- package/dist/{chunk-4MS6ZHFQ.js → chunk-Z427NPMU.js} +7 -7
- package/dist/chunk-Z427NPMU.js.map +1 -0
- package/dist/core/index.cjs +4 -4
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.js +2 -2
- package/dist/data-display/index.cjs.map +1 -1
- package/dist/data-display/index.js +5 -5
- package/dist/feedback/index.cjs.map +1 -1
- package/dist/feedback/index.js +2 -2
- package/dist/forms/index.cjs.map +1 -1
- package/dist/forms/index.js +8 -8
- package/dist/glass/index.cjs.map +1 -1
- package/dist/glass/index.js +2 -2
- package/dist/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +19 -19
- package/dist/layout/index.cjs.map +1 -1
- package/dist/layout/index.js +2 -2
- package/dist/navigation/index.cjs.map +1 -1
- package/dist/navigation/index.js +6 -6
- package/dist/overlays/index.cjs.map +1 -1
- package/dist/overlays/index.js +7 -7
- package/dist/reset.css +45 -45
- package/dist/tokens.css +11 -11
- package/dist/typography/index.cjs.map +1 -1
- package/dist/typography/index.js +4 -4
- package/llms.txt +3 -3
- package/package.json +165 -165
- package/scripts/postinstall.js +125 -125
- package/src/bento/BentoCard.tsx +140 -140
- package/src/bento/BentoGrid.tsx +50 -50
- package/src/bento/index.ts +2 -2
- package/src/bento/tokens.css +46 -46
- package/src/buttons/Button.tsx +104 -104
- package/src/buttons/ButtonGroup.tsx +43 -43
- package/src/buttons/IconButton.tsx +79 -79
- package/src/buttons/SplitButton.tsx +186 -186
- package/src/buttons/ToggleButton.tsx +157 -157
- package/src/buttons/index.ts +5 -5
- package/src/buttons/tokens.css +6 -6
- package/src/core/ThemeProvider.tsx +133 -133
- package/src/core/index.ts +2 -2
- package/src/core/tokens.css +134 -134
- package/src/data-display/Accordion.tsx +147 -147
- package/src/data-display/Avatar.tsx +134 -134
- package/src/data-display/Card.tsx +112 -112
- package/src/data-display/Chip.tsx +74 -74
- package/src/data-display/DataTablePro.tsx +534 -534
- package/src/data-display/StatCard.tsx +60 -60
- package/src/data-display/Table.tsx +74 -74
- package/src/data-display/Timeline.tsx +62 -62
- package/src/data-display/TreeView.tsx +279 -279
- package/src/data-display/tokens.css +4 -4
- package/src/feedback/Alert.tsx +80 -80
- package/src/feedback/EmptyState.tsx +45 -45
- package/src/feedback/Skeleton.tsx +66 -66
- package/src/feedback/Spinner.tsx +65 -65
- package/src/feedback/index.ts +5 -5
- package/src/feedback/tokens.css +4 -4
- package/src/forms/Checkbox.tsx +149 -149
- package/src/forms/CheckboxGroup.tsx +76 -76
- package/src/forms/Combobox.tsx +512 -512
- package/src/forms/DatePicker.tsx +784 -784
- package/src/forms/FileUpload.tsx +266 -266
- package/src/forms/FormField.tsx +115 -115
- package/src/forms/Input.tsx +151 -151
- package/src/forms/NumberInput.tsx +262 -262
- package/src/forms/PasswordInput.tsx +35 -35
- package/src/forms/PinInput.tsx +139 -139
- package/src/forms/Radio.tsx +142 -142
- package/src/forms/RangeSlider.tsx +237 -237
- package/src/forms/SearchInput.tsx +34 -34
- package/src/forms/Select.tsx +103 -103
- package/src/forms/Slider.tsx +85 -85
- package/src/forms/Textarea.tsx +114 -114
- package/src/forms/tokens.css +6 -6
- package/src/glass/GlassButton.tsx +59 -59
- package/src/glass/GlassCard.tsx +71 -71
- package/src/glass/index.ts +3 -3
- package/src/glass/tokens.css +81 -81
- package/src/index.ts +26 -26
- package/src/layout/AspectRatio.tsx +39 -39
- package/src/layout/Container.tsx +53 -53
- package/src/layout/Divider.tsx +61 -61
- package/src/layout/Flex.tsx +79 -79
- package/src/layout/Grid.tsx +124 -124
- package/src/layout/PageLayout.tsx +59 -59
- package/src/layout/Section.tsx +47 -47
- package/src/layout/Spacer.tsx +30 -30
- package/src/layout/Stack.tsx +88 -88
- package/src/layout/tokens.css +8 -8
- package/src/navigation/Breadcrumb.tsx +73 -73
- package/src/navigation/CommandPalette.tsx +142 -142
- package/src/navigation/DropdownMenu.tsx +244 -244
- package/src/navigation/Pagination.tsx +114 -114
- package/src/navigation/Stepper.tsx +93 -93
- package/src/navigation/Tabs.tsx +265 -265
- package/src/navigation/index.ts +6 -6
- package/src/navigation/tokens.css +4 -4
- package/src/overlays/AlertDialog.tsx +63 -63
- package/src/overlays/BottomSheet.tsx +143 -143
- package/src/overlays/ContextMenu.tsx +161 -161
- package/src/overlays/Drawer.tsx +160 -160
- package/src/overlays/FocusTrap.tsx +122 -122
- package/src/overlays/Modal.tsx +296 -296
- package/src/overlays/Popover.tsx +156 -156
- package/src/overlays/Portal.tsx +23 -23
- package/src/overlays/Toast.tsx +175 -175
- package/src/overlays/Tooltip.tsx +125 -125
- package/src/overlays/tokens.css +8 -8
- package/src/registry/components.ts +1368 -1368
- package/src/styles/components.css +39 -39
- package/src/styles/index.css +5 -5
- package/src/styles/reset.css +45 -45
- package/src/styles/tokens.css +11 -11
- package/src/typography/Blockquote.tsx +32 -32
- package/src/typography/Code.tsx +89 -89
- package/src/typography/Heading.tsx +56 -56
- package/src/typography/Kbd.tsx +25 -25
- package/src/typography/Label.tsx +47 -47
- package/src/typography/Link.tsx +56 -56
- package/src/typography/Text.tsx +62 -62
- package/src/typography/index.ts +7 -7
- package/src/typography/tokens.css +5 -5
- package/src/utils/cn.ts +6 -6
- package/src/utils/scroll-lock.ts +19 -19
- package/src/utils/useControllableState.ts +54 -54
- package/ui-contract.json +1 -1
- package/dist/chunk-2YJBW4E2.js.map +0 -1
- package/dist/chunk-4CRFNALF.js.map +0 -1
- package/dist/chunk-4MS6ZHFQ.js.map +0 -1
- package/dist/chunk-77KTYOMQ.js.map +0 -1
- package/dist/chunk-ADO3SVUA.js.map +0 -1
- package/dist/chunk-D7FB3TCA.js.map +0 -1
- package/dist/chunk-DSEL7ELZ.js.map +0 -1
- package/dist/chunk-EXFR2BFJ.js.map +0 -1
- package/dist/chunk-GXWB6BSY.js.map +0 -1
- package/dist/chunk-I2FQBMVW.js.map +0 -1
- package/dist/chunk-I5O2WCGF.js.map +0 -1
- package/dist/chunk-ME4XILG5.js.map +0 -1
- package/dist/chunk-PC5SZFZC.js.map +0 -1
- package/dist/chunk-S6XJMYME.js.map +0 -1
- package/dist/chunk-V52JOSDF.js.map +0 -1
- package/dist/chunk-W5WNWTQC.js.map +0 -1
- package/dist/chunk-YJ64RI7J.js.map +0 -1
- package/dist/chunk-YOCGBORV.js.map +0 -1
- package/dist/chunk-ZEDXARXW.js.map +0 -1
package/scripts/postinstall.js
CHANGED
|
@@ -1,125 +1,125 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import fs from 'node:fs';
|
|
4
|
-
import path from 'node:path';
|
|
5
|
-
import os from 'node:os';
|
|
6
|
-
import readline from 'node:readline';
|
|
7
|
-
import { execSync } from 'node:child_process';
|
|
8
|
-
|
|
9
|
-
const CONFIG_DIR = path.join(os.homedir(), '.thangnqdev-ui');
|
|
10
|
-
const CONFIG_FILE = path.join(CONFIG_DIR, 'telemetry.json');
|
|
11
|
-
|
|
12
|
-
// 1. Silent bailouts for CI, non-interactive environments, and opt-out flags
|
|
13
|
-
if (
|
|
14
|
-
process.env.CI ||
|
|
15
|
-
process.env.CONTINUOUS_INTEGRATION ||
|
|
16
|
-
process.env.DO_NOT_TRACK === '1' ||
|
|
17
|
-
process.env.AETHER_TELEMETRY_DISABLED === '1' ||
|
|
18
|
-
!process.stdout.isTTY ||
|
|
19
|
-
!process.stdin.isTTY
|
|
20
|
-
) {
|
|
21
|
-
process.exit(0);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// 2. Check if user has already configured preference
|
|
25
|
-
if (fs.existsSync(CONFIG_FILE)) {
|
|
26
|
-
try {
|
|
27
|
-
const config = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf-8'));
|
|
28
|
-
if (config.prompted) {
|
|
29
|
-
process.exit(0);
|
|
30
|
-
}
|
|
31
|
-
} catch {
|
|
32
|
-
// Ignore corrupted config
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function getGitRemote() {
|
|
37
|
-
try {
|
|
38
|
-
const remote = execSync('git remote get-url origin', {
|
|
39
|
-
stdio: ['pipe', 'pipe', 'ignore'],
|
|
40
|
-
timeout: 1000,
|
|
41
|
-
})
|
|
42
|
-
.toString()
|
|
43
|
-
.trim();
|
|
44
|
-
return remote;
|
|
45
|
-
} catch {
|
|
46
|
-
return null;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function saveConfig(data) {
|
|
51
|
-
try {
|
|
52
|
-
if (!fs.existsSync(CONFIG_DIR)) {
|
|
53
|
-
fs.mkdirSync(CONFIG_DIR, { recursive: true });
|
|
54
|
-
}
|
|
55
|
-
fs.writeFileSync(
|
|
56
|
-
CONFIG_FILE,
|
|
57
|
-
JSON.stringify(
|
|
58
|
-
{
|
|
59
|
-
...data,
|
|
60
|
-
updatedAt: new Date().toISOString(),
|
|
61
|
-
prompted: true,
|
|
62
|
-
},
|
|
63
|
-
null,
|
|
64
|
-
2
|
|
65
|
-
)
|
|
66
|
-
);
|
|
67
|
-
} catch {
|
|
68
|
-
// Ignore filesystem permissions error on read-only environments
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
async function promptUser() {
|
|
73
|
-
const detectedRepo = getGitRemote();
|
|
74
|
-
|
|
75
|
-
console.log('\n\x1b[36m╭────────────────────────────────────────────────────────────────────────╮\x1b[0m');
|
|
76
|
-
console.log('\x1b[36m│\x1b[0m \x1b[1m✦ Thanks for installing @thangnqdev/ui (AETHER Spatial UI)\x1b[0m \x1b[36m│\x1b[0m');
|
|
77
|
-
console.log('\x1b[36m│\x1b[0m \x1b[36m│\x1b[0m');
|
|
78
|
-
console.log('\x1b[36m│\x1b[0m Would you like to share your public repository info to be featured \x1b[36m│\x1b[0m');
|
|
79
|
-
console.log('\x1b[36m│\x1b[0m in the AETHER Community Showcase & project ecosystem? \x1b[36m│\x1b[0m');
|
|
80
|
-
if (detectedRepo) {
|
|
81
|
-
console.log(`\x1b[36m│\x1b[0m \x1b[90mDetected repo:\x1b[0m \x1b[32m${detectedRepo.slice(0, 52)}\x1b[0m \x1b[36m│\x1b[0m`);
|
|
82
|
-
}
|
|
83
|
-
console.log('\x1b[36m│\x1b[0m \x1b[36m│\x1b[0m');
|
|
84
|
-
console.log('\x1b[36m│\x1b[0m \x1b[1m[y]\x1b[0m Yes, share repo info \x1b[1m[n]\x1b[0m No, keep anonymous (Default: n) \x1b[36m│\x1b[0m');
|
|
85
|
-
console.log('\x1b[36m╰────────────────────────────────────────────────────────────────────────╯\x1b[0m');
|
|
86
|
-
|
|
87
|
-
const rl = readline.createInterface({
|
|
88
|
-
input: process.stdin,
|
|
89
|
-
output: process.stdout,
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
return new Promise((resolve) => {
|
|
93
|
-
// Timeout prompt after 15 seconds so installation never hangs
|
|
94
|
-
const timer = setTimeout(() => {
|
|
95
|
-
saveConfig({ enabled: false, repo: null });
|
|
96
|
-
rl.close();
|
|
97
|
-
resolve();
|
|
98
|
-
}, 15000);
|
|
99
|
-
|
|
100
|
-
rl.question(' \x1b[33mShare repository info? (y/N):\x1b[0m ', (answer) => {
|
|
101
|
-
clearTimeout(timer);
|
|
102
|
-
const isYes = answer.trim().toLowerCase() === 'y' || answer.trim().toLowerCase() === 'yes';
|
|
103
|
-
|
|
104
|
-
if (isYes) {
|
|
105
|
-
saveConfig({
|
|
106
|
-
enabled: true,
|
|
107
|
-
repo: detectedRepo || 'manual-opt-in',
|
|
108
|
-
optedInAt: new Date().toISOString(),
|
|
109
|
-
});
|
|
110
|
-
console.log(' \x1b[32m✔ Thank you! Repository info shared with AETHER Community Showcase.\x1b[0m\n');
|
|
111
|
-
} else {
|
|
112
|
-
saveConfig({
|
|
113
|
-
enabled: false,
|
|
114
|
-
repo: null,
|
|
115
|
-
});
|
|
116
|
-
console.log(' \x1b[90m✔ Understood. Anonymous mode active. (Manage anytime via npx @thangnqdev/ui showcase)\x1b[0m\n');
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
rl.close();
|
|
120
|
-
resolve();
|
|
121
|
-
});
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
promptUser().catch(() => process.exit(0));
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import fs from 'node:fs';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import os from 'node:os';
|
|
6
|
+
import readline from 'node:readline';
|
|
7
|
+
import { execSync } from 'node:child_process';
|
|
8
|
+
|
|
9
|
+
const CONFIG_DIR = path.join(os.homedir(), '.thangnqdev-ui');
|
|
10
|
+
const CONFIG_FILE = path.join(CONFIG_DIR, 'telemetry.json');
|
|
11
|
+
|
|
12
|
+
// 1. Silent bailouts for CI, non-interactive environments, and opt-out flags
|
|
13
|
+
if (
|
|
14
|
+
process.env.CI ||
|
|
15
|
+
process.env.CONTINUOUS_INTEGRATION ||
|
|
16
|
+
process.env.DO_NOT_TRACK === '1' ||
|
|
17
|
+
process.env.AETHER_TELEMETRY_DISABLED === '1' ||
|
|
18
|
+
!process.stdout.isTTY ||
|
|
19
|
+
!process.stdin.isTTY
|
|
20
|
+
) {
|
|
21
|
+
process.exit(0);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// 2. Check if user has already configured preference
|
|
25
|
+
if (fs.existsSync(CONFIG_FILE)) {
|
|
26
|
+
try {
|
|
27
|
+
const config = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf-8'));
|
|
28
|
+
if (config.prompted) {
|
|
29
|
+
process.exit(0);
|
|
30
|
+
}
|
|
31
|
+
} catch {
|
|
32
|
+
// Ignore corrupted config
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function getGitRemote() {
|
|
37
|
+
try {
|
|
38
|
+
const remote = execSync('git remote get-url origin', {
|
|
39
|
+
stdio: ['pipe', 'pipe', 'ignore'],
|
|
40
|
+
timeout: 1000,
|
|
41
|
+
})
|
|
42
|
+
.toString()
|
|
43
|
+
.trim();
|
|
44
|
+
return remote;
|
|
45
|
+
} catch {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function saveConfig(data) {
|
|
51
|
+
try {
|
|
52
|
+
if (!fs.existsSync(CONFIG_DIR)) {
|
|
53
|
+
fs.mkdirSync(CONFIG_DIR, { recursive: true });
|
|
54
|
+
}
|
|
55
|
+
fs.writeFileSync(
|
|
56
|
+
CONFIG_FILE,
|
|
57
|
+
JSON.stringify(
|
|
58
|
+
{
|
|
59
|
+
...data,
|
|
60
|
+
updatedAt: new Date().toISOString(),
|
|
61
|
+
prompted: true,
|
|
62
|
+
},
|
|
63
|
+
null,
|
|
64
|
+
2
|
|
65
|
+
)
|
|
66
|
+
);
|
|
67
|
+
} catch {
|
|
68
|
+
// Ignore filesystem permissions error on read-only environments
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
async function promptUser() {
|
|
73
|
+
const detectedRepo = getGitRemote();
|
|
74
|
+
|
|
75
|
+
console.log('\n\x1b[36m╭────────────────────────────────────────────────────────────────────────╮\x1b[0m');
|
|
76
|
+
console.log('\x1b[36m│\x1b[0m \x1b[1m✦ Thanks for installing @thangnqdev/ui (AETHER Spatial UI)\x1b[0m \x1b[36m│\x1b[0m');
|
|
77
|
+
console.log('\x1b[36m│\x1b[0m \x1b[36m│\x1b[0m');
|
|
78
|
+
console.log('\x1b[36m│\x1b[0m Would you like to share your public repository info to be featured \x1b[36m│\x1b[0m');
|
|
79
|
+
console.log('\x1b[36m│\x1b[0m in the AETHER Community Showcase & project ecosystem? \x1b[36m│\x1b[0m');
|
|
80
|
+
if (detectedRepo) {
|
|
81
|
+
console.log(`\x1b[36m│\x1b[0m \x1b[90mDetected repo:\x1b[0m \x1b[32m${detectedRepo.slice(0, 52)}\x1b[0m \x1b[36m│\x1b[0m`);
|
|
82
|
+
}
|
|
83
|
+
console.log('\x1b[36m│\x1b[0m \x1b[36m│\x1b[0m');
|
|
84
|
+
console.log('\x1b[36m│\x1b[0m \x1b[1m[y]\x1b[0m Yes, share repo info \x1b[1m[n]\x1b[0m No, keep anonymous (Default: n) \x1b[36m│\x1b[0m');
|
|
85
|
+
console.log('\x1b[36m╰────────────────────────────────────────────────────────────────────────╯\x1b[0m');
|
|
86
|
+
|
|
87
|
+
const rl = readline.createInterface({
|
|
88
|
+
input: process.stdin,
|
|
89
|
+
output: process.stdout,
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
return new Promise((resolve) => {
|
|
93
|
+
// Timeout prompt after 15 seconds so installation never hangs
|
|
94
|
+
const timer = setTimeout(() => {
|
|
95
|
+
saveConfig({ enabled: false, repo: null });
|
|
96
|
+
rl.close();
|
|
97
|
+
resolve();
|
|
98
|
+
}, 15000);
|
|
99
|
+
|
|
100
|
+
rl.question(' \x1b[33mShare repository info? (y/N):\x1b[0m ', (answer) => {
|
|
101
|
+
clearTimeout(timer);
|
|
102
|
+
const isYes = answer.trim().toLowerCase() === 'y' || answer.trim().toLowerCase() === 'yes';
|
|
103
|
+
|
|
104
|
+
if (isYes) {
|
|
105
|
+
saveConfig({
|
|
106
|
+
enabled: true,
|
|
107
|
+
repo: detectedRepo || 'manual-opt-in',
|
|
108
|
+
optedInAt: new Date().toISOString(),
|
|
109
|
+
});
|
|
110
|
+
console.log(' \x1b[32m✔ Thank you! Repository info shared with AETHER Community Showcase.\x1b[0m\n');
|
|
111
|
+
} else {
|
|
112
|
+
saveConfig({
|
|
113
|
+
enabled: false,
|
|
114
|
+
repo: null,
|
|
115
|
+
});
|
|
116
|
+
console.log(' \x1b[90m✔ Understood. Anonymous mode active. (Manage anytime via npx @thangnqdev/ui showcase)\x1b[0m\n');
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
rl.close();
|
|
120
|
+
resolve();
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
promptUser().catch(() => process.exit(0));
|
package/src/bento/BentoCard.tsx
CHANGED
|
@@ -1,140 +1,140 @@
|
|
|
1
|
-
import React, { forwardRef } from 'react';
|
|
2
|
-
import { cva, type VariantProps } from 'class-variance-authority';
|
|
3
|
-
import { cn } from '../utils/cn';
|
|
4
|
-
|
|
5
|
-
const bentoCardVariants = cva(
|
|
6
|
-
'group relative flex flex-col justify-between overflow-hidden transition-all duration-500 ease-out border text-[var(--ui-bento-text-title)]',
|
|
7
|
-
{
|
|
8
|
-
variants: {
|
|
9
|
-
colSpan: {
|
|
10
|
-
1: 'col-span-1',
|
|
11
|
-
2: 'col-span-1 md:col-span-2',
|
|
12
|
-
3: 'col-span-1 md:col-span-2 lg:col-span-3',
|
|
13
|
-
},
|
|
14
|
-
rowSpan: {
|
|
15
|
-
1: 'row-span-1',
|
|
16
|
-
2: 'row-span-1 md:row-span-2 md:min-h-[460px]',
|
|
17
|
-
3: 'row-span-1 md:row-span-3 md:min-h-[680px]',
|
|
18
|
-
},
|
|
19
|
-
variant: {
|
|
20
|
-
default:
|
|
21
|
-
'bg-[var(--ui-bento-bg-card)] border-[var(--ui-bento-border)] hover:border-[var(--ui-bento-border-hover)] hover:bg-[var(--ui-bento-bg-card-hover)] shadow-[var(--ui-bento-shadow)]',
|
|
22
|
-
spotlight:
|
|
23
|
-
'bg-[var(--ui-bento-bg-card)] border-[var(--ui-bento-border)] hover:border-white/30 dark:hover:border-white/30 hover:shadow-[0_0_35px_-8px_rgba(255,255,255,0.12)]',
|
|
24
|
-
elevated:
|
|
25
|
-
'bg-[image:var(--ui-bento-bg-elevated)] border-[var(--ui-bento-border)] hover:border-[var(--ui-bento-border-hover)] shadow-[var(--ui-bento-shadow-elevated)]',
|
|
26
|
-
},
|
|
27
|
-
radius: {
|
|
28
|
-
md: 'rounded-[var(--ui-bento-radius-md)]',
|
|
29
|
-
lg: 'rounded-[var(--ui-bento-radius-lg)]',
|
|
30
|
-
},
|
|
31
|
-
padding: {
|
|
32
|
-
sm: 'p-4 sm:p-5',
|
|
33
|
-
md: 'p-5 sm:p-7',
|
|
34
|
-
lg: 'p-6 sm:p-9',
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
defaultVariants: {
|
|
38
|
-
colSpan: 1,
|
|
39
|
-
rowSpan: 1,
|
|
40
|
-
variant: 'default',
|
|
41
|
-
radius: 'lg',
|
|
42
|
-
padding: 'md',
|
|
43
|
-
},
|
|
44
|
-
}
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
export interface BentoCardProps
|
|
48
|
-
extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'>,
|
|
49
|
-
VariantProps<typeof bentoCardVariants> {
|
|
50
|
-
title?: React.ReactNode;
|
|
51
|
-
description?: React.ReactNode;
|
|
52
|
-
icon?: React.ReactNode;
|
|
53
|
-
tag?: React.ReactNode;
|
|
54
|
-
/**
|
|
55
|
-
* Decorative background graphic. Non-interactive backdrop element.
|
|
56
|
-
*/
|
|
57
|
-
backgroundGraphic?: React.ReactNode;
|
|
58
|
-
/**
|
|
59
|
-
* @deprecated Use `backgroundGraphic` instead.
|
|
60
|
-
*/
|
|
61
|
-
graphic?: React.ReactNode;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export const BentoCard = forwardRef<HTMLDivElement, BentoCardProps>(
|
|
65
|
-
(
|
|
66
|
-
{
|
|
67
|
-
className,
|
|
68
|
-
colSpan,
|
|
69
|
-
rowSpan,
|
|
70
|
-
variant,
|
|
71
|
-
radius,
|
|
72
|
-
padding,
|
|
73
|
-
title,
|
|
74
|
-
description,
|
|
75
|
-
icon,
|
|
76
|
-
tag,
|
|
77
|
-
backgroundGraphic,
|
|
78
|
-
graphic,
|
|
79
|
-
children,
|
|
80
|
-
...props
|
|
81
|
-
},
|
|
82
|
-
ref
|
|
83
|
-
) => {
|
|
84
|
-
const bgGraphic = backgroundGraphic ?? graphic;
|
|
85
|
-
|
|
86
|
-
return (
|
|
87
|
-
<div
|
|
88
|
-
ref={ref}
|
|
89
|
-
className={cn(bentoCardVariants({ colSpan, rowSpan, variant, radius, padding, className }))}
|
|
90
|
-
{...props}
|
|
91
|
-
>
|
|
92
|
-
{/* Subtle Specular Top Line */}
|
|
93
|
-
<div
|
|
94
|
-
className="pointer-events-none absolute inset-x-0 top-0 h-px bg-gradient-to-r from-transparent via-white/20 to-transparent opacity-50"
|
|
95
|
-
aria-hidden="true"
|
|
96
|
-
/>
|
|
97
|
-
|
|
98
|
-
{/* Background Visual Graphic Slot (Decorative) */}
|
|
99
|
-
{bgGraphic && (
|
|
100
|
-
<div className="absolute inset-0 z-0 overflow-hidden pointer-events-none opacity-70 transition-transform duration-700 ease-out motion-safe:group-hover:scale-105">
|
|
101
|
-
{bgGraphic}
|
|
102
|
-
</div>
|
|
103
|
-
)}
|
|
104
|
-
|
|
105
|
-
{/* Top Header Section */}
|
|
106
|
-
{(icon || tag) && (
|
|
107
|
-
<div className="relative z-10 flex items-start justify-between gap-4">
|
|
108
|
-
{icon && (
|
|
109
|
-
<div className="flex h-11 w-11 items-center justify-center rounded-2xl bg-[var(--ui-bento-icon-bg)] border border-[var(--ui-bento-icon-border)] backdrop-blur-md shadow-inner transition-transform duration-300 group-hover:scale-105">
|
|
110
|
-
{icon}
|
|
111
|
-
</div>
|
|
112
|
-
)}
|
|
113
|
-
{tag && (
|
|
114
|
-
<div className="font-mono text-[10px] font-semibold uppercase tracking-widest text-[var(--ui-bento-text-tag)] border border-[var(--ui-bento-icon-border)] bg-[var(--ui-bento-icon-bg)] px-2.5 py-1 rounded-md backdrop-blur-sm">
|
|
115
|
-
{tag}
|
|
116
|
-
</div>
|
|
117
|
-
)}
|
|
118
|
-
</div>
|
|
119
|
-
)}
|
|
120
|
-
|
|
121
|
-
{/* Main Content Area */}
|
|
122
|
-
<div className="relative z-10 mt-auto pt-6">
|
|
123
|
-
{title && (
|
|
124
|
-
<h3 className="text-xl font-bold tracking-tight text-[var(--ui-bento-text-title)] transition-colors group-hover:text-[var(--ui-primary)] dark:group-hover:text-white">
|
|
125
|
-
{title}
|
|
126
|
-
</h3>
|
|
127
|
-
)}
|
|
128
|
-
{description && (
|
|
129
|
-
<p className="mt-2 text-sm leading-relaxed text-[var(--ui-bento-text-desc)] font-normal">
|
|
130
|
-
{description}
|
|
131
|
-
</p>
|
|
132
|
-
)}
|
|
133
|
-
{children}
|
|
134
|
-
</div>
|
|
135
|
-
</div>
|
|
136
|
-
);
|
|
137
|
-
}
|
|
138
|
-
);
|
|
139
|
-
|
|
140
|
-
BentoCard.displayName = 'BentoCard';
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import { cva, type VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { cn } from '../utils/cn';
|
|
4
|
+
|
|
5
|
+
const bentoCardVariants = cva(
|
|
6
|
+
'group relative flex flex-col justify-between overflow-hidden transition-all duration-500 ease-out border text-[var(--ui-bento-text-title)]',
|
|
7
|
+
{
|
|
8
|
+
variants: {
|
|
9
|
+
colSpan: {
|
|
10
|
+
1: 'col-span-1',
|
|
11
|
+
2: 'col-span-1 md:col-span-2',
|
|
12
|
+
3: 'col-span-1 md:col-span-2 lg:col-span-3',
|
|
13
|
+
},
|
|
14
|
+
rowSpan: {
|
|
15
|
+
1: 'row-span-1',
|
|
16
|
+
2: 'row-span-1 md:row-span-2 md:min-h-[460px]',
|
|
17
|
+
3: 'row-span-1 md:row-span-3 md:min-h-[680px]',
|
|
18
|
+
},
|
|
19
|
+
variant: {
|
|
20
|
+
default:
|
|
21
|
+
'bg-[var(--ui-bento-bg-card)] border-[var(--ui-bento-border)] hover:border-[var(--ui-bento-border-hover)] hover:bg-[var(--ui-bento-bg-card-hover)] shadow-[var(--ui-bento-shadow)]',
|
|
22
|
+
spotlight:
|
|
23
|
+
'bg-[var(--ui-bento-bg-card)] border-[var(--ui-bento-border)] hover:border-white/30 dark:hover:border-white/30 hover:shadow-[0_0_35px_-8px_rgba(255,255,255,0.12)]',
|
|
24
|
+
elevated:
|
|
25
|
+
'bg-[image:var(--ui-bento-bg-elevated)] border-[var(--ui-bento-border)] hover:border-[var(--ui-bento-border-hover)] shadow-[var(--ui-bento-shadow-elevated)]',
|
|
26
|
+
},
|
|
27
|
+
radius: {
|
|
28
|
+
md: 'rounded-[var(--ui-bento-radius-md)]',
|
|
29
|
+
lg: 'rounded-[var(--ui-bento-radius-lg)]',
|
|
30
|
+
},
|
|
31
|
+
padding: {
|
|
32
|
+
sm: 'p-4 sm:p-5',
|
|
33
|
+
md: 'p-5 sm:p-7',
|
|
34
|
+
lg: 'p-6 sm:p-9',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
defaultVariants: {
|
|
38
|
+
colSpan: 1,
|
|
39
|
+
rowSpan: 1,
|
|
40
|
+
variant: 'default',
|
|
41
|
+
radius: 'lg',
|
|
42
|
+
padding: 'md',
|
|
43
|
+
},
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
export interface BentoCardProps
|
|
48
|
+
extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'>,
|
|
49
|
+
VariantProps<typeof bentoCardVariants> {
|
|
50
|
+
title?: React.ReactNode;
|
|
51
|
+
description?: React.ReactNode;
|
|
52
|
+
icon?: React.ReactNode;
|
|
53
|
+
tag?: React.ReactNode;
|
|
54
|
+
/**
|
|
55
|
+
* Decorative background graphic. Non-interactive backdrop element.
|
|
56
|
+
*/
|
|
57
|
+
backgroundGraphic?: React.ReactNode;
|
|
58
|
+
/**
|
|
59
|
+
* @deprecated Use `backgroundGraphic` instead.
|
|
60
|
+
*/
|
|
61
|
+
graphic?: React.ReactNode;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export const BentoCard = forwardRef<HTMLDivElement, BentoCardProps>(
|
|
65
|
+
(
|
|
66
|
+
{
|
|
67
|
+
className,
|
|
68
|
+
colSpan,
|
|
69
|
+
rowSpan,
|
|
70
|
+
variant,
|
|
71
|
+
radius,
|
|
72
|
+
padding,
|
|
73
|
+
title,
|
|
74
|
+
description,
|
|
75
|
+
icon,
|
|
76
|
+
tag,
|
|
77
|
+
backgroundGraphic,
|
|
78
|
+
graphic,
|
|
79
|
+
children,
|
|
80
|
+
...props
|
|
81
|
+
},
|
|
82
|
+
ref
|
|
83
|
+
) => {
|
|
84
|
+
const bgGraphic = backgroundGraphic ?? graphic;
|
|
85
|
+
|
|
86
|
+
return (
|
|
87
|
+
<div
|
|
88
|
+
ref={ref}
|
|
89
|
+
className={cn(bentoCardVariants({ colSpan, rowSpan, variant, radius, padding, className }))}
|
|
90
|
+
{...props}
|
|
91
|
+
>
|
|
92
|
+
{/* Subtle Specular Top Line */}
|
|
93
|
+
<div
|
|
94
|
+
className="pointer-events-none absolute inset-x-0 top-0 h-px bg-gradient-to-r from-transparent via-white/20 to-transparent opacity-50"
|
|
95
|
+
aria-hidden="true"
|
|
96
|
+
/>
|
|
97
|
+
|
|
98
|
+
{/* Background Visual Graphic Slot (Decorative) */}
|
|
99
|
+
{bgGraphic && (
|
|
100
|
+
<div className="absolute inset-0 z-0 overflow-hidden pointer-events-none opacity-70 transition-transform duration-700 ease-out motion-safe:group-hover:scale-105">
|
|
101
|
+
{bgGraphic}
|
|
102
|
+
</div>
|
|
103
|
+
)}
|
|
104
|
+
|
|
105
|
+
{/* Top Header Section */}
|
|
106
|
+
{(icon || tag) && (
|
|
107
|
+
<div className="relative z-10 flex items-start justify-between gap-4">
|
|
108
|
+
{icon && (
|
|
109
|
+
<div className="flex h-11 w-11 items-center justify-center rounded-2xl bg-[var(--ui-bento-icon-bg)] border border-[var(--ui-bento-icon-border)] backdrop-blur-md shadow-inner transition-transform duration-300 group-hover:scale-105">
|
|
110
|
+
{icon}
|
|
111
|
+
</div>
|
|
112
|
+
)}
|
|
113
|
+
{tag && (
|
|
114
|
+
<div className="font-mono text-[10px] font-semibold uppercase tracking-widest text-[var(--ui-bento-text-tag)] border border-[var(--ui-bento-icon-border)] bg-[var(--ui-bento-icon-bg)] px-2.5 py-1 rounded-md backdrop-blur-sm">
|
|
115
|
+
{tag}
|
|
116
|
+
</div>
|
|
117
|
+
)}
|
|
118
|
+
</div>
|
|
119
|
+
)}
|
|
120
|
+
|
|
121
|
+
{/* Main Content Area */}
|
|
122
|
+
<div className="relative z-10 mt-auto pt-6">
|
|
123
|
+
{title && (
|
|
124
|
+
<h3 className="text-xl font-bold tracking-tight text-[var(--ui-bento-text-title)] transition-colors group-hover:text-[var(--ui-primary)] dark:group-hover:text-white">
|
|
125
|
+
{title}
|
|
126
|
+
</h3>
|
|
127
|
+
)}
|
|
128
|
+
{description && (
|
|
129
|
+
<p className="mt-2 text-sm leading-relaxed text-[var(--ui-bento-text-desc)] font-normal">
|
|
130
|
+
{description}
|
|
131
|
+
</p>
|
|
132
|
+
)}
|
|
133
|
+
{children}
|
|
134
|
+
</div>
|
|
135
|
+
</div>
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
);
|
|
139
|
+
|
|
140
|
+
BentoCard.displayName = 'BentoCard';
|
package/src/bento/BentoGrid.tsx
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { cva, type VariantProps } from 'class-variance-authority';
|
|
3
|
-
import { cn } from '../utils/cn';
|
|
4
|
-
|
|
5
|
-
const bentoGridVariants = cva('grid w-full auto-rows-[minmax(240px,auto)]', {
|
|
6
|
-
variants: {
|
|
7
|
-
cols: {
|
|
8
|
-
1: 'grid-cols-1',
|
|
9
|
-
2: 'grid-cols-1 md:grid-cols-2',
|
|
10
|
-
3: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3',
|
|
11
|
-
4: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-4',
|
|
12
|
-
},
|
|
13
|
-
gap: {
|
|
14
|
-
sm: 'gap-4',
|
|
15
|
-
md: 'gap-6',
|
|
16
|
-
lg: 'gap-8',
|
|
17
|
-
},
|
|
18
|
-
flow: {
|
|
19
|
-
row: 'grid-flow-row',
|
|
20
|
-
col: 'grid-flow-col',
|
|
21
|
-
dense: 'grid-flow-dense',
|
|
22
|
-
'row-dense': 'grid-flow-row-dense',
|
|
23
|
-
'col-dense': 'grid-flow-col-dense',
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
defaultVariants: {
|
|
27
|
-
cols: 3,
|
|
28
|
-
gap: 'md',
|
|
29
|
-
flow: 'row',
|
|
30
|
-
},
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
export interface BentoGridProps
|
|
34
|
-
extends React.HTMLAttributes<HTMLDivElement>,
|
|
35
|
-
VariantProps<typeof bentoGridVariants> {}
|
|
36
|
-
|
|
37
|
-
export const BentoGrid: React.FC<BentoGridProps> = ({
|
|
38
|
-
className,
|
|
39
|
-
cols,
|
|
40
|
-
gap,
|
|
41
|
-
flow,
|
|
42
|
-
children,
|
|
43
|
-
...props
|
|
44
|
-
}) => {
|
|
45
|
-
return (
|
|
46
|
-
<div className={cn(bentoGridVariants({ cols, gap, flow, className }))} {...props}>
|
|
47
|
-
{children}
|
|
48
|
-
</div>
|
|
49
|
-
);
|
|
50
|
-
};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { cva, type VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { cn } from '../utils/cn';
|
|
4
|
+
|
|
5
|
+
const bentoGridVariants = cva('grid w-full auto-rows-[minmax(240px,auto)]', {
|
|
6
|
+
variants: {
|
|
7
|
+
cols: {
|
|
8
|
+
1: 'grid-cols-1',
|
|
9
|
+
2: 'grid-cols-1 md:grid-cols-2',
|
|
10
|
+
3: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3',
|
|
11
|
+
4: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-4',
|
|
12
|
+
},
|
|
13
|
+
gap: {
|
|
14
|
+
sm: 'gap-4',
|
|
15
|
+
md: 'gap-6',
|
|
16
|
+
lg: 'gap-8',
|
|
17
|
+
},
|
|
18
|
+
flow: {
|
|
19
|
+
row: 'grid-flow-row',
|
|
20
|
+
col: 'grid-flow-col',
|
|
21
|
+
dense: 'grid-flow-dense',
|
|
22
|
+
'row-dense': 'grid-flow-row-dense',
|
|
23
|
+
'col-dense': 'grid-flow-col-dense',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: {
|
|
27
|
+
cols: 3,
|
|
28
|
+
gap: 'md',
|
|
29
|
+
flow: 'row',
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export interface BentoGridProps
|
|
34
|
+
extends React.HTMLAttributes<HTMLDivElement>,
|
|
35
|
+
VariantProps<typeof bentoGridVariants> {}
|
|
36
|
+
|
|
37
|
+
export const BentoGrid: React.FC<BentoGridProps> = ({
|
|
38
|
+
className,
|
|
39
|
+
cols,
|
|
40
|
+
gap,
|
|
41
|
+
flow,
|
|
42
|
+
children,
|
|
43
|
+
...props
|
|
44
|
+
}) => {
|
|
45
|
+
return (
|
|
46
|
+
<div className={cn(bentoGridVariants({ cols, gap, flow, className }))} {...props}>
|
|
47
|
+
{children}
|
|
48
|
+
</div>
|
|
49
|
+
);
|
|
50
|
+
};
|
package/src/bento/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './BentoGrid';
|
|
2
|
-
export * from './BentoCard';
|
|
1
|
+
export * from './BentoGrid';
|
|
2
|
+
export * from './BentoCard';
|