uisv 0.0.12 → 0.0.13

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 (75) hide show
  1. package/dist/components/accordion.svelte +108 -0
  2. package/dist/components/accordion.svelte.d.ts +58 -0
  3. package/dist/components/alert.svelte +271 -0
  4. package/dist/components/alert.svelte.d.ts +23 -0
  5. package/dist/components/badge.svelte +225 -0
  6. package/dist/components/badge.svelte.d.ts +19 -0
  7. package/dist/components/banner.svelte +254 -0
  8. package/dist/components/banner.svelte.d.ts +23 -0
  9. package/dist/components/button/button.svelte +105 -0
  10. package/dist/components/button/button.svelte.d.ts +4 -0
  11. package/dist/components/button/index.d.ts +48 -0
  12. package/dist/components/button/index.js +4 -0
  13. package/dist/components/button/style.d.ts +148 -0
  14. package/dist/components/button/style.js +248 -0
  15. package/dist/components/card.svelte +70 -0
  16. package/dist/components/card.svelte.d.ts +17 -0
  17. package/dist/components/checkbox-group.svelte +258 -0
  18. package/dist/components/checkbox-group.svelte.d.ts +26 -0
  19. package/dist/components/checkbox.svelte +175 -0
  20. package/dist/components/checkbox.svelte.d.ts +27 -0
  21. package/dist/components/chip.svelte +82 -0
  22. package/dist/components/chip.svelte.d.ts +17 -0
  23. package/dist/components/color-picker.svelte +48 -0
  24. package/dist/components/color-picker.svelte.d.ts +10 -0
  25. package/dist/components/h1.svelte +15 -0
  26. package/dist/components/h1.svelte.d.ts +3 -0
  27. package/dist/components/h2.svelte +19 -0
  28. package/dist/components/h2.svelte.d.ts +3 -0
  29. package/dist/components/h3.svelte +16 -0
  30. package/dist/components/h3.svelte.d.ts +3 -0
  31. package/dist/components/h4.svelte +19 -0
  32. package/dist/components/h4.svelte.d.ts +3 -0
  33. package/dist/components/h5.svelte +19 -0
  34. package/dist/components/h5.svelte.d.ts +3 -0
  35. package/dist/components/h6.svelte +19 -0
  36. package/dist/components/h6.svelte.d.ts +3 -0
  37. package/dist/components/index.d.ts +42 -0
  38. package/dist/components/index.js +42 -0
  39. package/dist/components/input/index.d.ts +54 -0
  40. package/dist/components/input/index.js +2 -0
  41. package/dist/components/input/input.svelte +103 -0
  42. package/dist/components/input/input.svelte.d.ts +4 -0
  43. package/dist/components/input/style.d.ts +316 -0
  44. package/dist/components/input/style.js +128 -0
  45. package/dist/components/input-time/index.d.ts +375 -0
  46. package/dist/components/input-time/index.js +144 -0
  47. package/dist/components/input-time/input-time.svelte +39 -0
  48. package/dist/components/input-time/input-time.svelte.d.ts +4 -0
  49. package/dist/components/kbd.svelte +239 -0
  50. package/dist/components/kbd.svelte.d.ts +40 -0
  51. package/dist/components/p.svelte +9 -0
  52. package/dist/components/p.svelte.d.ts +3 -0
  53. package/dist/components/pin-input.svelte +162 -0
  54. package/dist/components/pin-input.svelte.d.ts +25 -0
  55. package/dist/components/placeholder.svelte +34 -0
  56. package/dist/components/placeholder.svelte.d.ts +3 -0
  57. package/dist/components/popover.svelte +151 -0
  58. package/dist/components/popover.svelte.d.ts +88 -0
  59. package/dist/components/progress.svelte +124 -0
  60. package/dist/components/progress.svelte.d.ts +21 -0
  61. package/dist/components/select.svelte +171 -0
  62. package/dist/components/select.svelte.d.ts +50 -0
  63. package/dist/components/slider.svelte +172 -0
  64. package/dist/components/slider.svelte.d.ts +44 -0
  65. package/dist/components/switch.svelte +180 -0
  66. package/dist/components/switch.svelte.d.ts +27 -0
  67. package/dist/components/tabs.svelte +246 -0
  68. package/dist/components/tabs.svelte.d.ts +34 -0
  69. package/dist/index.d.ts +4 -0
  70. package/dist/index.js +3 -0
  71. package/dist/utilities.svelte.d.ts +24 -0
  72. package/dist/utilities.svelte.js +47 -0
  73. package/dist/vite.d.ts +51 -0
  74. package/dist/vite.js +157 -0
  75. package/package.json +2 -2
