uisv 0.0.20 → 0.0.21

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.
@@ -71,7 +71,7 @@
71
71
  {
72
72
  color: 'surface',
73
73
  variant: 'solid',
74
- class: 'bg-surface-900',
74
+ class: 'bg-surface-inverted text-inverted',
75
75
  },
76
76
  {
77
77
  color: 'info',
@@ -97,94 +97,94 @@
97
97
  {
98
98
  color: 'primary',
99
99
  variant: 'outline',
100
- class: 'border-primary-300 text-primary-400',
100
+ class: 'border-primary/50 text-primary',
101
101
  },
102
102
  {
103
103
  color: 'surface',
104
104
  variant: 'outline',
105
- class: 'border-surface-300 text-surface-900',
105
+ class: 'border-surface-accented text-highlighted',
106
106
  },
107
107
  {
108
108
  color: 'info',
109
109
  variant: 'outline',
110
- class: 'border-info-300 text-info-500',
110
+ class: 'border-info/50 text-info',
111
111
  },
112
112
  {
113
113
  color: 'success',
114
114
  variant: 'outline',
115
- class: 'border-green-300 text-success-500',
115
+ class: 'border-green/50 text-success',
116
116
  },
117
117
  {
118
118
  color: 'error',
119
119
  variant: 'outline',
120
- class: 'border-error-300 text-error-500',
120
+ class: 'border-error/50 text-error',
121
121
  },
122
122
  {
123
123
  color: 'warning',
124
124
  variant: 'outline',
125
- class: 'border-warning-300 text-warning-500',
125
+ class: 'border-warning/50 text-warning',
126
126
  },
127
127
 
128
128
  {
129
129
  color: 'primary',
130
130
  variant: 'soft',
131
- class: ' bg-primary-50 text-primary-500',
131
+ class: ' bg-primary/10 text-primary-500',
132
132
  },
133
133
  {
134
134
  color: 'surface',
135
135
  variant: 'soft',
136
- class: 'bg-surface-100 text-surface-800',
136
+ class: 'bg-surface/10 text-highlighted',
137
137
  },
138
138
  {
139
139
  color: 'info',
140
140
  variant: 'soft',
141
- class: 'bg-info-100 text-info-500',
141
+ class: 'bg-info/10 text-info-500',
142
142
  },
143
143
  {
144
144
  color: 'success',
145
145
  variant: 'soft',
146
- class: 'bg-success-100 text-success-500',
146
+ class: 'bg-success/10 text-success-500',
147
147
  },
148
148
  {
149
149
  color: 'error',
150
150
  variant: 'soft',
151
- class: 'bg-error-100 text-error-500',
151
+ class: 'bg-error/10 text-error-500',
152
152
  },
153
153
  {
154
154
  color: 'warning',
155
155
  variant: 'soft',
156
- class: 'bg-warning-100 text-warning-500 ',
156
+ class: 'bg-warning/10 text-warning-500 ',
157
157
  },
158
158
 
159
159
  {
160
160
  color: 'primary',
161
161
  variant: 'subtle',
162
- class: 'bg-primary-50 text-primary-500 border-primary-200 ',
162
+ class: 'bg-primary/10 text-primary-500 border-primary/20',
163
163
  },
164
164
  {
165
165
  color: 'surface',
166
166
  variant: 'subtle',
167
- class: 'bg-surface-100 text-surface-800 border-surface-300 ',
167
+ class: 'bg-surface/10 text-highlighted border-surface/20 ',
168
168
  },
169
169
  {
170
170
  color: 'info',
171
171
  variant: 'subtle',
172
- class: 'bg-info-50 text-info-600 border-info-200',
172
+ class: 'bg-info/10 text-info-600 border-info/20',
173
173
  },
174
174
  {
175
175
  color: 'success',
176
176
  variant: 'subtle',
177
- class: 'bg-success-100 text-success-600 border-success-300',
177
+ class: 'bg-success/10 text-success-600 border-success/20',
178
178
  },
179
179
  {
180
180
  color: 'error',
181
181
  variant: 'subtle',
182
- class: 'bg-error-50 text-error-600 border-error-200',
182
+ class: 'bg-error/10 text-error-600 border-error/20',
183
183
  },
184
184
  {
185
185
  color: 'warning',
186
186
  variant: 'subtle',
187
- class: 'bg-warning-50 text-warning-600 border-warning-300',
187
+ class: 'bg-warning/10 text-warning-600 border-warning/20',
188
188
  },
189
189
  ],
190
190
  })({ variant, size, color });
