@likable-hair/svelte 1.0.0 → 2.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 (120) hide show
  1. package/README.md +1 -1
  2. package/dist/components/composed/search/GlobalSearchTextField.svelte +176 -0
  3. package/dist/components/composed/search/GlobalSearchTextField.svelte.d.ts +47 -0
  4. package/dist/components/composed/search/SearchBar.svelte +82 -0
  5. package/dist/components/composed/search/SearchBar.svelte.d.ts +33 -0
  6. package/dist/components/composed/search/SearchResults.svelte +100 -0
  7. package/dist/components/composed/search/SearchResults.svelte.d.ts +47 -0
  8. package/dist/{shop → components/composed/shop}/ProductCard.svelte +1 -1
  9. package/dist/components/layouts/StableDividedSideBarLayout.svelte +189 -0
  10. package/dist/components/layouts/StableDividedSideBarLayout.svelte.d.ts +39 -0
  11. package/dist/{buttons → components/simple/buttons}/Button.svelte +9 -4
  12. package/dist/{buttons → components/simple/buttons}/Button.svelte.d.ts +0 -1
  13. package/dist/components/simple/buttons/DefaultButton.svelte +93 -0
  14. package/dist/components/simple/buttons/DefaultButton.svelte.d.ts +50 -0
  15. package/dist/components/simple/buttons/LinkButton.svelte +78 -0
  16. package/dist/components/simple/buttons/LinkButton.svelte.d.ts +49 -0
  17. package/dist/{common → components/simple/common}/MediaQuery.svelte +1 -1
  18. package/dist/components/simple/common/Playground.svelte +52 -0
  19. package/dist/components/simple/common/Playground.svelte.d.ts +17 -0
  20. package/dist/components/simple/dialogs/Dialog.svelte +410 -0
  21. package/dist/{dialogs → components/simple/dialogs}/Dialog.svelte.d.ts +4 -0
  22. package/dist/components/simple/lists/SelectableVerticalList.svelte +129 -0
  23. package/dist/components/simple/lists/SelectableVerticalList.svelte.d.ts +52 -0
  24. package/dist/components/simple/lists/SidebarMenuList.svelte +169 -0
  25. package/dist/components/simple/lists/SidebarMenuList.svelte.d.ts +31 -0
  26. package/dist/{navigation → components/simple/navigation}/HeaderMenu.svelte +1 -1
  27. package/dist/{navigation → components/simple/navigation}/HeaderMenu.svelte.d.ts +1 -3
  28. package/dist/components/simple/navigation/Navigator.svelte +89 -0
  29. package/dist/{navigation → components/simple/navigation}/Navigator.svelte.d.ts +5 -1
  30. package/dist/components/simple/typography/Code.svelte +52 -0
  31. package/dist/components/simple/typography/Code.svelte.d.ts +28 -0
  32. package/dist/components/simple/typography/dracula.css +81 -0
  33. package/dist/index.d.ts +43 -43
  34. package/dist/index.js +43 -43
  35. package/dist/utils/keyboarder.d.ts +14 -0
  36. package/dist/utils/keyboarder.js +31 -0
  37. package/dist/utils/teleporter.d.ts +10 -0
  38. package/dist/utils/teleporter.js +35 -0
  39. package/package.json +6 -1
  40. package/dist/dialogs/Dialog.svelte +0 -115
  41. package/dist/navigation/Navigator.svelte +0 -61
  42. package/dist/{shop → components/composed/shop}/ProductCard.svelte.d.ts +0 -0
  43. package/dist/{shop → components/composed/shop}/ProductsGrid.svelte +0 -0
  44. package/dist/{shop → components/composed/shop}/ProductsGrid.svelte.d.ts +0 -0
  45. package/dist/{common → components/simple/common}/Card.svelte +0 -0
  46. package/dist/{common → components/simple/common}/Card.svelte.d.ts +0 -0
  47. package/dist/{common → components/simple/common}/Gesture.svelte +0 -0
  48. package/dist/{common → components/simple/common}/Gesture.svelte.d.ts +0 -0
  49. package/dist/{common → components/simple/common}/IntersectionObserver.svelte +0 -0
  50. package/dist/{common → components/simple/common}/IntersectionObserver.svelte.d.ts +0 -0
  51. package/dist/{common → components/simple/common}/MediaQuery.svelte.d.ts +0 -0
  52. package/dist/{common → components/simple/common}/Menu.svelte +0 -0
  53. package/dist/{common → components/simple/common}/Menu.svelte.d.ts +0 -0
  54. package/dist/{common → components/simple/common}/SimpleTable.svelte +0 -0
  55. package/dist/{common → components/simple/common}/SimpleTable.svelte.d.ts +0 -0
  56. package/dist/{common → components/simple/common}/materialDesign.css +0 -0
  57. package/dist/{common → components/simple/common}/scroller.d.ts +0 -0
  58. package/dist/{common → components/simple/common}/scroller.js +0 -0
  59. package/dist/{dates → components/simple/dates}/Calendar.svelte +0 -0
  60. package/dist/{dates → components/simple/dates}/Calendar.svelte.d.ts +0 -0
  61. package/dist/{dates → components/simple/dates}/DatePicker.svelte +0 -0
  62. package/dist/{dates → components/simple/dates}/DatePicker.svelte.d.ts +0 -0
  63. package/dist/{dates → components/simple/dates}/MonthSelector.svelte +0 -0
  64. package/dist/{dates → components/simple/dates}/MonthSelector.svelte.d.ts +0 -0
  65. package/dist/{dates → components/simple/dates}/TimePickerTextField.svelte +0 -0
  66. package/dist/{dates → components/simple/dates}/TimePickerTextField.svelte.d.ts +0 -0
  67. package/dist/{dates → components/simple/dates}/YearSelector.svelte +0 -0
  68. package/dist/{dates → components/simple/dates}/YearSelector.svelte.d.ts +0 -0
  69. package/dist/{dates → components/simple/dates}/utils.d.ts +0 -0
  70. package/dist/{dates → components/simple/dates}/utils.js +0 -0
  71. package/dist/{forms → components/simple/forms}/Autocomplete.svelte +0 -0
  72. package/dist/{forms → components/simple/forms}/Autocomplete.svelte.d.ts +0 -0
  73. package/dist/{forms → components/simple/forms}/Checkbox.svelte +0 -0
  74. package/dist/{forms → components/simple/forms}/Checkbox.svelte.d.ts +0 -0
  75. package/dist/{forms → components/simple/forms}/FileInput.svelte +0 -0
  76. package/dist/{forms → components/simple/forms}/FileInput.svelte.d.ts +0 -0
  77. package/dist/{forms → components/simple/forms}/FileInputList.svelte +0 -0
  78. package/dist/{forms → components/simple/forms}/FileInputList.svelte.d.ts +0 -0
  79. package/dist/{forms → components/simple/forms}/Switch.svelte +0 -0
  80. package/dist/{forms → components/simple/forms}/Switch.svelte.d.ts +0 -0
  81. package/dist/{forms → components/simple/forms}/Textarea.svelte +0 -0
  82. package/dist/{forms → components/simple/forms}/Textarea.svelte.d.ts +0 -0
  83. package/dist/{forms → components/simple/forms}/Textfield.svelte +0 -0
  84. package/dist/{forms → components/simple/forms}/Textfield.svelte.d.ts +0 -0
  85. package/dist/{forms → components/simple/forms}/VerticalSwitch.svelte +0 -0
  86. package/dist/{forms → components/simple/forms}/VerticalSwitch.svelte.d.ts +0 -0
  87. package/dist/{forms → components/simple/forms}/VerticalTextSwitch.svelte +0 -0
  88. package/dist/{forms → components/simple/forms}/VerticalTextSwitch.svelte.d.ts +0 -0
  89. package/dist/{loaders → components/simple/loaders}/CircularLoader.svelte +0 -0
  90. package/dist/{loaders → components/simple/loaders}/CircularLoader.svelte.d.ts +0 -0
  91. package/dist/{loaders → components/simple/loaders}/Skeleton.svelte +0 -0
  92. package/dist/{loaders → components/simple/loaders}/Skeleton.svelte.d.ts +0 -0
  93. package/dist/{media → components/simple/media}/AttachmentDownloader.svelte +0 -0
  94. package/dist/{media → components/simple/media}/AttachmentDownloader.svelte.d.ts +0 -0
  95. package/dist/{media → components/simple/media}/Avatar.svelte +0 -0
  96. package/dist/{media → components/simple/media}/Avatar.svelte.d.ts +0 -0
  97. package/dist/{media → components/simple/media}/Carousel.svelte +0 -0
  98. package/dist/{media → components/simple/media}/Carousel.svelte.d.ts +0 -0
  99. package/dist/{media → components/simple/media}/DescriptiveAvatar.svelte +0 -0
  100. package/dist/{media → components/simple/media}/DescriptiveAvatar.svelte.d.ts +0 -0
  101. package/dist/{media → components/simple/media}/Gallery.svelte +0 -0
  102. package/dist/{media → components/simple/media}/Gallery.svelte.d.ts +0 -0
  103. package/dist/{media → components/simple/media}/Icon.svelte +0 -0
  104. package/dist/{media → components/simple/media}/Icon.svelte.d.ts +0 -0
  105. package/dist/{media → components/simple/media}/Image.svelte +2 -2
  106. /package/dist/{media → components/simple/media}/Image.svelte.d.ts +0 -0
  107. /package/dist/{media → components/simple/media}/ImageGrid.svelte +0 -0
  108. /package/dist/{media → components/simple/media}/ImageGrid.svelte.d.ts +0 -0
  109. /package/dist/{navigation → components/simple/navigation}/Breadcrumb.svelte +0 -0
  110. /package/dist/{navigation → components/simple/navigation}/Breadcrumb.svelte.d.ts +0 -0
  111. /package/dist/{navigation → components/simple/navigation}/Chip.svelte +0 -0
  112. /package/dist/{navigation → components/simple/navigation}/Chip.svelte.d.ts +0 -0
  113. /package/dist/{navigation → components/simple/navigation}/Drawer.svelte +0 -0
  114. /package/dist/{navigation → components/simple/navigation}/Drawer.svelte.d.ts +0 -0
  115. /package/dist/{navigation → components/simple/navigation}/TabSwitcher.svelte +0 -0
  116. /package/dist/{navigation → components/simple/navigation}/TabSwitcher.svelte.d.ts +0 -0
  117. /package/dist/{progress → components/simple/progress}/ProgressBar.svelte +0 -0
  118. /package/dist/{progress → components/simple/progress}/ProgressBar.svelte.d.ts +0 -0
  119. /package/dist/{timeline → components/simple/timeline}/SimpleTimeLine.svelte +0 -0
  120. /package/dist/{timeline → components/simple/timeline}/SimpleTimeLine.svelte.d.ts +0 -0
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Likablehair Svelte component library
2
2
 
