@onereach/ui-components 2.72.1 → 2.72.2-beta.2260.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 (56) hide show
  1. package/dist/bundled/v2/{OrSidebar-c95ef614.js → OrSidebar-64cc9127.js} +92 -86
  2. package/dist/bundled/v2/OrSidebarCollapseButton-fcc085c7.js +235 -0
  3. package/dist/bundled/v2/components/index.js +2 -1
  4. package/dist/bundled/v2/components/or-sidebar-v3/OrSidebar.stories3.d.ts +36 -1
  5. package/dist/bundled/v2/components/or-sidebar-v3/OrSidebar.vue.d.ts +49 -4
  6. package/dist/bundled/v2/components/or-sidebar-v3/index.js +13 -1
  7. package/dist/bundled/v2/components/or-sidebar-v3/partials/OrSidebarCollapseButton.stories3.d.ts +12 -0
  8. package/dist/bundled/v2/components/or-sidebar-v3/partials/OrSidebarCollapseButton.vue.d.ts +53 -0
  9. package/dist/bundled/v2/components/or-sidebar-v3/partials/index.d.ts +1 -0
  10. package/dist/bundled/v2/components/or-sidebar-v3/partials/index.js +18 -0
  11. package/dist/bundled/v2/components/or-sidebar-v3/styles.d.ts +9 -1
  12. package/dist/bundled/v2/index.js +3 -2
  13. package/dist/bundled/v3/{OrSidebar.vue_vue_type_script_lang-ce0b152c.js → OrSidebar.vue_vue_type_script_lang-a150808b.js} +75 -80
  14. package/dist/bundled/v3/OrSidebarCollapseButton.vue_vue_type_script_lang-d3e3cd4f.js +185 -0
  15. package/dist/bundled/v3/components/index.js +2 -1
  16. package/dist/bundled/v3/components/or-sidebar-v3/OrSidebar.stories3.d.ts +36 -1
  17. package/dist/bundled/v3/components/or-sidebar-v3/OrSidebar.vue.d.ts +49 -4
  18. package/dist/bundled/v3/components/or-sidebar-v3/index.js +16 -2
  19. package/dist/bundled/v3/components/or-sidebar-v3/partials/OrSidebarCollapseButton.stories3.d.ts +12 -0
  20. package/dist/bundled/v3/components/or-sidebar-v3/partials/OrSidebarCollapseButton.vue.d.ts +53 -0
  21. package/dist/bundled/v3/components/or-sidebar-v3/partials/index.d.ts +1 -0
  22. package/dist/bundled/v3/components/or-sidebar-v3/partials/index.js +17 -0
  23. package/dist/bundled/v3/components/or-sidebar-v3/styles.d.ts +9 -1
  24. package/dist/bundled/v3/index.js +26 -9
  25. package/dist/esm/v2/{OrSidebar-fabc7bc9.js → OrSidebar-a10424d2.js} +92 -86
  26. package/dist/esm/v2/OrSidebarCollapseButton-3b461dfe.js +233 -0
  27. package/dist/esm/v2/components/index.js +2 -1
  28. package/dist/esm/v2/components/or-sidebar-v3/OrSidebar.stories3.d.ts +36 -1
  29. package/dist/esm/v2/components/or-sidebar-v3/OrSidebar.vue.d.ts +49 -4
  30. package/dist/esm/v2/components/or-sidebar-v3/index.js +13 -1
  31. package/dist/esm/v2/components/or-sidebar-v3/partials/OrSidebarCollapseButton.stories3.d.ts +12 -0
  32. package/dist/esm/v2/components/or-sidebar-v3/partials/OrSidebarCollapseButton.vue.d.ts +53 -0
  33. package/dist/esm/v2/components/or-sidebar-v3/partials/index.d.ts +1 -0
  34. package/dist/esm/v2/components/or-sidebar-v3/partials/index.js +16 -0
  35. package/dist/esm/v2/components/or-sidebar-v3/styles.d.ts +9 -1
  36. package/dist/esm/v2/index.js +2 -1
  37. package/dist/esm/v3/{OrSidebar-a62972f5.js → OrSidebar-3be35e8d.js} +81 -89
  38. package/dist/esm/v3/OrSidebarCollapseButton-30d0033b.js +204 -0
  39. package/dist/esm/v3/components/index.js +2 -1
  40. package/dist/esm/v3/components/or-sidebar-v3/OrSidebar.stories3.d.ts +36 -1
  41. package/dist/esm/v3/components/or-sidebar-v3/OrSidebar.vue.d.ts +49 -4
  42. package/dist/esm/v3/components/or-sidebar-v3/index.js +12 -1
  43. package/dist/esm/v3/components/or-sidebar-v3/partials/OrSidebarCollapseButton.stories3.d.ts +12 -0
  44. package/dist/esm/v3/components/or-sidebar-v3/partials/OrSidebarCollapseButton.vue.d.ts +53 -0
  45. package/dist/esm/v3/components/or-sidebar-v3/partials/index.d.ts +1 -0
  46. package/dist/esm/v3/components/or-sidebar-v3/partials/index.js +15 -0
  47. package/dist/esm/v3/components/or-sidebar-v3/styles.d.ts +9 -1
  48. package/dist/esm/v3/index.js +2 -1
  49. package/package.json +2 -3
  50. package/src/components/or-sidebar-v3/OrSidebar.docs.mdx +6 -0
  51. package/src/components/or-sidebar-v3/OrSidebar.stories3.ts +253 -12
  52. package/src/components/or-sidebar-v3/OrSidebar.vue +130 -23
  53. package/src/components/or-sidebar-v3/partials/OrSidebarCollapseButton.stories3.ts +48 -0
  54. package/src/components/or-sidebar-v3/partials/OrSidebarCollapseButton.vue +74 -0
  55. package/src/components/or-sidebar-v3/partials/index.ts +1 -0
  56. package/src/components/or-sidebar-v3/styles.ts +164 -9
