@onereach/ui-components 2.69.0 → 2.69.1-beta.2090.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/bundled/v2/{OrCard-58a1ba3e.js → OrCard-29116e1f.js} +2 -2
  2. package/dist/bundled/v2/OrCardCollection-a8d5ce32.js +328 -0
  3. package/dist/bundled/v2/{OrSearch-9d402f56.js → OrSearch-19f43fe5.js} +2 -2
  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 +4 -0
  7. package/dist/bundled/v2/components/or-card-collection-v3/OrCardCollection.vue.d.ts +61 -37
  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/constatnts.d.ts +4 -0
  10. package/dist/bundled/v2/components/or-card-collection-v3/index.js +7 -4
  11. package/dist/bundled/v2/components/or-card-collection-v3/types.d.ts +5 -4
  12. package/dist/bundled/v2/components/or-card-v3/index.js +1 -1
  13. package/dist/bundled/v2/components/or-search-v3/index.js +1 -1
  14. package/dist/bundled/v2/components/or-sort-header-v3/index.js +1 -1
  15. package/dist/bundled/v2/index.js +5 -5
  16. package/dist/bundled/v3/OrButton-8ab33d9d.js +33 -0
  17. package/dist/bundled/v3/OrCardCollection.vue_vue_type_script_lang-f9f329a2.js +224 -0
  18. package/dist/bundled/v3/{OrConfirm.vue_vue_type_script_lang-289b5600.js → OrConfirm.vue_vue_type_script_lang-85472b12.js} +6 -36
  19. package/dist/bundled/v3/OrMenu-f26e8e55.js +29 -0
  20. package/dist/bundled/v3/{OrSearch.vue_vue_type_script_lang-ed78b21f.js → OrSearch.vue_vue_type_script_lang-cb2d6612.js} +1 -1
  21. package/dist/bundled/v3/{OrTabs.vue_vue_type_script_lang-919b2021.js → OrTabs.vue_vue_type_script_lang-61b79a5a.js} +10 -36
  22. package/dist/bundled/v3/components/index.js +9 -7
  23. package/dist/bundled/v3/components/or-card-collection-v3/OrCardCollection.stories3.d.ts +4 -0
  24. package/dist/bundled/v3/components/or-card-collection-v3/OrCardCollection.vue.d.ts +61 -37
  25. package/dist/bundled/v3/components/or-card-collection-v3/OrCardCollectionView.vue3.vue.d.ts +35 -0
  26. package/dist/bundled/v3/components/or-card-collection-v3/constatnts.d.ts +4 -0
  27. package/dist/bundled/v3/components/or-card-collection-v3/index.js +11 -4
  28. package/dist/bundled/v3/components/or-card-collection-v3/types.d.ts +5 -4
  29. package/dist/bundled/v3/components/or-confirm-v3/index.js +2 -1
  30. package/dist/bundled/v3/components/or-search-v3/index.js +1 -1
  31. package/dist/bundled/v3/components/or-tabs-v3/index.js +2 -1
  32. package/dist/bundled/v3/index.js +319 -299
  33. package/dist/esm/v2/OrCardCollection-95b051e1.js +328 -0
  34. package/dist/esm/v2/components/index.js +1 -1
  35. package/dist/esm/v2/components/or-card-collection-v3/OrCardCollection.stories3.d.ts +4 -0
  36. package/dist/esm/v2/components/or-card-collection-v3/OrCardCollection.vue.d.ts +61 -37
  37. package/dist/esm/v2/components/or-card-collection-v3/OrCardCollectionView.vue2.vue.d.ts +35 -0
  38. package/dist/esm/v2/components/or-card-collection-v3/constatnts.d.ts +4 -0
  39. package/dist/esm/v2/components/or-card-collection-v3/index.js +7 -4
  40. package/dist/esm/v2/components/or-card-collection-v3/types.d.ts +5 -4
  41. package/dist/esm/v2/index.js +1 -1
  42. package/dist/esm/v3/OrCardCollection-afd863fc.js +274 -0
  43. package/dist/esm/v3/components/index.js +1 -1
  44. package/dist/esm/v3/components/or-card-collection-v3/OrCardCollection.stories3.d.ts +4 -0
  45. package/dist/esm/v3/components/or-card-collection-v3/OrCardCollection.vue.d.ts +61 -37
  46. package/dist/esm/v3/components/or-card-collection-v3/OrCardCollectionView.vue3.vue.d.ts +35 -0
  47. package/dist/esm/v3/components/or-card-collection-v3/constatnts.d.ts +4 -0
  48. package/dist/esm/v3/components/or-card-collection-v3/index.js +7 -4
  49. package/dist/esm/v3/components/or-card-collection-v3/types.d.ts +5 -4
  50. package/dist/esm/v3/index.js +1 -1
  51. package/package.json +2 -3
  52. package/src/components/or-card-collection-v3/OrCardCollection.stories3.ts +160 -19
  53. package/src/components/or-card-collection-v3/OrCardCollection.vue +99 -74
  54. package/src/components/or-card-collection-v3/OrCardCollectionView.vue2.vue +41 -0
  55. package/src/components/or-card-collection-v3/OrCardCollectionView.vue3.vue +42 -0
  56. package/src/components/or-card-collection-v3/constatnts.ts +12 -0
  57. package/src/components/or-card-collection-v3/styles.ts +1 -1
  58. package/src/components/or-card-collection-v3/types.ts +5 -4
  59. package/dist/bundled/v2/OrCardCollection-a9a779ea.js +0 -228
  60. package/dist/bundled/v3/OrCardCollection.vue_vue_type_script_lang-3993a015.js +0 -164
  61. package/dist/esm/v2/OrCardCollection-4f001551.js +0 -227
  62. package/dist/esm/v3/OrCardCollection-5a0febaf.js +0 -198
