uisv 0.0.21 → 0.0.23

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 (89) hide show
  1. package/dist/components/accordion.svelte +22 -22
  2. package/dist/components/accordion.svelte.d.ts +10 -10
  3. package/dist/components/alert.svelte +22 -28
  4. package/dist/components/alert.svelte.d.ts +5 -5
  5. package/dist/components/app.svelte +63 -0
  6. package/dist/components/app.svelte.d.ts +8 -0
  7. package/dist/components/badge.svelte +18 -23
  8. package/dist/components/badge.svelte.d.ts +3 -3
  9. package/dist/components/banner.svelte +18 -24
  10. package/dist/components/banner.svelte.d.ts +5 -5
  11. package/dist/components/breadcrumb.svelte +7 -8
  12. package/dist/components/breadcrumb.svelte.d.ts +5 -26
  13. package/dist/components/button.svelte +36 -44
  14. package/dist/components/button.svelte.d.ts +12 -11
  15. package/dist/components/calendar.svelte +6 -7
  16. package/dist/components/calendar.svelte.d.ts +3 -3
  17. package/dist/components/card.svelte +11 -12
  18. package/dist/components/card.svelte.d.ts +5 -5
  19. package/dist/components/checkbox-group.svelte +12 -13
  20. package/dist/components/checkbox-group.svelte.d.ts +4 -4
  21. package/dist/components/checkbox.svelte +42 -40
  22. package/dist/components/checkbox.svelte.d.ts +6 -6
  23. package/dist/components/chip.svelte +7 -8
  24. package/dist/components/chip.svelte.d.ts +3 -3
  25. package/dist/components/collapsible.svelte +7 -6
  26. package/dist/components/collapsible.svelte.d.ts +4 -4
  27. package/dist/components/color-picker.svelte +1 -1
  28. package/dist/components/h1.svelte +8 -7
  29. package/dist/components/h2.svelte +12 -11
  30. package/dist/components/h3.svelte +9 -8
  31. package/dist/components/h4.svelte +12 -11
  32. package/dist/components/h5.svelte +12 -11
  33. package/dist/components/h6.svelte +12 -11
  34. package/dist/components/index.d.ts +7 -0
  35. package/dist/components/index.js +7 -0
  36. package/dist/components/input-number.svelte +8 -9
  37. package/dist/components/input-number.svelte.d.ts +5 -5
  38. package/dist/components/input-time.svelte +11 -12
  39. package/dist/components/input-time.svelte.d.ts +6 -6
  40. package/dist/components/input.svelte +19 -29
  41. package/dist/components/input.svelte.d.ts +6 -6
  42. package/dist/components/kbd.svelte +6 -7
  43. package/dist/components/kbd.svelte.d.ts +2 -2
  44. package/dist/components/modal.svelte +189 -0
  45. package/dist/components/modal.svelte.d.ts +33 -0
  46. package/dist/components/p.svelte +3 -1
  47. package/dist/components/pin-input.svelte +10 -11
  48. package/dist/components/pin-input.svelte.d.ts +3 -3
  49. package/dist/components/placeholder.svelte +4 -4
  50. package/dist/components/popover.svelte +33 -61
  51. package/dist/components/popover.svelte.d.ts +8 -30
  52. package/dist/components/progress.svelte +62 -26
  53. package/dist/components/progress.svelte.d.ts +8 -7
  54. package/dist/components/select.svelte +49 -53
  55. package/dist/components/select.svelte.d.ts +22 -29
  56. package/dist/components/seperator.svelte +7 -8
  57. package/dist/components/seperator.svelte.d.ts +6 -6
  58. package/dist/components/slider.svelte +13 -14
  59. package/dist/components/slider.svelte.d.ts +4 -4
  60. package/dist/components/switch.svelte +19 -23
  61. package/dist/components/switch.svelte.d.ts +6 -6
  62. package/dist/components/tabs.svelte +19 -20
  63. package/dist/components/tabs.svelte.d.ts +7 -7
  64. package/dist/components/toast.svelte +173 -0
  65. package/dist/components/toast.svelte.d.ts +8 -0
  66. package/dist/components/toast.svelte.js +11 -0
  67. package/dist/components/tooltip.svelte +94 -0
  68. package/dist/components/tooltip.svelte.d.ts +24 -0
  69. package/dist/contexts.d.ts +54 -0
  70. package/dist/contexts.js +46 -0
  71. package/dist/index.d.ts +1 -1
  72. package/dist/index.js +1 -1
  73. package/dist/mode.d.ts +89 -0
  74. package/dist/mode.js +1 -0
  75. package/dist/utilities/index.d.ts +5 -0
  76. package/dist/utilities/index.js +5 -0
  77. package/dist/utilities/isComponent.d.ts +7 -0
  78. package/dist/utilities/isComponent.js +10 -0
  79. package/dist/utilities/isSnippet.d.ts +7 -0
  80. package/dist/utilities/isSnippet.js +8 -0
  81. package/dist/utilities/useElementRects.svelte.d.ts +11 -0
  82. package/dist/{utilities.svelte.js → utilities/useElementRects.svelte.js} +0 -38
  83. package/dist/utilities/useRafFn.svelte.d.ts +43 -0
  84. package/dist/utilities/useRafFn.svelte.js +56 -0
  85. package/dist/utilities/useStyle.svelte.d.ts +8 -0
  86. package/dist/utilities/useStyle.svelte.js +21 -0
  87. package/dist/vite.js +30 -35
  88. package/package.json +39 -27
  89. package/dist/utilities.svelte.d.ts +0 -31
