@naptics/vue-collection 0.3.2 → 1.0.0-beta.1

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.
Files changed (129) hide show
  1. package/eslint.config.cjs +0 -2
  2. package/package.json +31 -30
  3. package/postcss.config.js +1 -4
  4. package/src/demo/App.css +47 -3
  5. package/src/demo/components/ComponentSection.tsx +1 -1
  6. package/src/demo/views/NavigationView.tsx +1 -1
  7. package/src/demo/views/presentation/TooltipView.tsx +1 -1
  8. package/src/lib/components/NAlert.tsx +3 -3
  9. package/src/lib/components/NBadge.tsx +1 -1
  10. package/src/lib/components/NButton.tsx +6 -4
  11. package/src/lib/components/NCheckbox.tsx +2 -2
  12. package/src/lib/components/NDialog.tsx +2 -2
  13. package/src/lib/components/NDropdown.tsx +11 -9
  14. package/src/lib/components/NDropzone.tsx +4 -4
  15. package/src/lib/components/NIconButton.tsx +2 -2
  16. package/src/lib/components/NInput.tsx +1 -1
  17. package/src/lib/components/NLink.tsx +1 -1
  18. package/src/lib/components/NModal.tsx +4 -4
  19. package/src/lib/components/NPagination.css +4 -2
  20. package/src/lib/components/NPagination.tsx +1 -1
  21. package/src/lib/components/NSearchbar.tsx +1 -1
  22. package/src/lib/components/NSelect.tsx +1 -1
  23. package/src/lib/components/NSuggestionList.tsx +1 -1
  24. package/src/lib/components/NTable.css +2 -0
  25. package/src/lib/components/NTableAction.tsx +1 -1
  26. package/src/lib/components/NTextArea.tsx +1 -1
  27. package/src/lib/components/NTooltip.css +2 -0
  28. package/src/lib/components/NTooltip.tsx +1 -1
  29. package/src/lib/utils/component.tsx +1 -1
  30. package/tsconfig.lib.json +1 -0
  31. package/vite.config.ts +2 -0
  32. package/components/NAlert.d.ts +0 -29
  33. package/components/NAlert.js +0 -84
  34. package/components/NBadge.d.ts +0 -73
  35. package/components/NBadge.js +0 -64
  36. package/components/NBreadcrub.d.ts +0 -69
  37. package/components/NBreadcrub.js +0 -71
  38. package/components/NButton.d.ts +0 -64
  39. package/components/NButton.js +0 -72
  40. package/components/NCheckbox.d.ts +0 -20
  41. package/components/NCheckbox.js +0 -43
  42. package/components/NCheckboxLabel.d.ts +0 -26
  43. package/components/NCheckboxLabel.js +0 -42
  44. package/components/NCrudModal.d.ts +0 -118
  45. package/components/NCrudModal.js +0 -120
  46. package/components/NDialog.d.ts +0 -81
  47. package/components/NDialog.js +0 -161
  48. package/components/NDropdown.d.ts +0 -67
  49. package/components/NDropdown.js +0 -115
  50. package/components/NDropzone.d.ts +0 -61
  51. package/components/NDropzone.js +0 -218
  52. package/components/NForm.d.ts +0 -21
  53. package/components/NForm.js +0 -29
  54. package/components/NFormModal.d.ts +0 -75
  55. package/components/NFormModal.js +0 -59
  56. package/components/NIconButton.d.ts +0 -83
  57. package/components/NIconButton.js +0 -88
  58. package/components/NIconCircle.d.ts +0 -49
  59. package/components/NIconCircle.js +0 -67
  60. package/components/NInput.css +0 -11
  61. package/components/NInput.d.ts +0 -94
  62. package/components/NInput.js +0 -110
  63. package/components/NInputPhone.d.ts +0 -58
  64. package/components/NInputPhone.js +0 -47
  65. package/components/NInputSelect.d.ts +0 -103
  66. package/components/NInputSelect.js +0 -115
  67. package/components/NInputSuggestion.d.ts +0 -79
  68. package/components/NInputSuggestion.js +0 -64
  69. package/components/NLink.d.ts +0 -47
  70. package/components/NLink.js +0 -67
  71. package/components/NList.d.ts +0 -37
  72. package/components/NList.js +0 -40
  73. package/components/NLoadingIndicator.css +0 -46
  74. package/components/NLoadingIndicator.d.ts +0 -29
  75. package/components/NLoadingIndicator.js +0 -54
  76. package/components/NModal.d.ts +0 -133
  77. package/components/NModal.js +0 -232
  78. package/components/NPagination.css +0 -15
  79. package/components/NPagination.d.ts +0 -37
  80. package/components/NPagination.js +0 -105
  81. package/components/NSearchbar.d.ts +0 -39
  82. package/components/NSearchbar.js +0 -64
  83. package/components/NSearchbarList.d.ts +0 -33
  84. package/components/NSearchbarList.js +0 -41
  85. package/components/NSelect.d.ts +0 -82
  86. package/components/NSelect.js +0 -101
  87. package/components/NSuggestionList.d.ts +0 -153
  88. package/components/NSuggestionList.js +0 -160
  89. package/components/NTable.css +0 -3
  90. package/components/NTable.d.ts +0 -97
  91. package/components/NTable.js +0 -128
  92. package/components/NTableAction.d.ts +0 -30
  93. package/components/NTableAction.js +0 -50
  94. package/components/NTextArea.d.ts +0 -96
  95. package/components/NTextArea.js +0 -133
  96. package/components/NTooltip.css +0 -37
  97. package/components/NTooltip.d.ts +0 -152
  98. package/components/NTooltip.js +0 -241
  99. package/components/NValInput.d.ts +0 -159
  100. package/components/NValInput.js +0 -113
  101. package/components/ValidatedForm.d.ts +0 -39
  102. package/components/ValidatedForm.js +0 -35
  103. package/i18n/de/vue-collection.json +0 -58
  104. package/i18n/en/vue-collection.json +0 -58
  105. package/i18n/index.d.ts +0 -40
  106. package/i18n/index.js +0 -31
  107. package/index.d.ts +0 -2
  108. package/index.js +0 -2
  109. package/tailwind.config.js +0 -38
  110. package/utils/breakpoints.d.ts +0 -18
  111. package/utils/breakpoints.js +0 -40
  112. package/utils/component.d.ts +0 -57
  113. package/utils/component.js +0 -79
  114. package/utils/deferred.d.ts +0 -13
  115. package/utils/deferred.js +0 -17
  116. package/utils/identifiable.d.ts +0 -56
  117. package/utils/identifiable.js +0 -81
  118. package/utils/stringMaxLength.d.ts +0 -14
  119. package/utils/stringMaxLength.js +0 -23
  120. package/utils/tailwind.d.ts +0 -4
  121. package/utils/tailwind.js +0 -1
  122. package/utils/utils.d.ts +0 -47
  123. package/utils/utils.js +0 -56
  124. package/utils/vModel.d.ts +0 -182
  125. package/utils/vModel.js +0 -224
  126. package/utils/validation.d.ts +0 -90
  127. package/utils/validation.js +0 -147
  128. package/utils/vue.d.ts +0 -13
  129. package/utils/vue.js +0 -21