3
- A simple library that contains svelte components, used by likablehair frontend applications
3
+ A simple library that contains svelte components, used by likablehair frontend applications.
4
4
 
5
5
  ## Developer guide
6
6
 
@@ -0,0 +1,176 @@
1
+ <script>import Dialog from "../../simple/dialogs/Dialog.svelte";
2
+ import { createEventDispatcher, onMount } from "svelte";
3
+ import SearchBar from "./SearchBar.svelte";
4
+ import Keyboarder, {} from "../../../utils/keyboarder";
5
+ import SearchResults, {} from "./SearchResults.svelte";
6
+ export let color = "rgb(113 113 122)", searchButtonRingColor = "rgba(24,24,27,.1)", searchButtonHoverRingColor = "rgba(24,24,27,.2)", searchButtonWidth = "100%", searchButtonMaxWidth = "28rem", searchButtonHeight = "2rem", searchButtonBackgroundColor = "white", searchButtonPadding = "0rem 0.75rem 0rem 0.5rem", searchButtonFontSize = ".875rem", searchButtonText = "Search", searchDialogOpened = false, transitionDuration = ".8s", searcher = () => Promise.resolve([]);
7
+ let searchBarInput, searchText = void 0, searchResults = void 0, searchLoading = false;
8
+ let dispatch = createEventDispatcher();
9
+ onMount(() => {
10
+ let handler = (params) => {
11
+ if ((params.meta || params.ctrl) && params.key == "k") {
12
+ toggleSearchDialog();
13
+ }
14
+ };
15
+ Keyboarder.on(handler);
16
+ return () => {
17
+ Keyboarder.off(handler);
18
+ };
19
+ });
20
+ function handleKeydown(event) {
21
+ if (event.key == "ArrowDown" || event.key == "ArrowUp")
22
+ event.preventDefault();
23
+ }
24
+ function toggleSearchDialog() {
25
+ searchDialogOpened = !searchDialogOpened;
26
+ if (searchDialogOpened)
27
+ searchBarInput.focus();
28
+ dispatch("toggle-search-dialog", { opened: searchDialogOpened });
29
+ }
30
+ async function search() {
31
+ if (!!searchText) {
32
+ searchLoading = true;
33
+ searchResults = await searcher({
34
+ searchText
35
+ });
36
+ searchLoading = false;
37
+ }
38
+ }
39
+ </script>
40
+
41
+ <div
42
+ style:--global-search-text-field-ring-color={searchButtonRingColor}
43
+ style:--global-search-text-field-hover-ring-color={searchButtonHoverRingColor}
44
+ style:--global-search-text-field-color={color}
45
+ style:--global-search-text-field-width={searchButtonWidth}
46
+ style:--global-search-text-field-max-width={searchButtonMaxWidth}
47
+ style:--global-search-text-field-height={searchButtonHeight}
48
+ style:--global-search-text-field-background-color={searchButtonBackgroundColor}
49
+ style:--global-search-text-field-padding={searchButtonPadding}
50
+ style:--global-search-text-field-font-size={searchButtonFontSize}
51
+ >
52
+ <slot
53
+ name="search-button"
54
+ {toggleSearchDialog}
55
+ >
56
+ <button
57
+ on:click={toggleSearchDialog}
58
+ class="search-like-button"
59
+ >
60
+ <slot name="search-button-icon">
61
+ <svg
62
+ viewBox="0 0 20 20"
63
+ fill="none"
64
+ aria-hidden="true"
65
+ class="search-icon"
66
+ ><path
67
+ stroke-linecap="round"
68
+ stroke-linejoin="round"
69
+ d="M12.01 12a4.25 4.25 0 1 0-6.02-6 4.25 4.25 0 0 0 6.02 6Zm0 0 3.24 3.25"
70
+ /></svg
71
+ >
72
+ </slot>
73
+ <slot name="search-button-text">
74
+ {searchButtonText}
75
+ </slot>
76
+ <slot name="search-button-shortcut">
77
+ <kbd class="shortcut"><kbd class="shortcut">⌘</kbd><kbd class="shortcut">K</kbd></kbd>
78
+ </slot>
79
+ </button>
80
+ </slot>
81
+ <Dialog
82
+ bind:open={searchDialogOpened}
83
+ transition="scale"
84
+ overlayBackdropFilter="blur(2px)"
85
+ transitionDuration={transitionDuration}
86
+ >
87
+ <div
88
+ style:max-width="90vw"
89
+ style:width="600px"
90
+ style:height="500px"
91
+ style:display="flex"
92
+ style:justify-content="center"
93
+ on:click={() => searchDialogOpened = false}
94
+ on:keypress={() => searchDialogOpened = false}
95
+ >
96
+ <div
97
+ on:click|stopPropagation={() => { }}
98
+ on:keypress|stopPropagation={() => { }}
99
+ style:width="100%"
100
+ style:height="fit-content"
101
+ >
102
+ <slot
103
+ name="search-bar"
104
+ searchBarInput
105
+ searchText
106
+ search
107
+ >
108
+ <SearchBar
109
+ bind:input={searchBarInput}
110
+ bind:value={searchText}
111
+ on:input={search}
112
+ on:keydown={handleKeydown}
113
+ ></SearchBar>
114
+ </slot>
115
+ {#if !!searchText}
116
+ <slot
117
+ name="search-results"
118
+ searchLoading
119
+ searchResults
120
+ >
121
+ <SearchResults
122
+ margin="-.5rem 0 0 0"
123
+ borderRadius="0 0 .5rem .5rem"
124
+ loading={searchLoading}
125
+ results={searchResults}
126
+ activeKeyboard
127
+ on:select
128
+ ></SearchResults>
129
+ </slot>
130
+ {/if}
131
+ </div>
132
+ </div>
133
+ </Dialog>
134
+ </div>
135
+
136
+ <style>
137
+ .search-like-button {
138
+ --global-search-text-field-ring-real-color: var(--global-search-text-field-ring-color);
139
+ box-shadow: inset 0 0 0 1px var(--global-search-text-field-ring-color);
140
+ color: var(--global-search-text-field-color);
141
+ display: flex;
142
+ align-items: center;
143
+ gap: 0.5rem;
144
+ width: var(--global-search-text-field-width);
145
+ max-width: var(--global-search-text-field-max-width);
146
+ height: var(--global-search-text-field-height);
147
+ font-size: var(--global-search-text-field-font-size);
148
+ line-height: 1.5rem;
149
+ background-color: var(--global-search-text-field-background-color);
150
+ border-radius: 9999px;
151
+ padding: var(--global-search-text-field-padding);
152
+ border: 0 solid #e5e7eb;
153
+ cursor: pointer;
154
+ transition-property: box-shadow;
155
+ transition-timing-function: cubic-bezier(0.075, 0.82, 0.165, 1);
156
+ transition-duration: .5s;
157
+ }
158
+
159
+ .search-like-button:hover {
160
+ box-shadow: inset 0 0 0 1px var(--global-search-text-field-hover-ring-color);
161
+ }
162
+
163
+ .search-icon {
164
+ height: 1.25rem;
165
+ width: 1.25rem;
166
+ stroke: currentColor;
167
+ }
168
+
169
+ .shortcut {
170
+ margin-left: auto;
171
+ font-size: 1rem;
172
+ color: var(--global-search-text-field-color);
173
+ text-transform: none;
174
+ font-family: ui-sans-serif,system-ui,-apple-system;
175
+ }
176
+ </style>
@@ -0,0 +1,47 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ import { type Result } from './SearchResults.svelte';
3
+ declare const __propDef: {
4
+ props: {
5
+ color?: string | undefined;
6
+ searchButtonRingColor?: string | undefined;
7
+ searchButtonHoverRingColor?: string | undefined;
8
+ searchButtonWidth?: string | undefined;
9
+ searchButtonMaxWidth?: string | undefined;
10
+ searchButtonHeight?: string | undefined;
11
+ searchButtonBackgroundColor?: string | undefined;
12
+ searchButtonPadding?: string | undefined;
13
+ searchButtonFontSize?: string | undefined;
14
+ searchButtonText?: string | undefined;
15
+ searchDialogOpened?: boolean | undefined;
16
+ transitionDuration?: string | undefined;
17
+ searcher?: ((params: {
18
+ searchText: string;
19
+ }) => Promise<Result[] | undefined>) | undefined;
20
+ };
21
+ events: {
22
+ select: CustomEvent<{
23
+ element: import("../../simple/lists/SelectableVerticalList.svelte").Element;
24
+ }>;
25
+ 'toggle-search-dialog': CustomEvent<{
26
+ opened: boolean;
27
+ }>;
28
+ } & {
29
+ [evt: string]: CustomEvent<any>;
30
+ };
31
+ slots: {
32
+ 'search-button': {
33
+ toggleSearchDialog: () => void;
34
+ };
35
+ 'search-button-icon': {};
36
+ 'search-button-text': {};
37
+ 'search-button-shortcut': {};
38
+ 'search-bar': {};
39
+ 'search-results': {};
40
+ };
41
+ };
42
+ export type GlobalSearchTextFieldProps = typeof __propDef.props;
43
+ export type GlobalSearchTextFieldEvents = typeof __propDef.events;
44
+ export type GlobalSearchTextFieldSlots = typeof __propDef.slots;
45
+ export default class GlobalSearchTextField extends SvelteComponentTyped<GlobalSearchTextFieldProps, GlobalSearchTextFieldEvents, GlobalSearchTextFieldSlots> {
46
+ }
47
+ export {};
@@ -0,0 +1,82 @@
1
+ <script>export let maxWidth = void 0, width = "100%", ringColor = "rgba(24,24,27,.1)", backgroundColor = "rgb(250 250 250/1)", borderRadius = "0.5rem", height = "3rem", padding = "0rem 1rem 0rem 1rem", lineHeight = "1.5rem", fontSize = ".875rem", input = void 0, value = void 0;
2
+ </script>
3
+
4
+ <div
5
+ style:--search-bar-ring-color={ringColor}
6
+ style:--search-bar-background-color={backgroundColor}
7
+ style:--search-bar-border-radius={borderRadius}
8
+ style:--search-bar-height={height}
9
+ style:--search-bar-padding={padding}
10
+ style:--search-bar-line-height={lineHeight}
11
+ style:--search-bar-font-size={fontSize}
12
+ style:max-width={maxWidth}
13
+ style:width={width}
14
+ class="container"
15
+ >
16
+ <slot name="icon">
17
+ <svg
18
+ viewBox="0 0 20 20"
19
+ fill="none"
20
+ aria-hidden="true"
21
+ class="search-icon"
22
+ ><path
23
+ stroke-linecap="round"
24
+ stroke-linejoin="round"
25
+ d="M12.01 12a4.25 4.25 0 1 0-6.02-6 4.25 4.25 0 0 0 6.02 6Zm0 0 3.24 3.25"
26
+ /></svg
27
+ >
28
+ </slot>
29
+ <slot name="input">
30
+ <input
31
+ aria-autocomplete="both"
32
+ aria-labelledby="search-content"
33
+ id="search-content"
34
+ autocomplete="off"
35
+ autocorrect="off"
36
+ autocapitalize="off"
37
+ enterkeyhint="search"
38
+ spellcheck="false"
39
+ placeholder="Find something..."
40
+ maxlength="512"
41
+ tabindex="0"
42
+ class="input"
43
+ bind:this={input}
44
+ bind:value={value}
45
+ on:input
46
+ on:change
47
+ on:keydown
48
+ />
49
+ </slot>
50
+ </div>
51
+
52
+ <style>
53
+ .container {
54
+ box-shadow: inset 0 0 0 1px var(--search-bar-ring-color);
55
+ background-color: var(--search-bar-background-color);
56
+ border-radius: var(--search-bar-border-radius);
57
+ height: var(--search-bar-height);
58
+ display: flex;
59
+ align-items: center;
60
+ gap: 0.5rem;
61
+ padding: var(--search-bar-padding);
62
+ box-sizing: border-box;
63
+ }
64
+
65
+ .input {
66
+ font-size: var(--search-bar-font-size);
67
+ line-height: var(--search-bar-line-height);
68
+ box-sizing: border-box;
69
+ border: 0 solid #e5e7eb;
70
+ outline: 2px solid transparent;
71
+ outline-offset: 2px;
72
+ background-color: transparent;
73
+ color: inherit;
74
+ appearance: none;
75
+ }
76
+
77
+ .search-icon {
78
+ height: 1.25rem;
79
+ width: 1.25rem;
80
+ stroke: currentColor;
81
+ }
82
+ </style>
@@ -0,0 +1,33 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ maxWidth?: string | undefined;
5
+ width?: string | undefined;
6
+ ringColor?: string | undefined;
7
+ backgroundColor?: string | undefined;
8
+ borderRadius?: string | undefined;
9
+ height?: string | undefined;
10
+ padding?: string | undefined;
11
+ lineHeight?: string | undefined;
12
+ fontSize?: string | undefined;
13
+ input?: HTMLElement | undefined;
14
+ value?: string | undefined;
15
+ };
16
+ events: {
17
+ input: Event;
18
+ change: Event;
19
+ keydown: KeyboardEvent;
20
+ } & {
21
+ [evt: string]: CustomEvent<any>;
22
+ };
23
+ slots: {
24
+ icon: {};
25
+ input: {};
26
+ };
27
+ };
28
+ export type SearchBarProps = typeof __propDef.props;
29
+ export type SearchBarEvents = typeof __propDef.events;
30
+ export type SearchBarSlots = typeof __propDef.slots;
31
+ export default class SearchBar extends SvelteComponentTyped<SearchBarProps, SearchBarEvents, SearchBarSlots> {
32
+ }
33
+ export {};
@@ -0,0 +1,100 @@
1
+ <script context="module"></script>
2
+
3
+ <script>import SelectableVerticalList from "../../simple/lists/SelectableVerticalList.svelte";
4
+ export let maxWidth = void 0, width = "100%", height = void 0, maxHeight = void 0, margin = void 0, backgroundColor = "rgb(255 255 255/1)", noDataText = "Sorry, nothing found", loadingText = "Searching for references ...", borderColor = "rgb(228 228 231/1)", borderRadius = void 0, results = [], loading = false, footer = true, activeKeyboard = false;
5
+ </script>
6
+
7
+ <div
8
+ style:--search-results-width={width}
9
+ style:--search-results-max-width={maxWidth}
10
+ style:--search-results-height={height}
11
+ style:--search-results-max-height={maxHeight}
12
+ style:--search-results-margin={margin}
13
+ style:--search-results-background-color={backgroundColor}
14
+ style:--search-results-border-color={borderColor}
15
+ style:--search-results-border-radius={borderRadius}
16
+ class="container"
17
+ >
18
+ {#if loading}
19
+ <div class="loading-container">
20
+ <slot name="loading">
21
+ <span style:font-size=".875rem">{loadingText}</span>
22
+ </slot>
23
+ </div>
24
+ {:else if !results || results.length == 0}
25
+ <div
26
+ class="no-data-container"
27
+ >
28
+ <slot name="no-data">
29
+ <span style:font-size=".875rem">{noDataText}</span>
30
+ </slot>
31
+ </div>
32
+ {:else}
33
+ <div>
34
+ <SelectableVerticalList
35
+ elements={results.map((r) => {
36
+ return {
37
+ title: r.title,
38
+ description: r.subtitle,
39
+ name: r.name,
40
+ data: r.data
41
+ }
42
+ })}
43
+ activeKeyboard={activeKeyboard}
44
+ on:focus
45
+ on:select
46
+ >
47
+ <div
48
+ slot="description"
49
+ let:element
50
+ style:margin-top=".5rem"
51
+ style:opacity="60%"
52
+ >
53
+ {element.description}
54
+ </div>
55
+ </SelectableVerticalList>
56
+ </div>
57
+ {/if}
58
+ {#if footer}
59
+ <div class="footer">
60
+ <slot name="footer">
61
+ <span
62
+ style:font-size=".875rem"
63
+ >
64
+ <span
65
+ style:opacity=".5"
66
+ >Search with</span> ❤️
67
+ </span>
68
+ </slot>
69
+ </div>
70
+ {/if}
71
+ </div>
72
+
73
+ <style>
74
+ .container {
75
+ width: var(--search-results-width);
76
+ max-width: var(--search-results-max-width);
77
+ height: var(--search-results-height);
78
+ max-height: var(--search-results-max-height);
79
+ background-color: var(--search-results-background-color);
80
+ margin: var(--search-results-margin);
81
+ border-top: 1px solid var(--search-results-border-color);
82
+ border-radius: var(--search-results-border-radius);
83
+ }
84
+
85
+ .no-data-container, .loading-container {
86
+ display: flex;
87
+ align-items: center;
88
+ justify-content: center;
89
+ padding: 2rem;
90
+ }
91
+
92
+ .footer {
93
+ border-top: 1px solid var(--search-results-border-color);
94
+ display: flex;
95
+ align-items: center;
96
+ justify-content: flex-end;
97
+ padding: 0 1rem;
98
+ height: 2rem;
99
+ }
100
+ </style>
@@ -0,0 +1,47 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ export type Result = {
3
+ title: string;
4
+ name: string | number;
5
+ subtitle?: string;
6
+ url?: string;
7
+ data?: Record<string, any>;
8
+ };
9
+ declare const __propDef: {
10
+ props: {
11
+ maxWidth?: string | undefined;
12
+ width?: string | undefined;
13
+ height?: string | undefined;
14
+ maxHeight?: string | undefined;
15
+ margin?: string | undefined;
16
+ backgroundColor?: string | undefined;
17
+ noDataText?: string | undefined;
18
+ loadingText?: string | undefined;
19
+ borderColor?: string | undefined;
20
+ borderRadius?: string | undefined;
21
+ results?: Result[] | undefined;
22
+ loading?: boolean | undefined;
23
+ footer?: boolean | undefined;
24
+ activeKeyboard?: boolean | undefined;
25
+ };
26
+ events: {
27
+ focus: CustomEvent<{
28
+ element: import("../../simple/lists/SelectableVerticalList.svelte").Element;
29
+ }>;
30
+ select: CustomEvent<{
31
+ element: import("../../simple/lists/SelectableVerticalList.svelte").Element;
32
+ }>;
33
+ } & {
34
+ [evt: string]: CustomEvent<any>;
35
+ };
36
+ slots: {
37
+ loading: {};
38
+ 'no-data': {};
39
+ footer: {};
40
+ };
41
+ };
42
+ export type SearchResultsProps = typeof __propDef.props;
43
+ export type SearchResultsEvents = typeof __propDef.events;
44
+ export type SearchResultsSlots = typeof __propDef.slots;
45
+ export default class SearchResults extends SvelteComponentTyped<SearchResultsProps, SearchResultsEvents, SearchResultsSlots> {
46
+ }
47
+ export {};
@@ -1,7 +1,7 @@
1
1
  <script>export let image = "", title = "", sale = false, saleText = "SALE", price = void 0, currency = "\u20AC", discount = void 0, maxWidth = void 0, maxHeight = void 0, minWidth = void 0, minHeight = void 0, width = void 0, height = void 0;
2
2
  $:
3
3
  priceLessDiscount = Number(((price || 0) - (discount || 0)).toFixed(2));
4
- import Image from "../media/Image.svelte";
4
+ import Image from "../../../media/Image.svelte";
5
5
  </script>
6
6
 
7
7
  <div
@@ -0,0 +1,189 @@
1
+ <script>import MediaQuery from "../simple/common/MediaQuery.svelte";
2
+ import Icon from "../simple/media/Icon.svelte";
3
+ import { createEventDispatcher } from "svelte";
4
+ export let sideBarWidth = "18rem", sideBarBorderColor = "hsl(0deg 0% 39.85% / 50%)", sideBarPadding = "1rem 1.5rem 2rem 1.5rem", headerMenuHeight = "3.5rem", headerMenuBorderColor = "hsl(0deg 0% 39.85% / 50%)", headerMenuPadding = "0rem 2rem 0rem 2rem", padding = "1rem 2rem 1rem 2rem", innerHeaderMenuBackgroundColor = "rgb(255 255 255/0.5)", drawerBackgroundColor = "white", drawerWidth = "24rem", drawerOpened = false;
5
+ let dispatch = createEventDispatcher();
6
+ function toggleMenu() {
7
+ drawerOpened = !drawerOpened;
8
+ dispatch("drawer-change", { opened: drawerOpened });
9
+ }
10
+ function handleOverlayClick() {
11
+ drawerOpened = false;
12
+ dispatch("drawer-change", { opened: drawerOpened });
13
+ }
14
+ </script>
15
+
16
+ <MediaQuery let:mAndDown>
17
+ <div
18
+ style:--stable-divider-side-bar-layout-side-bar-width={sideBarWidth}
19
+ style:--stable-divider-side-bar-layout-side-bar-border-color={sideBarBorderColor}
20
+ style:--stable-divider-side-bar-layout-side-bar-padding={sideBarPadding}
21
+ style:--stable-divider-side-bar-layout-header-menu-height={headerMenuHeight}
22
+ style:--stable-divider-side-bar-layout-header-menu-border-color={headerMenuBorderColor}
23
+ style:--stable-divider-side-bar-layout-header-menu-padding={headerMenuPadding}
24
+ style:--stable-divider-side-bar-layout-inner-header-menu-background-color={innerHeaderMenuBackgroundColor}
25
+ style:--stable-divider-side-bar-layout-drawer-background-color={drawerBackgroundColor}
26
+ style:--stable-divider-side-bar-layout-drawer-width={drawerWidth}
27
+ >
28
+ <header
29
+ class="side-bar"
30
+ class:opened={drawerOpened}
31
+ >
32
+ <div
33
+ class="header-toolbar"
34
+ class:opened-drawer={drawerOpened}
35
+ >
36
+ <slot name="menu">
37
+ <div class="inner-menu">
38
+ {#if mAndDown}
39
+ <div style:margin-right="2rem">
40
+ <Icon
41
+ name="mdi-menu"
42
+ click
43
+ on:click={toggleMenu}
44
+ ></Icon>
45
+ </div>
46
+ {/if}
47
+ <slot name="inner-menu" hamburgerVisible={mAndDown}>
48
+ Menu
49
+ </slot>
50
+ </div>
51
+ </slot>
52
+ </div>
53
+ <div class="side-bar-content">
54
+ <slot name="sidebar" hamburgerVisible={mAndDown}>
55
+ Sidebar
56
+ </slot>
57
+ </div>
58
+ </header>
59
+ <div class="main-section">
60
+ <div
61
+ class="overlay"
62
+ on:click={handleOverlayClick}
63
+ on:keypress={handleOverlayClick}
64
+ class:visible={drawerOpened}
65
+ ></div>
66
+ <div
67
+ style:padding={padding}
68
+ class:blurred={drawerOpened}
69
+ >
70
+ <slot>Content</slot>
71
+ </div>
72
+ </div>
73
+ </div>
74
+ </MediaQuery>
75
+
76
+
77
+ <style>
78
+ .side-bar {
79
+ position: fixed;
80
+ width: var(--stable-divider-side-bar-layout-side-bar-width);
81
+ border-right: 1px solid var(--stable-divider-side-bar-layout-side-bar-border-color);
82
+ top: 0;
83
+ bottom: 0;
84
+ left: 0;
85
+ right: 0;
86
+ padding: var(--stable-divider-side-bar-layout-side-bar-padding);
87
+ }
88
+
89
+ .overlay {
90
+ display: none;
91
+ }
92
+
93
+ @media (max-width: 1024px) {
94
+ .side-bar {
95
+ left: calc(0rem - var(--stable-divider-side-bar-layout-drawer-width));
96
+ right: auto;
97
+ transition-property: left;
98
+ transition-timing-function: cubic-bezier(.4,0,.2,1);
99
+ transition-duration: .5s;
100
+ top: var(--stable-divider-side-bar-layout-header-menu-height);
101
+ background-color: var(--stable-divider-side-bar-layout-drawer-background-color);
102
+ bottom: 0;
103
+ z-index: 30;
104
+ width: var(--stable-divider-side-bar-layout-drawer-width);
105
+ max-width: 100vw;
106
+ }
107
+
108
+ .side-bar.opened {
109
+ left: 0;
110
+ }
111
+
112
+ .overlay {
113
+ position: fixed;
114
+ top: var(--stable-divider-side-bar-layout-header-menu-height);
115
+ left: 0;
116
+ bottom: 0;
117
+ right: 0;
118
+ z-index: -100;
119
+ transition-property: backdrop-filter;
120
+ transition-timing-function: cubic-bezier(.4,0,.2,1);
121
+ transition-duration: .15s;
122
+ display: block;
123
+ }
124
+
125
+ .overlay.visible {
126
+ background-color: hsla(240,5%,65%,.2);
127
+ backdrop-filter: blur(4px);
128
+ z-index: 20;
129
+ }
130
+ }
131
+
132
+ .header-toolbar {
133
+ position: fixed;
134
+ height: var(--stable-divider-side-bar-layout-header-menu-height);
135
+ left: var(--stable-divider-side-bar-layout-side-bar-width);
136
+ border-bottom: 1px solid var(--stable-divider-side-bar-layout-header-menu-border-color);
137
+ backdrop-filter: blur(4px);
138
+ background-color: var(--stable-divider-side-bar-layout-inner-header-menu-background-color);
139
+ transition-property: background-color;
140
+ transition-timing-function: cubic-bezier(.4,0,.2,1);
141
+ transition-duration: .5s;
142
+ right: 0;
143
+ top: 0;
144
+ }
145
+
146
+ @media (max-width: 1024px) {
147
+ .header-toolbar {
148
+ left: 0;
149
+ }
150
+
151
+ .header-toolbar.opened-drawer {
152
+ background-color: inherit;
153
+ }
154
+
155
+ .header-toolbar:hover {
156
+ background-color: inherit;
157
+ }
158
+ }
159
+
160
+ .main-section {
161
+ padding-left: var(--stable-divider-side-bar-layout-side-bar-width);
162
+ padding-top: var(--stable-divider-side-bar-layout-header-menu-height);
163
+ }
164
+
165
+ @media (max-width: 1024px) {
166
+ .main-section {
167
+ padding-left: 0;
168
+ }
169
+
170
+ .blurred {
171
+ backdrop-filter: blur(4px);
172
+ }
173
+ }
174
+
175
+ .inner-menu {
176
+ padding: var(--stable-divider-side-bar-layout-header-menu-padding);
177
+ background-color: var(--stable-divider-side-bar-layout-inner-header-menu-background-color);
178
+ height: 100%;
179
+ display: flex;
180
+ align-items: center;
181
+ justify-content: space-between;
182
+ }
183
+
184
+ * {
185
+ box-sizing: border-box;
186
+ border: 0 solid #e5e7eb;
187
+ }
188
+
189
+ </style>