@onereach/ui-components 2.70.2-beta.2198.0 → 2.70.2-beta.2199.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 (223) hide show
  1. package/dist/bundled/v2/{OrCardCollection-0141a358.js → OrCardCollection-1bb83cfb.js} +1 -1
  2. package/dist/bundled/v2/{OrCheckbox-dbef9f9a.js → OrCheckbox-251ecafc.js} +32 -17
  3. package/dist/bundled/v2/{OrConfirm-23c3ce56.js → OrConfirm-4cae7867.js} +1 -1
  4. package/dist/bundled/v2/{OrInlineInput-87589946.js → OrInlineInput-2133e469.js} +38 -22
  5. package/dist/bundled/v2/{OrInlineTextarea-21b0e6fc.js → OrInlineTextarea-d61ca596.js} +34 -18
  6. package/dist/bundled/v2/{OrInput-82ccfe00.js → OrInput-770f1bed.js} +38 -30
  7. package/dist/bundled/v2/{OrPagination-379c10b8.js → OrPagination-468d0964.js} +1 -1
  8. package/dist/bundled/v2/{OrRadio-cd39b20b.js → OrRadio-ae89bc9b.js} +30 -15
  9. package/dist/bundled/v2/{OrSearch-53470b0e.js → OrSearch-2e5f9e24.js} +1 -1
  10. package/dist/bundled/v2/{OrSelect-c49e1bcf.js → OrSelect-039c0711.js} +2 -2
  11. package/dist/bundled/v2/OrSidebar-c95ef614.js +230 -0
  12. package/dist/bundled/v2/{OrSwitch-237a2081.js → OrSwitch-20640a05.js} +30 -15
  13. package/dist/bundled/v2/{OrTabs-42f7c52c.js → OrTabs-85aefcba.js} +1 -1
  14. package/dist/bundled/v2/{OrTextarea-5593fbe9.js → OrTextarea-0ff8063b.js} +39 -20
  15. package/dist/bundled/v2/components/index.js +16 -14
  16. package/dist/bundled/v2/components/or-card-collection-v3/index.js +5 -3
  17. package/dist/bundled/v2/components/or-checkbox-v3/OrCheckbox.vue.d.ts +18 -2
  18. package/dist/bundled/v2/components/or-checkbox-v3/index.js +2 -1
  19. package/dist/bundled/v2/components/or-confirm-v3/index.js +4 -2
  20. package/dist/bundled/v2/components/or-inline-input-v3/OrInlineInput.vue.d.ts +36 -6
  21. package/dist/bundled/v2/components/or-inline-input-v3/index.js +3 -1
  22. package/dist/bundled/v2/components/or-inline-textarea-v3/OrInlineTextarea.vue.d.ts +36 -6
  23. package/dist/bundled/v2/components/or-inline-textarea-v3/index.js +3 -1
  24. package/dist/bundled/v2/components/or-input-v3/OrInput.vue.d.ts +43 -8
  25. package/dist/bundled/v2/components/or-input-v3/index.js +3 -1
  26. package/dist/bundled/v2/components/or-pagination-v3/index.js +1 -1
  27. package/dist/bundled/v2/components/or-radio-v3/OrRadio.vue.d.ts +18 -2
  28. package/dist/bundled/v2/components/or-radio-v3/index.js +2 -1
  29. package/dist/bundled/v2/components/or-search-v3/index.js +4 -2
  30. package/dist/bundled/v2/components/or-select-v3/index.js +5 -3
  31. package/dist/bundled/v2/components/or-sidebar-v3/OrSidebar.stories3.d.ts +1 -36
  32. package/dist/bundled/v2/components/or-sidebar-v3/OrSidebar.vue.d.ts +4 -49
  33. package/dist/bundled/v2/components/or-sidebar-v3/index.js +1 -13
  34. package/dist/bundled/v2/components/or-sidebar-v3/styles.d.ts +1 -7
  35. package/dist/bundled/v2/components/or-switch-v3/OrSwitch.vue.d.ts +18 -2
  36. package/dist/bundled/v2/components/or-switch-v3/index.js +2 -1
  37. package/dist/bundled/v2/components/or-tabs-v3/index.js +1 -1
  38. package/dist/bundled/v2/components/or-textarea-v3/OrTextarea.vue.d.ts +45 -6
  39. package/dist/bundled/v2/components/or-textarea-v3/index.js +3 -1
  40. package/dist/bundled/v2/hooks/index.d.ts +3 -0
  41. package/dist/bundled/v2/hooks/index.js +2 -0
  42. package/dist/bundled/v2/hooks/useControlAttributes.d.ts +8 -0
  43. package/dist/bundled/v2/hooks/useIdAttribute.d.ts +2 -0
  44. package/dist/bundled/v2/hooks/useValidationAttributes.d.ts +12 -0
  45. package/dist/bundled/v2/index.js +17 -15
  46. package/dist/bundled/v2/useIdAttribute-cf61643f.js +22 -0
  47. package/dist/bundled/v2/useValidationAttributes-6df7bcf9.js +17 -0
  48. package/dist/bundled/v3/{OrCardCollection.vue_vue_type_script_lang-2d78a51a.js → OrCardCollection.vue_vue_type_script_lang-a0f29a55.js} +1 -1
  49. package/dist/bundled/v3/{OrCheckbox.vue_vue_type_script_lang-8b36e06c.js → OrCheckbox.vue_vue_type_script_lang-2024ec32.js} +22 -7
  50. package/dist/bundled/v3/{OrConfirm.vue_vue_type_script_lang-05b21989.js → OrConfirm.vue_vue_type_script_lang-7d9d3810.js} +2 -2
  51. package/dist/bundled/v3/{OrInlineInput.vue_vue_type_script_lang-67218502.js → OrInlineInput.vue_vue_type_script_lang-40f0073f.js} +27 -11
  52. package/dist/bundled/v3/{OrInlineTextarea.vue_vue_type_script_lang-a1831ab8.js → OrInlineTextarea.vue_vue_type_script_lang-2817edd5.js} +27 -11
  53. package/dist/bundled/v3/{OrInput-a4f220ed.js → OrInput-e325a104.js} +12 -12
  54. package/dist/bundled/v3/{OrInput.vue_vue_type_script_lang-607d79d4.js → OrInput.vue_vue_type_script_lang-fd850b82.js} +26 -15
  55. package/dist/bundled/v3/{OrPagination.vue_vue_type_script_lang-c96d7cd7.js → OrPagination.vue_vue_type_script_lang-0d9daaa7.js} +1 -1
  56. package/dist/bundled/v3/{OrRadio.vue_vue_type_script_lang-2e666a56.js → OrRadio.vue_vue_type_script_lang-29e8b856.js} +22 -7
  57. package/dist/bundled/v3/{OrSearch.vue_vue_type_script_lang-06f318ca.js → OrSearch.vue_vue_type_script_lang-480f4b1c.js} +2 -2
  58. package/dist/bundled/v3/{OrSelect.vue_vue_type_script_lang-58e5a52b.js → OrSelect.vue_vue_type_script_lang-7aa8956a.js} +17 -15
  59. package/dist/bundled/v3/OrSidebar.vue_vue_type_script_lang-ce0b152c.js +181 -0
  60. package/dist/bundled/v3/{OrSwitch.vue_vue_type_script_lang-04829f64.js → OrSwitch.vue_vue_type_script_lang-02b4913a.js} +22 -7
  61. package/dist/bundled/v3/{OrTabs.vue_vue_type_script_lang-61b79a5a.js → OrTabs.vue_vue_type_script_lang-01188224.js} +1 -1
  62. package/dist/bundled/v3/{OrTextarea.vue_vue_type_script_lang-8e3531cd.js → OrTextarea.vue_vue_type_script_lang-2fdac7b2.js} +31 -12
  63. package/dist/bundled/v3/components/index.js +17 -15
  64. package/dist/bundled/v3/components/or-card-collection-v3/index.js +6 -4
  65. package/dist/bundled/v3/components/or-checkbox-v3/OrCheckbox.vue.d.ts +18 -2
  66. package/dist/bundled/v3/components/or-checkbox-v3/index.js +2 -1
  67. package/dist/bundled/v3/components/or-confirm-v3/index.js +5 -3
  68. package/dist/bundled/v3/components/or-inline-input-v3/OrInlineInput.vue.d.ts +36 -6
  69. package/dist/bundled/v3/components/or-inline-input-v3/index.js +3 -1
  70. package/dist/bundled/v3/components/or-inline-textarea-v3/OrInlineTextarea.vue.d.ts +36 -6
  71. package/dist/bundled/v3/components/or-inline-textarea-v3/index.js +3 -1
  72. package/dist/bundled/v3/components/or-input-v3/OrInput.vue.d.ts +43 -8
  73. package/dist/bundled/v3/components/or-input-v3/index.js +3 -1
  74. package/dist/bundled/v3/components/or-pagination-v3/index.js +1 -1
  75. package/dist/bundled/v3/components/or-radio-v3/OrRadio.vue.d.ts +18 -2
  76. package/dist/bundled/v3/components/or-radio-v3/index.js +2 -1
  77. package/dist/bundled/v3/components/or-search-v3/index.js +5 -3
  78. package/dist/bundled/v3/components/or-select-v3/index.js +6 -4
  79. package/dist/bundled/v3/components/or-sidebar-v3/OrSidebar.stories3.d.ts +1 -36
  80. package/dist/bundled/v3/components/or-sidebar-v3/OrSidebar.vue.d.ts +4 -49
  81. package/dist/bundled/v3/components/or-sidebar-v3/index.js +1 -15
  82. package/dist/bundled/v3/components/or-sidebar-v3/styles.d.ts +1 -7
  83. package/dist/bundled/v3/components/or-switch-v3/OrSwitch.vue.d.ts +18 -2
  84. package/dist/bundled/v3/components/or-switch-v3/index.js +2 -1
  85. package/dist/bundled/v3/components/or-tabs-v3/index.js +1 -1
  86. package/dist/bundled/v3/components/or-textarea-v3/OrTextarea.vue.d.ts +45 -6
  87. package/dist/bundled/v3/components/or-textarea-v3/index.js +3 -1
  88. package/dist/bundled/v3/hooks/index.d.ts +3 -0
  89. package/dist/bundled/v3/hooks/index.js +2 -0
  90. package/dist/bundled/v3/hooks/useControlAttributes.d.ts +8 -0
  91. package/dist/bundled/v3/hooks/useIdAttribute.d.ts +2 -0
  92. package/dist/bundled/v3/hooks/useValidationAttributes.d.ts +12 -0
  93. package/dist/bundled/v3/index.js +85 -93
  94. package/dist/bundled/v3/useIdAttribute-b2e42f31.js +21 -0
  95. package/dist/bundled/v3/useValidationAttributes-5428d8fa.js +16 -0
  96. package/dist/esm/v2/{OrCardCollection-3c38fc85.js → OrCardCollection-784318ac.js} +1 -1
  97. package/dist/esm/v2/{OrCheckbox-567e387c.js → OrCheckbox-7317fe1a.js} +32 -17
  98. package/dist/esm/v2/{OrConfirm-e2ab9b4c.js → OrConfirm-3d064f6c.js} +1 -1
  99. package/dist/esm/v2/{OrInlineInput-10205811.js → OrInlineInput-7c4f1f92.js} +38 -22
  100. package/dist/esm/v2/{OrInlineTextarea-7658611e.js → OrInlineTextarea-3381e2a9.js} +34 -18
  101. package/dist/esm/v2/{OrInput-ada3a970.js → OrInput-e10cc643.js} +38 -30
  102. package/dist/esm/v2/{OrPagination-c0dbec6a.js → OrPagination-291bd1b9.js} +1 -1
  103. package/dist/esm/v2/{OrRadio-848ce55d.js → OrRadio-b0a560d2.js} +30 -15
  104. package/dist/esm/v2/{OrSearch-0f08f2f5.js → OrSearch-1490c00b.js} +1 -1
  105. package/dist/esm/v2/{OrSelect-1d705445.js → OrSelect-1fbeed4f.js} +2 -2
  106. package/dist/esm/v2/OrSidebar-fabc7bc9.js +228 -0
  107. package/dist/esm/v2/{OrSwitch-13b6a7ee.js → OrSwitch-133052ca.js} +30 -15
  108. package/dist/esm/v2/{OrTabs-71bd3fd2.js → OrTabs-e5b81f4b.js} +1 -1
  109. package/dist/esm/v2/{OrTextarea-6712a150.js → OrTextarea-a7c846da.js} +39 -20
  110. package/dist/esm/v2/components/index.js +16 -14
  111. package/dist/esm/v2/components/or-card-collection-v3/index.js +5 -3
  112. package/dist/esm/v2/components/or-checkbox-v3/OrCheckbox.vue.d.ts +18 -2
  113. package/dist/esm/v2/components/or-checkbox-v3/index.js +2 -1
  114. package/dist/esm/v2/components/or-confirm-v3/index.js +4 -2
  115. package/dist/esm/v2/components/or-inline-input-v3/OrInlineInput.vue.d.ts +36 -6
  116. package/dist/esm/v2/components/or-inline-input-v3/index.js +3 -1
  117. package/dist/esm/v2/components/or-inline-textarea-v3/OrInlineTextarea.vue.d.ts +36 -6
  118. package/dist/esm/v2/components/or-inline-textarea-v3/index.js +3 -1
  119. package/dist/esm/v2/components/or-input-v3/OrInput.vue.d.ts +43 -8
  120. package/dist/esm/v2/components/or-input-v3/index.js +3 -1
  121. package/dist/esm/v2/components/or-pagination-v3/index.js +1 -1
  122. package/dist/esm/v2/components/or-radio-v3/OrRadio.vue.d.ts +18 -2
  123. package/dist/esm/v2/components/or-radio-v3/index.js +2 -1
  124. package/dist/esm/v2/components/or-search-v3/index.js +4 -2
  125. package/dist/esm/v2/components/or-select-v3/index.js +5 -3
  126. package/dist/esm/v2/components/or-sidebar-v3/OrSidebar.stories3.d.ts +1 -36
  127. package/dist/esm/v2/components/or-sidebar-v3/OrSidebar.vue.d.ts +4 -49
  128. package/dist/esm/v2/components/or-sidebar-v3/index.js +1 -13
  129. package/dist/esm/v2/components/or-sidebar-v3/styles.d.ts +1 -7
  130. package/dist/esm/v2/components/or-switch-v3/OrSwitch.vue.d.ts +18 -2
  131. package/dist/esm/v2/components/or-switch-v3/index.js +2 -1
  132. package/dist/esm/v2/components/or-tabs-v3/index.js +1 -1
  133. package/dist/esm/v2/components/or-textarea-v3/OrTextarea.vue.d.ts +45 -6
  134. package/dist/esm/v2/components/or-textarea-v3/index.js +3 -1
  135. package/dist/esm/v2/hooks/index.d.ts +3 -0
  136. package/dist/esm/v2/hooks/index.js +2 -0
  137. package/dist/esm/v2/hooks/useControlAttributes.d.ts +8 -0
  138. package/dist/esm/v2/hooks/useIdAttribute.d.ts +2 -0
  139. package/dist/esm/v2/hooks/useValidationAttributes.d.ts +12 -0
  140. package/dist/esm/v2/index.js +16 -14
  141. package/dist/esm/v2/useIdAttribute-859439f0.js +21 -0
  142. package/dist/esm/v2/useValidationAttributes-d1abbe34.js +16 -0
  143. package/dist/esm/v3/{OrCardCollection-dbb3e839.js → OrCardCollection-110b3a0b.js} +1 -1
  144. package/dist/esm/v3/{OrCheckbox-3e139eac.js → OrCheckbox-7144da06.js} +36 -19
  145. package/dist/esm/v3/{OrConfirm-1bcd39b1.js → OrConfirm-1a38ed1b.js} +1 -1
  146. package/dist/esm/v3/{OrInlineInput-507fc99c.js → OrInlineInput-a6b19dbe.js} +37 -20
  147. package/dist/esm/v3/{OrInlineTextarea-53a9e027.js → OrInlineTextarea-9eb60363.js} +37 -20
  148. package/dist/esm/v3/{OrInput-9c0426b9.js → OrInput-e07ec00c.js} +37 -26
  149. package/dist/esm/v3/{OrPagination-a703307d.js → OrPagination-5e01a0a5.js} +1 -1
  150. package/dist/esm/v3/{OrRadio-54b6d0de.js → OrRadio-39d1905d.js} +34 -17
  151. package/dist/esm/v3/{OrSearch-9885d178.js → OrSearch-a60f67f0.js} +1 -1
  152. package/dist/esm/v3/{OrSelect-dfa4885f.js → OrSelect-2c70e384.js} +2 -2
  153. package/dist/esm/v3/OrSidebar-a62972f5.js +206 -0
  154. package/dist/esm/v3/{OrSwitch-cca30aa0.js → OrSwitch-3e9a699d.js} +34 -18
  155. package/dist/esm/v3/{OrTabs-d0ee6cef.js → OrTabs-91618aab.js} +1 -1
  156. package/dist/esm/v3/{OrTextarea-bb9ef3f2.js → OrTextarea-fd6b9f31.js} +42 -22
  157. package/dist/esm/v3/components/index.js +16 -14
  158. package/dist/esm/v3/components/or-card-collection-v3/index.js +5 -3
  159. package/dist/esm/v3/components/or-checkbox-v3/OrCheckbox.vue.d.ts +18 -2
  160. package/dist/esm/v3/components/or-checkbox-v3/index.js +2 -1
  161. package/dist/esm/v3/components/or-confirm-v3/index.js +4 -2
  162. package/dist/esm/v3/components/or-inline-input-v3/OrInlineInput.vue.d.ts +36 -6
  163. package/dist/esm/v3/components/or-inline-input-v3/index.js +3 -1
  164. package/dist/esm/v3/components/or-inline-textarea-v3/OrInlineTextarea.vue.d.ts +36 -6
  165. package/dist/esm/v3/components/or-inline-textarea-v3/index.js +3 -1
  166. package/dist/esm/v3/components/or-input-v3/OrInput.vue.d.ts +43 -8
  167. package/dist/esm/v3/components/or-input-v3/index.js +3 -1
  168. package/dist/esm/v3/components/or-pagination-v3/index.js +1 -1
  169. package/dist/esm/v3/components/or-radio-v3/OrRadio.vue.d.ts +18 -2
  170. package/dist/esm/v3/components/or-radio-v3/index.js +2 -1
  171. package/dist/esm/v3/components/or-search-v3/index.js +4 -2
  172. package/dist/esm/v3/components/or-select-v3/index.js +5 -3
  173. package/dist/esm/v3/components/or-sidebar-v3/OrSidebar.stories3.d.ts +1 -36
  174. package/dist/esm/v3/components/or-sidebar-v3/OrSidebar.vue.d.ts +4 -49
  175. package/dist/esm/v3/components/or-sidebar-v3/index.js +1 -12
  176. package/dist/esm/v3/components/or-sidebar-v3/styles.d.ts +1 -7
  177. package/dist/esm/v3/components/or-switch-v3/OrSwitch.vue.d.ts +18 -2
  178. package/dist/esm/v3/components/or-switch-v3/index.js +2 -1
  179. package/dist/esm/v3/components/or-tabs-v3/index.js +1 -1
  180. package/dist/esm/v3/components/or-textarea-v3/OrTextarea.vue.d.ts +45 -6
  181. package/dist/esm/v3/components/or-textarea-v3/index.js +3 -1
  182. package/dist/esm/v3/hooks/index.d.ts +3 -0
  183. package/dist/esm/v3/hooks/index.js +2 -0
  184. package/dist/esm/v3/hooks/useControlAttributes.d.ts +8 -0
  185. package/dist/esm/v3/hooks/useIdAttribute.d.ts +2 -0
  186. package/dist/esm/v3/hooks/useValidationAttributes.d.ts +12 -0
  187. package/dist/esm/v3/index.js +16 -14
  188. package/dist/esm/v3/useIdAttribute-859439f0.js +21 -0
  189. package/dist/esm/v3/useValidationAttributes-d1abbe34.js +16 -0
  190. package/package.json +1 -1
  191. package/src/components/or-checkbox-v3/OrCheckbox.vue +28 -10
  192. package/src/components/or-inline-input-v3/OrInlineInput.vue +32 -13
  193. package/src/components/or-inline-textarea-v3/OrInlineTextarea.vue +32 -13
  194. package/src/components/or-input-v3/OrInput.stories3.ts +4 -4
  195. package/src/components/or-input-v3/OrInput.vue +31 -19
  196. package/src/components/or-pagination-v3/OrPagination.vue +1 -1
  197. package/src/components/or-radio-v3/OrRadio.vue +27 -9
  198. package/src/components/or-sidebar-v3/OrSidebar.docs.mdx +0 -6
  199. package/src/components/or-sidebar-v3/OrSidebar.stories3.ts +6 -219
  200. package/src/components/or-sidebar-v3/OrSidebar.vue +22 -121
  201. package/src/components/or-sidebar-v3/styles.ts +9 -153
  202. package/src/components/or-switch-v3/OrSwitch.vue +27 -9
  203. package/src/components/or-tabs-v3/OrTabs.vue +1 -1
  204. package/src/components/or-textarea-v3/OrTextarea.stories3.ts +4 -4
  205. package/src/components/or-textarea-v3/OrTextarea.vue +36 -14
  206. package/src/hooks/index.ts +3 -0
  207. package/src/hooks/useControlAttributes.ts +19 -0
  208. package/src/hooks/useIdAttribute.ts +9 -0
  209. package/src/hooks/useValidationAttributes.ts +25 -0
  210. package/dist/bundled/v2/OrSidebar-2a7d62a8.js +0 -455
  211. package/dist/bundled/v2/components/or-sidebar-v3/OrSidebarCollapseButton.stories3.d.ts +0 -12
  212. package/dist/bundled/v2/components/or-sidebar-v3/OrSidebarCollapseButton.vue.d.ts +0 -59
  213. package/dist/bundled/v3/OrSidebar.vue_vue_type_script_lang-b4fa1550.js +0 -347
  214. package/dist/bundled/v3/components/or-sidebar-v3/OrSidebarCollapseButton.stories3.d.ts +0 -12
  215. package/dist/bundled/v3/components/or-sidebar-v3/OrSidebarCollapseButton.vue.d.ts +0 -59
  216. package/dist/esm/v2/OrSidebar-1e02702f.js +0 -452
  217. package/dist/esm/v2/components/or-sidebar-v3/OrSidebarCollapseButton.stories3.d.ts +0 -12
  218. package/dist/esm/v2/components/or-sidebar-v3/OrSidebarCollapseButton.vue.d.ts +0 -59
  219. package/dist/esm/v3/OrSidebar-749bbcba.js +0 -387
  220. package/dist/esm/v3/components/or-sidebar-v3/OrSidebarCollapseButton.stories3.d.ts +0 -12
  221. package/dist/esm/v3/components/or-sidebar-v3/OrSidebarCollapseButton.vue.d.ts +0 -59
  222. package/src/components/or-sidebar-v3/OrSidebarCollapseButton.stories3.ts +0 -48
  223. package/src/components/or-sidebar-v3/OrSidebarCollapseButton.vue +0 -64
