@onereach/ui-components 2.71.1-beta.2223.0 → 2.71.1-beta.2226.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 (153) hide show
  1. package/dist/bundled/v2/{OrCardCollection-0141a358.js → OrCardCollection-3dee1926.js} +2 -2
  2. package/dist/bundled/v2/{OrConfirm-057e997e.js → OrConfirm-5fd7f8bb.js} +1 -1
  3. package/dist/bundled/v2/{OrIconButton-a2ba92df.js → OrIconButton-76043aa4.js} +10 -3
  4. package/dist/bundled/v2/{OrInlineInput-87589946.js → OrInlineInput-7faf5534.js} +1 -1
  5. package/dist/bundled/v2/{OrInlineTextarea-21b0e6fc.js → OrInlineTextarea-a9bfe477.js} +1 -1
  6. package/dist/bundled/v2/{OrInput-82ccfe00.js → OrInput-d4173a5a.js} +1 -1
  7. package/dist/bundled/v2/{OrModal-af6677fd.js → OrModal-6484c944.js} +1 -1
  8. package/dist/bundled/v2/{OrNotification-3250f58b.js → OrNotification-35ec61a9.js} +1 -1
  9. package/dist/bundled/v2/{OrSearch-53470b0e.js → OrSearch-ae350dc7.js} +1 -1
  10. package/dist/bundled/v2/{OrSelect-02fb39f0.js → OrSelect-e3ee8d12.js} +2 -2
  11. package/dist/bundled/v2/OrSidebar-c95ef614.js +230 -0
  12. package/dist/bundled/v2/{OrTag-30fecee5.js → OrTag-b9ace427.js} +1 -1
  13. package/dist/bundled/v2/components/index.js +13 -13
  14. package/dist/bundled/v2/components/or-card-collection-v3/index.js +4 -4
  15. package/dist/bundled/v2/components/or-confirm-v3/index.js +3 -3
  16. package/dist/bundled/v2/components/or-icon-button-v3/OrIconButton.vue.d.ts +11 -0
  17. package/dist/bundled/v2/components/or-icon-button-v3/index.js +1 -1
  18. package/dist/bundled/v2/components/or-inline-input-v3/index.js +2 -2
  19. package/dist/bundled/v2/components/or-inline-textarea-v3/index.js +2 -2
  20. package/dist/bundled/v2/components/or-input-v3/index.js +2 -2
  21. package/dist/bundled/v2/components/or-modal-v3/index.js +2 -2
  22. package/dist/bundled/v2/components/or-notification-v3/index.js +2 -2
  23. package/dist/bundled/v2/components/or-search-v3/index.js +3 -3
  24. package/dist/bundled/v2/components/or-select-v3/index.js +4 -4
  25. package/dist/bundled/v2/components/or-sidebar-v3/OrSidebar.stories3.d.ts +1 -36
  26. package/dist/bundled/v2/components/or-sidebar-v3/OrSidebar.vue.d.ts +4 -49
  27. package/dist/bundled/v2/components/or-sidebar-v3/index.js +1 -13
  28. package/dist/bundled/v2/components/or-sidebar-v3/styles.d.ts +1 -9
  29. package/dist/bundled/v2/components/or-tag-v3/index.js +2 -2
  30. package/dist/bundled/v2/components/or-toast-v3/index.js +2 -2
  31. package/dist/bundled/v2/index.js +14 -14
  32. package/dist/bundled/v2/{types-8fe4e345.js → types-7f69189b.js} +1 -1
  33. package/dist/bundled/v3/{OrCardCollection.vue_vue_type_script_lang-2d78a51a.js → OrCardCollection.vue_vue_type_script_lang-95abfcc1.js} +3 -3
  34. package/dist/bundled/v3/{OrConfirm.vue_vue_type_script_lang-9d9a3917.js → OrConfirm.vue_vue_type_script_lang-16dfa0b6.js} +2 -2
  35. package/dist/bundled/v3/{OrIconButton-cd62526d.js → OrIconButton-50df6117.js} +3 -2
  36. package/dist/bundled/v3/{OrIconButton.vue_vue_type_script_lang-aefcf30d.js → OrIconButton.vue_vue_type_script_lang-b1490ad1.js} +9 -3
  37. package/dist/bundled/v3/{OrInlineInput.vue_vue_type_script_lang-67218502.js → OrInlineInput.vue_vue_type_script_lang-9f237eb5.js} +2 -2
  38. package/dist/bundled/v3/{OrInlineTextarea.vue_vue_type_script_lang-a1831ab8.js → OrInlineTextarea.vue_vue_type_script_lang-d9e0eb26.js} +2 -2
  39. package/dist/bundled/v3/{OrInput-a4f220ed.js → OrInput-a0b9a900.js} +1 -1
  40. package/dist/bundled/v3/{OrInput.vue_vue_type_script_lang-607d79d4.js → OrInput.vue_vue_type_script_lang-f3ce4d61.js} +2 -2
  41. package/dist/bundled/v3/{OrModal.vue_vue_type_script_lang-55c864d1.js → OrModal.vue_vue_type_script_lang-e4f57a5e.js} +2 -2
  42. package/dist/bundled/v3/{OrNotification.vue_vue_type_script_lang-c886ae51.js → OrNotification.vue_vue_type_script_lang-f580ebc1.js} +2 -2
  43. package/dist/bundled/v3/{OrSearch.vue_vue_type_script_lang-06f318ca.js → OrSearch.vue_vue_type_script_lang-8c220bb4.js} +2 -2
  44. package/dist/bundled/v3/{OrSelect.vue_vue_type_script_lang-83f15704.js → OrSelect.vue_vue_type_script_lang-3f4e09e9.js} +3 -3
  45. package/dist/bundled/v3/OrSidebar.vue_vue_type_script_lang-ce0b152c.js +181 -0
  46. package/dist/bundled/v3/{OrTag.vue_vue_type_script_lang-3e30f662.js → OrTag.vue_vue_type_script_lang-5db8644c.js} +2 -2
  47. package/dist/bundled/v3/{OrToastContainer-34389303.js → OrToastContainer-c5d7acf8.js} +1 -1
  48. package/dist/bundled/v3/components/index.js +15 -15
  49. package/dist/bundled/v3/components/or-card-collection-v3/index.js +6 -6
  50. package/dist/bundled/v3/components/or-confirm-v3/index.js +5 -5
  51. package/dist/bundled/v3/components/or-icon-button-v3/OrIconButton.vue.d.ts +11 -0
  52. package/dist/bundled/v3/components/or-icon-button-v3/index.js +1 -1
  53. package/dist/bundled/v3/components/or-inline-input-v3/index.js +3 -3
  54. package/dist/bundled/v3/components/or-inline-textarea-v3/index.js +3 -3
  55. package/dist/bundled/v3/components/or-input-v3/index.js +3 -3
  56. package/dist/bundled/v3/components/or-modal-v3/index.js +3 -3
  57. package/dist/bundled/v3/components/or-notification-v3/index.js +3 -3
  58. package/dist/bundled/v3/components/or-search-v3/index.js +5 -5
  59. package/dist/bundled/v3/components/or-select-v3/index.js +6 -6
  60. package/dist/bundled/v3/components/or-sidebar-v3/OrSidebar.stories3.d.ts +1 -36
  61. package/dist/bundled/v3/components/or-sidebar-v3/OrSidebar.vue.d.ts +4 -49
  62. package/dist/bundled/v3/components/or-sidebar-v3/index.js +1 -15
  63. package/dist/bundled/v3/components/or-sidebar-v3/styles.d.ts +1 -9
  64. package/dist/bundled/v3/components/or-tag-v3/index.js +3 -3
  65. package/dist/bundled/v3/components/or-toast-v3/index.js +4 -4
  66. package/dist/bundled/v3/index.js +31 -47
  67. package/dist/bundled/v3/{types-f53434f2.js → types-f7b07e1a.js} +2 -2
  68. package/dist/esm/v2/{OrCardCollection-3c38fc85.js → OrCardCollection-259b2e2b.js} +2 -2
  69. package/dist/esm/v2/{OrConfirm-047d4086.js → OrConfirm-921dbb5d.js} +1 -1
  70. package/dist/esm/v2/{OrIconButton-b3779042.js → OrIconButton-3c81fd64.js} +10 -3
  71. package/dist/esm/v2/{OrInlineInput-10205811.js → OrInlineInput-1ad5ea15.js} +1 -1
  72. package/dist/esm/v2/{OrInlineTextarea-7658611e.js → OrInlineTextarea-bfe528e7.js} +1 -1
  73. package/dist/esm/v2/{OrInput-ada3a970.js → OrInput-59cc6981.js} +1 -1
  74. package/dist/esm/v2/{OrModal-a7719843.js → OrModal-8c6fdab4.js} +1 -1
  75. package/dist/esm/v2/{OrNotification-8a4830a3.js → OrNotification-c0d70dc7.js} +1 -1
  76. package/dist/esm/v2/{OrSearch-0f08f2f5.js → OrSearch-ebc3b81c.js} +1 -1
  77. package/dist/esm/v2/{OrSelect-f8837f5d.js → OrSelect-7317a963.js} +2 -2
  78. package/dist/esm/v2/OrSidebar-fabc7bc9.js +228 -0
  79. package/dist/esm/v2/{OrTag-5c404031.js → OrTag-842193c2.js} +1 -1
  80. package/dist/esm/v2/components/index.js +13 -13
  81. package/dist/esm/v2/components/or-card-collection-v3/index.js +4 -4
  82. package/dist/esm/v2/components/or-confirm-v3/index.js +3 -3
  83. package/dist/esm/v2/components/or-icon-button-v3/OrIconButton.vue.d.ts +11 -0
  84. package/dist/esm/v2/components/or-icon-button-v3/index.js +1 -1
  85. package/dist/esm/v2/components/or-inline-input-v3/index.js +2 -2
  86. package/dist/esm/v2/components/or-inline-textarea-v3/index.js +2 -2
  87. package/dist/esm/v2/components/or-input-v3/index.js +2 -2
  88. package/dist/esm/v2/components/or-modal-v3/index.js +2 -2
  89. package/dist/esm/v2/components/or-notification-v3/index.js +2 -2
  90. package/dist/esm/v2/components/or-search-v3/index.js +3 -3
  91. package/dist/esm/v2/components/or-select-v3/index.js +4 -4
  92. package/dist/esm/v2/components/or-sidebar-v3/OrSidebar.stories3.d.ts +1 -36
  93. package/dist/esm/v2/components/or-sidebar-v3/OrSidebar.vue.d.ts +4 -49
  94. package/dist/esm/v2/components/or-sidebar-v3/index.js +1 -13
  95. package/dist/esm/v2/components/or-sidebar-v3/styles.d.ts +1 -9
  96. package/dist/esm/v2/components/or-tag-v3/index.js +2 -2
  97. package/dist/esm/v2/components/or-toast-v3/index.js +2 -2
  98. package/dist/esm/v2/index.js +13 -13
  99. package/dist/esm/v2/{types-6c742e07.js → types-3ff6f029.js} +1 -1
  100. package/dist/esm/v3/{OrCardCollection-dbb3e839.js → OrCardCollection-2886a9ca.js} +2 -2
  101. package/dist/esm/v3/{OrConfirm-fee3c859.js → OrConfirm-1d9bfd2a.js} +1 -1
  102. package/dist/esm/v3/{OrIconButton-1a89fbf9.js → OrIconButton-7a512558.js} +11 -4
  103. package/dist/esm/v3/{OrInlineInput-507fc99c.js → OrInlineInput-54c7b053.js} +1 -1
  104. package/dist/esm/v3/{OrInlineTextarea-53a9e027.js → OrInlineTextarea-5a8fc512.js} +1 -1
  105. package/dist/esm/v3/{OrInput-9c0426b9.js → OrInput-639352e4.js} +1 -1
  106. package/dist/esm/v3/{OrModal-7878cc39.js → OrModal-4cd576c7.js} +1 -1
  107. package/dist/esm/v3/{OrNotification-e1383681.js → OrNotification-cb49acef.js} +1 -1
  108. package/dist/esm/v3/{OrSearch-9885d178.js → OrSearch-8caf7e53.js} +1 -1
  109. package/dist/esm/v3/{OrSelect-8fbd88bc.js → OrSelect-3932d4bd.js} +2 -2
  110. package/dist/esm/v3/OrSidebar-a62972f5.js +206 -0
  111. package/dist/esm/v3/{OrTag-5d54f37d.js → OrTag-6db3aaf7.js} +1 -1
  112. package/dist/esm/v3/components/index.js +13 -13
  113. package/dist/esm/v3/components/or-card-collection-v3/index.js +4 -4
  114. package/dist/esm/v3/components/or-confirm-v3/index.js +3 -3
  115. package/dist/esm/v3/components/or-icon-button-v3/OrIconButton.vue.d.ts +11 -0
  116. package/dist/esm/v3/components/or-icon-button-v3/index.js +1 -1
  117. package/dist/esm/v3/components/or-inline-input-v3/index.js +2 -2
  118. package/dist/esm/v3/components/or-inline-textarea-v3/index.js +2 -2
  119. package/dist/esm/v3/components/or-input-v3/index.js +2 -2
  120. package/dist/esm/v3/components/or-modal-v3/index.js +2 -2
  121. package/dist/esm/v3/components/or-notification-v3/index.js +2 -2
  122. package/dist/esm/v3/components/or-search-v3/index.js +3 -3
  123. package/dist/esm/v3/components/or-select-v3/index.js +4 -4
  124. package/dist/esm/v3/components/or-sidebar-v3/OrSidebar.stories3.d.ts +1 -36
  125. package/dist/esm/v3/components/or-sidebar-v3/OrSidebar.vue.d.ts +4 -49
  126. package/dist/esm/v3/components/or-sidebar-v3/index.js +1 -12
  127. package/dist/esm/v3/components/or-sidebar-v3/styles.d.ts +1 -9
  128. package/dist/esm/v3/components/or-tag-v3/index.js +2 -2
  129. package/dist/esm/v3/components/or-toast-v3/index.js +2 -2
  130. package/dist/esm/v3/index.js +13 -13
  131. package/dist/esm/v3/{types-2692e337.js → types-85bee366.js} +1 -1
  132. package/package.json +1 -1
  133. package/src/components/or-icon-button-v3/OrIconButton.stories3.ts +4 -0
  134. package/src/components/or-icon-button-v3/OrIconButton.vue +6 -0
  135. package/src/components/or-icon-button-v3/styles.ts +13 -0
  136. package/src/components/or-sidebar-v3/OrSidebar.docs.mdx +0 -6
  137. package/src/components/or-sidebar-v3/OrSidebar.stories3.ts +12 -253
  138. package/src/components/or-sidebar-v3/OrSidebar.vue +23 -130
  139. package/src/components/or-sidebar-v3/styles.ts +9 -164
  140. package/dist/bundled/v2/OrSidebar-eedd2d6e.js +0 -464
  141. package/dist/bundled/v2/components/or-sidebar-v3/OrSidebarCollapseButton.stories3.d.ts +0 -12
  142. package/dist/bundled/v2/components/or-sidebar-v3/OrSidebarCollapseButton.vue.d.ts +0 -53
  143. package/dist/bundled/v3/OrSidebar.vue_vue_type_script_lang-6dc222bd.js +0 -356
  144. package/dist/bundled/v3/components/or-sidebar-v3/OrSidebarCollapseButton.stories3.d.ts +0 -12
  145. package/dist/bundled/v3/components/or-sidebar-v3/OrSidebarCollapseButton.vue.d.ts +0 -53
  146. package/dist/esm/v2/OrSidebar-e43a6e55.js +0 -461
  147. package/dist/esm/v2/components/or-sidebar-v3/OrSidebarCollapseButton.stories3.d.ts +0 -12
  148. package/dist/esm/v2/components/or-sidebar-v3/OrSidebarCollapseButton.vue.d.ts +0 -53
  149. package/dist/esm/v3/OrSidebar-2abaf7d6.js +0 -396
  150. package/dist/esm/v3/components/or-sidebar-v3/OrSidebarCollapseButton.stories3.d.ts +0 -12
  151. package/dist/esm/v3/components/or-sidebar-v3/OrSidebarCollapseButton.vue.d.ts +0 -53
  152. package/src/components/or-sidebar-v3/OrSidebarCollapseButton.stories3.ts +0 -48
  153. package/src/components/or-sidebar-v3/OrSidebarCollapseButton.vue +0 -74
