@onereach/ui-components 2.73.0-beta.2258.0 → 2.73.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.
- package/dist/bundled/v2/{OrCardCollection-06ecb8e1.js → OrCardCollection-4ac89ea5.js} +1 -1
- package/dist/bundled/v2/{OrCode-0cf7596d.js → OrCode-fc6876ec.js} +12 -184
- package/dist/bundled/v2/{OrNotification-2e2a1941.js → OrNotification-3909aaf2.js} +3 -3
- package/dist/bundled/v2/{OrSearch-bb87b34c.js → OrSearch-09fd004c.js} +2 -1
- package/dist/bundled/v2/{OrSidebar-c95ef614.js → OrSidebar-a2bc21b9.js} +155 -34
- package/dist/bundled/v2/OrSidebarCollapseButton-8297ef86.js +125 -0
- package/dist/bundled/v2/{OrSkeletonText-2f1a3cc7.js → OrSkeletonText-242d22f3.js} +3 -3
- package/dist/bundled/v2/components/index.js +7 -6
- package/dist/bundled/v2/components/or-card-collection-v3/index.js +2 -2
- package/dist/bundled/v2/components/or-code/OrCode.vue.d.ts +0 -10
- package/dist/bundled/v2/components/or-code/index.js +1 -1
- package/dist/bundled/v2/components/or-notification/index.js +1 -1
- package/dist/bundled/v2/components/or-search-v3/index.js +1 -1
- package/dist/bundled/v2/components/or-sidebar-v3/OrSidebar.stories3.d.ts +36 -1
- package/dist/bundled/v2/components/or-sidebar-v3/OrSidebar.vue.d.ts +49 -4
- package/dist/bundled/v2/components/or-sidebar-v3/index.js +13 -1
- package/dist/bundled/v2/components/or-sidebar-v3/partials/index.d.ts +1 -0
- package/dist/bundled/v2/components/or-sidebar-v3/partials/index.js +18 -0
- package/dist/bundled/v2/components/or-sidebar-v3/partials/or-sidebar-collapse-button/OrSidebarCollapseButton.stories3.d.ts +12 -0
- package/dist/bundled/v2/components/or-sidebar-v3/partials/or-sidebar-collapse-button/OrSidebarCollapseButton.vue.d.ts +53 -0
- package/dist/bundled/v2/components/or-sidebar-v3/partials/or-sidebar-collapse-button/index.d.ts +1 -0
- package/dist/bundled/v2/components/or-sidebar-v3/partials/or-sidebar-collapse-button/index.js +18 -0
- package/dist/bundled/v2/components/or-sidebar-v3/partials/or-sidebar-collapse-button/styles.d.ts +2 -0
- package/dist/bundled/v2/components/or-sidebar-v3/styles.d.ts +7 -1
- package/dist/bundled/v2/components/or-skeleton/index.js +1 -1
- package/dist/bundled/v2/index.js +8 -7
- package/dist/bundled/v3/{OrCardCollection.vue_vue_type_script_lang-e2980d04.js → OrCardCollection.vue_vue_type_script_lang-f76c3264.js} +1 -1
- package/dist/bundled/v3/{OrCode.vue_vue_type_script_lang-df150e3b.js → OrCode.vue_vue_type_script_lang-c55de81d.js} +8 -180
- package/dist/bundled/v3/{OrSearch.vue_vue_type_script_lang-321907ec.js → OrSearch.vue_vue_type_script_lang-c054c8db.js} +2 -1
- package/dist/bundled/v3/OrSidebar.vue_vue_type_script_lang-7f3f1a16.js +291 -0
- package/dist/bundled/v3/OrSidebarCollapseButton.vue_vue_type_script_lang-9aeba2d4.js +75 -0
- package/dist/bundled/v3/components/index.js +5 -4
- package/dist/bundled/v3/components/or-card-collection-v3/index.js +2 -2
- package/dist/bundled/v3/components/or-code/OrCode.vue.d.ts +0 -10
- package/dist/bundled/v3/components/or-code/index.js +1 -1
- package/dist/bundled/v3/components/or-search-v3/index.js +1 -1
- package/dist/bundled/v3/components/or-sidebar-v3/OrSidebar.stories3.d.ts +36 -1
- package/dist/bundled/v3/components/or-sidebar-v3/OrSidebar.vue.d.ts +49 -4
- package/dist/bundled/v3/components/or-sidebar-v3/index.js +16 -2
- package/dist/bundled/v3/components/or-sidebar-v3/partials/index.d.ts +1 -0
- package/dist/bundled/v3/components/or-sidebar-v3/partials/index.js +17 -0
- package/dist/bundled/v3/components/or-sidebar-v3/partials/or-sidebar-collapse-button/OrSidebarCollapseButton.stories3.d.ts +12 -0
- package/dist/bundled/v3/components/or-sidebar-v3/partials/or-sidebar-collapse-button/OrSidebarCollapseButton.vue.d.ts +53 -0
- package/dist/bundled/v3/components/or-sidebar-v3/partials/or-sidebar-collapse-button/index.d.ts +1 -0
- package/dist/bundled/v3/components/or-sidebar-v3/partials/or-sidebar-collapse-button/index.js +17 -0
- package/dist/bundled/v3/components/or-sidebar-v3/partials/or-sidebar-collapse-button/styles.d.ts +2 -0
- package/dist/bundled/v3/components/or-sidebar-v3/styles.d.ts +7 -1
- package/dist/bundled/v3/index.js +36 -19
- package/dist/esm/v2/{OrCardCollection-251ab033.js → OrCardCollection-5a9eda35.js} +1 -1
- package/dist/esm/v2/{OrCode-e2ce05ea.js → OrCode-d4400b42.js} +12 -30
- package/dist/esm/v2/{OrNotification-a49e76d3.js → OrNotification-a9231a83.js} +3 -3
- package/dist/esm/v2/{OrSearch-f42d588d.js → OrSearch-7411388b.js} +2 -1
- package/dist/esm/v2/{OrSidebar-fabc7bc9.js → OrSidebar-27236fbd.js} +155 -34
- package/dist/esm/v2/OrSidebarCollapseButton-cfe51a60.js +123 -0
- package/dist/esm/v2/{OrSkeletonText-24509efe.js → OrSkeletonText-cc94bdc9.js} +3 -3
- package/dist/esm/v2/components/index.js +7 -7
- package/dist/esm/v2/components/or-card-collection-v3/index.js +2 -2
- package/dist/esm/v2/components/or-code/OrCode.vue.d.ts +0 -10
- package/dist/esm/v2/components/or-code/index.js +2 -3
- package/dist/esm/v2/components/or-notification/index.js +1 -1
- package/dist/esm/v2/components/or-search-v3/index.js +1 -1
- package/dist/esm/v2/components/or-sidebar-v3/OrSidebar.stories3.d.ts +36 -1
- package/dist/esm/v2/components/or-sidebar-v3/OrSidebar.vue.d.ts +49 -4
- package/dist/esm/v2/components/or-sidebar-v3/index.js +13 -1
- package/dist/esm/v2/components/or-sidebar-v3/partials/index.d.ts +1 -0
- package/dist/esm/v2/components/or-sidebar-v3/partials/index.js +16 -0
- package/dist/esm/v2/components/or-sidebar-v3/partials/or-sidebar-collapse-button/OrSidebarCollapseButton.stories3.d.ts +12 -0
- package/dist/esm/v2/components/or-sidebar-v3/partials/or-sidebar-collapse-button/OrSidebarCollapseButton.vue.d.ts +53 -0
- package/dist/esm/v2/components/or-sidebar-v3/partials/or-sidebar-collapse-button/index.d.ts +1 -0
- package/dist/esm/v2/components/or-sidebar-v3/partials/or-sidebar-collapse-button/index.js +16 -0
- package/dist/esm/v2/components/or-sidebar-v3/partials/or-sidebar-collapse-button/styles.d.ts +2 -0
- package/dist/esm/v2/components/or-sidebar-v3/styles.d.ts +7 -1
- package/dist/esm/v2/components/or-skeleton/index.js +1 -1
- package/dist/esm/v2/index.js +7 -7
- package/dist/esm/v3/{OrCardCollection-8b8e3745.js → OrCardCollection-e4fde5b4.js} +1 -1
- package/dist/esm/v3/{OrCode-72688173.js → OrCode-5ed69c23.js} +9 -27
- package/dist/esm/v3/{OrNotification-eb08de33.js → OrNotification-e85a4956.js} +1 -1
- package/dist/esm/v3/{OrSearch-4c5c44f2.js → OrSearch-5406bf03.js} +2 -1
- package/dist/esm/v3/OrSidebar-61d84c3e.js +313 -0
- package/dist/esm/v3/OrSidebarCollapseButton-1b9c83ef.js +94 -0
- package/dist/esm/v3/{OrSkeletonText-0546754d.js → OrSkeletonText-2b1610ce.js} +3 -3
- package/dist/esm/v3/components/index.js +7 -7
- package/dist/esm/v3/components/or-card-collection-v3/index.js +2 -2
- package/dist/esm/v3/components/or-code/OrCode.vue.d.ts +0 -10
- package/dist/esm/v3/components/or-code/index.js +2 -3
- package/dist/esm/v3/components/or-notification/index.js +1 -1
- package/dist/esm/v3/components/or-search-v3/index.js +1 -1
- package/dist/esm/v3/components/or-sidebar-v3/OrSidebar.stories3.d.ts +36 -1
- package/dist/esm/v3/components/or-sidebar-v3/OrSidebar.vue.d.ts +49 -4
- package/dist/esm/v3/components/or-sidebar-v3/index.js +12 -1
- package/dist/esm/v3/components/or-sidebar-v3/partials/index.d.ts +1 -0
- package/dist/esm/v3/components/or-sidebar-v3/partials/index.js +15 -0
- package/dist/esm/v3/components/or-sidebar-v3/partials/or-sidebar-collapse-button/OrSidebarCollapseButton.stories3.d.ts +12 -0
- package/dist/esm/v3/components/or-sidebar-v3/partials/or-sidebar-collapse-button/OrSidebarCollapseButton.vue.d.ts +53 -0
- package/dist/esm/v3/components/or-sidebar-v3/partials/or-sidebar-collapse-button/index.d.ts +1 -0
- package/dist/esm/v3/components/or-sidebar-v3/partials/or-sidebar-collapse-button/index.js +15 -0
- package/dist/esm/v3/components/or-sidebar-v3/partials/or-sidebar-collapse-button/styles.d.ts +2 -0
- package/dist/esm/v3/components/or-sidebar-v3/styles.d.ts +7 -1
- package/dist/esm/v3/components/or-skeleton/index.js +1 -1
- package/dist/esm/v3/index.js +7 -7
- package/package.json +4 -4
- package/src/components/or-code/OrCode.vue +6 -23
- package/src/components/or-notification/OrNotification.vue +1 -26
- package/src/components/or-search-v3/OrSearch.vue +2 -1
- package/src/components/or-sidebar-v3/OrSidebar.docs.mdx +6 -0
- package/src/components/or-sidebar-v3/OrSidebar.stories3.ts +253 -12
- package/src/components/or-sidebar-v3/OrSidebar.vue +130 -23
- package/src/components/or-sidebar-v3/partials/index.ts +1 -0
- package/src/components/or-sidebar-v3/partials/or-sidebar-collapse-button/OrSidebarCollapseButton.stories3.ts +48 -0
- package/src/components/or-sidebar-v3/partials/or-sidebar-collapse-button/OrSidebarCollapseButton.vue +79 -0
- package/src/components/or-sidebar-v3/partials/or-sidebar-collapse-button/index.ts +1 -0
- package/src/components/or-sidebar-v3/partials/or-sidebar-collapse-button/styles.ts +50 -0
- package/src/components/or-sidebar-v3/styles.ts +114 -9
- package/src/components/or-skeleton/styles.scss +3 -18
- package/src/components/or-stepper/OrStepper.stories.ts +1 -1
- package/dist/bundled/v3/OrSidebar.vue_vue_type_script_lang-ce0b152c.js +0 -181
- package/dist/esm/v3/OrSidebar-a62972f5.js +0 -206
package/src/components/or-sidebar-v3/partials/or-sidebar-collapse-button/OrSidebarCollapseButton.vue
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
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
|
+
model: {
|
|
30
|
+
prop: 'modelValue',
|
|
31
|
+
event: 'update:modelValue',
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
props: {
|
|
35
|
+
/**
|
|
36
|
+
* Must be `true` if sidebar is collapsed.
|
|
37
|
+
*/
|
|
38
|
+
modelValue: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: false,
|
|
41
|
+
},
|
|
42
|
+
side: {
|
|
43
|
+
type: String as PropType<OrSidebarPlacement>,
|
|
44
|
+
default: OrSidebarPlacement.right,
|
|
45
|
+
validator: (value?: any) => _.includes(_.values(OrSidebarPlacement), value),
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
emits: ['update:modelValue'],
|
|
50
|
+
|
|
51
|
+
expose: ['root'],
|
|
52
|
+
|
|
53
|
+
setup(props) {
|
|
54
|
+
// Refs
|
|
55
|
+
const root = ref<InstanceType<typeof HTMLDivElement>>();
|
|
56
|
+
|
|
57
|
+
const rootStyles = computed(() => [
|
|
58
|
+
'or-sidebar-collapse-button',
|
|
59
|
+
...CollapseButtonContainer,
|
|
60
|
+
]);
|
|
61
|
+
|
|
62
|
+
const buttonStyles = computed(() => [
|
|
63
|
+
...CollapseButton,
|
|
64
|
+
]);
|
|
65
|
+
|
|
66
|
+
const icon = computed(() => (props.side === OrSidebarPlacement.left !== props.modelValue) ?
|
|
67
|
+
'keyboard_arrow_left' :
|
|
68
|
+
'keyboard_arrow_right',
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
return {
|
|
72
|
+
root,
|
|
73
|
+
rootStyles,
|
|
74
|
+
buttonStyles,
|
|
75
|
+
icon,
|
|
76
|
+
};
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
</script>
|
|
@@ -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
|
+
];
|
|
@@ -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]',
|
|
42
|
+
];
|
|
43
|
+
|
|
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]',
|
|
15
72
|
];
|
|
16
73
|
|
|
17
|
-
export const
|
|
74
|
+
export const SidebarSides: Record<OrSidebarPlacement, string[]> = {
|
|
18
75
|
[OrSidebarPlacement.left]: [
|
|
19
76
|
// Borders
|
|
20
77
|
'border-r-[1px]',
|
|
21
78
|
'border-r-solid',
|
|
22
|
-
'border-r-
|
|
79
|
+
'border-r-outline-variant dark:border-r-outline-variant-dark',
|
|
23
80
|
],
|
|
24
81
|
[OrSidebarPlacement.right]: [
|
|
25
82
|
// Borders
|
|
26
83
|
'border-l-[1px]',
|
|
27
84
|
'border-l-solid',
|
|
28
|
-
'border-l-
|
|
85
|
+
'border-l-outline-variant dark:border-l-outline-variant-dark',
|
|
86
|
+
],
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export const SidebarToolbarSides: Record<OrSidebarPlacement, string[]> = {
|
|
90
|
+
[OrSidebarPlacement.left]: [
|
|
91
|
+
// Borders
|
|
92
|
+
'border-r-[1px]',
|
|
93
|
+
'border-r-solid',
|
|
94
|
+
'border-r-outline-variant dark:border-r-outline-variant-dark',
|
|
95
|
+
],
|
|
96
|
+
[OrSidebarPlacement.right]: [
|
|
97
|
+
// Borders
|
|
98
|
+
'border-l-[1px]',
|
|
99
|
+
'border-l-solid',
|
|
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-
|
|
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,15 @@ 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-
|
|
220
|
+
'border-t-outline-variant dark:border-t-outline-variant-dark',
|
|
116
221
|
];
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
$c-skeleton-bg: #f6f8fd;
|
|
13
|
-
$c-skeleton-center: #fff;
|
|
14
|
-
|
|
15
12
|
.or-skeleton {
|
|
13
|
+
$c-skeleton-bg: #f6f8fd;
|
|
14
|
+
$c-skeleton-center: #fff;
|
|
15
|
+
|
|
16
16
|
overflow: hidden;
|
|
17
17
|
position: relative;
|
|
18
18
|
padding: 0;
|
|
@@ -33,18 +33,3 @@ $c-skeleton-center: #fff;
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
[data-theme="dark"] {
|
|
39
|
-
$c-skeleton-dark-bg: $c-neutral-3;
|
|
40
|
-
$c-skeleton-dark-center: $c-neutral-2;
|
|
41
|
-
|
|
42
|
-
.or-skeleton {
|
|
43
|
-
background: $c-skeleton-dark-bg;
|
|
44
|
-
&.is-animated {
|
|
45
|
-
&::before {
|
|
46
|
-
background: linear-gradient(90.14deg, $c-skeleton-dark-bg 0.1%, $c-skeleton-dark-center 49.98%, $c-skeleton-dark-bg 99.06%);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
@@ -30,7 +30,7 @@ const Template: Story = (_args, { argTypes }) => ({
|
|
|
30
30
|
},
|
|
31
31
|
//<component :key="slot.Id" :someProp="slotProps"></component>
|
|
32
32
|
//<template #buttons="{onConfirm}"> here your button slot props <or-button content="slot-confirm" @click="onConfirm"/></template>
|
|
33
|
-
template: '<div><or-stepper v-bind="$props"> <template v-for="slot in slots" v-slot:[slot]="slotProps"><p class="bg-surface-5
|
|
33
|
+
template: '<div><or-stepper v-bind="$props"> <template v-for="slot in slots" v-slot:[slot]="slotProps"><p class="bg-surface-5 rounded-sm p-2"> your slot named like content-{index} === {{slot}} ; slot props {{slotProps}}</p></template></or-stepper></div>',
|
|
34
34
|
|
|
35
35
|
});
|
|
36
36
|
|
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
import { useDraggable, useElementBounding } from '@vueuse/core';
|
|
2
|
-
import _ from 'lodash';
|
|
3
|
-
import { defineComponent, ref, computed, watch } from 'vue';
|
|
4
|
-
|
|
5
|
-
var OrSidebarPlacement;
|
|
6
|
-
(function (OrSidebarPlacement) {
|
|
7
|
-
OrSidebarPlacement["left"] = "left";
|
|
8
|
-
OrSidebarPlacement["right"] = "right";
|
|
9
|
-
})(OrSidebarPlacement || (OrSidebarPlacement = {}));
|
|
10
|
-
|
|
11
|
-
const SidebarRoot = [
|
|
12
|
-
// Position
|
|
13
|
-
'relative',
|
|
14
|
-
// Layout
|
|
15
|
-
'flex', 'flex-col', 'shrink-0',
|
|
16
|
-
// Box
|
|
17
|
-
'min-h-0', 'p-0'];
|
|
18
|
-
const SidebarRootSides = {
|
|
19
|
-
[OrSidebarPlacement.left]: [
|
|
20
|
-
// Borders
|
|
21
|
-
'border-r-[1px]', 'border-r-solid', 'border-r-secondary dark:border-r-secondary-dark'],
|
|
22
|
-
[OrSidebarPlacement.right]: [
|
|
23
|
-
// Borders
|
|
24
|
-
'border-l-[1px]', 'border-l-solid', 'border-l-secondary dark:border-l-secondary-dark']
|
|
25
|
-
};
|
|
26
|
-
const SidebarResize = [
|
|
27
|
-
// Position
|
|
28
|
-
'absolute', 'inset-y-none', 'z-[1]',
|
|
29
|
-
// Box
|
|
30
|
-
'w-[12px]', 'h-[100%]',
|
|
31
|
-
// Cursor
|
|
32
|
-
'cursor-ew-resize'];
|
|
33
|
-
const SidebarResizeSides = {
|
|
34
|
-
[OrSidebarPlacement.left]: [
|
|
35
|
-
// Position
|
|
36
|
-
'-right-[1px]',
|
|
37
|
-
// Borders
|
|
38
|
-
'hover:border-r-2', 'hover:border-r-primary hover:dark:border-r-primary-dark',
|
|
39
|
-
// Transition
|
|
40
|
-
'transition-[border-right]'],
|
|
41
|
-
[OrSidebarPlacement.right]: [
|
|
42
|
-
// Position
|
|
43
|
-
'-left-[1px]',
|
|
44
|
-
// Borders
|
|
45
|
-
'hover:border-l-2', 'hover:border-l-primary hover:dark:border-l-primary-dark',
|
|
46
|
-
// Transition
|
|
47
|
-
'transition-[border-left]']
|
|
48
|
-
};
|
|
49
|
-
const SidebarResizingSides = {
|
|
50
|
-
[OrSidebarPlacement.left]: [
|
|
51
|
-
// Borders
|
|
52
|
-
'border-r-2', 'border-r-primary dark:border-r-primary-dark'],
|
|
53
|
-
[OrSidebarPlacement.right]: [
|
|
54
|
-
// Borders
|
|
55
|
-
'border-l-2', 'border-l-primary dark:border-l-primary-dark']
|
|
56
|
-
};
|
|
57
|
-
const SidebarMain = [
|
|
58
|
-
// Layout
|
|
59
|
-
'flex', 'flex-col', 'grow',
|
|
60
|
-
// Box
|
|
61
|
-
'min-h-0'];
|
|
62
|
-
const SidebarHeader = [
|
|
63
|
-
// Sizing
|
|
64
|
-
'p-md'];
|
|
65
|
-
const SidebarContent = [
|
|
66
|
-
// Layout
|
|
67
|
-
'grow', 'overflow-auto',
|
|
68
|
-
// Sizing
|
|
69
|
-
'p-md'];
|
|
70
|
-
const SidebarFooter = [
|
|
71
|
-
// Sizing
|
|
72
|
-
'p-md',
|
|
73
|
-
// Borders
|
|
74
|
-
'border-t-[1px]', 'border-t-solid', 'border-t-secondary dark:border-t-secondary-dark'];
|
|
75
|
-
|
|
76
|
-
var script = defineComponent({
|
|
77
|
-
name: 'OrSidebar',
|
|
78
|
-
props: {
|
|
79
|
-
width: {
|
|
80
|
-
type: Number,
|
|
81
|
-
required: false,
|
|
82
|
-
default: 0,
|
|
83
|
-
validator: value => _.isNumber(value) && value >= 0
|
|
84
|
-
},
|
|
85
|
-
minimumWidth: {
|
|
86
|
-
type: Number,
|
|
87
|
-
required: false,
|
|
88
|
-
default: 350,
|
|
89
|
-
validator: value => _.isNumber(value) && value >= 0
|
|
90
|
-
},
|
|
91
|
-
/**
|
|
92
|
-
* User may put the component on the right or the left side of a container.
|
|
93
|
-
* This property mirrors the resizing behavior (drag direction) and styling (horizontal border) of the sidebar.
|
|
94
|
-
*
|
|
95
|
-
* Note: the property doesn't reposition the component in the parent container.
|
|
96
|
-
* @values left, right
|
|
97
|
-
*/
|
|
98
|
-
side: {
|
|
99
|
-
type: String,
|
|
100
|
-
default: OrSidebarPlacement.right,
|
|
101
|
-
validator: value => _.includes(_.values(OrSidebarPlacement), value)
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
emits: ['change:width'],
|
|
105
|
-
setup(props, {
|
|
106
|
-
emit
|
|
107
|
-
}) {
|
|
108
|
-
// Refs
|
|
109
|
-
const root = ref();
|
|
110
|
-
const resizeBar = ref(null);
|
|
111
|
-
const parentContainer = computed(() => {
|
|
112
|
-
var _a;
|
|
113
|
-
return (_a = root.value) === null || _a === void 0 ? void 0 : _a.parentElement;
|
|
114
|
-
});
|
|
115
|
-
// State
|
|
116
|
-
const startPositionX = ref(0);
|
|
117
|
-
const isResizing = ref(false);
|
|
118
|
-
const localWidth = ref(props.width >= props.minimumWidth ? props.width : props.minimumWidth);
|
|
119
|
-
// Styles
|
|
120
|
-
const sidebarStyle = computed(() => ({
|
|
121
|
-
width: localWidth.value + 'px'
|
|
122
|
-
}));
|
|
123
|
-
const rootStyles = computed(() => ['or-sidebar', ...SidebarRoot, ...SidebarRootSides[props.side]]);
|
|
124
|
-
const resizeStyles = computed(() => [...SidebarResize, ...SidebarResizeSides[props.side], ...(isResizing.value ? SidebarResizingSides[props.side] : [])]);
|
|
125
|
-
const mainStyles = computed(() => [...SidebarMain]);
|
|
126
|
-
const headerStyles = computed(() => [...SidebarHeader]);
|
|
127
|
-
const contentStyles = computed(() => [...SidebarContent]);
|
|
128
|
-
const footerStyles = computed(() => [...SidebarFooter]);
|
|
129
|
-
// Effects
|
|
130
|
-
useDraggable(resizeBar, {
|
|
131
|
-
preventDefault: true,
|
|
132
|
-
onStart: (position, event) => {
|
|
133
|
-
document.body.style.cursor = 'ew-resize';
|
|
134
|
-
document.body.style.userSelect = 'none';
|
|
135
|
-
startPositionX.value = event.x;
|
|
136
|
-
isResizing.value = true;
|
|
137
|
-
},
|
|
138
|
-
onMove: position => {
|
|
139
|
-
const delta = (position.x - startPositionX.value) * (props.side === OrSidebarPlacement.left ? -1 : 1);
|
|
140
|
-
const newWidth = localWidth.value - delta;
|
|
141
|
-
localWidth.value = newWidth > maximumWidth.value ? maximumWidth.value : newWidth < props.minimumWidth ? props.minimumWidth : newWidth;
|
|
142
|
-
startPositionX.value = position.x;
|
|
143
|
-
},
|
|
144
|
-
onEnd: () => {
|
|
145
|
-
document.body.style.cursor = '';
|
|
146
|
-
document.body.style.userSelect = '';
|
|
147
|
-
isResizing.value = false;
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
const {
|
|
151
|
-
width: maximumWidth
|
|
152
|
-
} = useElementBounding(parentContainer);
|
|
153
|
-
watch(() => props.width, newValue => {
|
|
154
|
-
if (newValue !== localWidth.value) {
|
|
155
|
-
localWidth.value = newValue > maximumWidth.value ? maximumWidth.value : newValue < props.minimumWidth ? props.minimumWidth : newValue;
|
|
156
|
-
}
|
|
157
|
-
});
|
|
158
|
-
watch(() => props.minimumWidth, newMinimum => {
|
|
159
|
-
if (newMinimum > localWidth.value) localWidth.value = newMinimum;
|
|
160
|
-
});
|
|
161
|
-
watch(maximumWidth, newMaximum => {
|
|
162
|
-
if (newMaximum < localWidth.value) localWidth.value = newMaximum;
|
|
163
|
-
});
|
|
164
|
-
watch(localWidth, val => emit('change:width', val));
|
|
165
|
-
return {
|
|
166
|
-
root,
|
|
167
|
-
resizeBar,
|
|
168
|
-
isResizing,
|
|
169
|
-
localWidth,
|
|
170
|
-
sidebarStyle,
|
|
171
|
-
rootStyles,
|
|
172
|
-
resizeStyles,
|
|
173
|
-
mainStyles,
|
|
174
|
-
headerStyles,
|
|
175
|
-
contentStyles,
|
|
176
|
-
footerStyles
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
});
|
|
180
|
-
|
|
181
|
-
export { OrSidebarPlacement as O, script as s };
|