@@ -1,8 +1,8 @@
1
1
  <script module lang="ts">
2
+ import { getAppContext } from '../contexts.js';
2
3
  import { type PropColor, isComponent, isSnippet } from '../index.js';
3
4
  import type { Snippet } from 'svelte';
4
- import type { ClassNameValue } from 'tailwind-merge';
5
- import { tv } from 'tailwind-variants';
5
+ import { tv, type ClassValue } from 'tailwind-variants';
6
6
  import type { Component } from 'vitest-browser-svelte';
7
7
 
8
8
  export type CheckboxProps = {
@@ -18,11 +18,11 @@
18
18
  indicator?: 'start' | 'end' | 'hidden';
19
19
  as?: string;
20
20
  ui?: {
21
- root?: ClassNameValue;
22
- container?: ClassNameValue;
23
- icon?: ClassNameValue;
24
- label?: ClassNameValue;
25
- description?: ClassNameValue;
21
+ root?: ClassValue;
22
+ container?: ClassValue;
23
+ icon?: ClassValue;
24
+ label?: ClassValue;
25
+ description?: ClassValue;
26
26
  };
27
27
  };
28
28
  </script>
@@ -33,96 +33,98 @@
33
33
  color = 'primary',
34
34
  size = 'md',
35
35
  disabled,
36
- icon = 'i-lucide-check',
37
- intermediateicon = 'i-lucide-minus',
36
+ icon = getAppContext().icons.check,
37
+ intermediateicon = getAppContext().icons.minus,
38
38
  label,
39
39
  description,
40
40
  required,
41
41
  indicator = 'start',
42
42
  as = 'div',
43
- ui = {}
43
+ ui = {},
44
44
  }: CheckboxProps = $props();
45
45
  const id = $props.id();
46
46
 