@@ -1,396 +0,0 @@
1
- import { useDraggable, useElementBounding } from '@vueuse/core';
2
- import _ from 'lodash';
3
- import { defineComponent, ref, computed, useSlots, watch } from 'vue-demi';
4
- import { s as script$2 } from './OrIconButton-1a89fbf9.js';
5
- import { resolveComponent, openBlock, createElementBlock, normalizeClass, createVNode, renderSlot, createCommentVNode, createElementVNode, normalizeStyle, createBlock, withDirectives, vShow } from 'vue';
6
-
7
- var OrSidebarPlacement;
8
- (function (OrSidebarPlacement) {
9
- OrSidebarPlacement["left"] = "left";
10
- OrSidebarPlacement["right"] = "right";
11
- })(OrSidebarPlacement || (OrSidebarPlacement = {}));
12
-
13
- const SidebarRoot = [
14
- // Position
15
- 'relative',
16
- // Layout
17
- 'flex', 'flex-row', 'shrink-0',
18
- // Box
19
- 'min-w-0', 'h-auto', 'p-0',
20
- // Theme
21
- 'bg-background', 'dark:bg-background-dark'];
22
- const SidebarBar = [
23
- // Position
24
- 'relative',
25
- // Layout
26
- 'flex', 'flex-col', 'shrink-0', 'grow',
27
- // Box
28
- 'min-h-0', 'p-0',
29
- // Theme
30
- 'text-on-background', 'dark:text-on-background-dark',
31
- // Transition
32
- 'transition-[width]'];
33
- const SidebarToolbar = [
34
- // Position
35
- 'relative',
36
- // Layout
37
- 'flex', 'flex-col', 'shrink-0', 'grow', 'overflow-auto', 'items-center',
38
- // Sizing
39
- 'gap-md',
40
- // Box
41
- 'min-h-0', 'min-w-xl', 'p-[6px]', 'py-md+',
42
- // Theme
43
- 'text-outline', 'dark:text-outline-dark'];
44
- const CollapsibleSidebarToolbar = ['pt-[56px]'];
45
- const SidebarSides = {
46
- [OrSidebarPlacement.left]: [
47
- // Borders
48
- 'border-r-[1px]', 'border-r-solid', 'border-r-outline-variant dark:border-r-outline-variant-dark'],
49
- [OrSidebarPlacement.right]: [
50
- // Borders
51
- 'border-l-[1px]', 'border-l-solid', 'border-l-outline-variant dark:border-l-outline-variant-dark']
52
- };
53
- const SidebarToolbarSides = {
54
- [OrSidebarPlacement.left]: [
55
- // Borders
56
- 'border-r-[1px]', 'border-r-solid', 'border-r-outline-variant dark:border-r-outline-variant-dark'],
57
- [OrSidebarPlacement.right]: [
58
- // Borders
59
- 'border-l-[1px]', 'border-l-solid', 'border-l-outline-variant dark:border-l-outline-variant-dark']
60
- };
61
- const SidebarResize = [
62
- // Position
63
- 'absolute', 'inset-y-none', 'z-[1]',
64
- // Box
65
- 'w-sm+', 'h-[100%]',
66
- // Cursor
67
- 'cursor-ew-resize'];
68
- const SidebarResizeSides = {
69
- [OrSidebarPlacement.left]: [
70
- // Position
71
- '-right-[1px]',
72
- // Borders
73
- 'hover:border-r-2', 'hover:border-r-primary-hover hover:dark:border-r-primary-hover-dark',
74
- // Transition
75
- 'transition-[border-right]'],
76
- [OrSidebarPlacement.right]: [
77
- // Position
78
- '-left-[1px]',
79
- // Borders
80
- 'hover:border-l-2', 'hover:border-l-primary-hover hover:dark:border-l-primary-hover-dark',
81
- // Transition
82
- 'transition-[border-left]']
83
- };
84
- const SidebarCollapseButton = [
85
- // Position
86
- 'absolute', 'top-md', 'inset-y-none', 'z-[1]'];
87
- const SidebarCollapseButtonSides = {
88
- [OrSidebarPlacement.left]: [
89
- // Position
90
- '-right-[12px]'],
91
- [OrSidebarPlacement.right]: [
92
- // Position
93
- '-left-[12px]']
94
- };
95
- const SidebarResizingSides = {
96
- [OrSidebarPlacement.left]: [
97
- // Borders
98
- 'border-r-2', 'border-r-primary-hover dark:border-r-primary-hover-dark'],
99
- [OrSidebarPlacement.right]: [
100
- // Borders
101
- 'border-l-2', 'border-l-primary-hover dark:border-l-primary-hover-dark']
102
- };
103
- const SidebarMain = [
104
- // Layout
105
- 'flex', 'flex-col', 'grow', 'overflow-x-hidden',
106
- // Box
107
- 'min-h-0'];
108
- const SidebarHeader = [
109
- // Layout
110
- 'shrink-0', 'overflow-hidden',
111
- // Sizing
112
- 'p-md',
113
- // Typography
114
- 'typography-headline-2', 'whitespace-nowrap', 'text-ellipsis'];
115
- const SidebarContent = [
116
- // Layout
117
- 'grow', 'overflow-auto',
118
- // Sizing
119
- 'p-md'];
120
- const SidebarFooter = [
121
- // Layout
122
- 'shrink-0', 'overflow-x-hidden',
123
- // Sizing
124
- 'p-md',
125
- // Borders
126
- 'border-t-[1px]', 'border-t-solid', 'border-t-outline-variant dark:border-t-outline-variant-dark'];
127
- const CollapseButtonContainer = [
128
- // Box
129
- 'w-[24px]', 'h-[24px]', 'rounded-full',
130
- // Theme
131
- 'text-primary dark:text-primary-dark', 'bg-background dark:bg-background-dark'];
132
- const CollapseButton = [
133
- // Box
134
- 'w-[24px]', 'h-[24px]',
135
- // Typography
136
- '!text-[16px]',
137
- // Borders
138
- '!border-[1px]', '!border-solid',
139
- // Theme
140
- '!text-primary dark:!text-primary-dark', '!bg-background dark:!bg-background-dark', '!border-outline-variant dark:!border-outline-variant-dark', '!outline-none',
141
- // Theme (hover)
142
- 'hover:!text-primary hover:dark:!text-primary-dark', 'hover:!bg-primary-opacity-0-08 dark:hover:!bg-primary-opacity-0-08-dark', 'hover:!border-outline dark:hover:!border-outline-dark',
143
- // Theme (active)
144
- 'active:!text-primary active:dark:!text-primary-dark', 'active:!bg-primary-opacity-0-12 dark:active:!bg-primary-opacity-0-12-dark', 'active:!border-primary dark:active:!border-primary-dark',
145
- // Theme (focus)
146
- 'focus:!text-primary focus:dark:!text-primary-dark', 'focus:!bg-primary-opacity-0-12 dark:focus:!bg-primary-opacity-0-12-dark', 'focus:!border-outline dark:focus:!border-outline-dark',
147
- // Theme (disabled)
148
- 'disabled:!text-on-disabled disabled:dark:!text-on-disabled-dark', 'disabled:!bg-background disabled:dark:!bg-background-dark', 'disabled:!border-outline-variant disabled:dark:!border-outline-variant-dark'];
149
-
150
- var script$1 = defineComponent({
151
- name: 'OrSidebarCollapseButton',
152
- components: {
153
- OrIconButton: script$2
154
- },
155
- props: {
156
- /**
157
- * Must be `true` if sidebar is collapsed.
158
- */
159
- modelValue: {
160
- type: Boolean,
161
- default: false
162
- },
163
- side: {
164
- type: String,
165
- default: OrSidebarPlacement.right,
166
- validator: value => _.includes(_.values(OrSidebarPlacement), value)
167
- }
168
- },
169
- emits: ['update:modelValue'],
170
- expose: ['root'],
171
- setup(props) {
172
- // Refs
173
- const root = ref();
174
- const rootStyles = computed(() => ['or-sidebar-collapse-button', ...CollapseButtonContainer]);
175
- const buttonStyles = computed(() => [...CollapseButton]);
176
- const icon = computed(() => props.side === OrSidebarPlacement.left !== props.modelValue ? 'keyboard_arrow_left' : 'keyboard_arrow_right');
177
- return {
178
- root,
179
- rootStyles,
180
- buttonStyles,
181
- icon
182
- };
183
- }
184
- });
185
-
186
- function render$1(_ctx, _cache, $props, $setup, $data, $options) {
187
- const _component_or_icon_button = resolveComponent("or-icon-button");
188
- return openBlock(), createElementBlock("div", {
189
- ref: "root",
190
- class: normalizeClass(_ctx.rootStyles)
191
- }, [createVNode(_component_or_icon_button, {
192
- class: normalizeClass(_ctx.buttonStyles),
193
- icon: {
194
- icon: _ctx.icon,
195
- size: 'inherit'
196
- },
197
- color: "inherit",
198
- onClick: _cache[0] || (_cache[0] = $event => _ctx.$emit('update:modelValue', !_ctx.modelValue))
199
- }, null, 8 /* PROPS */, ["class", "icon"])], 2 /* CLASS */);
200
- }
201
-
202
- script$1.render = render$1;
203
- script$1.__file = "src/components/or-sidebar-v3/OrSidebarCollapseButton.vue";
204
-
205
- var script = defineComponent({
206
- name: 'OrSidebar',
207
- components: {
208
- OrSidebarCollapseButton: script$1
209
- },
210
- props: {
211
- width: {
212
- type: Number,
213
- default: 320,
214
- validator: value => _.isNumber(value) && value >= 0
215
- },
216
- minimumWidth: {
217
- type: Number,
218
- default: 256,
219
- validator: value => _.isNumber(value) && value >= 0
220
- },
221
- maximumWidth: {
222
- type: Number,
223
- default: 384,
224
- validator: value => _.isNumber(value) && value >= 0
225
- },
226
- /**
227
- * User may put the component on the right or the left side of a container.
228
- * This property mirrors the resizing behavior (drag direction) and styling (horizontal border) of the sidebar.
229
- *
230
- * Note: the property doesn't reposition the component in the parent container.
231
- * @values left, right
232
- */
233
- side: {
234
- type: String,
235
- default: OrSidebarPlacement.right,
236
- validator: value => _.includes(_.values(OrSidebarPlacement), value)
237
- },
238
- draggable: {
239
- type: Boolean,
240
- default: true
241
- },
242
- collapsible: {
243
- type: Boolean,
244
- default: false
245
- }
246
- },
247
- emits: ['change:width', 'open', 'close'],
248
- expose: ['root', 'open', 'close'],
249
- setup(props, {
250
- emit
251
- }) {
252
- // Refs
253
- const root = ref();
254
- const resizeBar = ref(null);
255
- const parentContainer = computed(() => {
256
- var _a;
257
- return (_a = root.value) === null || _a === void 0 ? void 0 : _a.parentElement;
258
- });
259
- // Slots
260
- const {
261
- toolbar: toolbarSlot
262
- } = useSlots();
263
- // State
264
- const startPositionX = ref(0);
265
- const isResizing = ref(false);
266
- const isCollapsed = ref(false);
267
- const maximumWidth = ref(props.maximumWidth || 384);
268
- const localWidth = ref(props.width >= props.minimumWidth ? props.width : props.minimumWidth);
269
- const isShowingToolbar = computed(() => !!toolbarSlot);
270
- // Styles
271
- const sidebarStyle = computed(() => ({
272
- width: (isCollapsed.value ? 16 : localWidth.value) + 'px'
273
- }));
274
- const rootStyles = computed(() => ['or-sidebar', ...SidebarRoot]);
275
- const sidebarStyles = computed(() => [...SidebarBar, ...SidebarSides[props.side]]);
276
- const toolbarStyles = computed(() => [...SidebarToolbar, ...(props.collapsible ? CollapsibleSidebarToolbar : []), ...SidebarToolbarSides[props.side]]);
277
- const resizeStyles = computed(() => [...SidebarResize, ...SidebarResizeSides[props.side], ...(isResizing.value ? SidebarResizingSides[props.side] : [])]);
278
- const collapsibleButtonStyles = computed(() => [...SidebarCollapseButton, ...SidebarCollapseButtonSides[props.side]]);
279
- const mainStyles = computed(() => [...SidebarMain]);
280
- const headerStyles = computed(() => [...SidebarHeader]);
281
- const contentStyles = computed(() => [...SidebarContent]);
282
- const footerStyles = computed(() => [...SidebarFooter]);
283
- // Effects
284
- useDraggable(resizeBar, {
285
- preventDefault: true,
286
- onStart: (position, event) => {
287
- document.body.style.cursor = 'ew-resize';
288
- document.body.style.userSelect = 'none';
289
- startPositionX.value = event.x;
290
- isResizing.value = true;
291
- },
292
- onMove: position => {
293
- const delta = (position.x - startPositionX.value) * (props.side === OrSidebarPlacement.left ? -1 : 1);
294
- const newWidth = localWidth.value - delta;
295
- localWidth.value = newWidth > maximumWidth.value ? maximumWidth.value : newWidth < props.minimumWidth ? props.minimumWidth : newWidth;
296
- startPositionX.value = position.x;
297
- },
298
- onEnd: () => {
299
- document.body.style.cursor = '';
300
- document.body.style.userSelect = '';
301
- isResizing.value = false;
302
- }
303
- });
304
- // Methods
305
- function open() {
306
- isCollapsed.value = false;
307
- }
308
- function close() {
309
- isCollapsed.value = true;
310
- }
311
- const {
312
- width: containerWidth
313
- } = useElementBounding(parentContainer);
314
- watch(() => props.width, newValue => {
315
- if (newValue !== localWidth.value) {
316
- localWidth.value = newValue > maximumWidth.value ? maximumWidth.value : newValue < props.minimumWidth ? props.minimumWidth : newValue;
317
- }
318
- });
319
- watch(() => props.minimumWidth, newMinimum => {
320
- if (newMinimum > localWidth.value) localWidth.value = newMinimum;
321
- });
322
- watch(() => props.maximumWidth, newMaximum => {
323
- if (newMaximum < maximumWidth.value) maximumWidth.value = newMaximum;
324
- });
325
- watch(containerWidth, newMaximum => {
326
- if (newMaximum < maximumWidth.value) maximumWidth.value = newMaximum;
327
- });
328
- watch(maximumWidth, newMaximum => {
329
- if (newMaximum < localWidth.value) localWidth.value = newMaximum;
330
- });
331
- watch(localWidth, val => emit('change:width', val));
332
- watch(isCollapsed, val => emit(val ? 'close' : 'open'));
333
- return {
334
- root,
335
- resizeBar,
336
- isResizing,
337
- isCollapsed,
338
- localWidth,
339
- isShowingToolbar,
340
- sidebarStyle,
341
- rootStyles,
342
- sidebarStyles,
343
- toolbarStyles,
344
- resizeStyles,
345
- collapsibleButtonStyles,
346
- mainStyles,
347
- headerStyles,
348
- contentStyles,
349
- footerStyles,
350
- open,
351
- close
352
- };
353
- }
354
- });
355
-
356
- function render(_ctx, _cache, $props, $setup, $data, $options) {
357
- const _component_or_sidebar_collapse_button = resolveComponent("or-sidebar-collapse-button");
358
- return openBlock(), createElementBlock("aside", {
359
- ref: "root",
360
- class: normalizeClass(_ctx.rootStyles)
361
- }, [_ctx.side === 'right' && _ctx.isShowingToolbar ? (openBlock(), createElementBlock("div", {
362
- key: 0,
363
- class: normalizeClass(_ctx.toolbarStyles)
364
- }, [renderSlot(_ctx.$slots, "toolbar")], 2 /* CLASS */)) : createCommentVNode("v-if", true), createElementVNode("div", {
365
- class: normalizeClass(_ctx.sidebarStyles),
366
- style: normalizeStyle(_ctx.sidebarStyle)
367
- }, [_ctx.draggable && !_ctx.isCollapsed ? (openBlock(), createElementBlock("div", {
368
- key: 0,
369
- ref: "resizeBar",
370
- class: normalizeClass(_ctx.resizeStyles)
371
- }, null, 2 /* CLASS */)) : createCommentVNode("v-if", true), _ctx.collapsible ? (openBlock(), createBlock(_component_or_sidebar_collapse_button, {
372
- key: 1,
373
- modelValue: _ctx.isCollapsed,
374
- "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => _ctx.isCollapsed = $event),
375
- class: normalizeClass(_ctx.collapsibleButtonStyles),
376
- side: _ctx.side
377
- }, null, 8 /* PROPS */, ["modelValue", "class", "side"])) : createCommentVNode("v-if", true), withDirectives(createElementVNode("div", {
378
- class: normalizeClass(_ctx.mainStyles)
379
- }, [_ctx.$slots.header ? (openBlock(), createElementBlock("div", {
380
- key: 0,
381
- class: normalizeClass(_ctx.headerStyles)
382
- }, [renderSlot(_ctx.$slots, "header")], 2 /* CLASS */)) : createCommentVNode("v-if", true), createElementVNode("div", {
383
- class: normalizeClass(_ctx.contentStyles)
384
- }, [renderSlot(_ctx.$slots, "default")], 2 /* CLASS */)], 2 /* CLASS */), [[vShow, !_ctx.isCollapsed]]), _ctx.$slots.footer ? withDirectives((openBlock(), createElementBlock("div", {
385
- key: 2,
386
- class: normalizeClass(_ctx.footerStyles)
387
- }, [renderSlot(_ctx.$slots, "footer")], 2 /* CLASS */)), [[vShow, !_ctx.isCollapsed]]) : createCommentVNode("v-if", true)], 6 /* CLASS, STYLE */), _ctx.side === 'left' && _ctx.isShowingToolbar ? (openBlock(), createElementBlock("div", {
388
- key: 1,
389
- class: normalizeClass(_ctx.toolbarStyles)
390
- }, [renderSlot(_ctx.$slots, "toolbar")], 2 /* CLASS */)) : createCommentVNode("v-if", true)], 2 /* CLASS */);
391
- }
392
-
393
- script.render = render;
394
- script.__file = "src/components/or-sidebar-v3/OrSidebar.vue";
395
-
396
- export { OrSidebarPlacement as O, script as s };
@@ -1,12 +0,0 @@
1
- import { Meta, StoryFn } from '@storybook/vue3';
2
- declare const _default: Meta<import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<unknown>, import("@vue/composition-api").MethodOptions, import("@vue/composition-api").ComputedOptions, import("@vue/composition-api").ComponentPropsOptions<import("@vue/composition-api").Data>, import("@vue/composition-api").ExtractPropTypes<import("@vue/composition-api").ComponentPropsOptions<import("@vue/composition-api").Data>>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{} & {}, import("@vue/composition-api").ShallowUnwrapRef<unknown>, unknown, import("@vue/composition-api").ComputedOptions, import("@vue/composition-api").MethodOptions, unknown, unknown, {
3
- [x: string]: ((...args: any[]) => any) | null;
4
- } | string[], {} & {}, {
5
- [x: number]: string;
6
- } | {}, true>)>;
7
- export default _default;
8
- export declare const Default: StoryFn<import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<unknown>, import("@vue/composition-api").MethodOptions, import("@vue/composition-api").ComputedOptions, import("@vue/composition-api").ComponentPropsOptions<import("@vue/composition-api").Data>, import("@vue/composition-api").ExtractPropTypes<import("@vue/composition-api").ComponentPropsOptions<import("@vue/composition-api").Data>>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{} & {}, import("@vue/composition-api").ShallowUnwrapRef<unknown>, unknown, import("@vue/composition-api").ComputedOptions, import("@vue/composition-api").MethodOptions, unknown, unknown, {
9
- [x: string]: ((...args: any[]) => any) | null;
10
- } | string[], {} & {}, {
11
- [x: number]: string;
12
- } | {}, true>)>;
@@ -1,53 +0,0 @@
1
- import { PropType } from 'vue-demi';
2
- import { OrSidebarPlacement } from './props';
3
- declare const _default: import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<{
4
- root: import("@vue/composition-api").Ref<HTMLDivElement | undefined>;
5
- rootStyles: import("@vue/composition-api").ComputedRef<string[]>;
6
- buttonStyles: import("@vue/composition-api").ComputedRef<string[]>;
7
- icon: import("@vue/composition-api").ComputedRef<"keyboard_arrow_left" | "keyboard_arrow_right">;
8
- }> & import("@vue/composition-api").Data, {}, {}, {
9
- /**
10
- * Must be `true` if sidebar is collapsed.
11
- */
12
- modelValue: {
13
- type: BooleanConstructor;
14
- default: boolean;
15
- };
16
- side: {
17
- type: PropType<OrSidebarPlacement>;
18
- default: OrSidebarPlacement;
19
- validator: (value?: any) => boolean;
20
- };
21
- }, import("@vue/composition-api").ExtractPropTypes<{
22
- /**
23
- * Must be `true` if sidebar is collapsed.
24
- */
25
- modelValue: {
26
- type: BooleanConstructor;
27
- default: boolean;
28
- };
29
- side: {
30
- type: PropType<OrSidebarPlacement>;
31
- default: OrSidebarPlacement;
32
- validator: (value?: any) => boolean;
33
- };
34
- }>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
35
- modelValue: boolean;
36
- side: OrSidebarPlacement;
37
- } & {} & {
38
- [x: string & `on${string}`]: ((...args: any[]) => any) | undefined;
39
- }, import("@vue/composition-api").ShallowUnwrapRef<{
40
- root: import("@vue/composition-api").Ref<HTMLDivElement | undefined>;
41
- rootStyles: import("@vue/composition-api").ComputedRef<string[]>;
42
- buttonStyles: import("@vue/composition-api").ComputedRef<string[]>;
43
- icon: import("@vue/composition-api").ComputedRef<"keyboard_arrow_left" | "keyboard_arrow_right">;
44
- }>, import("@vue/composition-api").Data, {}, {}, {}, {}, string[], {
45
- modelValue: boolean;
46
- side: OrSidebarPlacement;
47
- } & {} & {
48
- [x: string & `on${string}`]: ((...args: any[]) => any) | undefined;
49
- }, {
50
- modelValue: boolean;
51
- side: OrSidebarPlacement;
52
- }, true>);
53
- export default _default;
@@ -1,48 +0,0 @@
1
- import { Meta, StoryFn } from '@storybook/vue3';
2
- import OrSidebarCollapseButton from './OrSidebarCollapseButton.vue';
3
- import { OrSidebarPlacement } from './props';
4
- import { action } from '@storybook/addon-actions';
5
- import { ref } from 'vue-demi';
6
-
7
- export default {
8
- title: 'Components/Sidebar/Parts/CollapseButton',
9
- component: OrSidebarCollapseButton,
10
-
11
- argTypes: {
12
- // Props
13
- modelValue: {
14
- control: { type: 'boolean' },
15
- },
16
-
17
- side: {
18
- control: { type: 'select' },
19
- options: Object.values(OrSidebarPlacement),
20
- },
21
- },
22
- } as Meta<typeof OrSidebarCollapseButton>;
23
-
24
- const DefaultTemplate: StoryFn<typeof OrSidebarCollapseButton> = (args) => ({
25
- components: {
26
- OrSidebarCollapseButton,
27
- },
28
-
29
- setup() {
30
- const collapsed = ref<boolean>(!!args.modelValue);
31
-
32
- return {
33
- args,
34
- collapsed,
35
- };
36
- },
37
-
38
- methods: {
39
- onUpdateModelValue: action('update:modelValue'),
40
- },
41
-
42
- template: '<OrSidebarCollapseButton v-model="collapsed" v-bind="args" @update:modelValue="onUpdateModelValue" />',
43
- });
44
-
45
- export const Default = DefaultTemplate.bind({});
46
- Default.args = {
47
- side: OrSidebarPlacement.right,
48
- };
@@ -1,74 +0,0 @@
1
- <template>
2
- <div
3
- ref="root"
4
- :class="rootStyles"
5
- >
6
- <or-icon-button
7
- :class="buttonStyles"
8
- :icon="{ icon, size: 'inherit' }"
9
- color="inherit"
10
- @click="$emit('update:modelValue', !modelValue)"
11
- />
12
- </div>
13
- </template>
14
-
15
- <script lang="ts">
16
- import _ from 'lodash';
17
- import { computed, defineComponent, PropType, ref } from 'vue-demi';
18
- import { OrSidebarPlacement } from './props';
19
- import { OrIconButtonV3 as OrIconButton } from '../or-icon-button-v3';
20
- import { CollapseButton, CollapseButtonContainer } from './styles';
21
-
22
- export default defineComponent({
23
- name: 'OrSidebarCollapseButton',
24
-
25
- components: {
26
- OrIconButton,
27
- },
28
-
29
- props: {
30
- /**
31
- * Must be `true` if sidebar is collapsed.
32
- */
33
- modelValue: {
34
- type: Boolean,
35
- default: false,
36
- },
37
- side: {
38
- type: String as PropType<OrSidebarPlacement>,
39
- default: OrSidebarPlacement.right,
40
- validator: (value?: any) => _.includes(_.values(OrSidebarPlacement), value),
41
- },
42
- },
43
-
44
- emits: ['update:modelValue'],
45
-
46
- expose: ['root'],
47
-
48
- setup(props) {
49
- // Refs
50
- const root = ref<InstanceType<typeof HTMLDivElement>>();
51
-
52
- const rootStyles = computed(() => [
53
- 'or-sidebar-collapse-button',
54
- ...CollapseButtonContainer,
55
- ]);
56
-
57
- const buttonStyles = computed(() => [
58
- ...CollapseButton,
59
- ]);
60
-
61
- const icon = computed(() => (props.side === OrSidebarPlacement.left !== props.modelValue) ?
62
- 'keyboard_arrow_left' :
63
- 'keyboard_arrow_right',
64
- );
65
-
66
- return {
67
- root,
68
- rootStyles,
69
- buttonStyles,
70
- icon,
71
- };
72
- },
73
- });
74
- </script>