@fluid-topics/ft-search-bar 0.2.16 → 0.2.19

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.
@@ -7,6 +7,7 @@ export declare const FtSearchBarCssVariables: {
7
7
  mobileOpenBottom: FtCssVariable;
8
8
  mobileOpenLeft: FtCssVariable;
9
9
  mobileOpenRight: FtCssVariable;
10
+ desktopFiltersHeight: FtCssVariable;
10
11
  floatingZIndex: FtCssVariable;
11
12
  colorSurface: FtCssVariable;
12
13
  colorOnSurface: FtCssVariable;
@@ -6,6 +6,7 @@ import { FtSelectCssVariables } from "@fluid-topics/ft-select";
6
6
  import { FtSnapScrollCssVariables } from "@fluid-topics/ft-snap-scroll";
7
7
  import { FtChipCssVariables } from "@fluid-topics/ft-chip";
8
8
  import { FtSkeletonCssVariables } from "@fluid-topics/ft-skeleton";
9
+ import { FtTooltipCssVariables } from "@fluid-topics/ft-tooltip";
9
10
  export const FtSearchBarCssVariables = {
10
11
  height: FtCssVariable.create("--ft-search-bar-height", "SIZE", "38px"),
11
12
  borderRadius: FtCssVariable.extend("--ft-search-bar-border-radius", designSystemVariables.borderRadiusS),
@@ -14,7 +15,8 @@ export const FtSearchBarCssVariables = {
14
15
  mobileOpenBottom: FtCssVariable.create("--ft-search-bar-mobile-open-bottom", "SIZE", "0"),
15
16
  mobileOpenLeft: FtCssVariable.create("--ft-search-bar-mobile-open-left", "SIZE", "0"),
16
17
  mobileOpenRight: FtCssVariable.create("--ft-search-bar-mobile-open-right", "SIZE", "0"),
17
- floatingZIndex: FtCssVariable.create("--ft-search-bar-floating-components-z-index", "NUMBER", "2"),
18
+ desktopFiltersHeight: FtCssVariable.create("--ft-search-bar-desktop-filters-height", "SIZE", "350px"),
19
+ floatingZIndex: FtCssVariable.create("--ft-search-bar-floating-components-z-index", "NUMBER", "3"),
18
20
  colorSurface: FtCssVariable.external(designSystemVariables.colorSurface, "Design system"),
19
21
  colorOnSurface: FtCssVariable.external(designSystemVariables.colorOnSurface, "Design system"),
20
22
  colorOnSurfaceMedium: FtCssVariable.external(designSystemVariables.colorOnSurfaceMedium, "Design system"),
@@ -50,9 +52,16 @@ export const searchBarCss = css `
50
52
  right: ${FtSearchBarCssVariables.mobileOpenRight};
51
53
  z-index: ${FtSearchBarCssVariables.floatingZIndex};
52
54
  padding: 16px;
55
+ }
56
+
57
+ .ft-search-bar--mobile-menu-open:not(.ft-search-bar--forced-open) {
53
58
  background: ${FtSearchBarCssVariables.colorSurface};
54
59
  }
55
60
 
61
+ .ft-search-bar--mobile-menu-open.ft-search-bar--forced-open {
62
+ position: ${FtSearchBarCssVariables.mobileOpenPosition.get("static")};
63
+ }
64
+
56
65
  .ft-search-bar {
57
66
  position: relative;
58
67
  display: flex;
@@ -106,12 +115,12 @@ export const searchBarCss = css `
106
115
  flex-grow: 1;
107
116
  border: none;
108
117
  background-color: transparent;
118
+ color: ${FtSearchBarCssVariables.colorOnSurface};
109
119
  outline: none;
110
120
  }
111
121
 
112
- .ft-search-bar--desktop .ft-search-bar--input {
113
- flex-shrink: 0;
114
- min-width: 250px;
122
+ .ft-search-bar--input::placeholder {
123
+ color: ${FtSearchBarCssVariables.colorOnSurfaceMedium};
115
124
  }
116
125
 
117
126
  .ft-search-bar--actions {
@@ -121,7 +130,7 @@ export const searchBarCss = css `
121
130
  align-items: center;
122
131
  height: 100%;
123
132
 
124
- --ft-tooltip-z-index: 3;
133
+ ${setVariable(FtTooltipCssVariables.zIndex, `calc(${FtSearchBarCssVariables.floatingZIndex} + 1)`)};
125
134
  }
126
135
 
127
136
  .ft-search-bar > ft-button,
@@ -179,23 +188,31 @@ export const searchBarCss = css `
179
188
  `;
180
189
  //language=css
181
190
  export const facetsCss = css `
182
- .ft-search-bar--floating-panel .ft-search-bar--presets {
191
+ .ft-search-bar--desktop-menu .ft-search-bar--presets {
183
192
  margin-right: auto;
184
193
  }
185
194
 
186
- .ft-search-bar--floating-panel .ft-search-bar--presets {
195
+ .ft-search-bar--desktop-menu .ft-search-bar--presets {
187
196
  min-width: 250px;
188
197
  ${setVariable(FtSelectCssVariables.optionsZIndex, "2")};
189
198
  }
190
199
 
191
- .ft-search-bar--floating-panel {
200
+ .ft-search-bar--desktop-menu {
201
+ display: flex;
192
202
  flex-direction: column;
193
203
  gap: 16px;
204
+ }
205
+
206
+ .ft-search-bar + .ft-search-bar--desktop-menu {
207
+ margin-top: 8px;
208
+ }
209
+
210
+ .ft-search-bar--floating-panel {
194
211
  padding: 16px;
195
212
  }
196
213
 
197
214
  .ft-search-bar--floating-panel-open .ft-search-bar--floating-panel {
198
- display: flex;
215
+ display: block;
199
216
  }
200
217
 
201
218
  .ft-search-bar--desktop .ft-search-bar--facets-actions {
@@ -203,6 +220,9 @@ export const facetsCss = css `
203
220
  align-items: center;
204
221
  justify-content: flex-end;
205
222
  gap: 8px;
223
+ }
224
+
225
+ .ft-search-bar--floating-panel .ft-search-bar--facets-actions {
206
226
  padding: 0 10px;
207
227
  }
208
228
 
@@ -224,13 +244,13 @@ export const facetsCss = css `
224
244
  display: none;
225
245
  }
226
246
 
227
- .ft-search-bar--floating-panel .ft-search-bar--filters-container {
247
+ .ft-search-bar--desktop-menu .ft-search-bar--filters-container {
228
248
  display: block;
229
- height: 350px;
249
+ height: ${FtSearchBarCssVariables.desktopFiltersHeight};
230
250
  --ft-snap-scroll-gap: 16px;
231
251
  }
232
252
 
233
- .ft-search-bar--floating-panel ft-filter {
253
+ .ft-search-bar--desktop-menu ft-filter {
234
254
  display: flex;
235
255
  flex-grow: 0;
236
256
  max-height: 100%;
@@ -294,7 +314,7 @@ export const facetsCss = css `
294
314
  padding-right: 0;
295
315
  }
296
316
 
297
- .ft-search-bar--floating-panel .ft-search-bar--launch-search {
317
+ .ft-search-bar--desktop-menu .ft-search-bar--launch-search {
298
318
  margin: 0;
299
319
  }
300
320
  `;
@@ -350,7 +370,7 @@ export const suggestionsCss = css `
350
370
  .ft-search-bar--floating-panel,
351
371
  .ft-search-bar--desktop .ft-search-bar--suggestions {
352
372
  position: absolute;
353
- z-index: var(--ft-search-bar-floating-components-z-index, 1);
373
+ z-index: ${FtSearchBarCssVariables.floatingZIndex};
354
374
  top: 100%;
355
375
  left: -1px;
356
376
  right: -1px;
@@ -370,12 +390,6 @@ export const suggestionsCss = css `
370
390
  display: block;
371
391
  }
372
392
 
373
- .ft-search-bar--no-suggestions {
374
- text-align: center;
375
- padding: 8px;
376
- color: ${FtSearchBarCssVariables.colorOnSurface};
377
- }
378
-
379
393
  .ft-search-bar--suggestion {
380
394
  text-decoration: none;
381
395
  position: relative;
@@ -16,8 +16,8 @@ export interface FtSearchBarLabels extends ParametrizedLabels {
16
16
  clearInputButton?: string;
17
17
  clearFilterButton?: string;
18
18
  displayMoreFilterValuesButton?: string;
19
+ noFilterValuesAvailable?: string;
19
20
  searchButton?: string;
20
- noSuggestions?: string;
21
21
  contentLocaleSelector?: string;
22
22
  presetsSelector?: string;
23
23
  removeRecentSearch?: string;
@@ -28,7 +28,7 @@ export declare type DisplayMode = "auto" | "mobile" | "desktop";
28
28
  export interface FtSearchBarProperties {
29
29
  labels?: FtSearchBarLabels;
30
30
  mode?: DisplayMode;
31
- forceMobileMenuOpen?: boolean;
31
+ forceMenuOpen?: boolean;
32
32
  baseUrl: string;
33
33
  apiIntegrationIdentifier?: string;
34
34
  contentLocale?: string;
@@ -52,6 +52,7 @@ export declare class FtSearchBar extends FtLitElement implements FtSearchBarProp
52
52
  dense: boolean;
53
53
  mode?: DisplayMode;
54
54
  forceMobileMenuOpen: boolean;
55
+ forceMenuOpen: boolean;
55
56
  baseUrl: string;
56
57
  apiIntegrationIdentifier: string;
57
58
  contentLocale?: string;
@@ -88,7 +89,6 @@ export declare class FtSearchBar extends FtLitElement implements FtSearchBarProp
88
89
  private lastSuggestion?;
89
90
  private updateFacetsDebouncer;
90
91
  private suggestDebouncer;
91
- private get recentSearchesStorageKey();
92
92
  private api?;
93
93
  get request(): FtSearchRequest;
94
94
  get facetsRequest(): Array<FtSearchFacetConf>;
@@ -99,6 +99,7 @@ export declare class FtSearchBar extends FtLitElement implements FtSearchBarProp
99
99
  private get hasPriors();
100
100
  private get hasLocaleSelector();
101
101
  focus(): void;
102
+ focusInput(): void;
102
103
  clear(): void;
103
104
  protected render(): import("lit-html").TemplateResult<1>;
104
105
  protected renderSearchBar(): import("lit-html").TemplateResult<1>;
@@ -107,9 +108,11 @@ export declare class FtSearchBar extends FtLitElement implements FtSearchBarProp
107
108
  private renderMobileFacets;
108
109
  private contentLocalesAsFilterOptions;
109
110
  private renderDesktopSearchBar;
111
+ private renderDesktopMenu;
110
112
  private renderSearchBarLeftAction;
111
113
  private renderDesktopSearchBarButtons;
112
114
  private renderFacetsActions;
115
+ private renderDesktopClearFilters;
113
116
  private renderDesktopFacets;
114
117
  private renderSelectedFacets;
115
118
  private renderSuggestions;
@@ -131,6 +134,8 @@ export declare class FtSearchBar extends FtLitElement implements FtSearchBarProp
131
134
  private onSuggestKeyUp;
132
135
  private onSuggestSelected;
133
136
  private launchSearch;
137
+ private get recentSearchesStorageKey();
138
+ private initRecentSearches;
134
139
  private saveRecentSearches;
135
140
  private closeFloatingContainer;
136
141
  connectedCallback(): void;
@@ -144,7 +149,5 @@ export declare class FtSearchBar extends FtLitElement implements FtSearchBarProp
144
149
  private clearFilters;
145
150
  private removeRecentSearch;
146
151
  private onSuggestKeyDown;
147
- private getFilterExportParts;
148
- private getFilterSubPartExportAttribute;
149
152
  }
150
153
  //# sourceMappingURL=ft-search-bar.d.ts.map