@onereach/ui-components 2.69.3 → 2.69.4

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 (76) hide show
  1. package/dist/bundled/v2/{OrCard-58a1ba3e.js → OrCard-29116e1f.js} +2 -2
  2. package/dist/bundled/v2/OrCardCollection-f622df47.js +346 -0
  3. package/dist/bundled/v2/{OrSearch-9d402f56.js → OrSearch-a11b3621.js} +9 -3
  4. package/dist/bundled/v2/{OrSortHeader-396e6a7c.js → OrSortHeader-9932d28f.js} +2 -2
  5. package/dist/bundled/v2/components/index.js +4 -4
  6. package/dist/bundled/v2/components/or-card-collection-v3/OrCardCollection.stories3.d.ts +5 -0
  7. package/dist/bundled/v2/components/or-card-collection-v3/OrCardCollection.vue.d.ts +67 -42
  8. package/dist/bundled/v2/components/or-card-collection-v3/OrCardCollectionView.vue2.vue.d.ts +35 -0
  9. package/dist/bundled/v2/components/or-card-collection-v3/index.js +7 -4
  10. package/dist/bundled/v2/components/or-card-collection-v3/props.d.ts +5 -1
  11. package/dist/bundled/v2/components/or-card-collection-v3/styles.d.ts +2 -2
  12. package/dist/bundled/v2/components/or-card-collection-v3/types.d.ts +8 -3
  13. package/dist/bundled/v2/components/or-card-v3/index.js +1 -1
  14. package/dist/bundled/v2/components/or-search-v3/OrSearch.vue.d.ts +13 -0
  15. package/dist/bundled/v2/components/or-search-v3/index.js +1 -1
  16. package/dist/bundled/v2/components/or-sort-header-v3/index.js +1 -1
  17. package/dist/bundled/v2/index.js +5 -5
  18. package/dist/bundled/v3/OrButton-a671b8a1.js +33 -0
  19. package/dist/bundled/v3/OrCardCollection.vue_vue_type_script_lang-15645a65.js +228 -0
  20. package/dist/bundled/v3/{OrConfirm.vue_vue_type_script_lang-49a3a9bd.js → OrConfirm.vue_vue_type_script_lang-f57ffa1a.js} +6 -36
  21. package/dist/bundled/v3/OrMenu-f26e8e55.js +29 -0
  22. package/dist/bundled/v3/{OrSearch.vue_vue_type_script_lang-ed78b21f.js → OrSearch.vue_vue_type_script_lang-0ae8a6dd.js} +8 -2
  23. package/dist/bundled/v3/{OrTabs.vue_vue_type_script_lang-919b2021.js → OrTabs.vue_vue_type_script_lang-61b79a5a.js} +10 -36
  24. package/dist/bundled/v3/components/index.js +8 -6
  25. package/dist/bundled/v3/components/or-card-collection-v3/OrCardCollection.stories3.d.ts +5 -0
  26. package/dist/bundled/v3/components/or-card-collection-v3/OrCardCollection.vue.d.ts +67 -42
  27. package/dist/bundled/v3/components/or-card-collection-v3/OrCardCollectionView.vue3.vue.d.ts +35 -0
  28. package/dist/bundled/v3/components/or-card-collection-v3/index.js +11 -4
  29. package/dist/bundled/v3/components/or-card-collection-v3/props.d.ts +5 -1
  30. package/dist/bundled/v3/components/or-card-collection-v3/styles.d.ts +2 -2
  31. package/dist/bundled/v3/components/or-card-collection-v3/types.d.ts +8 -3
  32. package/dist/bundled/v3/components/or-confirm-v3/index.js +2 -1
  33. package/dist/bundled/v3/components/or-search-v3/OrSearch.vue.d.ts +13 -0
  34. package/dist/bundled/v3/components/or-search-v3/index.js +1 -1
  35. package/dist/bundled/v3/components/or-tabs-v3/index.js +2 -1
  36. package/dist/bundled/v3/index.js +326 -295
  37. package/dist/esm/v2/OrCardCollection-43aa4a3c.js +346 -0
  38. package/dist/esm/v2/{OrSearch-ddb7c1fe.js → OrSearch-62d91301.js} +7 -1
  39. package/dist/esm/v2/components/index.js +2 -2
  40. package/dist/esm/v2/components/or-card-collection-v3/OrCardCollection.stories3.d.ts +5 -0
  41. package/dist/esm/v2/components/or-card-collection-v3/OrCardCollection.vue.d.ts +67 -42
  42. package/dist/esm/v2/components/or-card-collection-v3/OrCardCollectionView.vue2.vue.d.ts +35 -0
  43. package/dist/esm/v2/components/or-card-collection-v3/index.js +7 -4
  44. package/dist/esm/v2/components/or-card-collection-v3/props.d.ts +5 -1
  45. package/dist/esm/v2/components/or-card-collection-v3/styles.d.ts +2 -2
  46. package/dist/esm/v2/components/or-card-collection-v3/types.d.ts +8 -3
  47. package/dist/esm/v2/components/or-search-v3/OrSearch.vue.d.ts +13 -0
  48. package/dist/esm/v2/components/or-search-v3/index.js +1 -1
  49. package/dist/esm/v2/index.js +2 -2
  50. package/dist/esm/v3/OrCardCollection-6b5e6b76.js +289 -0
  51. package/dist/esm/v3/{OrSearch-cdde55ce.js → OrSearch-aafb93b4.js} +7 -1
  52. package/dist/esm/v3/components/index.js +2 -2
  53. package/dist/esm/v3/components/or-card-collection-v3/OrCardCollection.stories3.d.ts +5 -0
  54. package/dist/esm/v3/components/or-card-collection-v3/OrCardCollection.vue.d.ts +67 -42
  55. package/dist/esm/v3/components/or-card-collection-v3/OrCardCollectionView.vue3.vue.d.ts +35 -0
  56. package/dist/esm/v3/components/or-card-collection-v3/index.js +7 -4
  57. package/dist/esm/v3/components/or-card-collection-v3/props.d.ts +5 -1
  58. package/dist/esm/v3/components/or-card-collection-v3/styles.d.ts +2 -2
  59. package/dist/esm/v3/components/or-card-collection-v3/types.d.ts +8 -3
  60. package/dist/esm/v3/components/or-search-v3/OrSearch.vue.d.ts +13 -0
  61. package/dist/esm/v3/components/or-search-v3/index.js +1 -1
  62. package/dist/esm/v3/index.js +2 -2
  63. package/package.json +2 -2
  64. package/src/components/or-card-collection-v3/OrCardCollection.docs.mdx +4 -0
  65. package/src/components/or-card-collection-v3/OrCardCollection.stories3.ts +230 -30
  66. package/src/components/or-card-collection-v3/OrCardCollection.vue +120 -77
  67. package/src/components/or-card-collection-v3/OrCardCollectionView.vue2.vue +41 -0
  68. package/src/components/or-card-collection-v3/OrCardCollectionView.vue3.vue +42 -0
  69. package/src/components/or-card-collection-v3/props.ts +14 -1
  70. package/src/components/or-card-collection-v3/styles.ts +3 -3
  71. package/src/components/or-card-collection-v3/types.ts +9 -3
  72. package/src/components/or-search-v3/OrSearch.vue +7 -1
  73. package/dist/bundled/v2/OrCardCollection-a9a779ea.js +0 -228
  74. package/dist/bundled/v3/OrCardCollection.vue_vue_type_script_lang-861158b5.js +0 -164
  75. package/dist/esm/v2/OrCardCollection-4f001551.js +0 -227
  76. package/dist/esm/v3/OrCardCollection-5a0febaf.js +0 -198
