@onereach/ui-components 2.63.0-beta.1907.0 → 2.63.1-beta.1936.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 (300) hide show
  1. package/dist/v2/OrCardCollection-5d5046f1.js +227 -0
  2. package/dist/v2/{OrConfirm-8d149ece.js → OrConfirm-edc537b3.js} +1 -1
  3. package/dist/v2/{OrIconButton-5883eba0.js → OrIconButton-2088a37f.js} +1 -1
  4. package/dist/v2/{OrInlineInput-16a343c1.js → OrInlineInput-da65c72a.js} +9 -8
  5. package/dist/v2/{OrInlineTextarea-f154bdf5.js → OrInlineTextarea-da66759a.js} +9 -8
  6. package/dist/v2/{OrInput-4a50fe57.js → OrInput-655bed71.js} +9 -7
  7. package/dist/v2/{OrModal-64c5ae2e.js → OrModal-a1452b11.js} +1 -1
  8. package/dist/v2/{OrNotification-9c164908.js → OrNotification-ac420f39.js} +1 -1
  9. package/dist/v2/{OrSearch-a247f072.js → OrSearch-287a08a9.js} +1 -1
  10. package/dist/v2/OrSegmentedControl-17df63b8.js +236 -0
  11. package/dist/v2/{OrSelect-f416b7aa.js → OrSelect-1a353817.js} +4 -4
  12. package/dist/v2/OrSortHeader-a6004b24.js +133 -0
  13. package/dist/v2/{OrTabs-b4a9740b.js → OrTabs-f2a60b41.js} +1 -1
  14. package/dist/v2/{OrTag-ab03c4f7.js → OrTag-1ced4e58.js} +1 -1
  15. package/dist/v2/{OrTextarea-8773d494.js → OrTextarea-cc70afc9.js} +5 -5
  16. package/dist/v2/{OrTooltip-caeac590.js → OrTooltip-afe7030b.js} +33 -3
  17. package/dist/v2/components/index.d.ts +3 -0
  18. package/dist/v2/components/or-card-collection-v3/OrCardCollection.stories3.d.ts +17 -0
  19. package/dist/v2/components/or-card-collection-v3/OrCardCollection.vue.d.ts +98 -0
  20. package/dist/v2/components/or-card-collection-v3/index.d.ts +3 -0
  21. package/dist/v2/components/or-card-collection-v3/props.d.ts +4 -0
  22. package/dist/v2/components/or-card-collection-v3/styles.d.ts +6 -0
  23. package/dist/v2/components/or-card-collection-v3/types.d.ts +7 -0
  24. package/dist/v2/components/{or-rich-text-editor-v3/OrRichTextEditor.stories3.d.ts → or-segmented-control-v3/OrSegmentedControl.stories3.d.ts} +1 -1
  25. package/dist/v2/components/or-segmented-control-v3/OrSegmentedControl.vue.d.ts +77 -0
  26. package/dist/v2/components/or-segmented-control-v3/components/or-segmented-control-item/OrSegmentedControlItem.vue.d.ts +47 -0
  27. package/dist/v2/components/or-segmented-control-v3/components/or-segmented-control-item/styles.d.ts +3 -0
  28. package/dist/v2/components/or-segmented-control-v3/index.d.ts +3 -0
  29. package/dist/v2/components/or-segmented-control-v3/props.d.ts +4 -0
  30. package/dist/v2/components/or-segmented-control-v3/styles.d.ts +3 -0
  31. package/dist/v2/components/or-segmented-control-v3/types.d.ts +4 -0
  32. package/dist/{v3/components/or-rich-text-editor-v3/OrRichTextEditor.stories3.d.ts → v2/components/or-sort-header-v3/OrSortHeader.stories3.d.ts} +1 -1
  33. package/dist/v2/components/or-sort-header-v3/OrSortHeader.vue.d.ts +57 -0
  34. package/dist/v2/components/or-sort-header-v3/index.d.ts +2 -0
  35. package/dist/v2/components/or-sort-header-v3/styles.d.ts +1 -0
  36. package/dist/v2/components/or-sort-header-v3/types.d.ts +4 -0
  37. package/dist/v2/components/or-tooltip-v3/styles.d.ts +2 -0
  38. package/dist/v2/index.js +17 -14
  39. package/dist/v2/index11.js +20 -1
  40. package/dist/v2/index12.js +3 -12
  41. package/dist/v2/index13.js +3 -2
  42. package/dist/v2/index14.js +11 -5
  43. package/dist/v2/index15.js +5 -14
  44. package/dist/v2/index16.js +4 -19
  45. package/dist/v2/index17.js +28 -4
  46. package/dist/v2/index18.js +3 -7
  47. package/dist/v2/index19.js +5 -23
  48. package/dist/v2/index2.js +17 -14
  49. package/dist/v2/index20.js +25 -21
  50. package/dist/v2/index21.js +21 -18
  51. package/dist/v2/index22.js +20 -2
  52. package/dist/v2/index23.js +2 -4
  53. package/dist/v2/index24.js +2 -1
  54. package/dist/v2/index25.js +1 -2
  55. package/dist/v2/index26.js +2 -2
  56. package/dist/v2/index27.js +4 -7
  57. package/dist/v2/index28.js +6 -2
  58. package/dist/v2/index29.js +3 -3
  59. package/dist/v2/index30.js +3 -10
  60. package/dist/v2/index31.js +9 -12
  61. package/dist/v2/index32.js +11 -1
  62. package/dist/v2/index33.js +1 -1
  63. package/dist/v2/index34.js +1 -16
  64. package/dist/v2/index35.js +17 -17
  65. package/dist/v2/index36.js +17 -17
  66. package/dist/v2/index37.js +16 -1
  67. package/dist/v2/index38.js +1 -17
  68. package/dist/v2/index39.js +18 -22
  69. package/dist/v2/index40.js +22 -2
  70. package/dist/v2/index41.js +3 -3
  71. package/dist/v2/index42.js +1 -1
  72. package/dist/v2/index43.js +3 -20
  73. package/dist/v2/index44.js +1 -7
  74. package/dist/v2/index45.js +24 -1
  75. package/dist/v2/index46.js +3 -3
  76. package/dist/v2/index47.js +1 -2
  77. package/dist/v2/index48.js +2 -9
  78. package/dist/v2/index49.js +10 -17
  79. package/dist/v2/index50.js +17 -13
  80. package/dist/v2/index51.js +13 -14
  81. package/dist/v2/index52.js +14 -13
  82. package/dist/v2/index53.js +12 -15
  83. package/dist/v2/index54.js +16 -1
  84. package/dist/v2/index55.js +2 -6
  85. package/dist/v2/index56.js +1 -5
  86. package/dist/v2/index57.js +10 -3
  87. package/dist/v2/index58.js +2 -4
  88. package/dist/v2/index59.js +5 -3
  89. package/dist/v2/index60.js +2 -1
  90. package/dist/v2/index61.js +2 -5
  91. package/dist/v2/index62.js +6 -334
  92. package/dist/v2/index63.js +4 -4
  93. package/dist/v2/index64.js +2 -16
  94. package/dist/v2/index65.js +15 -24
  95. package/dist/v2/index66.js +26 -4
  96. package/dist/v2/index67.js +2 -1
  97. package/dist/v2/index68.js +3 -4
  98. package/dist/v2/index69.js +3 -4
  99. package/dist/v2/index70.js +3 -10
  100. package/dist/v2/index71.js +3 -6
  101. package/dist/v2/index72.js +4 -4
  102. package/dist/v2/index73.js +15 -6
  103. package/dist/v2/index74.js +2 -2
  104. package/dist/v2/index75.js +6 -3
  105. package/dist/v2/index76.js +4 -3
  106. package/dist/v2/index77.js +1 -2
  107. package/dist/v2/index78.js +2 -14
  108. package/dist/v2/index79.js +2 -10
  109. package/dist/v2/index80.js +5 -4
  110. package/dist/v2/index81.js +12 -2
  111. package/dist/v2/index82.js +14 -2
  112. package/dist/v2/index83.js +2 -3
  113. package/dist/v2/index84.js +2 -8
  114. package/dist/v2/index85.js +2 -20
  115. package/dist/v2/index86.js +8 -18
  116. package/dist/v2/index87.js +21 -1
  117. package/dist/v2/index88.js +17 -16
  118. package/dist/v2/index89.js +1 -1
  119. package/dist/v2/index90.js +17 -9
  120. package/dist/v2/index91.js +2 -12
  121. package/dist/v2/index92.js +10 -1
  122. package/dist/v2/index93.js +12 -6
  123. package/dist/v2/index94.js +1 -2
  124. package/dist/v2/index95.js +7 -0
  125. package/dist/v2/index96.js +3 -0
  126. package/dist/v2/{types-fb93ea4e.js → types-89aad7fb.js} +1 -1
  127. package/dist/v3/OrCardCollection-c6f3ac23.js +198 -0
  128. package/dist/v3/{OrConfirm-456ddee1.js → OrConfirm-0bafcc7b.js} +1 -1
  129. package/dist/v3/{OrIconButton-b8066b5d.js → OrIconButton-5fb3a9aa.js} +1 -1
  130. package/dist/v3/{OrInlineInput-280768ba.js → OrInlineInput-d9bbc08c.js} +9 -6
  131. package/dist/v3/{OrInlineTextarea-0f63f344.js → OrInlineTextarea-d5a97ed9.js} +9 -6
  132. package/dist/v3/{OrInput-3eef7945.js → OrInput-db4813b4.js} +11 -6
  133. package/dist/v3/{OrModal-f67d37d3.js → OrModal-3a43b7e7.js} +1 -1
  134. package/dist/v3/{OrNotification-fefa1cb4.js → OrNotification-433d16f7.js} +1 -1
  135. package/dist/v3/{OrSearch-15a70678.js → OrSearch-0c29f499.js} +1 -1
  136. package/dist/v3/OrSegmentedControl-2bbc0f22.js +184 -0
  137. package/dist/v3/{OrSelect-9d300f55.js → OrSelect-323a87b4.js} +7 -5
  138. package/dist/v3/OrSortHeader-5eba50cd.js +104 -0
  139. package/dist/v3/{OrTabs-194ca950.js → OrTabs-ac0be933.js} +1 -1
  140. package/dist/v3/{OrTag-144b4ab8.js → OrTag-deaff080.js} +1 -1
  141. package/dist/v3/{OrTextarea-09aa33dc.js → OrTextarea-98895b2a.js} +6 -4
  142. package/dist/v3/{OrTooltip-30e05f9e.js → OrTooltip-36c6728c.js} +33 -3
  143. package/dist/v3/components/index.d.ts +3 -0
  144. package/dist/v3/components/or-card-collection-v3/OrCardCollection.stories3.d.ts +17 -0
  145. package/dist/v3/components/or-card-collection-v3/OrCardCollection.vue.d.ts +98 -0
  146. package/dist/v3/components/or-card-collection-v3/index.d.ts +3 -0
  147. package/dist/v3/components/or-card-collection-v3/props.d.ts +4 -0
  148. package/dist/v3/components/or-card-collection-v3/styles.d.ts +6 -0
  149. package/dist/v3/components/or-card-collection-v3/types.d.ts +7 -0
  150. package/dist/v3/components/or-segmented-control-v3/OrSegmentedControl.stories3.d.ts +12 -0
  151. package/dist/v3/components/or-segmented-control-v3/OrSegmentedControl.vue.d.ts +77 -0
  152. package/dist/v3/components/or-segmented-control-v3/components/or-segmented-control-item/OrSegmentedControlItem.vue.d.ts +47 -0
  153. package/dist/v3/components/or-segmented-control-v3/components/or-segmented-control-item/styles.d.ts +3 -0
  154. package/dist/v3/components/or-segmented-control-v3/index.d.ts +3 -0
  155. package/dist/v3/components/or-segmented-control-v3/props.d.ts +4 -0
  156. package/dist/v3/components/or-segmented-control-v3/styles.d.ts +3 -0
  157. package/dist/v3/components/or-segmented-control-v3/types.d.ts +4 -0
  158. package/dist/v3/components/or-sort-header-v3/OrSortHeader.stories3.d.ts +12 -0
  159. package/dist/v3/components/or-sort-header-v3/OrSortHeader.vue.d.ts +57 -0
  160. package/dist/v3/components/or-sort-header-v3/index.d.ts +2 -0
  161. package/dist/v3/components/or-sort-header-v3/styles.d.ts +1 -0
  162. package/dist/v3/components/or-sort-header-v3/types.d.ts +4 -0
  163. package/dist/v3/components/or-tooltip-v3/styles.d.ts +2 -0
  164. package/dist/v3/index.js +17 -14
  165. package/dist/v3/index11.js +19 -1
  166. package/dist/v3/index12.js +3 -11
  167. package/dist/v3/index13.js +3 -2
  168. package/dist/v3/index14.js +9 -4
  169. package/dist/v3/index15.js +4 -11
  170. package/dist/v3/index16.js +3 -17
  171. package/dist/v3/index17.js +25 -4
  172. package/dist/v3/index18.js +3 -6
  173. package/dist/v3/index19.js +5 -20
  174. package/dist/v3/index2.js +17 -14
  175. package/dist/v3/index20.js +21 -20
  176. package/dist/v3/index21.js +20 -15
  177. package/dist/v3/index22.js +16 -1
  178. package/dist/v3/index23.js +2 -4
  179. package/dist/v3/index24.js +2 -1
  180. package/dist/v3/index25.js +1 -2
  181. package/dist/v3/index26.js +2 -2
  182. package/dist/v3/index27.js +4 -6
  183. package/dist/v3/index28.js +5 -2
  184. package/dist/v3/index29.js +3 -3
  185. package/dist/v3/index30.js +3 -9
  186. package/dist/v3/index31.js +8 -11
  187. package/dist/v3/index32.js +10 -1
  188. package/dist/v3/index33.js +1 -1
  189. package/dist/v3/index34.js +1 -15
  190. package/dist/v3/index35.js +16 -14
  191. package/dist/v3/index36.js +14 -16
  192. package/dist/v3/index37.js +16 -2
  193. package/dist/v3/index38.js +2 -17
  194. package/dist/v3/index39.js +17 -17
  195. package/dist/v3/index40.js +16 -1
  196. package/dist/v3/index41.js +3 -3
  197. package/dist/v3/index42.js +1 -1
  198. package/dist/v3/index43.js +3 -16
  199. package/dist/v3/index44.js +1 -7
  200. package/dist/v3/index45.js +20 -1
  201. package/dist/v3/index46.js +3 -3
  202. package/dist/v3/index47.js +1 -2
  203. package/dist/v3/index48.js +2 -8
  204. package/dist/v3/index49.js +9 -14
  205. package/dist/v3/index50.js +14 -12
  206. package/dist/v3/index51.js +12 -11
  207. package/dist/v3/index52.js +11 -12
  208. package/dist/v3/index53.js +11 -11
  209. package/dist/v3/index54.js +12 -1
  210. package/dist/v3/index55.js +2 -5
  211. package/dist/v3/index56.js +1 -5
  212. package/dist/v3/index57.js +9 -3
  213. package/dist/v3/index58.js +2 -4
  214. package/dist/v3/index59.js +5 -3
  215. package/dist/v3/index60.js +2 -1
  216. package/dist/v3/index61.js +1 -4
  217. package/dist/v3/index62.js +6 -307
  218. package/dist/v3/index63.js +4 -4
  219. package/dist/v3/index64.js +2 -15
  220. package/dist/v3/index65.js +13 -22
  221. package/dist/v3/index66.js +24 -3
  222. package/dist/v3/index67.js +2 -1
  223. package/dist/v3/index68.js +3 -4
  224. package/dist/v3/index69.js +3 -4
  225. package/dist/v3/index70.js +3 -9
  226. package/dist/v3/index71.js +3 -4
  227. package/dist/v3/index72.js +4 -4
  228. package/dist/v3/index73.js +11 -5
  229. package/dist/v3/index74.js +2 -2
  230. package/dist/v3/index75.js +5 -2
  231. package/dist/v3/index76.js +4 -3
  232. package/dist/v3/index77.js +1 -2
  233. package/dist/v3/index78.js +2 -13
  234. package/dist/v3/index79.js +2 -9
  235. package/dist/v3/index80.js +5 -4
  236. package/dist/v3/index81.js +11 -1
  237. package/dist/v3/index82.js +13 -1
  238. package/dist/v3/index83.js +1 -3
  239. package/dist/v3/index84.js +1 -8
  240. package/dist/v3/index85.js +2 -17
  241. package/dist/v3/index86.js +7 -14
  242. package/dist/v3/index87.js +18 -1
  243. package/dist/v3/index88.js +14 -15
  244. package/dist/v3/index89.js +1 -1
  245. package/dist/v3/index90.js +15 -6
  246. package/dist/v3/index91.js +2 -11
  247. package/dist/v3/index92.js +8 -1
  248. package/dist/v3/index93.js +11 -6
  249. package/dist/v3/index94.js +1 -2
  250. package/dist/v3/index95.js +7 -0
  251. package/dist/v3/index96.js +3 -0
  252. package/dist/v3/{types-a2a8f948.js → types-d5d4ab32.js} +1 -1
  253. package/package.json +2 -8
  254. package/src/components/index.ts +3 -0
  255. package/src/components/or-card-collection-v3/OrCardCollection.docs.mdx +3 -0
  256. package/src/components/or-card-collection-v3/OrCardCollection.stories3.ts +162 -0
  257. package/src/components/or-card-collection-v3/OrCardCollection.vue +210 -0
  258. package/src/components/or-card-collection-v3/index.ts +3 -0
  259. package/src/components/or-card-collection-v3/props.ts +4 -0
  260. package/src/components/or-card-collection-v3/styles.ts +53 -0
  261. package/src/components/or-card-collection-v3/types.ts +8 -0
  262. package/src/components/or-checkbox-v3/OrCheckbox.stories3.ts +1 -1
  263. package/src/components/or-inline-input-v3/OrInlineInput.vue +14 -12
  264. package/src/components/or-inline-textarea-v3/OrInlineTextarea.vue +14 -12
  265. package/src/components/or-input-v3/OrInput.vue +33 -29
  266. package/src/components/or-radio-v3/OrRadio.stories3.ts +1 -1
  267. package/src/components/or-segmented-control-v3/OrSegmentedControl.docs.mdx +7 -0
  268. package/src/components/or-segmented-control-v3/OrSegmentedControl.stories3.ts +106 -0
  269. package/src/components/or-segmented-control-v3/OrSegmentedControl.vue +107 -0
  270. package/src/components/or-segmented-control-v3/components/or-segmented-control-item/OrSegmentedControlItem.vue +64 -0
  271. package/src/components/or-segmented-control-v3/components/or-segmented-control-item/styles.ts +50 -0
  272. package/src/components/or-segmented-control-v3/index.ts +3 -0
  273. package/src/components/or-segmented-control-v3/props.ts +4 -0
  274. package/src/components/or-segmented-control-v3/styles.ts +24 -0
  275. package/src/components/or-segmented-control-v3/types.ts +4 -0
  276. package/src/components/or-select-v3/OrSelect.vue +5 -3
  277. package/src/components/or-sort-header-v3/OrSortHeader.docs.mdx +3 -0
  278. package/src/components/or-sort-header-v3/OrSortHeader.stories3.ts +132 -0
  279. package/src/components/or-sort-header-v3/OrSortHeader.vue +111 -0
  280. package/src/components/or-sort-header-v3/index.ts +2 -0
  281. package/src/components/or-sort-header-v3/styles.ts +23 -0
  282. package/src/components/or-sort-header-v3/types.ts +4 -0
  283. package/src/components/or-switch-v3/OrSwitch.stories3.ts +1 -1
  284. package/src/components/or-tabs-v3/OrTabs.stories3.ts +9 -4
  285. package/src/components/or-tabs-v3/OrTabs.vue +1 -1
  286. package/src/components/or-textarea-v3/OrTextarea.vue +12 -10
  287. package/src/components/or-tooltip-v3/OrTooltip.vue +3 -2
  288. package/src/components/or-tooltip-v3/styles.ts +55 -0
  289. package/src/hooks/useClassAttribute.ts +1 -1
  290. package/dist/v2/components/or-rich-text-editor-v3/OrRichTextEditor.vue.d.ts +0 -111
  291. package/dist/v2/components/or-rich-text-editor-v3/index.d.ts +0 -1
  292. package/dist/v2/components/or-rich-text-editor-v3/styles.d.ts +0 -7
  293. package/dist/v3/components/or-rich-text-editor-v3/OrRichTextEditor.vue.d.ts +0 -111
  294. package/dist/v3/components/or-rich-text-editor-v3/index.d.ts +0 -1
  295. package/dist/v3/components/or-rich-text-editor-v3/styles.d.ts +0 -7
  296. package/src/components/or-rich-text-editor-v3/OrRichTextEditor.docs.mdx +0 -16
  297. package/src/components/or-rich-text-editor-v3/OrRichTextEditor.stories3.ts +0 -57
  298. package/src/components/or-rich-text-editor-v3/OrRichTextEditor.vue +0 -322
  299. package/src/components/or-rich-text-editor-v3/index.ts +0 -1
  300. package/src/components/or-rich-text-editor-v3/styles.ts +0 -71
