@naptics/vue-collection 1.0.0-beta.1 → 1.0.0-beta.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.
Files changed (200) hide show
  1. package/lib/components/NAlert.d.ts +29 -0
  2. package/lib/components/NAlert.js +84 -0
  3. package/lib/components/NBadge.d.ts +73 -0
  4. package/lib/components/NBadge.js +64 -0
  5. package/lib/components/NBreadcrub.d.ts +69 -0
  6. package/lib/components/NBreadcrub.js +71 -0
  7. package/lib/components/NButton.d.ts +64 -0
  8. package/lib/components/NButton.js +70 -0
  9. package/lib/components/NCheckbox.d.ts +20 -0
  10. package/lib/components/NCheckbox.js +43 -0
  11. package/lib/components/NCheckboxLabel.d.ts +26 -0
  12. package/lib/components/NCheckboxLabel.js +42 -0
  13. package/lib/components/NCrudModal.d.ts +118 -0
  14. package/lib/components/NCrudModal.js +120 -0
  15. package/lib/components/NDialog.d.ts +81 -0
  16. package/lib/components/NDialog.js +161 -0
  17. package/lib/components/NDropdown.d.ts +67 -0
  18. package/lib/components/NDropdown.js +115 -0
  19. package/lib/components/NDropzone.d.ts +61 -0
  20. package/lib/components/NDropzone.js +218 -0
  21. package/lib/components/NForm.d.ts +21 -0
  22. package/lib/components/NForm.js +29 -0
  23. package/lib/components/NFormModal.d.ts +75 -0
  24. package/lib/components/NFormModal.js +59 -0
  25. package/lib/components/NIconButton.d.ts +83 -0
  26. package/lib/components/NIconButton.js +88 -0
  27. package/lib/components/NIconCircle.d.ts +49 -0
  28. package/lib/components/NIconCircle.js +67 -0
  29. package/lib/components/NInput.d.ts +94 -0
  30. package/lib/components/NInput.js +110 -0
  31. package/lib/components/NInputPhone.d.ts +58 -0
  32. package/lib/components/NInputPhone.js +47 -0
  33. package/lib/components/NInputSelect.d.ts +103 -0
  34. package/lib/components/NInputSelect.js +115 -0
  35. package/lib/components/NInputSuggestion.d.ts +79 -0
  36. package/lib/components/NInputSuggestion.js +64 -0
  37. package/lib/components/NLink.d.ts +47 -0
  38. package/lib/components/NLink.js +67 -0
  39. package/lib/components/NList.d.ts +37 -0
  40. package/lib/components/NList.js +40 -0
  41. package/lib/components/NLoadingIndicator.d.ts +29 -0
  42. package/lib/components/NLoadingIndicator.js +54 -0
  43. package/lib/components/NModal.d.ts +133 -0
  44. package/lib/components/NModal.js +235 -0
  45. package/{src/lib → lib}/components/NPagination.css +1 -1
  46. package/lib/components/NPagination.d.ts +37 -0
  47. package/lib/components/NPagination.js +105 -0
  48. package/lib/components/NSearchbar.d.ts +39 -0
  49. package/lib/components/NSearchbar.js +64 -0
  50. package/lib/components/NSearchbarList.d.ts +33 -0
  51. package/lib/components/NSearchbarList.js +41 -0
  52. package/lib/components/NSelect.d.ts +82 -0
  53. package/lib/components/NSelect.js +101 -0
  54. package/lib/components/NSuggestionList.d.ts +153 -0
  55. package/lib/components/NSuggestionList.js +160 -0
  56. package/{src/lib → lib}/components/NTable.css +1 -1
  57. package/lib/components/NTable.d.ts +97 -0
  58. package/lib/components/NTable.js +128 -0
  59. package/lib/components/NTableAction.d.ts +30 -0
  60. package/lib/components/NTableAction.js +50 -0
  61. package/lib/components/NTextArea.d.ts +96 -0
  62. package/lib/components/NTextArea.js +133 -0
  63. package/{src/lib → lib}/components/NTooltip.css +1 -1
  64. package/lib/components/NTooltip.d.ts +152 -0
  65. package/lib/components/NTooltip.js +241 -0
  66. package/lib/components/NValInput.d.ts +156 -0
  67. package/lib/components/NValInput.js +113 -0
  68. package/lib/components/ValidatedForm.d.ts +39 -0
  69. package/lib/components/ValidatedForm.js +35 -0
  70. package/{src/lib/i18n/index.ts → lib/i18n/index.d.ts} +9 -23
  71. package/lib/i18n/index.js +31 -0
  72. package/lib/index.d.ts +2 -0
  73. package/lib/index.js +2 -0
  74. package/lib/utils/breakpoints.d.ts +18 -0
  75. package/lib/utils/breakpoints.js +40 -0
  76. package/lib/utils/component.d.ts +57 -0
  77. package/lib/utils/component.js +79 -0
  78. package/lib/utils/deferred.d.ts +13 -0
  79. package/lib/utils/deferred.js +17 -0
  80. package/lib/utils/identifiable.d.ts +56 -0
  81. package/lib/utils/identifiable.js +81 -0
  82. package/lib/utils/stringMaxLength.d.ts +14 -0
  83. package/lib/utils/stringMaxLength.js +23 -0
  84. package/lib/utils/tailwind.d.ts +4 -0
  85. package/lib/utils/tailwind.js +1 -0
  86. package/lib/utils/utils.d.ts +47 -0
  87. package/lib/utils/utils.js +56 -0
  88. package/{src/lib/utils/vModel.ts → lib/utils/vModel.d.ts} +48 -126
  89. package/lib/utils/vModel.js +224 -0
  90. package/lib/utils/validation.d.ts +90 -0
  91. package/lib/utils/validation.js +147 -0
  92. package/lib/utils/vue.d.ts +13 -0
  93. package/lib/utils/vue.js +21 -0
  94. package/package.json +6 -2
  95. package/.github/workflows/build.yml +0 -26
  96. package/.github/workflows/deploy-demo.yml +0 -46
  97. package/.github/workflows/deploy-lib.yml +0 -59
  98. package/.gitlab-ci.yml +0 -57
  99. package/.nvmrc +0 -1
  100. package/.prettierrc +0 -8
  101. package/.vscode/extensions.json +0 -10
  102. package/.vscode/launch.json +0 -23
  103. package/.vscode/settings.json +0 -13
  104. package/babel.config.json +0 -3
  105. package/env.d.ts +0 -15
  106. package/eslint.config.cjs +0 -27
  107. package/index.html +0 -13
  108. package/postcss.config.js +0 -3
  109. package/public/favicon.ico +0 -0
  110. package/scripts/build-lib.sh +0 -52
  111. package/scripts/sync-node-types.js +0 -70
  112. package/src/demo/App.css +0 -53
  113. package/src/demo/App.tsx +0 -5
  114. package/src/demo/components/ColorGrid.tsx +0 -26
  115. package/src/demo/components/ComponentGrid.tsx +0 -26
  116. package/src/demo/components/ComponentSection.tsx +0 -30
  117. package/src/demo/components/VariantSection.tsx +0 -18
  118. package/src/demo/i18n/de.ts +0 -7
  119. package/src/demo/i18n/en.ts +0 -7
  120. package/src/demo/i18n/index.ts +0 -24
  121. package/src/demo/main.ts +0 -13
  122. package/src/demo/router/index.ts +0 -21
  123. package/src/demo/views/HomeView.tsx +0 -94
  124. package/src/demo/views/NavigationView.tsx +0 -43
  125. package/src/demo/views/presentation/AlertView.tsx +0 -40
  126. package/src/demo/views/presentation/BadgeView.tsx +0 -61
  127. package/src/demo/views/presentation/BreadcrumbView.tsx +0 -52
  128. package/src/demo/views/presentation/ButtonView.tsx +0 -49
  129. package/src/demo/views/presentation/CheckboxView.tsx +0 -59
  130. package/src/demo/views/presentation/DropdownView.tsx +0 -59
  131. package/src/demo/views/presentation/DropzoneView.tsx +0 -39
  132. package/src/demo/views/presentation/IconButtonView.tsx +0 -47
  133. package/src/demo/views/presentation/IconCircleView.tsx +0 -38
  134. package/src/demo/views/presentation/InputView.tsx +0 -179
  135. package/src/demo/views/presentation/LinkView.tsx +0 -60
  136. package/src/demo/views/presentation/ListView.tsx +0 -29
  137. package/src/demo/views/presentation/LoadingIndicatorView.tsx +0 -38
  138. package/src/demo/views/presentation/ModalView.tsx +0 -210
  139. package/src/demo/views/presentation/PaginationView.tsx +0 -25
  140. package/src/demo/views/presentation/SearchbarView.tsx +0 -80
  141. package/src/demo/views/presentation/TableView.tsx +0 -146
  142. package/src/demo/views/presentation/TooltipView.tsx +0 -92
  143. package/src/lib/components/NAlert.tsx +0 -85
  144. package/src/lib/components/NBadge.tsx +0 -75
  145. package/src/lib/components/NBreadcrub.tsx +0 -97
  146. package/src/lib/components/NButton.tsx +0 -82
  147. package/src/lib/components/NCheckbox.tsx +0 -55
  148. package/src/lib/components/NCheckboxLabel.tsx +0 -51
  149. package/src/lib/components/NCrudModal.tsx +0 -133
  150. package/src/lib/components/NDialog.tsx +0 -182
  151. package/src/lib/components/NDropdown.tsx +0 -169
  152. package/src/lib/components/NDropzone.tsx +0 -265
  153. package/src/lib/components/NForm.tsx +0 -32
  154. package/src/lib/components/NFormModal.tsx +0 -66
  155. package/src/lib/components/NIconButton.tsx +0 -92
  156. package/src/lib/components/NIconCircle.tsx +0 -78
  157. package/src/lib/components/NInput.tsx +0 -139
  158. package/src/lib/components/NInputPhone.tsx +0 -53
  159. package/src/lib/components/NInputSelect.tsx +0 -126
  160. package/src/lib/components/NInputSuggestion.tsx +0 -80
  161. package/src/lib/components/NLink.tsx +0 -82
  162. package/src/lib/components/NList.tsx +0 -67
  163. package/src/lib/components/NLoadingIndicator.tsx +0 -63
  164. package/src/lib/components/NModal.tsx +0 -243
  165. package/src/lib/components/NPagination.tsx +0 -131
  166. package/src/lib/components/NSearchbar.tsx +0 -78
  167. package/src/lib/components/NSearchbarList.tsx +0 -47
  168. package/src/lib/components/NSelect.tsx +0 -128
  169. package/src/lib/components/NSuggestionList.tsx +0 -216
  170. package/src/lib/components/NTable.tsx +0 -247
  171. package/src/lib/components/NTableAction.tsx +0 -49
  172. package/src/lib/components/NTextArea.tsx +0 -159
  173. package/src/lib/components/NTooltip.tsx +0 -289
  174. package/src/lib/components/NValInput.tsx +0 -163
  175. package/src/lib/components/ValidatedForm.ts +0 -71
  176. package/src/lib/components/__tests__/NButton.spec.tsx +0 -26
  177. package/src/lib/components/__tests__/NCheckbox.spec.tsx +0 -39
  178. package/src/lib/index.ts +0 -2
  179. package/src/lib/jsx.d.ts +0 -13
  180. package/src/lib/utils/__tests__/identifiable.spec.ts +0 -72
  181. package/src/lib/utils/__tests__/validation.spec.ts +0 -92
  182. package/src/lib/utils/breakpoints.ts +0 -47
  183. package/src/lib/utils/component.tsx +0 -131
  184. package/src/lib/utils/deferred.ts +0 -28
  185. package/src/lib/utils/identifiable.ts +0 -87
  186. package/src/lib/utils/stringMaxLength.ts +0 -25
  187. package/src/lib/utils/tailwind.ts +0 -41
  188. package/src/lib/utils/utils.ts +0 -90
  189. package/src/lib/utils/validation.ts +0 -189
  190. package/src/lib/utils/vue.ts +0 -25
  191. package/tsconfig.config.json +0 -9
  192. package/tsconfig.demo.json +0 -19
  193. package/tsconfig.json +0 -16
  194. package/tsconfig.lib.json +0 -19
  195. package/tsconfig.vitest.json +0 -8
  196. package/vite.config.ts +0 -30
  197. /package/{src/lib → lib}/components/NInput.css +0 -0
  198. /package/{src/lib → lib}/components/NLoadingIndicator.css +0 -0
  199. /package/{src/lib → lib}/i18n/de/vue-collection.json +0 -0
  200. /package/{src/lib → lib}/i18n/en/vue-collection.json +0 -0