@@ -1,11 +1,10 @@
1
- export { C as CardCollectionView, s as OrCardCollectionV3 } from '../../OrCardCollection-5a0febaf.js';
1
+ export { D as DefaultCardCollectionViews, s as OrCardCollectionV3, d as defaultViewModes, g as gridView, l as listView } from '../../OrCardCollection-6b5e6b76.js';
2
2
  import 'vue-demi';
3
3
  import '../../useClassAttribute-47fdb016.js';
4
4
  import '@vueuse/core';
5
- import '../../OrCard-fd92f7c8.js';
6
- import 'vue';
7
5
  import '../../OrIconButton-1eebcafc.js';
8
6
  import '../../OrIcon-b195169c.js';
7
+ import 'vue';
9
8
  import '../../OrTooltip-50d27b4f.js';
10
9
  import '../../OrPopover-1075dd38.js';
11
10
  import '@floating-ui/dom';
@@ -14,10 +13,14 @@ import '../../useResponsive-a02e95b7.js';
14
13
  import '../../OrBottomSheet-62817aec.js';
15
14
  import '../../OrOverlay-738a44d5.js';
16
15
  import '../../OrTeleport.vue3-8099178c.js';
16
+ import '../../OrMenu-840038cd.js';
17
+ import '../../OrMenuItem-9da279f6.js';
18
+ import '../../OrButton-bb6bf8a9.js';
19
+ import '../../OrLoader-b3cf4231.js';
20
+ import '../../OrSearch-aafb93b4.js';
17
21
  import '../../OrInput-41691fb3.js';
