odj-svelte-ui 0.2.0 → 0.2.1

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.
@@ -10,38 +10,37 @@ export declare const sidebar: import("tailwind-variants").TVReturnType<{
10
10
  base: string;
11
11
  };
12
12
  };
13
- isOpen: {
14
- true: string;
15
- false: string;
16
- };
17
13
  breakpoint: {
14
+ none: {
15
+ base: string;
16
+ div: string;
17
+ };
18
18
  sm: {
19
19
  base: string;
20
+ div: string;
20
21
  };
21
22
  md: {
22
23
  base: string;
24
+ div: string;
23
25
  };
24
26
  lg: {
25
27
  base: string;
28
+ div: string;
26
29
  };
27
30
  xl: {
28
31
  base: string;
32
+ div: string;
29
33
  };
30
34
  "2xl": {
31
35
  base: string;
32
- };
33
- };
34
- backdrop: {
35
- true: {
36
- backdrop: string;
36
+ div: string;
37
37
  };
38
38
  };
39
39
  }, {
40
40
  base: string;
41
+ div: string;
41
42
  active: string;
42
43
  nonactive: string;
43
- div: string;
44
- backdrop: string;
45
44
  }, undefined, import("tailwind-variants/dist/config").TVConfig<{
46
45
  position: {
47
46
  fixed: {
@@ -54,30 +53,30 @@ export declare const sidebar: import("tailwind-variants").TVReturnType<{
54
53
  base: string;
55
54
  };
56
55
  };
57
- isOpen: {
58
- true: string;
59
- false: string;
60
- };
61
56
  breakpoint: {
57
+ none: {
58
+ base: string;
59
+ div: string;
60
+ };
62
61
  sm: {
63
62
  base: string;
63
+ div: string;
64
64
  };
65
65
  md: {
66
66
  base: string;
67
+ div: string;
67
68
  };
68
69
  lg: {
69
70
  base: string;
71
+ div: string;
70
72
  };
71
73
  xl: {
72
74
  base: string;
75
+ div: string;
73
76
  };
74
77
  "2xl": {
75
78
  base: string;
76
- };
77
- };
78
- backdrop: {
79
- true: {
80
- backdrop: string;
79
+ div: string;
81
80
  };
82
81
  };
83
82
  }, {
@@ -92,30 +91,30 @@ export declare const sidebar: import("tailwind-variants").TVReturnType<{
92
91
  base: string;
93
92
  };
94
93
  };
95
- isOpen: {
96
- true: string;
97
- false: string;
98
- };
99
94
  breakpoint: {
95
+ none: {
96
+ base: string;
97
+ div: string;
98
+ };
100
99
  sm: {
101
100
  base: string;
101
+ div: string;
102
102
  };
103
103
  md: {
104
104
  base: string;
105
+ div: string;
105
106
  };
106
107
  lg: {
107
108
  base: string;
109
+ div: string;
108
110
  };
109
111
  xl: {
110
112
  base: string;
113
+ div: string;
111
114
  };
112
115
  "2xl": {
113
116
  base: string;
114
- };
115
- };
116
- backdrop: {
117
- true: {
118
- backdrop: string;
117
+ div: string;
119
118
  };
120
119
  };
121
120
  }>, {
@@ -130,38 +129,37 @@ export declare const sidebar: import("tailwind-variants").TVReturnType<{
130
129
  base: string;
131
130
  };
132
131
  };
133
- isOpen: {
134
- true: string;
135
- false: string;
136
- };
137
132
  breakpoint: {
133
+ none: {
134
+ base: string;
135
+ div: string;
136
+ };
138
137
  sm: {
139
138
  base: string;
139
+ div: string;
140
140
  };
141
141
  md: {
142
142
  base: string;
143
+ div: string;
143
144
  };
144
145
  lg: {
145
146
  base: string;
147
+ div: string;
146
148
  };
147
149
  xl: {
148
150
  base: string;
151
+ div: string;
149
152
  };
150
153
  "2xl": {
151
154
  base: string;
152
- };
153
- };
154
- backdrop: {
155
- true: {
156
- backdrop: string;
155
+ div: string;
157
156
  };
158
157
  };
