@fastkit/vui 0.12.8 → 0.12.9

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 (108) hide show
  1. package/LICENSE +1 -1
  2. package/dist/vui.css +2786 -2716
  3. package/dist/vui.css.map +1 -0
  4. package/dist/vui.d.ts +9072 -10172
  5. package/dist/vui.mjs +2141 -1969
  6. package/dist/vui.mjs.map +1 -0
  7. package/package.json +89 -59
  8. package/src/components/VApp/VApp.tsx +3 -1
  9. package/src/components/VAvatar/VAvatar.scss +62 -60
  10. package/src/components/VAvatar/VAvatar.tsx +6 -1
  11. package/src/components/VBreadcrumbs/VBreadcrumbs.scss +53 -51
  12. package/src/components/VBusyImage/VBusyImage.scss +50 -51
  13. package/src/components/VButton/VButton.scss +120 -118
  14. package/src/components/VButton/VButton.tsx +6 -1
  15. package/src/components/VButton/VButtonGroup.scss +21 -19
  16. package/src/components/VCard/VCard.scss +41 -42
  17. package/src/components/VCard/VCard.tsx +5 -0
  18. package/src/components/VCard/VCardActions.scss +9 -7
  19. package/src/components/VCard/VCardContent.scss +4 -2
  20. package/src/components/VCheckable/VCheckable.scss +79 -80
  21. package/src/components/VCheckable/VCheckable.tsx +1 -1
  22. package/src/components/VCheckbox/VCheckbox.scss +50 -48
  23. package/src/components/VCheckbox/VCheckbox.tsx +2 -2
  24. package/src/components/VChip/VChip.scss +61 -59
  25. package/src/components/VChip/VChip.tsx +6 -1
  26. package/src/components/VContentSwitcher/VContentSwitcher.scss +52 -50
  27. package/src/components/VControlField/VControlField.scss +148 -146
  28. package/src/components/VControlField/VControlField.tsx +3 -3
  29. package/src/components/VDataTable/VDataTable.scss +167 -168
  30. package/src/components/VDrawerLayout/VDrawerLayout.scss +27 -25
  31. package/src/components/VForm/VForm.tsx +3 -4
  32. package/src/components/VFormControl/VFormControl.scss +84 -82
  33. package/src/components/VFormControl/VFormControl.tsx +2 -3
  34. package/src/components/VGrid/VGridContainer.scss +5 -3
  35. package/src/components/VGrid/VGridItem.scss +4 -2
  36. package/src/components/VHero/VHero.scss +23 -21
  37. package/src/components/VIcon/VIcon.scss +19 -17
  38. package/src/components/VListTile/VListTile.scss +60 -58
  39. package/src/components/VListTile/VListTile.tsx +5 -0
  40. package/src/components/VNavigation/VNavigation.scss +12 -10
  41. package/src/components/VNavigation/VNavigationItem.scss +21 -19
  42. package/src/components/VNavigation/VNavigationItem.tsx +5 -0
  43. package/src/components/VOption/VOption.scss +55 -56
  44. package/src/components/VOption/VOption.tsx +2 -2
  45. package/src/components/VOptionGroup/VOptionGroup.scss +14 -12
  46. package/src/components/VOptionGroup/VOptionGroup.tsx +3 -1
  47. package/src/components/VPagination/VPagination.scss +81 -79
  48. package/src/components/VPagination/VPagination.tsx +1 -1
  49. package/src/components/VPaper/VPaper.scss +43 -41
  50. package/src/components/VRadio/VRadio.scss +52 -53
  51. package/src/components/VRadio/VRadio.tsx +2 -2
  52. package/src/components/VSelect/VSelect.scss +77 -75
  53. package/src/components/VSelect/VSelect.tsx +5 -2
  54. package/src/components/VSkeltonLoader/VSkeltonLoaderBone.scss +24 -22
  55. package/src/components/VSwitch/VSwitch.scss +96 -94
  56. package/src/components/VSwitch/VSwitch.tsx +2 -2
  57. package/src/components/VTabs/VTab.scss +59 -57
  58. package/src/components/VTabs/VTabs.scss +41 -39
  59. package/src/components/VTabs/VTabs.tsx +5 -2
  60. package/src/components/VTextCounter/VTextCounter.scss +4 -2
  61. package/src/components/VTextField/VTextField.scss +37 -35
  62. package/src/components/VTextField/VTextField.tsx +2 -2
  63. package/src/components/VTextarea/VTextarea.scss +33 -31
  64. package/src/components/VTextarea/VTextarea.tsx +2 -2
  65. package/src/components/VToolbar/VToolbar.scss +19 -17
  66. package/src/components/VToolbar/VToolbarEdge.scss +21 -19
  67. package/src/components/VToolbar/VToolbarMenu.scss +6 -4
  68. package/src/components/VToolbar/VToolbarMenu.tsx +5 -0
  69. package/src/components/VToolbar/VToolbarTitle.scss +19 -17
  70. package/src/components/VWysiwygEditor/VWysiwygEditor.scss +52 -50
  71. package/src/components/VWysiwygEditor/VWysiwygEditor.tsx +2 -2
  72. package/src/components/VWysiwygEditor/extensions/linter/Linter.scss +108 -109
  73. package/src/components/VWysiwygEditor/schemes.ts +1 -1
  74. package/src/components/VWysiwygEditor/tools/color.scss +106 -112
  75. package/src/components/kits.ts +1 -1
  76. package/src/composables/control.ts +1 -1
  77. package/src/composables/form-selector.scss +20 -18
  78. package/src/composables/form-selector.tsx +5 -3
  79. package/src/index.ts +13 -2
  80. package/src/plugin.tsx +4 -4
  81. package/src/schemes/control.ts +2 -2
  82. package/src/service.tsx +5 -5
  83. package/src/styles/core/functions.scss +2 -2
  84. package/src/styles/index.scss +23 -9
  85. package/dist/tool/index.d.ts +0 -2
  86. package/dist/tool/index.d.ts.map +0 -1
  87. package/dist/tool/index.mjs +0 -193
  88. package/dist/tool/vite-plugin.d.ts +0 -25
  89. package/dist/tool/vite-plugin.d.ts.map +0 -1
  90. package/src/.DS_Store +0 -0
  91. package/src/assets/builtins/color-scheme.ts +0 -9
  92. package/src/assets/builtins/media-match.ts +0 -3
  93. package/src/components/.DS_Store +0 -0
  94. package/src/components/VAvatar/.DS_Store +0 -0
  95. package/src/components/VChip/.DS_Store +0 -0
  96. package/src/components/VSkeltonLoader/.DS_Store +0 -0
  97. package/src/components/VTextField/.DS_Store +0 -0
  98. package/src/components/VWysiwygEditor/.DS_Store +0 -0
  99. package/src/components/VWysiwygEditor/extensions/.DS_Store +0 -0
  100. package/src/components/VWysiwygEditor/extensions/linter/.DS_Store +0 -0
  101. package/src/tool/index.ts +0 -2
  102. package/src/tool/vite-plugin.ts +0 -266
  103. /package/{src/styles → dist}/after-effects/display-flow.scss +0 -0
  104. /package/{src/styles → dist}/after-effects/spacing.scss +0 -0
  105. /package/{src/styles → dist}/after-effects/text.scss +0 -0
  106. /package/{src/styles → dist}/after-effects.scss +0 -0
  107. /package/dist/{assets/builtins → builtins}/color-scheme.ts +0 -0
  108. /package/dist/{assets/builtins → builtins}/media-match.ts +0 -0
