@onereach/ui-components 2.72.2-beta.2263.0 → 2.72.2-beta.2265.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 (61) hide show
  1. package/dist/bundled/v2/{OrSidebar-64cc9127.js → OrSidebar-468106b9.js} +116 -1
  2. package/dist/bundled/v2/{OrSidebarCollapseButton-fcc085c7.js → OrSidebarCollapseButton-1161aef8.js} +2 -116
  3. package/dist/bundled/v2/components/index.js +2 -2
  4. package/dist/bundled/v2/components/or-sidebar-v3/index.js +2 -2
  5. package/dist/bundled/v2/components/or-sidebar-v3/partials/index.d.ts +1 -1
  6. package/dist/bundled/v2/components/or-sidebar-v3/partials/index.js +1 -1
  7. package/dist/{esm/v2/components/or-sidebar-v3/partials → bundled/v2/components/or-sidebar-v3/partials/or-sidebar-collapse-button}/OrSidebarCollapseButton.vue.d.ts +1 -1
  8. package/dist/bundled/v2/components/or-sidebar-v3/partials/or-sidebar-collapse-button/index.d.ts +1 -0
  9. package/dist/bundled/v2/components/or-sidebar-v3/partials/or-sidebar-collapse-button/index.js +18 -0
  10. package/dist/bundled/v2/components/or-sidebar-v3/partials/or-sidebar-collapse-button/styles.d.ts +2 -0
  11. package/dist/bundled/v2/components/or-sidebar-v3/styles.d.ts +0 -2
  12. package/dist/bundled/v2/index.js +3 -3
  13. package/dist/bundled/v3/{OrSidebar.vue_vue_type_script_lang-a150808b.js → OrSidebar.vue_vue_type_script_lang-a68e0381.js} +117 -2
  14. package/dist/bundled/v3/OrSidebarCollapseButton.vue_vue_type_script_lang-31f02a78.js +71 -0
  15. package/dist/bundled/v3/components/index.js +2 -2
  16. package/dist/bundled/v3/components/or-sidebar-v3/index.js +2 -2
  17. package/dist/bundled/v3/components/or-sidebar-v3/partials/index.d.ts +1 -1
  18. package/dist/bundled/v3/components/or-sidebar-v3/partials/index.js +1 -1
  19. package/dist/bundled/v3/components/or-sidebar-v3/partials/{OrSidebarCollapseButton.vue.d.ts → or-sidebar-collapse-button/OrSidebarCollapseButton.vue.d.ts} +1 -1
  20. package/dist/bundled/v3/components/or-sidebar-v3/partials/or-sidebar-collapse-button/index.d.ts +1 -0
  21. package/dist/bundled/v3/components/or-sidebar-v3/partials/or-sidebar-collapse-button/index.js +17 -0
  22. package/dist/bundled/v3/components/or-sidebar-v3/partials/or-sidebar-collapse-button/styles.d.ts +2 -0
  23. package/dist/bundled/v3/components/or-sidebar-v3/styles.d.ts +0 -2
  24. package/dist/bundled/v3/index.js +4 -4
  25. package/dist/esm/v2/{OrSidebar-a10424d2.js → OrSidebar-f7fc1179.js} +116 -1
  26. package/dist/esm/v2/{OrSidebarCollapseButton-3b461dfe.js → OrSidebarCollapseButton-3b28945e.js} +2 -116
  27. package/dist/esm/v2/components/index.js +2 -2
  28. package/dist/esm/v2/components/or-sidebar-v3/index.js +2 -2
  29. package/dist/esm/v2/components/or-sidebar-v3/partials/index.d.ts +1 -1
  30. package/dist/esm/v2/components/or-sidebar-v3/partials/index.js +1 -1
  31. package/dist/esm/{v3/components/or-sidebar-v3/partials → v2/components/or-sidebar-v3/partials/or-sidebar-collapse-button}/OrSidebarCollapseButton.vue.d.ts +1 -1
  32. package/dist/esm/v2/components/or-sidebar-v3/partials/or-sidebar-collapse-button/index.d.ts +1 -0
  33. package/dist/esm/v2/components/or-sidebar-v3/partials/or-sidebar-collapse-button/index.js +16 -0
  34. package/dist/esm/v2/components/or-sidebar-v3/partials/or-sidebar-collapse-button/styles.d.ts +2 -0
  35. package/dist/esm/v2/components/or-sidebar-v3/styles.d.ts +0 -2
  36. package/dist/esm/v2/index.js +2 -2
  37. package/dist/esm/v3/{OrSidebar-3be35e8d.js → OrSidebar-dbeffb9d.js} +116 -1
  38. package/dist/esm/v3/OrSidebarCollapseButton-5478da75.js +90 -0
  39. package/dist/esm/v3/components/index.js +2 -2
  40. package/dist/esm/v3/components/or-sidebar-v3/index.js +2 -2
  41. package/dist/esm/v3/components/or-sidebar-v3/partials/index.d.ts +1 -1
  42. package/dist/esm/v3/components/or-sidebar-v3/partials/index.js +1 -1
  43. package/dist/{bundled/v2/components/or-sidebar-v3/partials → esm/v3/components/or-sidebar-v3/partials/or-sidebar-collapse-button}/OrSidebarCollapseButton.vue.d.ts +1 -1
  44. package/dist/esm/v3/components/or-sidebar-v3/partials/or-sidebar-collapse-button/index.d.ts +1 -0
  45. package/dist/esm/v3/components/or-sidebar-v3/partials/or-sidebar-collapse-button/index.js +15 -0
  46. package/dist/esm/v3/components/or-sidebar-v3/partials/or-sidebar-collapse-button/styles.d.ts +2 -0
  47. package/dist/esm/v3/components/or-sidebar-v3/styles.d.ts +0 -2
  48. package/dist/esm/v3/index.js +2 -2
  49. package/package.json +1 -1
  50. package/src/components/or-sidebar-v3/partials/index.ts +1 -1
  51. package/src/components/or-sidebar-v3/partials/{OrSidebarCollapseButton.stories3.ts → or-sidebar-collapse-button/OrSidebarCollapseButton.stories3.ts} +2 -2
  52. package/src/components/or-sidebar-v3/partials/{OrSidebarCollapseButton.vue → or-sidebar-collapse-button/OrSidebarCollapseButton.vue} +3 -3
  53. package/src/components/or-sidebar-v3/partials/or-sidebar-collapse-button/index.ts +1 -0
  54. package/src/components/or-sidebar-v3/partials/or-sidebar-collapse-button/styles.ts +50 -0
  55. package/src/components/or-sidebar-v3/styles.ts +0 -50
  56. package/dist/bundled/v3/OrSidebarCollapseButton.vue_vue_type_script_lang-d3e3cd4f.js +0 -185
  57. package/dist/esm/v3/OrSidebarCollapseButton-30d0033b.js +0 -204
  58. /package/dist/bundled/v2/components/or-sidebar-v3/partials/{OrSidebarCollapseButton.stories3.d.ts → or-sidebar-collapse-button/OrSidebarCollapseButton.stories3.d.ts} +0 -0
  59. /package/dist/bundled/v3/components/or-sidebar-v3/partials/{OrSidebarCollapseButton.stories3.d.ts → or-sidebar-collapse-button/OrSidebarCollapseButton.stories3.d.ts} +0 -0
  60. /package/dist/esm/v2/components/or-sidebar-v3/partials/{OrSidebarCollapseButton.stories3.d.ts → or-sidebar-collapse-button/OrSidebarCollapseButton.stories3.d.ts} +0 -0
  61. /package/dist/esm/v3/components/or-sidebar-v3/partials/{OrSidebarCollapseButton.stories3.d.ts → or-sidebar-collapse-button/OrSidebarCollapseButton.stories3.d.ts} +0 -0
