@onereach/ui-components 2.70.0-beta.2131.0 → 2.70.0-beta.2159.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 (228) hide show
  1. package/dist/bundled/v2/{OrAvatar-2fa559e1.js → OrAvatar-ae61bfb9.js} +41 -15
  2. package/dist/bundled/v2/{OrButton-0e91a808.js → OrButton-4b99c680.js} +5 -1
  3. package/dist/bundled/v2/{OrCard-58a1ba3e.js → OrCard-29116e1f.js} +2 -2
  4. package/dist/bundled/v2/OrCardCollection-c4209a92.js +350 -0
  5. package/dist/bundled/v2/OrCode-be1bd373.js +4255 -0
  6. package/dist/bundled/v2/{OrConfirm-18c534df.js → OrConfirm-cab6535b.js} +1 -1
  7. package/dist/bundled/v2/OrEmptyState-9fb413f9.js +160 -0
  8. package/dist/bundled/v2/{OrRichTextEditor-63ef1357.js → OrRichTextEditor-5843ecda.js} +13803 -20711
  9. package/dist/bundled/v2/{OrSearch-9d402f56.js → OrSearch-76b002cf.js} +10 -4
  10. package/dist/bundled/v2/{OrSortHeader-396e6a7c.js → OrSortHeader-9932d28f.js} +2 -2
  11. package/dist/bundled/v2/codemirrorView-14f6685c.js +7136 -0
  12. package/dist/bundled/v2/components/index.d.ts +1 -0
  13. package/dist/bundled/v2/components/index.js +13 -10
  14. package/dist/bundled/v2/components/or-avatar-v3/OrAvatar.stories3.d.ts +1 -1
  15. package/dist/bundled/v2/components/or-avatar-v3/OrAvatar.vue.d.ts +11 -0
  16. package/dist/bundled/v2/components/or-avatar-v3/index.js +2 -1
  17. package/dist/bundled/v2/components/or-avatar-v3/props.d.ts +2 -1
  18. package/dist/bundled/v2/components/or-avatar-v3/styles.d.ts +2 -0
  19. package/dist/bundled/v2/components/or-button-v3/index.js +1 -1
  20. package/dist/bundled/v2/components/or-card-collection-v3/OrCardCollection.stories3.d.ts +10 -0
  21. package/dist/bundled/v2/components/or-card-collection-v3/OrCardCollection.vue.d.ts +87 -40
  22. package/dist/bundled/v2/components/or-card-collection-v3/OrCardCollectionView.vue2.vue.d.ts +35 -0
  23. package/dist/bundled/v2/components/or-card-collection-v3/index.js +7 -4
  24. package/dist/bundled/v2/components/or-card-collection-v3/props.d.ts +5 -1
  25. package/dist/bundled/v2/components/or-card-collection-v3/styles.d.ts +2 -2
  26. package/dist/bundled/v2/components/or-card-collection-v3/types.d.ts +8 -3
  27. package/dist/bundled/v2/components/or-card-v3/index.js +1 -1
  28. package/dist/bundled/v2/components/or-code/index.js +3 -2
  29. package/dist/bundled/v2/components/or-confirm-v3/index.js +2 -2
  30. package/dist/bundled/v2/components/or-empty-state-v3/OrEmptyState.vue.d.ts +1 -1
  31. package/dist/bundled/v2/components/or-empty-state-v3/index.js +3 -159
  32. package/dist/bundled/v2/components/or-input-box-v3/OrInputBox.vue.d.ts +1 -2
  33. package/dist/bundled/v2/components/or-rich-text-editor-v3/index.js +4 -2
  34. package/dist/bundled/v2/components/or-rich-text-editor-v3/utils/codemirror/codemirrorNode.d.ts +3 -0
  35. package/dist/bundled/v2/components/or-rich-text-editor-v3/utils/codemirror/codemirrorView.d.ts +45 -0
  36. package/dist/bundled/v2/components/or-rich-text-editor-v3/utils/codemirror/index.d.ts +1 -0
  37. package/dist/bundled/v2/components/or-rich-text-editor-v3/utils/codemirror/index.js +2 -0
  38. package/dist/bundled/v2/components/or-rich-text-editor-v3/utils/codemirror/types.d.ts +19 -0
  39. package/dist/bundled/v2/components/or-search-v3/OrSearch.vue.d.ts +15 -2
  40. package/dist/bundled/v2/components/or-search-v3/index.js +1 -1
  41. package/dist/bundled/v2/components/or-sort-header-v3/index.js +1 -1
  42. package/dist/bundled/v2/index-46cc379c.js +12186 -0
  43. package/dist/bundled/v2/index-780d00b0.js +13307 -0
  44. package/dist/bundled/v2/index.js +14 -11
  45. package/dist/bundled/v3/{OrAvatar.vue_vue_type_script_lang-22e46ce1.js → OrAvatar.vue_vue_type_script_lang-0426862b.js} +35 -13
  46. package/dist/bundled/v3/OrButton-a671b8a1.js +33 -0
  47. package/dist/bundled/v3/{OrButton.vue_vue_type_script_lang-3718b300.js → OrButton.vue_vue_type_script_lang-b0dc31ca.js} +5 -1
  48. package/dist/bundled/v3/OrCardCollection.vue_vue_type_script_lang-9a2ae9a3.js +236 -0
  49. package/dist/bundled/v3/OrCode.vue_vue_type_script_lang-0f668150.js +4133 -0
  50. package/dist/bundled/v3/{OrConfirm.vue_vue_type_script_lang-289b5600.js → OrConfirm.vue_vue_type_script_lang-f57ffa1a.js} +6 -36
  51. package/dist/bundled/v3/OrEmptyState.vue_vue_type_script_lang-da7d6c42.js +111 -0
  52. package/dist/bundled/v3/{OrIconButton-4bd33e3c.js → OrIconButton-1581013c.js} +1 -1
  53. package/dist/bundled/v3/{OrIconButton.vue_vue_type_script_lang-641f6e06.js → OrIconButton.vue_vue_type_script_lang-f6f801ff.js} +1 -1
  54. package/dist/bundled/v3/{OrInlineInput.vue_vue_type_script_lang-3a8189f4.js → OrInlineInput.vue_vue_type_script_lang-f29483f4.js} +2 -2
  55. package/dist/bundled/v3/{OrInlineTextarea.vue_vue_type_script_lang-890b97ab.js → OrInlineTextarea.vue_vue_type_script_lang-cc40af48.js} +2 -2
  56. package/dist/bundled/v3/OrInput.vue_vue_type_script_lang-f6d793d3.js +2 -2
  57. package/dist/bundled/v3/{OrModal.vue_vue_type_script_lang-00a477f0.js → OrModal.vue_vue_type_script_lang-80a7b906.js} +2 -2
  58. package/dist/bundled/v3/OrNotification.vue_vue_type_script_lang-fbb35355.js +2 -2
  59. package/dist/bundled/v3/{OrRichTextEditor.vue_vue_type_script_lang-47fffbd6.js → OrRichTextEditor.vue_vue_type_script_lang-e0dfd695.js} +13803 -20711
  60. package/dist/bundled/v3/{OrSearch.vue_vue_type_script_lang-ed78b21f.js → OrSearch.vue_vue_type_script_lang-014ad470.js} +9 -3
  61. package/dist/bundled/v3/OrSelect.vue_vue_type_script_lang-15285ce4.js +1 -1
  62. package/dist/bundled/v3/{OrTag.vue_vue_type_script_lang-92d9fb12.js → OrTag.vue_vue_type_script_lang-dc6a4011.js} +2 -2
  63. package/dist/bundled/v3/{OrToastContainer-afb51e5d.js → OrToastContainer-7c3c0b12.js} +1 -1
  64. package/dist/bundled/v3/codemirrorView-14f6685c.js +7136 -0
  65. package/dist/bundled/v3/components/index.d.ts +1 -0
  66. package/dist/bundled/v3/components/index.js +23 -19
  67. package/dist/bundled/v3/components/or-avatar-v3/OrAvatar.stories3.d.ts +1 -1
  68. package/dist/bundled/v3/components/or-avatar-v3/OrAvatar.vue.d.ts +11 -0
  69. package/dist/bundled/v3/components/or-avatar-v3/index.js +3 -1
  70. package/dist/bundled/v3/components/or-avatar-v3/props.d.ts +2 -1
  71. package/dist/bundled/v3/components/or-avatar-v3/styles.d.ts +2 -0
  72. package/dist/bundled/v3/components/or-button-v3/index.js +1 -1
  73. package/dist/bundled/v3/components/or-card-collection-v3/OrCardCollection.stories3.d.ts +10 -0
  74. package/dist/bundled/v3/components/or-card-collection-v3/OrCardCollection.vue.d.ts +87 -40
  75. package/dist/bundled/v3/components/or-card-collection-v3/OrCardCollectionView.vue3.vue.d.ts +35 -0
  76. package/dist/bundled/v3/components/or-card-collection-v3/index.js +13 -6
  77. package/dist/bundled/v3/components/or-card-collection-v3/props.d.ts +5 -1
  78. package/dist/bundled/v3/components/or-card-collection-v3/styles.d.ts +2 -2
  79. package/dist/bundled/v3/components/or-card-collection-v3/types.d.ts +8 -3
  80. package/dist/bundled/v3/components/or-code/index.js +3 -2
  81. package/dist/bundled/v3/components/or-confirm-v3/index.js +5 -4
  82. package/dist/bundled/v3/components/or-empty-state-v3/OrEmptyState.vue.d.ts +1 -1
  83. package/dist/bundled/v3/components/or-empty-state-v3/index.js +2 -134
  84. package/dist/bundled/v3/components/or-icon-button-v3/index.js +1 -1
  85. package/dist/bundled/v3/components/or-inline-input-v3/index.js +3 -3
  86. package/dist/bundled/v3/components/or-inline-textarea-v3/index.js +3 -3
  87. package/dist/bundled/v3/components/or-input-box-v3/OrInputBox.vue.d.ts +1 -2
  88. package/dist/bundled/v3/components/or-input-v3/index.js +2 -2
  89. package/dist/bundled/v3/components/or-modal-v3/index.js +3 -3
  90. package/dist/bundled/v3/components/or-notification-v3/index.js +2 -2
  91. package/dist/bundled/v3/components/or-rich-text-editor-v3/index.js +6 -4
  92. package/dist/bundled/v3/components/or-rich-text-editor-v3/utils/codemirror/codemirrorNode.d.ts +3 -0
  93. package/dist/bundled/v3/components/or-rich-text-editor-v3/utils/codemirror/codemirrorView.d.ts +45 -0
  94. package/dist/bundled/v3/components/or-rich-text-editor-v3/utils/codemirror/index.d.ts +1 -0
  95. package/dist/bundled/v3/components/or-rich-text-editor-v3/utils/codemirror/index.js +2 -0
  96. package/dist/bundled/v3/components/or-rich-text-editor-v3/utils/codemirror/types.d.ts +19 -0
  97. package/dist/bundled/v3/components/or-search-v3/OrSearch.vue.d.ts +15 -2
  98. package/dist/bundled/v3/components/or-search-v3/index.js +3 -3
  99. package/dist/bundled/v3/components/or-select-v3/index.js +3 -3
  100. package/dist/bundled/v3/components/or-tag-v3/index.js +3 -3
  101. package/dist/bundled/v3/components/or-toast-v3/index.js +4 -4
  102. package/dist/bundled/v3/index-44faad6a.js +12186 -0
  103. package/dist/bundled/v3/index-780d00b0.js +13307 -0
  104. package/dist/bundled/v3/index.js +415 -351
  105. package/dist/bundled/v3/{types-6c5eee23.js → types-dcc78caa.js} +2 -2
  106. package/dist/esm/v2/{OrAvatar-0afdef36.js → OrAvatar-3d155af3.js} +41 -15
  107. package/dist/esm/v2/{OrButton-357a5756.js → OrButton-357e1e2c.js} +5 -1
  108. package/dist/esm/v2/OrCardCollection-57d11adf.js +350 -0
  109. package/dist/esm/v2/{OrCode-41dd5f9b.js → OrCode-d4400b42.js} +6 -4
  110. package/dist/esm/v2/{OrConfirm-b0b2e43c.js → OrConfirm-ec7aef0e.js} +1 -1
  111. package/dist/esm/v2/OrEmptyState-2481f13f.js +158 -0
  112. package/dist/esm/v2/{OrRichTextEditor-c3dee275.js → OrRichTextEditor-2d152db0.js} +59 -11
  113. package/dist/esm/v2/{OrSearch-ddb7c1fe.js → OrSearch-2f260b09.js} +8 -2
  114. package/dist/esm/v2/codemirrorView-8ea431d2.js +184 -0
  115. package/dist/esm/v2/components/index.d.ts +1 -0
  116. package/dist/esm/v2/components/index.js +13 -7
  117. package/dist/esm/v2/components/or-avatar-v3/OrAvatar.stories3.d.ts +1 -1
  118. package/dist/esm/v2/components/or-avatar-v3/OrAvatar.vue.d.ts +11 -0
  119. package/dist/esm/v2/components/or-avatar-v3/index.js +2 -1
  120. package/dist/esm/v2/components/or-avatar-v3/props.d.ts +2 -1
  121. package/dist/esm/v2/components/or-avatar-v3/styles.d.ts +2 -0
  122. package/dist/esm/v2/components/or-button-v3/index.js +1 -1
  123. package/dist/esm/v2/components/or-card-collection-v3/OrCardCollection.stories3.d.ts +10 -0
  124. package/dist/esm/v2/components/or-card-collection-v3/OrCardCollection.vue.d.ts +87 -40
  125. package/dist/esm/v2/components/or-card-collection-v3/OrCardCollectionView.vue2.vue.d.ts +35 -0
  126. package/dist/esm/v2/components/or-card-collection-v3/index.js +7 -4
  127. package/dist/esm/v2/components/or-card-collection-v3/props.d.ts +5 -1
  128. package/dist/esm/v2/components/or-card-collection-v3/styles.d.ts +2 -2
  129. package/dist/esm/v2/components/or-card-collection-v3/types.d.ts +8 -3
  130. package/dist/esm/v2/components/or-code/index.js +3 -1
  131. package/dist/esm/v2/components/or-confirm-v3/index.js +2 -2
  132. package/dist/esm/v2/components/or-empty-state-v3/OrEmptyState.vue.d.ts +1 -1
  133. package/dist/esm/v2/components/or-empty-state-v3/index.js +3 -158
  134. package/dist/esm/v2/components/or-input-box-v3/OrInputBox.vue.d.ts +1 -2
  135. package/dist/esm/v2/components/or-rich-text-editor-v3/index.js +8 -1
  136. package/dist/esm/v2/components/or-rich-text-editor-v3/utils/codemirror/codemirrorNode.d.ts +3 -0
  137. package/dist/esm/v2/components/or-rich-text-editor-v3/utils/codemirror/codemirrorView.d.ts +45 -0
  138. package/dist/esm/v2/components/or-rich-text-editor-v3/utils/codemirror/index.d.ts +1 -0
  139. package/dist/esm/v2/components/or-rich-text-editor-v3/utils/codemirror/index.js +5 -0
  140. package/dist/esm/v2/components/or-rich-text-editor-v3/utils/codemirror/types.d.ts +19 -0
  141. package/dist/esm/v2/components/or-search-v3/OrSearch.vue.d.ts +15 -2
  142. package/dist/esm/v2/components/or-search-v3/index.js +1 -1
  143. package/dist/esm/v2/index.js +13 -7
  144. package/dist/esm/v3/{OrAvatar-ef88d31c.js → OrAvatar-53a4429d.js} +43 -16
  145. package/dist/esm/v3/{OrButton-f4b9ee51.js → OrButton-bb6bf8a9.js} +5 -1
  146. package/dist/esm/v3/OrCardCollection-2a6514f3.js +298 -0
  147. package/dist/esm/v3/{OrCode-ee19a5e6.js → OrCode-5ed69c23.js} +3 -1
  148. package/dist/esm/v3/{OrConfirm-906427ef.js → OrConfirm-5d56cbd3.js} +1 -1
  149. package/dist/esm/v3/OrEmptyState-bb8e3145.js +135 -0
  150. package/dist/esm/v3/OrInput-41691fb3.js +1 -1
  151. package/dist/esm/v3/{OrInputBox-5247ab25.js → OrInputBox-6d1b6059.js} +1 -1
  152. package/dist/esm/v3/{OrRichTextEditor-b2e87342.js → OrRichTextEditor-f1271eb6.js} +58 -10
  153. package/dist/esm/v3/{OrSearch-cdde55ce.js → OrSearch-e5a2e93e.js} +9 -3
  154. package/dist/esm/v3/OrSelect-7e813982.js +1 -1
  155. package/dist/esm/v3/OrTextarea-bb9ef3f2.js +1 -1
  156. package/dist/esm/v3/codemirrorView-8ea431d2.js +184 -0
  157. package/dist/esm/v3/components/index.d.ts +1 -0
  158. package/dist/esm/v3/components/index.js +14 -8
  159. package/dist/esm/v3/components/or-avatar-v3/OrAvatar.stories3.d.ts +1 -1
  160. package/dist/esm/v3/components/or-avatar-v3/OrAvatar.vue.d.ts +11 -0
  161. package/dist/esm/v3/components/or-avatar-v3/index.js +2 -1
  162. package/dist/esm/v3/components/or-avatar-v3/props.d.ts +2 -1
  163. package/dist/esm/v3/components/or-avatar-v3/styles.d.ts +2 -0
  164. package/dist/esm/v3/components/or-button-v3/index.js +1 -1
  165. package/dist/esm/v3/components/or-card-collection-v3/OrCardCollection.stories3.d.ts +10 -0
  166. package/dist/esm/v3/components/or-card-collection-v3/OrCardCollection.vue.d.ts +87 -40
  167. package/dist/esm/v3/components/or-card-collection-v3/OrCardCollectionView.vue3.vue.d.ts +35 -0
  168. package/dist/esm/v3/components/or-card-collection-v3/index.js +8 -5
  169. package/dist/esm/v3/components/or-card-collection-v3/props.d.ts +5 -1
  170. package/dist/esm/v3/components/or-card-collection-v3/styles.d.ts +2 -2
  171. package/dist/esm/v3/components/or-card-collection-v3/types.d.ts +8 -3
  172. package/dist/esm/v3/components/or-code/index.js +3 -1
  173. package/dist/esm/v3/components/or-confirm-v3/index.js +3 -3
  174. package/dist/esm/v3/components/or-empty-state-v3/OrEmptyState.vue.d.ts +1 -1
  175. package/dist/esm/v3/components/or-empty-state-v3/index.js +3 -135
  176. package/dist/esm/v3/components/or-input-box-v3/OrInputBox.vue.d.ts +1 -2
  177. package/dist/esm/v3/components/or-input-box-v3/index.js +2 -2
  178. package/dist/esm/v3/components/or-input-v3/index.js +1 -1
  179. package/dist/esm/v3/components/or-rich-text-editor-v3/index.js +8 -1
  180. package/dist/esm/v3/components/or-rich-text-editor-v3/utils/codemirror/codemirrorNode.d.ts +3 -0
  181. package/dist/esm/v3/components/or-rich-text-editor-v3/utils/codemirror/codemirrorView.d.ts +45 -0
  182. package/dist/esm/v3/components/or-rich-text-editor-v3/utils/codemirror/index.d.ts +1 -0
  183. package/dist/esm/v3/components/or-rich-text-editor-v3/utils/codemirror/index.js +5 -0
  184. package/dist/esm/v3/components/or-rich-text-editor-v3/utils/codemirror/types.d.ts +19 -0
  185. package/dist/esm/v3/components/or-search-v3/OrSearch.vue.d.ts +15 -2
  186. package/dist/esm/v3/components/or-search-v3/index.js +2 -2
  187. package/dist/esm/v3/components/or-select-v3/index.js +1 -1
  188. package/dist/esm/v3/components/or-textarea-v3/index.js +1 -1
  189. package/dist/esm/v3/index.js +14 -8
  190. package/package.json +2 -1
  191. package/src/components/index.ts +1 -0
  192. package/src/components/or-avatar-v3/OrAvatar.stories3.ts +9 -7
  193. package/src/components/or-avatar-v3/OrAvatar.vue +22 -2
  194. package/src/components/or-avatar-v3/props.ts +1 -0
  195. package/src/components/or-avatar-v3/styles.ts +49 -11
  196. package/src/components/or-button-v3/styles.ts +6 -0
  197. package/src/components/or-card/OrCard.stories.ts +1 -1
  198. package/src/components/or-card-collection/OrCardCollection.stories.ts +1 -1
  199. package/src/components/or-card-collection-v3/OrCardCollection.docs.mdx +4 -0
  200. package/src/components/or-card-collection-v3/OrCardCollection.stories3.ts +246 -30
  201. package/src/components/or-card-collection-v3/OrCardCollection.vue +132 -77
  202. package/src/components/or-card-collection-v3/OrCardCollectionView.vue2.vue +41 -0
  203. package/src/components/or-card-collection-v3/OrCardCollectionView.vue3.vue +42 -0
  204. package/src/components/or-card-collection-v3/props.ts +14 -1
  205. package/src/components/or-card-collection-v3/styles.ts +6 -4
  206. package/src/components/or-card-collection-v3/types.ts +9 -3
  207. package/src/components/or-code/OrCode.vue +3 -1
  208. package/src/components/or-empty-state-v3/OrEmptyState.vue +16 -10
  209. package/src/components/or-input-box-v3/OrInputBox.vue +1 -2
  210. package/src/components/or-menu-v3/OrMenu.stories3.ts +1 -1
  211. package/src/components/or-rich-text-editor-v3/OrRichTextEditor.stories3.ts +2 -0
  212. package/src/components/or-rich-text-editor-v3/OrRichTextEditor.vue +32 -6
  213. package/src/components/or-rich-text-editor-v3/utils/codemirror/codemirrorNode.ts +40 -0
  214. package/src/components/or-rich-text-editor-v3/utils/codemirror/codemirrorView.ts +257 -0
  215. package/src/components/or-rich-text-editor-v3/utils/codemirror/index.ts +1 -0
  216. package/src/components/or-rich-text-editor-v3/utils/codemirror/types.ts +22 -0
  217. package/src/components/or-rich-text-editor-v3/utils/markdown.ts +2 -0
  218. package/src/components/or-search-v3/OrSearch.stories3.ts +1 -1
  219. package/src/components/or-search-v3/OrSearch.vue +8 -2
  220. package/src/components/or-teleport-v3/OrTeleport.stories3.ts +1 -1
  221. package/dist/bundled/v2/OrCardCollection-a9a779ea.js +0 -228
  222. package/dist/bundled/v2/OrCode-0cd991a1.js +0 -29579
  223. package/dist/bundled/v2/index.es-3f39f316.js +0 -115
  224. package/dist/bundled/v3/OrCardCollection.vue_vue_type_script_lang-3993a015.js +0 -164
  225. package/dist/bundled/v3/OrCode.vue_vue_type_script_lang-6c5f94a6.js +0 -29457
  226. package/dist/bundled/v3/index.es-3f39f316.js +0 -115
  227. package/dist/esm/v2/OrCardCollection-4f001551.js +0 -227
  228. package/dist/esm/v3/OrCardCollection-5a0febaf.js +0 -198