@@ -1,12 +1,13 @@
1
1
  <template>
2
2
  <div
3
3
  ref="root"
4
+ v-bind="$attrs"
4
5
  :class="rootStyles"
5
6
  >
6
7
  <input
7
- v-bind="$attrs"
8
- :id="controlId"
8
+ ref="control"
9
9
  v-model="proxyModelValue"
10
+ v-bind="controlAttributes"
10
11
  :class="controlStyles"
11
12
  type="radio"
12
13
  :value="inputValue"
@@ -18,7 +19,7 @@
18
19
 
19
20
  <template v-if="$slots.default || label">
20
21
  <OrLabel
21
- :control-id="controlId"
22
+ :control-id="controlAttributes.id"
22
23
  :variant="labelVariant"
23
24
  :required="required"
24
25
  :disabled="disabled"
@@ -34,8 +35,8 @@
34
35
  </template>
35
36
 
36
37
  <script lang="ts">
37
- import { computed, defineComponent, getCurrentInstance, PropType, ref } from 'vue-demi';
38
- import { useClassAttribute } from '../../hooks';
38
+ import { computed, defineComponent, PropType, reactive, ref } from 'vue-demi';
39
+ import { useClassAttribute, useControlAttributes, useIdAttribute } from '../../hooks';
39
40
  import { LabelVariant, OrLabelV3 as OrLabel } from '../or-label-v3';
