@timus-networks/theme 2.0.1 → 2.0.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 (193) hide show
  1. package/README.md +34 -49
  2. package/dist/module.d.mts +1 -1
  3. package/dist/module.d.ts +1 -1
  4. package/dist/module.json +2 -2
  5. package/dist/module.mjs +40 -18
  6. package/dist/runtime/components/development/example.alert.vue +29 -0
  7. package/dist/runtime/components/development/example.avatar.vue +85 -0
  8. package/dist/runtime/components/development/example.badge.vue +93 -0
  9. package/dist/runtime/components/development/example.breadcrumb.vue +54 -0
  10. package/dist/runtime/components/development/example.button.vue +235 -0
  11. package/dist/runtime/components/{example.button.vue.d.ts → development/example.button.vue.d.ts} +2 -1
  12. package/dist/runtime/components/development/example.card.vue +68 -0
  13. package/dist/runtime/components/development/example.checkbox.vue +176 -0
  14. package/dist/runtime/components/{example.checkbox.vue.d.ts → development/example.checkbox.vue.d.ts} +2 -2
  15. package/dist/runtime/components/development/example.collapse.vue +38 -0
  16. package/dist/runtime/components/development/example.datepicker.vue +193 -0
  17. package/dist/runtime/components/development/example.description.vue +94 -0
  18. package/dist/runtime/components/{example.dialog.vue → development/example.dialog.vue} +21 -24
  19. package/dist/runtime/components/development/example.dropdown.vue +166 -0
  20. package/dist/runtime/components/development/example.form.vue +488 -0
  21. package/dist/runtime/components/development/example.input.vue +270 -0
  22. package/dist/runtime/components/development/example.input.vue.d.ts +23 -0
  23. package/dist/runtime/components/development/example.link.vue +68 -0
  24. package/dist/runtime/components/development/example.message.vue +64 -0
  25. package/dist/runtime/components/development/example.notification.vue +75 -0
  26. package/dist/runtime/components/development/example.number.vue +70 -0
  27. package/dist/runtime/components/development/example.pagination.vue +89 -0
  28. package/dist/runtime/components/development/example.popover.vue +151 -0
  29. package/dist/runtime/components/development/example.radio.vue +163 -0
  30. package/dist/runtime/components/{example.radio.vue.d.ts → development/example.radio.vue.d.ts} +3 -2
  31. package/dist/runtime/components/development/example.select.vue +588 -0
  32. package/dist/runtime/components/{example.select.vue.d.ts → development/example.select.vue.d.ts} +3 -2
  33. package/dist/runtime/components/development/example.sidebar.vue +101 -0
  34. package/dist/runtime/components/development/example.static.vue +50 -0
  35. package/dist/runtime/components/development/example.switch.vue +101 -0
  36. package/dist/runtime/components/{example.table.vue → development/example.table.vue} +8 -22
  37. package/dist/runtime/components/development/example.tag.vue +255 -0
  38. package/dist/runtime/components/development/example.timepicker.vue +89 -0
  39. package/dist/runtime/components/development/example.tooltip.vue +104 -0
  40. package/dist/runtime/components/development/example.upload.vue +84 -0
  41. package/dist/runtime/components/production/html-encode.vue +96 -0
  42. package/dist/runtime/components/production/timus-breadcrumb.d.ts +36 -0
  43. package/dist/runtime/components/production/timus-breadcrumb.js +224 -0
  44. package/dist/runtime/components/production/timus-breadcrumb.mjs +224 -0
  45. package/dist/runtime/components/production/timus-breadcrumb.vue +83 -0
  46. package/dist/runtime/components/production/timus-breadcrumb.vue.d.ts +340 -0
  47. package/dist/runtime/composables/useBreadcrumb.d.ts +8 -0
  48. package/dist/runtime/composables/useBreadcrumb.js +53 -0
  49. package/dist/runtime/composables/useBreadcrumb.mjs +53 -0
  50. package/dist/runtime/pages/theme.vue +44 -13
  51. package/dist/runtime/plugins/disable-warnings-plugin.js +18 -0
  52. package/dist/runtime/plugins/disable-warnings-plugin.mjs +18 -0
  53. package/dist/runtime/public/scss/element-plus/affix.css +28 -0
  54. package/dist/runtime/public/scss/element-plus/alert.css +116 -20
  55. package/dist/runtime/public/scss/element-plus/anchor-link.css +28 -0
  56. package/dist/runtime/public/scss/element-plus/anchor.css +28 -0
  57. package/dist/runtime/public/scss/element-plus/aside.css +28 -0
  58. package/dist/runtime/public/scss/element-plus/autocomplete.css +28 -0
  59. package/dist/runtime/public/scss/element-plus/avatar.css +60 -10
  60. package/dist/runtime/public/scss/element-plus/backtop.css +28 -0
  61. package/dist/runtime/public/scss/element-plus/badge.css +30 -2
  62. package/dist/runtime/public/scss/element-plus/base.css +31 -3
  63. package/dist/runtime/public/scss/element-plus/breadcrumb.css +46 -6
  64. package/dist/runtime/public/scss/element-plus/button-group.css +154 -32
  65. package/dist/runtime/public/scss/element-plus/button.css +70 -24
  66. package/dist/runtime/public/scss/element-plus/calendar.css +28 -0
  67. package/dist/runtime/public/scss/element-plus/card.css +41 -6
  68. package/dist/runtime/public/scss/element-plus/carousel-item.css +28 -0
  69. package/dist/runtime/public/scss/element-plus/carousel.css +28 -0
  70. package/dist/runtime/public/scss/element-plus/cascader-panel.css +28 -0
  71. package/dist/runtime/public/scss/element-plus/cascader.css +28 -0
  72. package/dist/runtime/public/scss/element-plus/check-tag.css +28 -0
  73. package/dist/runtime/public/scss/element-plus/checkbox-button.css +33 -0
  74. package/dist/runtime/public/scss/element-plus/checkbox-group.css +28 -0
  75. package/dist/runtime/public/scss/element-plus/checkbox.css +28 -0
  76. package/dist/runtime/public/scss/element-plus/col.css +28 -0
  77. package/dist/runtime/public/scss/element-plus/collapse.css +28 -0
  78. package/dist/runtime/public/scss/element-plus/color-picker.css +28 -0
  79. package/dist/runtime/public/scss/element-plus/common/popup.css +28 -0
  80. package/dist/runtime/public/scss/element-plus/common/transition.css +28 -0
  81. package/dist/runtime/public/scss/element-plus/common/var.css +28 -0
  82. package/dist/runtime/public/scss/element-plus/container.css +28 -0
  83. package/dist/runtime/public/scss/element-plus/dark/css-vars.css +28 -0
  84. package/dist/runtime/public/scss/element-plus/dark/var.css +28 -0
  85. package/dist/runtime/public/scss/element-plus/date-picker/date-picker.css +76 -14
  86. package/dist/runtime/public/scss/element-plus/date-picker/date-range-picker.css +41 -9
  87. package/dist/runtime/public/scss/element-plus/date-picker/date-table.css +31 -3
  88. package/dist/runtime/public/scss/element-plus/date-picker/month-table.css +28 -0
  89. package/dist/runtime/public/scss/element-plus/date-picker/picker-panel.css +69 -6
  90. package/dist/runtime/public/scss/element-plus/date-picker/picker.css +28 -0
  91. package/dist/runtime/public/scss/element-plus/date-picker/time-picker.css +56 -16
  92. package/dist/runtime/public/scss/element-plus/date-picker/time-range-picker.css +39 -4
  93. package/dist/runtime/public/scss/element-plus/date-picker/time-spinner.css +31 -4
  94. package/dist/runtime/public/scss/element-plus/date-picker/year-table.css +28 -0
  95. package/dist/runtime/public/scss/element-plus/date-picker.css +134 -50
  96. package/dist/runtime/public/scss/element-plus/descriptions-item.css +48 -8
  97. package/dist/runtime/public/scss/element-plus/descriptions.css +78 -16
  98. package/dist/runtime/public/scss/element-plus/dialog.css +30 -2
  99. package/dist/runtime/public/scss/element-plus/display.css +28 -0
  100. package/dist/runtime/public/scss/element-plus/divider.css +28 -0
  101. package/dist/runtime/public/scss/element-plus/drawer.css +28 -0
  102. package/dist/runtime/public/scss/element-plus/dropdown.css +43 -12
  103. package/dist/runtime/public/scss/element-plus/empty.css +28 -0
  104. package/dist/runtime/public/scss/element-plus/footer.css +28 -0
  105. package/dist/runtime/public/scss/element-plus/form.css +28 -0
  106. package/dist/runtime/public/scss/element-plus/header.css +28 -0
  107. package/dist/runtime/public/scss/element-plus/icon.css +30 -2
  108. package/dist/runtime/public/scss/element-plus/image-viewer.css +28 -0
  109. package/dist/runtime/public/scss/element-plus/image.css +28 -0
  110. package/dist/runtime/public/scss/element-plus/index.css +920 -329
  111. package/dist/runtime/public/scss/element-plus/input-number.css +50 -6
  112. package/dist/runtime/public/scss/element-plus/input.css +28 -0
  113. package/dist/runtime/public/scss/element-plus/link.css +59 -28
  114. package/dist/runtime/public/scss/element-plus/loading.css +28 -0
  115. package/dist/runtime/public/scss/element-plus/main.css +28 -0
  116. package/dist/runtime/public/scss/element-plus/mention.css +28 -0
  117. package/dist/runtime/public/scss/element-plus/menu.css +28 -0
  118. package/dist/runtime/public/scss/element-plus/message-box.css +34 -2
  119. package/dist/runtime/public/scss/element-plus/message.css +161 -31
  120. package/dist/runtime/public/scss/element-plus/mixins/mixins.css +28 -0
  121. package/dist/runtime/public/scss/element-plus/notification.css +41 -9
  122. package/dist/runtime/public/scss/element-plus/option-group.css +28 -0
  123. package/dist/runtime/public/scss/element-plus/option.css +29 -0
  124. package/dist/runtime/public/scss/element-plus/overlay.css +28 -0
  125. package/dist/runtime/public/scss/element-plus/page-header.css +28 -0
  126. package/dist/runtime/public/scss/element-plus/pagination.css +64 -11
  127. package/dist/runtime/public/scss/element-plus/popconfirm.css +28 -0
  128. package/dist/runtime/public/scss/element-plus/popover.css +28 -0
  129. package/dist/runtime/public/scss/element-plus/popper.css +29 -1
  130. package/dist/runtime/public/scss/element-plus/progress.css +28 -0
  131. package/dist/runtime/public/scss/element-plus/radio-button.css +36 -2
  132. package/dist/runtime/public/scss/element-plus/radio-group.css +28 -0
  133. package/dist/runtime/public/scss/element-plus/radio.css +28 -0
  134. package/dist/runtime/public/scss/element-plus/rate.css +28 -0
  135. package/dist/runtime/public/scss/element-plus/reset.css +28 -0
  136. package/dist/runtime/public/scss/element-plus/result.css +28 -0
  137. package/dist/runtime/public/scss/element-plus/row.css +28 -0
  138. package/dist/runtime/public/scss/element-plus/scrollbar.css +28 -0
  139. package/dist/runtime/public/scss/element-plus/segmented.css +28 -0
  140. package/dist/runtime/public/scss/element-plus/select-dropdown-v2.css +28 -0
  141. package/dist/runtime/public/scss/element-plus/select-dropdown.css +28 -0
  142. package/dist/runtime/public/scss/element-plus/select-v2.css +48 -23
  143. package/dist/runtime/public/scss/element-plus/select.css +48 -23
  144. package/dist/runtime/public/scss/element-plus/skeleton-item.css +28 -0
  145. package/dist/runtime/public/scss/element-plus/skeleton.css +28 -0
  146. package/dist/runtime/public/scss/element-plus/slider.css +28 -0
  147. package/dist/runtime/public/scss/element-plus/space.css +28 -0
  148. package/dist/runtime/public/scss/element-plus/spinner.css +28 -0
  149. package/dist/runtime/public/scss/element-plus/statistic.css +28 -0
  150. package/dist/runtime/public/scss/element-plus/step.css +28 -0
  151. package/dist/runtime/public/scss/element-plus/steps.css +28 -0
  152. package/dist/runtime/public/scss/element-plus/switch.css +116 -20
  153. package/dist/runtime/public/scss/element-plus/table-column.css +29 -1
  154. package/dist/runtime/public/scss/element-plus/table-v2.css +28 -0
  155. package/dist/runtime/public/scss/element-plus/table.css +28 -0
  156. package/dist/runtime/public/scss/element-plus/tabs.css +30 -2
  157. package/dist/runtime/public/scss/element-plus/tag.css +28 -0
  158. package/dist/runtime/public/scss/element-plus/text.css +34 -0
  159. package/dist/runtime/public/scss/element-plus/time-picker.css +111 -30
  160. package/dist/runtime/public/scss/element-plus/time-select.css +76 -14
  161. package/dist/runtime/public/scss/element-plus/timeline-item.css +28 -0
  162. package/dist/runtime/public/scss/element-plus/timeline.css +28 -0
  163. package/dist/runtime/public/scss/element-plus/tooltip-v2.css +28 -0
  164. package/dist/runtime/public/scss/element-plus/tour.css +30 -2
  165. package/dist/runtime/public/scss/element-plus/transfer.css +28 -0
  166. package/dist/runtime/public/scss/element-plus/tree-select.css +28 -0
  167. package/dist/runtime/public/scss/element-plus/tree.css +28 -0
  168. package/dist/runtime/public/scss/element-plus/upload.css +28 -0
  169. package/dist/runtime/public/scss/element-plus/var.css +29 -1
  170. package/dist/runtime/public/scss/element-plus/virtual-list.css +28 -0
  171. package/dist/runtime/public/scss/theme.css +79 -2
  172. package/dist/runtime/types.d.ts +7 -16
  173. package/package.json +1 -1
  174. package/dist/runtime/components/example.button.vue +0 -237
  175. package/dist/runtime/components/example.checkbox.vue +0 -190
  176. package/dist/runtime/components/example.form.vue +0 -494
  177. package/dist/runtime/components/example.input.vue +0 -286
  178. package/dist/runtime/components/example.input.vue.d.ts +0 -20
  179. package/dist/runtime/components/example.popover.vue +0 -161
  180. package/dist/runtime/components/example.radio.vue +0 -165
  181. package/dist/runtime/components/example.select.vue +0 -591
  182. package/dist/runtime/components/example.sidebar.vue +0 -104
  183. package/dist/runtime/components/example.tag.vue +0 -279
  184. package/dist/runtime/components/html-encode.vue +0 -37
  185. package/dist/runtime/plugins/element-extend-plugin.d.ts +0 -38
  186. package/dist/runtime/plugins/element-extend-plugin.js +0 -39
  187. package/dist/runtime/plugins/element-extend-plugin.mjs +0 -39
  188. package/dist/runtime/plugins/experimental-size-plugin.js +0 -13
  189. package/dist/runtime/plugins/experimental-size-plugin.mjs +0 -13
  190. /package/dist/runtime/plugins/{experimental-size-plugin.d.ts → disable-warnings-plugin.d.ts} +0 -0
  191. /package/dist/runtime/plugins/{theme-provider.d.ts → theme-provider-plugin.d.ts} +0 -0
  192. /package/dist/runtime/plugins/{theme-provider.js → theme-provider-plugin.js} +0 -0
  193. /package/dist/runtime/plugins/{theme-provider.mjs → theme-provider-plugin.mjs} +0 -0