159
158
  }, {
160
159
  base: string;
160
+ div: string;
161
161
  active: string;
162
162
  nonactive: string;
163
- div: string;
164
- backdrop: string;
165
163
  }, import("tailwind-variants").TVReturnType<{
166
164
  position: {
167
165
  fixed: {
@@ -174,38 +172,37 @@ export declare const sidebar: import("tailwind-variants").TVReturnType<{
174
172
  base: string;
175
173
  };
176
174
  };
177
- isOpen: {
178
- true: string;
179
- false: string;
180
- };
181
175
  breakpoint: {
176
+ none: {
177
+ base: string;
178
+ div: string;
179
+ };
182
180
  sm: {
183
181
  base: string;
182
+ div: string;
184
183
  };
185
184
  md: {
186
185
  base: string;
186
+ div: string;
187
187
  };
188
188
  lg: {
189
189
  base: string;
190
+ div: string;
190
191
  };
191
192
  xl: {
192
193
  base: string;
194
+ div: string;
193
195
  };
194
196
  "2xl": {
195
197
  base: string;
196
- };
197
- };
198
- backdrop: {
199
- true: {
200
- backdrop: string;
198
+ div: string;
201
199
  };
202
200
  };
203
201
  }, {
204
202
  base: string;
203
+ div: string;
205
204
  active: string;
206
205
  nonactive: string;
207
- div: string;
208
- backdrop: string;
209
206
  }, undefined, import("tailwind-variants/dist/config").TVConfig<{
210
207
  position: {
211
208
  fixed: {
@@ -218,30 +215,30 @@ export declare const sidebar: import("tailwind-variants").TVReturnType<{
218
215
  base: string;
219
216
  };
220
217
  };
221
- isOpen: {
222
- true: string;
223
- false: string;
224
- };
225
218
  breakpoint: {
219
+ none: {
220
+ base: string;
221
+ div: string;
222
+ };
226
223
  sm: {
227
224
  base: string;
225
+ div: string;
228
226
  };
229
227
  md: {
230
228
  base: string;
229
+ div: string;
231
230
  };
232
231
  lg: {
233
232
  base: string;
233
+ div: string;
234
234
  };
235
235
  xl: {
236
236
  base: string;
237
+ div: string;
237
238
  };
238
239
  "2xl": {
239
240
  base: string;
240
- };
241
- };
242
- backdrop: {
243
- true: {
244
- backdrop: string;
241
+ div: string;
245
242
  };
246
243
  };
247
244
  }, {
@@ -256,88 +253,206 @@ export declare const sidebar: import("tailwind-variants").TVReturnType<{
256
253
  base: string;
257
254
  };
258
255
  };
259
- isOpen: {
260
- true: string;
261
- false: string;
262
- };
263
256
  breakpoint: {
257
+ none: {
258
+ base: string;
259
+ div: string;
260
+ };
264
261
  sm: {
265
262
  base: string;
263
+ div: string;
266
264
  };
267
265
  md: {
268
266
  base: string;
267
+ div: string;
269
268
  };
270
269
  lg: {
271
270
  base: string;
271
+ div: string;
272
272
  };
273
273
  xl: {
274
274
  base: string;
275
+ div: string;
275
276
  };
276
277
  "2xl": {
277
278
  base: string;
278
- };
279
- };
280
- backdrop: {
281
- true: {
282
- backdrop: string;
279
+ div: string;
283
280
  };
284
281
  };
285
282
  }>, unknown, unknown, undefined>>;
286
- export declare const sidebarbutton: import("tailwind-variants").TVReturnType<{
283
+ export declare const sidebargroup: import("tailwind-variants").TVReturnType<{
287
284
  breakpoint: {
288
- sm: string;
289
- md: string;
290
- lg: string;
291
- xl: string;
292
- "2xl": string;
285
+ none: {
286
+ base: string;
287
+ };
288
+ sm: {
289
+ base: string;
290
+ };
291
+ md: {
292
+ base: string;
293
+ };
294
+ lg: {
295
+ base: string;
296
+ };
297
+ xl: {
298
+ base: string;
299
+ };
300
+ "2xl": {
301
+ base: string;
302
+ };
303
+ };
304
+ border: {
305
+ true: string;
293
306
  };
294
- }, undefined, "inline-flex items-center p-2 mt-2 ms-3 text-sm text-gray-500 rounded-lg hover:bg-gray-100 focus:outline-hidden focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600", import("tailwind-variants/dist/config").TVConfig<{
307
+ }, {
308
+ base: string;
309
+ }, undefined, import("tailwind-variants/dist/config").TVConfig<{
295
310
  breakpoint: {
296
- sm: string;
297
- md: string;
298
- lg: string;
299
- xl: string;
300
- "2xl": string;
311
+ none: {
312
+ base: string;
313
+ };
314
+ sm: {
315
+ base: string;
316
+ };
317
+ md: {
318
+ base: string;
319
+ };
320
+ lg: {
321
+ base: string;
322
+ };
323
+ xl: {
324
+ base: string;
325
+ };
326
+ "2xl": {
327
+ base: string;
328
+ };
329
+ };
330
+ border: {
331
+ true: string;
301
332
  };
302
333
  }, {
303
334
  breakpoint: {
304
- sm: string;
305
- md: string;
306
- lg: string;
307
- xl: string;
308
- "2xl": string;
335
+ none: {
336
+ base: string;
337
+ };
338
+ sm: {
339
+ base: string;
340
+ };
341
+ md: {
342
+ base: string;
343
+ };
344
+ lg: {
345
+ base: string;
346
+ };
347
+ xl: {
348
+ base: string;
349
+ };
350
+ "2xl": {
351
+ base: string;
352
+ };
353
+ };
354
+ border: {
355
+ true: string;
309
356
  };
310
357
  }>, {
311
358
  breakpoint: {
312
- sm: string;
313
- md: string;
314
- lg: string;
315
- xl: string;
316
- "2xl": string;
359
+ none: {
360
+ base: string;
361
+ };
362
+ sm: {
363
+ base: string;
364
+ };
365
+ md: {
366
+ base: string;
367
+ };
368
+ lg: {
369
+ base: string;
370
+ };
371
+ xl: {
372
+ base: string;
373
+ };
374
+ "2xl": {
375
+ base: string;
376
+ };
317
377
  };
318
- }, undefined, import("tailwind-variants").TVReturnType<{
378
+ border: {
379
+ true: string;
380
+ };
381
+ }, {
382
+ base: string;
383
+ }, import("tailwind-variants").TVReturnType<{
319
384
  breakpoint: {
320
- sm: string;
321
- md: string;
322
- lg: string;
323
- xl: string;
324
- "2xl": string;
385
+ none: {
386
+ base: string;
387
+ };
388
+ sm: {
389
+ base: string;
390
+ };
391
+ md: {
392
+ base: string;
393
+ };
394
+ lg: {
395
+ base: string;
396
+ };
397
+ xl: {
398
+ base: string;
399
+ };
400
+ "2xl": {
401
+ base: string;
402
+ };
403
+ };
404
+ border: {
405
+ true: string;
325
406
  };
326
- }, undefined, "inline-flex items-center p-2 mt-2 ms-3 text-sm text-gray-500 rounded-lg hover:bg-gray-100 focus:outline-hidden focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600", import("tailwind-variants/dist/config").TVConfig<{
407
+ }, {
408
+ base: string;
409
+ }, undefined, import("tailwind-variants/dist/config").TVConfig<{
327
410
  breakpoint: {
328
- sm: string;
329
- md: string;
330
- lg: string;
331
- xl: string;
332
- "2xl": string;
411
+ none: {
412
+ base: string;
413
+ };
414
+ sm: {
415
+ base: string;
416
+ };
417
+ md: {
418
+ base: string;
419
+ };
420
+ lg: {
421
+ base: string;
422
+ };
423
+ xl: {
424
+ base: string;
425
+ };
426
+ "2xl": {
427
+ base: string;
428
+ };
429
+ };
430
+ border: {
431
+ true: string;
333
432
  };
334
433
  }, {
335
434
  breakpoint: {
336
- sm: string;
337
- md: string;
338
- lg: string;
339
- xl: string;
340
- "2xl": string;
435
+ none: {
436
+ base: string;
437
+ };
438
+ sm: {
439
+ base: string;
440
+ };
441
+ md: {
442
+ base: string;
443
+ };
444
+ lg: {
445
+ base: string;
446
+ };
447
+ xl: {
448
+ base: string;
449
+ };
450
+ "2xl": {
451
+ base: string;
452
+ };
453
+ };
454
+ border: {
455
+ true: string;
341
456
  };
342
457
  }>, unknown, unknown, undefined>>;
343
458
  export declare const sidebarcta: import("tailwind-variants").TVReturnType<{
@@ -1,11 +1,10 @@
1
1
  import { tv } from "tailwind-variants";
2
2
  export const sidebar = tv({
3
3
  slots: {
4
- base: "top-0 left-0 z-50 w-64 transition-transform bg-gray-50 dark:bg-gray-800",
5
- active: "flex items-center text-base font-normal text-gray-900 bg-gray-200 dark:bg-gray-700 rounded-sm dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700",
6
- nonactive: "flex items-center text-base font-normal text-gray-900 rounded-sm dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700",
7
- div: "overflow-y-auto h-full px-3 py-4 overflow-y-auto bg-gray-50 dark:bg-gray-800",
8
- backdrop: "fixed top-0 start-0 z-40 w-full h-full"
4
+ base: "top-0 left-0 z-10 min-w-full",
5
+ div: "overflow-y-auto p-2 rounded-lg bg-light-surface-100 dark:bg-dark-surface-800",
6
+ active: "cursor-pointer flex items-center p-2 rounded-lg text-base font-normal text-light-surface-900 dark:text-white bg-light-surface-300 dark:bg-dark-surface-700 hover:bg-light-surface-300/50 dark:hover:bg-dark-surface-600",
7
+ nonactive: "cursor-pointer flex items-center p-2 rounded-lg text-base font-normal text-light-surface-700 dark:text-dark-surface-400 hover:bg-light-surface-300/50 dark:hover:bg-dark-surface-600 hover:text-light-surface-800 dark:hover:text-dark-surface-200"
9
8
  },
10
9
  variants: {
11
10
  position: {
@@ -13,44 +12,44 @@ export const sidebar = tv({
13
12
  absolute: { base: "absolute" },
14
13
  static: { base: "static" }
15
14
  },
16
- isOpen: {
17
- true: "block",
18
- false: "hidden"
19
- },
20
15
  breakpoint: {
21
- sm: { base: "sm:block" },
22
- md: { base: "md:block" },
23
- lg: { base: "lg:block" },
24
- xl: { base: "xl:block" },
25
- "2xl": { base: "2xl:block" }
26
- },
27
- backdrop: {
28
- true: { backdrop: "bg-gray-900/75" }
16
+ none: { base: "min-w-64 h-full", div: "h-full sm:rounded-none" },
17
+ sm: { base: "sm:min-w-64 sm:h-full", div: "sm:h-full sm:rounded-none" },
18
+ md: { base: "md:min-w-64 md:h-full", div: "md:h-full md:rounded-none" },
19
+ lg: { base: "lg:min-w-64 lg:h-full", div: "lg:h-full lg:rounded-none" },
20
+ xl: { base: "xl:min-w-64 xl:h-full", div: "xl:h-full xl:rounded-none" },
21
+ "2xl": { base: "2xl:min-w-64 2xl:h-full", div: "2xl:h-full 2xl:rounded-none" }
29
22
  }
30
23
  }
31
24
  });
32
- export const sidebarbutton = tv({
33
- base: "inline-flex items-center p-2 mt-2 ms-3 text-sm text-gray-500 rounded-lg hover:bg-gray-100 focus:outline-hidden focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600",
25
+ export const sidebargroup = tv({
26
+ slots: {
27
+ base: "flex flex-row gap-2"
28
+ },
34
29
  variants: {
35
30
  breakpoint: {
36
- sm: "sm:hidden",
37
- md: "md:hidden",
38
- lg: "lg:hidden",
39
- xl: "xl:hidden",
40
- "2xl": "2xl:hidden"
31
+ none: { base: "flex-col" },
32
+ sm: { base: "sm:flex-col" },
33
+ md: { base: "md:flex-col" },
34
+ lg: { base: "lg:flex-col" },
35
+ xl: { base: "xl:flex-col" },
36
+ "2xl": { base: "2xl:flex-col" }
37
+ },
38
+ border: {
39
+ true: "pt-4 mt-4 border-t border-light-surface-200 dark:border-dark-surface-700"
41
40
  }
42
41
  }
43
42
  });
44
43
  export const sidebarcta = tv({
45
44
  slots: {
46
- base: "p-4 mt-6 bg-primary-50 rounded-lg dark:bg-primary-900",
45
+ base: "p-4 mt-2 bg-primary-50 rounded-lg dark:bg-primary-900",
47
46
  div: "flex items-center mb-3",
48
47
  span: "bg-primary-100 text-primary-800 text-sm font-semibold me-2 px-2.5 py-0.5 rounded-sm dark:bg-primary-200 dark:text-primary-900"
49
48
  }
50
49
  });
51
50
  export const sitebarbrand = tv({
52
51
  slots: {
53
- base: "flex items-center ps-2.5 mb-5",
52
+ base: "flex items-center px-2 my-2",
54
53
  img: "h-6 me-3 sm:h-7",
55
54
  span: "self-center text-xl font-semibold whitespace-nowrap dark:text-white"
56
55
  }
@@ -58,9 +57,9 @@ export const sitebarbrand = tv({
58
57
  export const sidebardropdownwrapper = tv({
59
58
  slots: {
60
59
  base: "",
61
- btn: "flex items-center w-full text-base font-normal text-gray-900 rounded-sm transition duration-75 group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700",
60
+ btn: "group w-full cursor-pointer flex items-center p-2 rounded-lg text-base font-normal text-light-surface-700 dark:text-dark-surface-400 hover:bg-light-surface-300/50 dark:hover:bg-dark-surface-600 hover:text-light-surface-800 dark:hover:text-dark-surface-200",
62
61
  span: "flex-1 ms-3 text-left whitespace-nowrap",
63
- svg: "h-3 w-3 text-gray-800 dark:text-white",
62
+ svg: "h-3 w-3 text-light-surface-700 dark:text-dark-surface-400 group-hover:text-light-surface-800 dark:group-hover:text-dark-surface-200",
64
63
  ul: "py-2 space-y-2"
65
64
  }
66
65
  });
@@ -3,36 +3,26 @@ import type { Snippet } from "svelte";
3
3
  import type { HTMLAttributes, HTMLButtonAttributes, HTMLAnchorAttributes } from "svelte/elements";
4
4
  import type { TransitionFunc, ParamsType } from "../types";
5
5
  type SidebarCtxType = {
6
- closeSidebar?: () => void;
7
6
  activeClass?: string;
8
7
  nonActiveClass?: string;
9
8
  isSingle?: boolean;
10
9
  selected?: Writable<object>;
11
10
  activeUrl?: string;
11
+ breakpoint?: BreakpointType;
12
12
  };
13
- type BreakpointType = "sm" | "md" | "lg" | "xl" | "2xl" | undefined;
13
+ type BreakpointType = "sm" | "md" | "lg" | "xl" | "2xl" | "none" | undefined;
14
14
  type PosisionType = "fixed" | "absolute" | "static" | undefined;
15
15
  interface SidebarProps extends HTMLAttributes<HTMLElement> {
16
16
  children: Snippet;
17
- isOpen?: boolean;
18
- closeSidebar?: () => void;
19
- activateClickOutside?: boolean;
20
17
  isSingle?: boolean;
21
18
  breakpoint?: BreakpointType;
22
19
  position?: PosisionType;
23
- ariaLabel?: string;
24
20
  divClass?: string;
21
+ ariaLabel?: string;
25
22
  nonActiveClass?: string;
26
23
  activeClass?: string;
27
- params?: ParamsType;
28
- transition?: TransitionFunc;
29
- backdrop?: boolean;
30
- backdropClass?: string;
31
24
  activeUrl?: string;
32
25
  }
33
- interface SidebarButtonProps extends HTMLButtonAttributes {
34
- breakpoint?: BreakpointType;
35
- }
36
26
  interface SidebarCtaProps extends HTMLAttributes<HTMLDivElement> {
37
27
  children: Snippet;
38
28
  icon?: Snippet;
@@ -69,7 +59,6 @@ interface SidebarDropdownWrapperProps extends HTMLButtonAttributes {
69
59
  }
70
60
  interface SidebarGroupProps extends HTMLAttributes<HTMLUListElement> {
71
61
  children: Snippet;
72
- borderClass?: string;
73
62
  border?: boolean;
74
63
  }
75
64
  interface SidebarItemProps extends HTMLAnchorAttributes {
@@ -82,4 +71,4 @@ interface SidebarItemProps extends HTMLAnchorAttributes {
82
71
  aClass?: string;
83
72
  active?: boolean;
84
73
  }
85
- export type { SidebarProps, SidebarDropdownWrapperProps, SidebarGroupProps, SidebarItemProps, SidebarCtxType, SidebarButtonProps, SidebarCtaProps, SidebarBrandProps, BreakpointType, PosisionType };
74
+ export type { SidebarProps, SidebarDropdownWrapperProps, SidebarGroupProps, SidebarItemProps, SidebarCtxType, SidebarCtaProps, SidebarBrandProps, BreakpointType, PosisionType };
@@ -61,7 +61,6 @@
61
61
  review,
62
62
  scorerating,
63
63
  sidebar,
64
- sidebarbutton,
65
64
  sidebarcta,
66
65
  sitebarbrand,
67
66
  sidebardropdownwrapper,
@@ -216,7 +215,6 @@
216
215
  review,
217
216
  scorerating,
218
217
  sidebar,
219
- sidebarbutton,
220
218
  sidebarcta,
221
219
  sitebarbrand,
222
220
  sidebardropdownwrapper,