40
41
  import { RadioControl, RadioControlHandle, RadioRoot } from './styles';
41
42
 
@@ -95,13 +96,15 @@ export default defineComponent({
95
96
 
96
97
  expose: [
97
98
  'root',
99
+
100
+ 'focus',
101
+ 'blur',
98
102
  ],
99
103
 
100
104
  setup(props, context) {
101
- const currentInstance = getCurrentInstance()!;
102
-
103
105
  // Refs
104
106
  const root = ref<HTMLElement>();
107
+ const control = ref<HTMLInputElement>();
105
108
 
106
109
  // Styles
107
110
  const classAttribute = useClassAttribute();
@@ -118,7 +121,10 @@ export default defineComponent({
118
121
  ]);
119
122
 
120
123
  // State
121
- const controlId = ref(context.attrs.id as string ?? currentInstance.uid.toString());
124
+ const controlAttributes = reactive({
125
+ id: useIdAttribute(),
126
+ ...useControlAttributes(),
127
+ });
122
128
 
123
129
  const proxyModelValue = computed({
124
130
  get: () => {
@@ -131,12 +137,24 @@ export default defineComponent({
131
137
  },
132
138
  });
133
139
 
140
+ // Methods
141
+ function focus(): void {
142
+ control.value?.focus();
143
+ }
144
+
145
+ function blur(): void {
146
+ control.value?.blur();
147
+ }
148
+
134
149
  return {
135
150
  root,
151
+ control,
136
152
  rootStyles,
137
153
  controlStyles,
138
- controlId,
154
+ controlAttributes,
139
155
  proxyModelValue,
156
+ focus,
157
+ blur,
140
158
  };
141
159
  },
142
160
  });
@@ -5,9 +5,3 @@ import { OrSidebarV3 as OrSidebar } from '@onereach/ui-components';
5
5
  ```
6
6
 
7
7
  <DocsPage />
8
-
9
- ## Migration Guide from V1
10
- - added property `draggable`
11
- - added property `maximumWidth`
12
- - added property `collapsible`
13
- - added slot `toolbar`
@@ -3,11 +3,8 @@ import OrSidebarDocs from './OrSidebar.docs.mdx';
3
3
  import OrSidebar from './OrSidebar.vue';
4
4
  import { OrSidebarPlacement } from './props';
5
5
  import { action } from '@storybook/addon-actions';
6
- import { ref } from 'vue-demi';
7
6
  import * as Faker from 'faker';
8
7
  import { OrButtonV3 as OrButton } from '../or-button-v3';
9
- import { OrIconButtonV3 as OrIconButton } from '../or-icon-button-v3';
10
- import { OrTabsV3 as OrTabs, TabsItem } from '../or-tabs-v3';
11
8
 
12
9
  export default {
13
10
  title: 'Components/Sidebar',
@@ -42,15 +39,6 @@ export default {
42
39
  control: { type: 'text' },
43
40
  },
44
41
 
45
- toolbar: {
46
- type: {
47
- name: 'string',
48
- required: false,
49
- },
50
-
51
- control: { type: 'text' },
52
- },
53
-
54
42
  // Props
55
43
  width: {
56
44
  control: { type: 'number' },
@@ -64,14 +52,6 @@ export default {
64
52
  control: { type: 'select' },
65
53
  options: Object.values(OrSidebarPlacement),
66
54
  },
67
-
68
- draggable: {
69
- control: { type: 'boolean' },
70
- },
71
-
72
- collapsible: {
73
- control: { type: 'boolean' },
74
- },
75
55
  },
76
56
 
77
57
  parameters: {
@@ -87,7 +67,6 @@ const DefaultTemplate: StoryFn<typeof OrSidebar> = (args) => ({
87
67
  components: {
88
68
  OrSidebar,
89
69
  OrButton,
90
- OrIconButton,
91
70
  },
92
71
 
93
72
  setup() {
@@ -99,9 +78,9 @@ const DefaultTemplate: StoryFn<typeof OrSidebar> = (args) => ({
99
78
  },
100
79
 
101
80
  template: `
102
- <div style="display: flex; flex-direction: row; border: 1px solid gray; max-height: 750px">
81
+ <div style="display: flex; flex-direction: row; border: 1px solid gray; max-height: 500px">
103
82
  <div style="flex-grow: 1; overflow: auto">
104
- ${Faker.lorem.paragraphs(10)}
83
+ ${Faker.lorem.paragraphs(3)}
105
84
  </div>
106
85
  <OrSidebar v-bind="args" @change:width="onChangeWidth">
107
86
  <template v-if="${!!args.header}" v-slot:header>
@@ -113,9 +92,6 @@ const DefaultTemplate: StoryFn<typeof OrSidebar> = (args) => ({
113
92
  <template v-if="${!!args.footer}" v-slot:footer>
114
93
  ${args.footer}
115
94
  </template>
116
- <template v-if="${!!args.toolbar}" v-slot:toolbar>
117
- ${args.toolbar}
118
- </template>
119
95
  </OrSidebar>
120
96
  </div>
121
97
  `,
@@ -125,7 +101,6 @@ const LeftTemplate: StoryFn<typeof OrSidebar> = (args) => ({
125
101
  components: {
126
102
  OrSidebar,
127
103
  OrButton,
128
- OrIconButton,
129
104
  },
130
105
 
131
106
  setup() {
@@ -137,7 +112,7 @@ const LeftTemplate: StoryFn<typeof OrSidebar> = (args) => ({
137
112
  },
138
113
 
139
114
  template: `
140
- <div style="display: flex; flex-direction: row; border: 1px solid gray; max-height: 750px">
115
+ <div style="display: flex; flex-direction: row; border: 1px solid gray; max-height: 500px">
141
116
  <OrSidebar v-bind="args" @change:width="onChangeWidth">
142
117
  <template v-if="${!!args.header}" v-slot:header>
143
118
  ${args.header}
@@ -148,137 +123,14 @@ const LeftTemplate: StoryFn<typeof OrSidebar> = (args) => ({
148
123
  <template v-if="${!!args.footer}" v-slot:footer>
149
124
  ${args.footer}
150
125
  </template>
151
- <template v-if="${!!args.toolbar}" v-slot:toolbar>
152
- ${args.toolbar}
153
- </template>
154
126
  </OrSidebar>
155
127
  <div style="flex-grow: 1; overflow: auto">
156
- ${Faker.lorem.paragraphs(10)}
128
+ ${Faker.lorem.paragraphs(3)}
157
129
  </div>
158
130
  </div>
159
131
  `,
160
132
  });
161
133
 
162
- const TabsTemplate: StoryFn<typeof OrSidebar> = (args) => ({
163
- components: {
164
- OrSidebar,
165
- OrButton,
166
- OrIconButton,
167
- OrTabs,
168
- },
169
-
170
- setup() {
171
- // State
172
- const model = ref<string>();
173
-
174
- return {
175
- args,
176
- model,
177
- };
178
- },
179
-
180
- methods: {
181
- onChangeWidth: action('change:width'),
182
- },
183
-
184
- template: `
185
- <div style="display: flex; flex-direction: row; border: 1px solid gray; max-height: 750px">
186
- <div style="flex-grow: 1; overflow: auto">
187
- ${Faker.lorem.paragraphs(10)}
188
- </div>
189
- <OrSidebar v-bind="args" @change:width="onChangeWidth">
190
- <template v-if="${!!args.header}" v-slot:header>
191
- ${args.header}
192
- </template>
193
- <template v-if="${!!args.default}" v-slot:default>
194
- ${args.default}
195
- </template>
196
- <template v-else v-slot:default>
197
- <or-tabs
198
- v-model="model"
199
- :items="args.items"
200
- >
201
- <template v-for="item in args.items" #[item.value]>
202
- {{ item.label }} Content
203
- ${Faker.lorem.paragraphs(3)}
204
- </template>
205
- </or-tabs>
206
- </template>
207
- <template v-if="${!!args.footer}" v-slot:footer>
208
- ${args.footer}
209
- </template>
210
- <template v-if="${!!args.toolbar}" v-slot:toolbar>
211
- ${args.toolbar}
212
- </template>
213
- </OrSidebar>
214
- </div>
215
- `,
216
- });
217
-
218
- const longToolbar = `
219
- <or-icon-button
220
- icon="refresh"
221
- color="inherit"
222
- />
223
- <hr class="w-full border-outline-variant dark:border-outline-variant-dark" />
224
- <or-icon-button
225
- icon="add"
226
- color="inherit"
227
- />
228
- <or-icon-button
229
- icon="zoom_out_map"
230
- color="inherit"
231
- />
232
- <or-icon-button
233
- icon="remove"
234
- color="inherit"
235
- />
236
- <hr class="w-full border-outline-variant dark:border-outline-variant-dark" />
237
- <or-icon-button
238
- icon="description"
239
- color="inherit"
240
- />
241
- <or-icon-button
242
- icon="tab_unselected"
243
- color="inherit"
244
- />
245
- <hr class="w-full border-outline-variant dark:border-outline-variant-dark" />
246
- <or-icon-button
247
- icon="create_new_folder"
248
- color="inherit"
249
- />
250
- <or-icon-button
251
- icon="content_paste"
252
- color="inherit"
253
- />
254
- <or-icon-button
255
- icon="location_on"
256
- color="inherit"
257
- />
258
- <or-icon-button
259
- icon="copy_all"
260
- color="inherit"
261
- />
262
- <or-icon-button
263
- icon="call_split"
264
- color="inherit"
265
- />
266
- <hr class="w-full border-outline-variant dark:border-outline-variant-dark" />
267
- <or-icon-button
268
- icon="sell"
269
- color="inherit"
270
- />
271
- <div class="mt-auto" />
272
- <or-icon-button
273
- icon="terminal"
274
- color="inherit"
275
- />
276
- <or-icon-button
277
- icon="delete"
278
- color="inherit"
279
- />
280
- `;
281
-
282
134
  export const Default = DefaultTemplate.bind({});
283
135
  Default.args = {
284
136
  header: 'Header',
@@ -286,24 +138,11 @@ Default.args = {
286
138
  footer: 'Footer',
287
139
  };
288
140
 
289
- export const WithCustomWidthConstraints = DefaultTemplate.bind({});
290
- WithCustomWidthConstraints.args = {
141
+ export const WithMinimumWidth = DefaultTemplate.bind({});
142
+ WithMinimumWidth.args = {
291
143
  ...Default.args,
292
144
  width: 250,
293
145
  minimumWidth: 200,
294
- maximumWidth: 500,
295
- };
296
-
297
- export const NotDraggable = DefaultTemplate.bind({});
298
- NotDraggable.args = {
299
- ...Default.args,
300
- draggable: false,
301
- };
302
-
303
- export const Collapsible = DefaultTemplate.bind({});
304
- Collapsible.args = {
305
- ...Default.args,
306
- collapsible: true,
307
146
  };
308
147
 
309
148
  export const OnlyContent = DefaultTemplate.bind({});
@@ -328,60 +167,8 @@ WithFooter.args = {
328
167
  `,
329
168
  };
330
169
 
331
- export const WithToolbar = DefaultTemplate.bind({});
332
- WithToolbar.args = {
333
- ...OnlyContent.args,
334
- toolbar: longToolbar,
335
- };
336
-
337
- export const CollapsibleWithToolbar = DefaultTemplate.bind({});
338
- CollapsibleWithToolbar.args = {
339
- ...WithToolbar.args,
340
- collapsible: true,
341
- };
342
-
343
- export const WithTabs = TabsTemplate.bind({});
344
- WithTabs.args = {
345
- minimumWidth: 352,
346
- header: 'Headline',
347
- items: Array.from<string, TabsItem>([
348
- 'Alfa',
349
- 'Bravo',
350
- 'Charlie',
351
- 'Delta',
352
- 'Echo',
353
- 'Foxtrot',
354
- 'Golf',
355
- 'Hotel',
356
- 'India',
357
- 'Juliett',
358
- ], (item) => ({
359
- value: item.toLowerCase(),
360
- label: item,
361
- })),
362
- footer: `
363
- <div style="display: flex; flex-direction: row; justify-content: end; gap: 16px">
364
- <or-button color="danger" variant="outlined">Delete</or-button>
365
- <or-button variant="outlined" class="ml-auto">Cancel</or-button>
366
- <or-button>Save</or-button>
367
- </div>
368
- `,
369
- };
370
-
371
170
  export const LeftSidebar = LeftTemplate.bind({});
372
171
  LeftSidebar.args = {
373
172
  ...Default.args,
374
173
  side: 'left',
375
174
  };
376
-
377
- export const WithLeftToolbar = LeftTemplate.bind({});
378
- WithLeftToolbar.args = {
379
- ...LeftSidebar.args,
380
- toolbar: longToolbar,
381
- };
382
-
383
- export const CollapsibleWithWithLeftToolbar = LeftTemplate.bind({});
384
- CollapsibleWithWithLeftToolbar.args = {
385
- ...WithLeftToolbar.args,
386
- collapsible: true,
387
- };
@@ -2,55 +2,28 @@
2
2
  <aside
3
3
  ref="root"
4
4
  :class="rootStyles"
5
+ :style="sidebarStyle"
5
6
  >
6
7
  <div
7
- v-if="side === 'right' && isShowingToolbar"
8
- :class="toolbarStyles"
9
- >
10
- <slot name="toolbar" />
11
- </div>
12
- <div
13
- :class="sidebarStyles"
14
- :style="sidebarStyle"
15
- >
8
+ ref="resizeBar"
9
+ :class="resizeStyles"
10
+ />
11
+ <div :class="mainStyles">
16
12
  <div
17
- v-if="draggable && !isCollapsed"
18
- ref="resizeBar"
19
- :class="resizeStyles"
20
- />
21
- <or-sidebar-collapse-button
22
- v-if="collapsible"
23
- v-model="isCollapsed"
24
- :class="collapsibleButtonStyles"
25
- :side="side"
26
- />
27
- <div
28
- v-show="!isCollapsed"
29
- :class="mainStyles"
13
+ v-if="$slots.header"
14
+ :class="headerStyles"
30
15
  >
31
- <div
32
- v-if="$slots.header"
33
- :class="headerStyles"
34
- >
35
- <slot name="header" />
36
- </div>
37
- <div :class="contentStyles">
38
- <slot />
39
- </div>
16
+ <slot name="header" />
40
17
  </div>
41
- <div
42
- v-if="$slots.footer"
43
- v-show="!isCollapsed"
44
- :class="footerStyles"
45
- >
46
- <slot name="footer" />
18
+ <div :class="contentStyles">
19
+ <slot />
47
20
  </div>
48
21
  </div>
49
22
  <div
50
- v-if="side === 'left' && isShowingToolbar"
51
- :class="toolbarStyles"
23
+ v-if="$slots.footer"
24
+ :class="footerStyles"
52
25
  >
53
- <slot name="toolbar" />
26
+ <slot name="footer" />
54
27
  </div>
55
28
  </aside>
56
29
  </template>
@@ -58,47 +31,34 @@
58
31
  <script lang="ts">
59
32
  import { useDraggable, useElementBounding } from '@vueuse/core';
60
33
  import _ from 'lodash';
61
- import { computed, defineComponent, PropType, ref, watch, useSlots } from 'vue-demi';
34
+ import { computed, defineComponent, PropType, ref, watch } from 'vue-demi';
62
35
  import { OrSidebarPlacement } from './props';
63
36
  import {
64
37
  SidebarRoot,
65
- SidebarBar,
66
- SidebarToolbar,
67
- SidebarSides,
68
- SidebarToolbarSides,
38
+ SidebarRootSides,
69
39
  SidebarResize,
70
40
  SidebarResizeSides,
71
- SidebarCollapseButton,
72
- SidebarCollapseButtonSides,
73
41
  SidebarResizingSides,
74
42
  SidebarMain,
75
43
  SidebarHeader,
76
44
  SidebarContent,
77
45
  SidebarFooter,
78
46
  } from './styles';
79
- import OrSidebarCollapseButton from './OrSidebarCollapseButton.vue';
80
47
 
81
48
  export default defineComponent({
82
49
  name: 'OrSidebar',
83
50
 
84
- components: {
85
- OrSidebarCollapseButton,
86
- },
87
-
88
51
  props: {
89
52
  width: {
90
53
  type: Number,
91
- default: 320,
54
+ required: false,
55
+ default: 0,
92
56
  validator: (value?: any) => _.isNumber(value) && value >= 0,
93
57
  },
94
58
  minimumWidth: {
95
59
  type: Number,
96
- default: 256,
97
- validator: (value?: any) => _.isNumber(value) && value >= 0,
98
- },
99
- maximumWidth: {
100
- type: Number,
101
- default: 384,
60
+ required: false,
61
+ default: 350,
102
62
  validator: (value?: any) => _.isNumber(value) && value >= 0,
103
63
  },
104
64
  /**
@@ -113,24 +73,10 @@ export default defineComponent({
113
73
  default: OrSidebarPlacement.right,
114
74
  validator: (value?: any) => _.includes(_.values(OrSidebarPlacement), value),
115
75
  },
116
- draggable: {
117
- type: Boolean,
118
- default: true,
119
- },
120
- collapsible: {
121
- type: Boolean,
122
- default: false,
123
- },
124
76
  },
125
77
 
126
78
  emits: ['change:width'],
127
79
 
128
- expose: [
129
- 'root',
130
- 'open',
131
- 'close',
132
- ],
133
-
134
80
  setup(props, { emit }) {
135
81
  // Refs
136
82
  const root = ref<HTMLElement>();
@@ -138,36 +84,20 @@ export default defineComponent({
138
84
 
139
85
  const parentContainer = computed(() => root.value?.parentElement);
140
86
 
141
- // Slots
142
- const { toolbar: toolbarSlot } = useSlots();
143
-
144
87
  // State
145
88
  const startPositionX = ref(0);
146
89
  const isResizing = ref(false);
147
- const isCollapsed = ref(false);
148
- const maximumWidth = ref(props.maximumWidth || 384);
149
90
  const localWidth = ref(props.width >= props.minimumWidth ? props.width : props.minimumWidth);
150
91
 
151
- const isShowingToolbar = computed(() => !!toolbarSlot);
152
-
153
92
  // Styles
154
93
  const sidebarStyle = computed(() => ({
155
- width: (isCollapsed.value ? 16 : localWidth.value) + 'px',
94
+ width: localWidth.value + 'px',
156
95
  }));
157
96
 
158
97
  const rootStyles = computed(() => [
159
98
  'or-sidebar',
160
99
  ...SidebarRoot,
161
- ]);
162
-
163
- const sidebarStyles = computed(() => [
164
- ...SidebarBar,
165
- ...SidebarSides[props.side],
166
- ]);
167
-
168
- const toolbarStyles = computed(() => [
169
- ...SidebarToolbar,
170
- ...SidebarToolbarSides[props.side],
100
+ ...SidebarRootSides[props.side],
171
101
  ]);
172
102
 
173
103
  const resizeStyles = computed(() => [
@@ -176,11 +106,6 @@ export default defineComponent({
176
106
  ...(isResizing.value ? SidebarResizingSides[props.side] : []),
177
107
  ]);
178
108
 
179
- const collapsibleButtonStyles = computed(() => [
180
- ...SidebarCollapseButton,
181
- ...SidebarCollapseButtonSides[props.side],
182
- ]);
183
-
184
109
  const mainStyles = computed(() => [...SidebarMain]);
185
110
 
186
111
  const headerStyles = computed(() => [...SidebarHeader]);
@@ -212,16 +137,7 @@ export default defineComponent({
212
137
  },
213
138
  });
214
139
 
215
- // Methods
216
- function open(): void {
217
- isCollapsed.value = false;
218
- }
219
-
220
- function close(): void {
221
- isCollapsed.value = true;
222
- }
223
-
224
- const { width: containerWidth } = useElementBounding(parentContainer);
140
+ const { width: maximumWidth } = useElementBounding(parentContainer);
225
141
 
226
142
  watch(() => props.width, (newValue: number) => {
227
143
  if (newValue !== localWidth.value) {
@@ -234,14 +150,6 @@ export default defineComponent({
234
150
  if (newMinimum > localWidth.value) localWidth.value = newMinimum;
235
151
  });
236
152
 
237
- watch(() => props.maximumWidth, (newMaximum: number) => {
238
- if (newMaximum < maximumWidth.value) maximumWidth.value = newMaximum;
239
- });
240
-
241
- watch(containerWidth, (newMaximum: number) => {
242
- if (newMaximum < maximumWidth.value) maximumWidth.value = newMaximum;
243
- });
244
-
245
153
  watch(maximumWidth, (newMaximum: number) => {
246
154
  if (newMaximum < localWidth.value) localWidth.value = newMaximum;
247
155
  });
@@ -252,21 +160,14 @@ export default defineComponent({
252
160
  root,
253
161
  resizeBar,
254
162
  isResizing,
255
- isCollapsed,
256
163
  localWidth,
257
- isShowingToolbar,
258
164
  sidebarStyle,
259
165
  rootStyles,
260
- sidebarStyles,
261
- toolbarStyles,
262
166
  resizeStyles,
263
- collapsibleButtonStyles,
264
167
  mainStyles,
265
168
  headerStyles,
266
169
  contentStyles,
267
170
  footerStyles,
268
- open,
269
- close,
270
171
  };
271
172
  },
272
173
  });