@polymarbot/nuxt-layer-shadcn-ui 0.1.1 → 0.1.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.
@@ -2,11 +2,9 @@
2
2
  @import 'tw-animate-css';
3
3
  @import './colors.css';
4
4
  @import './utilities.css';
5
- @import './animate.css';
6
- @import './transition.css';
7
5
 
8
- /* Ensure Tailwind scans all source files in this app */
9
- @source '../../../..';
6
+ /* Ensure Tailwind scans the layer's own source files */
7
+ @source '../../..';
10
8
 
11
9
  /* Dark mode configuration for Tailwind v4 */
12
10
  @custom-variant dark (&:where(.dark, .dark *));
@@ -14,30 +12,5 @@
14
12
  @layer base {
15
13
  * {
16
14
  @apply border-border outline-ring/50;
17
- box-sizing: border-box;
18
- }
19
- html {
20
- font-size: 16px;
21
- }
22
- body {
23
- @apply bg-background text-foreground;
24
- margin: 0;
25
- }
26
- }
27
-
28
- /* Prevent accidental text selection on touch devices */
29
- @media (pointer: coarse) {
30
- body {
31
- -webkit-user-select: none;
32
- user-select: none;
33
- }
34
- input,
35
- textarea,
36
- [contenteditable='true'],
37
- pre,
38
- code,
39
- .selectable {
40
- -webkit-user-select: text;
41
- user-select: text;
42
15
  }
43
16
  }
@@ -21,6 +21,3 @@
21
21
  to { height: 0; }
22
22
  }
23
23
  }