package/.gitlab-ci.yml DELETED
@@ -1,57 +0,0 @@
1
- cache:
2
- paths:
3
- - node_modules/
4
-
5
- default:
6
- image: node:18-alpine3.15
7
-
8
- stages:
9
- - prebuild
10
- - build
11
- - deploy
12
-
13
- workflow:
14
- rules:
15
- - if: $CI_PIPELINE_SOURCE == "merge_request_event"
16
- - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
17
-
18
- prebuild:
19
- stage: prebuild
20
- before_script:
21
- - npm ci
22
- script:
23
- - npm run type-check
24
- - npm run lint
25
- - npm run test
26
-
27
-
28
- build-pages:
29
- stage: build
30
- before_script:
31
- - npm ci
32
- script:
33
- - export VITE_BASE_PATH="${CI_PROJECT_PATH#$CI_PROJECT_ROOT_NAMESPACE}/"
34
- - npm run build
35
- artifacts:
36
- paths:
37
- - dist/
38
- expire_in: 1 day
39
-
40
- pages:
41
- stage: deploy
42
- image: busybox:latest
43
- environment:
44
- name: Showroom
45
- url: $CI_PAGES_URL
46
- script:
47
- - rm -rf public
48
- - mkdir public
49
- - mv dist/* public
50
- artifacts:
51
- paths:
52
- - public
53
- rules:
54
- - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
55
-
56
-
57
-
package/.nvmrc DELETED
@@ -1 +0,0 @@
1
- 24
package/.prettierrc DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "trailingComma": "es5",
3
- "tabWidth": 4,
4
- "semi": false,
5
- "singleQuote": true,
6
- "printWidth": 120,
7
- "arrowParens": "avoid"
8
- }
@@ -1,10 +0,0 @@
1
- {
2
- "recommendations": [
3
- "Vue.volar",
4
- "Vue.vscode-typescript-vue-plugin",
5
- "dbaeumer.vscode-eslint",
6
- "esbenp.prettier-vscode",
7
- "bradlc.vscode-tailwindcss"
8
- ],
9
- "unwantedRecommendations": ["octref.vetur"]
10
- }
@@ -1,23 +0,0 @@
1
- {
2
- // Use IntelliSense to learn about possible attributes.
3
- // Hover to view descriptions of existing attributes.
4
- // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
- "version": "0.2.0",
6
- "configurations": [
7
- {
8
- "type": "chrome",
9
- "request": "launch",
10
- "name": "Launch Chrome Canary",
11
- "url": "http://localhost:5173",
12
- "webRoot": "${workspaceFolder}",
13
- "runtimeExecutable": "canary"
14
- },
15
- {
16
- "type": "chrome",
17
- "request": "launch",
18
- "name": "Launch Chrome (stable)",
19
- "url": "http://localhost:5173",
20
- "webRoot": "${workspaceFolder}"
21
- }
22
- ]
23
- }
@@ -1,13 +0,0 @@
1
- {
2
- "eslint.enable": true,
3
- "prettier.enable": true,
4
- "editor.defaultFormatter": "esbenp.prettier-vscode",
5
- "editor.formatOnSave": true,
6
- "eslint.validate": ["vue", "html", "javascript", "typescript", "javascriptreact", "typescriptreact"],
7
- "css.lint.unknownAtRules": "ignore",
8
- "[yaml]": {
9
- "editor.insertSpaces": true,
10
- "editor.tabSize": 2,
11
- "editor.autoIndent": "advanced"
12
- }
13
- }
package/babel.config.json DELETED
@@ -1,3 +0,0 @@
1
- {
2
- "plugins": ["@vue/babel-plugin-jsx"]
3
- }
package/env.d.ts DELETED
@@ -1,15 +0,0 @@
1
- /// <reference types="vite/client" />
2
-
3
- import type { VNode } from 'vue'
4
-
5
- declare global {
6
- namespace JSX {
7
- interface IntrinsicElements {
8
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
9
- [elem: string]: any
10
- }
11
- type Element = VNode
12
- }
13
- }
14
-
15
- export {}
package/eslint.config.cjs DELETED
@@ -1,27 +0,0 @@
1
- const pluginVue = require('eslint-plugin-vue')
2
- const { defineConfigWithVueTs, vueTsConfigs } = require('@vue/eslint-config-typescript')
3
- const js = require('@eslint/js')
4
- const prettierConfig = require('@vue/eslint-config-prettier')
5
-
6
- module.exports = defineConfigWithVueTs(
7
- {
8
- ignores: ['node_modules/**', 'dist/**', 'dist-ssr/**', 'lib/**', 'coverage/**', 'scripts/*.js'],
9
- },
10
- js.configs.recommended,
11
- pluginVue.configs['flat/essential'],
12
- vueTsConfigs.recommended,
13
- prettierConfig,
14
- {
15
- files: ['**/*.config.js', '**/*.config.cjs'],
16
- languageOptions: {
17
- globals: {
18
- require: 'readonly',
19
- module: 'readonly',
20
- __dirname: 'readonly',
21
- },
22
- },
23
- rules: {
24
- '@typescript-eslint/no-require-imports': 'off',
25
- },
26
- }
27
- )
package/index.html DELETED
@@ -1,13 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <link rel="icon" href="/favicon.ico" />
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
- <title>Vue Collection</title>
8
- </head>
9
- <body>
10
- <div id="app"></div>
11
- <script type="module" src="/src/demo/main.ts"></script>
12
- </body>
13
- </html>
package/postcss.config.js DELETED
@@ -1,3 +0,0 @@
1
- module.exports = {
2
- plugins: {},
3
- }
Binary file
@@ -1,52 +0,0 @@
1
- #!/usr/bin/env bash
2
- # Exit on error
3
- set -e
4
- # Remove lib folder
5
- echo "Removing ./lib folder."
6
- rm -rf ./lib
7
-
8
- # Compile typescript code to javascript code
9
- echo "Compiling typescript code with tsconfig.lib.json."
10
- tsc --project tsconfig.lib.json
11
-
12
- # Move lib two directories up
13
- echo "Cleaning up ./lib directory."
14
- if [ ! -d "./lib/src/lib" ]; then
15
- echo "Error: ./lib/src/lib directory not found after compilation"
16
- exit 1
17
- fi
18
- mv ./lib/src/lib/* ./lib
19
-
20
- # Remove unused files
21
- rm -rf ./lib/src
22
- rm -f ./lib/tsconfig.lib.tsbuildinfo
23
-
24
- # Move all css files from components to lib
25
- echo "Copying .css files from the components folder."
26
- if ls ./src/lib/components/*.css 1> /dev/null 2>&1; then
27
- cp ./src/lib/components/*.css ./lib/components
28
- else
29
- echo "Warning: No CSS files found in ./src/lib/components/"
30
- fi
31
-
32
- # Transpile jsx files to js with babel
33
- echo "Using Babel to transpile jsx."
34
- BABEL_OUTPUT=$(./node_modules/.bin/babel lib --out-dir lib 2>&1)
35
- BABEL_EXIT_CODE=$?
36
- echo "$BABEL_OUTPUT"
37
-
38
- # Check if Babel command succeeded
39
- if [ $BABEL_EXIT_CODE -ne 0 ]; then
40
- echo "Error: Babel transpilation failed with exit code $BABEL_EXIT_CODE"
41
- exit $BABEL_EXIT_CODE
42
- fi
43
-
44
- # Optionally, check if any .js files were produced
45
- if ! find ./lib -name "*.js" -type f | grep -q .; then
46
- echo "Error: No .js files produced by Babel transpilation"
47
- exit 1
48
- fi
49
-
50
- find ./lib -name "*.jsx" -type f -delete
51
-
52
- echo "Build completed successfully!"
@@ -1,70 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const fs = require('fs')
4
- const path = require('path')
5
-
6
- const rootDir = path.join(__dirname, '..')
7
- const nvmrcPath = path.join(rootDir, '.nvmrc')
8
- const packageJsonPath = path.join(rootDir, 'package.json')
9
-
10
- // Read .nvmrc
11
- if (!fs.existsSync(nvmrcPath)) {
12
- console.error('Error: .nvmrc file not found')
13
- process.exit(1)
14
- }
15
-
16
- const nvmrcContent = fs.readFileSync(nvmrcPath, 'utf8').trim()
17
-
18
- // Extract major version from .nvmrc
19
- // Supports formats like: "24", "v24", "24.12.0", "lts/iron", etc.
20
- let nodeMajorVersion
21
-
22
- if (nvmrcContent.startsWith('lts/')) {
23
- // Map LTS names to major versions
24
- const ltsMap = {
25
- krypton: '24',
26
- jod: '22',
27
- iron: '20',
28
- hydrogen: '18',
29
- gallium: '16',
30
- fermium: '14',
31
- }
32
- const ltsName = nvmrcContent.replace('lts/', '').toLowerCase()
33
- nodeMajorVersion = ltsMap[ltsName]
34
- if (!nodeMajorVersion) {
35
- console.error(`Error: Unknown LTS name "${ltsName}"`)
36
- process.exit(1)
37
- }
38
- } else {
39
- // Extract numeric version
40
- const versionMatch = nvmrcContent.match(/^v?(\d+)/)
41
- if (!versionMatch) {
42
- console.error(`Error: Could not extract Node version from .nvmrc: "${nvmrcContent}"`)
43
- process.exit(1)
44
- }
45
- nodeMajorVersion = versionMatch[1]
46
- }
47
-
48
- console.log(`Node version from .nvmrc: ${nodeMajorVersion}`)
49
-
50
- // Read package.json
51
- const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'))
52
-
53
- // Check current @types/node version
54
- const currentTypesNode = packageJson.devDependencies?.['@types/node']
55
- const desiredTypesNode = `^${nodeMajorVersion}`
56
-
57
- if (currentTypesNode === desiredTypesNode) {
58
- console.log(`✓ @types/node is already set to ${desiredTypesNode}`)
59
- process.exit(0)
60
- }
61
-
62
- console.log(`Updating @types/node from ${currentTypesNode} to ${desiredTypesNode}`)
63
-
64
- // Update package.json
65
- packageJson.devDependencies['@types/node'] = desiredTypesNode
66
-
67
- // Write back to package.json
68
- fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2) + '\n', 'utf8')
69
-
70
- console.log('✓ package.json updated. Run `npm install` to install the correct @types/node version.')
package/src/demo/App.css DELETED
@@ -1,53 +0,0 @@
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}");
48
-
49
- @layer base {
50
- body {
51
- @apply text-default-900;
52
- }
53
- }
package/src/demo/App.tsx DELETED
@@ -1,5 +0,0 @@
1
- import { createView } from '@/lib/utils/component'
2
- import { RouterView } from 'vue-router'
3
- import './App.css'
4
-
5
- export default createView('App', () => () => <RouterView />)
@@ -1,26 +0,0 @@
1
- import { createComponent } from '@/lib/utils/component'
2
- import { computed, type PropType } from 'vue'
3
- import ComponentGrid, { componentGridProps } from '@/demo/components/ComponentGrid'
4
-
5
- export const colorGridProps = {
6
- ...componentGridProps,
7
- colors: {
8
- type: Number,
9
- default: 6,
10
- },
11
- item: Function as PropType<(color: string, index: number) => JSX.Element>,
12
- } as const
13
-
14
- export default createComponent('ColorGrid', colorGridProps, props => {
15
- const colors = ['primary', 'secondary', 'green', 'red', 'yellow', 'default']
16
-
17
- const selectedColors = computed(() => colors.slice(0, props.colors))
18
-
19
- return () => (
20
- <ComponentGrid cols={props.cols}>
21
- {selectedColors.value.map((color, index) => (
22
- <div class="flex">{props.item?.(color, index)}</div>
23
- ))}
24
- </ComponentGrid>
25
- )
26
- })
@@ -1,26 +0,0 @@
1
- import { createComponent } from '@/lib/utils/component'
2
- import { computed, type PropType } from 'vue'
3
-
4
- export const componentGridProps = {
5
- cols: {
6
- type: Number as PropType<2 | 4 | 6 | 8>,
7
- default: 6,
8
- },
9
- } as const
10
-
11
- export default createComponent('ComponentGrid', componentGridProps, (props, { slots }) => {
12
- const classes = computed(() => {
13
- switch (props.cols) {
14
- case 2:
15
- return 'grid-cols-1 sm:grid-cols-2'
16
- case 4:
17
- return 'grid-cols-2 sm:grid-cols-4'
18
- case 8:
19
- return 'grid-cols-4 sm:grid-cols-8'
20
- default:
21
- return 'grid-cols-3 sm:grid-cols-6'
22
- }
23
- })
24
-
25
- return () => <div class={`grid gap-4 ${classes.value}`}>{slots.default?.()}</div>
26
- })
@@ -1,30 +0,0 @@
1
- import { createComponent } from '@/lib/utils/component'
2
- import { LinkIcon } from '@heroicons/vue/24/solid'
3
- import { RouterLink } from 'vue-router'
4
-
5
- export const componentSectionProps = {
6
- id: String,
7
- title: String,
8
- subtitle: String,
9
- } as const
10
-
11
- export default createComponent('ComponentSection', componentSectionProps, (props, { slots }) => {
12
- return () => (
13
- <div class="border-b-2 border-default-200" id={props.id}>
14
- <div>
15
- <div class="px-8 py-10 max-w-4xl mx-auto">
16
- <RouterLink to={{ hash: props.id ? `#${props.id}` : undefined }} class="group outline-hidden">
17
- <h2 class="font-bold text-4xl mb-2 flex items-center space-x-2 ">
18
- <span>{props.title}</span>
19
- <LinkIcon class="h-8 w-8 text-default-900 opacity-30 hidden group-hover:block group-focus-visible:block" />
20
- </h2>
21
- </RouterLink>
22
- <p class="text-default-500 text-xl font-light">{props.subtitle}</p>
23
- </div>
24
- </div>
25
- <div class="bg-default-50">
26
- <div class="px-8 pt-10 pb-20 space-y-8 max-w-4xl mx-auto">{slots.default?.()}</div>
27
- </div>
28
- </div>
29
- )
30
- })
@@ -1,18 +0,0 @@
1
- import { createComponent } from '@/lib/utils/component'
2
-
3
- export const variantSectionProps = {
4
- title: String,
5
- subtitle: String,
6
- } as const
7
-
8
- export default createComponent('VariantSection', variantSectionProps, (props, { slots }) => {
9
- return () => (
10
- <div>
11
- <div class="mb-6">
12
- <h3 class="text-lg font-medium text-default-700"> {props.title} </h3>
13
- {props.subtitle && <p class="text-default-500 text-sm"> {props.subtitle} </p>}
14
- </div>
15
- <div class="border-2 border-dashed rounded-lg p-8 border-default-200 bg-white">{slots.default?.()}</div>
16
- </div>
17
- )
18
- })
@@ -1,7 +0,0 @@
1
- import vueCollection from '@/lib/i18n/de/vue-collection.json'
2
-
3
- const de = {
4
- ['vue-collection']: vueCollection,
5
- }
6
-
7
- export default de
@@ -1,7 +0,0 @@
1
- import vueCollection from '@/lib/i18n/en/vue-collection.json'
2
-
3
- const en = {
4
- ['vue-collection']: vueCollection,
5
- }
6
-
7
- export default en
@@ -1,24 +0,0 @@
1
- import en from './en'
2
- import de from './de'
3
- import { createI18n } from 'vue-i18n'
4
- import { registerTranslationProvider } from '@/lib/i18n'
5
-
6
- export const i18n = createI18n({
7
- legacy: false,
8
- locale: 'en',
9
- messages: {
10
- en,
11
- de,
12
- },
13
- })
14
-
15
- registerTranslationProvider({
16
- trsl(key, params) {
17
- return i18n.global.t(key, params == null ? {} : params)
18
- },
19
- trslc(key, count, params) {
20
- const newCount = count ?? 0
21
- const newParams = { n: newCount, ...params }
22
- return i18n.global.t(key, newParams, { plural: newCount })
23
- },
24
- })
package/src/demo/main.ts DELETED
@@ -1,13 +0,0 @@
1
- import { createApp } from 'vue'
2
- import App from './App'
3
- import router from './router'
4
- import { addDocumentResizeEventListener } from '@/lib/utils/breakpoints'
5
- import { i18n } from './i18n'
6
-
7
- addDocumentResizeEventListener()
8
-
9
- const app = createApp(App)
10
- app.use(router)
11
- app.use(i18n)
12
-
13
- app.mount('#app')
@@ -1,21 +0,0 @@
1
- import { createRouter, createWebHistory } from 'vue-router'
2
-
3
- const router = createRouter({
4
- history: createWebHistory(import.meta.env.BASE_URL),
5
- scrollBehavior: to => {
6
- if (to.hash) {
7
- return {
8
- el: to.hash,
9
- }
10
- }
11
- },
12
- routes: [
13
- {
14
- path: '/',
15
- name: 'home',
16
- component: () => import('../views/HomeView'),
17
- },
18
- ],
19
- })
20
-
21
- export default router
@@ -1,94 +0,0 @@
1
- import ModalView from './presentation/ModalView'
2
- import { createView } from '@/lib/utils/component'
3
- import AlertView from './presentation/AlertView'
4
- import BadgeView from './presentation/BadgeView'
5
- import ButtonView from './presentation/ButtonView'
6
- import CheckboxView from './presentation/CheckboxView'
7
- import IconButtonView from './presentation/IconButtonView'
8
- import DropdownView from './presentation/DropdownView'
9
- import IconCircleView from './presentation/IconCircleView'
10
- import InputView from './presentation/InputView'
11
- import ListView from './presentation/ListView'
12
- import LoadingIndicatorView from './presentation/LoadingIndicatorView'
13
- import PaginationView from './presentation/PaginationView'
14
- import SearchbarView from './presentation/SearchbarView'
15
- import TableView from './presentation/TableView'
16
- import NavigationView from './NavigationView'
17
- import { RouterLink } from 'vue-router'
18
- import { ChevronDoubleUpIcon } from '@heroicons/vue/24/solid'
19
- import { ref, Transition } from 'vue'
20
- import NBadge from '@/lib/components/NBadge'
21
- import LinkView from './presentation/LinkView'
22
- import BreadcrumbView from './presentation/BreadcrumbView'
23
- import TooltipView from './presentation/TooltipView'
24
- import DropzoneView from './presentation/DropzoneView'
25
-
26
- export default createView('HomeView', () => {
27
- const showButton = ref(false)
28
- window.onscroll = () => {
29
- const treshhold = 1000
30
- showButton.value = document.documentElement.scrollTop > treshhold || document.body.scrollTop > treshhold
31
- }
32
-
33
- return () => (
34
- <div>
35
- <div class="bg-gradient-to-r from-primary-500/70 to-white">
36
- <div
37
- class="bg-gradient-to-b from-default-300/80 to-default-50 border-b-2 border-default-200 z-50"
38
- id="overview"
39
- >
40
- <div class="px-8 py-20 min-h-screen m-auto text-center max-w-4xl flex items-center justify-center flex-col">
41
- <h1 class="text-6xl font-semibold mb-8">Vue Collection</h1>
42
- <p class="text-3xl font-light text-default-500">
43
- Styled and fully functional components created by naptics.
44
- </p>
45
- <NavigationView class="mt-16" />
46
- </div>
47
- </div>
48
- </div>
49
-
50
- <div class="space-y-10">
51
- <AlertView />
52
- <ButtonView />
53
- <IconButtonView />
54
- <LinkView />
55
- <IconCircleView />
56
- <BadgeView />
57
- <BreadcrumbView />
58
- <CheckboxView />
59
- <DropdownView />
60
- <InputView />
61
- <SearchbarView />
62
- <LoadingIndicatorView />
63
- <ModalView />
64
- <ListView />
65
- <TableView />
66
- <TooltipView />
67
- <PaginationView />
68
- <DropzoneView />
69
- </div>
70
-
71
- <Transition
72
- enterActiveClass="transition duration-400"
73
- enterFromClass="opacity-0"
74
- enterToClass="opacity-100"
75
- leaveActiveClass="transition duration-400"
76
- leaveFromClass="opacity-100"
77
- leaveToClass="opacity-0"
78
- >
79
- {showButton.value && (
80
- <div class="fixed z-20 bottom-4 right-4">
81
- <RouterLink to={{ hash: '#overview' }}>
82
- <NBadge textSize="text-base" allCaps={false}>
83
- <div class="flex items-center space-x-2">
84
- <span>Overview</span>
85
- <ChevronDoubleUpIcon class="h-5 w-5" />
86
- </div>
87
- </NBadge>
88
- </RouterLink>
89
- </div>
90
- )}
91
- </Transition>
92
- </div>
93
- )
94
- })