package/eslint.config.cjs CHANGED
@@ -3,8 +3,6 @@ const { defineConfigWithVueTs, vueTsConfigs } = require('@vue/eslint-config-type
3
3
  const js = require('@eslint/js')
4
4
  const prettierConfig = require('@vue/eslint-config-prettier')
5
5
 
6
- require('@rushstack/eslint-patch/modern-module-resolution')
7
-
8
6
  module.exports = defineConfigWithVueTs(
9
7
  {
10
8
  ignores: ['node_modules/**', 'dist/**', 'dist-ssr/**', 'lib/**', 'coverage/**', 'scripts/*.js'],
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@naptics/vue-collection",
3
3
  "author": "Timo Siegenthaler and Jonas Schoch",
4
4
  "description": "Vue Collection is a collection of styled and fully functional Vue components which can easily be integrated into our projects.",
5
- "version": "0.3.2",
5
+ "version": "1.0.0-beta.1",
6
6
  "main": "./index.js",
7
7
  "repository": {
8
8
  "type": "git",
@@ -22,43 +22,44 @@
22
22
  "preinstall": "node ./scripts/sync-node-types.js"
23
23
  },
24
24
  "dependencies": {
25
- "@headlessui/vue": "^1.7.10",
26
- "@popperjs/core": "^2.11.6",
27
- "awesome-phonenumber": "^5.1.0"
25
+ "@headlessui/vue": "^1.7.23",
26
+ "@popperjs/core": "^2.11.8",
27
+ "awesome-phonenumber": "^7.8.0"
28
28
  },
29
29
  "peerDependencies": {
30
30
  "@heroicons/vue": "^2.0.16",
31
31
  "vue": "^3.5.0"
32
32
  },
33
33
  "devDependencies": {
34
- "@babel/cli": "^7.21.0",
35
- "@babel/core": "^7.21.3",
36
- "@intlify/unplugin-vue-i18n": "^11.0.3",
37
- "@rushstack/eslint-patch": "^1.15.0",
38
- "@tailwindcss/forms": "^0.5.3",
39
- "@types/jsdom": "^21.1.0",
34
+ "@babel/cli": "^7.28.6",
35
+ "@babel/core": "^7.29.0",
36
+ "@eslint/js": "^10.0.1",
37
+ "@intlify/unplugin-vue-i18n": "^11.2.3",
38
+ "@rushstack/eslint-patch": "^1.16.1",
39
+ "@tailwindcss/forms": "^0.5.11",
40
+ "@tailwindcss/vite": "^4.3.0",
41
+ "@types/jsdom": "^28.0.3",
40
42
  "@types/node": "^24",
41
- "@vitejs/plugin-vue": "^6.0.3",
42
- "@vitejs/plugin-vue-jsx": "^5.1.2",
43
- "@vue/babel-plugin-jsx": "^1.1.1",
43
+ "@vitejs/plugin-vue": "^6.0.7",
44
+ "@vitejs/plugin-vue-jsx": "^5.1.5",
45
+ "@vue/babel-plugin-jsx": "^2.0.1",
44
46
  "@vue/eslint-config-prettier": "^10.2.0",
45
- "@vue/eslint-config-typescript": "^14.6.0",
46
- "@vue/test-utils": "^2.3.0",
47
- "@vue/tsconfig": "^0.5.1",
48
- "autoprefixer": "^10.4.13",
49
- "eslint": "^9.17.0",
50
- "eslint-plugin-vue": "^10.6.2",
51
- "jsdom": "^29.0.2",
47
+ "@vue/eslint-config-typescript": "^14.7.0",
48
+ "@vue/test-utils": "^2.4.10",
49
+ "@vue/tsconfig": "^0.8.1",
50
+ "eslint": "^10.4.0",
51
+ "eslint-plugin-vue": "^10.9.1",
52
+ "jsdom": "^29.1.1",
52
53
  "npm-run-all": "^4.1.5",
53
- "postcss": "^8.4.21",
54
- "prettier": "^3.0.0",
55
- "tailwindcss": "^3.2.7",
56
- "typescript": "~5.5.4",
57
- "vite": "^7.3.0",
58
- "vitest": "^4.0.15",
59
- "vue": "^3.5.25",
60
- "vue-i18n": "^9.2.2",
61
- "vue-router": "^4.1.6",
62
- "vue-tsc": "^3.1.8"
54
+ "postcss": "^8.5.15",
55
+ "prettier": "^3.8.3",
56
+ "tailwindcss": "^4.3.0",
57
+ "typescript": "~5.8.3",
58
+ "vite": "^8.0.14",
59
+ "vitest": "^4.1.7",
60
+ "vue": "^3.5.34",
61
+ "vue-i18n": "^11.4.4",
62
+ "vue-router": "^5.0.7",
63
+ "vue-tsc": "^3.3.1"
63
64
  }
64
65
  }
package/postcss.config.js CHANGED
@@ -1,6 +1,3 @@
1
1
  module.exports = {
2
- plugins: {
3
- tailwindcss: {},
4
- autoprefixer: {},
5
- },
2
+ plugins: {},
6
3
  }
package/src/demo/App.css CHANGED
@@ -1,6 +1,50 @@
1
- @tailwind base;
2
- @tailwind components;
3
- @tailwind utilities;
1
+ @import "tailwindcss";
2
+ @plugin "@tailwindcss/forms";
3
+
4
+ @theme {
5
+ --color-default-50: var(--color-slate-50);
6
+ --color-default-100: var(--color-slate-100);
7
+ --color-default-200: var(--color-slate-200);
8
+ --color-default-300: var(--color-slate-300);
9
+ --color-default-400: var(--color-slate-400);
10
+ --color-default-500: var(--color-slate-500);
11
+ --color-default-600: var(--color-slate-600);
12
+ --color-default-700: var(--color-slate-700);
13
+ --color-default-800: var(--color-slate-800);
14
+ --color-default-900: var(--color-slate-900);
15
+ --color-default-950: var(--color-slate-950);
16
+
17
+ --color-primary-50: var(--color-violet-50);
18
+ --color-primary-100: var(--color-violet-100);
19
+ --color-primary-200: var(--color-violet-200);
20
+ --color-primary-300: var(--color-violet-300);
21
+ --color-primary-400: var(--color-violet-400);
22
+ --color-primary-500: var(--color-violet-500);
23
+ --color-primary-600: var(--color-violet-600);
24
+ --color-primary-700: var(--color-violet-700);
25
+ --color-primary-800: var(--color-violet-800);
26
+ --color-primary-900: var(--color-violet-900);
27
+ --color-primary-950: var(--color-violet-950);
28
+
29
+ --color-secondary-50: var(--color-fuchsia-50);
30
+ --color-secondary-100: var(--color-fuchsia-100);
31
+ --color-secondary-200: var(--color-fuchsia-200);
32
+ --color-secondary-300: var(--color-fuchsia-300);
33
+ --color-secondary-400: var(--color-fuchsia-400);
34
+ --color-secondary-500: var(--color-fuchsia-500);
35
+ --color-secondary-600: var(--color-fuchsia-600);
36
+ --color-secondary-700: var(--color-fuchsia-700);
37
+ --color-secondary-800: var(--color-fuchsia-800);
38
+ --color-secondary-900: var(--color-fuchsia-900);
39
+ --color-secondary-950: var(--color-fuchsia-950);
40
+ }
41
+
42
+ /* Safelist dynamic color/size classes used in components */
43
+ @source inline("{bg,text}-{default,primary,secondary,green,red,yellow,blue}-{50,100,200,300,400,500,600,700,800,900}");
44
+ @source inline("hover:{bg,text}-{default,primary,secondary,green,red,yellow,blue}-{50,100,200,300,400,500,600,700,800,900}");
45
+ @source inline("ring-{default,primary,secondary,green,red,yellow,blue}-{50,100,200,300,400,500,600,700,800,900}");
46
+ @source inline("focus-visible:ring-{default,primary,secondary,green,red,yellow,blue}-{50,100,200,300,400,500,600,700,800,900}");
47
+ @source inline("{w,h}-{1,2,3,4,5,6,7,8,9,10,11,12,14,16,18,20}");
4
48
 
5
49
  @layer base {
6
50
  body {
@@ -13,7 +13,7 @@ export default createComponent('ComponentSection', componentSectionProps, (props
13
13
  <div class="border-b-2 border-default-200" id={props.id}>
14
14
  <div>
15
15
  <div class="px-8 py-10 max-w-4xl mx-auto">
16
- <RouterLink to={{ hash: props.id ? `#${props.id}` : undefined }} class="group outline-none">
16
+ <RouterLink to={{ hash: props.id ? `#${props.id}` : undefined }} class="group outline-hidden">
17
17
  <h2 class="font-bold text-4xl mb-2 flex items-center space-x-2 ">
18
18
  <span>{props.title}</span>
19
19
  <LinkIcon class="h-8 w-8 text-default-900 opacity-30 hidden group-hover:block group-focus-visible:block" />
@@ -30,7 +30,7 @@ export default createView('NavigationView', () => {
30
30
  {sections.map(section => (
31
31
  <RouterLink
32
32
  to={{ hash: `#${section.hash}` }}
33
- class="outline-none focus-visible:ring-2 focus-visible ring-primary-500 rounded-md"
33
+ class="outline-hidden focus-visible:ring-2 focus-visible ring-primary-500 rounded-md"
34
34
  >
35
35
  <NBadge color="primary" allCaps={false} textSize="text-2xl">
36
36
  {section.label}
@@ -22,7 +22,7 @@ export default createView('TooltipView', () => {
22
22
  >
23
23
  <ComponentGrid cols={5}>
24
24
  <div class="flex">
25
- <NTooltip text="Hello tooltip!">
25
+ <NTooltip text="Hello tooltip!" placement="bottom">
26
26
  <NBadge text="Hover me" />
27
27
  </NTooltip>
28
28
  </div>
@@ -39,16 +39,16 @@ const Component = createComponent('NAlert', nAlertProps, (props, { slots }) => {
39
39
  return () => (
40
40
  <div class={`rounded-md p-3 shadow-lg bg-${variant.value.color}-50`}>
41
41
  <div class="flex items-center">
42
- <div class="flex flex-shrink-0 items-center">{variant.value.icon()}</div>
42
+ <div class="flex shrink-0 items-center">{variant.value.icon()}</div>
43
43
 
44
- <div class="ml-3 flex-grow">
44
+ <div class="ml-3 grow">
45
45
  <p class={`text-sm font-medium text-${variant.value.color}-900`}>
46
46
  {slots.default?.() ?? props.text}
47
47
  </p>
48
48
  </div>
49
49
 
50
50
  {!props.hideX && (
51
- <div class="flex items-center flex-shrink-0 ml-3">
51
+ <div class="flex items-center shrink-0 ml-3">
52
52
  <NIconButton color={variant.value.color} size={5} icon={XMarkIcon} onClick={props.onDismiss} />
53
53
  </div>
54
54
  )}
@@ -60,7 +60,7 @@ const Component = createComponent('NBadge', nBadgeProps, (props, { slots }) => {
60
60
  <NTooltip {...mapTooltipProps(props)}>
61
61
  <div
62
62
  class={[
63
- 'px-2 py-1 rounded-md font-semibold shadow',
63
+ 'px-2 py-1 rounded-md font-semibold shadow-sm',
64
64
  `${props.textSize} bg-${props.color}-${props.shade} text-${props.color}-${props.textShade}`,
65
65
  props.allCaps ? 'uppercase' : '',
66
66
  props.badgeClass,
@@ -56,17 +56,19 @@ const Component = createComponent('NButton', nButtonProps, (props, { slots }) =>
56
56
  disabled={isDisabled.value}
57
57
  type={props.type}
58
58
  class={[
59
- `block w-full font-medium rounded-md focus:outline-none focus-visible:ring-2 shadow text-${props.color}-900 relative`,
59
+ `block w-full font-medium rounded-md focus:outline-hidden focus-visible:ring-2 shadow-sm text-${props.color}-900 relative`,
60
60
  isDisabled.value
61
- ? `bg-${props.color}-100 text-opacity-20 cursor-default`
62
- : `bg-${props.color}-200 hover:bg-${props.color}-300 focus-visible:ring-${props.color}-500`,
61
+ ? `bg-${props.color}-100 cursor-default`
62
+ : `bg-${props.color}-200 hover:bg-${props.color}-300 focus-visible:ring-${props.color}-500 cursor-pointer`,
63
63
 
64
64
  props.small ? 'py-1 px-2 text-xs' : 'py-2 px-4 text-sm',
65
65
  props.buttonClass,
66
66
  ]}
67
67
  onClick={props.onClick}
68
68
  >
69
- <span class={{ 'opacity-10': props.loading }}>{slots.default?.()}</span>
69
+ <span class={props.loading ? 'opacity-0' : isDisabled.value ? 'opacity-20' : undefined}>
70
+ {slots.default?.()}
71
+ </span>
70
72
  {props.loading && (
71
73
  <div class="absolute inset-0 flex items-center justify-center opacity-50">
72
74
  <NLoadingIndicator color={props.color} size={props.small ? 4 : 6} shade={600} />
@@ -43,9 +43,9 @@ const Component = createComponent('NCheckbox', nCheckboxProps, props => {
43
43
  onClick={toggle}
44
44
  key={updateKey.value}
45
45
  class={[
46
- `h-5 w-5 border-default-300 rounded focus:outline-none focus:ring-0 focus-visible:ring-2 focus-visible:ring-${props.color}-500`,
46
+ `h-5 w-5 border-default-300 rounded-sm focus:outline-hidden focus:ring-0 focus-visible:ring-2 focus-visible:ring-${props.color}-500`,
47
47
  props.disabled
48
- ? `cursor-default bg-default-100 text-${props.color}-200`
48
+ ? `cursor-default opacity-50 bg-default-100 checked:bg-current text-${props.color}-400`
49
49
  : `cursor-pointer text-${props.color}-400`,
50
50
  ]}
51
51
  />
@@ -127,7 +127,7 @@ const Component = createComponent('NDialog', nDialogProps, (props, context) => {
127
127
  hideHeader
128
128
  >
129
129
  <div class="flex space-x-4 py-2">
130
- <div class="flex-grow-0">
130
+ <div class="grow-0">
131
131
  <NIconCircle
132
132
  icon={props.icon || defaults.value.icon}
133
133
  iconSize={6}
@@ -135,7 +135,7 @@ const Component = createComponent('NDialog', nDialogProps, (props, context) => {
135
135
  />
136
136
  </div>
137
137
 
138
- <div class="flex-grow">
138
+ <div class="grow">
139
139
  <DialogTitle as="h4" class="font-medium text-lg text-default-700 mb-1">
140
140
  {props.title}
141
141
  </DialogTitle>
@@ -89,28 +89,30 @@ const Component = createComponentWithSlots('NDropdown', nDropdownProps, ['button
89
89
  <MenuButton
90
90
  disabled={props.disabled}
91
91
  class={[
92
- 'shadow w-full flex justify-between items-center text-default-700 rounded-md border bg-white border-default-300 px-4 py-2 text-sm font-medium focus:outline-none focus:ring-offset-2 focus-visible:ring-2 focus-visible:ring-primary-500',
93
- props.disabled ? 'text-opacity-20 cursor-default' : 'hover:bg-default-100',
92
+ 'shadow-sm w-full flex justify-between items-center rounded-md border bg-white border-default-300 px-4 py-2 text-sm font-medium focus:outline-hidden focus:ring-offset-2 focus-visible:ring-2 focus-visible:ring-primary-500',
93
+ props.disabled
94
+ ? 'text-default-700/20 cursor-default'
95
+ : 'hover:bg-default-100 text-default-700 cursor-pointer',
94
96
  props.buttonClass,
95
97
  ]}
96
98
  >
97
99
  <span>{props.title}</span>
98
- <ChevronDownIcon class="-mr-1 ml-2 h-5 w-5 flex-shrink-0" aria-hidden="true" />
100
+ <ChevronDownIcon class="-mr-1 ml-2 h-5 w-5 shrink-0" aria-hidden="true" />
99
101
  </MenuButton>
100
102
  )}
101
103
  </div>
102
104
 
103
105
  <Transition
104
106
  enterActiveClass="transition ease-out duration-100"
105
- enterFromClass="transform opacity-0 scale-95"
106
- enterToClass="transform opacity-100 scale-100"
107
+ enterFromClass="opacity-0 scale-95"
108
+ enterToClass="opacity-100 scale-100"
107
109
  leaveActiveClass="transition ease-in duration-75"
108
- leaveFromClass="transform opacity-100 scale-100"
109
- leaveToClass="transform opacity-0 scale-95"
110
+ leaveFromClass="opacity-100 scale-100"
111
+ leaveToClass="opacity-0 scale-95"
110
112
  >
111
113
  <MenuItems
112
114
  class={[
113
- 'z-10 absolute w-56 mt-2 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5 focus:outline-none',
115
+ 'z-10 absolute w-56 mt-2 rounded-md shadow-lg bg-white ring-1 ring-black/5 focus:outline-hidden',
114
116
  props.right ? 'origin-top-right right-0' : 'origin-top-left left-0',
115
117
  ]}
116
118
  >
@@ -142,7 +144,7 @@ const Component = createComponentWithSlots('NDropdown', nDropdownProps, ['button
142
144
  type="button"
143
145
  onClick={item.onClick}
144
146
  class={[
145
- 'w-full text-left px-4 py-2 text-sm',
147
+ 'w-full text-left px-4 py-2 text-sm cursor-pointer',
146
148
  active
147
149
  ? 'bg-default-100 text-default-900'
148
150
  : 'text-default-700',
@@ -168,7 +168,7 @@ const Component = createComponent('NDropzone', nDropzoneProps, props => {
168
168
  <div>
169
169
  <button
170
170
  class={[
171
- 'block w-full rounded-md border-dashed border-2 focus-visible:border-primary-500 focus:outline-none ',
171
+ 'block w-full rounded-md border-dashed border-2 focus-visible:border-primary-500 focus:outline-hidden ',
172
172
  'flex flex-col items-center justify-center text-center text-sm select-none p-4',
173
173
  !props.disabled ? 'hover:border-primary-300 hover:bg-primary-50 hover:text-primary-700' : '',
174
174
  props.disabled
@@ -196,14 +196,14 @@ const Component = createComponent('NDropzone', nDropzoneProps, props => {
196
196
  />
197
197
 
198
198
  {/* Counterweight */}
199
- <div class="flex-grow mb-2" />
199
+ <div class="grow mb-2" />
200
200
 
201
201
  <span class="font-medium">
202
202
  {trslc('vue-collection.text.drag-n-drop-files', props.maxFiles, { n: props.maxFiles })}
203
203
  </span>
204
204
  <span>{props.description}</span>
205
205
 
206
- <div class="flex-grow mt-2 flex items-end justify-center text-red-500 font-medium">
206
+ <div class="grow mt-2 flex items-end justify-center text-red-500 font-medium">
207
207
  <span>{fileError.value}</span>
208
208
  </div>
209
209
  </button>
@@ -224,7 +224,7 @@ const Component = createComponent('NDropzone', nDropzoneProps, props => {
224
224
  </NBadge>
225
225
  ))}
226
226
 
227
- <div class="flex-grow text-sm text-default-500 flex items-end justify-end text-right">
227
+ <div class="grow text-sm text-default-500 flex items-end justify-end text-right">
228
228
  <span>
229
229
  <span>
230
230
  {trslc('vue-collection.text.files-selected', files.value.length, {
@@ -65,10 +65,10 @@ export const nIconButtonProps = {
65
65
  */
66
66
  const Component = createComponent('NIconButton', nIconButtonProps, props => {
67
67
  const classes = () => [
68
- 'block p-0.5 rounded-md focus:outline-none focus-visible:ring-2 -m-1',
68
+ 'block p-0.5 rounded-md focus:outline-hidden focus-visible:ring-2 -m-1',
69
69
  props.disabled
70
70
  ? `text-${props.color}-200 cursor-default`
71
- : `hover:bg-${props.color}-${props.shade} hover:bg-opacity-10 text-${props.color}-${props.shade} focus-visible:ring-${props.color}-${props.shade} cursor-pointer`,
71
+ : `hover:bg-current/10 text-${props.color}-${props.shade} focus-visible:ring-${props.color}-${props.shade} cursor-pointer`,
72
72
  props.buttonClass,
73
73
  ]
74
74
 
@@ -112,7 +112,7 @@ const Component = createComponent('NInput', nInputProps, (props, context) => {
112
112
  onBlur={() => props.onBlur?.()}
113
113
  onInvalid={event => event.preventDefault()}
114
114
  class={[
115
- 'block w-full rounded-md border focus:outline-none focus:ring-1 ',
115
+ 'block w-full rounded-md border focus:outline-hidden focus:ring-1 ',
116
116
  props.small ? 'text-xs py-0.5 px-2' : 'py-2 px-4',
117
117
  props.disabled
118
118
  ? 'text-default-500 placeholder-default-300 bg-default-50'
@@ -55,7 +55,7 @@ const Component = createComponent('NLink', nLinkProps, (props, { slots }) => {
55
55
  })
56
56
 
57
57
  const classes = computed(() => [
58
- 'font-medium focus:outline-none focus-visible:ring-2 rounded-sm ring-offset-2 hover:underline text-left',
58
+ 'font-medium focus:outline-hidden focus-visible:ring-2 rounded-xs ring-offset-2 hover:underline text-left cursor-pointer',
59
59
  `${props.textSize} text-${props.color}-${props.shade} hover:text-${props.color}-${hoverShade.value} focus-visible:ring-${props.color}-${props.shade}`,
60
60
  ])
61
61
  const disabledClasses = computed(() => [
@@ -1,6 +1,6 @@
1
1
  import { createComponentWithSlots } from '../utils/component'
2
2
  import type { PropType } from 'vue'
3
- import { Dialog, DialogOverlay, DialogTitle, TransitionRoot, TransitionChild } from '@headlessui/vue'
3
+ import { Dialog, DialogTitle, TransitionRoot, TransitionChild } from '@headlessui/vue'
4
4
  import NButton from './NButton'
5
5
  import NIconButton from './NIconButton'
6
6
  import { XMarkIcon } from '@heroicons/vue/24/solid'
@@ -160,9 +160,9 @@ const Component = createComponentWithSlots('NModal', nModalProps, ['modal', 'hea
160
160
  leave-to="opacity-0"
161
161
  >
162
162
  {props.closeOnBackground ? (
163
- <DialogOverlay class="fixed inset-0 bg-default-700 bg-opacity-75" />
163
+ <div class="fixed inset-0 bg-default-700/75" aria-hidden="true" onClick={cancel} />
164
164
  ) : (
165
- <div class="fixed inset-0 bg-default-700 bg-opacity-75" />
165
+ <div class="fixed inset-0 bg-default-700/75" aria-hidden="true" />
166
166
  )}
167
167
  </TransitionChild>
168
168
 
@@ -180,7 +180,7 @@ const Component = createComponentWithSlots('NModal', nModalProps, ['modal', 'hea
180
180
  leave-from="opacity-100 translate-y-0 sm:scale-100"
181
181
  leave-to="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
182
182
  >
183
- <div class={['transform m-4 w-full align-middle', props.maxWidth]}>
183
+ <div class={['relative m-4 w-full align-middle', props.maxWidth]}>
184
184
  {props.modal?.({ ok, cancel }) || (
185
185
  <div
186
186
  class={[
@@ -1,3 +1,5 @@
1
+ @reference "../../demo/App.css";
2
+
1
3
  .pagination-item {
2
4
  @apply h-9 w-9 text-sm inline-flex items-center justify-center border font-medium border-default-300 text-default-500;
3
5
  }
@@ -7,9 +9,9 @@
7
9
  }
8
10
 
9
11
  .pagination-item.selectable {
10
- @apply hover:bg-default-50 focus:outline-none focus-visible:border-primary-500 focus-visible:ring-primary-500 focus-visible:ring-1 focus-visible:z-[2];
12
+ @apply cursor-pointer hover:bg-default-50 focus:outline-hidden focus-visible:border-primary-500 focus-visible:ring-primary-500 focus-visible:ring-1 focus-visible:z-2;
11
13
  }
12
14
 
13
15
  .pagination-item.selectable.selected {
14
- @apply border-primary-500 bg-primary-100 hover:bg-primary-100 text-primary-600 z-[1];
16
+ @apply border-primary-500 bg-primary-100 hover:bg-primary-100 text-primary-600 z-1;
15
17
  }
@@ -86,7 +86,7 @@ const Component = createComponent('NPagination', nPaginationProps, props => {
86
86
  ]
87
87
 
88
88
  return () => (
89
- <nav class="inline-flex rounded-md shadow -space-x-px">
89
+ <nav class="inline-flex rounded-md shadow-sm -space-x-px">
90
90
  <button
91
91
  class={['pagination-item selectable rounded-l-md', props.small ? '' : 'not-small']}
92
92
  onClick={previous}
@@ -64,7 +64,7 @@ const Component = createComponent('NSearchbar', nSearchbarProps, (props, context
64
64
  placeholder={props.placeholder}
65
65
  autocomplete="off"
66
66
  class={[
67
- 'block w-full pl-10 pr-4 rounded-md border focus:outline-none focus:ring-1 transition placeholder-default-400 border-default-300 focus:border-primary-500 focus:ring-primary-500',
67
+ 'block w-full pl-10 pr-4 rounded-md border focus:outline-hidden focus:ring-1 transition placeholder-default-400 border-default-300 focus:border-primary-500 focus:ring-primary-500',
68
68
  props.small ? 'py-1' : 'py-2',
69
69
  props.inputClass,
70
70
  ]}
@@ -101,7 +101,7 @@ const Component = createComponent('NSelect', nSelectProps, (props, context) => {
101
101
  onChange={event => slotProps.onUpdateValue((event.target as HTMLInputElement).value)}
102
102
  onBlur={slotProps.onBlur}
103
103
  class={[
104
- 'block w-full py-2 pl-4 pr-10 rounded-md border focus:outline-none focus:ring-1',
104
+ 'block w-full py-2 pl-4 pr-10 rounded-md border focus:outline-hidden focus:ring-1',
105
105
  props.disabled ? 'text-default-300 ' : 'text-default-900 ',
106
106
  slotProps.error
107
107
  ? 'border-red-500 focus:border-red-500 focus:ring-red-500'
@@ -179,7 +179,7 @@ const Component = createComponentWithSlots('NSuggestionList', nSuggestionListPro
179
179
  <li
180
180
  key={item.id}
181
181
  class={[
182
- 'focus:outline-none hover:bg-default-50 rounded-md select-none p-2 cursor-pointer',
182
+ 'focus:outline-hidden hover:bg-default-50 rounded-md select-none p-2 cursor-pointer',
183
183
  selectedIndex.value === index ? 'bg-default-50' : '',
184
184
  ]}
185
185
  onMousedown={onListMouseDown}
@@ -1,3 +1,5 @@
1
+ @reference "../../demo/App.css";
2
+
1
3
  .table-heading {
2
4
  @apply text-left text-xs font-medium text-default-500 uppercase tracking-wider;
3
5
  }
@@ -31,7 +31,7 @@ const Component = createComponent('NTableAction', nTableActionProps, (props, { s
31
31
  const content = () => slots.default?.() || <>{props.text}</>
32
32
 
33
33
  const classes = [
34
- 'text-left font-medium focus:outline-none focus-visible:ring-2 focus-visible:ring-default-900 rounded-sm ring-offset-2 text-default-900 hover:underline hover:text-default-700',
34
+ 'text-left font-medium focus:outline-hidden focus-visible:ring-2 focus-visible:ring-default-900 rounded-xs ring-offset-2 text-default-900 hover:underline hover:text-default-700 cursor-pointer',
35
35
  ]
36
36
 
37
37
  return () =>
@@ -134,7 +134,7 @@ const NTextAreaBase = createComponent('NTextAreaBase', nTextAreaBaseProps, (prop
134
134
  onBlur={() => props.onBlur?.()}
135
135
  onInvalid={event => event.preventDefault()}
136
136
  class={[
137
- 'block w-full rounded-md border focus:outline-none focus:ring-1 ',
137
+ 'block w-full rounded-md border focus:outline-hidden focus:ring-1 ',
138
138
  props.disabled
139
139
  ? 'text-default-500 placeholder-default-300 bg-default-50'
140
140
  : 'text-default-900 placeholder-default-400 ',
@@ -1,3 +1,5 @@
1
+ @reference "../../demo/App.css";
2
+
1
3
  .arrow,
2
4
  .arrow::before {
3
5
  position: absolute;
@@ -235,7 +235,7 @@ const NTooltipBase = createComponent('NTooltipBase', nTooltipProps, (props, { sl
235
235
  return () => (
236
236
  <>
237
237
  <div
238
- class="p-[10px] -m-[10px]"
238
+ class="p-[10px] m-[-10px]"
239
239
  onMouseleave={() => setTimeout(() => (isHoveringContent.value = false), 10)}
240
240
  >
241
241
  <div id={contentId} onMouseenter={() => (isHoveringContent.value = true)}>
@@ -97,7 +97,7 @@ export function extractProps<T extends Record<string, unknown>>(
97
97
  ...keys: (keyof T)[]
98
98
  ): UnwrapNestedRefs<Partial<ToRefs<T>>> {
99
99
  const partial: Partial<ToRefs<T>> = {}
100
- for (const key of keys) partial[key] = toRef(props, key)
100
+ for (const key of keys) partial[key] = toRef(props, key) as never
101
101
  return reactive(partial)
102
102
  }
103
103
 
package/tsconfig.lib.json CHANGED
@@ -12,6 +12,7 @@
12
12
  "noImplicitAny": false,
13
13
  "downlevelIteration": true,
14
14
  "skipLibCheck": true,
15
+ "allowImportingTsExtensions": false,
15
16
  "noEmit": false,
16
17
  "declaration": true
17
18
  }
package/vite.config.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { fileURLToPath, URL } from 'url'
2
2
  import { defineConfig } from 'vite'
3
+ import tailwindcss from '@tailwindcss/vite'
3
4
  import vue from '@vitejs/plugin-vue'
4
5
  import vueJsx from '@vitejs/plugin-vue-jsx'
5
6
  import vueI18n from '@intlify/unplugin-vue-i18n/vite'
@@ -10,6 +11,7 @@ const __dirname = dirname(fileURLToPath(import.meta.url))
10
11
  // https://vitejs.dev/config/
11
12
  export default defineConfig({
12
13
  plugins: [
14
+ tailwindcss(),
13
15
  vue(),
14
16
  vueJsx(),
15
17
  vueI18n({
@@ -1,29 +0,0 @@
1
- import { type PropType } from 'vue';
2
- export type AlertVariant = 'success' | 'info' | 'warning' | 'error' | 'loading';
3
- export declare const nAlertProps: {
4
- /**
5
- * The variant of the alert. This defines its color and icon.
6
- */
7
- readonly variant: {
8
- readonly type: PropType<AlertVariant>;
9
- readonly default: "success";
10
- };
11
- /**
12
- * The text of the alert.
13
- */
14
- readonly text: StringConstructor;
15
- /**
16
- * If set to `true` the X-button of the alert is hidden.
17
- */
18
- readonly hideX: BooleanConstructor;
19
- /**
20
- * This is called, when the X-button is clicked.
21
- */
22
- readonly onDismiss: PropType<() => void>;
23
- };
24
- /**
25
- * The `NAlert` is a fully styled alert with multiple variants.
26
- * It can be used as a normal blocking element or as part of an alert queue.
27
- */
28
- declare const Component: import("vue").DefineSetupFnComponent<Record<string, any>, {}, {}, Record<string, any> & {}, import("vue").PublicProps>;
29
- export { Component as NAlert, Component as default };