@@ -3,8 +3,10 @@ import { Meta, StoryFn } from '@storybook/vue3';
3
3
  import { OrIconV3 as OrIcon } from '../or-icon-v3';
4
4
  import OrCardCollectionDocs from './OrCardCollection.docs.mdx';
5
5
  import OrCardCollection from './OrCardCollection.vue';
6
+ import { defaultViewModes } from './constatnts';
7
+ import { OrCardV3 as OrCard } from '../or-card-v3';
6
8
  import { CardCollectionView } from './props';
7
- import { CardCollectionItem, CardCollectionSortHeader } from './types';
9
+ import { CardCollectionItem } from './types';
8
10
 
9
11
  export default {
10
12
  title: 'Components/Card Collection',
@@ -70,12 +72,14 @@ export default {
70
72
  docs: {
71
73
  page: OrCardCollectionDocs,
72
74
  },
75
+ layout: 'fullscreen',
73
76
  },
74
77
  } as Meta<typeof OrCardCollection>;
75
78
 
76
79
  const Template: StoryFn<typeof OrCardCollection> = (args) => ({
77
80
  components: {
78
81
  OrCardCollection,
82
+ OrCard,
79
83
  OrIcon,
80
84
  },
81
85
 
@@ -89,16 +93,19 @@ const Template: StoryFn<typeof OrCardCollection> = (args) => ({
89
93
  },
90
94
 
91
95
  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>
96
+ <div class="p-md bg-surface-1 dark:bg-surface-1-dark">
97
+ <OrCardCollection
98
+ v-bind="args"
99
+ @viewChange="onViewChange"
100
+ @sortChange="onSortChange"
101
+ @searchChange="onSearchChange"
102
+ >
103
+ <template #item="{item, mode}">
104
+ <OrCard>${args.item} ({{mode}})</OrCard>
105
+ </template>
106
+ <template #addon>${args.addon}</template>
107
+ </OrCardCollection>
108
+ </div>
102
109
  `,
103
110
  });
104
111
 
@@ -106,8 +113,7 @@ export const Default = Template.bind({});
106
113
 
107
114
  Default.args = {
108
115
  // Slots
109
- gridItem: '{{ item.label }} (grid)',
110
- listItem: '{{ item.label }} (list)',
116
+ item: '{{ item.label }}',
111
117
  addon: '<OrIcon icon="info" />',
112
118
 
113
119
  // Props
@@ -139,7 +145,7 @@ Default.args = {
139
145
  'Yankee',
140
146
  'Zulu',
141
147
  ], (item) => ({
142
- id: item.toLowerCase(),
148
+ key: item.toLowerCase(),
143
149
  label: item,
144
150
  })),
145
151
  };
@@ -150,13 +156,148 @@ WithSorting.args = {
150
156
  ...Default.args,
151
157
 
152
158
  // Props
153
- sortHeaders: Array.from<string, CardCollectionSortHeader>([
159
+ sort: 'Bar',
160
+ sortOptions: [
154
161
  'Foo',
155
162
  'Bar',
156
163
  'Baz',
157
164
  'Qux',
158
- ], (item) => ({
159
- value: item.toLowerCase(),
160
- label: item,
161
- })),
165
+ ],
166
+ };
167
+
168
+
169
+ export const OverrideViewContainer: StoryFn<typeof OrCardCollection> = (args) => ({
170
+ components: {
171
+ OrCardCollection,
172
+ OrCard,
173
+ },
174
+
175
+ setup() {
176
+ return {
177
+ args,
178
+ onViewChange: action('viewChange'),
179
+ onSortChange: action('sortChange'),
180
+ onSearchChange: action('searchChange'),
181
+ };
182
+ },
183
+
184
+ template: `
185
+ <div class="p-md bg-surface-1 dark:bg-surface-1-dark">
186
+ <OrCardCollection
187
+ v-bind="args"
188
+ @viewChange="onViewChange"
189
+ @sortChange="onSortChange"
190
+ @searchChange="onSearchChange"
191
+ >
192
+ <template #grid="{items}">
193
+ <div class="typography-headline-3">Custom grid</div>
194
+ <div class="grid grid-cols-3">
195
+ <OrCard
196
+ v-for="item in items"
197
+ :key="item.key"
198
+ >
199
+ {{ item.label }}
200
+ </OrCard>
201
+ </div>
202
+ </template>
203
+ <template #list="{items}">
204
+ <div class="typography-headline-3">Custom list</div>
205
+ <ul>
206
+ <li
207
+ v-for="item in items"
208
+ :key="item.key"
209
+ >
210
+ - {{ item.label }}
211
+ </li>
212
+ </ul>
213
+ </template>
214
+ </OrCardCollection>
215
+ </div>
216
+ `,
217
+ });
218
+
219
+ OverrideViewContainer.args = {
220
+ ...Default.args,
221
+ };
222
+
223
+ export const ExtraViewMode: StoryFn<typeof OrCardCollection> = (args) => ({
224
+ components: {
225
+ OrCardCollection,
226
+ OrCard,
227
+ },
228
+
229
+ setup() {
230
+ return {
231
+ args,
232
+ defaultViewModes,
233
+ onViewChange: action('viewChange'),
234
+ onSearchChange: action('searchChange'),
235
+ };
236
+ },
237
+
238
+ template: `
239
+ <div class="p-md bg-surface-1 dark:bg-surface-1-dark">
240
+ <OrCardCollection
241
+ v-bind="args"
242
+ :view-modes="[...defaultViewModes, {view: 'mymode', icon: 'timeline'}]"
243
+ @viewChange="onViewChange"
244
+ @searchChange="onSearchChange"
245
+ >
246
+ <template #item="{item, mode}">
247
+ <OrCard>${args.item} ({{mode}})</OrCard>
248
+ </template>
249
+ <template #mymode="{items}">
250
+ <div class="typography-headline-3">My view mode</div>
251
+ <div class="grid grid-cols-3">
252
+ <OrCard
253
+ v-for="item in items"
254
+ :key="item.key"
255
+ >
256
+ {{ item.label }} (timeline)
257
+ </OrCard>
258
+ </div>
259
+ </template>
260
+ </OrCardCollection>
261
+ </div>
262
+ `,
263
+ });
264
+
265
+ ExtraViewMode.args = {
266
+ ...Default.args,
267
+ };
268
+
269
+ export const WithLink: StoryFn<typeof OrCardCollection> = (args) => ({
270
+ components: {
271
+ OrCardCollection,
272
+ OrCard,
273
+ OrIcon,
274
+ },
275
+
276
+ setup() {
277
+ return {
278
+ args,
279
+ onViewChange: action('viewChange'),
280
+ onSortChange: action('sortChange'),
281
+ onSearchChange: action('searchChange'),
282
+ };
283
+ },
284
+
285
+ template: `
286
+ <div class="p-md bg-surface-1 dark:bg-surface-1-dark">
287
+ <OrCardCollection
288
+ v-bind="args"
289
+ @viewChange="onViewChange"
290
+ @sortChange="onSortChange"
291
+ @searchChange="onSearchChange"
292
+ >
293
+ <template #item="{item}">
294
+ <a href="#" @click.prevent><OrCard>${args.item}</OrCard></a>
295
+ </template>
296
+ </OrCardCollection>
297
+ </div>
298
+ `,
299
+ });
300
+
301
+ WithLink.args = {
302
+ ...Default.args,
162
303
  };
@@ -6,87 +6,105 @@
6
6
  >
7
7
  <div :class="toolbarStyles">
8
8
  <div :class="toolbarPanelStyles">
9
- <template v-if="sortHeaders">
10
- <OrSortHeader
11
- v-for="header in sortHeaders"
12
- :key="header.value"
13
- v-model="proxySort"
14
- :input-value="header.value"
9
+ <template v-if="sortOptions.length">
10
+ <OrButton
11
+ ref="sortButton"
12
+ variant="link"
13
+ color="inherit"
14
+ @click="sortMenu.toggle()"
15
15
  >
16
- {{ header.label }}
17
- </OrSortHeader>
16
+ {{ proxySort }}
17
+ <OrIcon
18
+ v-if="sortMenu"
19
+ :icon="sortMenu.isOpen ? 'arrow_drop_up' : 'arrow_drop_down'"
20
+ />
21
+ </OrButton>
22
+ <OrMenu
23
+ ref="sortMenu"
24
+ :trigger="sortButton && sortButton.root"
25
+ >
26
+ <OrMenuItem
27
+ v-for="sortItem in sortOptions"
28
+ :key="sortItem"
29
+ @click="handleSort(sortItem)"
30
+ >
31
+ {{ sortItem }}
32
+ </OrMenuItem>
33
+ </OrMenu>
18
34
  </template>
19
35
  </div>
20
36
 
21
- <div :class="toolbarPanelStyles">
22
- <OrInput
23
- v-model="proxySearch"
24
- :type="'search'"
25
- :placeholder="'Search'"
26
- :size="'s'"
37
+ <div
38
+ :class="toolbarPanelStyles"
39
+ >
40
+ <OrSearch
41
+ class="md:w-[350px]"
42
+ size="s"
43
+ @search="handleSearch"
27
44
  />
28
-
29
- <OrIconButton
30
- :icon="'grid_view'"
31
- @click="switchToGridView()"
32
- />
33
-
34
- <OrIconButton
35
- :icon="'view_list'"
36
- @click="switchToListView()"
37
- />
38
-
39
- <slot name="addon" />
45
+ <div class="layout-row gap-sm">
46
+ <template v-if="viewModes.length > 1">
47
+ <OrIconButton
48
+ v-for="viewOption in viewModes"
49
+ :key="viewOption.view"
50
+ :icon="{icon: viewOption.icon, variant: viewOption.view === proxyView ? 'filled' : 'outlined'}"
51
+ @click="switchView(viewOption.view)"
52
+ />
53
+ </template>
54
+ <slot name="addon" />
55
+ </div>
40
56
  </div>
41
57
  </div>
42
58
 
43
- <div :class="contentStyles">
44
- <template v-if="proxyView === 'grid'">
45
- <OrCard
46
- v-for="item in items"
47
- :key="item.id"
48
- >
49
- <slot
50
- name="gridItem"
51
- v-bind="item"
52
- />
53
- </OrCard>
54
- </template>
55
-
56
- <template v-if="proxyView === 'list'">
57
- <OrCard
58
- v-for="item in items"
59
- :key="item.id"
60
- >
59
+ <slot
60
+ :name="proxyView"
61
+ v-bind="{items}"
62
+ >
63
+ <OrCardCollectionView
64
+ :items="items"
65
+ :mode="proxyView"
66
+ >
67
+ <template v-slot:item="props">
61
68
  <slot
62
- name="listItem"
63
- v-bind="item"
69
+ name="item"
70
+ v-bind="props"
64
71
  />
65
- </OrCard>
66
- </template>
67
- </div>
72
+ </template>
73
+ </OrCardCollectionView>
74
+ </slot>
68
75
  </div>
69
76
  </template>
70
77
 
71
78
  <script lang="ts">
72
79
  import { computed, defineComponent, PropType, ref, watch } from 'vue-demi';
73
80
  import { useClassAttribute } from '../../hooks';
74
- import { OrCardV3 as OrCard } from '../or-card-v3';
75
81
  import { OrIconButtonV3 as OrIconButton } from '../or-icon-button-v3';
76
- import { OrInputV3 as OrInput } from '../or-input-v3';
77
- import { OrSortHeaderV3 as OrSortHeader, SortHeaderModel } from '../or-sort-header-v3';
82
+ import { OrMenuV3 as OrMenu } from '../or-menu-v3';
83
+ import { OrMenuItemV3 as OrMenuItem } from '../or-menu-item-v3';
84
+ import { OrIconV3 as OrIcon } from '../or-icon-v3';
78
85
  import { CardCollectionView } from './props';
79
- import { CardCollectionContent, CardCollectionContentViews, CardCollectionRoot, CardCollectionToolbar, CardCollectionToolbarPanel } from './styles';
80
- import { CardCollectionItem, CardCollectionSortHeader } from './types';
86
+ import {
87
+ CardCollectionRoot,
88
+ CardCollectionToolbar,
89
+ CardCollectionToolbarPanel,
90
+ } from './styles';
91
+ import { CardCollectionItem, ViewMode } from './types';
92
+ import OrCardCollectionView from './OrCardCollectionView.vue3.vue';
93
+ import { OrButtonV3 as OrButton } from '../or-button-v3';
94
+ import { OrSearchV3 as OrSearch } from '../or-search-v3';
95
+ import { defaultViewModes } from './constatnts';
81
96
 
82
97
  export default defineComponent({
83
98
  name: 'OrCardCollection',
84
99
 
85
100
  components: {
86
- OrCard,
101
+ OrCardCollectionView,
87
102
  OrIconButton,
88
- OrInput,
89
- OrSortHeader,
103
+ OrButton,
104
+ OrMenu,
105
+ OrMenuItem,
106
+ OrIcon,
107
+ OrSearch,
90
108
  },
91
109
 
92
110
  inheritAttrs: false,
@@ -98,18 +116,23 @@ export default defineComponent({
98
116
  },
99
117
 
100
118
  view: {
101
- type: String as PropType<CardCollectionView>,
119
+ type: String as PropType<string>,
102
120
  default: CardCollectionView.Grid,
103
121
  },
104
122
 
123
+ viewModes: {
124
+ type: Array as PropType<ViewMode[]>,
125
+ default: () => defaultViewModes,
126
+ },
127
+
105
128
  sort: {
106
- type: Object as PropType<SortHeaderModel>,
129
+ type: String,
107
130
  default: undefined,
108
131
  },
109
132
 
110
- sortHeaders: {
111
- type: Array as PropType<CardCollectionSortHeader[]>,
112
- default: undefined,
133
+ sortOptions: {
134
+ type: Array as PropType<string[]>,
135
+ default: () => [],
113
136
  },
114
137
 
115
138
  search: {
@@ -131,6 +154,8 @@ export default defineComponent({
131
154
  setup(props, context) {
132
155
  // Refs
133
156
  const root = ref<HTMLElement>();
157
+ const sortMenu = ref<typeof OrMenu>();
158
+ const sortButton = ref<typeof OrButton>();
134
159
 
135
160
  // Styles
136
161
  const classAttribute = useClassAttribute();
@@ -149,23 +174,21 @@ export default defineComponent({
149
174
  ...CardCollectionToolbarPanel,
150
175
  ]);
151
176
 
152
- const contentStyles = computed(() => [
153
- ...CardCollectionContent,
154
- ...CardCollectionContentViews[proxyView.value],
155
- ]);
156
-
157
177
  // State
158
178
  const proxyView = ref(props.view);
159
179
  const proxySort = ref(props.sort);
160
180
  const proxySearch = ref(props.search);
161
181
 
162
182
  // Methods
163
- function switchToGridView(): void {
164
- proxyView.value = CardCollectionView.Grid;
183
+ function switchView(view: string): void {
184
+ proxyView.value = view;
185
+ }
186
+ function handleSort(sort: string) {
187
+ proxySort.value = sort;
165
188
  }
166
189
 
167
- function switchToListView(): void {
168
- proxyView.value = CardCollectionView.List;
190
+ function handleSearch(search: string) {
191
+ proxySearch.value = search;
169
192
  }
170
193
 
171
194
  // Effects
@@ -195,15 +218,17 @@ export default defineComponent({
195
218
 
196
219
  return {
197
220
  root,
221
+ sortMenu,
222
+ sortButton,
198
223
  rootStyles,
199
224
  toolbarStyles,
200
225
  toolbarPanelStyles,
201
- contentStyles,
202
226
  proxyView,
203
227
  proxySort,
204
228
  proxySearch,
205
- switchToGridView,
206
- switchToListView,
229
+ switchView,
230
+ handleSort,
231
+ handleSearch,
207
232
  };
208
233
  },
209
234
  });
@@ -0,0 +1,41 @@
1
+ <template>
2
+ <div :class="contentStyles">
3
+ <slot
4
+ v-for="(item) in items"
5
+ name="item"
6
+ v-bind="{
7
+ item,
8
+ mode,
9
+ }"
10
+ >
11
+ {{ item.key }}
12
+ </slot>
13
+ </div>
14
+ </template>
15
+ <script lang="ts">
16
+ import { defineComponent, computed, PropType } from 'vue-demi';
17
+ import { CardCollectionContent, CardCollectionContentViews } from './styles';
18
+ import { CardCollectionItem } from './types';
19
+ import { CardCollectionView } from './props';
20
+
21
+ export default defineComponent({
22
+ name: 'OrCardCollectionView',
23
+ props: {
24
+ items: {
25
+ type: Array as PropType<CardCollectionItem[]>,
26
+ default: [] as CardCollectionItem[],
27
+ },
28
+ mode: {
29
+ type: String as PropType<CardCollectionView>,
30
+ required: true,
31
+ },
32
+ },
33
+ setup(props) {
34
+ const contentStyles = computed(() => [
35
+ ...CardCollectionContent,
36
+ ...CardCollectionContentViews[props.mode],
37
+ ]);
38
+ return { contentStyles };
39
+ },
40
+ });
41
+ </script>
@@ -0,0 +1,42 @@
1
+ <template>
2
+ <div :class="contentStyles">
3
+ <slot
4
+ v-for="(item, index) in items"
5
+ :key="item.key || index"
6
+ name="item"
7
+ v-bind="{
8
+ item,
9
+ mode,
10
+ }"
11
+ >
12
+ {{ item.key }}
13
+ </slot>
14
+ </div>
15
+ </template>
16
+ <script lang="ts">
17
+ import { defineComponent, computed, PropType } from 'vue-demi';
18
+ import { CardCollectionContent, CardCollectionContentViews } from './styles';
19
+ import { CardCollectionItem } from './types';
20
+ import { CardCollectionView } from './props';
21
+
22
+ export default defineComponent({
23
+ name: 'OrCardCollectionView',
24
+ props: {
25
+ items: {
26
+ type: Array as PropType<CardCollectionItem[]>,
27
+ default: [] as CardCollectionItem[],
28
+ },
29
+ mode: {
30
+ type: String as PropType<CardCollectionView>,
31
+ required: true,
32
+ },
33
+ },
34
+ setup(props) {
35
+ const contentStyles = computed(() => [
36
+ ...CardCollectionContent,
37
+ ...CardCollectionContentViews[props.mode],
38
+ ]);
39
+ return { contentStyles };
40
+ },
41
+ });
42
+ </script>
@@ -0,0 +1,12 @@
1
+ import { ViewMode } from './types';
2
+
3
+ export const gridView: ViewMode = {
4
+ view: 'grid',
5
+ icon: 'grid_view',
6
+ };
7
+ export const listView: ViewMode = {
8
+ view: 'list',
9
+ icon: 'view_agenda',
10
+ };
11
+
12
+ export const defaultViewModes = [gridView, listView];
@@ -25,7 +25,7 @@ export const CardCollectionToolbarPanel: string[] = [
25
25
  'layout-row',
26
26
 
27
27
  // Spacing
28
- 'gap-sm+',
28
+ 'gap-lg+',
29
29
  ];
30
30
 
31
31
  export const CardCollectionContent: string[] = [
@@ -1,8 +1,9 @@
1
1
  export interface CardCollectionItem {
2
- id: string;
2
+ key?: string;
3
+ [key: string|number]: any;
3
4
  }
4
5
 
5
- export interface CardCollectionSortHeader {
6
- value: string;
7
- label: string;
6
+ export interface ViewMode {
7
+ view: string;
8
+ icon: string;
8
9
  }