24
-
25
- /* Safe area utilities */
26
- @utility pb-safe { padding-bottom: env(safe-area-inset-bottom); }
package/nuxt.config.ts CHANGED
@@ -15,11 +15,35 @@ export default defineNuxtConfig({
15
15
  // Package is declared as peerDependency so consumers own the version.
16
16
  modules: [ '@nuxtjs/i18n' ],
17
17
 
18
- // Explicit absolute path so the layer's messages load regardless of the
19
- // consumer's vueI18n setting (each layer's vueI18n is resolved per-layer
20
- // and merged by @nuxtjs/i18n).
18
+ // Lazy-loaded messages. @nuxtjs/i18n v9+ lazy-loads every locale file by
19
+ // default; each layer's `langDir` resolves per-layer, so the files under
20
+ // this layer's directory stay scoped to this layer and are merged with
21
+ // the consumer's own locale files per matching `code`. `langDir` must be
22
+ // relative (absolute paths do not survive the build) — v10's default
23
+ // `restructureDir: 'i18n'` roots resolution at `<layer>/i18n/`.
21
24
  i18n: {
22
- vueI18n: join(currentDir, 'i18n.config.ts'),
25
+ langDir: 'messages',
26
+ locales: [
27
+ { code: 'ar', file: 'ar.json' },
28
+ { code: 'de', file: 'de.json' },
29
+ { code: 'en', file: 'en.json' },
30
+ { code: 'es', file: 'es.json' },
31
+ { code: 'fr', file: 'fr.json' },
32
+ { code: 'hi', file: 'hi.json' },
33
+ { code: 'id', file: 'id.json' },
34
+ { code: 'it', file: 'it.json' },
35
+ { code: 'ja', file: 'ja.json' },
36
+ { code: 'ko', file: 'ko.json' },
37
+ { code: 'nl', file: 'nl.json' },
38
+ { code: 'pl', file: 'pl.json' },
39
+ { code: 'pt', file: 'pt.json' },
40
+ { code: 'ru', file: 'ru.json' },
41
+ { code: 'th', file: 'th.json' },
42
+ { code: 'tr', file: 'tr.json' },
43
+ { code: 'vi', file: 'vi.json' },
44
+ { code: 'zh-CN', file: 'zh-CN.json' },
45
+ { code: 'zh-TW', file: 'zh-TW.json' },
46
+ ],
23
47
  },
24
48
 
25
49
  // Register the layer's global stylesheet. Consumers extending this layer
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polymarbot/nuxt-layer-shadcn-ui",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Nuxt layer providing shadcn-vue based UI components",
5
5
  "type": "module",
6
6
  "main": "./nuxt.config.ts",
@@ -11,7 +11,6 @@
11
11
  "files": [
12
12
  "app",
13
13
  "i18n",
14
- "i18n.config.ts",
15
14
  "nuxt.config.ts"
16
15
  ],
17
16
  "publishConfig": {
@@ -41,6 +40,6 @@
41
40
  "nuxt": "^4",
42
41
  "vue": "^3",
43
42
  "vue-i18n": "^11",
44
- "vue-router": "^4"
43
+ "vue-router": "^4 || ^5"
45
44
  }
46
45
  }
@@ -1,71 +0,0 @@
1
- @keyframes slideIn {
2
- from {
3
- transform: translateX(calc(100% + var(--viewport-padding)));
4
- }
5
- to {
6
- transform: translateX(0);
7
- }
8
- }
9
-
10
- @keyframes hide {
11
- from {
12
- opacity: 1;
13
- }
14
- to {
15
- opacity: 0;
16
- }
17
- }
18
-
19
- @keyframes swipeOut {
20
- from {
21
- transform: translateX(var(--radix-toast-swipe-end-x));
22
- }
23
- to {
24
- transform: translateX(calc(100% + var(--viewport-padding)));
25
- }
26
- }
27
-
28
- @keyframes shake {
29
- 0%, 100% {
30
- transform: translateX(0);
31
- }
32
- 10%, 30%, 50%, 70%, 90% {
33
- transform: translateX(-4px);
34
- }
35
- 20%, 40%, 60%, 80% {
36
- transform: translateX(4px);
37
- }
38
- }
39
-
40
- @keyframes pop {
41
- from {
42
- transform: scale(0);
43
- opacity: 0;
44
- }
45
- to {
46
- transform: scale(1);
47
- opacity: 1;
48
- }
49
- }
50
-
51
- @layer utilities {
52
- .animate-slideIn {
53
- animation: slideIn 150ms cubic-bezier(0.16, 1, 0.3, 1);
54
- }
55
-
56
- .animate-hide {
57
- animation: hide 100ms ease-in;
58
- }
59
-
60
- .animate-swipeOut {
61
- animation: swipeOut 100ms ease-out;
62
- }
63
-
64
- .animate-shake {
65
- animation: shake 0.5s ease-in-out;
66
- }
67
-
68
- .animate-pop {
69
- animation: pop 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
70
- }
71
- }
@@ -1,34 +0,0 @@
1
- /* Layout transition (fade only) */
2
- .layout-enter-active,
3
- .layout-leave-active {
4
- transition: opacity .2s;
5
- }
6
- .layout-enter-from,
7
- .layout-leave-to {
8
- opacity: 0;
9
- }
10
-
11
- /* Page transition */
12
- .page-enter-active,
13
- .page-leave-active {
14
- transition: all .2s;
15
- }
16
- .page-enter-from,
17
- .page-leave-to {
18
- opacity: 0;
19
- transform: translateX(30px);
20
- }
21
-
22
- /* Tab transition */
23
- .tab-enter-active,
24
- .tab-leave-active {
25
- transition: all .2s;
26
- }
27
- .tab-enter-from {
28
- opacity: 0;
29
- transform: translateX(30px);
30
- }
31
- .tab-leave-to {
32
- opacity: 0;
33
- transform: translateX(-30px);
34
- }
package/i18n.config.ts DELETED
@@ -1,19 +0,0 @@
1
- /**
2
- * Vue I18n config loaded by `@nuxtjs/i18n` (configured via `nuxt.config.ts`).
3
- *
4
- * Pre-merged messages live in `i18n/messages/<locale>.json` (generated by
5
- * `pnpm i18n:build`). This file auto-loads every JSON in that directory so
6
- * adding a new language file "just works" without touching this config.
7
- *
8
- * Consumers that extend this Nuxt layer inherit these messages; their own
9
- * translations are merged on top by `@nuxtjs/i18n`.
10
- */
11
- const files = import.meta.glob('./i18n/messages/*.json', { eager: true, import: 'default' })
12
-
13
- const messages: Record<string, unknown> = {}
14
- for (const [ filepath, data ] of Object.entries(files)) {
15
- const code = filepath.split('/').pop()!.replace('.json', '')
16
- messages[code] = data
17
- }
18
-
19
- export default defineI18nConfig(() => ({ messages }))