sv5ui 0.0.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.
Files changed (144) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +124 -0
  3. package/dist/Alert/Alert.svelte +120 -0
  4. package/dist/Alert/Alert.svelte.d.ts +5 -0
  5. package/dist/Alert/alert.types.d.ts +99 -0
  6. package/dist/Alert/alert.types.js +1 -0
  7. package/dist/Alert/alert.variants.d.ts +213 -0
  8. package/dist/Alert/alert.variants.js +293 -0
  9. package/dist/Alert/index.d.ts +2 -0
  10. package/dist/Alert/index.js +1 -0
  11. package/dist/Avatar/Avatar.svelte +70 -0
  12. package/dist/Avatar/Avatar.svelte.d.ts +6 -0
  13. package/dist/Avatar/avatar.types.d.ts +40 -0
  14. package/dist/Avatar/avatar.types.js +1 -0
  15. package/dist/Avatar/avatar.variants.d.ts +178 -0
  16. package/dist/Avatar/avatar.variants.js +28 -0
  17. package/dist/Avatar/index.d.ts +2 -0
  18. package/dist/Avatar/index.js +1 -0
  19. package/dist/AvatarGroup/AvatarGroup.svelte +66 -0
  20. package/dist/AvatarGroup/AvatarGroup.svelte.d.ts +5 -0
  21. package/dist/AvatarGroup/avatar-group.types.d.ts +34 -0
  22. package/dist/AvatarGroup/avatar-group.types.js +1 -0
  23. package/dist/AvatarGroup/avatar-group.variants.d.ts +173 -0
  24. package/dist/AvatarGroup/avatar-group.variants.js +45 -0
  25. package/dist/AvatarGroup/index.d.ts +2 -0
  26. package/dist/AvatarGroup/index.js +1 -0
  27. package/dist/Badge/Badge.svelte +74 -0
  28. package/dist/Badge/Badge.svelte.d.ts +5 -0
  29. package/dist/Badge/badge.types.d.ts +74 -0
  30. package/dist/Badge/badge.types.js +1 -0
  31. package/dist/Badge/badge.variants.d.ts +303 -0
  32. package/dist/Badge/badge.variants.js +245 -0
  33. package/dist/Badge/index.d.ts +2 -0
  34. package/dist/Badge/index.js +1 -0
  35. package/dist/Button/Button.svelte +103 -0
  36. package/dist/Button/Button.svelte.d.ts +6 -0
  37. package/dist/Button/button.types.d.ts +97 -0
  38. package/dist/Button/button.types.js +1 -0
  39. package/dist/Button/button.variants.d.ts +388 -0
  40. package/dist/Button/button.variants.js +461 -0
  41. package/dist/Button/index.d.ts +2 -0
  42. package/dist/Button/index.js +1 -0
  43. package/dist/Card/Card.svelte +53 -0
  44. package/dist/Card/Card.svelte.d.ts +5 -0
  45. package/dist/Card/card.types.d.ts +32 -0
  46. package/dist/Card/card.types.js +1 -0
  47. package/dist/Card/card.variants.d.ts +108 -0
  48. package/dist/Card/card.variants.js +32 -0
  49. package/dist/Card/index.d.ts +2 -0
  50. package/dist/Card/index.js +1 -0
  51. package/dist/Chip/Chip.svelte +50 -0
  52. package/dist/Chip/Chip.svelte.d.ts +5 -0
  53. package/dist/Chip/chip.types.d.ts +62 -0
  54. package/dist/Chip/chip.types.js +1 -0
  55. package/dist/Chip/chip.variants.d.ts +328 -0
  56. package/dist/Chip/chip.variants.js +58 -0
  57. package/dist/Chip/index.d.ts +2 -0
  58. package/dist/Chip/index.js +1 -0
  59. package/dist/Container/Container.svelte +27 -0
  60. package/dist/Container/Container.svelte.d.ts +5 -0
  61. package/dist/Container/container.types.d.ts +19 -0
  62. package/dist/Container/container.types.js +1 -0
  63. package/dist/Container/container.variants.d.ts +29 -0
  64. package/dist/Container/container.variants.js +9 -0
  65. package/dist/Container/index.d.ts +2 -0
  66. package/dist/Container/index.js +1 -0
  67. package/dist/Empty/Empty.svelte +83 -0
  68. package/dist/Empty/Empty.svelte.d.ts +5 -0
  69. package/dist/Empty/empty.types.d.ts +74 -0
  70. package/dist/Empty/empty.types.js +1 -0
  71. package/dist/Empty/empty.variants.d.ts +288 -0
  72. package/dist/Empty/empty.variants.js +364 -0
  73. package/dist/Empty/index.d.ts +2 -0
  74. package/dist/Empty/index.js +1 -0
  75. package/dist/Icon/Icon.svelte +40 -0
  76. package/dist/Icon/Icon.svelte.d.ts +6 -0
  77. package/dist/Icon/icon.types.d.ts +37 -0
  78. package/dist/Icon/icon.types.js +1 -0
  79. package/dist/Icon/index.d.ts +2 -0
  80. package/dist/Icon/index.js +1 -0
  81. package/dist/Kbd/Kbd.svelte +35 -0
  82. package/dist/Kbd/Kbd.svelte.d.ts +5 -0
  83. package/dist/Kbd/index.d.ts +3 -0
  84. package/dist/Kbd/index.js +2 -0
  85. package/dist/Kbd/kbd.types.d.ts +77 -0
  86. package/dist/Kbd/kbd.types.js +1 -0
  87. package/dist/Kbd/kbd.variants.d.ts +118 -0
  88. package/dist/Kbd/kbd.variants.js +96 -0
  89. package/dist/Kbd/useKbd.svelte.d.ts +29 -0
  90. package/dist/Kbd/useKbd.svelte.js +245 -0
  91. package/dist/Link/Link.svelte +117 -0
  92. package/dist/Link/Link.svelte.d.ts +5 -0
  93. package/dist/Link/index.d.ts +2 -0
  94. package/dist/Link/index.js +1 -0
  95. package/dist/Link/link.types.d.ts +68 -0
  96. package/dist/Link/link.types.js +1 -0
  97. package/dist/Link/link.variants.d.ts +138 -0
  98. package/dist/Link/link.variants.js +145 -0
  99. package/dist/Progress/Progress.svelte +89 -0
  100. package/dist/Progress/Progress.svelte.d.ts +6 -0
  101. package/dist/Progress/index.d.ts +2 -0
  102. package/dist/Progress/index.js +1 -0
  103. package/dist/Progress/progress.types.d.ts +63 -0
  104. package/dist/Progress/progress.types.js +1 -0
  105. package/dist/Progress/progress.variants.d.ts +483 -0
  106. package/dist/Progress/progress.variants.js +190 -0
  107. package/dist/Separator/Separator.svelte +67 -0
  108. package/dist/Separator/Separator.svelte.d.ts +6 -0
  109. package/dist/Separator/index.d.ts +2 -0
  110. package/dist/Separator/index.js +1 -0
  111. package/dist/Separator/separator.types.d.ts +48 -0
  112. package/dist/Separator/separator.types.js +1 -0
  113. package/dist/Separator/separator.variants.d.ts +488 -0
  114. package/dist/Separator/separator.variants.js +104 -0
  115. package/dist/Skeleton/Skeleton.svelte +31 -0
  116. package/dist/Skeleton/Skeleton.svelte.d.ts +5 -0
  117. package/dist/Skeleton/index.d.ts +2 -0
  118. package/dist/Skeleton/index.js +1 -0
  119. package/dist/Skeleton/skeleton.types.d.ts +18 -0
  120. package/dist/Skeleton/skeleton.types.js +1 -0
  121. package/dist/Skeleton/skeleton.variants.d.ts +18 -0
  122. package/dist/Skeleton/skeleton.variants.js +12 -0
  123. package/dist/Timeline/Timeline.svelte +106 -0
  124. package/dist/Timeline/Timeline.svelte.d.ts +5 -0
  125. package/dist/Timeline/index.d.ts +2 -0
  126. package/dist/Timeline/index.js +1 -0
  127. package/dist/Timeline/timeline.types.d.ts +130 -0
  128. package/dist/Timeline/timeline.types.js +1 -0
  129. package/dist/Timeline/timeline.variants.d.ts +413 -0
  130. package/dist/Timeline/timeline.variants.js +121 -0
  131. package/dist/User/User.svelte +94 -0
  132. package/dist/User/User.svelte.d.ts +5 -0
  133. package/dist/User/index.d.ts +2 -0
  134. package/dist/User/index.js +1 -0
  135. package/dist/User/user.types.d.ts +74 -0
  136. package/dist/User/user.types.js +1 -0
  137. package/dist/User/user.variants.d.ts +308 -0
  138. package/dist/User/user.variants.js +73 -0
  139. package/dist/config.d.ts +59 -0
  140. package/dist/config.js +94 -0
  141. package/dist/index.d.ts +19 -0
  142. package/dist/index.js +20 -0
  143. package/dist/theme.css +410 -0
  144. package/package.json +104 -0