47
- const classes = $derived.by(() =>
47
+ const variants = $derived.by(() =>
48
48
  tv({
49
49
  slots: {
50
50
  root: 'relative flex-inline gap-2',
51
51
  container:
52
- 'rounded-md border border-neutral-200 relative transition m-0.5 mr-0 grid place-items-center',
52
+ 'rounded-md border border-surface-accented relative transition m-0.5 mr-0 grid place-items-center',
53
53
  icon: 'pi text-white',
54
54
  label: 'text-sm font-medium',
55
- description: 'text-sm text-neutral-500'
55
+ description: 'text-sm text-label-muted',
56
56
  },
57
57
  variants: {
58
58
  color: {
59
59
  primary: {
60
- container: [value && 'bg-primary-500 border-primary-500 text-primary-500']
60
+ container: [value && 'bg-primary-500 border-primary-500 text-primary-500'],
61
61
  },
62
62
  surface: {
63
- container: [value && 'bg-neutral-900 border-neutral-900 text-neutral-900']
63
+ container: [
64
+ value && 'bg-surface-inverted border-surface-inverted text-surface-inverted',
65
+ ],
64
66
  },
65
67
  info: {
66
- container: [value && 'bg-info-500 border-info-500 text-info-500']
68
+ container: [value && 'bg-info-500 border-info-500 text-info-500'],
67
69
  },
68
70
  success: {
69
- container: [value && 'bg-success-500 border-success-500 text-success-500']
71
+ container: [value && 'bg-success-500 border-success-500 text-success-500'],
70
72
  },
71
73
  warning: {
72
- container: [value && 'bg-warning-500 border-warning-500 text-warning-500']
74
+ container: [value && 'bg-warning-500 border-warning-500 text-warning-500'],
73
75
  },
74
76
  error: {
75
- container: [value && 'bg-error-500 border-error-500 text-error-500']
76
- }
77
+ container: [value && 'bg-error-500 border-error-500 text-error-500'],
78
+ },
77
79
  },
78
80
  size: {
79
81
  xs: {
80
82
  container: 'size-3',
81
- icon: 'size-3'
83
+ icon: 'size-3',
82
84
  },
83
85
  sm: {
84
86
  container: 'size-3.5',
85
- icon: 'size-3.5'
87
+ icon: 'size-3.5',
86
88
  },
87
89
  md: {
88
90
  container: 'size-4',
89
- icon: 'size-4'
91
+ icon: 'size-4',
90
92
  },
91
93
  lg: {
92
94
  container: 'size-4.5',
93
- icon: 'size-4.5'
95
+ icon: 'size-4.5',
94
96
  },
95
97
  xl: {
96
98
  container: 'size-5',
97
- icon: 'size-5'
98
- }
99
+ icon: 'size-5',
100
+ },
99
101
  },
100
102
  indicator: {
101
103
  start: '',
102
104
  end: {
103
- root: 'flex-row-reverse'
105
+ root: 'flex-row-reverse',
104
106
  },
105
107
  hidden: {
106
- container: 'hidden'
107
- }
108
- }
108
+ container: 'hidden',
109
+ },
110
+ },
109
111
  },
110
- compoundVariants: []
111
- })({ color, size, indicator })
112
+ compoundVariants: [],
113
+ })({ color, size, indicator }),
112
114
  );
113
115
  </script>
114
116
 
115
117
  <svelte:element
116
118
  this={as}
117
119
  data-state={value ? 'checked' : 'unchecked'}
