uisv 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +0,0 @@
1
- export const FORM_OPTION_CONTEXT_KEY = Symbol('uisv.form-options');
2
- export const FORM_BUS_CONTEXT_KEY = Symbol('uisv.form-events');
3
- export const FORM_STATE_CONTEXT_KEY = Symbol('uisv.form-state');
4
- export const FORM_FIELD_CONTEXT_KEY = Symbol('uisv.form-field');
5
- export const FORM_TID_CONTEXT_KEY = Symbol('uisv.input-id');
6
- export const FORM_INPUTS_CONTEXT_KEY = Symbol('uisv.form-inputs');
7
- export const FORM_LOADING_CONTEXT_KEY = Symbol('uisv.form-loading');
8
- export const FORM_ERRORS_CONTEXT_KEY = Symbol('uisv.form-errors');
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- "use strict";
package/dist/vite.d.ts DELETED
@@ -1,38 +0,0 @@
1
- import { type WebFontsOptions } from '@unocss/preset-web-fonts';
2
- import type { PropColor } from './types.js';
3
- export type PluginOptions = {
4
- /**
5
- * Colors as UnoCSS color name, hex color, or UnoCSS theme color object
6
- * @example
7
- * {
8
- * primary: 'orange',
9
- * secondary: 'neutral',
10
- * info: '#00F',
11
- * success: '#0F0',
12
- * warning: 'FF0',
13
- * error: {
14
- * 50: '#fef2f2';
15
- * 100: '#fee2e2';
16
- * 200: '#fecaca';
17
- * 300: '#fca5a5';
18
- * 400: '#f87171';
19
- * 500: '#ef4444';
20
- * 600: '#dc2626';
21
- * 700: '#b91c1c';
22
- * 800: '#991b1b';
23
- * 900: '#7f1d1d';
24
- * 950: '#450a0a';
25
- * }
26
- * }
27
- */
28
- colors?: Partial<Record<PropColor, string | Record<number, string>>>;
29
- /**
30
- * Options for the UnoCSS web fonts plugin
31
- */
32
- fonts?: WebFontsOptions;
33
- /**
34
- * Corner radius for every* component
35
- */
36
- radius?: number;
37
- };
38
- export declare function uisv(options: Required<PluginOptions>): import("vite").Plugin<any>[];
package/dist/vite.js DELETED
@@ -1,85 +0,0 @@
1
- import uno_plugin from 'unocss/vite';
2
- import { transformerVariantGroup, transformerCompileClass, transformerDirectives, presetWind4, presetWebFonts } from 'unocss';
3
- import {} from '@unocss/preset-web-fonts';
4
- import { presetIcons } from 'unocss';
5
- import { defu } from 'defu';
6
- import { getColors } from 'theme-colors';
7
- // export function uisv(opts: PluginOptions = {}) {
8
- // const _opts: PluginOptions = defu(opts, {
9
- // primary: 'orange',
10
- // neutral: 'neutral',
11
- // unocss: true,
12
- // transitions: true
13
- // } as PluginOptions);
14
- // const uisv_plugin: Plugin = {
15
- // name: 'vite-plugin-uisv',
16
- // enforce: 'pre',
17
- // async load(id) {
18
- // if (id === '$theme/button') {
19
- // return `export default ${JSON.stringify(useButtonTheme(_opts))}`;
20
- // }
21
- // },
22
- // resolveId(source) {
23
- // if (source.startsWith('$theme')) return source;
24
- // }
25
- // };
26
- // return [
27
- // uisv_plugin,
28
- // _opts.unocss! &&
29
- // unocss({
30
- // presets: [preset_wind3, presetWebFonts(_opts.fonts)],
31
- // transformers: [
32
- // transformerVariantGroup(),
33
- // transformerCompileClass(),
34
- // transformerDirectives()
35
- // ],
36
- // extendTheme: (theme, config) => {
37
- // console.log(theme, config);
38
- // }
39
- // })
40
- // ];
41
- // }
42
- export function uisv(options) {
43
- const _opts = defu(options, {
44
- colors: {
45
- primary: 'orange',
46
- secondary: 'neutral',
47
- info: 'blue',
48
- success: 'green',
49
- warning: 'yellow',
50
- error: 'red'
51
- },
52
- fonts: {
53
- fonts: {
54
- sans: 'Public Sans:400,500,600'
55
- }
56
- }
57
- });
58
- return uno_plugin({
59
- theme: {
60
- radius: {
61
- base: `${_opts.radius || 0.25}rem`
62
- }
63
- },
64
- presets: [
65
- presetWind4({
66
- preflights: {
67
- reset: true
68
- }
69
- }),
70
- presetWebFonts(_opts.fonts),
71
- presetIcons()
72
- ],
73
- transformers: [transformerVariantGroup(), transformerCompileClass(), transformerDirectives()],
74
- extendTheme: (theme) => {
75
- for (const [color, value] of Object.entries(_opts.colors)) {
76
- if (typeof value !== 'string') {
77
- theme.colors[color] = value;
78
- continue;
79
- }
80
- const in_theme = theme.colors[value];
81
- theme.colors[color] = in_theme ? in_theme : getColors(value);
82
- }
83
- }
84
- });
85
- }