uisv 0.0.4 → 0.0.5

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 (39) hide show
  1. package/dist/components/alert.svelte +274 -0
  2. package/dist/components/alert.svelte.d.ts +24 -0
  3. package/dist/components/badge.svelte +227 -0
  4. package/dist/components/badge.svelte.d.ts +19 -0
  5. package/dist/components/banner.svelte +257 -0
  6. package/dist/components/banner.svelte.d.ts +24 -0
  7. package/dist/components/button.svelte +380 -0
  8. package/dist/components/button.svelte.d.ts +50 -0
  9. package/dist/components/card.svelte +70 -0
  10. package/dist/components/card.svelte.d.ts +17 -0
  11. package/dist/components/checkbox.svelte +176 -0
  12. package/dist/components/checkbox.svelte.d.ts +27 -0
  13. package/dist/components/checkboxgroup.svelte +260 -0
  14. package/dist/components/checkboxgroup.svelte.d.ts +26 -0
  15. package/dist/components/chip.svelte +82 -0
  16. package/dist/components/chip.svelte.d.ts +17 -0
  17. package/dist/components/index.d.ts +22 -0
  18. package/dist/components/index.js +22 -0
  19. package/dist/components/placeholder.svelte +32 -0
  20. package/dist/components/placeholder.svelte.d.ts +7 -0
  21. package/dist/components/progress.svelte +124 -0
  22. package/dist/components/progress.svelte.d.ts +21 -0
  23. package/dist/components/slider.svelte +172 -0
  24. package/dist/components/slider.svelte.d.ts +44 -0
  25. package/dist/components/switch.svelte +180 -0
  26. package/dist/components/switch.svelte.d.ts +27 -0
  27. package/dist/index.d.ts +2 -0
  28. package/dist/index.js +2 -0
  29. package/dist/types.d.ts +7 -0
  30. package/dist/types.js +1 -0
  31. package/dist/utils/common.d.ts +14 -0
  32. package/dist/utils/common.js +18 -0
  33. package/dist/utils/keys.d.ts +8 -0
  34. package/dist/utils/keys.js +8 -0
  35. package/dist/utils/types.d.ts +1 -0
  36. package/dist/utils/types.js +1 -0
  37. package/dist/vite.d.ts +38 -0
  38. package/dist/vite.js +57 -0
  39. package/package.json +1 -1
@@ -0,0 +1,8 @@
1
+ export declare const FORM_OPTION_CONTEXT_KEY: unique symbol;
2
+ export declare const FORM_BUS_CONTEXT_KEY: unique symbol;
3
+ export declare const FORM_STATE_CONTEXT_KEY: unique symbol;
4
+ export declare const FORM_FIELD_CONTEXT_KEY: unique symbol;
5
+ export declare const FORM_TID_CONTEXT_KEY: unique symbol;
6
+ export declare const FORM_INPUTS_CONTEXT_KEY: unique symbol;
7
+ export declare const FORM_LOADING_CONTEXT_KEY: unique symbol;
8
+ export declare const FORM_ERRORS_CONTEXT_KEY: unique symbol;
@@ -0,0 +1,8 @@
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');
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ "use strict";
package/dist/vite.d.ts ADDED
@@ -0,0 +1,38 @@
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 ADDED
@@ -0,0 +1,57 @@
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(options) {
8
+ const _opts = defu(options, {
9
+ colors: {
10
+ primary: 'orange',
11
+ secondary: 'neutral',
12
+ info: 'blue',
13
+ success: 'green',
14
+ warning: 'yellow',
15
+ error: 'red'
16
+ },
17
+ fonts: {
18
+ fonts: {
19
+ sans: 'Public Sans:400,500,600'
20
+ }
21
+ }
22
+ });
23
+ return [
24
+ uno_plugin({
25
+ theme: {
26
+ radius: {
27
+ base: `${_opts.radius || 0.25}rem`
28
+ }
29
+ },
30
+ preflights: [
31
+ {
32
+ getCSS: () => 'body { font-size: var(--font-sans);}'
33
+ }
34
+ ],
35
+ presets: [
36
+ presetWind4({
37
+ preflights: {
38
+ reset: true
39
+ }
40
+ }),
41
+ presetWebFonts(_opts.fonts),
42
+ presetIcons()
43
+ ],
44
+ transformers: [transformerVariantGroup(), transformerCompileClass(), transformerDirectives()],
45
+ extendTheme: (theme) => {
46
+ for (const [color, value] of Object.entries(_opts.colors)) {
47
+ if (typeof value !== 'string') {
48
+ theme.colors[color] = value;
49
+ continue;
50
+ }
51
+ const in_theme = theme.colors[value];
52
+ theme.colors[color] = in_theme ? in_theme : getColors(value);
53
+ }
54
+ }
55
+ })
56
+ ];
57
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uisv",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "ui library for the rest of us",
5
5
  "license": "MIT",
6
6
  "repository": "ui-sv/uisv",