18
22
  import '../../OrError-ec8c709d.js';
19
23
  import '../../OrHint-74bb732d.js';
20
24
  import '../../OrInputBox-5247ab25.js';
21
25
  import '../../OrLabel-bdaec602.js';
22
26
  import '../../style-inject.es-4c6f2515.js';
23
- import '../../OrSortHeader-fe1a9cf8.js';
@@ -1,4 +1,8 @@
1
- export declare enum CardCollectionView {
1
+ import { ViewMode } from './types';
2
+ export declare enum DefaultCardCollectionViews {
2
3
  Grid = "grid",
3
4
  List = "list"
4
5
  }
6
+ export declare const gridView: ViewMode;
7
+ export declare const listView: ViewMode;
8
+ export declare const defaultViewModes: ViewMode[];
@@ -1,6 +1,6 @@
1
- import { CardCollectionView } from './props';
1
+ import { DefaultCardCollectionViews } from './props';
2
2
  export declare const CardCollectionRoot: string[];
3
3
  export declare const CardCollectionToolbar: string[];
4
4
  export declare const CardCollectionToolbarPanel: string[];
5
5
  export declare const CardCollectionContent: string[];
6
- export declare const CardCollectionContentViews: Record<CardCollectionView, string[]>;
6
+ export declare const CardCollectionContentViews: Record<DefaultCardCollectionViews, string[]>;
@@ -1,7 +1,12 @@
1
1
  export interface CardCollectionItem {
2
- id: string;
2
+ key?: string;
3
+ [key: string | number]: any;
3
4
  }
4
- export interface CardCollectionSortHeader {
5
- value: string;
5
+ export interface ViewMode {
6
+ view: string;
7
+ icon: string;
8
+ }
9
+ export interface SortOption {
6
10
  label: string;
11
+ value: string;
7
12
  }
@@ -11,6 +11,11 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
11
11
  focus: () => void;
12
12
  clear: () => void;
13
13
  }> & import("@vue/composition-api").Data, {}, {}, {
14
+ modelValue: {
15
+ type: StringConstructor;
16
+ default: string;
17
+ required: false;
18
+ };
14
19
  size: {
15
20
  type: PropType<SearchSize>;
16
21
  default: SearchSize;
@@ -32,6 +37,11 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
32
37
  default: boolean;
33
38
  };
34
39
  }, import("@vue/composition-api").ExtractPropTypes<{
40
+ modelValue: {
41
+ type: StringConstructor;
42
+ default: string;
43
+ required: false;
44
+ };
35
45
  size: {
36
46
  type: PropType<SearchSize>;
37
47
  default: SearchSize;
@@ -53,6 +63,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
53
63
  default: boolean;
54
64
  };
55
65
  }>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
66
+ modelValue: string;
56
67
  size: SearchSize;
57
68
  placeholder: string;
58
69
  debounce: number;
@@ -71,6 +82,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
71
82
  focus: () => void;
72
83
  clear: () => void;
73
84
  }>, import("@vue/composition-api").Data, {}, {}, {}, {}, string[], {
85
+ modelValue: string;
74
86
  size: SearchSize;
75
87
  placeholder: string;
76
88
  debounce: number;
@@ -79,6 +91,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
79
91
  } & {} & {
80
92
  [x: string & `on${string}`]: ((...args: any[]) => any) | undefined;
81
93
  }, {
94
+ modelValue: string;
82
95
  size: SearchSize;
83
96
  placeholder: string;
84
97
  debounce: number;
@@ -1,4 +1,4 @@
1
- export { s as OrSearchV3 } from '../../OrSearch-cdde55ce.js';
1
+ export { s as OrSearchV3 } from '../../OrSearch-aafb93b4.js';
2
2
  export { a as SearchSize } from '../../OrInputBox-5247ab25.js';
3
3
  import 'vue-demi';
4
4
  import '@vueuse/core';
@@ -6,7 +6,7 @@ export { b as BUTTON_COLOR, d as BUTTON_LOADER_TYPE, c as BUTTON_SIZE, B as BUTT
6
6
  export { a as ButtonColor, b as ButtonType, B as ButtonVariant, s as OrButtonV3 } from './OrButton-bb6bf8a9.js';
7
7
  export { s as OrCard } from './OrCard-e3a5aea4.js';
8
8
  export { C as CARD_COLLECTION_LAYOUT, s as OrCardCollection } from './OrCardCollection-a5e326ef.js';
9
- export { C as CardCollectionView, s as OrCardCollectionV3 } from './OrCardCollection-5a0febaf.js';
9
+ export { D as DefaultCardCollectionViews, s as OrCardCollectionV3, d as defaultViewModes, g as gridView, l as listView } from './OrCardCollection-6b5e6b76.js';
10
10
  export { s as OrCardV3 } from './OrCard-fd92f7c8.js';
11
11
  export { a as OrCarousel, s as OrCarouselItem } from './OrCarouselItem-636d99a1.js';
12
12
  export { s as OrCheckbox } from './OrCheckbox-ed4a19cf.js';
@@ -58,7 +58,7 @@ export { s as OrProgressV3, P as ProgressColor, a as ProgressType } from './OrPr
58
58
  export { s as OrRadio } from './OrRadio-c3ab11f2.js';
59
59
  export { s as OrRadioGroup } from './OrRadioGroup-00785e41.js';
60
60
  export { s as OrRadioV3 } from './OrRadio-54b6d0de.js';
61
- export { s as OrSearchV3 } from './OrSearch-cdde55ce.js';
61
+ export { s as OrSearchV3 } from './OrSearch-aafb93b4.js';
62
62
  export { s as OrSegmentedControlV3, S as SegmentedControlSize } from './OrSegmentedControl-171cad78.js';
63
63
  export { s as OrSelect } from './OrSelect-0821b907.js';
64
64
  export { s as OrSelectV3 } from './OrSelect-7e813982.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/ui-components",
3
- "version": "2.69.3",
3
+ "version": "2.69.4",
4
4
  "description": "Vue components library for v2/3",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/auto/index.js",
@@ -124,5 +124,5 @@
124
124
  },
125
125
  "./package.json": "./package.json"
126
126
  },