@@ -0,0 +1,74 @@
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>
@@ -0,0 +1 @@
1
+ export { default as OrSidebarCollapseButton } from './OrSidebarCollapseButton.vue';
@@ -4,28 +4,100 @@ export const SidebarRoot: string[] = [
4
4
  // Position
5
5
  'relative',
6
6
 
7
+ // Layout
8
+ 'flex',
9
+ 'flex-row',
10
+ 'shrink-0',
11
+
12
+ // Box
13
+ 'min-w-0',
14
+ 'h-auto',
15
+ 'p-0',
16
+
17
+ // Theme
18
+ 'bg-background',
19
+ 'dark:bg-background-dark',
20
+ ];
21
+
22
+ export const SidebarBar: string[] = [
23
+ // Position
24
+ 'relative',
25
+
7
26
  // Layout
8
27
  'flex',
9
28
  'flex-col',
10
29
  'shrink-0',
30
+ 'grow',
11
31
 
12
32
  // Box
13
33
  'min-h-0',
14
34
  'p-0',
35
+
36
+ // Theme
37
+ 'text-on-background',
38
+ 'dark:text-on-background-dark',
39
+
40
+ // Transition
41
+ 'transition-[width]',
15
42
  ];
16
43
 
17
- export const SidebarRootSides: Record<OrSidebarPlacement, string[]> = {
44
+ export const SidebarToolbar: string[] = [
45
+ // Position
46
+ 'relative',
47
+
48
+ // Layout
49
+ 'flex',
50
+ 'flex-col',
51
+ 'shrink-0',
52
+ 'grow',
53
+ 'overflow-auto',
54
+ 'items-center',
55
+
56
+ // Sizing
57
+ 'gap-md',
58
+
59
+ // Box
60
+ 'min-h-0',
61
+ 'min-w-xl',
62
+ 'p-[6px]',
63
+ 'py-md+',
64
+
65
+ // Theme
66
+ 'text-outline',
67
+ 'dark:text-outline-dark',
68
+ ];
69
+
70
+ export const CollapsibleSidebarToolbar: string[] = [
71
+ 'pt-[56px]',
72
+ ];
73
+
74
+ export const SidebarSides: Record<OrSidebarPlacement, string[]> = {
75
+ [OrSidebarPlacement.left]: [
76
+ // Borders
77
+ 'border-r-[1px]',
78
+ 'border-r-solid',
79
+ 'border-r-outline-variant dark:border-r-outline-variant-dark',
80
+ ],
81
+ [OrSidebarPlacement.right]: [
82
+ // Borders
83
+ 'border-l-[1px]',
84
+ 'border-l-solid',
85
+ 'border-l-outline-variant dark:border-l-outline-variant-dark',
86
+ ],
87
+ };
88
+
89
+ export const SidebarToolbarSides: Record<OrSidebarPlacement, string[]> = {
18
90
  [OrSidebarPlacement.left]: [
19
91
  // Borders
20
92
  'border-r-[1px]',
21
93
  'border-r-solid',
22
- 'border-r-secondary dark:border-r-secondary-dark',
94
+ 'border-r-outline-variant dark:border-r-outline-variant-dark',
23
95
  ],
24
96
  [OrSidebarPlacement.right]: [
25
97
  // Borders
26
98
  'border-l-[1px]',
27
99
  'border-l-solid',
28
- 'border-l-secondary dark:border-l-secondary-dark',
100
+ 'border-l-outline-variant dark:border-l-outline-variant-dark',
29
101
  ],
30
102
  };
31
103
 
@@ -36,7 +108,7 @@ export const SidebarResize: string[] = [
36
108
  'z-[1]',
37
109
 
38
110
  // Box
39
- 'w-[12px]',
111
+ 'w-sm+',
40
112
  'h-[100%]',
41
113
 
42
114
  // Cursor
@@ -50,7 +122,7 @@ export const SidebarResizeSides: Record<OrSidebarPlacement, string[]> = {
50
122
 
51
123
  // Borders
52
124
  'hover:border-r-2',
53
- 'hover:border-r-primary hover:dark:border-r-primary-dark',
125
+ 'hover:border-r-primary-hover hover:dark:border-r-primary-hover-dark',
54
126
 
55
127
  // Transition
56
128
  'transition-[border-right]',
@@ -61,23 +133,42 @@ export const SidebarResizeSides: Record<OrSidebarPlacement, string[]> = {
61
133
 
62
134
  // Borders
63
135
  'hover:border-l-2',
64
- 'hover:border-l-primary hover:dark:border-l-primary-dark',
136
+ 'hover:border-l-primary-hover hover:dark:border-l-primary-hover-dark',
65
137
 
66
138
  // Transition
67
139
  'transition-[border-left]',
68
140
  ],
69
141
  };
70
142
 
143
+ export const SidebarCollapseButton: string[] = [
144
+ // Position
145
+ 'absolute',
146
+ 'top-md',
147
+ 'inset-y-none',
148
+ 'z-[1]',
149
+ ];
150
+
151
+ export const SidebarCollapseButtonSides: Record<OrSidebarPlacement, string[]> = {
152
+ [OrSidebarPlacement.left]: [
153
+ // Position
154
+ '-right-[12px]',
155
+ ],
156
+ [OrSidebarPlacement.right]: [
157
+ // Position
158
+ '-left-[12px]',
159
+ ],
160
+ };
161
+
71
162
  export const SidebarResizingSides: Record<OrSidebarPlacement, string[]> = {
72
163
  [OrSidebarPlacement.left]: [
73
164
  // Borders
74
165
  'border-r-2',
75
- 'border-r-primary dark:border-r-primary-dark',
166
+ 'border-r-primary-hover dark:border-r-primary-hover-dark',
76
167
  ],
77
168
  [OrSidebarPlacement.right]: [
78
169
  // Borders
79
170
  'border-l-2',
80
- 'border-l-primary dark:border-l-primary-dark',
171
+ 'border-l-primary-hover dark:border-l-primary-hover-dark',
81
172
  ],
82
173
  };
83
174
 
@@ -86,14 +177,24 @@ export const SidebarMain: string[] = [
86
177
  'flex',
87
178
  'flex-col',
88
179
  'grow',
180
+ 'overflow-x-hidden',
89
181
 
90
182
  // Box
91
183
  'min-h-0',
92
184
  ];
93
185
 
94
186
  export const SidebarHeader: string[] = [
187
+ // Layout
188
+ 'shrink-0',
189
+ 'overflow-hidden',
190
+
95
191
  // Sizing
96
192
  'p-md',
193
+
194
+ // Typography
195
+ 'typography-headline-2',
196
+ 'whitespace-nowrap',
197
+ 'text-ellipsis',
97
198
  ];
98
199
 
99
200
  export const SidebarContent: string[] = [
@@ -106,11 +207,65 @@ export const SidebarContent: string[] = [
106
207
  ];
107
208
 
108
209
  export const SidebarFooter: string[] = [
210
+ // Layout
211
+ 'shrink-0',
212
+ 'overflow-x-hidden',
213
+
109
214
  // Sizing
110
215
  'p-md',
111
216
 
112
217
  // Borders
113
218
  'border-t-[1px]',
114
219
  'border-t-solid',
115
- 'border-t-secondary dark:border-t-secondary-dark',
220
+ 'border-t-outline-variant dark:border-t-outline-variant-dark',
221
+ ];
222
+
223
+ export const CollapseButtonContainer: string[] = [
224
+ // Box
225
+ 'w-[24px]',
226
+ 'h-[24px]',
227
+ 'rounded-full',
228
+
229
+ // Theme
230
+ 'text-primary dark:text-primary-dark',
231
+ 'bg-background dark:bg-background-dark',
232
+ ];
233
+
234
+ export const CollapseButton: string[] = [
235
+ // Box
236
+ 'w-[24px]',
237
+ 'h-[24px]',
238
+
239
+ // Typography
240
+ '!text-[16px]',
241
+
242
+ // Borders
243
+ '!border-[1px]',
244
+ '!border-solid',
245
+
246
+ // Theme
247
+ '!text-primary dark:!text-primary-dark',
248
+ '!bg-background dark:!bg-background-dark',
249
+ '!border-outline-variant dark:!border-outline-variant-dark',
250
+ '!outline-none',
251
+
252
+ // Theme (hover)
253
+ 'hover:!text-primary hover:dark:!text-primary-dark',
254
+ 'hover:!bg-primary-opacity-0-08 dark:hover:!bg-primary-opacity-0-08-dark',
255
+ 'hover:!border-outline dark:hover:!border-outline-dark',
256
+
257
+ // Theme (active)
258
+ 'active:!text-primary active:dark:!text-primary-dark',
259
+ 'active:!bg-primary-opacity-0-12 dark:active:!bg-primary-opacity-0-12-dark',
260
+ 'active:!border-primary dark:active:!border-primary-dark',
261
+
262
+ // Theme (focus)
263
+ 'focus:!text-primary focus:dark:!text-primary-dark',
264
+ 'focus:!bg-primary-opacity-0-12 dark:focus:!bg-primary-opacity-0-12-dark',
265
+ 'focus:!border-outline dark:focus:!border-outline-dark',
266
+
267
+ // Theme (disabled)
268
+ 'disabled:!text-on-disabled disabled:dark:!text-on-disabled-dark',
269
+ 'disabled:!bg-background disabled:dark:!bg-background-dark',
270
+ 'disabled:!border-outline-variant disabled:dark:!border-outline-variant-dark',
116
271
  ];