@empathyco/x-components 3.0.0-alpha.80 → 3.0.0-alpha.83

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 (49) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/design-system/base.css +13 -13
  3. package/design-system/default-theme.css +80 -80
  4. package/docs/API-reference/api/x-components.md +0 -1
  5. package/docs/API-reference/api/x-components.xmoduleoptions.md +1 -1
  6. package/docs/API-reference/api/x-components.xstoremoduleoptions.md +1 -1
  7. package/docs/API-reference/components/history-queries/x-components.clear-history-queries.md +29 -4
  8. package/docs/API-reference/components/history-queries/x-components.history-queries.md +51 -23
  9. package/docs/API-reference/components/history-queries/x-components.history-query.md +67 -17
  10. package/docs/API-reference/components/next-queries/x-components.next-queries-list.md +2 -2
  11. package/docs/API-reference/components/next-queries/x-components.next-queries.md +107 -26
  12. package/docs/API-reference/components/next-queries/x-components.next-query.md +57 -9
  13. package/docs/API-reference/components/popular-searches/x-components.popular-search.md +54 -11
  14. package/docs/API-reference/components/popular-searches/x-components.popular-searches.md +87 -23
  15. package/docs/API-reference/components/query-suggestions/x-components.query-suggestion.md +6 -6
  16. package/docs/API-reference/components/query-suggestions/x-components.query-suggestions.md +15 -14
  17. package/docs/API-reference/components/related-tags/x-components.related-tag.md +14 -20
  18. package/docs/API-reference/components/related-tags/x-components.related-tags.md +25 -23
  19. package/docs/API-reference/components/search-box/x-components.clear-search-input.md +26 -21
  20. package/docs/API-reference/components/search-box/x-components.search-button.md +39 -17
  21. package/docs/API-reference/components/search-box/x-components.search-input.md +18 -18
  22. package/js/x-installer/x-installer/x-installer.js.map +1 -1
  23. package/js/x-modules/history-queries/components/clear-history-queries.vue.js.map +1 -1
  24. package/js/x-modules/history-queries/components/history-queries.vue.js.map +1 -1
  25. package/js/x-modules/history-queries/components/history-query.vue.js.map +1 -1
  26. package/js/x-modules/next-queries/components/next-queries-list.vue.js.map +1 -1
  27. package/js/x-modules/next-queries/components/next-queries.vue.js.map +1 -1
  28. package/js/x-modules/next-queries/components/next-query.vue.js.map +1 -1
  29. package/js/x-modules/popular-searches/components/popular-search.vue.js.map +1 -1
  30. package/js/x-modules/popular-searches/components/popular-searches.vue.js.map +1 -1
  31. package/js/x-modules/query-suggestions/components/query-suggestion.vue.js.map +1 -1
  32. package/js/x-modules/query-suggestions/components/query-suggestions.vue.js.map +1 -1
  33. package/js/x-modules/related-tags/components/related-tag.vue.js +2 -2
  34. package/js/x-modules/related-tags/components/related-tag.vue.js.map +1 -1
  35. package/js/x-modules/related-tags/components/related-tags.vue.js +2 -2
  36. package/js/x-modules/related-tags/components/related-tags.vue.js.map +1 -1
  37. package/js/x-modules/search-box/components/clear-search-input.vue.js.map +1 -1
  38. package/js/x-modules/search-box/components/search-button.vue.js.map +1 -1
  39. package/js/x-modules/search-box/components/search-input.vue.js +2 -2
  40. package/js/x-modules/search-box/components/search-input.vue.js.map +1 -1
  41. package/package.json +5 -5
  42. package/report/x-components.api.json +5 -70
  43. package/report/x-components.api.md +6 -11
  44. package/types/plugins/x-plugin.types.d.ts +2 -1
  45. package/types/plugins/x-plugin.types.d.ts.map +1 -1
  46. package/types/utils/types.d.ts +1 -10
  47. package/types/utils/types.d.ts.map +1 -1
  48. package/types/x-installer/x-installer/x-installer.d.ts.map +1 -1
  49. package/docs/API-reference/api/x-components.deeppartial.md +0 -17