package/README.md CHANGED
@@ -1,12 +1,11 @@
1
1
  # @timus-networks/fonts
2
2
 
3
- Nuxt module for Font Installation.
3
+ Nuxt module for Theme Installation.
4
4
 
5
5
  ## Table of Contents
6
6
 
7
7
  - [Installation](#installation)
8
8
  - [Usage](#usage)
9
- - [Configuration](#configuration)
10
9
  - [Scripts](#scripts)
11
10
  - [Contributing](#contributing)
12
11
  - [License](#license)
@@ -18,13 +17,13 @@ To install this module, you can use npm or yarn:
18
17
  ### npm
19
18
 
20
19
  ```sh
21
- npm install @timus-networks/fonts
20
+ npm install @timus-networks/theme
22
21
  ```
23
22
 
24
23
  ### yarn
25
24
 
26
25
  ```sh
27
- yarn add @timus-networks/fonts
26
+ yarn add @timus-networks/theme
28
27
  ```
29
28
 
30
29
  ## Usage
@@ -33,70 +32,58 @@ yarn add @timus-networks/fonts
33
32
 
34
33
  ```typescript
35
34
  export default defineNuxtConfig({
36
- modules: ['@timus-networks/fonts'],
35
+ modules: ['@timus-networks/theme'],
37
36
  });
38
37
  ```
39
38
 
40
- 2. Add below configuration to your **nuxt.config.js** file.
41
-
42
- <sub>nuxt.config.js</sub>
43
-
44
- ```js
45
- tailwindcss: {
46
- // cssPath: '~/static/scss/main.scss',
47
- configPath: '@/tailwind.config.js',
48
- exposeConfig: false,
49
- exposeLevel: 2,
50
- config: {
51
- darkMode: 'class',
52
- },
53
- injectPosition: 'first',
54
- viewer: true,
55
- },
56
- ```
57
-
58
- 3. Add below code to your **tailwind.config.js** file
39
+ 2. Add below code to your **tailwind.config.js** file
59
40
 
60
41
  ```js
61
42
  // tint & shade color generator
62
- function generateColors(baseName, start = 100, end = 900, step = 100) {
43
+ function generateColors(baseName, start = 1, end = 9, step = 1) {
63
44
  const colors = {};
45
+
64
46
  for (let i = start; i <= end; i += step) {
65
- colors[i] = `var(--${baseName}-${i})`;
47
+ colors[i] = `var(--el-color-${baseName}-light-${i})`;
66
48
  }
49
+
67
50
  return colors;
68
51
  }
69
52
 
70
- const colorNames = ['primary', 'secondary', 'gray', 'danger', 'success', 'warning', 'info'];
71
-
72
- const colors = colorNames.reduce((acc, color) => {
73
- return { ...acc, [`${color}`]: generateColors(color, 100, 900) };
74
- }, {});
53
+ const colorNames = ['primary', 'secondary', 'neutral', 'danger', 'success', 'warning', 'info'];
54
+ const colorShades = [1, 2, 3, 4, 5, 6, 7, 8, 9];
55
+ const classPrefixes = ['bg', 'text', 'border'];
56
+ const colors = colorNames.reduce((acc, color) => ({ ...acc, [`${color}`]: generateColors(color, 1, 9) }), {});
75
57
 
76
58
  module.exports = {
77
- content: ['./pages/**/*.{html,js}'],
59
+ // content: ['./pages/**/*.{vue,html}', './components/**/*.{vue,html}', './layouts/**/*.{vue,html}', './modules/**/*.{vue,html}'],
60
+ content: ['./modules/**/*.{vue,html}'],
78
61
  theme: {
79
62
  extend: {
80
- colors: colors,
63
+ colors,
64
+ spacing: {
65
+ default: '30px',
66
+ 7.5: '30px', // 30px için özel bir sınıf ekliyoruz
67
+ },
81
68
  },
82
69
  },
83
- plugins: [],
70
+ plugins: [
71
+ function ({ addUtilities, theme, e }) {
72
+ const gridCols = theme('gridTemplateColumns');
73
+ const utilities = Object.entries(gridCols).map(([key, value]) => ({
74
+ [`.${e(`grid-cols-${key}`)}`]: {
75
+ 'grid-template-columns': value,
76
+ gap: '30px', // Burada varsayılan boşluğu ayarlıyoruz
77
+ },
78
+ }));
79
+
80
+ addUtilities(utilities);
81
+ },
82
+ ],
83
+ safelist: classPrefixes.flatMap((prefix) => colorNames.flatMap((color) => colorShades.map((i) => `${prefix}-${color}-${i}`))),
84
84
  };
85
85
  ```
86
86
 
87
- ## Configuration
88
-
89
- You can configure the module with the following options in your `nuxt.config.ts`:
90
- There are 2 type fonts exist currently: Poppins or Satoshi. Default font is `Poppins`. You can change it manually using `font: { family: 'Satoshi' }` option or add option with module.
91
-
92
- ```typescript
93
- export default defineNuxtConfig({
94
- modules: [['@timus-networks/fonts', { family: 'Poppins' }]],
95
- // Or add your custom configurations using font attribute
96
- font: { family: 'Satoshi' },
97
- });
98
- ```
99
-
100
87
  ## Scripts
101
88
 
102
89
  The following npm scripts are available:
@@ -124,5 +111,3 @@ If you would like to contribute, please follow these guidelines:
124
111
  ## License
125
112
 
126
113
  This project is licensed under the MIT License.
127
-
128
- <sub>Source for Poppins https://github.com/webfontworld/Poppins, Source for Satoshi https://www.fontshare.com/fonts/satoshi</sub>
package/dist/module.d.mts CHANGED
@@ -6,6 +6,6 @@ interface MyModuleOptions extends ModuleOptions {
6
6
  version: string;
7
7
  description: string;
8
8
  }
9
- declare const _default: _nuxt_schema.NuxtModule<MyModuleOptions>;
9
+ declare const _default: _nuxt_schema.NuxtModule<MyModuleOptions, MyModuleOptions, false>;
10
10
 
11
11
  export { type MyModuleOptions, _default as default };
package/dist/module.d.ts CHANGED
@@ -6,6 +6,6 @@ interface MyModuleOptions extends ModuleOptions {
6
6
  version: string;
7
7
  description: string;
8
8
  }
9
- declare const _default: _nuxt_schema.NuxtModule<MyModuleOptions>;
9
+ declare const _default: _nuxt_schema.NuxtModule<MyModuleOptions, MyModuleOptions, false>;
10
10
 
11
11
  export { type MyModuleOptions, _default as default };
package/dist/module.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@timus-networks/theme",
3
3
  "configKey": "themeOptions",
4
- "version": "2.0.1",
4
+ "version": "2.0.2",
5
5
  "builder": {
6
- "@nuxt/module-builder": "0.8.3",
6
+ "@nuxt/module-builder": "0.8.4",
7
7
  "unbuild": "2.0.0"
8
8
  }
9
9
  }
package/dist/module.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { readdirSync } from 'node:fs';
2
2
  import { resolve, parse, join } from 'node:path';
3
- import { defineNuxtModule, createResolver, addPlugin, addComponent } from 'nuxt/kit';
3
+ import { defineNuxtModule, createResolver, useNuxt, addImports, addPlugin, addComponent } from 'nuxt/kit';
4
4
 
5
5
 
6
6
 
@@ -12,7 +12,7 @@ const __filename = __cjs_url__.fileURLToPath(import.meta.url);
12
12
  const __dirname = __cjs_path__.dirname(__filename);
13
13
  const require = __cjs_mod__.createRequire(import.meta.url);
14
14
  const name = "@timus-networks/theme";
15
- const version = "2.0.1";
15
+ const version = "2.0.2";
16
16
  const description = "A comprehensive Nuxt.js module providing a tailored theme experience with integrated TailwindCSS support for applications.";
17
17
  const type = "module";
18
18
  const exports = {
@@ -102,12 +102,16 @@ const module = defineNuxtModule({
102
102
  hooks: {
103
103
  "pages:extend": (pages) => {
104
104
  const resolver = createResolver(import.meta.url);
105
- pages.push({
106
- name: "theme",
107
- path: "/theme",
108
- mode: "client",
109
- file: resolver.resolve(`${folderPath}/pages/theme.vue`)
110
- });
105
+ const nuxt = useNuxt();
106
+ const isDev = nuxt.options.dev;
107
+ if (isDev) {
108
+ pages.push({
109
+ name: "theme",
110
+ path: "/theme",
111
+ mode: "client",
112
+ file: resolver.resolve(`${folderPath}/pages/theme.vue`)
113
+ });
114
+ }
111
115
  },
112
116
  "nitro:config": async (nitroConfig) => {
113
117
  nitroConfig.publicAssets ||= [];
@@ -124,13 +128,31 @@ const module = defineNuxtModule({
124
128
  },
125
129
  setup(options, nuxt) {
126
130
  const resolver = createResolver(import.meta.url);
131
+ const isDev = nuxt.options.dev;
127
132
  console.info(`'${PackageJson.name}' loaded. Version:${options.version}`);
128
- const components_dir_list = ["runtime/components"];
133
+ const composablesDir = resolver.resolve(`${folderPath}/composables`);
134
+ const composableFiles = readdirSync(composablesDir).filter((file) => file.endsWith(".ts") && !file.startsWith("index"));
135
+ composableFiles.forEach((file) => {
136
+ const { name } = parse(file);
137
+ addImports({
138
+ name,
139
+ as: name,
140
+ from: `${composablesDir}/${file}`
141
+ });
142
+ });
143
+ const components_dir_list = [
144
+ { env: "development", path: "runtime/components/development" },
145
+ { env: "production", path: "runtime/components/production" }
146
+ ];
147
+ const comp = [];
129
148
  const addComponentFromFolder = (folder) => {
130
149
  const path = resolve(__dirname, folder);
131
- const files = readdirSync(path);
150
+ const files = readdirSync(path).filter((file) => file.endsWith(".vue"));
132
151
  files.forEach((file) => {
133
152
  const { name } = parse(file);
153
+ const isExit = comp.find((item) => item.name === name);
154
+ !isExit ? comp.push({ name, path: resolve(path, file) }) : console.log("#BU COMPONENT VAR name:", name, resolve(path, file), "\xD6nceki: ", isExit);
155
+ nuxt.options.build.transpile.push(resolve(path, file));
134
156
  addComponent({
135
157
  name: join(name),
136
158
  filePath: resolve(path, file),
@@ -138,16 +160,16 @@ const module = defineNuxtModule({
138
160
  });
139
161
  });
140
162
  };
141
- components_dir_list.forEach((folder) => {
142
- addComponentFromFolder(folder);
163
+ nuxt.hook("components:dirs", (dirs) => {
164
+ components_dir_list.forEach(({ env, path }) => {
165
+ if (isDev || !isDev && env === "production") {
166
+ addComponentFromFolder(path);
167
+ }
168
+ });
143
169
  });
144
170
  addPlugin(resolver.resolve(`${folderPath}/plugins/sample-plugin`));
145
- addPlugin(resolver.resolve(`${folderPath}/plugins/theme-provider`));
146
- nuxt.options.runtimeConfig.public.theme = {
147
- ...options,
148
- types: options.types,
149
- sizes: options.sizes
150
- };
171
+ addPlugin(resolver.resolve(`${folderPath}/plugins/disable-warnings-plugin`));
172
+ addPlugin(resolver.resolve(`${folderPath}/plugins/theme-provider-plugin`));
151
173
  nuxt.options.css.push(resolver.resolve(`${folderPath}/public/scss/theme.scss`));
152
174
  nuxt.options.css.push(resolver.resolve(`${folderPath}/public/scss/element-plus/index.scss`));
153
175
  nuxt.hook("prepare:types", ({ references }) => {
@@ -0,0 +1,29 @@
1
+ <template>
2
+ <div class="flex flex-col gap-8 mb-16">
3
+ <h1 class="">Alert</h1>
4
+ <p>Displays important alert messages.</p>
5
+
6
+ <el-card>
7
+ <template #header> Basic usage </template>
8
+ <div class="flex flex-col gap-7.5">
9
+ <p>
10
+ Alert components are non-overlay elements in the page that does not disappear automatically. Alert provides 4 types of themes defined by
11
+ <el-text tag="mark">type</el-text>, whose default value is <el-text tag="mark">info</el-text>.
12
+ </p>
13
+ <div class="flex gap-4 items-start flex-col">
14
+ <el-alert :title="`default`" />
15
+ <el-alert v-for="color of colors" :key="color" :title="`${color} alert`" :type="color" show-icon />
16
+ <el-alert v-for="color of colors" :key="color" :title="`${color} alert`" :type="color" description="This is a description." show-icon />
17
+ </div>
18
+ </div>
19
+ <template #footer> <html-encode :tag="snippets.basic" /> </template>
20
+ </el-card>
21
+ </div>
22
+ </template>
23
+
24
+ <script lang="ts" setup>
25
+ const colors = ref(['success', 'warning', 'info', 'error', 'danger']);
26
+ const snippets = ref({
27
+ basic: `<el-alert title="Title Text Goes Here" type="danger" description="This is a description." show-icon :closable="false" />`,
28
+ });
29
+ </script>
@@ -0,0 +1,85 @@
1
+ <template>
2
+ <div class="flex flex-col gap-8 mb-16">
3
+ <h1 class="">Avatar</h1>
4
+ <p>Avatars can be used to represent people or objects. It supports images, Icons, or characters.</p>
5
+
6
+ <el-card>
7
+ <template #header> With Image </template>
8
+ <section class="flex flex-col gap-7.5">
9
+ <p>Add <el-text tag="mark">src</el-text> attribute for display an image</p>
10
+ <div class="flex gap-7.5">
11
+ <div v-for="(size, index) of sizes" :key="size" class="flex flex-col gap-2 border rounded-md p-2 w-28 items-center">
12
+ <h5 class="font-normal text-neutral-7 grow">{{ String(size).toUpperCase() }}</h5>
13
+ <el-avatar :size="size" src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png" />
14
+ <small class="text-neutral-4 flex items-end grow p-mini">{{ infos[index] }}px</small>
15
+ </div>
16
+ </div>
17
+ </section>
18
+ <template #footer> <html-encode :tag="snippets.image" /> </template>
19
+ </el-card>
20
+
21
+ <el-card>
22
+ <template #header> With Text </template>
23
+ <section class="flex flex-col gap-7.5">
24
+ <p>Insert text into tag brackets</p>
25
+ <div class="flex gap-7.5">
26
+ <div v-for="(size, index) of sizes" :key="size" class="flex flex-col gap-2 border rounded-md p-2 w-28 items-center">
27
+ <h5 class="font-normal text-neutral-7 grow">{{ String(size).toUpperCase() }}</h5>
28
+ <el-avatar :size="size">SK</el-avatar>
29
+ <small class="text-neutral-4 flex items-end grow p-mini">{{ infos[index] }}px</small>
30
+ </div>
31
+ </div>
32
+ </section>
33
+ <template #footer> <html-encode :tag="snippets.text" /> </template>
34
+ </el-card>
35
+
36
+ <el-card>
37
+ <template #header> With Isax </template>
38
+ <section class="flex flex-col gap-7.5">
39
+ <p>Add <el-text tag="mark">class="isax-*"</el-text> attribute for display to isax icon</p>
40
+ <div class="flex gap-7.5">
41
+ <div v-for="(size, index) of sizes" :key="size" class="flex flex-col gap-2 border rounded-md p-2 w-28 items-center">
42
+ <h5 class="font-normal text-neutral-7 grow">{{ String(size).toUpperCase() }}</h5>
43
+ <el-avatar :size="size" class="isax-notification" />
44
+ <small class="text-neutral-4 flex items-end grow p-mini">{{ infos[index] }}px</small>
45
+ </div>
46
+ </div>
47
+ </section>
48
+ <template #footer> <html-encode :tag="snippets.isax" /> </template>
49
+ </el-card>
50
+
51
+ <el-card>
52
+ <template #header> With Element Icon </template>
53
+ <section class="flex flex-col gap-7.5">
54
+ <p>Add <el-text tag="mark">icon</el-text> attribute for display an icon</p>
55
+ <div class="flex gap-7.5">
56
+ <div v-for="(size, index) of sizes" :key="size" class="flex flex-col gap-2 border rounded-md p-2 w-28 items-center">
57
+ <h5 class="font-normal text-neutral-7 grow">{{ String(size).toUpperCase() }}</h5>
58
+ <el-avatar :size="size" :icon="ElIconBell" />
59
+ <small class="text-neutral-4 flex items-end grow p-mini">{{ infos[index] }}px</small>
60
+ </div>
61
+ </div>
62
+ </section>
63
+ <template #footer> <html-encode :tag="snippets.icon" /> </template>
64
+ </el-card>
65
+ </div>
66
+ </template>
67
+
68
+ <script lang="ts" setup>
69
+ import { ref } from 'vue';
70
+ import { reactive, toRefs } from 'vue';
71
+
72
+ const state = reactive({
73
+ circleUrl: 'https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png',
74
+ squareUrl: 'https://cube.elemecdn.com/9/c2/f0ee8a3c7c9638a54940382568c9dpng.png',
75
+ sizes: [50, 'default', 'large', 'medium', 'small', 'mini'] as const,
76
+ infos: [50, '32', '56', '44', '32', '16'] as const,
77
+ });
78
+ const { sizes, infos, circleUrl, squareUrl, sizeList } = toRefs(state);
79
+ const snippets = ref({
80
+ isax: `<el-avatar class="isax-notification" />`,
81
+ icon: `<el-avatar :icon="ElIconEdit" />`,
82
+ text: `<el-avatar>SK</el-avatar>`,
83
+ image: `<el-avatar src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png" />`,
84
+ });
85
+ </script>
@@ -0,0 +1,93 @@
1
+ <template>
2
+ <div class="flex flex-col gap-8 mb-16">
3
+ <h1 class="">Badge</h1>
4
+ <p>A number or status mark on buttons and icons.</p>
5
+
6
+ <el-card>
7
+ <template #header> Basic usage </template>
8
+ <div class="flex flex-col gap-4">
9
+ <p>Displays the amount of new messages. Add <el-text tag="mark">type</el-text> to colorize it. The amount is defined with value which accepts Number or String.</p>
10
+ <div class="flex gap-7.5">
11
+ <el-badge v-for="color of colors" :key="color" :value="12" :type="color">
12
+ <el-button size="small">{{ color }}</el-button>
13
+ </el-badge>
14
+ </div>
15
+ </div>
16
+ <template #footer> <html-encode :tag="snippets.basic" /> </template>
17
+ </el-card>
18
+
19
+ <el-card>
20
+ <template #header> Max Value </template>
21
+ <div class="flex flex-col gap-4">
22
+ <p>
23
+ You can customize the <el-text tag="mark">max</el-text> value. The max value is defined by property max which is a Number. Note that it only works when value is also a
24
+ Number.
25
+ </p>
26
+ <div class="flex gap-7.5">
27
+ <el-badge :value="200" :max="99" class="item">
28
+ <el-button>comments</el-button>
29
+ </el-badge>
30
+ <el-badge :value="100" :max="10" class="item">
31
+ <el-button>replies</el-button>
32
+ </el-badge>
33
+ </div>
34
+ </div>
35
+ <template #footer> <html-encode :tag="snippets.max" /> </template>
36
+ </el-card>
37
+
38
+ <el-card>
39
+ <template #header> Red Dot </template>
40
+ <div class="flex flex-col gap-4">
41
+ <p>Use a red dot to mark content that needs to be noticed. Use the attribute <el-text tag="mark">is-dot</el-text>. It is a Boolean.</p>
42
+ <div class="flex gap-7.5">
43
+ <el-badge is-dot class="item">query</el-badge>
44
+ <el-badge is-dot class="item">
45
+ <el-button class="share-button" :icon="ElIconShare" type="primary" />
46
+ </el-badge>
47
+ </div>
48
+ </div>
49
+
50
+ <template #footer> <html-encode :tag="snippets.dot" /> </template>
51
+ </el-card>
52
+
53
+ <el-card>
54
+ <template #header> Offset </template>
55
+ <div class="flex flex-col gap-3">
56
+ <p>
57
+ Set <el-text tag="mark">offset</el-text> of the badge dot, the format is <el-text tag="mark">[left, top]</el-text>, which represents the offset of the status dot from the
58
+ left and top of the default position.
59
+ </p>
60
+ <div class="flex gap-4">
61
+ <el-badge class="item" :value="1" :offset="[10, 5]">
62
+ <el-button> offset</el-button>
63
+ </el-badge>
64
+ </div>
65
+ </div>
66
+ <template #footer> <html-encode :tag="snippets.offset" /> </template>
67
+ </el-card>
68
+ </div>
69
+ </template>
70
+
71
+ <script lang="ts" setup>
72
+ import { ref } from 'vue';
73
+
74
+ const colors = ref(['default', 'primary', 'secondary', 'neutral', 'success', 'warning', 'info', 'danger']);
75
+ const snippets = ref({
76
+ basic: `
77
+ <el-badge :value="12" type="primary">
78
+ <el-button>comments</el-button>
79
+ </el-badge>
80
+ `,
81
+ max: `
82
+ <el-badge :value="200" :max="99" class="item">
83
+ <el-button>comments</el-button>
84
+ </el-badge>
85
+ `,
86
+ dot: `<el-badge is-dot class="item">query</el-badge>`,
87
+ offset: `
88
+ <el-badge class="item" :value="1" :offset="[10, 5]">
89
+ <el-button> offset</el-button>
90
+ </el-badge>
91
+ `,
92
+ });
93
+ </script>
@@ -0,0 +1,54 @@
1
+ <template>
2
+ <div class="flex flex-col gap-8 mb-16">
3
+ <h1 class="">Breadcrumb</h1>
4
+ <p>Display prompt information for mouse hover.</p>
5
+
6
+ <el-card>
7
+ <template #header> Basic usage </template>
8
+ <section class="flex flex-col gap-7.5">
9
+ <p>Add the <el-text tag="mark">timus-breadcrumb</el-text> component to the desired place. It will automatically grab the path and convert it into a breadcrumb.</p>
10
+ <timus-breadcrumb :paths="sample_path" />
11
+ </section>
12
+ <template #footer>
13
+ <div class="flex flex-col gap-7.5">
14
+ <html-encode :tag="snippets.basic" />
15
+ <div class="flex flex-col gap-3">
16
+ <h3>Usage On Tabbed Page Example:</h3>
17
+ <p class="p-medium">
18
+ This code will automatically redirect to the first tab, and the page will have a query parameter like
19
+ <span class="comment">http://localhost:3000/about?tab=alert</span>. Additionally, if another tab's name is manually provided in the URL, that tab will be selected by
20
+ default.
21
+ </p>
22
+ <html-encode :tag="snippets.composable" />
23
+ </div>
24
+ </div>
25
+ </template>
26
+ </el-card>
27
+ </div>
28
+ </template>
29
+
30
+ <script lang="ts" setup>
31
+ import { ref } from 'vue';
32
+
33
+ const sample_path = ref([{ regex: /^\/about$/, label: 'header.about.text' }]);
34
+ const snippets = ref({
35
+ basic: `<timus-breadcrumb :paths="[ { regex: /^\/about$/, label: 'header.about.text' } ]" />`,
36
+ composable: `
37
+ <template>
38
+ <el-tabs v-model="activeTab" @tab-click="tabChanged">
39
+ <el-tab-pane label="Alert" name="alert" lazy><example-alert /></el-tab-pane>
40
+ <el-tab-pane label="Avatar" name="avatar" lazy><example-avatar /></el-tab-pane>
41
+ </el-tabs>
42
+ </template>
43
+
44
+ <script setup lang="ts">
45
+ const { activeTab, tabChanged, setActiveTab, setupBreadcrumbs } = useBreadcrumb();
46
+ const tabs = ['avatar', 'alert'];
47
+
48
+ onMounted(() => {
49
+ setupBreadcrumbs(tabs);
50
+ });
51
+ <\/script>
52
+ `,
53
+ });
54
+ </script>