horizon-design 0.0.4 → 0.0.6
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.
|
@@ -23,17 +23,18 @@
|
|
|
23
23
|
} as const;
|
|
24
24
|
|
|
25
25
|
const sizes = {
|
|
26
|
-
xs: 'h-6 gap-1.5 px-2 text-xs rounded-md [&_svg:not([class*="size-"])]:size-2.5',
|
|
27
|
-
sm: 'h-7 px-2.5 gap-1.5 rounded-md [&_svg:not([class*="size-"])]:size-3.5',
|
|
28
|
-
md: 'h-8 px-3 py-2 rounded-md',
|
|
29
|
-
lg: 'h-9 px-3.5 rounded-lg',
|
|
30
|
-
xl: 'h-10 text-base px-4 rounded-lg',
|
|
31
|
-
'icon-xs': 'size-6 rounded-md',
|
|
32
|
-
'icon-sm': 'size-7 rounded-md',
|
|
33
|
-
'icon-md': 'size-8 rounded-md',
|
|
34
|
-
'icon-lg': 'size-9 rounded-lg',
|
|
35
|
-
'icon-xl':
|
|
36
|
-
|
|
26
|
+
xs: 'inline-flex items-center justify-center h-6 gap-1.5 px-2 text-xs rounded-md [&_svg:not([class*="size-"])]:size-2.5',
|
|
27
|
+
sm: 'inline-flex items-center justify-center h-7 px-2.5 gap-1.5 rounded-md [&_svg:not([class*="size-"])]:size-3.5',
|
|
28
|
+
md: 'inline-flex items-center justify-center h-8 px-3 py-2 rounded-md',
|
|
29
|
+
lg: 'inline-flex items-center justify-center h-9 px-3.5 rounded-lg',
|
|
30
|
+
xl: 'inline-flex items-center justify-center h-10 text-base px-4 rounded-lg',
|
|
31
|
+
'icon-xs': 'inline-grid place-content-center size-6 rounded-md',
|
|
32
|
+
'icon-sm': 'inline-grid place-content-center size-7 rounded-md',
|
|
33
|
+
'icon-md': 'inline-grid place-content-center size-8 rounded-md',
|
|
34
|
+
'icon-lg': 'inline-grid place-content-center size-9 rounded-lg',
|
|
35
|
+
'icon-xl':
|
|
36
|
+
'inline-grid place-content-center size-10 rounded-lg [&_svg:not([class*="size-"])]:size-5'
|
|
37
|
+
};
|
|
37
38
|
|
|
38
39
|
type Variant = keyof typeof variants;
|
|
39
40
|
type Size = keyof typeof sizes;
|
|
@@ -51,7 +52,7 @@
|
|
|
51
52
|
}
|
|
52
53
|
|
|
53
54
|
const base =
|
|
54
|
-
'
|
|
55
|
+
'shrink-0 whitespace-nowrap font-medium text-sm transition-[background-color,border-color,color,opacity,transform,box-shadow] duration-200 ease-out outline-none focus-visible:ring-[3px] focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-60 [&_svg:not([class*="size-"])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0';
|
|
55
56
|
|
|
56
57
|
let {
|
|
57
58
|
variant = 'default',
|
|
@@ -85,7 +86,7 @@
|
|
|
85
86
|
disabled={isLoading || disabled}
|
|
86
87
|
{...rest}
|
|
87
88
|
>
|
|
88
|
-
<span class="flex items-center justify-center gap-2">
|
|
89
|
+
<span class="flex items-center justify-center gap-2 w-full">
|
|
89
90
|
{#if isLoading}
|
|
90
91
|
<Spinner aria-hidden="true" />
|
|
91
92
|
{/if}
|
|
@@ -20,16 +20,16 @@
|
|
|
20
20
|
{...rest}
|
|
21
21
|
>
|
|
22
22
|
<ScrollArea.Viewport
|
|
23
|
-
class="size-full
|
|
23
|
+
class="size-full scrollbar-none rounded-[inherit] [&::-webkit-scrollbar]:hidden"
|
|
24
24
|
>
|
|
25
25
|
{@render children?.()}
|
|
26
26
|
</ScrollArea.Viewport>
|
|
27
27
|
<ScrollArea.Scrollbar
|
|
28
28
|
orientation="vertical"
|
|
29
|
-
class="group/scrollbar flex w-2.5 touch-none border-l border-l-transparent p-px transition-colors select-none"
|
|
29
|
+
class="group/scrollbar hidden data-overflow-y:flex w-2.5 touch-none border-l border-l-transparent p-px transition-colors select-none"
|
|
30
30
|
>
|
|
31
31
|
<ScrollArea.Thumb
|
|
32
|
-
class="bg-border hover:bg-scroll-thumb group-data-
|
|
32
|
+
class="bg-border hover:bg-scroll-thumb group-data-scrolling/scrollbar:bg-scroll-thumb-hover group-data-dragging/scrollbar:bg-scroll-thumb-active relative flex-1 rounded-full transition-colors"
|
|
33
33
|
/>
|
|
34
34
|
</ScrollArea.Scrollbar>
|
|
35
35
|
<ScrollArea.Corner />
|