@@ -10,7 +10,6 @@
10
10
  import type { ClassNameValue } from 'tailwind-merge';
11
11
  import { tv } from 'tailwind-variants';
12
12
  import { defu } from 'defu';
13
- import { useId } from 'bits-ui';
14
13
 
15
14
  export type BannerProps = {
16
15
  title: string | Snippet;
@@ -44,18 +43,7 @@
44
43
  ui = {},
45
44
  onclose = () => {},
46
45
  }: BannerProps = $props();
47
- const id = useId();
48
46
 
49
- const close_props = $derived.by(() => {
50
- return defu(typeof close === 'boolean' ? {} : close, {
51
- icon: 'i-lucide-x',
52
- variant: 'link',
53
- color: variant === 'solid' ? 'surface' : color,
54
- ui: {
55
- icon: variant === 'solid' ? 'text-white' : '',
56
- },
57
- } as ButtonProps);
58
- });
59
47
  const classes = $derived.by(() =>
60
48
  tv({
61
49
  slots: {
@@ -75,8 +63,8 @@
75
63
  },
76
64
  variant: {
77
65
  solid: {
78
- base: 'text-white',
79
- description: 'text-white/90',
66
+ base: 'text-inverted',
67
+ description: 'text-inverted/90',
80
68
  },
81
69
  outline: 'border',
82
70
  soft: '',
@@ -92,7 +80,7 @@
92
80
  {
93
81
  variant: 'solid',
94
82
  color: 'surface',
95
- class: 'bg-surface-900',
83
+ class: 'bg-surface-inverted',
96
84
  },
97
85
  {
98
86
  variant: 'solid',
@@ -118,94 +106,94 @@
118
106
  {
119
107
  variant: 'outline',
120
108
  color: 'primary',
121
- class: 'border-primary-300 text-primary-500',
109
+ class: 'border-primary/15 text-primary-500',
122
110
  },
123
111
  {
124
112
  variant: 'outline',
125
113
  color: 'surface',
126
- class: 'border-surface-300 text-surface-900',
114
+ class: 'border-surface/15',
127
115
  },
128
116
  {
129
117
  variant: 'outline',
130
118
  color: 'info',
131
- class: 'border-info-300 text-info-500',
119
+ class: 'border-info/15 text-info-500',
132
120
  },
133
121
  {
134
122
  variant: 'outline',
135
123
  color: 'success',
136
- class: 'border-success-300 text-success-500',
124
+ class: 'border-success/15 text-success-500',
137
125
  },
138
126
  {
139
127
  variant: 'outline',
140
128
  color: 'warning',
141
- class: 'border-warning-300 text-warning-500',
129
+ class: 'border-warning/15 text-warning-500',
142
130
  },
143
131
  {
144
132
  variant: 'outline',
145
133
  color: 'error',
146
- class: 'border-error-300 text-error-500',
134
+ class: 'border-error/15 text-error-500',
147
135
  },
148
136
 
149
137
  {
150
138
  variant: 'soft',
151
139
  color: 'primary',
152
- class: 'bg-primary-100 text-primary-500',
140
+ class: 'bg-primary/10 text-primary-500',
153
141
  },
154
142
  {
155
143
  variant: 'soft',
156
144
  color: 'surface',
157
- class: 'bg-surface-50 text-surface-900',
145
+ class: 'bg-surface/10',
158
146
  },
159
147
  {
160
148
  variant: 'soft',
161
149
  color: 'info',
162
- class: 'bg-info-50 text-info-500',
150
+ class: 'bg-info/10 text-info-500',
163
151
  },
164
152
  {
165
153
  variant: 'soft',
166
154
  color: 'success',
167
- class: 'bg-success-50 text-success-500',
155
+ class: 'bg-success/10 text-success-500',
168
156
  },
169
157
  {
170
158
  variant: 'soft',
171
159
  color: 'warning',
172
- class: 'bg-warning-50 text-warning-500',
160
+ class: 'bg-warning/10 text-warning-500',
173
161
  },
174
162
  {
175
163
  variant: 'soft',
176
164
  color: 'error',
177
- class: 'bg-error-50 text-error-500',
165
+ class: 'bg-error/10 text-error-500',
178
166
  },
179
167
 
180
168
  {
181
169
  variant: 'subtle',
182
170
  color: 'primary',
183
- class: 'bg-primary-100 text-primary-500 border-primary-300',
171
+ class: 'bg-primary/10 text-primary-500 border-primary/15',
184
172
  },
185
173
  {
186
174
  variant: 'subtle',
187
175
  color: 'surface',
188
- class: 'bg-surface-50 text-surface-900 border-surface-300',
176
+ class: 'bg-surface/10 border-surface/15',
189
177
  },
190
178
  {
191
179
  variant: 'subtle',
192
180
  color: 'info',
193
- class: 'bg-info-50 text-info-500 border-info-300',
181
+ class: 'bg-info/10 text-info-500 border-info/15',
194
182
  },
195
183
  {
196
184
  variant: 'subtle',
197
185
  color: 'success',
198
- class: 'bg-success-50 text-success-500 border-success-300',
186
+ class: 'bg-success/10 text-success-500 border-success/15',
199
187
  },
200
188
  {
201
189
  variant: 'subtle',
202
190
  color: 'warning',
203
- class: 'bg-warning-50 text-warning-500 border-warning-300',
191
+ class: 'bg-warning/10 text-warning-500 border-warning/15',
204
192
  },
205
193
  {
206
194
  variant: 'subtle',
207
195
  color: 'error',
208
- class: 'bg-error-50 text-error-500 border-error-300',
196
+ class: 'bg-error/10 text-error-500 border-error/15',
209
197
  },
210
198
  ],
211
199
  })({ color, variant }),
@@ -218,7 +206,7 @@
218
206
  {target}
219
207
  class={classes.base({ class: [ui.base] })}
220
208
  >
221
- <div class="flex flex-grow gap-2 text-sm items-center">
209
+ <div class="flex grow gap-2 text-sm items-center">
222
210
  {#if icon}
223
211
  <div class="size-6">
224
212
  {#if typeof icon === 'string'}
@@ -254,7 +242,17 @@
254
242
 
255
243
  {#if close}
256
244
  <div>
257
- <Button {...close_props} onclick={onclose} />
245
+ <Button
246
+ {...defu<ButtonProps, [ButtonProps]>(typeof close === 'boolean' ? {} : close, {
247
+ icon: 'i-lucide-x',
248
+ variant: 'ghost',
249
+ color: 'surface',
250
+ ui: {
251
+ icon: variant === 'solid' ? 'text-inverted' : '',
252
+ },
253
+ })}
254
+ onclick={onclose}
255
+ />
258
256
  </div>
259
257
  {/if}
260
258
  </svelte:element>
@@ -6,7 +6,6 @@
6
6
  import { isSnippet } from '../index.js';
7
7
  import { tv } from 'tailwind-variants';
8
8
  import type { SvelteHTMLElements } from 'svelte/elements';
9
- import { Button } from 'bits-ui';
10
9
 
11
10
  export type ButtonProps = SvelteHTMLElements['button'] & {
12
11
  /** The underlying DOM element being rendered. You can bind to this to get a reference to the element. */
@@ -81,7 +80,6 @@
81
80
  icon,
82
81
  loading,
83
82
  loadingicon = 'i-lucide-loader-circle',
84
- target,
85
83
  type,
86
84
  trailingicon,
87
85
  leadingicon,
@@ -145,7 +143,7 @@
145
143
  {
146
144
  color: 'surface',
147
145
  variant: 'solid',
148
- class: 'bg-surface-inverted text-hightlighted hover:bg-toned',
146
+ class: 'bg-surface-inverted text-inverted hover:bg-toned',
149
147
  },
150
148
  {
151
149
  color: 'info',
@@ -179,7 +177,7 @@
179
177
  color: 'surface',
180
178
  variant: 'outline',
181
179
  class: {
182
- base: 'border-surface-hightlighted text-surface-inverted hover:bg-surface/10',
180
+ base: 'border-surface-accented text-surface-inverted hover:bg-surface/10',
183
181
  },
184
182
  },
185
183
  {
@@ -350,8 +348,6 @@
350
348
 
351
349
  internal_loading = false;
352
350
  }
353
-
354
- $inspect(children, label, !!icon);
355
351
  </script>
356
352
 
357
353
  <svelte:element
@@ -2,7 +2,6 @@ import { type Component, type Snippet } from 'svelte';
2
2
  import { type PropColor, type PropVariant } from '../index.js';
3
3
  import type { ClassNameValue } from 'tailwind-merge';
4
4
  import type { SvelteHTMLElements } from 'svelte/elements';
5
- import { Button } from 'bits-ui';
6
5
  export type ButtonProps = SvelteHTMLElements['button'] & {
7
6
  /** The underlying DOM element being rendered. You can bind to this to get a reference to the element. */
8
7
  ref?: HTMLButtonElement | HTMLAnchorElement;
@@ -32,18 +32,18 @@
32
32
  variants: {
33
33
  variant: {
34
34
  solid: {
35
- base: 'bg-surface-900 text-surface-50',
35
+ base: 'bg-surface-inverted text-inverted',
36
36
  header: 'border-transparent',
37
37
  footer: 'border-transparent',
38
38
  },
39
39
  outline: {
40
- base: 'border border-surface-300 divide-y divide-surface-300',
40
+ base: 'border border-surface-accented divide-y divide-surface-accented',
41
41
  },
42
42
  soft: {
43
- base: 'bg-surface-50 divide-y divide-surface-300',
43
+ base: 'bg-surface/10 divide-y divide-surface-accented',
44
44
  },
45
45
  subtle: {
46
- base: 'bg-surface-50 border-surface-300 border divide-y divide-surface-300',
46
+ base: 'bg-surface/10 border-surface-accented border divide-y divide-surface-accented',
47
47
  },
48
48
  },
49
49
  },
@@ -24,7 +24,7 @@
24
24
  color = 'primary',
25
25
  position = 'top-right',
26
26
  size = 8,
27
- ui = {}
27
+ ui = {},
28
28
  }: ChipProps = $props();
29
29
 
30
30
  const classes = $derived.by(() =>
@@ -32,39 +32,39 @@
32
32
  slots: {
33
33
  base: 'relative inline-flex items-center justify-center shrink-0',
34
34
  chip: [
35
- 'absolute rounded-full ring ring-white flex items-center justify-center text-white font-medium whitespace-nowrap',
36
- '-translate-y-1/2 translate-x-1/2 px-0.5'
37
- ]
35
+ 'absolute rounded-full ring ring-inverted flex items-center justify-center text-inverted font-medium whitespace-nowrap',
36
+ '-translate-y-1/2 translate-x-1/2 px-0.5',
37
+ ],
38
38
  },
39
39
  variants: {
40
40
  color: {
41
41
  primary: {
42
- chip: 'bg-primary'
42
+ chip: 'bg-primary',
43
43
  },
44
44
  surface: {
45
- chip: 'bg-surface'
45
+ chip: 'bg-surface',
46
46
  },
47
47
  success: {
48
- chip: 'bg-success'
48
+ chip: 'bg-success',
49
49
  },
50
50
  info: {
51
- chip: 'bg-info'
51
+ chip: 'bg-info',
52
52
  },
53
53
  warning: {
54
- chip: 'bg-warning'
54
+ chip: 'bg-warning',
55
55
  },
56
56
  error: {
57
- chip: 'bg-error'
58
- }
57
+ chip: 'bg-error',
58
+ },
59
59
  },
60
60
  position: {
61
61
  'top-right': { chip: 'top-0 right-0' },
62
62
  'bottom-right': { chip: 'bottom-0 right-0' },
63
63
  'top-left': { chip: 'top-0 left-0' },
64
- 'bottom-left': { chip: 'bottom-0 left-0' }
65
- }
66
- }
67
- })({ color, position })
64
+ 'bottom-left': { chip: 'bottom-0 left-0' },
65
+ },
66
+ },
67
+ })({ color, position }),
68
68
  );
