@placeholderco/placeholder-ui 1.0.12 → 2.0.0
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 +1 -1
- package/README.md +134 -130
- package/dist/app.css +178 -0
- package/dist/bootstrap.min.css +3600 -0
- package/dist/cards/GitCard.svelte +115 -0
- package/dist/cards/GitCard.svelte.d.ts +22 -0
- package/dist/display/Avatar.svelte +29 -17
- package/dist/display/Avatar.svelte.d.ts +12 -2
- package/dist/display/LinkCollection.svelte +40 -18
- package/dist/display/LinkCollection.svelte.d.ts +9 -2
- package/dist/display/Paper.svelte +31 -19
- package/dist/display/Paper.svelte.d.ts +12 -3
- package/dist/display/alert/Alert.svelte +129 -0
- package/dist/display/alert/Alert.svelte.d.ts +15 -0
- package/dist/display/alert/AlertVariant.d.ts +1 -0
- package/dist/display/alert/AlertVariant.js +1 -0
- package/dist/display/filetree/FileTree.svelte +259 -0
- package/dist/display/filetree/FileTree.svelte.d.ts +76 -0
- package/dist/display/filetree/FileTreeItem.svelte +396 -0
- package/dist/display/filetree/FileTreeItem.svelte.d.ts +40 -0
- package/dist/display/filetree/FileTreeNode.d.ts +46 -0
- package/dist/display/filetree/FileTreeNode.js +115 -0
- package/dist/display/filetree/index.d.ts +5 -0
- package/dist/display/filetree/index.js +3 -0
- package/dist/editors/CodeMirror.svelte +306 -0
- package/dist/editors/CodeMirror.svelte.d.ts +31 -0
- package/dist/editors/tiptap/LinkActionMenu.svelte +307 -0
- package/dist/editors/tiptap/LinkActionMenu.svelte.d.ts +8 -0
- package/dist/editors/tiptap/TipTap.svelte +856 -0
- package/dist/editors/tiptap/TipTap.svelte.d.ts +54 -0
- package/dist/editors/tiptap/TipTapBubble.svelte +790 -0
- package/dist/editors/tiptap/TipTapBubble.svelte.d.ts +44 -0
- package/dist/editors/tiptap/collaboration.d.ts +55 -0
- package/dist/editors/tiptap/collaboration.js +1 -0
- package/dist/editors/tiptap/extensions/Alert.d.ts +18 -0
- package/dist/editors/tiptap/extensions/Alert.js +72 -0
- package/dist/editors/tiptap/extensions/CodeBlockEditor.d.ts +21 -0
- package/dist/editors/tiptap/extensions/CodeBlockEditor.js +326 -0
- package/dist/editors/tiptap/extensions/Div.d.ts +19 -0
- package/dist/editors/tiptap/extensions/Div.js +89 -0
- package/dist/editors/tiptap/extensions/Span.d.ts +5 -0
- package/dist/editors/tiptap/extensions/Span.js +56 -0
- package/dist/editors/tiptap/extensions/codeBlockEditor.css +236 -0
- package/dist/editors/tiptap/extensions/codeBlockLanguages.d.ts +17 -0
- package/dist/editors/tiptap/extensions/codeBlockLanguages.js +124 -0
- package/dist/editors/tiptap/extensions/index.d.ts +7 -0
- package/dist/editors/tiptap/extensions/index.js +5 -0
- package/dist/editors/tiptap/toolbar/AlertButton.svelte +261 -0
- package/dist/editors/tiptap/toolbar/AlertButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/AlignCenterButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/AlignCenterButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/AlignJustifyButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/AlignJustifyButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/AlignLeftButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/AlignLeftButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/AlignRightButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/AlignRightButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/BoldButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/BoldButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/BulletListButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/BulletListButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/CodeBlockButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/CodeBlockButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/CodeButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/CodeButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/ColorButton.svelte +299 -0
- package/dist/editors/tiptap/toolbar/ColorButton.svelte.d.ts +20 -0
- package/dist/editors/tiptap/toolbar/DocumentButton.svelte +58 -0
- package/dist/editors/tiptap/toolbar/DocumentButton.svelte.d.ts +9 -0
- package/dist/editors/tiptap/toolbar/HeadingButton.svelte +30 -0
- package/dist/editors/tiptap/toolbar/HeadingButton.svelte.d.ts +8 -0
- package/dist/editors/tiptap/toolbar/HtmlButton.svelte +68 -0
- package/dist/editors/tiptap/toolbar/HtmlButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/ImageButton.svelte +54 -0
- package/dist/editors/tiptap/toolbar/ImageButton.svelte.d.ts +8 -0
- package/dist/editors/tiptap/toolbar/ItalicButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/ItalicButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/LinkButton.svelte +257 -0
- package/dist/editors/tiptap/toolbar/LinkButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/OrderedListButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/OrderedListButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/RedoButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/RedoButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/StrikethroughButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/StrikethroughButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/SubscriptButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/SubscriptButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/SuperscriptButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/SuperscriptButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/TableButton.svelte +258 -0
- package/dist/editors/tiptap/toolbar/TableButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/ToolbarButton.svelte +84 -0
- package/dist/editors/tiptap/toolbar/ToolbarButton.svelte.d.ts +10 -0
- package/dist/editors/tiptap/toolbar/UnderlineButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/UnderlineButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/UndoButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/UndoButton.svelte.d.ts +7 -0
- package/dist/form/Autocomplete.svelte +86 -135
- package/dist/form/Autocomplete.svelte.d.ts +6 -8
- package/dist/form/AutocompleteMulti.svelte +385 -227
- package/dist/form/AutocompleteMulti.svelte.d.ts +59 -10
- package/dist/form/Checkbox.svelte +59 -54
- package/dist/form/Checkbox.svelte.d.ts +14 -5
- package/dist/form/Chips.svelte +29 -13
- package/dist/form/Chips.svelte.d.ts +16 -2
- package/dist/form/ComboBox.svelte +30 -20
- package/dist/form/ComboBox.svelte.d.ts +1 -1
- package/dist/form/ComboBoxItemBuilder.svelte +161 -188
- package/dist/form/ComboBoxItemBuilder.svelte.d.ts +19 -2
- package/dist/form/ComboBoxMulti.svelte +38 -24
- package/dist/form/ComboBoxMulti.svelte.d.ts +1 -1
- package/dist/form/CronBuilder.svelte +84 -67
- package/dist/form/CronBuilder.svelte.d.ts +16 -3
- package/dist/form/DatePicker.svelte +148 -195
- package/dist/form/DateRangePicker.svelte +101 -98
- package/dist/form/DateTimePicker.svelte +167 -208
- package/dist/form/DateTimePicker.svelte.d.ts +10 -2
- package/dist/form/FormGroup.svelte +33 -10
- package/dist/form/FormGroup.svelte.d.ts +12 -2
- package/dist/form/Number.svelte +70 -47
- package/dist/form/Number.svelte.d.ts +36 -6
- package/dist/form/Radio.svelte +18 -18
- package/dist/form/RadioGroup.svelte +23 -12
- package/dist/form/RadioGroup.svelte.d.ts +13 -2
- package/dist/form/SegmentedControl.svelte +76 -56
- package/dist/form/SegmentedControl.svelte.d.ts +9 -4
- package/dist/form/Select.svelte +150 -233
- package/dist/form/Select.svelte.d.ts +29 -5
- package/dist/form/SelectMulti.svelte +163 -277
- package/dist/form/SelectMulti.svelte.d.ts +36 -7
- package/dist/form/Slider.svelte +183 -269
- package/dist/form/Slider.svelte.d.ts +32 -17
- package/dist/form/StringArrayBuilder.svelte +249 -0
- package/dist/form/StringArrayBuilder.svelte.d.ts +15 -0
- package/dist/form/Switch.svelte +164 -106
- package/dist/form/Switch.svelte.d.ts +22 -3
- package/dist/form/TextArea.svelte +49 -29
- package/dist/form/TextArea.svelte.d.ts +23 -3
- package/dist/form/Textbox.svelte +69 -68
- package/dist/form/Textbox.svelte.d.ts +32 -4
- package/dist/form/TimePicker.svelte +42 -47
- package/dist/form/TimePicker.svelte.d.ts +12 -2
- package/dist/form/comboBoxCore.svelte.d.ts +99 -0
- package/dist/form/comboBoxCore.svelte.js +243 -0
- package/dist/icon/Icon.svelte +8 -3
- package/dist/icon/Icon.svelte.d.ts +8 -3
- package/dist/icon/file-type-bmp.svg +1 -0
- package/dist/icon/file-type-csv.svg +1 -0
- package/dist/icon/file-type-doc.svg +1 -0
- package/dist/icon/file-type-docx.svg +1 -0
- package/dist/icon/file-type-jpg.svg +1 -0
- package/dist/icon/file-type-pdf.svg +1 -0
- package/dist/icon/file-type-png.svg +1 -0
- package/dist/icon/file-type-ppt.svg +1 -0
- package/dist/icon/file-type-svg.svg +1 -0
- package/dist/icon/file-type-txt.svg +1 -0
- package/dist/icon/file-type-xls.svg +1 -0
- package/dist/icon/file-type-zip.svg +1 -0
- package/dist/icon/index.d.ts +166 -151
- package/dist/icon/index.js +166 -152
- package/dist/icon/logo-placeholder.svg +6 -0
- package/dist/icon/source-code.svg +1 -0
- package/dist/icon/sun-moon.svg +1 -0
- package/dist/icon/table.svg +6 -0
- package/dist/index.d.ts +87 -26
- package/dist/index.js +25 -28
- package/dist/layout/AppShell.svelte +12 -162
- package/dist/layout/AppShell.svelte.d.ts +6 -27
- package/dist/layout/CustomNavbar.svelte +9 -7
- package/dist/layout/CustomNavbar.svelte.d.ts +4 -2
- package/dist/layout/Navbar.svelte +161 -129
- package/dist/layout/Navbar.svelte.d.ts +29 -15
- package/dist/layout/NavbarItemDisplay.svelte +2 -2
- package/dist/layout/NavbarItemView.svelte +182 -0
- package/dist/layout/NavbarItemView.svelte.d.ts +10 -0
- package/dist/layout/Sidenav.svelte +280 -341
- package/dist/layout/Sidenav.svelte.d.ts +36 -4
- package/dist/models/ComboBoxItem.d.ts +2 -0
- package/dist/models/Employee.d.ts +53 -0
- package/dist/models/Employee.js +23 -0
- package/dist/models/Hyperlink.d.ts +3 -1
- package/dist/models/LinkCollectionItem.d.ts +3 -1
- package/dist/models/NavbarItem.d.ts +6 -2
- package/dist/theme.svelte.d.ts +0 -1
- package/dist/theme.svelte.js +46 -58
- package/dist/ui/Accordion.svelte +81 -242
- package/dist/ui/Accordion.svelte.d.ts +37 -14
- package/dist/ui/AccordionItem.svelte +303 -0
- package/dist/ui/AccordionItem.svelte.d.ts +21 -0
- package/dist/ui/ActionIcon.svelte +25 -21
- package/dist/ui/ActionIcon.svelte.d.ts +15 -2
- package/dist/ui/Badge.svelte +163 -171
- package/dist/ui/Badge.svelte.d.ts +13 -5
- package/dist/ui/Button.svelte +178 -205
- package/dist/ui/Button.svelte.d.ts +19 -2
- package/dist/ui/ButtonVariant.d.ts +15 -1
- package/dist/ui/ContextMenu.svelte +146 -0
- package/dist/ui/ContextMenu.svelte.d.ts +37 -0
- package/dist/ui/ContextMenuList.svelte +188 -0
- package/dist/ui/ContextMenuList.svelte.d.ts +12 -0
- package/dist/ui/Dialog.svelte +183 -111
- package/dist/ui/Dialog.svelte.d.ts +21 -4
- package/dist/ui/Drawer.svelte +237 -184
- package/dist/ui/Drawer.svelte.d.ts +20 -2
- package/dist/ui/Dropdown.svelte +24 -14
- package/dist/ui/Dropdown.svelte.d.ts +11 -2
- package/dist/ui/Dropzone.svelte +159 -57
- package/dist/ui/Dropzone.svelte.d.ts +29 -2
- package/dist/ui/Link.svelte +12 -4
- package/dist/ui/Link.svelte.d.ts +8 -2
- package/dist/ui/Loader.svelte +23 -18
- package/dist/ui/Loader.svelte.d.ts +5 -2
- package/dist/ui/Logo.svelte +37 -0
- package/dist/ui/Logo.svelte.d.ts +16 -0
- package/dist/ui/MultiSortable.svelte +287 -0
- package/dist/ui/MultiSortable.svelte.d.ts +50 -0
- package/dist/ui/Pagination.svelte +15 -9
- package/dist/ui/Pagination.svelte.d.ts +6 -2
- package/dist/ui/Popover.svelte +43 -65
- package/dist/ui/Popover.svelte.d.ts +14 -5
- package/dist/ui/ProgressBar.svelte +28 -30
- package/dist/ui/ProgressBarVariant.d.ts +7 -1
- package/dist/ui/SegmentedControl.svelte +0 -0
- package/dist/ui/SegmentedControl.svelte.d.ts +26 -0
- package/dist/ui/Sortable.svelte +163 -0
- package/dist/ui/Sortable.svelte.d.ts +47 -0
- package/dist/ui/Table.svelte +383 -80
- package/dist/ui/Table.svelte.d.ts +43 -2
- package/dist/ui/Tabs.svelte +22 -18
- package/dist/ui/Tabs.svelte.d.ts +6 -2
- package/dist/ui/ThemeSwitcher.svelte +26 -7
- package/dist/ui/ThemeSwitcher.svelte.d.ts +4 -2
- package/dist/ui/Tooltip.svelte +312 -180
- package/dist/ui/Tooltip.svelte.d.ts +4 -3
- package/dist/uiTheme.svelte.d.ts +86 -0
- package/dist/uiTheme.svelte.js +214 -0
- package/dist/util/DateFunctions.js +1 -1
- package/dist/util/DragDrop.d.ts +50 -0
- package/dist/util/DragDrop.js +154 -0
- package/dist/util/NavigateTo.js +2 -2
- package/dist/util/dayjs.d.ts +4 -0
- package/dist/util/dayjs.js +15 -0
- package/package.json +66 -26
- package/dist/display/Alert.svelte +0 -179
- package/dist/display/Alert.svelte.d.ts +0 -13
- package/dist/form/FileInput.svelte +0 -235
- package/dist/form/FileInput.svelte.d.ts +0 -23
- package/dist/form/PasswordInput.svelte +0 -253
- package/dist/form/PasswordInput.svelte.d.ts +0 -34
- package/dist/form/Rating.svelte +0 -235
- package/dist/form/Rating.svelte.d.ts +0 -21
- package/dist/styles/components.css +0 -199
- package/dist/styles/dark.css +0 -146
- package/dist/styles/index.css +0 -116
- package/dist/styles/reset.css +0 -110
- package/dist/styles/semantic.css +0 -86
- package/dist/styles/tokens.css +0 -203
- package/dist/styles/utilities.css +0 -523
- package/dist/ui/Breadcrumbs.svelte +0 -131
- package/dist/ui/Breadcrumbs.svelte.d.ts +0 -16
- package/dist/ui/LoadingOverlay.svelte +0 -53
- package/dist/ui/LoadingOverlay.svelte.d.ts +0 -11
- package/dist/ui/Progress.svelte +0 -191
- package/dist/ui/Progress.svelte.d.ts +0 -15
- package/dist/ui/RingProgress.svelte +0 -141
- package/dist/ui/RingProgress.svelte.d.ts +0 -18
- package/dist/ui/Skeleton.svelte +0 -85
- package/dist/ui/Skeleton.svelte.d.ts +0 -12
- package/dist/ui/Stepper.svelte +0 -355
- package/dist/ui/Stepper.svelte.d.ts +0 -24
- package/dist/ui/Timeline.svelte +0 -225
- package/dist/ui/Timeline.svelte.d.ts +0 -23
- /package/dist/{actions → util}/ClickOutside.d.ts +0 -0
- /package/dist/{actions → util}/ClickOutside.js +0 -0
- /package/dist/{transitions → util}/Transitions.d.ts +0 -0
- /package/dist/{transitions → util}/Transitions.js +0 -0
|
@@ -1,28 +1,77 @@
|
|
|
1
|
-
import type { ComboBoxItem, FetchFunctionType, SearchFunctionType } from
|
|
2
|
-
import {
|
|
3
|
-
interface
|
|
1
|
+
import type { ComboBoxGroup, ComboBoxItem, FetchFunctionType, RetrieveLabelFunctionType, SearchFunctionType } from '../models/ComboBoxItem.js';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
export interface AutocompleteMultiProps {
|
|
4
|
+
/** HTML name attribute for the input */
|
|
5
|
+
name?: string;
|
|
6
|
+
/** Label text displayed above the input */
|
|
4
7
|
label?: string;
|
|
8
|
+
/** Array of selected values (bindable) */
|
|
5
9
|
values?: string[];
|
|
10
|
+
/**
|
|
11
|
+
* Array of full selected item objects (bindable). Can be passed initially to preset
|
|
12
|
+
* the selection with known labels — no `values` or retrieveLabelFunction needed.
|
|
13
|
+
*/
|
|
6
14
|
rawValues?: ComboBoxItem[];
|
|
15
|
+
/** Placeholder text when nothing is selected */
|
|
7
16
|
placeholder?: string;
|
|
17
|
+
/** Mark field as required (shows asterisk) */
|
|
18
|
+
required?: boolean;
|
|
19
|
+
/** CSS classes for the control element */
|
|
8
20
|
class?: string;
|
|
21
|
+
/** CSS classes for the container element */
|
|
22
|
+
containerClass?: string;
|
|
23
|
+
/** CSS classes for the FormGroup wrapper */
|
|
24
|
+
groupClass?: string;
|
|
25
|
+
/** Disable the input */
|
|
9
26
|
disabled?: boolean;
|
|
10
|
-
|
|
27
|
+
/** Show error state styling */
|
|
11
28
|
showError?: boolean;
|
|
29
|
+
/** Error message to display */
|
|
12
30
|
errorText?: string;
|
|
31
|
+
/** Auto-focus the input on mount */
|
|
13
32
|
autofocus?: boolean;
|
|
14
|
-
|
|
33
|
+
/** Auto-focus on every dialog open */
|
|
34
|
+
autofocusDialog?: boolean;
|
|
35
|
+
/** Hide "no results" message when search finds nothing */
|
|
36
|
+
hideNoResults?: boolean;
|
|
37
|
+
/** Close the dropdown after selecting an option */
|
|
38
|
+
closeOnSelection?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Offer to add the typed text as a new chip when it doesn't match an existing option.
|
|
41
|
+
* On by default — set to `false` to restrict selection to the provided options.
|
|
42
|
+
*/
|
|
43
|
+
allowAdd?: boolean;
|
|
44
|
+
/** Builds the label shown for the "add new value" suggestion (default: `Add "<value>"`) */
|
|
45
|
+
addItemLabel?: (value: string) => string;
|
|
46
|
+
/** Text shown while loading options */
|
|
15
47
|
loadingText?: string;
|
|
48
|
+
/** SVG icon displayed on the left side */
|
|
49
|
+
leftIconSvg?: string;
|
|
50
|
+
/** Static list of autocomplete options */
|
|
16
51
|
options?: ComboBoxItem[];
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
52
|
+
/** Options organized into groups */
|
|
53
|
+
groupedOptions?: ComboBoxGroup[];
|
|
54
|
+
/** Position of the tooltip */
|
|
55
|
+
tooltipLocation?: 'top' | 'bottom' | 'left' | 'right';
|
|
56
|
+
/** Async function to fetch all options */
|
|
57
|
+
fetchFunction?: FetchFunctionType | null;
|
|
58
|
+
/** Async function to search/filter options based on input */
|
|
59
|
+
searchFunction?: SearchFunctionType | null;
|
|
60
|
+
/** Async function to retrieve labels for values */
|
|
61
|
+
retrieveLabelFunction?: RetrieveLabelFunctionType | null;
|
|
62
|
+
/** Rich tooltip content using a Svelte snippet */
|
|
20
63
|
tooltipContent?: Snippet;
|
|
64
|
+
/** Simple tooltip text */
|
|
21
65
|
tooltipText?: string;
|
|
66
|
+
/** Callback when Enter is pressed with the current filter text */
|
|
67
|
+
enterPressed?: (e: string) => void;
|
|
68
|
+
/** Callback when selection changes (returns value strings) */
|
|
22
69
|
onchange?: (e: string[]) => void;
|
|
70
|
+
/** Callback when selection changes (returns full item objects) */
|
|
23
71
|
onchangeRaw?: (e: ComboBoxItem[]) => void;
|
|
24
|
-
|
|
72
|
+
/** Callback when the user chooses to add the typed value as a new item */
|
|
73
|
+
onItemAdded?: (value: string) => void;
|
|
25
74
|
}
|
|
26
|
-
declare const AutocompleteMulti: import("svelte").Component<
|
|
75
|
+
declare const AutocompleteMulti: import("svelte").Component<AutocompleteMultiProps, {}, "values" | "rawValues">;
|
|
27
76
|
type AutocompleteMulti = ReturnType<typeof AutocompleteMulti>;
|
|
28
77
|
export default AutocompleteMulti;
|
|
@@ -1,33 +1,45 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { Icon, iconInfoCircle } from '../icon/index.js';
|
|
3
|
-
import Tooltip from '../ui/Tooltip.svelte';
|
|
1
|
+
<script module lang="ts">
|
|
4
2
|
import type { Snippet } from 'svelte';
|
|
5
3
|
|
|
6
|
-
interface
|
|
7
|
-
/** HTML name attribute for the checkbox */
|
|
4
|
+
export interface CheckboxProps {
|
|
5
|
+
/** HTML name attribute for the checkbox (falls back to label, then auto-generated) */
|
|
8
6
|
name?: string;
|
|
7
|
+
/** Label text displayed next to the checkbox */
|
|
9
8
|
label?: string;
|
|
9
|
+
/** Mark field as required (shows asterisk) */
|
|
10
10
|
required?: boolean;
|
|
11
|
+
/** Additional CSS classes */
|
|
11
12
|
class?: string;
|
|
13
|
+
/** Custom ID for the input element */
|
|
12
14
|
inputId?: string;
|
|
15
|
+
/** Disable the checkbox */
|
|
13
16
|
disabled?: boolean;
|
|
17
|
+
/** Show error state styling */
|
|
14
18
|
showError?: boolean;
|
|
19
|
+
/** Error message to display */
|
|
15
20
|
errorText?: string;
|
|
21
|
+
/** Whether the checkbox is checked (bindable) */
|
|
16
22
|
checked?: boolean;
|
|
17
23
|
/** When true, the checkbox state is controlled externally only. Clicking will call onchange but won't toggle the checkbox. */
|
|
18
24
|
controlled?: boolean;
|
|
19
25
|
/** Whether the checkbox is in an indeterminate state */
|
|
20
26
|
indeterminate?: boolean;
|
|
27
|
+
/** Callback when checked state changes */
|
|
21
28
|
onchange?: (e: boolean) => void;
|
|
22
29
|
/** Accessible label for screen readers (use when no visible label) */
|
|
23
30
|
ariaLabel?: string;
|
|
24
|
-
/** Rich tooltip content using a Svelte snippet */
|
|
25
|
-
tooltipContent?: Snippet;
|
|
26
31
|
/** Simple tooltip text */
|
|
27
32
|
tooltipText?: string;
|
|
28
33
|
/** Position of the tooltip */
|
|
29
34
|
tooltipLocation?: 'top' | 'bottom' | 'left' | 'right';
|
|
35
|
+
/** Rich tooltip content using a Svelte snippet */
|
|
36
|
+
tooltipContent?: Snippet;
|
|
30
37
|
}
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<script lang="ts">
|
|
41
|
+
import { Icon, iconInfoCircle } from '../icon/index.js';
|
|
42
|
+
import Tooltip from '../ui/Tooltip.svelte';
|
|
31
43
|
|
|
32
44
|
let {
|
|
33
45
|
name,
|
|
@@ -43,14 +55,16 @@
|
|
|
43
55
|
indeterminate = false,
|
|
44
56
|
onchange = undefined,
|
|
45
57
|
ariaLabel = undefined,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}:
|
|
58
|
+
tooltipText = undefined,
|
|
59
|
+
tooltipLocation = 'top',
|
|
60
|
+
tooltipContent = undefined
|
|
61
|
+
}: CheckboxProps = $props();
|
|
50
62
|
|
|
63
|
+
const autoName = `checkbox-${crypto.randomUUID()}`;
|
|
51
64
|
const nonce = Math.random().toString(36).substring(2, 15);
|
|
52
|
-
|
|
53
|
-
|
|
65
|
+
|
|
66
|
+
let resolvedName = $derived(
|
|
67
|
+
(name || label || autoName).replace(/[^a-zA-Z0-9_\-:.]/g, '_')
|
|
54
68
|
);
|
|
55
69
|
|
|
56
70
|
const id = $derived(inputId ? inputId : label ? `input-${label}` : `input-${nonce}`);
|
|
@@ -64,7 +78,7 @@
|
|
|
64
78
|
{#if controlled}
|
|
65
79
|
<input
|
|
66
80
|
bind:this={inputEl}
|
|
67
|
-
class="checkbox {showError && 'error'} {classes}"
|
|
81
|
+
class="checkbox text-base accent-accent mr-1 {showError && 'error'} {classes}"
|
|
68
82
|
type="checkbox"
|
|
69
83
|
{id}
|
|
70
84
|
name={resolvedName}
|
|
@@ -79,7 +93,7 @@
|
|
|
79
93
|
{:else}
|
|
80
94
|
<input
|
|
81
95
|
bind:this={inputEl}
|
|
82
|
-
class="checkbox {showError && 'error'} {classes}"
|
|
96
|
+
class="checkbox text-base accent-accent mr-1 {showError && 'error'} {classes}"
|
|
83
97
|
type="checkbox"
|
|
84
98
|
{id}
|
|
85
99
|
name={resolvedName}
|
|
@@ -96,7 +110,7 @@
|
|
|
96
110
|
{/if}
|
|
97
111
|
{#if tooltipContent || tooltipText}
|
|
98
112
|
<Tooltip {tooltipContent} location={tooltipLocation} text={tooltipText}>
|
|
99
|
-
<Icon svg={iconInfoCircle} size="1em" />
|
|
113
|
+
<Icon svg={iconInfoCircle} size="1em" stroke="var(--accent-color)" />
|
|
100
114
|
</Tooltip>
|
|
101
115
|
{/if}</span
|
|
102
116
|
>
|
|
@@ -107,12 +121,6 @@
|
|
|
107
121
|
</div>
|
|
108
122
|
|
|
109
123
|
<style>
|
|
110
|
-
.checkbox-container {
|
|
111
|
-
display: flex;
|
|
112
|
-
align-items: center;
|
|
113
|
-
gap: var(--pui-spacing-1_5);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
124
|
label {
|
|
117
125
|
display: flex;
|
|
118
126
|
flex-direction: row;
|
|
@@ -143,28 +151,28 @@
|
|
|
143
151
|
box-sizing: content-box;
|
|
144
152
|
width: 16px;
|
|
145
153
|
height: 16px;
|
|
146
|
-
border: 2px solid
|
|
147
|
-
transition: border-color
|
|
154
|
+
border: 2px solid #ccc;
|
|
155
|
+
transition: 0.2s border-color ease;
|
|
148
156
|
}
|
|
149
157
|
:global(.dark) input:before {
|
|
150
|
-
border-color:
|
|
158
|
+
border-color: #666;
|
|
151
159
|
}
|
|
152
160
|
input:checked:before {
|
|
153
|
-
border-color: var(--
|
|
154
|
-
transition: border-color
|
|
161
|
+
border-color: var(--ui-primary);
|
|
162
|
+
transition: 0.5s border-color ease;
|
|
155
163
|
}
|
|
156
164
|
:global(.dark) input:checked:before {
|
|
157
|
-
border-color: var(--
|
|
165
|
+
border-color: var(--ui-accent);
|
|
158
166
|
}
|
|
159
167
|
|
|
160
168
|
input:disabled:before {
|
|
161
|
-
border-color:
|
|
162
|
-
background-color:
|
|
169
|
+
border-color: #ccc;
|
|
170
|
+
background-color: #ccc;
|
|
163
171
|
opacity: 0.5;
|
|
164
172
|
}
|
|
165
173
|
:global(.dark) input:disabled:before {
|
|
166
|
-
border-color:
|
|
167
|
-
background-color:
|
|
174
|
+
border-color: #666;
|
|
175
|
+
background-color: #666;
|
|
168
176
|
}
|
|
169
177
|
input:after {
|
|
170
178
|
content: '';
|
|
@@ -174,7 +182,7 @@
|
|
|
174
182
|
top: 50%;
|
|
175
183
|
left: 50%;
|
|
176
184
|
transform-origin: 50% 50%;
|
|
177
|
-
background-color: var(--
|
|
185
|
+
background-color: var(--ui-primary);
|
|
178
186
|
width: 16px;
|
|
179
187
|
height: 16px;
|
|
180
188
|
border-radius: 100vh;
|
|
@@ -184,11 +192,11 @@
|
|
|
184
192
|
opacity: 0.5;
|
|
185
193
|
}
|
|
186
194
|
:global(.dark) input:after {
|
|
187
|
-
background-color: var(--
|
|
195
|
+
background-color: var(--ui-accent);
|
|
188
196
|
}
|
|
189
197
|
|
|
190
198
|
input[type='checkbox']:before {
|
|
191
|
-
border-radius:
|
|
199
|
+
border-radius: 4px;
|
|
192
200
|
}
|
|
193
201
|
input[type='checkbox']:after {
|
|
194
202
|
width: 7px;
|
|
@@ -196,49 +204,46 @@
|
|
|
196
204
|
border-radius: 0;
|
|
197
205
|
transform: translate(-50%, -85%) scale(0) rotate(45deg);
|
|
198
206
|
background-color: transparent;
|
|
199
|
-
box-shadow: 4px 4px 0px 0px var(--
|
|
207
|
+
box-shadow: 4px 4px 0px 0px var(--ui-primary);
|
|
200
208
|
}
|
|
201
209
|
:global(.dark) input[type='checkbox']:after {
|
|
202
|
-
box-shadow: 4px 4px 0px 0px var(--
|
|
210
|
+
box-shadow: 4px 4px 0px 0px var(--ui-accent);
|
|
203
211
|
}
|
|
204
212
|
input[type='checkbox']:checked:after {
|
|
205
|
-
-webkit-animation: toggleOnCheckbox
|
|
206
|
-
animation: toggleOnCheckbox
|
|
213
|
+
-webkit-animation: toggleOnCheckbox 0.2s ease forwards;
|
|
214
|
+
animation: toggleOnCheckbox 0.2s ease forwards;
|
|
207
215
|
}
|
|
208
|
-
|
|
209
|
-
/* Indeterminate state */
|
|
210
216
|
input[type='checkbox']:indeterminate:before {
|
|
211
|
-
border-color: var(--
|
|
217
|
+
border-color: var(--ui-primary);
|
|
212
218
|
}
|
|
213
219
|
:global(.dark) input[type='checkbox']:indeterminate:before {
|
|
214
|
-
border-color: var(--
|
|
220
|
+
border-color: var(--ui-accent);
|
|
215
221
|
}
|
|
216
222
|
input[type='checkbox']:indeterminate:after {
|
|
217
223
|
width: 10px;
|
|
218
224
|
height: 2px;
|
|
219
225
|
border-radius: 1px;
|
|
220
|
-
background-color: var(--
|
|
226
|
+
background-color: var(--ui-primary);
|
|
221
227
|
box-shadow: none;
|
|
222
228
|
transform: translate(-50%, -50%) scale(1);
|
|
223
229
|
}
|
|
224
230
|
:global(.dark) input[type='checkbox']:indeterminate:after {
|
|
225
|
-
background-color: var(--
|
|
231
|
+
background-color: var(--ui-accent);
|
|
226
232
|
}
|
|
227
|
-
|
|
228
233
|
input[type='checkbox'].filled:before {
|
|
229
|
-
border-radius:
|
|
234
|
+
border-radius: 4px;
|
|
230
235
|
transition:
|
|
231
|
-
border-color
|
|
232
|
-
background-color
|
|
236
|
+
0.2s border-color ease,
|
|
237
|
+
0.2s background-color ease;
|
|
233
238
|
}
|
|
234
239
|
input[type='checkbox'].filled:checked:not(:disabled):before {
|
|
235
|
-
background-color: var(--
|
|
240
|
+
background-color: var(--ui-primary);
|
|
236
241
|
}
|
|
237
242
|
:global(.dark) input[type='checkbox'].filled:checked:not(:disabled):before {
|
|
238
|
-
background-color: var(--
|
|
243
|
+
background-color: var(--ui-accent);
|
|
239
244
|
}
|
|
240
245
|
input[type='checkbox'].filled:not(:disabled):after {
|
|
241
|
-
box-shadow: 4px 4px 0px 0px
|
|
246
|
+
box-shadow: 4px 4px 0px 0px white;
|
|
242
247
|
}
|
|
243
248
|
@-webkit-keyframes toggleOnCheckbox {
|
|
244
249
|
0% {
|
|
@@ -268,10 +273,10 @@
|
|
|
268
273
|
}
|
|
269
274
|
|
|
270
275
|
input.error:before {
|
|
271
|
-
border-color: var(--
|
|
276
|
+
border-color: var(--danger-text) !important;
|
|
272
277
|
}
|
|
273
278
|
|
|
274
279
|
.error-text {
|
|
275
|
-
color: var(--
|
|
280
|
+
color: var(--danger-text);
|
|
276
281
|
}
|
|
277
282
|
</style>
|
|
@@ -1,29 +1,38 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
|
-
interface
|
|
3
|
-
/** HTML name attribute for the checkbox */
|
|
2
|
+
export interface CheckboxProps {
|
|
3
|
+
/** HTML name attribute for the checkbox (falls back to label, then auto-generated) */
|
|
4
4
|
name?: string;
|
|
5
|
+
/** Label text displayed next to the checkbox */
|
|
5
6
|
label?: string;
|
|
7
|
+
/** Mark field as required (shows asterisk) */
|
|
6
8
|
required?: boolean;
|
|
9
|
+
/** Additional CSS classes */
|
|
7
10
|
class?: string;
|
|
11
|
+
/** Custom ID for the input element */
|
|
8
12
|
inputId?: string;
|
|
13
|
+
/** Disable the checkbox */
|
|
9
14
|
disabled?: boolean;
|
|
15
|
+
/** Show error state styling */
|
|
10
16
|
showError?: boolean;
|
|
17
|
+
/** Error message to display */
|
|
11
18
|
errorText?: string;
|
|
19
|
+
/** Whether the checkbox is checked (bindable) */
|
|
12
20
|
checked?: boolean;
|
|
13
21
|
/** When true, the checkbox state is controlled externally only. Clicking will call onchange but won't toggle the checkbox. */
|
|
14
22
|
controlled?: boolean;
|
|
15
23
|
/** Whether the checkbox is in an indeterminate state */
|
|
16
24
|
indeterminate?: boolean;
|
|
25
|
+
/** Callback when checked state changes */
|
|
17
26
|
onchange?: (e: boolean) => void;
|
|
18
27
|
/** Accessible label for screen readers (use when no visible label) */
|
|
19
28
|
ariaLabel?: string;
|
|
20
|
-
/** Rich tooltip content using a Svelte snippet */
|
|
21
|
-
tooltipContent?: Snippet;
|
|
22
29
|
/** Simple tooltip text */
|
|
23
30
|
tooltipText?: string;
|
|
24
31
|
/** Position of the tooltip */
|
|
25
32
|
tooltipLocation?: 'top' | 'bottom' | 'left' | 'right';
|
|
33
|
+
/** Rich tooltip content using a Svelte snippet */
|
|
34
|
+
tooltipContent?: Snippet;
|
|
26
35
|
}
|
|
27
|
-
declare const Checkbox: import("svelte").Component<
|
|
36
|
+
declare const Checkbox: import("svelte").Component<CheckboxProps, {}, "checked">;
|
|
28
37
|
type Checkbox = ReturnType<typeof Checkbox>;
|
|
29
38
|
export default Checkbox;
|
package/dist/form/Chips.svelte
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
import { iconCheck } from '../icon/index.js';
|
|
6
6
|
import Button from '../ui/Button.svelte';
|
|
7
7
|
|
|
8
|
-
interface
|
|
8
|
+
export interface ChipsProps {
|
|
9
|
+
/** Label text displayed above the chips */
|
|
9
10
|
label?: string;
|
|
10
11
|
/** Visual style variant for chips */
|
|
11
12
|
variant?: ButtonVariant;
|
|
@@ -13,18 +14,31 @@
|
|
|
13
14
|
selectedVariant?: ButtonVariant;
|
|
14
15
|
/** Visual style variant for deselected chips (overrides variant for unselected state) */
|
|
15
16
|
deselectedVariant?: ButtonVariant;
|
|
17
|
+
/** Available chip options */
|
|
16
18
|
options: ComboBoxItem[];
|
|
19
|
+
/** Mark field as required (shows asterisk) */
|
|
17
20
|
required?: boolean;
|
|
21
|
+
/** Show error state styling */
|
|
18
22
|
showError?: boolean;
|
|
23
|
+
/** Error message to display */
|
|
19
24
|
errorText?: string;
|
|
25
|
+
/** Additional CSS classes */
|
|
20
26
|
class?: string;
|
|
27
|
+
/** CSS classes for the container element */
|
|
21
28
|
containerClass?: string;
|
|
29
|
+
/** Disable all chips */
|
|
22
30
|
disabled?: boolean;
|
|
31
|
+
/** Selected value for single selection mode (bindable) */
|
|
23
32
|
value?: string;
|
|
33
|
+
/** Selected values for multiple selection mode (bindable) */
|
|
24
34
|
values?: string[];
|
|
35
|
+
/** Allow selecting multiple chips */
|
|
25
36
|
multiple?: boolean;
|
|
37
|
+
/** Allow deselecting the current selection */
|
|
26
38
|
deselectable?: boolean;
|
|
39
|
+
/** Position of the tooltip */
|
|
27
40
|
tooltipLocation?: 'top' | 'bottom' | 'left' | 'right';
|
|
41
|
+
/** Callback when selection changes */
|
|
28
42
|
onchange?: (e: string | string[] | undefined) => void;
|
|
29
43
|
}
|
|
30
44
|
|
|
@@ -46,7 +60,7 @@
|
|
|
46
60
|
multiple = false,
|
|
47
61
|
deselectable = true,
|
|
48
62
|
onchange = undefined
|
|
49
|
-
}:
|
|
63
|
+
}: ChipsProps = $props();
|
|
50
64
|
|
|
51
65
|
const nonce = Math.random().toString(36).substring(2, 15);
|
|
52
66
|
const randomName = $derived(label + nonce);
|
|
@@ -70,6 +84,8 @@
|
|
|
70
84
|
onchange?.(values.length > 0 ? values : undefined);
|
|
71
85
|
}
|
|
72
86
|
}
|
|
87
|
+
|
|
88
|
+
|
|
73
89
|
</script>
|
|
74
90
|
|
|
75
91
|
<div class="radio-container {containerClass}">
|
|
@@ -109,34 +125,34 @@
|
|
|
109
125
|
<style>
|
|
110
126
|
.radio-options {
|
|
111
127
|
display: flex;
|
|
112
|
-
gap:
|
|
113
|
-
border-radius:
|
|
128
|
+
gap: 0.5rem;
|
|
129
|
+
border-radius: 6px;
|
|
114
130
|
}
|
|
115
131
|
|
|
116
132
|
.radio-required {
|
|
117
|
-
padding:
|
|
133
|
+
padding: 0.25rem;
|
|
118
134
|
}
|
|
119
135
|
|
|
120
136
|
.error {
|
|
121
|
-
border: 1px solid var(--
|
|
137
|
+
border: 1px solid var(--danger-text);
|
|
122
138
|
}
|
|
123
139
|
|
|
124
140
|
.error-text {
|
|
125
|
-
margin-top:
|
|
126
|
-
color: var(--
|
|
141
|
+
margin-top: 0.25rem;
|
|
142
|
+
color: var(--danger-text);
|
|
127
143
|
}
|
|
128
144
|
|
|
129
145
|
:global(.chip) {
|
|
130
|
-
padding:
|
|
131
|
-
border-radius:
|
|
146
|
+
padding: 0.25rem 1rem !important;
|
|
147
|
+
border-radius: 5rem !important;
|
|
132
148
|
}
|
|
133
149
|
|
|
134
150
|
:global(.chip.checked) {
|
|
135
|
-
padding-left:
|
|
136
|
-
padding-right:
|
|
151
|
+
padding-left: 0.3rem !important;
|
|
152
|
+
padding-right: 0.5rem !important;
|
|
137
153
|
}
|
|
138
154
|
|
|
139
155
|
:global(.chip .button) {
|
|
140
|
-
gap:
|
|
156
|
+
gap: 0.25rem;
|
|
141
157
|
}
|
|
142
158
|
</style>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ComboBoxItem } from '../models/ComboBoxItem.js';
|
|
2
2
|
import type { ButtonVariant } from '../ui/ButtonVariant.js';
|
|
3
|
-
interface
|
|
3
|
+
export interface ChipsProps {
|
|
4
|
+
/** Label text displayed above the chips */
|
|
4
5
|
label?: string;
|
|
5
6
|
/** Visual style variant for chips */
|
|
6
7
|
variant?: ButtonVariant;
|
|
@@ -8,20 +9,33 @@ interface Props {
|
|
|
8
9
|
selectedVariant?: ButtonVariant;
|
|
9
10
|
/** Visual style variant for deselected chips (overrides variant for unselected state) */
|
|
10
11
|
deselectedVariant?: ButtonVariant;
|
|
12
|
+
/** Available chip options */
|
|
11
13
|
options: ComboBoxItem[];
|
|
14
|
+
/** Mark field as required (shows asterisk) */
|
|
12
15
|
required?: boolean;
|
|
16
|
+
/** Show error state styling */
|
|
13
17
|
showError?: boolean;
|
|
18
|
+
/** Error message to display */
|
|
14
19
|
errorText?: string;
|
|
20
|
+
/** Additional CSS classes */
|
|
15
21
|
class?: string;
|
|
22
|
+
/** CSS classes for the container element */
|
|
16
23
|
containerClass?: string;
|
|
24
|
+
/** Disable all chips */
|
|
17
25
|
disabled?: boolean;
|
|
26
|
+
/** Selected value for single selection mode (bindable) */
|
|
18
27
|
value?: string;
|
|
28
|
+
/** Selected values for multiple selection mode (bindable) */
|
|
19
29
|
values?: string[];
|
|
30
|
+
/** Allow selecting multiple chips */
|
|
20
31
|
multiple?: boolean;
|
|
32
|
+
/** Allow deselecting the current selection */
|
|
21
33
|
deselectable?: boolean;
|
|
34
|
+
/** Position of the tooltip */
|
|
22
35
|
tooltipLocation?: 'top' | 'bottom' | 'left' | 'right';
|
|
36
|
+
/** Callback when selection changes */
|
|
23
37
|
onchange?: (e: string | string[] | undefined) => void;
|
|
24
38
|
}
|
|
25
|
-
declare const Chips: import("svelte").Component<
|
|
39
|
+
declare const Chips: import("svelte").Component<ChipsProps, {}, "value" | "values">;
|
|
26
40
|
type Chips = ReturnType<typeof Chips>;
|
|
27
41
|
export default Chips;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
loading: boolean;
|
|
9
9
|
open: boolean;
|
|
10
10
|
htmlElement?: HTMLElement | undefined;
|
|
11
|
-
|
|
11
|
+
hideNoResults: boolean;
|
|
12
12
|
loadingText: string;
|
|
13
13
|
onselection: (value: ComboBoxItem) => void;
|
|
14
14
|
onkeydown?: (e: KeyboardEvent) => boolean;
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
loading,
|
|
21
21
|
open,
|
|
22
22
|
htmlElement,
|
|
23
|
-
|
|
23
|
+
hideNoResults,
|
|
24
24
|
loadingText,
|
|
25
25
|
onselection: onSelection,
|
|
26
26
|
onkeydown
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
{:else if error}
|
|
73
73
|
<div class="error">{error}</div>
|
|
74
74
|
{:else if value && options?.length === 0}
|
|
75
|
-
{#if
|
|
75
|
+
{#if !hideNoResults}
|
|
76
76
|
<div class="no-results">No results found</div>
|
|
77
77
|
{/if}
|
|
78
78
|
{:else}
|
|
@@ -104,21 +104,32 @@
|
|
|
104
104
|
{/if}
|
|
105
105
|
|
|
106
106
|
<style>
|
|
107
|
+
/* .item {
|
|
108
|
+
&:hover,
|
|
109
|
+
&.selected {
|
|
110
|
+
@apply bg-main-border;
|
|
111
|
+
@apply text-accent;
|
|
112
|
+
}
|
|
113
|
+
} */
|
|
114
|
+
|
|
107
115
|
.combobox {
|
|
108
116
|
position: absolute;
|
|
109
117
|
width: 100%;
|
|
110
|
-
z-index:
|
|
111
|
-
border-radius:
|
|
118
|
+
z-index: 50;
|
|
119
|
+
border-radius: 0.25rem;
|
|
112
120
|
overflow: hidden;
|
|
113
|
-
border: 1px solid var(--
|
|
114
|
-
background-color: var(--
|
|
121
|
+
border: 1px solid var(--main-border-color);
|
|
122
|
+
background-color: var(--input-bg-color);
|
|
123
|
+
/* absolute w-full z-50 rounded overflow-hidden
|
|
124
|
+
border border-main-border bg-input */
|
|
115
125
|
}
|
|
116
126
|
|
|
117
127
|
.combobox-panel {
|
|
118
128
|
overflow: auto;
|
|
119
129
|
max-height: 20rem;
|
|
120
|
-
border: 1px solid var(--
|
|
130
|
+
border: 1px solid var(--border-color);
|
|
121
131
|
border-top: none;
|
|
132
|
+
/* max-h-80 overflow-auto */
|
|
122
133
|
}
|
|
123
134
|
|
|
124
135
|
.combobox-item {
|
|
@@ -127,32 +138,31 @@
|
|
|
127
138
|
align-items: center;
|
|
128
139
|
text-align: left;
|
|
129
140
|
background-color: transparent;
|
|
130
|
-
color: var(--
|
|
141
|
+
color: var(--text-color);
|
|
131
142
|
border: none;
|
|
132
|
-
font-size:
|
|
143
|
+
font-size: 1rem;
|
|
133
144
|
cursor: pointer;
|
|
134
|
-
gap:
|
|
145
|
+
gap: 0.5rem;
|
|
146
|
+
/* item w-full flex items-center text-left */
|
|
135
147
|
}
|
|
136
148
|
|
|
137
149
|
.p-2 {
|
|
138
|
-
padding:
|
|
150
|
+
padding: 0.5rem;
|
|
139
151
|
}
|
|
140
152
|
|
|
141
|
-
.error,
|
|
142
|
-
|
|
143
|
-
.no-results {
|
|
144
|
-
padding: var(--pui-spacing-2);
|
|
153
|
+
.error, .loading, .no-results {
|
|
154
|
+
padding: 0.5rem;
|
|
145
155
|
}
|
|
146
156
|
|
|
147
157
|
.no-results {
|
|
148
|
-
color: var(--
|
|
149
|
-
border: 1px solid var(--
|
|
158
|
+
color: var(--text-color);
|
|
159
|
+
border: 1px solid var(--border-color);
|
|
150
160
|
border-top: none;
|
|
151
161
|
}
|
|
152
162
|
|
|
153
163
|
.combobox-item.selected,
|
|
154
164
|
.combobox-item:hover {
|
|
155
|
-
background-color: var(--
|
|
156
|
-
color: var(--
|
|
165
|
+
background-color: var(--border-color);
|
|
166
|
+
color: rgb(var(--accent-color-rgb));
|
|
157
167
|
}
|
|
158
168
|
</style>
|
|
@@ -5,7 +5,7 @@ interface Props {
|
|
|
5
5
|
loading: boolean;
|
|
6
6
|
open: boolean;
|
|
7
7
|
htmlElement?: HTMLElement | undefined;
|
|
8
|
-
|
|
8
|
+
hideNoResults: boolean;
|
|
9
9
|
loadingText: string;
|
|
10
10
|
onselection: (value: ComboBoxItem) => void;
|
|
11
11
|
onkeydown?: (e: KeyboardEvent) => boolean;
|