package/dist/vite.js ADDED
@@ -0,0 +1,157 @@
1
+ import uno_plugin from 'unocss/vite';
2
+ import { transformerVariantGroup, transformerCompileClass, transformerDirectives, presetWebFonts, presetIcons, presetWind4, definePreset, } from 'unocss';
3
+ import {} from '@unocss/preset-web-fonts';
4
+ import { defu } from 'defu';
5
+ import { getColors } from 'theme-colors';
6
+ import { presetTheme } from 'unocss-preset-theme';
7
+ import { evaluatePath } from 'doc-path';
8
+ export function uisv(options) {
9
+ const _opts = defu(options, {
10
+ colors: {
11
+ primary: 'orange',
12
+ surface: 'neutral',
13
+ info: 'blue',
14
+ success: 'green',
15
+ warning: 'yellow',
16
+ error: 'red',
17
+ },
18
+ fonts: {
19
+ fonts: {
20
+ sans: 'Public Sans:400,500,600',
21
+ },
22
+ },
23
+ icons: {},
24
+ theme: {
25
+ radius: {
26
+ base: `${options.radius || 0.375}rem`,
27
+ },
28
+ },
29
+ });
30
+ // const semantics_preset = semantics({
31
+ // colors: _opts.colors,
32
+ // light: {
33
+ // base: 'surface.700',
34
+ // dimmed: 'surface.400',
35
+ // muted: 'surface.500',
36
+ // toned: 'surface.600',
37
+ // highlighted: 'surface.900',
38
+ // inverted: 'white',
39
+ // surface: {
40
+ // base: 'white',
41
+ // muted: 'surface.50',
42
+ // elevated: 'surface.100',
43
+ // accented: 'surface.200',
44
+ // inverted: 'surface.900',
45
+ // },
46
+ // },
47
+ // dark: {
48
+ // base: 'surface.700',
49
+ // dimmed: 'surface.400',
50
+ // muted: 'surface.500',
51
+ // toned: 'surface.600',
52
+ // highlighted: 'surface.900',
53
+ // inverted: 'white',
54
+ // surface: {
55
+ // base: 'surface.900',
56
+ // muted: 'surface.800',
57
+ // elevated: 'surface.800',
58
+ // accented: 'surface.700',
59
+ // inverted: 'white',
60
+ // },
61
+ // },
62
+ // });
63
+ return [
64
+ uno_plugin({
65
+ content: {
66
+ pipeline: {
67
+ include: [
68
+ // the default
69
+ /\.(vue|svelte|[jt]sx|vine.ts|mdx?|astro|elm|php|phtml|marko|html)($|\?)/,
70
+ // include js/ts files
71
+ 'src/**/*.{js,ts}',
72
+ ],
73
+ },
74
+ },
75
+ theme: _opts.theme,
76
+ preflights: [
77
+ {
78
+ getCSS({ theme }) {
79
+ if (!('colors' in theme) || typeof theme.colors !== 'object')
80
+ return;
81
+ const colors = theme.colors;
82
+ if (typeof colors.surface !== 'object')
83
+ return '';
84
+ const variables = `
85
+ --colors-DEFAULT: ${colors.surface['200']};
86
+ --colors-dimmed: ${colors.surface['500']};
87
+ --colors-muted: ${colors.surface['400']};
88
+ --colors-toned: ${colors.surface['300']};
89
+ --colors-highlighted: white;
90
+ --colors-inverted: ${colors.surface['900']};
91
+
92
+ --colors-surface-DEFAULT: ${colors.surface['900']};
93
+ --colors-surface-muted: ${colors.surface['800']};
94
+ --colors-surface-elevated: ${colors.surface['800']};
95
+ --colors-surface-accented: ${colors.surface['700']};
96
+ --colors-surface-inverted: white;
97
+ `;
98
+ return `
99
+ body {
100
+ background-color: var(--colors-inverted);
101
+ }
102
+
103
+
104
+
105
+ .dark {
106
+ ${variables}
107
+ }
108
+ `;
109
+ },
110
+ },
111
+ ],
112
+ presets: [
113
+ presetWind4({
114
+ dark: 'media',
115
+ preflights: {
116
+ reset: true,
117
+ },
118
+ }),
119
+ presetWebFonts(_opts.fonts),
120
+ presetIcons(_opts.icons),
121
+ // semantics_preset,
122
+ // theme_preset,
123
+ ],
124
+ transformers: [transformerVariantGroup(), transformerCompileClass(), transformerDirectives()],
125
+ extendTheme: (theme) => {
126
+ if (!('colors' in theme) || typeof theme.colors !== 'object')
127
+ theme.colors = {};
128
+ const colors = theme.colors;
129
+ for (const [color, value] of Object.entries(_opts.colors)) {
130
+ if (typeof value !== 'string') {
131
+ colors[color] = value;
132
+ continue;
133
+ }
134
+ const in_theme = colors[value];
135
+ colors[color] = in_theme ? in_theme : getColors(value);
136
+ }
137
+ if (typeof colors.surface === 'object') {
138
+ colors['DEFAULT'] = colors.surface['700'];
139
+ colors['dimmed'] = colors.surface['400'];
140
+ colors['muted'] = colors.surface['500'];
141
+ colors['toned'] = colors.surface['600'];
142
+ colors['highlighted'] = colors.surface['900'];
143
+ colors['inverted'] = 'white';
144
+ colors['surface'] = defu(colors.surface, {
145
+ DEFAULT: 'white',
146
+ muted: colors.surface['50'],
147
+ elevated: colors.surface['100'],
148
+ accented: colors.surface['200'],
149
+ inverted: colors.surface['900'],
150
+ });
151
+ }
152
+ if (theme.colors)
153
+ theme.colors = colors;
154
+ },
155
+ }),
156
+ ];
157
+ }
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "uisv",
3
- "version": "0.0.12",
3
+ "version": "0.0.13",
4
4
  "description": "ui library for the rest of us",
5
5
  "license": "MIT",
6
6
  "repository": "ui-sv/uisv",
7
7
  "homepage": "https://uisv.pages.dev",
8
8
  "scripts": {
9
9
  "dev": "vite dev",
10
- "build": "vite build && bun prepack",
10
+ "build": "vite build && prepack",
11
11
  "preview": "vite preview",
12
12
  "prepare": "svelte-kit sync || echo ''",
13
13
  "prepack": "svelte-kit sync && svelte-package && publint",