@@ -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
 
@@ -52,6 +53,14 @@ export default {
52
53
  control: { type: 'text' },
53
54
  },
54
55
 
56
+ searchPlaceholder: {
57
+ control: { type: 'text' },
58
+ },
59
+
60
+ searchDebounce: {
61
+ control: { type: 'number' },
62
+ },
63
+
55
64
  // Events
56
65
  viewChange: {
57
66
  table: { disable: true },
@@ -70,35 +79,48 @@ export default {
70
79
  docs: {
71
80
  page: OrCardCollectionDocs,
72
81
  },
82
+ layout: 'fullscreen',
73
83
  },
74
84
  } as Meta<typeof OrCardCollection>;
75
85
 
76
86
  const Template: StoryFn<typeof OrCardCollection> = (args) => ({
77
87
  components: {
78
88
  OrCardCollection,
89
+ OrCard,
79
90
  OrIcon,
80
91
  },
81
92
 
82
93
  setup() {
94
+ const sort = ref(args.sort);
95
+ const onSortChange = (newSort: string) => {
96
+ sort.value = newSort;
97
+ action('searchChange')(newSort);
98
+ };
99
+
83
100
  return {
84
101
  args,
102
+ sort,
103
+ onSortChange,
85
104
  onViewChange: action('viewChange'),
86
- onSortChange: action('sortChange'),
87
105
  onSearchChange: action('searchChange'),
88
106
  };
89
107
  },
90
108
 
91
109
  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>
110
+ <div class="p-md bg-surface-1 dark:bg-surface-1-dark">
111
+ <OrCardCollection
112
+ v-bind="args"
113
+ :sort="sort"
114
+ @viewChange="onViewChange"
115
+ @sortChange="onSortChange"
116
+ @searchChange="onSearchChange"
117
+ >
118
+ <template #item="{item, mode}">
119
+ <OrCard>${args.item} ({{mode}})</OrCard>
120
+ </template>
121
+ <template #addon>${args.addon}</template>
122
+ </OrCardCollection>
123
+ </div>
102
124
  `,
103
125
  });
104
126
 
@@ -106,8 +128,7 @@ export const Default = Template.bind({});
106
128
 
107
129
  Default.args = {
108
130
  // Slots
109
- gridItem: '{{ item.label }} (grid)',
110
- listItem: '{{ item.label }} (list)',
131
+ item: '{{ item.label }}',
111
132
  addon: '<OrIcon icon="info" />',
112
133
 
113
134
  // Props
@@ -139,7 +160,7 @@ Default.args = {
139
160
  'Yankee',
140
161
  'Zulu',
141
162
  ], (item) => ({
142
- id: item.toLowerCase(),
163
+ key: item.toLowerCase(),
143
164
  label: item,
144
165
  })),
145
166
  };
@@ -150,13 +171,208 @@ WithSorting.args = {
150
171
  ...Default.args,
151
172
 
152
173
  // 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
- })),
174
+ sort: 'bar',
175
+ sortOptions: [
176
+ {
177
+ label: 'Foo',
178
+ value: 'foo',
179
+ },
180
+ {
181
+ label: 'Bar',
182
+ value: 'bar',
183
+ },
184
+ {
185
+ label: 'Baz',
186
+ value: 'baz',
187
+ },
188
+ {
189
+ label: 'Qux',
190
+ value: 'qux',
191
+ },
192
+ ],
193
+ };
194
+
195
+
196
+ export const OverrideViewContainer: StoryFn<typeof OrCardCollection> = (args) => ({
197
+ components: {
198
+ OrCardCollection,
199
+ OrCard,
200
+ },
201
+
202
+ setup() {
203
+ return {
204
+ args,
205
+ onViewChange: action('viewChange'),
206
+ onSortChange: action('sortChange'),
207
+ onSearchChange: action('searchChange'),
208
+ };
209
+ },
210
+
211
+ template: `
212
+ <div class="p-md bg-surface-1 dark:bg-surface-1-dark">
213
+ <OrCardCollection
214
+ v-bind="args"
215
+ @viewChange="onViewChange"
216
+ @sortChange="onSortChange"
217
+ @searchChange="onSearchChange"
218
+ >
219
+ <template #header="{mode}">
220
+ ${args.header}
221
+ </template>
222
+ <template #grid="{items}">
223
+ <div class="grid grid-cols-3">
224
+ <OrCard
225
+ v-for="item in items"
226
+ :key="item.key"
227
+ >
228
+ {{ item.label }}
229
+ </OrCard>
230
+ </div>
231
+ </template>
232
+ <template #list="{items}">
233
+ <ul>
234
+ <li
235
+ v-for="item in items"
236
+ :key="item.key"
237
+ >
238
+ - {{ item.label }}
239
+ </li>
240
+ </ul>
241
+ </template>
242
+ </OrCardCollection>
243
+ </div>
244
+ `,
245
+ });
246
+
247
+ OverrideViewContainer.args = {
248
+ ...Default.args,
249
+ header: '<div class="typography-headline-3">Custom {{ mode }}</div>',
250
+ };
251
+
252
+ export const ExtraViewMode: StoryFn<typeof OrCardCollection> = (args) => ({
253
+ components: {
254
+ OrCardCollection,
255
+ OrCard,
256
+ },
257
+
258
+ setup() {
259
+ return {
260
+ args,
261
+ defaultViewModes,
262
+ onViewChange: action('viewChange'),
263
+ onSearchChange: action('searchChange'),
264
+ };
265
+ },
266
+
267
+ template: `
268
+ <div class="p-md bg-surface-1 dark:bg-surface-1-dark">
269
+ <OrCardCollection
270
+ v-bind="args"
271
+ :view-modes="[...defaultViewModes, {view: 'mymode', icon: 'timeline'}]"
272
+ @viewChange="onViewChange"
273
+ @searchChange="onSearchChange"
274
+ >
275
+ <template #item="{item, mode}">
276
+ <OrCard>${args.item} ({{mode}})</OrCard>
277
+ </template>
278
+ <template #mymode="{items}">
279
+ <div class="typography-headline-3">My view mode</div>
280
+ <div class="grid grid-cols-3">
281
+ <OrCard
282
+ v-for="item in items"
283
+ :key="item.key"
284
+ >
285
+ {{ item.label }} (timeline)
286
+ </OrCard>
287
+ </div>
288
+ </template>
289
+ </OrCardCollection>
290
+ </div>
291
+ `,
292
+ });
293
+
294
+ ExtraViewMode.args = {
295
+ ...Default.args,
296
+ };
297
+
298
+ export const WithLink: StoryFn<typeof OrCardCollection> = (args) => ({
299
+ components: {
300
+ OrCardCollection,
301
+ OrCard,
302
+ OrIcon,
303
+ },
304
+
305
+ setup() {
306
+ return {
307
+ args,
308
+ onViewChange: action('viewChange'),
309
+ onSortChange: action('sortChange'),
310
+ onSearchChange: action('searchChange'),
311
+ };
312
+ },
313
+
314
+ template: `
315
+ <div class="p-md bg-surface-1 dark:bg-surface-1-dark">
316
+ <OrCardCollection
317
+ v-bind="args"
318
+ @viewChange="onViewChange"
319
+ @sortChange="onSortChange"
320
+ @searchChange="onSearchChange"
321
+ >
322
+ <template #item="{item}">
323
+ <a href="#" @click.prevent><OrCard>${args.item}</OrCard></a>
324
+ </template>
325
+ </OrCardCollection>
326
+ </div>
327
+ `,
328
+ });
329
+
330
+ WithLink.args = {
331
+ ...Default.args,
332
+ };
333
+
334
+ export const EmptySearchResults: StoryFn<typeof OrCardCollection> = (args) => ({
335
+ components: {
336
+ OrCardCollection,
337
+ OrCard,
338
+ OrIcon,
339
+ },
340
+
341
+ setup() {
342
+ return {
343
+ args,
344
+ onViewChange: action('viewChange'),
345
+ onSortChange: action('sortChange'),
346
+ onSearchChange: action('searchChange'),
347
+ };
348
+ },
349
+
350
+ template: `
351
+ <div class="p-md h-screen bg-surface-1 dark:bg-surface-1-dark">
352
+ <OrCardCollection
353
+ v-bind="args"
354
+ @viewChange="onViewChange"
355
+ @sortChange="onSortChange"
356
+ @searchChange="onSearchChange"
357
+ >
358
+ <template #noSearchResults="{search}">
359
+ <p class="text-center typography-headline-3">No results for "{{search}}"</p>
360
+ </template>
361
+ </OrCardCollection>
362
+ </div>
363
+ `,
364
+ });
365
+
366
+ EmptySearchResults.args = {
367
+ ...Default.args,
368
+ search: 'My favorite ..',
369
+ items: [],
370
+ };
371
+
372
+ export const CustomizeSearch = Template.bind({});
373
+
374
+ CustomizeSearch.args = {
375
+ ...Default.args,
376
+ searchPlaceholder: 'What you want to find today?',
377
+ searchDebounce: 0,
162
378
  };
@@ -6,87 +6,120 @@
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
+ {{ sortLabel }}
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.value)"
30
+ >
31
+ {{ sortItem.label }}
32
+ </OrMenuItem>
33
+ </OrMenu>
18
34
  </template>
19
35
  </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()"
36
+ <div
37
+ :class="toolbarPanelStyles"
38
+ >
39
+ <OrSearch
40
+ :model-value="proxySearch"
41
+ class="md:w-[350px]"
42
+ :placeholder="searchPlaceholder"
43
+ :debounce="searchDebounce"
44
+ size="s"
45
+ @search="handleSearch"
37
46
  />
38
-
39
- <slot name="addon" />
47
+ <div class="layout-row gap-sm">
48
+ <template v-if="viewModes.length > 1">
49
+ <OrIconButton
50
+ v-for="viewOption in viewModes"
51
+ :key="viewOption.view"
52
+ :icon="{icon: viewOption.icon, variant: viewOption.view === proxyView ? 'filled' : 'outlined'}"
53
+ @click="switchView(viewOption.view)"
54
+ />
55
+ </template>
56
+ <slot name="addon" />
57
+ </div>
40
58
  </div>
41
59
  </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
- >
60
+ <slot
61
+ name="header"
62
+ v-bind="{
63
+ items,
64
+ mode: proxyView,
65
+ }"
66
+ />
67
+ <slot
68
+ v-if="items.length"
69
+ :name="proxyView"
70
+ v-bind="{items}"
71
+ >
72
+ <OrCardCollectionView
73
+ :items="items"
74
+ :mode="proxyView"
75
+ >
76
+ <template v-slot:item="props">
61
77
  <slot
62
- name="listItem"
63
- v-bind="item"
78
+ name="item"
79
+ v-bind="props"
64
80
  />
65
- </OrCard>
66
- </template>
67
- </div>
81
+ </template>
82
+ </OrCardCollectionView>
83
+ </slot>
84
+ <slot
85
+ v-else-if="items.length === 0 && proxySearch.length > 0"
86
+ name="noSearchResults"
87
+ v-bind="{search: proxySearch}"
88
+ >
89
+ No results
90
+ </slot>
68
91
  </div>
69
92
  </template>
70
93
 
71
94
  <script lang="ts">
72
95
  import { computed, defineComponent, PropType, ref, watch } from 'vue-demi';
73
96
  import { useClassAttribute } from '../../hooks';
74
- import { OrCardV3 as OrCard } from '../or-card-v3';
75
97
  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';
98
+ import { OrMenuV3 as OrMenu } from '../or-menu-v3';
99
+ import { OrMenuItemV3 as OrMenuItem } from '../or-menu-item-v3';
100
+ import { OrIconV3 as OrIcon } from '../or-icon-v3';
101
+ import {
102
+ CardCollectionRoot,
103
+ CardCollectionToolbar,
104
+ CardCollectionToolbarPanel,
105
+ } from './styles';
106
+ import { CardCollectionItem, SortOption, ViewMode } from './types';
107
+ import OrCardCollectionView from './OrCardCollectionView.vue3.vue';
108
+ import { OrButtonV3 as OrButton } from '../or-button-v3';
109
+ import { OrSearchV3 as OrSearch } from '../or-search-v3';
110
+ import { defaultViewModes, gridView } from './props';
81
111
 
82
112
  export default defineComponent({
83
113
  name: 'OrCardCollection',
84
114
 
85
115
  components: {
86
- OrCard,
116
+ OrCardCollectionView,
87
117
  OrIconButton,
88
- OrInput,
89
- OrSortHeader,
118
+ OrButton,
119
+ OrMenu,
120
+ OrMenuItem,
121
+ OrIcon,
122
+ OrSearch,
90
123
  },
91
124
 
92
125
  inheritAttrs: false,
@@ -98,24 +131,39 @@ export default defineComponent({
98
131
  },
99
132
 
100
133
  view: {
101
- type: String as PropType<CardCollectionView>,
102
- default: CardCollectionView.Grid,
134
+ type: String,
135
+ default: gridView.view,
136
+ },
137
+
138
+ viewModes: {
139
+ type: Array as PropType<ViewMode[]>,
140
+ default: () => defaultViewModes,
103
141
  },
104
142
 
105
143
  sort: {
106
- type: Object as PropType<SortHeaderModel>,
144
+ type: String,
107
145
  default: undefined,
108
146
  },
109
147
 
110
- sortHeaders: {
111
- type: Array as PropType<CardCollectionSortHeader[]>,
112
- default: undefined,
148
+ sortOptions: {
149
+ type: Array as PropType<SortOption[]>,
150
+ default: () => [],
113
151
  },
114
152
 
115
153
  search: {
154
+ type: String,
155
+ default: '',
156
+ },
157
+
158
+ searchPlaceholder: {
116
159
  type: String,
117
160
  default: undefined,
118
161
  },
162
+
163
+ searchDebounce: {
164
+ type: Number,
165
+ default: undefined,
166
+ },
119
167
  },
120
168
 
121
169
  emits: [
@@ -131,6 +179,8 @@ export default defineComponent({
131
179
  setup(props, context) {
132
180
  // Refs
133
181
  const root = ref<HTMLElement>();
182
+ const sortMenu = ref<typeof OrMenu>();
183
+ const sortButton = ref<typeof OrButton>();
134
184
 
135
185
  // Styles
136
186
  const classAttribute = useClassAttribute();
@@ -149,10 +199,9 @@ export default defineComponent({
149
199
  ...CardCollectionToolbarPanel,
150
200
  ]);
151
201
 
152
- const contentStyles = computed(() => [
153
- ...CardCollectionContent,
154
- ...CardCollectionContentViews[proxyView.value],
155
- ]);
202
+ const sortLabel = computed(() => {
203
+ return props.sortOptions.find(item => item.value === props.sort)?.label;
204
+ });
156
205
 
157
206
  // State
158
207
  const proxyView = ref(props.view);
@@ -160,12 +209,15 @@ export default defineComponent({
160
209
  const proxySearch = ref(props.search);
161
210
 
162
211
  // Methods
163
- function switchToGridView(): void {
164
- proxyView.value = CardCollectionView.Grid;
212
+ function switchView(view: string): void {
213
+ proxyView.value = view;
214
+ }
215
+ function handleSort(sort: string) {
216
+ proxySort.value = sort;
165
217
  }
166
218
 
167
- function switchToListView(): void {
168
- proxyView.value = CardCollectionView.List;
219
+ function handleSearch(search: string) {
220
+ proxySearch.value = search;
169
221
  }
170
222
 
171
223
  // Effects
@@ -195,15 +247,18 @@ export default defineComponent({
195
247
 
196
248
  return {
197
249
  root,
250
+ sortMenu,
251
+ sortButton,
198
252
  rootStyles,
199
253
  toolbarStyles,
200
254
  toolbarPanelStyles,
201
- contentStyles,
202
255
  proxyView,
203
256
  proxySort,
204
257
  proxySearch,
205
- switchToGridView,
206
- switchToListView,
258
+ sortLabel,
259
+ switchView,
260
+ handleSort,
261
+ handleSearch,
207
262
  };
208
263
  },
209
264
  });
@@ -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 { DefaultCardCollectionViews } 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<DefaultCardCollectionViews>,
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>