package/CHANGELOG.md CHANGED
@@ -3,6 +3,43 @@
3
3
  All notable changes to this project will be documented in this file. See
4
4
  [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [3.0.0-alpha.83](https://github.com/empathyco/x/compare/@empathyco/x-components@3.0.0-alpha.82...@empathyco/x-components@3.0.0-alpha.83) (2022-04-07)
7
+
8
+ ### Code Refactoring
9
+
10
+ - move DeepPartial type from x-components to x-utils
11
+ ([a26f0c5](https://github.com/empathyco/x/commit/a26f0c54317f17144b4262c60b0a0dc086883eb9)),
12
+ closes [EX-5835](https://searchbroker.atlassian.net/browse/EX-5835)
13
+
14
+ ### Documentation
15
+
16
+ - activating ready live-examples
17
+ ([953e6c2](https://github.com/empathyco/x/commit/953e6c2ead73cd464fbb861bcc917134eac478a1)),
18
+ closes [EX-5705](https://searchbroker.atlassian.net/browse/EX-5705)
19
+
20
+ # Change Log
21
+
22
+ All notable changes to this project will be documented in this file. See
23
+ [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
24
+
25
+ ## [3.0.0-alpha.82](https://github.com/empathyco/x/compare/@empathyco/x-components@3.0.0-alpha.81...@empathyco/x-components@3.0.0-alpha.82) (2022-04-05)
26
+
27
+ **Note:** Version bump only for package @empathyco/x-components
28
+
29
+ # Change Log
30
+
31
+ All notable changes to this project will be documented in this file. See
32
+ [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
33
+
34
+ ## [3.0.0-alpha.81](https://github.com/empathyco/x/compare/@empathyco/x-components@3.0.0-alpha.80...@empathyco/x-components@3.0.0-alpha.81) (2022-04-05)
35
+
36
+ **Note:** Version bump only for package @empathyco/x-components
37
+
38
+ # Change Log
39
+
40
+ All notable changes to this project will be documented in this file. See
41
+ [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
42
+
6
43
  ## [3.0.0-alpha.80](https://github.com/empathyco/x/compare/@empathyco/x-components@3.0.0-alpha.79...@empathyco/x-components@3.0.0-alpha.80) (2022-04-04)
7
44
 
8
45
  ### Testing
@@ -5,19 +5,6 @@
5
5
  --x-size-border-radius-base-pill: 99999px;
6
6
  --x-size-border-width-base: 1px;
7
7
  }
8
- :root {
9
- --x-color-base-lead: #36515b;
10
- --x-color-base-auxiliary: #667981;
11
- --x-color-base-neutral-10: #1a1a1a;
12
- --x-color-base-neutral-35: #595959;
13
- --x-color-base-neutral-70: #b3b3b3;
14
- --x-color-base-neutral-95: #f2f2f2;
15
- --x-color-base-neutral-100: #ffffff;
16
- --x-color-base-accent: #b90276;
17
- --x-color-base-enable: #00705c;
18
- --x-color-base-disable: #e11f26;
19
- --x-color-base-transparent: transparent;
20
- }
21
8
  :root {
22
9
  --x-size-base-01: 2px;
23
10
  --x-size-base-02: 4px;
@@ -53,4 +40,17 @@
53
40
  --x-size-line-height-base-s: 16px;
54
41
  --x-size-line-height-base-m: 24px;
55
42
  --x-size-line-height-base-l: 32px;
43
+ }
44
+ :root {
45
+ --x-color-base-lead: #36515b;
46
+ --x-color-base-auxiliary: #667981;
47
+ --x-color-base-neutral-10: #1a1a1a;
48
+ --x-color-base-neutral-35: #595959;
49
+ --x-color-base-neutral-70: #b3b3b3;
50
+ --x-color-base-neutral-95: #f2f2f2;
51
+ --x-color-base-neutral-100: #ffffff;
52
+ --x-color-base-accent: #b90276;
53
+ --x-color-base-enable: #00705c;
54
+ --x-color-base-disable: #e11f26;
55
+ --x-color-base-transparent: transparent;
56
56
  }
@@ -1634,86 +1634,6 @@
1634
1634
  -webkit-text-decoration: var(--x-font-decoration-option-list-button-default-hover);
1635
1635
  text-decoration: var(--x-font-decoration-option-list-button-default-hover);
1636
1636
  }
1637
- :root {
1638
- --x-color-background-option-list-button-default: transparent;
1639
- --x-color-border-option-list-button-default: transparent;
1640
- --x-color-text-option-list-button-default: var(--x-color-base-neutral-35);
1641
- --x-color-background-option-list-button-default-hover: var(
1642
- --x-color-background-option-list-button-default
1643
- );
1644
- --x-color-border-option-list-button-default-hover: var(
1645
- --x-color-border-option-list-button-default
1646
- );
1647
- --x-color-text-option-list-button-default-hover: var(--x-color-text-option-list-button-default);
1648
- --x-color-background-option-list-button-default-selected: var(
1649
- --x-color-background-option-list-button-default
1650
- );
1651
- --x-color-border-option-list-button-default-selected: var(
1652
- --x-color-border-option-list-button-default
1653
- );
1654
- --x-color-text-option-list-button-default-selected: var(--x-color-text-default);
1655
- --x-color-background-option-list-button-default-selected-hover: var(
1656
- --x-color-background-option-list-button-default-selected
1657
- );
1658
- --x-color-border-option-list-button-default-selected-hover: var(
1659
- --x-color-border-option-list-button-default-selected
1660
- );
1661
- --x-color-text-option-list-button-default-selected-hover: var(
1662
- --x-color-text-option-list-button-default-selected
1663
- );
1664
- --x-color-border-option-list-item-default: var(--x-color-base-neutral-70);
1665
- --x-color-border-top-option-list-item-default: var(--x-color-border-option-list-item-default);
1666
- --x-color-border-right-option-list-item-default: var(--x-color-border-option-list-item-default);
1667
- --x-color-border-bottom-option-list-item-default: var(--x-color-border-option-list-item-default);
1668
- --x-color-border-left-option-list-item-default: var(--x-color-border-option-list-item-default);
1669
- --x-color-border-option-list-item-default-selected: var(--x-color-base-neutral-70);
1670
- --x-color-border-top-option-list-item-default-selected: var(
1671
- --x-color-border-option-list-item-default-selected
1672
- );
1673
- --x-color-border-right-option-list-item-default-selected: var(
1674
- --x-color-border-option-list-item-default-selected
1675
- );
1676
- --x-color-border-bottom-option-list-item-default-selected: var(
1677
- --x-color-border-option-list-item-default-selected
1678
- );
1679
- --x-color-border-left-option-list-item-default-selected: var(
1680
- --x-color-border-option-list-item-default-selected
1681
- );
1682
- --x-size-border-width-option-list-item-default: var(--x-size-border-width-base);
1683
- --x-size-border-width-top-option-list-item-default: 0;
1684
- --x-size-border-width-right-option-list-item-default: var(
1685
- --x-size-border-width-option-list-item-default
1686
- );
1687
- --x-size-border-width-bottom-option-list-item-default: 0;
1688
- --x-size-border-width-left-option-list-item-default: 0;
1689
- --x-size-border-width-top-option-list-item-default-selected: var(
1690
- --x-size-border-width-top-option-list-item-default
1691
- );
1692
- --x-size-border-width-right-option-list-item-default-selected: var(
1693
- --x-size-border-width-right-option-list-item-default
1694
- );
1695
- --x-size-border-width-bottom-option-list-item-default-selected: var(
1696
- --x-size-border-width-bottom-option-list-item-default
1697
- );
1698
- --x-size-border-width-left-option-list-item-default-selected: var(
1699
- --x-size-border-width-left-option-list-item-default
1700
- );
1701
- --x-size-padding-option-list-button-default: var(--x-size-base-02);
1702
- --x-size-padding-top-option-list-button-default: var(--x-size-padding-option-list-button-default);
1703
- --x-size-padding-right-option-list-button-default: var(
1704
- --x-size-padding-option-list-button-default
1705
- );
1706
- --x-size-padding-bottom-option-list-button-default: var(
1707
- --x-size-padding-option-list-button-default
1708
- );
1709
- --x-size-padding-left-option-list-button-default: var(
1710
- --x-size-padding-option-list-button-default
1711
- );
1712
- --x-font-decoration-option-list-button-default-hover: underline;
1713
- --x-size-font-option-list-button-default: var(--x-size-font-text);
1714
- --x-number-font-weight-option-list-button-default: var(--x-number-font-weight-base-regular);
1715
- --x-number-font-weight-option-list-button-default-selected: var(--x-number-font-weight-base-bold);
1716
- }
1717
1637
  :root {
1718
1638
  --x-size-border-radius-picture-default: 0;
1719
1639
  --x-size-border-radius-top-picture-default: var(--x-size-border-radius-picture-default);
@@ -2902,4 +2822,84 @@
2902
2822
  --x-size-line-height-base-s: 16px;
2903
2823
  --x-size-line-height-base-m: 24px;
2904
2824
  --x-size-line-height-base-l: 32px;
2825
+ }
2826
+ :root {
2827
+ --x-color-background-option-list-button-default: transparent;
2828
+ --x-color-border-option-list-button-default: transparent;
2829
+ --x-color-text-option-list-button-default: var(--x-color-base-neutral-35);
2830
+ --x-color-background-option-list-button-default-hover: var(
2831
+ --x-color-background-option-list-button-default
2832
+ );
2833
+ --x-color-border-option-list-button-default-hover: var(
2834
+ --x-color-border-option-list-button-default
2835
+ );
2836
+ --x-color-text-option-list-button-default-hover: var(--x-color-text-option-list-button-default);
2837
+ --x-color-background-option-list-button-default-selected: var(
2838
+ --x-color-background-option-list-button-default
2839
+ );
2840
+ --x-color-border-option-list-button-default-selected: var(
2841
+ --x-color-border-option-list-button-default
2842
+ );
2843
+ --x-color-text-option-list-button-default-selected: var(--x-color-text-default);
2844
+ --x-color-background-option-list-button-default-selected-hover: var(
2845
+ --x-color-background-option-list-button-default-selected
2846
+ );
2847
+ --x-color-border-option-list-button-default-selected-hover: var(
2848
+ --x-color-border-option-list-button-default-selected
2849
+ );
2850
+ --x-color-text-option-list-button-default-selected-hover: var(
2851
+ --x-color-text-option-list-button-default-selected
2852
+ );
2853
+ --x-color-border-option-list-item-default: var(--x-color-base-neutral-70);
2854
+ --x-color-border-top-option-list-item-default: var(--x-color-border-option-list-item-default);
2855
+ --x-color-border-right-option-list-item-default: var(--x-color-border-option-list-item-default);
2856
+ --x-color-border-bottom-option-list-item-default: var(--x-color-border-option-list-item-default);
2857
+ --x-color-border-left-option-list-item-default: var(--x-color-border-option-list-item-default);
2858
+ --x-color-border-option-list-item-default-selected: var(--x-color-base-neutral-70);
2859
+ --x-color-border-top-option-list-item-default-selected: var(
2860
+ --x-color-border-option-list-item-default-selected
2861
+ );
2862
+ --x-color-border-right-option-list-item-default-selected: var(
2863
+ --x-color-border-option-list-item-default-selected
2864
+ );
2865
+ --x-color-border-bottom-option-list-item-default-selected: var(
2866
+ --x-color-border-option-list-item-default-selected
2867
+ );
2868
+ --x-color-border-left-option-list-item-default-selected: var(
2869
+ --x-color-border-option-list-item-default-selected
2870
+ );
2871
+ --x-size-border-width-option-list-item-default: var(--x-size-border-width-base);
2872
+ --x-size-border-width-top-option-list-item-default: 0;
2873
+ --x-size-border-width-right-option-list-item-default: var(
2874
+ --x-size-border-width-option-list-item-default
2875
+ );
2876
+ --x-size-border-width-bottom-option-list-item-default: 0;
2877
+ --x-size-border-width-left-option-list-item-default: 0;
2878
+ --x-size-border-width-top-option-list-item-default-selected: var(
2879
+ --x-size-border-width-top-option-list-item-default
2880
+ );
2881
+ --x-size-border-width-right-option-list-item-default-selected: var(
2882
+ --x-size-border-width-right-option-list-item-default
2883
+ );
2884
+ --x-size-border-width-bottom-option-list-item-default-selected: var(
2885
+ --x-size-border-width-bottom-option-list-item-default
2886
+ );
2887
+ --x-size-border-width-left-option-list-item-default-selected: var(
2888
+ --x-size-border-width-left-option-list-item-default
2889
+ );
2890
+ --x-size-padding-option-list-button-default: var(--x-size-base-02);
2891
+ --x-size-padding-top-option-list-button-default: var(--x-size-padding-option-list-button-default);
2892
+ --x-size-padding-right-option-list-button-default: var(
2893
+ --x-size-padding-option-list-button-default
2894
+ );
2895
+ --x-size-padding-bottom-option-list-button-default: var(
2896
+ --x-size-padding-option-list-button-default
2897
+ );
2898
+ --x-size-padding-left-option-list-button-default: var(
2899
+ --x-size-padding-option-list-button-default
2900
+ );
2901
+ --x-font-decoration-option-list-button-default-hover: underline;
2902
+ --x-size-font-option-list-button-default: var(--x-size-font-text);
2903
+ --x-number-font-weight-option-list-button-default: var(--x-number-font-weight-base-regular);
2904
+ --x-number-font-weight-option-list-button-default-selected: var(--x-number-font-weight-base-bold);
2905
2905
  }
@@ -575,7 +575,6 @@ X-Components is a library usable everywhere not only for search experiences.
575
575
  | [AnyXStoreModuleOption](./x-components.anyxstoremoduleoption.md) | Alias for any store module option. Use only when you don't care about the module concrete type. |
576
576
  | [ArrowKey](./x-components.arrowkey.md) | Union type containing the existing arrow keys. |
577
577
  | [DecoratorFor](./x-components.decoratorfor.md) | Creates a decorator that will only work for properties of the type passed. The decorator will only work if the property is public. |
578
- | [DeepPartial](./x-components.deeppartial.md) | Makes all the properties of the T type optional in depth. |
579
578
  | [DeviceXModule](./x-components.devicexmodule.md) | Device [XModule](./x-components.xmodule.md) alias. |
580
579
  | [DeviceXStoreModule](./x-components.devicexstoremodule.md) | Device type safe store module. |
581
580
  | [DocumentDirection](./x-components.documentdirection.md) | The HTML document direction orientation. Possible values: ltr (left to right) or rtl (right to left). |
@@ -16,6 +16,6 @@ export interface XModuleOptions<ModuleName extends XModuleName>
16
16
 
17
17
  | Property | Type | Description |
18
18
  | --- | --- | --- |
19
- | [config?](./x-components.xmoduleoptions.config.md) | [DeepPartial](./x-components.deeppartial.md)<!-- -->&lt;[ExtractState](./x-components.extractstate.md)<!-- -->&lt;ModuleName&gt; extends { config: infer Config; } ? Config : never&gt; | <i>(Optional)</i> The options to override the default config state for the module. |
19
+ | [config?](./x-components.xmoduleoptions.config.md) | DeepPartial&lt;[ExtractState](./x-components.extractstate.md)<!-- -->&lt;ModuleName&gt; extends { config: infer Config; } ? Config : never&gt; | <i>(Optional)</i> The options to override the default config state for the module. |
20
20
  | [wiring?](./x-components.xmoduleoptions.wiring.md) | Partial&lt;[Wiring](./x-components.wiring.md)<!-- -->&gt; | <i>(Optional)</i> The options to override the default wiring configuration for the module. |
21
21
 
@@ -16,5 +16,5 @@ export declare type XStoreModuleOptions<StoreModule extends AnyXStoreModule> = S
16
16
  mutations?: DeepPartial<MutationsTree<State, Mutations>>;
17
17
  } : never;
18
18
  ```
19
- <b>References:</b> [AnyXStoreModule](./x-components.anyxstoremodule.md)<!-- -->, [XStoreModule](./x-components.xstoremodule.md)<!-- -->, [DeepPartial](./x-components.deeppartial.md)<!-- -->, [ActionsTree](./x-components.actionstree.md)<!-- -->, [GettersTree](./x-components.getterstree.md)<!-- -->, [MutationsTree](./x-components.mutationstree.md)
19
+ <b>References:</b> [AnyXStoreModule](./x-components.anyxstoremodule.md)<!-- -->, [XStoreModule](./x-components.xstoremodule.md)<!-- -->, [ActionsTree](./x-components.actionstree.md)<!-- -->, [GettersTree](./x-components.getterstree.md)<!-- -->, [MutationsTree](./x-components.mutationstree.md)
20
20
 
@@ -22,10 +22,35 @@ intention to clear the whole history of queries.
22
22
 
23
23
  The component exposes a single default slot, where you can add icons or text.
24
24
 
25
- ```vue
26
- <ClearHistoryQueries>
27
- <img class="x-history-query__icon" src="./my-icon.svg"/>
28
- </ClearHistoryQueries>
25
+ ```vue live
26
+ <template>
27
+ <div>
28
+ <SearchInput />
29
+ <ClearHistoryQueries>Clear history queries</ClearHistoryQueries>
30
+ <HistoryQueries :animation="'FadeAndSlide'" :maxItemsToRender="10" />
31
+ </div>
32
+ </template>
33
+
34
+ <script>
35
+ import Vue from "vue";
36
+ import { SearchInput } from "@empathyco/x-components/search-box";
37
+ import {
38
+ HistoryQueries,
39
+ ClearHistoryQueries
40
+ } from "@empathyco/x-components/history-queries";
41
+ import { FadeAndSlide } from "@empathyco/x-components";
42
+
43
+ // Registering the animation as a global component
44
+ Vue.component("FadeAndSlide", FadeAndSlide);
45
+ export default {
46
+ name: "ClearHistoryQueriesDemo",
47
+ components: {
48
+ SearchInput,
49
+ HistoryQueries,
50
+ ClearHistoryQueries
51
+ }
52
+ };
53
+ </script>
29
54
  ```
30
55
 
31
56
  ## Events
@@ -35,17 +35,22 @@ This component doesn't emit events.
35
35
 
36
36
  Here you have a basic example of how the HistoryQueries is rendered.
37
37
 
38
- ```vue
38
+ ```vue live
39
39
  <template>
40
- <HistoryQueries />
40
+ <div>
41
+ <SearchInput />
42
+ <HistoryQueries />
43
+ </div>
41
44
  </template>
42
45
 
43
46
  <script>
47
+ import { SearchInput } from "@empathyco/x-components/search-box";
44
48
  import { HistoryQueries } from "@empathyco/x-components/history-queries";
45
49
 
46
50
  export default {
47
51
  name: "HistoryQueriesDemo",
48
52
  components: {
53
+ SearchInput,
49
54
  HistoryQueries
50
55
  }
51
56
  };
@@ -57,17 +62,22 @@ export default {
57
62
  In this example, the history queries have been limited to render a maximum of 10 queries (by default
58
63
  it is 5).
59
64
 
60
- ```vue
65
+ ```vue live
61
66
  <template>
62
- <HistoryQueries :maxItemsToRender="10" />
67
+ <div>
68
+ <SearchInput />
69
+ <HistoryQueries :maxItemsToRender="10" />
70
+ </div>
63
71
  </template>
64
72
 
65
73
  <script>
74
+ import { SearchInput } from "@empathyco/x-components/search-box";
66
75
  import { HistoryQueries } from "@empathyco/x-components/history-queries";
67
76
 
68
77
  export default {
69
78
  name: "HistoryQueriesDemo",
70
79
  components: {
80
+ SearchInput,
71
81
  HistoryQueries
72
82
  }
73
83
  };
@@ -76,24 +86,27 @@ export default {
76
86
 
77
87
  ### Play with the animation
78
88
 
79
- ```vue
89
+ ```vue live
80
90
  <template>
81
- <HistoryQueries :animation="fadeAndSlide" />
91
+ <div>
92
+ <SearchInput />
93
+ <HistoryQueries :animation="'FadeAndSlide'" />
94
+ </div>
82
95
  </template>
83
96
 
84
97
  <script>
98
+ import Vue from "vue";
99
+ import { SearchInput } from "@empathyco/x-components/search-box";
85
100
  import { HistoryQueries } from "@empathyco/x-components/history-queries";
86
101
  import { FadeAndSlide } from "@empathyco/x-components";
87
102
 
103
+ // Registering the animation as a global component
104
+ Vue.component("FadeAndSlide", FadeAndSlide);
88
105
  export default {
89
106
  name: "HistoryQueriesDemo",
90
107
  components: {
108
+ SearchInput,
91
109
  HistoryQueries
92
- },
93
- data() {
94
- return {
95
- fadeAndSlide: FadeAndSlide
96
- };
97
110
  }
98
111
  };
99
112
  </script>
@@ -104,14 +117,18 @@ export default {
104
117
  In this example, the [`HistoryQuery`](./x-components.history-query.md) component is passed in the
105
118
  `suggestion` slot (although any other component could potentially be passed).
106
119
 
107
- ```vue
120
+ ```vue live
108
121
  <template>
109
- <HistoryQueries #suggestion="{ suggestion }">
110
- <HistoryQuery :suggestion="suggestion"></HistoryQuery>
111
- </HistoryQueries>
122
+ <div>
123
+ <SearchInput />
124
+ <HistoryQueries #suggestion="{ suggestion }">
125
+ <HistoryQuery :suggestion="suggestion" />
126
+ </HistoryQueries>
127
+ </div>
112
128
  </template>
113
129
 
114
130
  <script>
131
+ import { SearchInput } from "@empathyco/x-components/search-box";
115
132
  import {
116
133
  HistoryQueries,
117
134
  HistoryQuery
@@ -120,6 +137,7 @@ import {
120
137
  export default {
121
138
  name: "HistoryQueriesDemo",
122
139
  components: {
140
+ SearchInput,
123
141
  HistoryQueries,
124
142
  HistoryQuery
125
143
  }
@@ -133,19 +151,24 @@ To continue the previous example, the [`HistoryQuery`](./x-components.history-qu
133
151
  passed in the `suggestion-content` slot, but in addition, an HTML span tag for the text are also
134
152
  passed.
135
153
 
136
- ```vue
154
+ ```vue live
137
155
  <template>
138
- <HistoryQueries #suggestion-content="{ suggestion }">
139
- <span>{{ suggestion.query }}</span>
140
- </HistoryQueries>
156
+ <div>
157
+ <SearchInput />
158
+ <HistoryQueries #suggestion-content="{ suggestion }">
159
+ <span>{{ suggestion.query }}</span>
160
+ </HistoryQueries>
161
+ </div>
141
162
  </template>
142
163
 
143
164
  <script>
165
+ import { SearchInput } from "@empathyco/x-components/search-box";
144
166
  import { HistoryQueries } from "@empathyco/x-components/history-queries";
145
167
 
146
168
  export default {
147
169
  name: "HistoryQueriesDemo",
148
170
  components: {
171
+ SearchInput,
149
172
  HistoryQueries
150
173
  }
151
174
  };
@@ -158,20 +181,25 @@ To continue the previous example, the [`HistoryQuery`](./x-components.history-qu
158
181
  passed in the `suggestion-content` slot, but in addition, a cross icon is also passed to change the
159
182
  icon to remove the history query.
160
183
 
161
- ```vue
184
+ ```vue live
162
185
  <template>
163
- <HistoryQueries #suggestion-content-remove="{ suggestion }">
164
- <CrossIcon />
165
- </HistoryQueries>
186
+ <div>
187
+ <SearchInput />
188
+ <HistoryQueries #suggestion-remove-content="{ suggestion }">
189
+ <CrossIcon />
190
+ </HistoryQueries>
191
+ </div>
166
192
  </template>
167
193
 
168
194
  <script>
195
+ import { SearchInput } from "@empathyco/x-components/search-box";
169
196
  import { HistoryQueries } from "@empathyco/x-components/history-queries";
170
197
  import { CrossIcon } from "@empathyco/x-components";
171
198
 
172
199
  export default {
173
200
  name: "HistoryQueriesDemo",
174
201
  components: {
202
+ SearchInput,
175
203
  HistoryQueries,
176
204
  CrossIcon
177
205
  }
@@ -29,8 +29,29 @@ history queries.
29
29
 
30
30
  This component only requires a prop called `suggestion`
31
31
 
32
- ```vue
33
- <HistoryQuery :suggestion="historyQuery" />
32
+ ```vue live
33
+ <template>
34
+ <HistoryQuery :suggestion="suggestion" />
35
+ </template>
36
+
37
+ <script>
38
+ import { HistoryQuery } from "@empathyco/x-components/history-queries";
39
+ export default {
40
+ name: "HistoryQueryDemo",
41
+ components: {
42
+ HistoryQuery
43
+ },
44
+ data() {
45
+ return {
46
+ suggestion: {
47
+ modelName: "HistoryQuery",
48
+ query: "trousers",
49
+ facets: []
50
+ }
51
+ };
52
+ }
53
+ };
54
+ </script>
34
55
  ```
35
56
 
36
57
  ### Customizing slots content
@@ -43,18 +64,47 @@ the suggestion itself, and a `string` of HTML with the matched query.
43
64
  The other slot is called `remove-button-content`, and allows you to set the content of the button
44
65
  that serves to remove this query from the history. This slot only has one property, the suggestion.
45
66
 
46
- ````vue
47
- <HistoryQuery :suggestion="historyQuery">
48
- <template #default="{ suggestion, queryHTML }">
49
- <img class="x-history-query__history-icon" src="./history-icon.svg"/>
50
- <span class="x-history-query__matching-part" v-html="queryHTML"/>
51
- </template>
52
-
53
- <template #remove-button-content="{ suggestion }">
54
- <img class="x-history-query__remove-icon" src="./remove-icon.svg"/>
55
- </template>
56
- </HistoryQuery>
57
- ``` ## Events A list of events that the component will emit: -
58
- `UserSelectedAHistoryQuery`: the event is emitted after the user clicks the
59
- button. The event payload is the history query data.
60
- ````
67
+ ```vue live
68
+ <template>
69
+ <HistoryQuery :suggestion="suggestion">
70
+ <template #default="{ suggestion, queryHTML }">
71
+ <HistoryIcon />
72
+ <span class="x-history-query__matching-part" v-html="queryHTML" />
73
+ </template>
74
+
75
+ <template #remove-button-content="{ suggestion }">
76
+ <CrossIcon />
77
+ </template>
78
+ </HistoryQuery>
79
+ </template>
80
+
81
+ <script>
82
+ import { HistoryQuery } from "@empathyco/x-components/history-queries";
83
+ import { HistoryIcon, CrossIcon } from "@empathyco/x-components";
84
+
85
+ export default {
86
+ name: "HistoryQueryDemo",
87
+ components: {
88
+ HistoryQuery,
89
+ HistoryIcon,
90
+ CrossIcon
91
+ },
92
+ data() {
93
+ return {
94
+ suggestion: {
95
+ modelName: "HistoryQuery",
96
+ query: "trousers",
97
+ facets: []
98
+ }
99
+ };
100
+ }
101
+ };
102
+ </script>
103
+ ```
104
+
105
+ ## Events
106
+
107
+ A list of events that the component will emit:
108
+
109
+ - `UserSelectedAHistoryQuery`: the event is emitted after the user clicks the button. The event
110
+ payload is the history query data.
@@ -42,7 +42,7 @@ Usually, this component is going to be used together with the `ResultsList` one.
42
42
  will be inserted between the results, guiding users to discover new searches directly from the
43
43
  results list.
44
44
 
45
- ```vue
45
+ ```vue live
46
46
  <template>
47
47
  <div>
48
48
  <SearchInput />
@@ -77,7 +77,7 @@ Finally, a third group will be inserted at index `192`. Because `maxGroups` is c
77
77
  more groups will be inserted. Each one of this groups will have up to `6` next queries
78
78
  (`maxNextQueriesPerGroup`).
79
79
 
80
- ```vue
80
+ ```vue live
81
81
  <template>
82
82
  <div>
83
83
  <SearchInput />