@@ -0,0 +1,138 @@
1
+ import { type VariantProps } from 'tailwind-variants';
2
+ export declare const linkVariants: import("tailwind-variants").TVReturnType<{
3
+ color: {
4
+ primary: string;
5
+ secondary: string;
6
+ tertiary: string;
7
+ success: string;
8
+ warning: string;
9
+ error: string;
10
+ info: string;
11
+ };
12
+ active: {
13
+ true: string;
14
+ false: string;
15
+ };
16
+ disabled: {
17
+ true: {
18
+ base: string;
19
+ };
20
+ false: string;
21
+ };
22
+ raw: {
23
+ true: string;
24
+ false: string;
25
+ };
26
+ }, {
27
+ base: string[];
28
+ }, undefined, {
29
+ color: {
30
+ primary: string;
31
+ secondary: string;
32
+ tertiary: string;
33
+ success: string;
34
+ warning: string;
35
+ error: string;
36
+ info: string;
37
+ };
38
+ active: {
39
+ true: string;
40
+ false: string;
41
+ };
42
+ disabled: {
43
+ true: {
44
+ base: string;
45
+ };
46
+ false: string;
47
+ };
48
+ raw: {
49
+ true: string;
50
+ false: string;
51
+ };
52
+ }, {
53
+ base: string[];
54
+ }, import("tailwind-variants").TVReturnType<{
55
+ color: {
56
+ primary: string;
57
+ secondary: string;
58
+ tertiary: string;
59
+ success: string;
60
+ warning: string;
61
+ error: string;
62
+ info: string;
63
+ };
64
+ active: {
65
+ true: string;
66
+ false: string;
67
+ };
68
+ disabled: {
69
+ true: {
70
+ base: string;
71
+ };
72
+ false: string;
73
+ };
74
+ raw: {
75
+ true: string;
76
+ false: string;
77
+ };
78
+ }, {
79
+ base: string[];
80
+ }, undefined, unknown, unknown, undefined>>;
81
+ export type LinkVariantProps = VariantProps<typeof linkVariants>;
82
+ export type LinkSlots = keyof ReturnType<typeof linkVariants>;
83
+ export declare const linkDefaults: {
84
+ defaultVariants: import("tailwind-variants").TVDefaultVariants<{
85
+ color: {
86
+ primary: string;
87
+ secondary: string;
88
+ tertiary: string;
89
+ success: string;
90
+ warning: string;
91
+ error: string;
92
+ info: string;
93
+ };
94
+ active: {
95
+ true: string;
96
+ false: string;
97
+ };
98
+ disabled: {
99
+ true: {
100
+ base: string;
101
+ };
102
+ false: string;
103
+ };
104
+ raw: {
105
+ true: string;
106
+ false: string;
107
+ };
108
+ }, {
109
+ base: string[];
110
+ }, {
111
+ color: {
112
+ primary: string;
113
+ secondary: string;
114
+ tertiary: string;
115
+ success: string;
116
+ warning: string;
117
+ error: string;
118
+ info: string;
119
+ };
120
+ active: {
121
+ true: string;
122
+ false: string;
123
+ };
124
+ disabled: {
125
+ true: {
126
+ base: string;
127
+ };
128
+ false: string;
129
+ };
130
+ raw: {
131
+ true: string;
132
+ false: string;
133
+ };
134
+ }, {
135
+ base: string[];
136
+ }>;
137
+ slots: Partial<Record<LinkSlots, string>>;
138
+ };
@@ -0,0 +1,145 @@
1
+ import { tv } from 'tailwind-variants';
2
+ export const linkVariants = tv({
3
+ slots: {
4
+ base: [
5
+ 'inline-flex items-center',
6
+ 'transition-colors duration-200',
7
+ 'focus:outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary'
8
+ ]
9
+ },
10
+ variants: {
11
+ color: {
12
+ primary: '',
13
+ secondary: '',
14
+ tertiary: '',
15
+ success: '',
16
+ warning: '',
17
+ error: '',
18
+ info: ''
19
+ },
20
+ active: {
21
+ true: '',
22
+ false: ''
23
+ },
24
+ disabled: {
25
+ true: {
26
+ base: 'cursor-not-allowed opacity-75'
27
+ },
28
+ false: ''
29
+ },
30
+ raw: {
31
+ true: '',
32
+ false: ''
33
+ }
34
+ },
35
+ compoundVariants: [
36
+ // ========== PRIMARY ==========
37
+ {
38
+ color: 'primary',
39
+ active: true,
40
+ raw: false,
41
+ class: { base: 'text-primary' }
42
+ },
43
+ {
44
+ color: 'primary',
45
+ active: false,
46
+ disabled: false,
47
+ raw: false,
48
+ class: { base: 'text-primary/80 hover:text-primary' }
49
+ },
50
+ // ========== SECONDARY ==========
51
+ {
52
+ color: 'secondary',
53
+ active: true,
54
+ raw: false,
55
+ class: { base: 'text-secondary' }
56
+ },
57
+ {
58
+ color: 'secondary',
59
+ active: false,
60
+ disabled: false,
61
+ raw: false,
62
+ class: { base: 'text-secondary/80 hover:text-secondary' }
63
+ },
64
+ // ========== TERTIARY ==========
65
+ {
66
+ color: 'tertiary',
67
+ active: true,
68
+ raw: false,
69
+ class: { base: 'text-tertiary' }
70
+ },
71
+ {
72
+ color: 'tertiary',
73
+ active: false,
74
+ disabled: false,
75
+ raw: false,
76
+ class: { base: 'text-tertiary/80 hover:text-tertiary' }
77
+ },
78
+ // ========== SUCCESS ==========
79
+ {
80
+ color: 'success',
81
+ active: true,
82
+ raw: false,
83
+ class: { base: 'text-success' }
84
+ },
85
+ {
86
+ color: 'success',
87
+ active: false,
88
+ disabled: false,
89
+ raw: false,
90
+ class: { base: 'text-success/80 hover:text-success' }
91
+ },
92
+ // ========== WARNING ==========
93
+ {
94
+ color: 'warning',
95
+ active: true,
96
+ raw: false,
97
+ class: { base: 'text-warning' }
98
+ },
99
+ {
100
+ color: 'warning',
101
+ active: false,
102
+ disabled: false,
103
+ raw: false,
104
+ class: { base: 'text-warning/80 hover:text-warning' }
105
+ },
106
+ // ========== ERROR ==========
107
+ {
108
+ color: 'error',
109
+ active: true,
110
+ raw: false,
111
+ class: { base: 'text-error' }
112
+ },
113
+ {
114
+ color: 'error',
115
+ active: false,
116
+ disabled: false,
117
+ raw: false,
118
+ class: { base: 'text-error/80 hover:text-error' }
119
+ },
120
+ // ========== INFO ==========
121
+ {
122
+ color: 'info',
123
+ active: true,
124
+ raw: false,
125
+ class: { base: 'text-info' }
126
+ },
127
+ {
128
+ color: 'info',
129
+ active: false,
130
+ disabled: false,
131
+ raw: false,
132
+ class: { base: 'text-info/80 hover:text-info' }
133
+ }
134
+ ],
135
+ defaultVariants: {
136
+ color: 'primary',
137
+ active: false,
138
+ disabled: false,
139
+ raw: false
140
+ }
141
+ });
142
+ export const linkDefaults = {
143
+ defaultVariants: linkVariants.defaultVariants,
144
+ slots: {}
145
+ };
@@ -0,0 +1,89 @@
1
+ <script lang="ts" module>
2
+ import type { ProgressProps } from './progress.types.js'
3
+
4
+ export type Props = ProgressProps
5
+ </script>
6
+
7
+ <script lang="ts">
8
+ import { Progress } from 'bits-ui'
9
+ import { progressVariants, progressDefaults } from './progress.variants.js'
10
+ import { getComponentConfig } from '../config.js'
11
+
12
+ const config = getComponentConfig('progress', progressDefaults)
13
+
14
+ let {
15
+ ref = $bindable(null),
16
+ value = null,
17
+ max = 100,
18
+ status = false,
19
+ color = config.defaultVariants.color,
20
+ size = config.defaultVariants.size,
21
+ orientation = config.defaultVariants.orientation,
22
+ inverted = false,
23
+ animation = config.defaultVariants.animation,
24
+ ui,
25
+ class: className,
26
+ statusSlot,
27
+ ...restProps
28
+ }: Props = $props()
29
+
30
+ const maxValue = $derived(Array.isArray(max) ? max.length - 1 : max)
31
+ const percent = $derived(value != null ? Math.round((Math.min(value, maxValue) / maxValue) * 100) : 0)
32
+ const isIndeterminate = $derived(value == null)
33
+ const state = $derived(isIndeterminate ? 'indeterminate' : 'determinate')
34
+
35
+ const indicatorStyle = $derived.by(() => {
36
+ if (isIndeterminate) return ''
37
+ const offset = 100 - percent
38
+ if (orientation === 'horizontal') {
39
+ return inverted ? `transform: translateX(${offset}%);` : `transform: translateX(-${offset}%);`
40
+ }
41
+ // Vertical: fill from bottom to top (positive Y = down)
42
+ return inverted ? `transform: translateY(-${offset}%);` : `transform: translateY(${offset}%);`
43
+ })
44
+
45
+ const classes = $derived.by(() => {
46
+ const slots = progressVariants({ animation, color, size, orientation, inverted })
47
+ return {
48
+ root: slots.root({ class: [config.slots.root, className, ui?.root] }),
49
+ base: slots.base({ class: [config.slots.base, ui?.base] }),
50
+ indicator: slots.indicator({ class: [config.slots.indicator, ui?.indicator] }),
51
+ status: slots.status({ class: [config.slots.status, ui?.status] }),
52
+ stepsBase: slots.steps({ class: [config.slots.steps, ui?.steps] }),
53
+ stepActive: progressVariants({ size, step: 'active' }).steps(),
54
+ stepOther: progressVariants({ size, step: 'other' }).steps()
55
+ }
56
+ })
57
+ </script>
58
+
59
+ <Progress.Root
60
+ bind:ref
61
+ value={value ?? undefined}
62
+ max={maxValue}
63
+ class={classes.root}
64
+ {...restProps}
65
+ >
66
+ {#if status && !Array.isArray(max)}
67
+ <div class={classes.status} style={isIndeterminate ? '' : `width: ${percent}%;`}>
68
+ {#if statusSlot}
69
+ {@render statusSlot({ percent })}
70
+ {:else}
71
+ {percent}%
72
+ {/if}
73
+ </div>
74
+ {/if}
75
+
76
+ <div class={classes.base}>
77
+ <div class={classes.indicator} data-state={state} style={indicatorStyle}></div>
78
+ </div>
79
+
80
+ {#if Array.isArray(max)}
81
+ <div class={classes.stepsBase}>
82
+ {#each max as step, index (index)}
83
+ <span class={value != null && index <= value ? classes.stepActive : classes.stepOther}>
84
+ {step}
85
+ </span>
86
+ {/each}
87
+ </div>
88
+ {/if}
89
+ </Progress.Root>
@@ -0,0 +1,6 @@
1
+ import type { ProgressProps } from './progress.types.js';
2
+ export type Props = ProgressProps;
3
+ import { Progress } from 'bits-ui';
4
+ declare const Progress: import("svelte").Component<ProgressProps, {}, "ref">;
5
+ type Progress = ReturnType<typeof Progress>;
6
+ export default Progress;
@@ -0,0 +1,2 @@
1
+ export { default as Progress } from './Progress.svelte';
2
+ export type { ProgressProps } from './progress.types.js';
@@ -0,0 +1 @@
1
+ export { default as Progress } from './Progress.svelte';
@@ -0,0 +1,63 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { ClassNameValue } from 'tailwind-merge';
3
+ import type { Progress } from 'bits-ui';
4
+ import type { ProgressVariantProps, ProgressSlots } from './progress.variants.js';
5
+ export type ProgressProps = Omit<Progress.RootProps, 'max'> & {
6
+ /**
7
+ * The current progress value.
8
+ * When undefined or null, displays an indeterminate state.
9
+ */
10
+ value?: number | null;
11
+ /**
12
+ * The maximum value of the progress.
13
+ * Accepts a number or an array of strings for step-based display.
14
+ * @default 100
15
+ */
16
+ max?: number | string[];
17
+ /**
18
+ * Displays the status text showing current value relative to max.
19
+ * @default false
20
+ */
21
+ status?: boolean;
22
+ /**
23
+ * Sets the color scheme applied to the progress indicator.
24
+ * @default 'primary'
25
+ */
26
+ color?: NonNullable<ProgressVariantProps['color']>;
27
+ /**
28
+ * Controls the thickness of the progress bar.
29
+ * @default 'md'
30
+ */
31
+ size?: NonNullable<ProgressVariantProps['size']>;
32
+ /**
33
+ * Controls the layout direction of the progress bar.
34
+ * @default 'horizontal'
35
+ */
36
+ orientation?: NonNullable<ProgressVariantProps['orientation']>;
37
+ /**
38
+ * Inverts the fill direction of the progress bar.
39
+ * @default false
40
+ */
41
+ inverted?: boolean;
42
+ /**
43
+ * Sets the animation style for the indeterminate state.
44
+ * @default 'carousel'
45
+ */
46
+ animation?: NonNullable<ProgressVariantProps['animation']>;
47
+ /**
48
+ * Override styles for specific progress slots.
49
+ * Available slots: root, base, indicator, status, steps.
50
+ */
51
+ ui?: Partial<Record<ProgressSlots, ClassNameValue>>;
52
+ /**
53
+ * Additional CSS classes for the root element.
54
+ */
55
+ class?: ClassNameValue;
56
+ /**
57
+ * Custom content rendered in the status area.
58
+ * Takes precedence over the default status display.
59
+ */
60
+ statusSlot?: Snippet<[{
61
+ percent: number;
62
+ }]>;
63
+ };
@@ -0,0 +1 @@
1
+ export {};