127
- "gitHead": "511a70136704bb863bfdf9e8c354637b8c1514a6"
127
+ "gitHead": "2240dfe52d067b0bde714f19d0058b971ce0271a"
128
128
  }
@@ -1,3 +1,7 @@
1
1
  import { DocsPage } from '@storybook/addon-docs';
2
2
 
3
3
  <DocsPage />
4
+
5
+ ## Migration Guide from V1
6
+
7
+ Component refactored completely, see new stories and code snippets
@@ -1,10 +1,12 @@
1
1
  import { action } from '@storybook/addon-actions';
2
2
  import { Meta, StoryFn } from '@storybook/vue3';
3
+ import { ref } from 'vue-demi';
3
4
  import { OrIconV3 as OrIcon } from '../or-icon-v3';
4
5
  import OrCardCollectionDocs from './OrCardCollection.docs.mdx';
5
6
  import OrCardCollection from './OrCardCollection.vue';
6
- import { CardCollectionView } from './props';
7
- import { CardCollectionItem, CardCollectionSortHeader } from './types';
7
+ import { defaultViewModes } from './props';
8
+ import { OrCardV3 as OrCard } from '../or-card-v3';
9
+ import { CardCollectionItem } from './types';
8
10
 
9
11
  export default {
10
12
  title: 'Components/Card Collection',
@@ -12,7 +14,7 @@ export default {
12
14
 
13
15
  argTypes: {
14
16
  // Slots
15
- gridItem: {
17
+ item: {
16
18
  type: {
17
19
  name: 'string',
18
20
  required: true,
@@ -21,10 +23,9 @@ export default {
21
23
  control: { type: 'text' },
22
24
  },
23
25
 
24
- listItem: {
26
+ header: {
25
27
  type: {
26
28
  name: 'string',
27
- required: true,
28
29
  },
29
30
 
30
31
  control: { type: 'text' },
@@ -37,14 +38,14 @@ export default {
37
38
 
38
39
  view: {
39
40
  control: { type: 'select' },
40
- options: Object.values(CardCollectionView),
41
+ options: defaultViewModes.map(mode => mode.view),
41
42
  },
42
43
 
43
44
  sort: {
44
45
  control: { type: 'object' },
45
46
  },
46
47
 
47
- sortHeaders: {
48
+ sortOptions: {
48
49
  control: { type: 'object' },
49
50
  },
50
51
 
@@ -70,35 +71,48 @@ export default {
70
71
  docs: {
71
72
  page: OrCardCollectionDocs,
72
73
  },
74
+ layout: 'fullscreen',
73
75
  },
74
76
  } as Meta<typeof OrCardCollection>;
75
77
 
76
78
  const Template: StoryFn<typeof OrCardCollection> = (args) => ({
77
79
  components: {
78
80
  OrCardCollection,
81
+ OrCard,
79
82
  OrIcon,
80
83
  },
81
84
 
82
85
  setup() {
86
+ const sort = ref(args.sort);
87
+ const onSortChange = (newSort: string) => {
88
+ sort.value = newSort;
89
+ action('searchChange')(newSort);
90
+ };
91
+
83
92
  return {
84
93
  args,
94
+ sort,
95
+ onSortChange,
85
96
  onViewChange: action('viewChange'),
86
- onSortChange: action('sortChange'),
87
97
  onSearchChange: action('searchChange'),
88
98
  };
89
99
  },
90
100
 
91
101
  template: `
92
- <OrCardCollection
93
- v-bind="args"
94
- @viewChange="onViewChange"
95
- @sortChange="onSortChange"
96
- @searchChange="onSearchChange"
97
- >
98
- <template #gridItem="item">${args.gridItem}</template>
99
- <template #listItem="item">${args.listItem}</template>
100
- <template #addon>${args.addon}</template>
101
- </OrCardCollection>
102
+ <div class="p-md bg-surface-1 dark:bg-surface-1-dark">
103
+ <OrCardCollection
104
+ v-bind="args"
105
+ :sort="sort"
106
+ @viewChange="onViewChange"
107
+ @sortChange="onSortChange"
108
+ @searchChange="onSearchChange"
109
+ >
110
+ <template #item="{item, mode}">
111
+ <OrCard>${args.item} ({{mode}})</OrCard>
112
+ </template>
113
+ <template #addon>${args.addon}</template>
114
+ </OrCardCollection>
115
+ </div>
102
116
  `,
103
117
  });
104
118
 
@@ -106,8 +120,7 @@ export const Default = Template.bind({});
106
120
 
107
121
  Default.args = {
108
122
  // Slots
109
- gridItem: '{{ item.label }} (grid)',
110
- listItem: '{{ item.label }} (list)',
123
+ item: '{{ item.label }}',
111
124
  addon: '<OrIcon icon="info" />',
112
125
 
113
126
  // Props
@@ -139,7 +152,7 @@ Default.args = {
139
152
  'Yankee',
140
153
  'Zulu',
141
154
  ], (item) => ({
142
- id: item.toLowerCase(),
155
+ key: item.toLowerCase(),
143
156
  label: item,
144
157
  })),
145
158
  };
@@ -150,13 +163,200 @@ WithSorting.args = {
150
163
  ...Default.args,
151
164
 
152
165
  // Props
153
- sortHeaders: Array.from<string, CardCollectionSortHeader>([
154
- 'Foo',
155
- 'Bar',
156
- 'Baz',
157
- 'Qux',
158
- ], (item) => ({
159
- value: item.toLowerCase(),
160
- label: item,
161
- })),
166
+ sort: 'bar',
167
+ sortOptions: [
168
+ {
169
+ label: 'Foo',
170
+ value: 'foo',
171
+ },
172
+ {
173
+ label: 'Bar',
174
+ value: 'bar',
175
+ },
176
+ {
177
+ label: 'Baz',
178
+ value: 'baz',
179
+ },
180
+ {
181
+ label: 'Qux',
182
+ value: 'qux',
183
+ },
184
+ ],
185
+ };
186
+
187
+
188
+ export const OverrideViewContainer: StoryFn<typeof OrCardCollection> = (args) => ({
189
+ components: {
190
+ OrCardCollection,
191
+ OrCard,
192
+ },
193
+
194
+ setup() {
195
+ return {
196
+ args,
197
+ onViewChange: action('viewChange'),
198
+ onSortChange: action('sortChange'),
199
+ onSearchChange: action('searchChange'),
200
+ };
201
+ },
202
+
203
+ template: `
204
+ <div class="p-md bg-surface-1 dark:bg-surface-1-dark">
205
+ <OrCardCollection
206
+ v-bind="args"
207
+ @viewChange="onViewChange"
208
+ @sortChange="onSortChange"
209
+ @searchChange="onSearchChange"
210
+ >
211
+ <template #header="{mode}">
212
+ ${args.header}
213
+ </template>
214
+ <template #grid="{items}">
215
+ <div class="grid grid-cols-3">
216
+ <OrCard
217
+ v-for="item in items"
218
+ :key="item.key"
219
+ >
220
+ {{ item.label }}
221
+ </OrCard>
222
+ </div>
223
+ </template>
224
+ <template #list="{items}">
225
+ <ul>
226
+ <li
227
+ v-for="item in items"
228
+ :key="item.key"
229
+ >
230
+ - {{ item.label }}
231
+ </li>
232
+ </ul>
233
+ </template>
234
+ </OrCardCollection>
235
+ </div>
236
+ `,
237
+ });
238
+
239
+ OverrideViewContainer.args = {
240
+ ...Default.args,
241
+ header: '<div class="typography-headline-3">Custom {{ mode }}</div>',
242
+ };
243
+
244
+ export const ExtraViewMode: StoryFn<typeof OrCardCollection> = (args) => ({
245
+ components: {
246
+ OrCardCollection,
247
+ OrCard,
248
+ },
249
+
250
+ setup() {
251
+ return {
252
+ args,
253
+ defaultViewModes,
254
+ onViewChange: action('viewChange'),
255
+ onSearchChange: action('searchChange'),
256
+ };
257
+ },
258
+
259
+ template: `
260
+ <div class="p-md bg-surface-1 dark:bg-surface-1-dark">
261
+ <OrCardCollection
262
+ v-bind="args"
263
+ :view-modes="[...defaultViewModes, {view: 'mymode', icon: 'timeline'}]"
264
+ @viewChange="onViewChange"
265
+ @searchChange="onSearchChange"
266
+ >
267
+ <template #item="{item, mode}">
268
+ <OrCard>${args.item} ({{mode}})</OrCard>
269
+ </template>
270
+ <template #mymode="{items}">
271
+ <div class="typography-headline-3">My view mode</div>
272
+ <div class="grid grid-cols-3">
273
+ <OrCard
274
+ v-for="item in items"
275
+ :key="item.key"
276
+ >
277
+ {{ item.label }} (timeline)
278
+ </OrCard>
279
+ </div>
280
+ </template>
281
+ </OrCardCollection>
282
+ </div>
283
+ `,
284
+ });
285
+
286
+ ExtraViewMode.args = {
287
+ ...Default.args,
288
+ };
289
+
290
+ export const WithLink: StoryFn<typeof OrCardCollection> = (args) => ({
291
+ components: {
292
+ OrCardCollection,
293
+ OrCard,
294
+ OrIcon,
295
+ },
296
+
297
+ setup() {
298
+ return {
299
+ args,
300
+ onViewChange: action('viewChange'),
301
+ onSortChange: action('sortChange'),
302
+ onSearchChange: action('searchChange'),
303
+ };
304
+ },
305
+
306
+ template: `
307
+ <div class="p-md bg-surface-1 dark:bg-surface-1-dark">
308
+ <OrCardCollection
309
+ v-bind="args"
310
+ @viewChange="onViewChange"
311
+ @sortChange="onSortChange"
312
+ @searchChange="onSearchChange"
313
+ >
314
+ <template #item="{item}">
315
+ <a href="#" @click.prevent><OrCard>${args.item}</OrCard></a>
316
+ </template>
317
+ </OrCardCollection>
318
+ </div>
319
+ `,
320
+ });
321
+
322
+ WithLink.args = {
323
+ ...Default.args,
324
+ };
325
+
326
+ export const EmptySearchResults: StoryFn<typeof OrCardCollection> = (args) => ({
327
+ components: {
328
+ OrCardCollection,
329
+ OrCard,
330
+ OrIcon,
331
+ },
332
+
333
+ setup() {
334
+ return {
335
+ args,
336
+ onViewChange: action('viewChange'),
337
+ onSortChange: action('sortChange'),
338
+ onSearchChange: action('searchChange'),
339
+ };
340
+ },
341
+
342
+ template: `
343
+ <div class="p-md h-screen bg-surface-1 dark:bg-surface-1-dark">
344
+ <OrCardCollection
345
+ v-bind="args"
346
+ @viewChange="onViewChange"
347
+ @sortChange="onSortChange"
348
+ @searchChange="onSearchChange"
349
+ >
350
+ <template #noSearchResults="{search}">
351
+ <p class="text-center typography-headline-3">No results for "{{search}}"</p>
352
+ </template>
353
+ </OrCardCollection>
354
+ </div>
355
+ `,
356
+ });
357
+
358
+ EmptySearchResults.args = {
359
+ ...Default.args,
360
+ search: 'My favorite ..',
361
+ items: [],
162
362
  };