@@ -1,25 +0,0 @@
1
- import { Plugin } from 'vite';
2
- import { RawIconFontEntry, IconFontSettings } from '@fastkit/icon-font-gen';
3
- import { VuiServiceOptions } from '../service';
4
- export interface ViteVuiPluginOptions extends Partial<Pick<VuiServiceOptions, 'uiSettings' | 'icons'>> {
5
- dynamicDest?: string;
6
- colorScheme?: string;
7
- mediaMatch?: string;
8
- iconFont?: RawIconFontEntry[];
9
- iconFontDefaults?: IconFontSettings;
10
- onBooted?: (() => any) | (() => Promise<any>);
11
- onBootError?: ((err: unknown) => any) | ((err: unknown) => Promise<any>);
12
- __dev?: boolean;
13
- }
14
- export interface ViteVuiPluginResultSettings extends Pick<VuiServiceOptions, 'uiSettings' | 'icons'> {
15
- colorScheme: string;
16
- mediaMatch: string;
17
- __dev?: boolean;
18
- }
19
- export interface ViteVuiPluginResult {
20
- settings: ViteVuiPluginResultSettings;
21
- plugins: (Plugin | Plugin[])[];
22
- dest: string;
23
- }
24
- export declare function viteVuiPlugin(options?: ViteVuiPluginOptions): ViteVuiPluginResult;
25
- //# sourceMappingURL=vite-plugin.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vite-plugin.d.ts","sourceRoot":"","sources":["../../../../../../../packages/vui/src/tool/vite-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAK9B,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAmF/C,MAAM,WAAW,oBACf,SAAQ,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,YAAY,GAAG,OAAO,CAAC,CAAC;IAChE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC9B,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,QAAQ,CAAC,EAAE,CAAC,MAAM,GAAG,CAAC,GAAG,CAAC,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9C,WAAW,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,OAAO,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;IACzE,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,2BACf,SAAQ,IAAI,CAAC,iBAAiB,EAAE,YAAY,GAAG,OAAO,CAAC;IACvD,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,2BAA2B,CAAC;IACtC,OAAO,EAAE,CAAC,MAAM,GAAG,MAAM,EAAE,CAAC,EAAE,CAAC;IAC/B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,aAAa,CAC3B,OAAO,GAAE,oBAAyB,GACjC,mBAAmB,CAqJrB"}
package/src/.DS_Store DELETED
Binary file
@@ -1,9 +0,0 @@
1
- import { createSimpleColorScheme } from '@fastkit/color-scheme-gen';
2
-
3
- const scheme = createSimpleColorScheme({
4
- // primary: '#28bebd',
5
- // secondary: '#484d55',
6
- // default: '#2f495e',
7
- });
8
-
9
- export default scheme;
@@ -1,3 +0,0 @@
1
- import { createRecommendedSettings } from '@fastkit/media-match-gen';
2
-
3
- export default createRecommendedSettings();
Binary file
Binary file
Binary file
Binary file
package/src/tool/index.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from './vite-plugin';
2
- // export * from './nuxt-module';
@@ -1,266 +0,0 @@
1
- import { Plugin } from 'vite';
2
- import { dynamicSrcVitePlugin } from '@fastkit/vite-kit';
3
- import path from 'node:path';
4
- import fs from 'fs-extra';
5
- import { findPackageDirSync, getDirname } from '@fastkit/node-util';
6
- import { RawIconFontEntry, IconFontSettings } from '@fastkit/icon-font-gen';
7
- import { VuiServiceOptions } from '../service';
8
- import { render } from 'eta';
9
- import { VuiError } from '../logger';
10
-
11
- const VUI_PACKAGE_DIR = path.resolve(getDirname(import.meta.url), '../..');
12
- const STYLE_AFTER_EFFECTS_PATH = path.join(
13
- VUI_PACKAGE_DIR,
14
- 'src/styles/after-effects.scss',
15
- );
16
-
17
- const COLOR_DUMP_STYLE = `@include dump-color-scheme(true);`;
18
-
19
- const TEMPLATE = `
20
- /* eslint-disable */
21
- // @ts-nocheck
22
- <% if (!it.__dev) { %>
23
- import '@fastkit/vue-stack/vue-stack.css';
24
- import '@fastkit/vue-app-layout/vue-app-layout.css';
25
- import '@fastkit/vue-loading/vue-loading.css';
26
- import '@fastkit/vue-scroller/vue-scroller.css';
27
- import '@fastkit/vui/vui.css';
28
- <% } %>
29
- import './setup.scss';
30
- import type { App } from 'vue';
31
- import type { Router } from 'vue-router';
32
- import { VPageLink } from '@fastkit/vue-page';
33
- import { installVuiPlugin as _installVuiPlugin, RawVuiPluginOptions, mergeVuiPluginOptions } from '@fastkit/vui';
34
- import { colorScheme } from '<%~ it.colorScheme %>';
35
- import '<%~ it.mediaMatch %>';
36
- import './icon-font';
37
- import '${STYLE_AFTER_EFFECTS_PATH}';
38
-
39
- export function installVui(settings: { app: App, router: Router }, options?: RawVuiPluginOptions) {
40
- const merged = mergeVuiPluginOptions({
41
- RouterLink: VPageLink,
42
- colorScheme,
43
- uiSettings: <%~ it.uiSettings %>,
44
- icons: <%~ it.icons %>,
45
- ...settings,
46
- }, options);
47
- _installVuiPlugin(settings.app, merged);
48
- }
49
-
50
- export default installVui;
51
- `.trim();
52
-
53
- async function renderTemplate({
54
- colorScheme,
55
- mediaMatch,
56
- uiSettings,
57
- icons,
58
- __dev,
59
- }: ViteVuiPluginResultSettings) {
60
- const result = await render(
61
- TEMPLATE,
62
- {
63
- colorScheme,
64
- mediaMatch,
65
- uiSettings: JSON.stringify(uiSettings),
66
- icons: JSON.stringify(icons),
67
- __dev,
68
- },
69
- { async: true },
70
- );
71
- if (!result) {
72
- throw new VuiError('template render error.');
73
- }
74
- return result;
75
- }
76
-
77
- function defaultDynamicDest() {
78
- return path.resolve('.vui');
79
- }
80
-
81
- function getBuiltinsDir() {
82
- const pkgDir = findPackageDirSync(undefined, true);
83
- if (!pkgDir) {
84
- throw new Error(`missing package directory`);
85
- }
86
-
87
- return path.join(pkgDir, 'node_modules/@fastkit/vui/dist/assets/builtins');
88
- }
89
-
90
- export interface ViteVuiPluginOptions
91
- extends Partial<Pick<VuiServiceOptions, 'uiSettings' | 'icons'>> {
92
- dynamicDest?: string;
93
- colorScheme?: string;
94
- mediaMatch?: string;
95
- iconFont?: RawIconFontEntry[];
96
- iconFontDefaults?: IconFontSettings;
97
- onBooted?: (() => any) | (() => Promise<any>);
98
- onBootError?: ((err: unknown) => any) | ((err: unknown) => Promise<any>);
99
- __dev?: boolean;
100
- }
101
-
102
- export interface ViteVuiPluginResultSettings
103
- extends Pick<VuiServiceOptions, 'uiSettings' | 'icons'> {
104
- colorScheme: string;
105
- mediaMatch: string;
106
- __dev?: boolean;
107
- }
108
-
109
- export interface ViteVuiPluginResult {
110
- settings: ViteVuiPluginResultSettings;
111
- plugins: (Plugin | Plugin[])[];
112
- dest: string;
113
- }
114
-
115
- export function viteVuiPlugin(
116
- options: ViteVuiPluginOptions = {},
117
- ): ViteVuiPluginResult {
118
- const plugins: (Plugin | Plugin[])[] = [];
119
-
120
- const builtinsDir = getBuiltinsDir();
121
- const {
122
- colorScheme = path.join(builtinsDir, 'color-scheme'),
123
- mediaMatch = path.join(builtinsDir, 'media-match'),
124
- iconFont,
125
- iconFontDefaults,
126
- onBooted,
127
- onBootError,
128
- uiSettings = {
129
- primaryScope: 'primary' as any,
130
- plainVariant: 'plain' as any,
131
- containedVariant: 'contained' as any,
132
- warningScope: 'warning' as any,
133
- errorScope: 'error' as any,
134
- buttonDefault: {
135
- color: 'base' as any,
136
- variant: 'contained' as any,
137
- },
138
- tabDefault: {
139
- color: 'accent' as any,
140
- },
141
- dialogOk: {
142
- color: 'primary' as any,
143
- },
144
- },
145
- icons = {
146
- menuDown: 'mdi-menu-down' as any,
147
- navigationExpand: 'mdi-menu-down' as any,
148
- prev: 'mdi-chevron-left' as any,
149
- next: 'mdi-chevron-right' as any,
150
- sort: 'mdi-chevron-down' as any,
151
- editorTextColor: 'mdi-format-color-text' as any,
152
- editorformatBold: 'mdi-format-bold' as any,
153
- editorformatUnderline: 'mdi-format-underline' as any,
154
- editorformatItalic: 'mdi-format-italic' as any,
155
- editorformatListBulleted: 'mdi-format-list-bulleted' as any,
156
- editorformatListNumbered: 'mdi-format-list-numbered' as any,
157
- editorLink: 'mdi-link' as any,
158
- editorLinkOff: 'mdi-link-off' as any,
159
- editorUndo: 'mdi-undo-variant' as any,
160
- editorRedo: 'mdi-redo-variant' as any,
161
- hinttip: 'mdi-help-circle-outline' as any,
162
- clear: 'mdi-close' as any,
163
- reload: 'mdi-reload' as any,
164
- // navigationExpand: (gen, active) => {
165
- // return gen({
166
- // name: 'mdi-menu-down' as any,
167
- // rotate: active ? 180 : 0,
168
- // });
169
- // },
170
- ...options.icons,
171
- } as VuiServiceOptions['icons'],
172
- __dev,
173
- } = options;
174
-
175
- let dynamicDest: string;
176
-
177
- const { dynamicDest: _dynamicDest } = options;
178
-
179
- if (!_dynamicDest) {
180
- dynamicDest = defaultDynamicDest();
181
- } else {
182
- dynamicDest = _dynamicDest;
183
- }
184
-
185
- const colorSchemeSrc = path.resolve(colorScheme);
186
- const colorSchemeDest = path.join(dynamicDest, 'color-scheme');
187
- const mediaMatchDest = path.join(dynamicDest, 'media-match');
188
- const dts = `
189
- /// <reference path="./color-scheme/color-scheme.info.ts" />
190
- /// <reference path="./icon-font/index.ts" />
191
- /// <reference path="./media-match/media-match.ts" />
192
- export {};
193
- `.trim();
194
-
195
- fs.ensureDirSync(dynamicDest);
196
- fs.writeFileSync(path.join(dynamicDest, 'setup.scss'), COLOR_DUMP_STYLE);
197
- fs.writeFileSync(path.join(dynamicDest, 'vui.d.ts'), dts);
198
-
199
- let iconFontEntries: RawIconFontEntry[] = iconFont || [
200
- {
201
- src: '@mdi',
202
- },
203
- ];
204
-
205
- if (iconFontDefaults) {
206
- iconFontEntries = iconFontEntries.map((entry) => {
207
- return {
208
- ...iconFontDefaults,
209
- ...entry,
210
- };
211
- });
212
- }
213
-
214
- plugins.push(
215
- dynamicSrcVitePlugin({
216
- colorScheme: {
217
- src: colorSchemeSrc,
218
- dest: colorSchemeDest,
219
- },
220
- mediaMatch: {
221
- src: path.resolve(mediaMatch),
222
- dest: mediaMatchDest,
223
- },
224
- iconFont: {
225
- entries: iconFontEntries,
226
- dest: path.join(dynamicDest, 'icon-font'),
227
- },
228
- onBooted,
229
- onBootError,
230
- }),
231
- );
232
-
233
- const plugin: Plugin = {
234
- name: 'vite:vui',
235
- enforce: 'pre',
236
- async config(config) {
237
- await fs.writeFile(
238
- path.join(dynamicDest, 'installer.ts'),
239
- await renderTemplate(settings),
240
- );
241
-
242
- const ssr = (config as any).ssr || {};
243
- ssr.noExternal = ssr.noExternal || [];
244
- ssr.noExternal.push(/\/vui\/dist\/assets\//);
245
-
246
- (config as any).ssr = ssr;
247
- return config;
248
- },
249
- };
250
-
251
- plugins.push(plugin);
252
-
253
- const settings = {
254
- colorScheme: path.join(colorSchemeDest, 'color-scheme.info'),
255
- mediaMatch: path.join(mediaMatchDest, 'media-match'),
256
- uiSettings,
257
- icons,
258
- __dev,
259
- };
260
-
261
- return {
262
- plugins,
263
- dest: dynamicDest,
264
- settings,
265
- };
266
- }
File without changes
File without changes
File without changes