@@ -1 +1 @@
1
- export { default as OrSidebarCollapseButton } from './OrSidebarCollapseButton.vue';
1
+ export * from './or-sidebar-collapse-button';
@@ -1,11 +1,11 @@
1
1
  import { Meta, StoryFn } from '@storybook/vue3';
2
2
  import OrSidebarCollapseButton from './OrSidebarCollapseButton.vue';
3
- import { OrSidebarPlacement } from '../props';
3
+ import { OrSidebarPlacement } from '../../props';
4
4
  import { action } from '@storybook/addon-actions';
5
5
  import { ref } from 'vue-demi';
6
6
 
7
7
  export default {
8
- title: 'Components/Sidebar/Parts/CollapseButton',
8
+ title: 'Components/Sidebar/Partials/CollapseButton',
9
9
  component: OrSidebarCollapseButton,
10
10
 
11
11
  argTypes: {
@@ -15,9 +15,9 @@
15
15
  <script lang="ts">
16
16
  import _ from 'lodash';
17
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';
18
+ import { OrSidebarPlacement } from '../../props';
19
+ import { OrIconButtonV3 as OrIconButton } from '../../../or-icon-button-v3';
20
+ import { CollapseButton, CollapseButtonContainer } from './styles';
21
21
 
22
22
  export default defineComponent({
23
23
  name: 'OrSidebarCollapseButton',
@@ -0,0 +1 @@
1
+ export { default as OrSidebarCollapseButton } from './OrSidebarCollapseButton.vue';
@@ -0,0 +1,50 @@
1
+ export const CollapseButtonContainer: string[] = [
2
+ // Box
3
+ 'w-[24px]',
4
+ 'h-[24px]',
5
+ 'rounded-full',
6
+
7
+ // Theme
8
+ 'text-primary dark:text-primary-dark',
9
+ 'bg-background dark:bg-background-dark',
10
+ ];
11
+
12
+ export const CollapseButton: string[] = [
13
+ // Box
14
+ 'w-[24px]',
15
+ 'h-[24px]',
16
+ 'rounded-full',
17
+
18
+ // Typography
19
+ '!text-[16px]',
20
+
21
+ // Borders
22
+ '!border-[1px]',
23
+ '!border-solid',
24
+
25
+ // Theme
26
+ '!text-primary dark:!text-primary-dark',
27
+ '!bg-background dark:!bg-background-dark',
28
+ '!border-outline-variant dark:!border-outline-variant-dark',
29
+ '!outline-none',
30
+
31
+ // Theme (hover)
32
+ 'hover:!text-primary hover:dark:!text-primary-dark',
33
+ 'hover:!bg-primary-opacity-0-08 dark:hover:!bg-primary-opacity-0-08-dark',
34
+ 'hover:!border-outline dark:hover:!border-outline-dark',
35
+
36
+ // Theme (active)
37
+ 'active:!text-primary active:dark:!text-primary-dark',
38
+ 'active:!bg-primary-opacity-0-12 dark:active:!bg-primary-opacity-0-12-dark',
39
+ 'active:!border-primary dark:active:!border-primary-dark',
40
+
41
+ // Theme (focus)
42
+ 'focus:!text-primary focus:dark:!text-primary-dark',
43
+ 'focus:!bg-primary-opacity-0-12 dark:focus:!bg-primary-opacity-0-12-dark',
44
+ 'focus:!border-outline dark:focus:!border-outline-dark',
45
+
46
+ // Theme (disabled)
47
+ 'disabled:!text-on-disabled disabled:dark:!text-on-disabled-dark',
48
+ 'disabled:!bg-background disabled:dark:!bg-background-dark',
49
+ 'disabled:!border-outline-variant disabled:dark:!border-outline-variant-dark',
50
+ ];
@@ -219,53 +219,3 @@ export const SidebarFooter: string[] = [
219
219
  'border-t-solid',
220
220
  'border-t-outline-variant dark:border-t-outline-variant-dark',
221
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',
271
- ];
@@ -1,185 +0,0 @@
1
- import _ from 'lodash';
2
- import { defineComponent, ref, computed } from 'vue';
3
- import './OrIconButton-e0566ecf.js';
4
- import { s as script$1 } from './OrIconButton.vue_vue_type_script_lang-7d1c3fe1.js';
5
-
6
- var OrSidebarPlacement;
7
- (function (OrSidebarPlacement) {
8
- OrSidebarPlacement["left"] = "left";
9
- OrSidebarPlacement["right"] = "right";
10
- })(OrSidebarPlacement || (OrSidebarPlacement = {}));
11
-
12
- const SidebarRoot = [
13
- // Position
14
- 'relative',
15
- // Layout
16
- 'flex', 'flex-row', 'shrink-0',
17
- // Box
18
- 'min-w-0', 'h-auto', 'p-0',
19
- // Theme
20
- 'bg-background', 'dark:bg-background-dark'];
21
- const SidebarBar = [
22
- // Position
23
- 'relative',
24
- // Layout
25
- 'flex', 'flex-col', 'shrink-0', 'grow',
26
- // Box
27
- 'min-h-0', 'p-0',
28
- // Theme
29
- 'text-on-background', 'dark:text-on-background-dark',
30
- // Transition
31
- 'transition-[width]'];
32
- const SidebarToolbar = [
33
- // Position
34
- 'relative',
35
- // Layout
36
- 'flex', 'flex-col', 'shrink-0', 'grow', 'overflow-auto', 'items-center',
37
- // Sizing
38
- 'gap-md',
39
- // Box
40
- 'min-h-0', 'min-w-xl', 'p-[6px]', 'py-md+',
41
- // Theme
42
- 'text-outline', 'dark:text-outline-dark'];
43
- const CollapsibleSidebarToolbar = ['pt-[56px]'];
44
- const SidebarSides = {
45
- [OrSidebarPlacement.left]: [
46
- // Borders
47
- 'border-r-[1px]', 'border-r-solid', 'border-r-outline-variant dark:border-r-outline-variant-dark'],
48
- [OrSidebarPlacement.right]: [
49
- // Borders
50
- 'border-l-[1px]', 'border-l-solid', 'border-l-outline-variant dark:border-l-outline-variant-dark']
51
- };
52
- const SidebarToolbarSides = {
53
- [OrSidebarPlacement.left]: [
54
- // Borders
55
- 'border-r-[1px]', 'border-r-solid', 'border-r-outline-variant dark:border-r-outline-variant-dark'],
56
- [OrSidebarPlacement.right]: [
57
- // Borders
58
- 'border-l-[1px]', 'border-l-solid', 'border-l-outline-variant dark:border-l-outline-variant-dark']
59
- };
60
- const SidebarResize = [
61
- // Position
62
- 'absolute', 'inset-y-none', 'z-[1]',
63
- // Box
64
- 'w-sm+', 'h-[100%]',
65
- // Cursor
66
- 'cursor-ew-resize'];
67
- const SidebarResizeSides = {
68
- [OrSidebarPlacement.left]: [
69
- // Position
70
- '-right-[1px]',
71
- // Borders
72
- 'hover:border-r-2', 'hover:border-r-primary-hover hover:dark:border-r-primary-hover-dark',
73
- // Transition
74
- 'transition-[border-right]'],
75
- [OrSidebarPlacement.right]: [
76
- // Position
77
- '-left-[1px]',
78
- // Borders
79
- 'hover:border-l-2', 'hover:border-l-primary-hover hover:dark:border-l-primary-hover-dark',
80
- // Transition
81
- 'transition-[border-left]']
82
- };
83
- const SidebarCollapseButton = [
84
- // Position
85
- 'absolute', 'top-md', 'inset-y-none', 'z-[1]'];
86
- const SidebarCollapseButtonSides = {
87
- [OrSidebarPlacement.left]: [
88
- // Position
89
- '-right-[12px]'],
90
- [OrSidebarPlacement.right]: [
91
- // Position
92
- '-left-[12px]']
93
- };
94
- const SidebarResizingSides = {
95
- [OrSidebarPlacement.left]: [
96
- // Borders
97
- 'border-r-2', 'border-r-primary-hover dark:border-r-primary-hover-dark'],
98
- [OrSidebarPlacement.right]: [
99
- // Borders
100
- 'border-l-2', 'border-l-primary-hover dark:border-l-primary-hover-dark']
101
- };
102
- const SidebarMain = [
103
- // Layout
104
- 'flex', 'flex-col', 'grow', 'overflow-x-hidden',
105
- // Box
106
- 'min-h-0'];
107
- const SidebarHeader = [
108
- // Layout
109
- 'shrink-0', 'overflow-hidden',
110
- // Sizing
111
- 'p-md',
112
- // Typography
113
- 'typography-headline-2', 'whitespace-nowrap', 'text-ellipsis'];
114
- const SidebarContent = [
115
- // Layout
116
- 'grow', 'overflow-auto',
117
- // Sizing
118
- 'p-md'];
119
- const SidebarFooter = [
120
- // Layout
121
- 'shrink-0', 'overflow-x-hidden',
122
- // Sizing
123
- 'p-md',
124
- // Borders
125
- 'border-t-[1px]', 'border-t-solid', 'border-t-outline-variant dark:border-t-outline-variant-dark'];
126
- const CollapseButtonContainer = [
127
- // Box
128
- 'w-[24px]', 'h-[24px]', 'rounded-full',
129
- // Theme
130
- 'text-primary dark:text-primary-dark', 'bg-background dark:bg-background-dark'];
131
- const CollapseButton = [
132
- // Box
133
- 'w-[24px]', 'h-[24px]',
134
- // Typography
135
- '!text-[16px]',
136
- // Borders
137
- '!border-[1px]', '!border-solid',
138
- // Theme
139
- '!text-primary dark:!text-primary-dark', '!bg-background dark:!bg-background-dark', '!border-outline-variant dark:!border-outline-variant-dark', '!outline-none',
140
- // Theme (hover)
141
- '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',
142
- // Theme (active)
143
- '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',
144
- // Theme (focus)
145
- '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',
146
- // Theme (disabled)
147
- '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'];
148
-
149
- var script = defineComponent({
150
- name: 'OrSidebarCollapseButton',
151
- components: {
152
- OrIconButton: script$1
153
- },
154
- props: {
155
- /**
156
- * Must be `true` if sidebar is collapsed.
157
- */
158
- modelValue: {
159
- type: Boolean,
160
- default: false
161
- },
162
- side: {
163
- type: String,
164
- default: OrSidebarPlacement.right,
165
- validator: value => _.includes(_.values(OrSidebarPlacement), value)
166
- }
167
- },
168
- emits: ['update:modelValue'],
169
- expose: ['root'],
170
- setup(props) {
171
- // Refs
172
- const root = ref();
173
- const rootStyles = computed(() => ['or-sidebar-collapse-button', ...CollapseButtonContainer]);
174
- const buttonStyles = computed(() => [...CollapseButton]);
175
- const icon = computed(() => props.side === OrSidebarPlacement.left !== props.modelValue ? 'keyboard_arrow_left' : 'keyboard_arrow_right');
176
- return {
177
- root,
178
- rootStyles,
179
- buttonStyles,
180
- icon
181
- };
182
- }
183
- });
184
-
185
- export { CollapsibleSidebarToolbar as C, OrSidebarPlacement as O, SidebarRoot as S, SidebarBar as a, SidebarSides as b, SidebarToolbar as c, SidebarToolbarSides as d, SidebarResize as e, SidebarResizeSides as f, SidebarResizingSides as g, SidebarCollapseButton as h, SidebarCollapseButtonSides as i, SidebarMain as j, SidebarHeader as k, SidebarContent as l, SidebarFooter as m, script as s };
@@ -1,204 +0,0 @@
1
- import _ from 'lodash';
2
- import { defineComponent, ref, computed } from 'vue-demi';
3
- import { s as script$1 } from './OrIconButton-2dcfb83e.js';
4
- import { resolveComponent, openBlock, createElementBlock, normalizeClass, createVNode } from 'vue';
5
-
6
- var OrSidebarPlacement;
7
- (function (OrSidebarPlacement) {
8
- OrSidebarPlacement["left"] = "left";
9
- OrSidebarPlacement["right"] = "right";
10
- })(OrSidebarPlacement || (OrSidebarPlacement = {}));
11
-
12
- const SidebarRoot = [
13
- // Position
14
- 'relative',
15
- // Layout
16
- 'flex', 'flex-row', 'shrink-0',
17
- // Box
18
- 'min-w-0', 'h-auto', 'p-0',
19
- // Theme
20
- 'bg-background', 'dark:bg-background-dark'];
21
- const SidebarBar = [
22
- // Position
23
- 'relative',
24
- // Layout
25
- 'flex', 'flex-col', 'shrink-0', 'grow',
26
- // Box
27
- 'min-h-0', 'p-0',
28
- // Theme
29
- 'text-on-background', 'dark:text-on-background-dark',
30
- // Transition
31
- 'transition-[width]'];
32
- const SidebarToolbar = [
33
- // Position
34
- 'relative',
35
- // Layout
36
- 'flex', 'flex-col', 'shrink-0', 'grow', 'overflow-auto', 'items-center',
37
- // Sizing
38
- 'gap-md',
39
- // Box
40
- 'min-h-0', 'min-w-xl', 'p-[6px]', 'py-md+',
41
- // Theme
42
- 'text-outline', 'dark:text-outline-dark'];
43
- const CollapsibleSidebarToolbar = ['pt-[56px]'];
44
- const SidebarSides = {
45
- [OrSidebarPlacement.left]: [
46
- // Borders
47
- 'border-r-[1px]', 'border-r-solid', 'border-r-outline-variant dark:border-r-outline-variant-dark'],
48
- [OrSidebarPlacement.right]: [
49
- // Borders
50
- 'border-l-[1px]', 'border-l-solid', 'border-l-outline-variant dark:border-l-outline-variant-dark']
51
- };
52
- const SidebarToolbarSides = {
53
- [OrSidebarPlacement.left]: [
54
- // Borders
55
- 'border-r-[1px]', 'border-r-solid', 'border-r-outline-variant dark:border-r-outline-variant-dark'],
56
- [OrSidebarPlacement.right]: [
57
- // Borders
58
- 'border-l-[1px]', 'border-l-solid', 'border-l-outline-variant dark:border-l-outline-variant-dark']
59
- };
60
- const SidebarResize = [
61
- // Position
62
- 'absolute', 'inset-y-none', 'z-[1]',
63
- // Box
64
- 'w-sm+', 'h-[100%]',
65
- // Cursor
66
- 'cursor-ew-resize'];
67
- const SidebarResizeSides = {
68
- [OrSidebarPlacement.left]: [
69
- // Position
70
- '-right-[1px]',
71
- // Borders
72
- 'hover:border-r-2', 'hover:border-r-primary-hover hover:dark:border-r-primary-hover-dark',
73
- // Transition
74
- 'transition-[border-right]'],
75
- [OrSidebarPlacement.right]: [
76
- // Position
77
- '-left-[1px]',
78
- // Borders
79
- 'hover:border-l-2', 'hover:border-l-primary-hover hover:dark:border-l-primary-hover-dark',
80
- // Transition
81
- 'transition-[border-left]']
82
- };
83
- const SidebarCollapseButton = [
84
- // Position
85
- 'absolute', 'top-md', 'inset-y-none', 'z-[1]'];
86
- const SidebarCollapseButtonSides = {
87
- [OrSidebarPlacement.left]: [
88
- // Position
89
- '-right-[12px]'],
90
- [OrSidebarPlacement.right]: [
91
- // Position
92
- '-left-[12px]']
93
- };
94
- const SidebarResizingSides = {
95
- [OrSidebarPlacement.left]: [
96
- // Borders
97
- 'border-r-2', 'border-r-primary-hover dark:border-r-primary-hover-dark'],
98
- [OrSidebarPlacement.right]: [
99
- // Borders
100
- 'border-l-2', 'border-l-primary-hover dark:border-l-primary-hover-dark']
101
- };
102
- const SidebarMain = [
103
- // Layout
104
- 'flex', 'flex-col', 'grow', 'overflow-x-hidden',
105
- // Box
106
- 'min-h-0'];
107
- const SidebarHeader = [
108
- // Layout
109
- 'shrink-0', 'overflow-hidden',
110
- // Sizing
111
- 'p-md',
112
- // Typography
113
- 'typography-headline-2', 'whitespace-nowrap', 'text-ellipsis'];
114
- const SidebarContent = [
115
- // Layout
116
- 'grow', 'overflow-auto',
117
- // Sizing
118
- 'p-md'];
119
- const SidebarFooter = [
120
- // Layout
121
- 'shrink-0', 'overflow-x-hidden',
122
- // Sizing
123
- 'p-md',
124
- // Borders
125
- 'border-t-[1px]', 'border-t-solid', 'border-t-outline-variant dark:border-t-outline-variant-dark'];
126
- const CollapseButtonContainer = [
127
- // Box
128
- 'w-[24px]', 'h-[24px]', 'rounded-full',
129
- // Theme
130
- 'text-primary dark:text-primary-dark', 'bg-background dark:bg-background-dark'];
131
- const CollapseButton = [
132
- // Box
133
- 'w-[24px]', 'h-[24px]',
134
- // Typography
135
- '!text-[16px]',
136
- // Borders
137
- '!border-[1px]', '!border-solid',
138
- // Theme
139
- '!text-primary dark:!text-primary-dark', '!bg-background dark:!bg-background-dark', '!border-outline-variant dark:!border-outline-variant-dark', '!outline-none',
140
- // Theme (hover)
141
- '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',
142
- // Theme (active)
143
- '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',
144
- // Theme (focus)
145
- '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',
146
- // Theme (disabled)
147
- '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'];
148
-
149
- var script = defineComponent({
150
- name: 'OrSidebarCollapseButton',
151
- components: {
152
- OrIconButton: script$1
153
- },
154
- props: {
155
- /**
156
- * Must be `true` if sidebar is collapsed.
157
- */
158
- modelValue: {
159
- type: Boolean,
160
- default: false
161
- },
162
- side: {
163
- type: String,
164
- default: OrSidebarPlacement.right,
165
- validator: value => _.includes(_.values(OrSidebarPlacement), value)
166
- }
167
- },
168
- emits: ['update:modelValue'],
169
- expose: ['root'],
170
- setup(props) {
171
- // Refs
172
- const root = ref();
173
- const rootStyles = computed(() => ['or-sidebar-collapse-button', ...CollapseButtonContainer]);
174
- const buttonStyles = computed(() => [...CollapseButton]);
175
- const icon = computed(() => props.side === OrSidebarPlacement.left !== props.modelValue ? 'keyboard_arrow_left' : 'keyboard_arrow_right');
176
- return {
177
- root,
178
- rootStyles,
179
- buttonStyles,
180
- icon
181
- };
182
- }
183
- });
184
-
185
- function render(_ctx, _cache, $props, $setup, $data, $options) {
186
- const _component_or_icon_button = resolveComponent("or-icon-button");
187
- return openBlock(), createElementBlock("div", {
188
- ref: "root",
189
- class: normalizeClass(_ctx.rootStyles)
190
- }, [createVNode(_component_or_icon_button, {
191
- class: normalizeClass(_ctx.buttonStyles),
192
- icon: {
193
- icon: _ctx.icon,
194
- size: 'inherit'
195
- },
196
- color: "inherit",
197
- onClick: _cache[0] || (_cache[0] = $event => _ctx.$emit('update:modelValue', !_ctx.modelValue))
198
- }, null, 8 /* PROPS */, ["class", "icon"])], 2 /* CLASS */);
199
- }
200
-
201
- script.render = render;
202
- script.__file = "src/components/or-sidebar-v3/partials/OrSidebarCollapseButton.vue";
203
-
204
- export { CollapsibleSidebarToolbar as C, OrSidebarPlacement as O, SidebarRoot as S, SidebarBar as a, SidebarSides as b, SidebarToolbar as c, SidebarToolbarSides as d, SidebarResize as e, SidebarResizeSides as f, SidebarResizingSides as g, SidebarCollapseButton as h, SidebarCollapseButtonSides as i, SidebarMain as j, SidebarHeader as k, SidebarContent as l, SidebarFooter as m, script as s };