@noahbaumgartner/svelte-ui 0.0.5 → 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.
- package/LICENSE +21 -0
- package/README.md +20 -5
- package/dist/components/accordion/Accordion.svelte +16 -6
- package/dist/components/accordion/Accordion.svelte.d.ts +3 -1
- package/dist/components/accordion/AccordionItem.svelte +106 -67
- package/dist/components/accordion/AccordionItem.svelte.d.ts +5 -1
- package/dist/components/alert-dialog/AlertDialog.svelte +108 -76
- package/dist/components/alert-dialog/AlertDialog.svelte.d.ts +5 -2
- package/dist/components/avatar/Avatar.svelte +71 -49
- package/dist/components/avatar/Avatar.svelte.d.ts +5 -2
- package/dist/components/avatar-group/AvatarGroup.svelte +72 -45
- package/dist/components/avatar-group/AvatarGroup.svelte.d.ts +5 -1
- package/dist/components/badge/Badge.svelte +50 -28
- package/dist/components/badge/Badge.svelte.d.ts +6 -4
- package/dist/components/breadcrumb/Breadcrumb.svelte +21 -17
- package/dist/components/breadcrumb/Breadcrumb.svelte.d.ts +3 -1
- package/dist/components/breadcrumb/BreadcrumbEllipsis.svelte +17 -6
- package/dist/components/breadcrumb/BreadcrumbEllipsis.svelte.d.ts +5 -2
- package/dist/components/breadcrumb/BreadcrumbItem.svelte +75 -36
- package/dist/components/breadcrumb/BreadcrumbItem.svelte.d.ts +8 -5
- package/dist/components/breadcrumb/BreadcrumbSeparator.svelte +32 -9
- package/dist/components/breadcrumb/BreadcrumbSeparator.svelte.d.ts +10 -17
- package/dist/components/button/Button.svelte +206 -168
- package/dist/components/button/Button.svelte.d.ts +9 -5
- package/dist/components/button-group/ButtonGroup.svelte +52 -55
- package/dist/components/button-group/ButtonGroup.svelte.d.ts +3 -1
- package/dist/components/calendar/Calendar.svelte +232 -144
- package/dist/components/calendar/Calendar.svelte.d.ts +19 -2
- package/dist/components/calendar/dates.d.ts +4 -1
- package/dist/components/calendar/dates.js +8 -2
- package/dist/components/card/Card.svelte +48 -32
- package/dist/components/card/Card.svelte.d.ts +3 -1
- package/dist/components/card/CardAction.svelte +11 -7
- package/dist/components/card/CardAction.svelte.d.ts +3 -1
- package/dist/components/card/CardContent.svelte +8 -4
- package/dist/components/card/CardContent.svelte.d.ts +3 -1
- package/dist/components/card/CardDescription.svelte +11 -7
- package/dist/components/card/CardDescription.svelte.d.ts +3 -1
- package/dist/components/card/CardFooter.svelte +15 -11
- package/dist/components/card/CardFooter.svelte.d.ts +3 -1
- package/dist/components/card/CardHeader.svelte +15 -11
- package/dist/components/card/CardHeader.svelte.d.ts +3 -1
- package/dist/components/card/CardTitle.svelte +11 -7
- package/dist/components/card/CardTitle.svelte.d.ts +3 -1
- package/dist/components/checkbox/Checkbox.svelte +152 -61
- package/dist/components/checkbox/Checkbox.svelte.d.ts +5 -2
- package/dist/components/color-picker/ColorPicker.svelte +131 -78
- package/dist/components/color-picker/ColorPicker.svelte.d.ts +10 -1
- package/dist/components/context-menu/ContextMenu.svelte +78 -61
- package/dist/components/context-menu/ContextMenu.svelte.d.ts +5 -2
- package/dist/components/context-menu/ContextMenuInfo.svelte +91 -0
- package/dist/components/context-menu/ContextMenuInfo.svelte.d.ts +19 -0
- package/dist/components/context-menu/ContextMenuItem.svelte +102 -57
- package/dist/components/context-menu/ContextMenuItem.svelte.d.ts +10 -5
- package/dist/components/context-menu/ContextMenuLabel.svelte +28 -0
- package/dist/components/context-menu/ContextMenuLabel.svelte.d.ts +10 -0
- package/dist/components/context-menu/ContextMenuSeparator.svelte +29 -0
- package/dist/components/context-menu/ContextMenuSeparator.svelte.d.ts +8 -0
- package/dist/components/dialog/Dialog.svelte +149 -108
- package/dist/components/dialog/Dialog.svelte.d.ts +7 -2
- package/dist/components/drawer/Drawer.svelte +240 -189
- package/dist/components/drawer/Drawer.svelte.d.ts +7 -2
- package/dist/components/empty-state/EmptyState.svelte +67 -47
- package/dist/components/empty-state/EmptyState.svelte.d.ts +7 -4
- package/dist/components/entry/Entry.svelte +53 -42
- package/dist/components/entry/Entry.svelte.d.ts +2 -1
- package/dist/components/field/Field.svelte +66 -45
- package/dist/components/field/Field.svelte.d.ts +2 -1
- package/dist/components/field/FieldContent.svelte +11 -8
- package/dist/components/field/FieldContent.svelte.d.ts +2 -1
- package/dist/components/field/FieldDescription.svelte +18 -15
- package/dist/components/field/FieldDescription.svelte.d.ts +2 -1
- package/dist/components/field/FieldError.svelte +22 -13
- package/dist/components/field/FieldError.svelte.d.ts +2 -1
- package/dist/components/field/FieldGroup.svelte +15 -12
- package/dist/components/field/FieldGroup.svelte.d.ts +2 -1
- package/dist/components/field/FieldLegend.svelte +23 -14
- package/dist/components/field/FieldLegend.svelte.d.ts +2 -1
- package/dist/components/field/FieldSeparator.svelte +12 -9
- package/dist/components/field/FieldSeparator.svelte.d.ts +2 -1
- package/dist/components/field/FieldSet.svelte +18 -15
- package/dist/components/field/FieldSet.svelte.d.ts +2 -1
- package/dist/components/footer/Footer.svelte +63 -47
- package/dist/components/footer/Footer.svelte.d.ts +2 -1
- package/dist/components/footer/FooterColumn.svelte +17 -14
- package/dist/components/footer/FooterColumn.svelte.d.ts +2 -1
- package/dist/components/image/Image.svelte +61 -0
- package/dist/components/image/Image.svelte.d.ts +18 -0
- package/dist/components/input/Input.svelte +307 -208
- package/dist/components/input/Input.svelte.d.ts +12 -1
- package/dist/components/input-group/InputGroup.svelte +101 -61
- package/dist/components/input-group/InputGroup.svelte.d.ts +2 -1
- package/dist/components/input-group/InputGroupAddon.svelte +58 -49
- package/dist/components/kbd/Kbd.svelte +39 -30
- package/dist/components/kbd/Kbd.svelte.d.ts +2 -1
- package/dist/components/kbd/KbdGroup.svelte +15 -12
- package/dist/components/kbd/KbdGroup.svelte.d.ts +2 -1
- package/dist/components/label/Label.svelte +47 -28
- package/dist/components/label/Label.svelte.d.ts +2 -1
- package/dist/components/link/Link.svelte +71 -17
- package/dist/components/link/Link.svelte.d.ts +2 -1
- package/dist/components/mesh-gradient/MeshGradient.svelte +33 -22
- package/dist/components/mesh-gradient/MeshGradient.svelte.d.ts +2 -3
- package/dist/components/navbar/Navbar.svelte +137 -99
- package/dist/components/navbar/Navbar.svelte.d.ts +4 -2
- package/dist/components/navigation-menu/NavigationMenu.svelte +37 -20
- package/dist/components/navigation-menu/NavigationMenu.svelte.d.ts +4 -2
- package/dist/components/navigation-menu/NavigationMenuItem.svelte +131 -89
- package/dist/components/navigation-menu/NavigationMenuItem.svelte.d.ts +4 -2
- package/dist/components/navigation-menu/NavigationMenuLink.svelte +90 -51
- package/dist/components/navigation-menu/NavigationMenuLink.svelte.d.ts +7 -5
- package/dist/components/number-stepper/NumberStepper.svelte +39 -20
- package/dist/components/number-stepper/NumberStepper.svelte.d.ts +6 -1
- package/dist/components/popover/Popover.svelte +85 -65
- package/dist/components/popover/Popover.svelte.d.ts +5 -2
- package/dist/components/preview-card/PreviewCard.svelte +116 -98
- package/dist/components/preview-card/PreviewCard.svelte.d.ts +9 -6
- package/dist/components/progress/Progress.svelte +61 -38
- package/dist/components/progress/Progress.svelte.d.ts +2 -1
- package/dist/components/radio-group/RadioGroup.svelte +24 -19
- package/dist/components/radio-group/RadioGroup.svelte.d.ts +2 -1
- package/dist/components/radio-group/RadioGroupItem.svelte +101 -54
- package/dist/components/radio-group/RadioGroupItem.svelte.d.ts +2 -1
- package/dist/components/section/Section.svelte +114 -0
- package/dist/components/section/Section.svelte.d.ts +22 -0
- package/dist/components/select/Select.svelte +216 -133
- package/dist/components/select/Select.svelte.d.ts +11 -2
- package/dist/components/separator/Separator.svelte +21 -10
- package/dist/components/separator/Separator.svelte.d.ts +2 -1
- package/dist/components/sidebar/Sidebar.svelte +142 -108
- package/dist/components/sidebar/Sidebar.svelte.d.ts +6 -1
- package/dist/components/sidebar/SidebarContent.svelte +15 -12
- package/dist/components/sidebar/SidebarContent.svelte.d.ts +2 -1
- package/dist/components/sidebar/SidebarFooter.svelte +10 -7
- package/dist/components/sidebar/SidebarFooter.svelte.d.ts +2 -1
- package/dist/components/sidebar/SidebarGroup.svelte +35 -25
- package/dist/components/sidebar/SidebarGroup.svelte.d.ts +2 -1
- package/dist/components/sidebar/SidebarHeader.svelte +21 -16
- package/dist/components/sidebar/SidebarHeader.svelte.d.ts +6 -1
- package/dist/components/sidebar/SidebarInset.svelte +11 -8
- package/dist/components/sidebar/SidebarInset.svelte.d.ts +2 -1
- package/dist/components/sidebar/SidebarMenu.svelte +13 -10
- package/dist/components/sidebar/SidebarMenu.svelte.d.ts +2 -1
- package/dist/components/sidebar/SidebarMenuItem.svelte +195 -114
- package/dist/components/sidebar/SidebarMenuItem.svelte.d.ts +11 -5
- package/dist/components/sidebar/SidebarProvider.svelte +18 -9
- package/dist/components/sidebar/SidebarProvider.svelte.d.ts +2 -1
- package/dist/components/sidebar/SidebarSeparator.svelte +6 -1
- package/dist/components/sidebar/SidebarSeparator.svelte.d.ts +6 -17
- package/dist/components/sidebar/SidebarTrigger.svelte +17 -5
- package/dist/components/sidebar/SidebarTrigger.svelte.d.ts +4 -2
- package/dist/components/skeleton/Skeleton.svelte +26 -16
- package/dist/components/skeleton/Skeleton.svelte.d.ts +4 -2
- package/dist/components/spinner/Spinner.svelte +71 -46
- package/dist/components/spinner/Spinner.svelte.d.ts +2 -1
- package/dist/components/switch/Switch.svelte +126 -65
- package/dist/components/switch/Switch.svelte.d.ts +4 -2
- package/dist/components/table/Table.svelte +135 -76
- package/dist/components/table/Table.svelte.d.ts +12 -2
- package/dist/components/tabs/Tabs.svelte +173 -116
- package/dist/components/tabs/Tabs.svelte.d.ts +10 -8
- package/dist/components/textarea/Textarea.svelte +76 -42
- package/dist/components/textarea/Textarea.svelte.d.ts +4 -1
- package/dist/components/time-picker/TimePicker.svelte +214 -85
- package/dist/components/time-picker/TimePicker.svelte.d.ts +18 -1
- package/dist/components/toaster/Toaster.svelte +132 -70
- package/dist/components/toaster/Toaster.svelte.d.ts +18 -2
- package/dist/components/toaster/toast.svelte.d.ts +3 -3
- package/dist/components/toggle/Toggle.svelte +25 -4
- package/dist/components/toggle/Toggle.svelte.d.ts +1 -1
- package/dist/components/tooltip/Tooltip.svelte +87 -58
- package/dist/components/tooltip/Tooltip.svelte.d.ts +4 -2
- package/dist/icon.d.ts +12 -0
- package/dist/icon.js +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +5 -0
- package/dist/internal/icons/ArrowDown.svelte +14 -0
- package/dist/internal/icons/ArrowDown.svelte.d.ts +4 -0
- package/dist/internal/icons/ArrowUp.svelte +14 -0
- package/dist/internal/icons/ArrowUp.svelte.d.ts +4 -0
- package/dist/internal/icons/Calendar.svelte +16 -0
- package/dist/internal/icons/Calendar.svelte.d.ts +4 -0
- package/dist/internal/icons/Check.svelte +8 -0
- package/dist/internal/icons/Check.svelte.d.ts +4 -0
- package/dist/internal/icons/ChevronDown.svelte +8 -0
- package/dist/internal/icons/ChevronDown.svelte.d.ts +4 -0
- package/dist/internal/icons/ChevronLeft.svelte +8 -0
- package/dist/internal/icons/ChevronLeft.svelte.d.ts +4 -0
- package/dist/internal/icons/ChevronRight.svelte +8 -0
- package/dist/internal/icons/ChevronRight.svelte.d.ts +4 -0
- package/dist/internal/icons/ChevronUp.svelte +8 -0
- package/dist/internal/icons/ChevronUp.svelte.d.ts +4 -0
- package/dist/internal/icons/ChevronsUpDown.svelte +14 -0
- package/dist/internal/icons/ChevronsUpDown.svelte.d.ts +4 -0
- package/dist/internal/icons/Clock.svelte +14 -0
- package/dist/internal/icons/Clock.svelte.d.ts +4 -0
- package/dist/internal/icons/Ellipsis.svelte +15 -0
- package/dist/internal/icons/Ellipsis.svelte.d.ts +4 -0
- package/dist/internal/icons/Icon.svelte +33 -0
- package/dist/internal/icons/Icon.svelte.d.ts +8 -0
- package/dist/internal/icons/Minus.svelte +8 -0
- package/dist/internal/icons/Minus.svelte.d.ts +4 -0
- package/dist/internal/icons/PanelLeft.svelte +14 -0
- package/dist/internal/icons/PanelLeft.svelte.d.ts +4 -0
- package/dist/internal/icons/Plus.svelte +14 -0
- package/dist/internal/icons/Plus.svelte.d.ts +4 -0
- package/dist/internal/icons/User.svelte +14 -0
- package/dist/internal/icons/User.svelte.d.ts +4 -0
- package/dist/internal/icons/X.svelte +14 -0
- package/dist/internal/icons/X.svelte.d.ts +4 -0
- package/dist/styles/tokens.css +39 -41
- package/package.json +5 -10
- package/dist/icons.d.ts +0 -2
- package/dist/icons.js +0 -4
|
@@ -5,84 +5,124 @@
|
|
|
5
5
|
type Props = Omit<HTMLAttributes<HTMLDivElement>, 'children'> & {
|
|
6
6
|
/** An Input plus InputGroupAddons, in any order. */
|
|
7
7
|
children: Snippet;
|
|
8
|
+
ref?: HTMLDivElement | null;
|
|
8
9
|
};
|
|
9
10
|
|
|
10
|
-
let { class: className, children, ...rest }: Props = $props();
|
|
11
|
+
let { class: className, children, ref = $bindable(null), ...rest }: Props = $props();
|
|
11
12
|
</script>
|
|
12
13
|
|
|
13
|
-
<div {...rest} role="group" class={['input-group', className]}>
|
|
14
|
+
<div {...rest} bind:this={ref} role="group" class={['input-group', className]}>
|
|
14
15
|
{@render children()}
|
|
15
16
|
</div>
|
|
16
17
|
|
|
17
18
|
<style>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
19
|
+
@layer svelte-ui {
|
|
20
|
+
.input-group {
|
|
21
|
+
position: relative;
|
|
22
|
+
display: flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
box-sizing: border-box;
|
|
25
|
+
width: 100%;
|
|
26
|
+
min-width: 0;
|
|
27
|
+
height: 32px;
|
|
28
|
+
font-size: 13px;
|
|
29
|
+
color: var(--color-text);
|
|
30
|
+
border: 1px solid var(--color-border-strong);
|
|
31
|
+
border-radius: 10px;
|
|
32
|
+
transition: border-color 200ms ease;
|
|
33
|
+
}
|
|
32
34
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
35
|
+
/* The group draws border and focus ring instead of the Input */
|
|
36
|
+
.input-group > :global(.input),
|
|
37
|
+
.input-group > :global(.input-wrapper > .input),
|
|
38
|
+
.input-group > :global(.input:is(:focus-visible, [aria-invalid='true'])),
|
|
39
|
+
.input-group > :global(.input-wrapper > .input:is(:focus-visible, [aria-invalid='true'])) {
|
|
40
|
+
height: 30px;
|
|
41
|
+
border: none;
|
|
42
|
+
border-radius: 0;
|
|
43
|
+
outline: none;
|
|
44
|
+
background-color: transparent;
|
|
45
|
+
}
|
|
44
46
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
.input-group > :global(:is(.input, .input-wrapper)) {
|
|
48
|
+
flex: 1;
|
|
49
|
+
}
|
|
48
50
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
.input-group:has(:global(.input:focus-visible)) {
|
|
52
|
+
border-color: var(--color-accent);
|
|
53
|
+
outline: 1px solid var(--color-accent);
|
|
54
|
+
}
|
|
53
55
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
.input-group:has(:global([aria-invalid='true'])) {
|
|
57
|
+
border-color: var(--color-destructive);
|
|
58
|
+
outline-color: var(--color-destructive);
|
|
59
|
+
}
|
|
58
60
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
.input-group:has(:global(.input:disabled)) {
|
|
62
|
+
cursor: not-allowed;
|
|
63
|
+
opacity: 0.5;
|
|
64
|
+
}
|
|
63
65
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
.input-group:has(:global(.input:disabled)) :global(.input) {
|
|
67
|
+
opacity: 1;
|
|
68
|
+
}
|
|
67
69
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
/* Tighten the input's padding next to an inline addon */
|
|
71
|
+
.input-group:has(> :global(.input-group-addon--inline-start)) > :global(.input) {
|
|
72
|
+
padding-left: 6px;
|
|
73
|
+
}
|
|
72
74
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
75
|
+
.input-group:has(> :global(.input-group-addon--inline-end)) > :global(.input) {
|
|
76
|
+
padding-right: 6px;
|
|
77
|
+
}
|
|
76
78
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
/* Block addons stack above or below the input */
|
|
80
|
+
.input-group:has(
|
|
81
|
+
> :global(:is(.input-group-addon--block-start, .input-group-addon--block-end))
|
|
82
|
+
) {
|
|
83
|
+
flex-direction: column;
|
|
84
|
+
align-items: stretch;
|
|
85
|
+
height: auto;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.input-group:has(> :global(:is(.input-group-addon--block-start, .input-group-addon--block-end)))
|
|
89
|
+
> :global(:is(.input, .input-wrapper)) {
|
|
90
|
+
flex: none;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
@media (prefers-reduced-motion: reduce) {
|
|
94
|
+
.input-group {
|
|
95
|
+
transition: none;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
@media (forced-colors: active) {
|
|
100
|
+
.input-group:has(:global(.input:focus-visible)) {
|
|
101
|
+
border-color: Highlight;
|
|
102
|
+
outline: 2px solid Highlight;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.input-group:has(:global([aria-invalid='true'])) {
|
|
106
|
+
border-width: 2px;
|
|
107
|
+
border-style: dashed;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.input-group:has(:global(.input:disabled)) {
|
|
111
|
+
color: GrayText;
|
|
112
|
+
border-color: GrayText;
|
|
113
|
+
opacity: 1;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
@media (pointer: coarse) {
|
|
118
|
+
.input-group {
|
|
119
|
+
min-height: 44px;
|
|
120
|
+
}
|
|
83
121
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
122
|
+
.input-group > :global(.input),
|
|
123
|
+
.input-group > :global(.input-wrapper > .input) {
|
|
124
|
+
height: 42px;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
87
127
|
}
|
|
88
128
|
</style>
|
|
@@ -3,7 +3,8 @@ import type { HTMLAttributes } from 'svelte/elements';
|
|
|
3
3
|
type Props = Omit<HTMLAttributes<HTMLDivElement>, 'children'> & {
|
|
4
4
|
/** An Input plus InputGroupAddons, in any order. */
|
|
5
5
|
children: Snippet;
|
|
6
|
+
ref?: HTMLDivElement | null;
|
|
6
7
|
};
|
|
7
|
-
declare const InputGroup: import("svelte").Component<Props, {}, "">;
|
|
8
|
+
declare const InputGroup: import("svelte").Component<Props, {}, "ref">;
|
|
8
9
|
type InputGroup = ReturnType<typeof InputGroup>;
|
|
9
10
|
export default InputGroup;
|
|
@@ -26,63 +26,72 @@
|
|
|
26
26
|
</div>
|
|
27
27
|
|
|
28
28
|
<style>
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
29
|
+
@layer svelte-ui {
|
|
30
|
+
.input-group-addon {
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-shrink: 0;
|
|
33
|
+
align-items: center;
|
|
34
|
+
gap: 6px;
|
|
35
|
+
height: 100%;
|
|
36
|
+
font-size: 13px;
|
|
37
|
+
color: var(--color-text-muted);
|
|
38
|
+
white-space: nowrap;
|
|
39
|
+
cursor: text;
|
|
40
|
+
user-select: none;
|
|
41
|
+
}
|
|
41
42
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
.input-group-addon :global(svg) {
|
|
44
|
+
width: 16px;
|
|
45
|
+
height: 16px;
|
|
46
|
+
flex-shrink: 0;
|
|
47
|
+
}
|
|
47
48
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
/* Buttons shrink to fit inside the 32px group */
|
|
50
|
+
.input-group-addon > :global(.button) {
|
|
51
|
+
height: 24px;
|
|
52
|
+
border-radius: 6px;
|
|
53
|
+
}
|
|
53
54
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
.input-group-addon > :global(.button--icon-only) {
|
|
56
|
+
width: 24px;
|
|
57
|
+
}
|
|
57
58
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
.input-group-addon--inline-start {
|
|
60
|
+
order: -1;
|
|
61
|
+
padding-left: 10px;
|
|
62
|
+
}
|
|
62
63
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
.input-group-addon--inline-end {
|
|
65
|
+
order: 1;
|
|
66
|
+
padding-right: 10px;
|
|
67
|
+
}
|
|
67
68
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
69
|
+
.input-group-addon--block-start {
|
|
70
|
+
order: -1;
|
|
71
|
+
height: auto;
|
|
72
|
+
padding: 8px 10px 0;
|
|
73
|
+
}
|
|
73
74
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
75
|
+
.input-group-addon--block-end {
|
|
76
|
+
order: 1;
|
|
77
|
+
height: auto;
|
|
78
|
+
padding: 0 10px 8px;
|
|
79
|
+
}
|
|
79
80
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
/* Buttons sit 4px from the border, like the Input's own controls */
|
|
82
|
+
.input-group-addon--inline-start:has(> :global(.button:first-child)) {
|
|
83
|
+
padding-left: 4px;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.input-group-addon--inline-end:has(> :global(.button:last-child)) {
|
|
87
|
+
padding-right: 4px;
|
|
88
|
+
}
|
|
84
89
|
|
|
85
|
-
|
|
86
|
-
|
|
90
|
+
@media (pointer: coarse) {
|
|
91
|
+
.input-group-addon > :global(.button) {
|
|
92
|
+
min-width: 44px;
|
|
93
|
+
min-height: 44px;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
87
96
|
}
|
|
88
97
|
</style>
|
|
@@ -4,43 +4,52 @@
|
|
|
4
4
|
|
|
5
5
|
type Props = Omit<HTMLAttributes<HTMLElement>, 'children'> & {
|
|
6
6
|
children: Snippet;
|
|
7
|
+
ref?: HTMLElement | null;
|
|
7
8
|
};
|
|
8
9
|
|
|
9
|
-
let { class: className, children, ...rest }: Props = $props();
|
|
10
|
+
let { class: className, children, ref = $bindable(null), ...rest }: Props = $props();
|
|
10
11
|
</script>
|
|
11
12
|
|
|
12
|
-
<kbd {...rest} class={['kbd', className]}>{@render children()}</kbd>
|
|
13
|
+
<kbd {...rest} bind:this={ref} class={['kbd', className]}>{@render children()}</kbd>
|
|
13
14
|
|
|
14
15
|
<style>
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
16
|
+
@layer svelte-ui {
|
|
17
|
+
.kbd {
|
|
18
|
+
display: inline-flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
justify-content: center;
|
|
21
|
+
gap: 4px;
|
|
22
|
+
box-sizing: border-box;
|
|
23
|
+
width: fit-content;
|
|
24
|
+
min-width: 20px;
|
|
25
|
+
height: 20px;
|
|
26
|
+
padding: 0 4px;
|
|
27
|
+
font-family: inherit;
|
|
28
|
+
font-size: 12px;
|
|
29
|
+
line-height: 1;
|
|
30
|
+
background-color: var(--color-surface);
|
|
31
|
+
color: var(--color-text-muted);
|
|
32
|
+
border-radius: 4px;
|
|
33
|
+
pointer-events: none;
|
|
34
|
+
user-select: none;
|
|
35
|
+
}
|
|
34
36
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
.kbd :global(svg) {
|
|
38
|
+
width: 12px;
|
|
39
|
+
height: 12px;
|
|
40
|
+
flex-shrink: 0;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
:global(.button--primary) .kbd,
|
|
44
|
+
:global(.tooltip-content) .kbd {
|
|
45
|
+
background-color: color-mix(in srgb, currentColor 20%, transparent);
|
|
46
|
+
color: inherit;
|
|
47
|
+
}
|
|
40
48
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
49
|
+
@media (forced-colors: active) {
|
|
50
|
+
.kbd {
|
|
51
|
+
border: 1px solid CanvasText;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
45
54
|
}
|
|
46
55
|
</style>
|
|
@@ -2,7 +2,8 @@ import type { Snippet } from 'svelte';
|
|
|
2
2
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
3
|
type Props = Omit<HTMLAttributes<HTMLElement>, 'children'> & {
|
|
4
4
|
children: Snippet;
|
|
5
|
+
ref?: HTMLElement | null;
|
|
5
6
|
};
|
|
6
|
-
declare const Kbd: import("svelte").Component<Props, {}, "">;
|
|
7
|
+
declare const Kbd: import("svelte").Component<Props, {}, "ref">;
|
|
7
8
|
type Kbd = ReturnType<typeof Kbd>;
|
|
8
9
|
export default Kbd;
|
|
@@ -4,24 +4,27 @@
|
|
|
4
4
|
|
|
5
5
|
type Props = Omit<HTMLAttributes<HTMLElement>, 'children'> & {
|
|
6
6
|
children: Snippet;
|
|
7
|
+
ref?: HTMLElement | null;
|
|
7
8
|
};
|
|
8
9
|
|
|
9
|
-
let { class: className, children, ...rest }: Props = $props();
|
|
10
|
+
let { class: className, children, ref = $bindable(null), ...rest }: Props = $props();
|
|
10
11
|
</script>
|
|
11
12
|
|
|
12
|
-
<kbd {...rest} class={['kbd-group', className]}>{@render children()}</kbd>
|
|
13
|
+
<kbd {...rest} bind:this={ref} class={['kbd-group', className]}>{@render children()}</kbd>
|
|
13
14
|
|
|
14
15
|
<style>
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
@layer svelte-ui {
|
|
17
|
+
.kbd-group {
|
|
18
|
+
display: inline-flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
gap: 4px;
|
|
21
|
+
font-family: inherit;
|
|
22
|
+
font-size: 12px;
|
|
23
|
+
color: var(--color-text-muted);
|
|
24
|
+
}
|
|
23
25
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
:global(.tooltip-content) .kbd-group {
|
|
27
|
+
color: inherit;
|
|
28
|
+
}
|
|
26
29
|
}
|
|
27
30
|
</style>
|
|
@@ -2,7 +2,8 @@ import type { Snippet } from 'svelte';
|
|
|
2
2
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
3
|
type Props = Omit<HTMLAttributes<HTMLElement>, 'children'> & {
|
|
4
4
|
children: Snippet;
|
|
5
|
+
ref?: HTMLElement | null;
|
|
5
6
|
};
|
|
6
|
-
declare const KbdGroup: import("svelte").Component<Props, {}, "">;
|
|
7
|
+
declare const KbdGroup: import("svelte").Component<Props, {}, "ref">;
|
|
7
8
|
type KbdGroup = ReturnType<typeof KbdGroup>;
|
|
8
9
|
export default KbdGroup;
|
|
@@ -5,44 +5,63 @@
|
|
|
5
5
|
type Props = Omit<HTMLLabelAttributes, 'children'> & {
|
|
6
6
|
/** Set `for` to the control's id, or wrap the control. */
|
|
7
7
|
children: Snippet;
|
|
8
|
+
ref?: HTMLLabelElement | null;
|
|
8
9
|
};
|
|
9
10
|
|
|
10
|
-
let { class: className, children, ...rest }: Props = $props();
|
|
11
|
+
let { class: className, children, ref = $bindable(null), ...rest }: Props = $props();
|
|
11
12
|
</script>
|
|
12
13
|
|
|
13
|
-
<label {...rest} class={['label', className]}>
|
|
14
|
+
<label {...rest} bind:this={ref} class={['label', className]}>
|
|
14
15
|
{@render children()}
|
|
15
16
|
</label>
|
|
16
17
|
|
|
17
18
|
<style>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
@layer svelte-ui {
|
|
20
|
+
.label {
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
gap: 8px;
|
|
24
|
+
width: fit-content;
|
|
25
|
+
font-size: 13px;
|
|
26
|
+
font-weight: 500;
|
|
27
|
+
line-height: 1.4;
|
|
28
|
+
color: var(--color-text);
|
|
29
|
+
user-select: none;
|
|
30
|
+
}
|
|
29
31
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
/* Checkboxes and switches toggle on a label click, so show it */
|
|
33
|
+
.label:has(:global(:is(.checkbox, .switch))),
|
|
34
|
+
:global(:is(.checkbox, .switch)) + .label {
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
}
|
|
35
37
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
/* Dim with a disabled control, whether wrapped or placed right before the label */
|
|
39
|
+
.label:has(:global(:disabled)),
|
|
40
|
+
:global(:disabled) + .label,
|
|
41
|
+
:global(:is(.checkbox, .switch):has(:disabled)) + .label {
|
|
42
|
+
cursor: not-allowed;
|
|
43
|
+
opacity: 0.5;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* A wrapped control is already dimmed by the label */
|
|
47
|
+
.label:has(:global(:disabled)) :global(:disabled) {
|
|
48
|
+
opacity: 1;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@media (forced-colors: active) {
|
|
52
|
+
.label:has(:global(:disabled)),
|
|
53
|
+
:global(:disabled) + .label,
|
|
54
|
+
:global(:is(.checkbox, .switch):has(:disabled)) + .label {
|
|
55
|
+
color: GrayText;
|
|
56
|
+
opacity: 1;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
43
59
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
60
|
+
@media (pointer: coarse) {
|
|
61
|
+
.label:has(:global(:is(.checkbox, .switch, .radio))),
|
|
62
|
+
:global(:is(.checkbox, .switch, .radio)) + .label {
|
|
63
|
+
min-height: 44px;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
47
66
|
}
|
|
48
67
|
</style>
|
|
@@ -3,7 +3,8 @@ import type { HTMLLabelAttributes } from 'svelte/elements';
|
|
|
3
3
|
type Props = Omit<HTMLLabelAttributes, 'children'> & {
|
|
4
4
|
/** Set `for` to the control's id, or wrap the control. */
|
|
5
5
|
children: Snippet;
|
|
6
|
+
ref?: HTMLLabelElement | null;
|
|
6
7
|
};
|
|
7
|
-
declare const Label: import("svelte").Component<Props, {}, "">;
|
|
8
|
+
declare const Label: import("svelte").Component<Props, {}, "ref">;
|
|
8
9
|
type Label = ReturnType<typeof Label>;
|
|
9
10
|
export default Label;
|
|
@@ -6,35 +6,89 @@
|
|
|
6
6
|
/** External (http) links open in a new tab. */
|
|
7
7
|
href: string;
|
|
8
8
|
children: Snippet;
|
|
9
|
+
ref?: HTMLAnchorElement | null;
|
|
9
10
|
};
|
|
10
11
|
|
|
11
|
-
let {
|
|
12
|
+
let {
|
|
13
|
+
href,
|
|
14
|
+
target,
|
|
15
|
+
rel,
|
|
16
|
+
class: className,
|
|
17
|
+
children,
|
|
18
|
+
ref = $bindable(null),
|
|
19
|
+
...rest
|
|
20
|
+
}: Props = $props();
|
|
12
21
|
|
|
13
22
|
let resolvedTarget = $derived(target ?? (href.startsWith('http') ? '_blank' : undefined));
|
|
14
23
|
let resolvedRel = $derived(rel ?? (resolvedTarget === '_blank' ? 'noopener' : undefined));
|
|
15
24
|
</script>
|
|
16
25
|
|
|
17
|
-
<!-- eslint-disable
|
|
18
|
-
<a
|
|
26
|
+
<!-- eslint-disable svelte/no-navigation-without-resolve -->
|
|
27
|
+
<a
|
|
28
|
+
{...rest}
|
|
29
|
+
bind:this={ref}
|
|
30
|
+
{href}
|
|
31
|
+
target={resolvedTarget}
|
|
32
|
+
rel={resolvedRel}
|
|
33
|
+
class={['link', className]}
|
|
34
|
+
>
|
|
19
35
|
{@render children()}
|
|
20
36
|
</a>
|
|
21
37
|
|
|
38
|
+
<!-- eslint-enable svelte/no-navigation-without-resolve -->
|
|
39
|
+
|
|
22
40
|
<style>
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
41
|
+
@layer svelte-ui {
|
|
42
|
+
.link {
|
|
43
|
+
color: inherit;
|
|
44
|
+
text-decoration: underline;
|
|
45
|
+
text-decoration-thickness: max(1px, 0.0625em);
|
|
46
|
+
text-underline-offset: 4px;
|
|
47
|
+
outline: none;
|
|
48
|
+
cursor: pointer;
|
|
49
|
+
transition: opacity 200ms;
|
|
50
|
+
}
|
|
32
51
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
52
|
+
.link:hover {
|
|
53
|
+
opacity: 0.6;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.link:focus-visible {
|
|
57
|
+
text-decoration-thickness: max(2px, 0.125em);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@media (prefers-reduced-motion: reduce) {
|
|
61
|
+
.link {
|
|
62
|
+
transition: none;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@media (forced-colors: active) {
|
|
67
|
+
.link {
|
|
68
|
+
color: LinkText;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.link:hover {
|
|
72
|
+
opacity: 1;
|
|
73
|
+
text-decoration-thickness: max(2px, 0.125em);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.link:focus-visible {
|
|
77
|
+
outline: 2px solid Highlight;
|
|
78
|
+
outline-offset: 2px;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
@media (pointer: coarse) {
|
|
83
|
+
.link {
|
|
84
|
+
position: relative;
|
|
85
|
+
}
|
|
36
86
|
|
|
37
|
-
|
|
38
|
-
|
|
87
|
+
.link::after {
|
|
88
|
+
content: '';
|
|
89
|
+
position: absolute;
|
|
90
|
+
inset: -12px -4px;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
39
93
|
}
|
|
40
94
|
</style>
|