69
69
  </script>
70
70
 
@@ -46,8 +46,6 @@
46
46
  },
47
47
  );
48
48
 
49
- $inspect(isComponent(name), name);
50
-
51
49
  useStyle(() => css_style);
52
50
  </script>
53
51
 
package/dist/vite.d.ts CHANGED
@@ -48,4 +48,5 @@ export type PluginOptions = {
48
48
  */
49
49
  icons?: Parameters<typeof presetIcons>[0];
50
50
  };
51
- export declare function uisv(options: PluginOptions): import("vite").Plugin<any>[][];
51
+ declare const _default: (options?: PluginOptions) => import("vite").Plugin<any>[][];
52
+ export default _default;
package/dist/vite.js CHANGED
@@ -3,7 +3,7 @@ import { transformerVariantGroup, transformerCompileClass, transformerDirectives
3
3
  import {} from '@unocss/preset-web-fonts';
4
4
  import { defu } from 'defu';
5
5
  import { getColors } from 'theme-colors';
6
- export function uisv(options) {
6
+ export default (options = {}) => {
7
7
  const _opts = defu(options, {
8
8
  colors: {
9
9
  primary: {
@@ -139,4 +139,4 @@ export function uisv(options) {
139
139
  },
140
140
  }),
141
141
  ];
142
- }
142
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uisv",
3
- "version": "0.0.20",
3
+ "version": "0.0.21",
4
4
  "description": "ui library for the rest of us",
5
5
  "license": "MIT",
6
6
  "repository": "ui-sv/uisv",