@@ -0,0 +1,162 @@
1
+ import { action } from '@storybook/addon-actions';
2
+ import { Meta, StoryFn } from '@storybook/vue3';
3
+ import { OrIconV3 as OrIcon } from '../or-icon-v3';
4
+ import OrCardCollectionDocs from './OrCardCollection.docs.mdx';
5
+ import OrCardCollection from './OrCardCollection.vue';
6
+ import { CardCollectionView } from './props';
7
+ import { CardCollectionItem, CardCollectionSortHeader } from './types';
8
+
9
+ export default {
10
+ title: 'Components/Card Collection',
11
+ component: OrCardCollection,
12
+
13
+ argTypes: {
14
+ // Slots
15
+ gridItem: {
16
+ type: {
17
+ name: 'string',
18
+ required: true,
19
+ },
20
+
21
+ control: { type: 'text' },
22
+ },
23
+
24
+ listItem: {
25
+ type: {
26
+ name: 'string',
27
+ required: true,
28
+ },
29
+
30
+ control: { type: 'text' },
31
+ },
32
+
33
+ // Props
34
+ items: {
35
+ control: { type: 'object' },
36
+ },
37
+
38
+ view: {
39
+ control: { type: 'select' },
40
+ options: Object.values(CardCollectionView),
41
+ },
42
+
43
+ sort: {
44
+ control: { type: 'object' },
45
+ },
46
+
47
+ sortHeaders: {
48
+ control: { type: 'object' },
49
+ },
50
+
51
+ search: {
52
+ control: { type: 'text' },
53
+ },
54
+
55
+ // Events
56
+ viewChange: {
57
+ table: { disable: true },
58
+ },
59
+
60
+ sortChange: {
61
+ table: { disable: true },
62
+ },
63
+
64
+ searchChange: {
65
+ table: { disable: true },
66
+ },
67
+ },
68
+
69
+ parameters: {
70
+ docs: {
71
+ page: OrCardCollectionDocs,
72
+ },
73
+ },
74
+ } as Meta<typeof OrCardCollection>;
75
+
76
+ const Template: StoryFn<typeof OrCardCollection> = (args) => ({
77
+ components: {
78
+ OrCardCollection,
79
+ OrIcon,
80
+ },
81
+
82
+ setup() {
83
+ return {
84
+ args,
85
+ onViewChange: action('viewChange'),
86
+ onSortChange: action('sortChange'),
87
+ onSearchChange: action('searchChange'),
88
+ };
89
+ },
90
+
91
+ 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
+ `,
103
+ });
104
+
105
+ export const Default = Template.bind({});
106
+
107
+ Default.args = {
108
+ // Slots
109
+ gridItem: '{{ item.label }} (grid)',
110
+ listItem: '{{ item.label }} (list)',
111
+ addon: '<OrIcon icon="info" />',
112
+
113
+ // Props
114
+ items: Array.from<string, CardCollectionItem>([
115
+ 'Alfa',
116
+ 'Bravo',
117
+ 'Charlie',
118
+ 'Delta',
119
+ 'Echo',
120
+ 'Foxtrot',
121
+ 'Golf',
122
+ 'Hotel',
123
+ 'India',
124
+ 'Juliett',
125
+ 'Kilo',
126
+ 'Lima',
127
+ 'Mike',
128
+ 'November',
129
+ 'Oscar',
130
+ 'Papa',
131
+ 'Quebec',
132
+ 'Romeo',
133
+ 'Sierra',
134
+ 'Tango',
135
+ 'Uniform',
136
+ 'Victor',
137
+ 'Whiskey',
138
+ 'X-Ray',
139
+ 'Yankee',
140
+ 'Zulu',
141
+ ], (item) => ({
142
+ id: item.toLowerCase(),
143
+ label: item,
144
+ })),
145
+ };
146
+
147
+ export const WithSorting = Template.bind({});
148
+
149
+ WithSorting.args = {
150
+ ...Default.args,
151
+
152
+ // 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
+ })),
162
+ };
@@ -0,0 +1,210 @@
1
+ <template>
2
+ <div
3
+ ref="root"
4
+ v-bind="$attrs"
5
+ :class="rootStyles"
6
+ >
7
+ <div :class="toolbarStyles">
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"
15
+ >
16
+ {{ header.label }}
17
+ </OrSortHeader>
18
+ </template>
19
+ </div>
20
+
21
+ <div :class="toolbarPanelStyles">
22
+ <OrInput
23
+ v-model="proxySearch"
24
+ :type="'search'"
25
+ :placeholder="'Search'"
26
+ :size="'s'"
27
+ />
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" />
40
+ </div>
41
+ </div>
42
+
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
+ >
61
+ <slot
62
+ name="listItem"
63
+ v-bind="item"
64
+ />
65
+ </OrCard>
66
+ </template>
67
+ </div>
68
+ </div>
69
+ </template>
70
+
71
+ <script lang="ts">
72
+ import { computed, defineComponent, PropType, ref, watch } from 'vue-demi';
73
+ import { useClassAttribute } from '../../hooks';
74
+ import { OrCardV3 as OrCard } from '../or-card-v3';
75
+ 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';
78
+ import { CardCollectionView } from './props';
79
+ import { CardCollectionContent, CardCollectionContentViews, CardCollectionRoot, CardCollectionToolbar, CardCollectionToolbarPanel } from './styles';
80
+ import { CardCollectionItem, CardCollectionSortHeader } from './types';
81
+
82
+ export default defineComponent({
83
+ name: 'OrCardCollection',
84
+
85
+ components: {
86
+ OrCard,
87
+ OrIconButton,
88
+ OrInput,
89
+ OrSortHeader,
90
+ },
91
+
92
+ inheritAttrs: false,
93
+
94
+ props: {
95
+ items: {
96
+ type: Array as PropType<CardCollectionItem[]>,
97
+ default: [] as CardCollectionItem[],
98
+ },
99
+
100
+ view: {
101
+ type: String as PropType<CardCollectionView>,
102
+ default: CardCollectionView.Grid,
103
+ },
104
+
105
+ sort: {
106
+ type: Object as PropType<SortHeaderModel>,
107
+ default: undefined,
108
+ },
109
+
110
+ sortHeaders: {
111
+ type: Array as PropType<CardCollectionSortHeader[]>,
112
+ default: undefined,
113
+ },
114
+
115
+ search: {
116
+ type: String,
117
+ default: undefined,
118
+ },
119
+ },
120
+
121
+ emits: [
122
+ 'viewChange',
123
+ 'sortChange',
124
+ 'searchChange',
125
+ ],
126
+
127
+ expose: [
128
+ 'root',
129
+ ],
130
+
131
+ setup(props, context) {
132
+ // Refs
133
+ const root = ref<HTMLElement>();
134
+
135
+ // Styles
136
+ const classAttribute = useClassAttribute();
137
+
138
+ const rootStyles = computed(() => [
139
+ 'or-card-collection',
140
+ ...CardCollectionRoot,
141
+ classAttribute.value,
142
+ ]);
143
+
144
+ const toolbarStyles = computed(() => [
145
+ ...CardCollectionToolbar,
146
+ ]);
147
+
148
+ const toolbarPanelStyles = computed(() => [
149
+ ...CardCollectionToolbarPanel,
150
+ ]);
151
+
152
+ const contentStyles = computed(() => [
153
+ ...CardCollectionContent,
154
+ ...CardCollectionContentViews[proxyView.value],
155
+ ]);
156
+
157
+ // State
158
+ const proxyView = ref(props.view);
159
+ const proxySort = ref(props.sort);
160
+ const proxySearch = ref(props.search);
161
+
162
+ // Methods
163
+ function switchToGridView(): void {
164
+ proxyView.value = CardCollectionView.Grid;
165
+ }
166
+
167
+ function switchToListView(): void {
168
+ proxyView.value = CardCollectionView.List;
169
+ }
170
+
171
+ // Effects
172
+ watch(() => props.view, (value) => {
173
+ proxyView.value = value;
174
+ });
175
+
176
+ watch(proxyView, (value) => {
177
+ context.emit('viewChange', value);
178
+ });
179
+
180
+ watch(() => props.sort, (value) => {
181
+ proxySort.value = value;
182
+ });
183
+
184
+ watch(proxySort, (value) => {
185
+ context.emit('sortChange', value);
186
+ });
187
+
188
+ watch(() => props.search, (value) => {
189
+ proxySearch.value = value;
190
+ });
191
+
192
+ watch(proxySearch, (value) => {
193
+ context.emit('searchChange', value);
194
+ });
195
+
196
+ return {
197
+ root,
198
+ rootStyles,
199
+ toolbarStyles,
200
+ toolbarPanelStyles,
201
+ contentStyles,
202
+ proxyView,
203
+ proxySort,
204
+ proxySearch,
205
+ switchToGridView,
206
+ switchToListView,
207
+ };
208
+ },
209
+ });
210
+ </script>
@@ -0,0 +1,3 @@
1
+ export { default as OrCardCollectionV3 } from './OrCardCollection.vue';
2
+ export * from './props';
3
+ export * from './types';
@@ -0,0 +1,4 @@
1
+ export enum CardCollectionView {
2
+ Grid = 'grid',
3
+ List = 'list',
4
+ }
@@ -0,0 +1,53 @@
1
+ import { CardCollectionView } from './props';
2
+
3
+ export const CardCollectionRoot: string[] = [
4
+ // Layout
5
+ 'flex flex-col',
6
+
7
+ // Spacing
8
+ 'gap-md',
9
+ ];
10
+
11
+ export const CardCollectionToolbar: string[] = [
12
+ // Layout
13
+ 'flex',
14
+ 'justify-between',
15
+ 'items-center',
16
+
17
+ // Typography
18
+ 'typography-body-2-regular',
19
+
20
+ // Theme
21
+ 'theme-foreground-default',
22
+ 'dark:theme-foreground-default-dark',
23
+ ];
24
+
25
+ export const CardCollectionToolbarPanel: string[] = [
26
+ // Layout
27
+ 'flex',
28
+ 'justify-normal',
29
+ 'items-center',
30
+
31
+ // Spacing
32
+ 'gap-sm',
33
+ ];
34
+
35
+ export const CardCollectionContent: string[] = [
36
+ // Layout
37
+ 'grid',
38
+
39
+ // Spacing
40
+ 'gap-sm md:gap-md',
41
+ ];
42
+
43
+ export const CardCollectionContentViews: Record<CardCollectionView, string[]> = {
44
+ 'grid': [
45
+ // Layout
46
+ 'sm:grid-cols-1',
47
+ 'md:grid-cols-2',
48
+ 'lg:grid-cols-4',
49
+ 'xl:grid-cols-6',
50
+ ],
51
+
52
+ 'list': [],
53
+ };
@@ -0,0 +1,8 @@
1
+ export interface CardCollectionItem {
2
+ id: string;
3
+ }
4
+
5
+ export interface CardCollectionSortHeader {
6
+ value: string;
7
+ label: string;
8
+ }
@@ -27,7 +27,7 @@ export default {
27
27
  },
28
28
 
29
29
  value: { // TODO: Remove Vue 2 fallback
30
- control: { type: 'object' },
30
+ table: { disable: true },
31
31
  },
32
32
 
33
33
  inputValue: { // TODO: Rename to `value` after complete migration to Vue 3
@@ -41,16 +41,18 @@
41
41
  </div>
42
42
 
43
43
  <template v-if="!invalid">
44
- <OrHint>
45
- {{ hint }}
46
-
47
- <template
48
- v-if="maxLength"
49
- v-slot:addon
50
- >
51
- {{ currentLength }} / {{ maxLength }}
52
- </template>
53
- </OrHint>
44
+ <template v-if="hint || maxLength">
45
+ <OrHint>
46
+ {{ hint }}
47
+
48
+ <template
49
+ v-if="maxLength"
50
+ v-slot:addon
51
+ >
52
+ {{ currentLength }} / {{ maxLength }}
53
+ </template>
54
+ </OrHint>
55
+ </template>
54
56
  </template>
55
57
 
56
58
  <template v-else>
@@ -217,7 +219,7 @@ export default defineComponent({
217
219
 
218
220
  function reset(): void {
219
221
  if (draftModelValue.value !== proxyModelValue.value) {
220
- draftModelValue.value = proxyModelValue.value;
222
+ draftModelValue.value = proxyModelValue.value ?? '';
221
223
  }
222
224
 
223
225
  activated.value = false;
@@ -225,7 +227,7 @@ export default defineComponent({
225
227
 
226
228
  // Effects
227
229
  watch(proxyModelValue, (value) => {
228
- draftModelValue.value = value;
230
+ draftModelValue.value = value ?? '';
229
231
  }, { immediate: true });
230
232
 
231
233
  return {
@@ -40,16 +40,18 @@
40
40
  </div>
41
41
 
42
42
  <template v-if="!invalid">
43
- <OrHint>
44
- {{ hint }}
45
-
46
- <template
47
- v-if="maxLength"
48
- v-slot:addon
49
- >
50
- {{ currentLength }} / {{ maxLength }}
51
- </template>
52
- </OrHint>
43
+ <template v-if="hint || maxLength">
44
+ <OrHint>
45
+ {{ hint }}
46
+
47
+ <template
48
+ v-if="maxLength"
49
+ v-slot:addon
50
+ >
51
+ {{ currentLength }} / {{ maxLength }}
52
+ </template>
53
+ </OrHint>
54
+ </template>
53
55
  </template>
54
56
 
55
57
  <template v-else>
@@ -205,7 +207,7 @@ export default defineComponent({
205
207
 
206
208
  function reset(): void {
207
209
  if (draftModelValue.value !== proxyModelValue.value) {
208
- draftModelValue.value = proxyModelValue.value;
210
+ draftModelValue.value = proxyModelValue.value ?? '';
209
211
  }
210
212
 
211
213
  activated.value = false;
@@ -213,7 +215,7 @@ export default defineComponent({
213
215
 
214
216
  // Effects
215
217
  watch(proxyModelValue, (value) => {
216
- draftModelValue.value = value;
218
+ draftModelValue.value = value ?? '';
217
219
  }, { immediate: true });
218
220
 
219
221
  return {
@@ -41,45 +41,49 @@
41
41
  @blur="$emit('blur', $event)"
42
42
  >
43
43
 
44
- <template v-if="type === 'password'">
45
- <OrIconButton
46
- :icon="{ icon: disclosed ? 'visibility_off' : 'visibility', variant: 'filled' }"
47
- :color="'inherit'"
48
- :disabled="disabled"
49
- @click.stop="disclosed = !disclosed"
50
- />
51
- </template>
52
-
53
- <template v-if="type === 'search'">
54
- <template v-if="modelValue">
44
+ <div :class="['-m-xs', 'ml-none']">
45
+ <template v-if="type === 'password'">
55
46
  <OrIconButton
56
- :icon="'close'"
47
+ :icon="{ icon: disclosed ? 'visibility_off' : 'visibility', variant: 'filled' }"
57
48
  :color="'inherit'"
58
49
  :disabled="disabled"
59
- @click.stop="$emit('update:modelValue', '')"
50
+ @click.stop="disclosed = !disclosed"
60
51
  />
61
52
  </template>
62
53
 
63
- <template v-else>
64
- <OrIcon
65
- :icon="'search'"
66
- :variant="'outlined'"
67
- />
54
+ <template v-if="type === 'search'">
55
+ <template v-if="modelValue">
56
+ <OrIconButton
57
+ :icon="'close'"
58
+ :color="'inherit'"
59
+ :disabled="disabled"
60
+ @click.stop="$emit('update:modelValue', '')"
61
+ />
62
+ </template>
63
+
64
+ <template v-else>
65
+ <OrIcon
66
+ :icon="'search'"
67
+ :variant="'outlined'"
68
+ />
69
+ </template>
68
70
  </template>
69
- </template>
71
+ </div>
70
72
  </OrInputBox>
71
73
 
72
74
  <template v-if="!invalid">
73
- <OrHint :disabled="disabled">
74
- {{ hint }}
75
-
76
- <template
77
- v-if="maxLength"
78
- v-slot:addon
79
- >
80
- {{ currentLength }} / {{ maxLength }}
81
- </template>
82
- </OrHint>
75
+ <template v-if="hint || maxLength">
76
+ <OrHint :disabled="disabled">
77
+ {{ hint }}
78
+
79
+ <template
80
+ v-if="maxLength"
81
+ v-slot:addon
82
+ >
83
+ {{ currentLength }} / {{ maxLength }}
84
+ </template>
85
+ </OrHint>
86
+ </template>
83
87
  </template>
84
88
 
85
89
  <template v-else>
@@ -27,7 +27,7 @@ export default {
27
27
  },
28
28
 
29
29
  value: { // TODO: Remove Vue 2 fallback
30
- control: { type: 'object' },
30
+ table: { disable: true },
31
31
  },
32
32
 
33
33
  inputValue: { // TODO: Rename to `value` after complete migration to Vue 3
@@ -0,0 +1,7 @@
1
+ import { DocsPage } from '@storybook/addon-docs';
2
+
3
+ ```ts
4
+ import { OrSegmentedControlV3 as OrSegmentedControl } from '@onereach/ui-components';
5
+ ```
6
+
7
+ <DocsPage />