118
- class={classes.root({
119
- class: [disabled && 'opacity-50', ui.root]
120
+ class={variants.root({
121
+ class: [disabled && 'opacity-50', ui.root],
120
122
  })}
121
123
  >
122
124
  <button
123
125
  {id}
124
126
  aria-label="checkbox"
125
- class={classes.container({ class: [ui.container] })}
127
+ class={variants.container({ class: [ui.container] })}
126
128
  onclick={() => {
127
129
  if (disabled) return;
128
130
  if (value === 'intermediate') return (value = true);
@@ -137,8 +139,8 @@
137
139
  <div class="flex flex-col justify-start">
138
140
  <label
139
141
  for={id}
140
- class={classes.label({
141
- class: [required ? 'after:content-["*"] after:text-error-500' : '', ui.label]
142
+ class={variants.label({
143
+ class: [required ? 'after:content-["*"] after:text-error-500' : '', ui.label],
142
144
  })}
143
145
  >
144
146
  {#if typeof label === 'string'}
@@ -149,7 +151,7 @@
149
151
  </label>
150
152
 
151
153
  {#if description}
152
- <div class={classes.description({ class: ui.description })}>
154
+ <div class={variants.description({ class: ui.description })}>
153
155
  {#if typeof description === 'string'}
154
156
  {description}
155
157
  {:else}
@@ -161,10 +163,10 @@
161
163
  {/if}
162
164
  </svelte:element>
163
165
 
164
- {#snippet Icon(ico?: CheckboxProps['icon'], icon_class?: ClassNameValue)}
166
+ {#snippet Icon(ico?: CheckboxProps['icon'], icon_class?: ClassValue)}
165
167
  <div class={['absolute', icon_class]}>
166
168
  {#if typeof ico === 'string'}
167
- <div class={classes.icon({ class: [ico, ui.icon] })}></div>
169
+ <div class={variants.icon({ class: [ico, ui.icon] })}></div>
168
170
  {:else if isSnippet(ico)}
169
171
  {@render ico()}
170
172
  {:else if isComponent(ico)}
@@ -1,6 +1,6 @@
1
1
  import { type PropColor } from '../index.js';
2
2
  import type { Snippet } from 'svelte';
3
- import type { ClassNameValue } from 'tailwind-merge';
3
+ import { type ClassValue } from 'tailwind-variants';
4
4
  import type { Component } from 'vitest-browser-svelte';
5
5
  export type CheckboxProps = {
6
6
  value?: boolean | 'intermediate';
@@ -15,11 +15,11 @@ export type CheckboxProps = {
15
15
  indicator?: 'start' | 'end' | 'hidden';
16
16
  as?: string;
17
17
  ui?: {
18
- root?: ClassNameValue;
19
- container?: ClassNameValue;
20
- icon?: ClassNameValue;
21
- label?: ClassNameValue;
22
- description?: ClassNameValue;
18
+ root?: ClassValue;
19
+ container?: ClassValue;
20
+ icon?: ClassValue;
21
+ label?: ClassValue;
22
+ description?: ClassValue;
23
23
  };
24
24
  };
25
25
  declare const Checkbox: import("svelte").Component<CheckboxProps, {}, "value">;
@@ -1,8 +1,7 @@
1
1
  <script module lang="ts">
2
2
  import type { PropColor } from '../index.js';
3
3
  import type { Snippet } from 'svelte';
4
- import type { ClassNameValue } from 'tailwind-merge';
5
- import { tv } from 'tailwind-variants';
4
+ import { tv, type ClassValue } from 'tailwind-variants';
6
5
 
7
6
  export type ChipProps = {
8
7
  children: Snippet;
@@ -11,8 +10,8 @@
11
10
  position?: 'top-left' | 'top-right' | 'bottom-right' | 'bottom-left';
12
11
  size?: number;
13
12
  ui?: {
14
- base?: ClassNameValue;
15
- chip?: ClassNameValue;
13
+ base?: ClassValue;
14
+ chip?: ClassValue;
16
15
  };
17
16
  };
18
17
  </script>
@@ -27,12 +26,12 @@
27
26
  ui = {},
28
27
  }: ChipProps = $props();
29
28
 
30
- const classes = $derived.by(() =>
29
+ const variants = $derived.by(() =>
31
30
  tv({
32
31
  slots: {
33
32
  base: 'relative inline-flex items-center justify-center shrink-0',
34
33
  chip: [
35
- 'absolute rounded-full ring ring-inverted flex items-center justify-center text-inverted font-medium whitespace-nowrap',
34
+ 'absolute rounded-full ring ring-inverted flex items-center justify-center text-label-inverted font-medium whitespace-nowrap',
36
35
  '-translate-y-1/2 translate-x-1/2 px-0.5',
37
36
  ],
38
37
  },
@@ -68,11 +67,11 @@
68
67
  );
69
68
  </script>
70
69
 
71
- <div class={classes.base({ class: [ui.base] })}>
70
+ <div class={variants.base({ class: [ui.base] })}>
72
71
  {@render children()}
73
72
 
74
73
  <span
75
- class={classes.chip({ class: ui.chip })}
74
+ class={variants.chip({ class: ui.chip })}
76
75
  style:height="{size}px"
77
76
  style:min-width="{size}px"
78
77
  style:font-size="{size}px"
@@ -1,6 +1,6 @@
1
1
  import type { PropColor } from '../index.js';
2
2
  import type { Snippet } from 'svelte';
3
- import type { ClassNameValue } from 'tailwind-merge';
3
+ import { type ClassValue } from 'tailwind-variants';
4
4
  export type ChipProps = {
5
5
  children: Snippet;
6
6
  text?: string;
@@ -8,8 +8,8 @@ export type ChipProps = {
8
8
  position?: 'top-left' | 'top-right' | 'bottom-right' | 'bottom-left';
9
9
  size?: number;
10
10
  ui?: {
11
- base?: ClassNameValue;
12
- chip?: ClassNameValue;
11
+ base?: ClassValue;
12
+ chip?: ClassValue;
13
13
  };
14
14
  };
15
15
  declare const Chip: import("svelte").Component<ChipProps, {}, "">;
@@ -2,21 +2,22 @@
2
2
  import { type ButtonProps, Button } from '../index.js';
3
3
  import { Collapsible } from 'bits-ui';
4
4
  import { defu } from 'defu';
5
- import type { ClassNameValue } from 'tailwind-merge';
6
- import { tv } from 'tailwind-variants';
5
+ import { tv, type ClassValue } from 'tailwind-variants';
7
6
 
8
7
  export type CollapsibleProps = ButtonProps & {
9
8
  open?: boolean;
10
9
  disabled?: boolean;
11
- class?: ClassNameValue;
10
+ class?: ClassValue;
12
11
  ui?: {
13
- root?: ClassNameValue;
14
- content?: ClassNameValue;
12
+ root?: ClassValue;
13
+ content?: ClassValue;
15
14
  };
16
15
  };
17
16
  </script>
18
17
 
19
18
  <script lang="ts">
19
+ import { getAppContext } from '../contexts.js';
20
+
20
21
  let {
21
22
  open = $bindable(false),
22
23
  children,
@@ -41,7 +42,7 @@
41
42
  {#snippet child({ props })}
42
43
  <Button
43
44
  {...props}
44
- trailingicon="i-lucide-chevron-down"
45
+ trailingicon={getAppContext().icons.chevrondown}
45
46
  {...rest}
46
47
  block
47
48
  ui={defu(ui, { trailingicon: 'ms-auto' })}
@@ -1,13 +1,13 @@
1
1
  import { type ButtonProps } from '../index.js';
2
2
  import { Collapsible } from 'bits-ui';
3
- import type { ClassNameValue } from 'tailwind-merge';
3
+ import { type ClassValue } from 'tailwind-variants';
4
4
  export type CollapsibleProps = ButtonProps & {
5
5
  open?: boolean;
6
6
  disabled?: boolean;
7
- class?: ClassNameValue;
7
+ class?: ClassValue;
8
8
  ui?: {
9
- root?: ClassNameValue;
10
- content?: ClassNameValue;
9
+ root?: ClassValue;
10
+ content?: ClassValue;
11
11
  };
12
12
  };
13
13
  declare const Collapsible: import("svelte").Component<CollapsibleProps, {}, "open">;
@@ -22,7 +22,7 @@
22
22
 
23
23
  const translated = $derived(new ColorTranslator(value));
24
24
 
25
- const classes = $derived(
25
+ const variants = $derived(
26
26
  tv({
27
27
  slots: {
28
28
  root: '',
@@ -2,14 +2,15 @@
2
2
  import type { SvelteHTMLElements } from 'svelte/elements';
3
3
  import { cn } from 'tailwind-variants';
4
4
  const { children, class: classes, ...rest }: SvelteHTMLElements['h1'] = $props();
5
+
6
+ const classname = $derived(
7
+ cn(
8
+ 'text-4xl font-bold mb-8 scroll-mt-[calc(45px+var(--ui-header-height))] lg:scroll-mt-(--ui-header-height)',
9
+ classes,
10
+ ),
11
+ );
5
12
  </script>
6
13
 
7
- <h1
8
- {...rest}
9
- class={cn(
10
- 'text-4xl font-bold mb-8 scroll-mt-[calc(45px+var(--ui-header-height))] lg:scroll-mt-(--ui-header-height)',
11
- classes,
12
- )}
13
- >
14
+ <h1 {...rest} class={classname}>
14
15
  {@render children?.()}
15
16
  </h1>
@@ -2,18 +2,19 @@
2
2
  import type { SvelteHTMLElements } from 'svelte/elements';
3
3
  import { cn } from 'tailwind-variants';
4
4
  const { children, class: classes, ...rest }: SvelteHTMLElements['h2'] = $props();
5
+
6
+ const classname = $derived(
7
+ cn(
8
+ 'relative text-2xl text-label-highlighted font-bold mt-12 mb-6',
9
+ 'scroll-mt-[calc(48px+45px+var(--ui-header-height))] lg:scroll-mt-[calc(48px+var(--ui-header-height))]',
10
+ '[&>a]:focus-visible:outline-primary',
11
+ '[&>a>code]:transition-colors [&>a>code]:border-dashed [&>a>code]:font-bold [&>a>code]:text-xl/7',
12
+ 'hover:[&>a>code]:border-primary hover:[&>a>code]:text-primary',
13
+ classes,
14
+ ),
15
+ );
5
16
  </script>
6
17
 
7
- <h2
8
- {...rest}
9
- class={cn(
10
- 'relative text-2xl text-highlighted font-bold mt-12 mb-6',
11
- 'scroll-mt-[calc(48px+45px+var(--ui-header-height))] lg:scroll-mt-[calc(48px+var(--ui-header-height))]',
12
- '[&>a]:focus-visible:outline-primary',
13
- '[&>a>code]:transition-colors [&>a>code]:border-dashed [&>a>code]:font-bold [&>a>code]:text-xl/7',
14
- 'hover:[&>a>code]:border-primary hover:[&>a>code]:text-primary',
15
- classes,
16
- )}
17
- >
18
+ <h2 {...rest} class={classname}>
18
19
  {@render children?.()}
19
20
  </h2>
@@ -2,15 +2,16 @@
2
2
  import type { SvelteHTMLElements } from 'svelte/elements';
3
3
  import { cn } from 'tailwind-variants';
4
4
  const { children, class: classes, ...rest }: SvelteHTMLElements['h3'] = $props();
5
+
6
+ const classname = $derived(
7
+ cn(
8
+ 'relative text-xl text-label-highlighted font-bold mt-8 mb-3 scroll-mt-[calc(32px+45px+var(--ui-header-height))] lg:scroll-mt-[calc(32px+var(--ui-header-height))] [&>a]:focus-visible:outline-primary [&>a>code]:border-dashed hover:[&>a>code]:border-primary hover:[&>a>code]:text-primary [&>a>code]:text-lg/6 [&>a>code]:font-bold',
9
+ '[&>a>code]:transition-colors',
10
+ classes,
11
+ ),
12
+ );
5
13
  </script>
6
14
 
7
- <h3
8
- {...rest}
9
- class={cn(
10
- 'relative text-xl text-highlighted font-bold mt-8 mb-3 scroll-mt-[calc(32px+45px+var(--ui-header-height))] lg:scroll-mt-[calc(32px+var(--ui-header-height))] [&>a]:focus-visible:outline-primary [&>a>code]:border-dashed hover:[&>a>code]:border-primary hover:[&>a>code]:text-primary [&>a>code]:text-lg/6 [&>a>code]:font-bold',
11
- '[&>a>code]:transition-colors',
12
- classes,
13
- )}
14
- >
15
+ <h3 {...rest} class={classname}>
15
16
  {@render children?.()}
16
17
  </h3>
@@ -2,18 +2,19 @@
2
2
  import type { SvelteHTMLElements } from 'svelte/elements';
3
3
  import { cn } from 'tailwind-variants';
4
4
  const { children, class: classes, ...rest }: SvelteHTMLElements['h4'] = $props();
5
+
6
+ const classname = $derived(
7
+ cn(
8
+ 'relative text-2xl text-label-highlighted font-bold mt-12 mb-6',
9
+ 'scroll-mt-[calc(48px+45px+var(--ui-header-height))] lg:scroll-mt-[calc(48px+var(--ui-header-height))]',
10
+ 'hover:[&>a>code]:border-primary hover:[&>a>code]:text-primary',
11
+ '[&>a>code]:transition-colors [&>a>code]:text-xl/7 [&>a>code]:font-bold [&>a>code]:border-dashed',
12
+ '[&>a]:focus-visible:outline-primary',
13
+ classes,
14
+ ),
15
+ );
5
16
  </script>
6
17
 
7
- <h4
8
- {...rest}
9
- class={cn(
10
- 'relative text-2xl text-highlighted font-bold mt-12 mb-6',
11
- 'scroll-mt-[calc(48px+45px+var(--ui-header-height))] lg:scroll-mt-[calc(48px+var(--ui-header-height))]',
12
- 'hover:[&>a>code]:border-primary hover:[&>a>code]:text-primary',
13
- '[&>a>code]:transition-colors [&>a>code]:text-xl/7 [&>a>code]:font-bold [&>a>code]:border-dashed',
14
- '[&>a]:focus-visible:outline-primary',
15
- classes,
16
- )}
17
- >
18
+ <h4 {...rest} class={classname}>
18
19
  {@render children?.()}
19
20
  </h4>
@@ -2,18 +2,19 @@
2
2
  import type { SvelteHTMLElements } from 'svelte/elements';
3
3
  import { cn } from 'tailwind-variants';
4
4
  const { children, class: classes, ...rest }: SvelteHTMLElements['h5'] = $props();
5
+
6
+ const classname = $derived(
7
+ cn(
8
+ 'relative text-2xl text-label-highlighted font-bold mt-12 mb-6',
9
+ 'scroll-mt-[calc(48px+45px+var(--ui-header-height))] lg:scroll-mt-[calc(48px+var(--ui-header-height))]',
10
+ 'hover:[&>a>code]:border-primary hover:[&>a>code]:text-primary',
11
+ '[&>a>code]:transition-colors [&>a>code]:text-xl/7 [&>a>code]:font-bold [&>a>code]:border-dashed',
12
+ '[&>a]:focus-visible:outline-primary',
13
+ classes,
14
+ ),
15
+ );
5
16
  </script>
6
17
 
7
- <h5
8
- {...rest}
9
- class={cn(
10
- 'relative text-2xl text-highlighted font-bold mt-12 mb-6',
11
- 'scroll-mt-[calc(48px+45px+var(--ui-header-height))] lg:scroll-mt-[calc(48px+var(--ui-header-height))]',
12
- 'hover:[&>a>code]:border-primary hover:[&>a>code]:text-primary',
13
- '[&>a>code]:transition-colors [&>a>code]:text-xl/7 [&>a>code]:font-bold [&>a>code]:border-dashed',
14
- '[&>a]:focus-visible:outline-primary',
15
- classes,
16
- )}
17
- >
18
+ <h5 {...rest} class={classname}>
18
19
  {@render children?.()}
19
20
  </h5>
@@ -2,18 +2,19 @@
2
2
  import type { SvelteHTMLElements } from 'svelte/elements';
3
3
  import { cn } from 'tailwind-variants';
4
4
  const { children, class: classes, ...rest }: SvelteHTMLElements['h6'] = $props();
5
+
6
+ const classname = $derived(
7
+ cn(
8
+ 'relative text-2xl text-label-highlighted font-bold mt-12 mb-6',
9
+ 'scroll-mt-[calc(48px+45px+var(--ui-header-height))] lg:scroll-mt-[calc(48px+var(--ui-header-height))]',
10
+ 'hover:[&>a>code]:border-primary hover:[&>a>code]:text-primary',
11
+ '[&>a>code]:transition-colors [&>a>code]:text-xl/7 [&>a>code]:font-bold [&>a>code]:border-dashed',
12
+ '[&>a]:focus-visible:outline-primary',
13
+ classes,
14
+ ),
15
+ );
5
16
  </script>
6
17
 
7
- <h6
8
- {...rest}
9
- class={cn(
10
- 'relative text-2xl text-highlighted font-bold mt-12 mb-6',
11
- 'scroll-mt-[calc(48px+45px+var(--ui-header-height))] lg:scroll-mt-[calc(48px+var(--ui-header-height))]',
12
- 'hover:[&>a>code]:border-primary hover:[&>a>code]:text-primary',
13
- '[&>a>code]:transition-colors [&>a>code]:text-xl/7 [&>a>code]:font-bold [&>a>code]:border-dashed',
14
- '[&>a]:focus-visible:outline-primary',
15
- classes,
16
- )}
17
- >
18
+ <h6 {...rest} class={classname}>
18
19
  {@render children?.()}
19
20
  </h6>
@@ -55,3 +55,10 @@ export * from './breadcrumb.svelte';
55
55
  export { default as Breadcrumb } from './breadcrumb.svelte';
56
56
  export * from './input-number.svelte';
57
57
  export { default as InputNumber } from './input-number.svelte';
58
+ export * from './modal.svelte';
59
+ export { default as Modal } from './modal.svelte';
60
+ export * from './tooltip.svelte';
61
+ export { default as Tooltip } from './tooltip.svelte';
62
+ export * from './app.svelte';
63
+ export { default as App } from './app.svelte';
64
+ export * from './toast.svelte.js';
@@ -55,3 +55,10 @@ export * from './breadcrumb.svelte';
55
55
  export { default as Breadcrumb } from './breadcrumb.svelte';
56
56
  export * from './input-number.svelte';
57
57
  export { default as InputNumber } from './input-number.svelte';
58
+ export * from './modal.svelte';
59
+ export { default as Modal } from './modal.svelte';
60
+ export * from './tooltip.svelte';
61
+ export { default as Tooltip } from './tooltip.svelte';
62
+ export * from './app.svelte';
63
+ export { default as App } from './app.svelte';
64
+ export * from './toast.svelte.js';
@@ -7,10 +7,9 @@
7
7
  type PropVariant,
8
8
  } from '../index.js';
9
9
  import type { SvelteHTMLElements } from 'svelte/elements';
10
- import type { ClassNameValue } from 'tailwind-merge';
11
- import { tv } from 'tailwind-variants';
12
- import Accordion from './accordion.svelte';
10
+ import { tv, type ClassValue } from 'tailwind-variants';
13
11
  import { useId } from 'bits-ui';
12
+ import { getAppContext } from '../contexts.js';
14
13
 
15
14
  export type InputNumberProps = Omit<SvelteHTMLElements['input'], 'size' | 'value'> & {
16
15
  value?: number;
@@ -38,10 +37,10 @@
38
37
  focusonchange?: boolean;
39
38
  autocomplete?: 'on' | 'off' | string;
40
39
  ui?: {
41
- root?: ClassNameValue;
42
- base?: ClassNameValue;
43
- increment?: ClassNameValue;
44
- decrement?: ClassNameValue;
40
+ root?: ClassValue;
41
+ base?: ClassValue;
42
+ increment?: ClassValue;
43
+ decrement?: ClassValue;
45
44
  };
46
45
  };
47
46
  </script>
@@ -156,7 +155,7 @@
156
155
  {#if increment}
157
156
  <Button
158
157
  variant="link"
159
- icon="i-lucide:minus"
158
+ icon={getAppContext().icons.minus}
160
159
  onclick={() => {
161
160
  value = value === undefined ? 0 : value - 1;
162
161
  }}
@@ -166,7 +165,7 @@
166
165
  {#if increment}
167
166
  <Button
168
167
  variant="link"
169
- icon="i-lucide:plus"
168
+ icon={getAppContext().icons.plus}
170
169
  onclick={() => {
171
170
  value = value === undefined ? 0 : value + 1;
172
171
  }}
@@ -1,6 +1,6 @@
1
1
  import { type ButtonProps, type PropColor, type PropSize, type PropVariant } from '../index.js';
2
2
  import type { SvelteHTMLElements } from 'svelte/elements';
3
- import type { ClassNameValue } from 'tailwind-merge';
3
+ import { type ClassValue } from 'tailwind-variants';
4
4
  export type InputNumberProps = Omit<SvelteHTMLElements['input'], 'size' | 'value'> & {
5
5
  value?: number;
6
6
  placeholder?: string;
@@ -27,10 +27,10 @@ export type InputNumberProps = Omit<SvelteHTMLElements['input'], 'size' | 'value
27
27
  focusonchange?: boolean;
28
28
  autocomplete?: 'on' | 'off' | string;
29
29
  ui?: {
30
- root?: ClassNameValue;
31
- base?: ClassNameValue;
32
- increment?: ClassNameValue;
33
- decrement?: ClassNameValue;
30
+ root?: ClassValue;
31
+ base?: ClassValue;
32
+ increment?: ClassValue;
33
+ decrement?: ClassValue;
34
34
  };
35
35
  };
36
36
  declare const InputNumber: import("svelte").Component<InputNumberProps, {}, "value">;