@onereach/ui-components 2.70.1 → 2.70.2-beta.2198.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 (47) hide show
  1. package/dist/bundled/v2/OrSidebar-2a7d62a8.js +455 -0
  2. package/dist/bundled/v2/components/index.js +1 -1
  3. package/dist/bundled/v2/components/or-sidebar-v3/OrSidebar.stories3.d.ts +36 -1
  4. package/dist/bundled/v2/components/or-sidebar-v3/OrSidebar.vue.d.ts +49 -4
  5. package/dist/bundled/v2/components/or-sidebar-v3/OrSidebarCollapseButton.stories3.d.ts +12 -0
  6. package/dist/bundled/v2/components/or-sidebar-v3/OrSidebarCollapseButton.vue.d.ts +59 -0
  7. package/dist/bundled/v2/components/or-sidebar-v3/index.js +13 -1
  8. package/dist/bundled/v2/components/or-sidebar-v3/styles.d.ts +7 -1
  9. package/dist/bundled/v2/index.js +2 -2
  10. package/dist/bundled/v3/OrSidebar.vue_vue_type_script_lang-b4fa1550.js +347 -0
  11. package/dist/bundled/v3/components/index.js +1 -1
  12. package/dist/bundled/v3/components/or-sidebar-v3/OrSidebar.stories3.d.ts +36 -1
  13. package/dist/bundled/v3/components/or-sidebar-v3/OrSidebar.vue.d.ts +49 -4
  14. package/dist/bundled/v3/components/or-sidebar-v3/OrSidebarCollapseButton.stories3.d.ts +12 -0
  15. package/dist/bundled/v3/components/or-sidebar-v3/OrSidebarCollapseButton.vue.d.ts +59 -0
  16. package/dist/bundled/v3/components/or-sidebar-v3/index.js +15 -1
  17. package/dist/bundled/v3/components/or-sidebar-v3/styles.d.ts +7 -1
  18. package/dist/bundled/v3/index.js +25 -9
  19. package/dist/esm/v2/OrSidebar-1e02702f.js +452 -0
  20. package/dist/esm/v2/components/index.js +1 -1
  21. package/dist/esm/v2/components/or-sidebar-v3/OrSidebar.stories3.d.ts +36 -1
  22. package/dist/esm/v2/components/or-sidebar-v3/OrSidebar.vue.d.ts +49 -4
  23. package/dist/esm/v2/components/or-sidebar-v3/OrSidebarCollapseButton.stories3.d.ts +12 -0
  24. package/dist/esm/v2/components/or-sidebar-v3/OrSidebarCollapseButton.vue.d.ts +59 -0
  25. package/dist/esm/v2/components/or-sidebar-v3/index.js +13 -1
  26. package/dist/esm/v2/components/or-sidebar-v3/styles.d.ts +7 -1
  27. package/dist/esm/v2/index.js +1 -1
  28. package/dist/esm/v3/OrSidebar-749bbcba.js +387 -0
  29. package/dist/esm/v3/components/index.js +1 -1
  30. package/dist/esm/v3/components/or-sidebar-v3/OrSidebar.stories3.d.ts +36 -1
  31. package/dist/esm/v3/components/or-sidebar-v3/OrSidebar.vue.d.ts +49 -4
  32. package/dist/esm/v3/components/or-sidebar-v3/OrSidebarCollapseButton.stories3.d.ts +12 -0
  33. package/dist/esm/v3/components/or-sidebar-v3/OrSidebarCollapseButton.vue.d.ts +59 -0
  34. package/dist/esm/v3/components/or-sidebar-v3/index.js +12 -1
  35. package/dist/esm/v3/components/or-sidebar-v3/styles.d.ts +7 -1
  36. package/dist/esm/v3/index.js +1 -1
  37. package/package.json +2 -3
  38. package/src/components/or-sidebar-v3/OrSidebar.docs.mdx +6 -0
  39. package/src/components/or-sidebar-v3/OrSidebar.stories3.ts +219 -6
  40. package/src/components/or-sidebar-v3/OrSidebar.vue +121 -22
  41. package/src/components/or-sidebar-v3/OrSidebarCollapseButton.stories3.ts +48 -0
  42. package/src/components/or-sidebar-v3/OrSidebarCollapseButton.vue +64 -0
  43. package/src/components/or-sidebar-v3/styles.ts +153 -9
  44. package/dist/bundled/v2/OrSidebar-c95ef614.js +0 -230
  45. package/dist/bundled/v3/OrSidebar.vue_vue_type_script_lang-ce0b152c.js +0 -181
  46. package/dist/esm/v2/OrSidebar-fabc7bc9.js +0 -228
  47. package/dist/esm/v3/OrSidebar-a62972f5.js +0 -206
@@ -4,26 +4,36 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
4
4
  root: import("@vue/composition-api").Ref<HTMLElement | undefined>;
5
5
  resizeBar: import("@vue/composition-api").Ref<HTMLElement | null>;
6
6
  isResizing: import("@vue/composition-api").Ref<boolean>;
7
+ isCollapsed: import("@vue/composition-api").Ref<boolean>;
7
8
  localWidth: import("@vue/composition-api").Ref<number>;
9
+ isShowingToolbar: import("@vue/composition-api").ComputedRef<boolean>;
8
10
  sidebarStyle: import("@vue/composition-api").ComputedRef<{
9
11
  width: string;
10
12
  }>;
11
13
  rootStyles: import("@vue/composition-api").ComputedRef<string[]>;
14
+ sidebarStyles: import("@vue/composition-api").ComputedRef<string[]>;
15
+ toolbarStyles: import("@vue/composition-api").ComputedRef<string[]>;
12
16
  resizeStyles: import("@vue/composition-api").ComputedRef<string[]>;
17
+ collapsibleButtonStyles: import("@vue/composition-api").ComputedRef<string[]>;
13
18
  mainStyles: import("@vue/composition-api").ComputedRef<string[]>;
14
19
  headerStyles: import("@vue/composition-api").ComputedRef<string[]>;
15
20
  contentStyles: import("@vue/composition-api").ComputedRef<string[]>;
16
21
  footerStyles: import("@vue/composition-api").ComputedRef<string[]>;
22
+ open: () => void;
23
+ close: () => void;
17
24
  }> & import("@vue/composition-api").Data, {}, {}, {
18
25
  width: {
19
26
  type: NumberConstructor;
20
- required: false;
21
27
  default: number;
22
28
  validator: (value?: any) => boolean;
23
29
  };
24
30
  minimumWidth: {
25
31
  type: NumberConstructor;
26
- required: false;
32
+ default: number;
33
+ validator: (value?: any) => boolean;
34
+ };
35
+ maximumWidth: {
36
+ type: NumberConstructor;
27
37
  default: number;
28
38
  validator: (value?: any) => boolean;
29
39
  };
@@ -39,16 +49,27 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
39
49
  default: OrSidebarPlacement;
40
50
  validator: (value?: any) => boolean;
41
51
  };
52
+ draggable: {
53
+ type: BooleanConstructor;
54
+ default: boolean;
55
+ };
56
+ collapsible: {
57
+ type: BooleanConstructor;
58
+ default: boolean;
59
+ };
42
60
  }, import("@vue/composition-api").ExtractPropTypes<{
43
61
  width: {
44
62
  type: NumberConstructor;
45
- required: false;
46
63
  default: number;
47
64
  validator: (value?: any) => boolean;
48
65
  };
49
66
  minimumWidth: {
50
67
  type: NumberConstructor;
51
- required: false;
68
+ default: number;
69
+ validator: (value?: any) => boolean;
70
+ };
71
+ maximumWidth: {
72
+ type: NumberConstructor;
52
73
  default: number;
53
74
  validator: (value?: any) => boolean;
54
75
  };
@@ -64,35 +85,59 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
64
85
  default: OrSidebarPlacement;
65
86
  validator: (value?: any) => boolean;
66
87
  };
88
+ draggable: {
89
+ type: BooleanConstructor;
90
+ default: boolean;
91
+ };
92
+ collapsible: {
93
+ type: BooleanConstructor;
94
+ default: boolean;
95
+ };
67
96
  }>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
68
97
  width: number;
69
98
  minimumWidth: number;
99
+ maximumWidth: number;
70
100
  side: OrSidebarPlacement;
101
+ draggable: boolean;
102
+ collapsible: boolean;
71
103
  } & {} & {
72
104
  [x: string & `on${string}`]: ((...args: any[]) => any) | undefined;
73
105
  }, import("@vue/composition-api").ShallowUnwrapRef<{
74
106
  root: import("@vue/composition-api").Ref<HTMLElement | undefined>;
75
107
  resizeBar: import("@vue/composition-api").Ref<HTMLElement | null>;
76
108
  isResizing: import("@vue/composition-api").Ref<boolean>;
109
+ isCollapsed: import("@vue/composition-api").Ref<boolean>;
77
110
  localWidth: import("@vue/composition-api").Ref<number>;
111
+ isShowingToolbar: import("@vue/composition-api").ComputedRef<boolean>;
78
112
  sidebarStyle: import("@vue/composition-api").ComputedRef<{
79
113
  width: string;
80
114
  }>;
81
115
  rootStyles: import("@vue/composition-api").ComputedRef<string[]>;
116
+ sidebarStyles: import("@vue/composition-api").ComputedRef<string[]>;
117
+ toolbarStyles: import("@vue/composition-api").ComputedRef<string[]>;
82
118
  resizeStyles: import("@vue/composition-api").ComputedRef<string[]>;
119
+ collapsibleButtonStyles: import("@vue/composition-api").ComputedRef<string[]>;
83
120
  mainStyles: import("@vue/composition-api").ComputedRef<string[]>;
84
121
  headerStyles: import("@vue/composition-api").ComputedRef<string[]>;
85
122
  contentStyles: import("@vue/composition-api").ComputedRef<string[]>;
86
123
  footerStyles: import("@vue/composition-api").ComputedRef<string[]>;
124
+ open: () => void;
125
+ close: () => void;
87
126
  }>, import("@vue/composition-api").Data, {}, {}, {}, {}, string[], {
88
127
  width: number;
89
128
  minimumWidth: number;
129
+ maximumWidth: number;
90
130
  side: OrSidebarPlacement;
131
+ draggable: boolean;
132
+ collapsible: boolean;
91
133
  } & {} & {
92
134
  [x: string & `on${string}`]: ((...args: any[]) => any) | undefined;
93
135
  }, {
94
136
  width: number;
95
137
  minimumWidth: number;
138
+ maximumWidth: number;
96
139
  side: OrSidebarPlacement;
140
+ draggable: boolean;
141
+ collapsible: boolean;
97
142
  }, true>);
98
143
  export default _default;
@@ -0,0 +1,12 @@
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>)>;
@@ -0,0 +1,59 @@
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<import("@vue/composition-api").ComponentRenderProxy<{} & {}, import("@vue/composition-api").ShallowUnwrapRef<unknown>, unknown, import("@vue/composition-api").ComputedOptions, import("@vue/composition-api").MethodOptions, unknown, unknown, {
5
+ [x: string]: ((...args: any[]) => any) | null;
6
+ } | string[], {} & {}, {
7
+ [x: number]: string;
8
+ } | {}, true> | undefined>;
9
+ rootStyles: import("@vue/composition-api").ComputedRef<string[]>;
10
+ icon: import("@vue/composition-api").ComputedRef<"keyboard_arrow_left" | "keyboard_arrow_right">;
11
+ }> & import("@vue/composition-api").Data, {}, {}, {
12
+ /**
13
+ * Must be `true` if sidebar is collapsed.
14
+ */
15
+ modelValue: {
16
+ type: BooleanConstructor;
17
+ default: boolean;
18
+ };
19
+ side: {
20
+ type: PropType<OrSidebarPlacement>;
21
+ default: OrSidebarPlacement;
22
+ validator: (value?: any) => boolean;
23
+ };
24
+ }, import("@vue/composition-api").ExtractPropTypes<{
25
+ /**
26
+ * Must be `true` if sidebar is collapsed.
27
+ */
28
+ modelValue: {
29
+ type: BooleanConstructor;
30
+ default: boolean;
31
+ };
32
+ side: {
33
+ type: PropType<OrSidebarPlacement>;
34
+ default: OrSidebarPlacement;
35
+ validator: (value?: any) => boolean;
36
+ };
37
+ }>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
38
+ modelValue: boolean;
39
+ side: OrSidebarPlacement;
40
+ } & {} & {
41
+ [x: string & `on${string}`]: ((...args: any[]) => any) | undefined;
42
+ }, import("@vue/composition-api").ShallowUnwrapRef<{
43
+ root: import("@vue/composition-api").Ref<import("@vue/composition-api").ComponentRenderProxy<{} & {}, import("@vue/composition-api").ShallowUnwrapRef<unknown>, unknown, import("@vue/composition-api").ComputedOptions, import("@vue/composition-api").MethodOptions, unknown, unknown, {
44
+ [x: string]: ((...args: any[]) => any) | null;
45
+ } | string[], {} & {}, {
46
+ [x: number]: string;
47
+ } | {}, true> | undefined>;
48
+ rootStyles: import("@vue/composition-api").ComputedRef<string[]>;
49
+ icon: import("@vue/composition-api").ComputedRef<"keyboard_arrow_left" | "keyboard_arrow_right">;
50
+ }>, import("@vue/composition-api").Data, {}, {}, {}, {}, string[], {
51
+ modelValue: boolean;
52
+ side: OrSidebarPlacement;
53
+ } & {} & {
54
+ [x: string & `on${string}`]: ((...args: any[]) => any) | undefined;
55
+ }, {
56
+ modelValue: boolean;
57
+ side: OrSidebarPlacement;
58
+ }, true>);
59
+ export default _default;
@@ -1,5 +1,16 @@
1
- export { O as OrSidebarPlacement, s as OrSidebarV3 } from '../../OrSidebar-a62972f5.js';
1
+ export { O as OrSidebarPlacement, s as OrSidebarV3 } from '../../OrSidebar-749bbcba.js';
2
2
  import '@vueuse/core';
3
3
  import 'lodash';
4
4
  import 'vue-demi';
5
+ import '../../OrIconButton-1a89fbf9.js';
6
+ import '../../useClassAttribute-47fdb016.js';
7
+ import '../../OrIcon-b195169c.js';
5
8
  import 'vue';
9
+ import '../../OrTooltip-50d27b4f.js';
10
+ import '../../OrPopover-1075dd38.js';
11
+ import '@floating-ui/dom';
12
+ import '../../useElevation-31bfe1f6.js';
13
+ import '../../useResponsive-a02e95b7.js';
14
+ import '../../OrBottomSheet-62817aec.js';
15
+ import '../../OrOverlay-738a44d5.js';
16
+ import '../../OrTeleport.vue3-8099178c.js';
@@ -1,10 +1,16 @@
1
1
  import { OrSidebarPlacement } from './props';
2
2
  export declare const SidebarRoot: string[];
3
- export declare const SidebarRootSides: Record<OrSidebarPlacement, string[]>;
3
+ export declare const SidebarBar: string[];
4
+ export declare const SidebarToolbar: string[];
5
+ export declare const SidebarSides: Record<OrSidebarPlacement, string[]>;
6
+ export declare const SidebarToolbarSides: Record<OrSidebarPlacement, string[]>;
4
7
  export declare const SidebarResize: string[];
5
8
  export declare const SidebarResizeSides: Record<OrSidebarPlacement, string[]>;
9
+ export declare const SidebarCollapseButton: string[];
10
+ export declare const SidebarCollapseButtonSides: Record<OrSidebarPlacement, string[]>;
6
11
  export declare const SidebarResizingSides: Record<OrSidebarPlacement, string[]>;
7
12
  export declare const SidebarMain: string[];
8
13
  export declare const SidebarHeader: string[];
9
14
  export declare const SidebarContent: string[];
10
15
  export declare const SidebarFooter: string[];
16
+ export declare const CollapseButton: string[];
@@ -65,7 +65,7 @@ export { s as OrSegmentedControlV3, S as SegmentedControlSize } from './OrSegmen
65
65
  export { s as OrSelect } from './OrSelect-0821b907.js';
66
66
  export { s as OrSelectV3 } from './OrSelect-dfa4885f.js';
67
67
  export { s as OrSidebar, O as OrSidebarSide } from './OrSidebar-375c85a3.js';
68
- export { O as OrSidebarPlacement, s as OrSidebarV3 } from './OrSidebar-a62972f5.js';
68
+ export { O as OrSidebarPlacement, s as OrSidebarV3 } from './OrSidebar-749bbcba.js';
69
69
  export { s as OrSkeletonCircle, a as OrSkeletonRect, b as OrSkeletonText, O as OrSkeletonTextSizes } from './OrSkeletonText-2b1610ce.js';
70
70
  export { s as OrSkeletonCircleV3, a as OrSkeletonRectV3, b as OrSkeletonTextV3 } from './OrSkeletonText-3965ff71.js';
71
71
  export { s as OrSlider } from './OrSlider-87e2da8c.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/ui-components",
3
- "version": "2.70.1",
3
+ "version": "2.70.2-beta.2198.0",
4
4
  "description": "Vue components library for v2/3",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/auto/index.js",
@@ -124,6 +124,5 @@
124
124
  "default": "./dist/bundled/v3/components/*/index.js"
125
125
  },
126
126
  "./package.json": "./package.json"
127
- },
128
- "gitHead": "17e59ffe62767284f97f34422c6b40b43d97a309"
127
+ }
129
128
  }
@@ -5,3 +5,9 @@ import { OrSidebarV3 as OrSidebar } from '@onereach/ui-components';
5
5
  ```
6
6
 
7
7
  <DocsPage />
8
+
9
+ ## Migration Guide from V1
10
+ - added property `draggable`
11
+ - added property `maximumWidth`
12
+ - added property `collapsible`
13
+ - added slot `toolbar`
@@ -3,8 +3,11 @@ import OrSidebarDocs from './OrSidebar.docs.mdx';
3
3
  import OrSidebar from './OrSidebar.vue';
4
4
  import { OrSidebarPlacement } from './props';
5
5
  import { action } from '@storybook/addon-actions';
6
+ import { ref } from 'vue-demi';
6
7
  import * as Faker from 'faker';
7
8
  import { OrButtonV3 as OrButton } from '../or-button-v3';
9
+ import { OrIconButtonV3 as OrIconButton } from '../or-icon-button-v3';
10
+ import { OrTabsV3 as OrTabs, TabsItem } from '../or-tabs-v3';
8
11
 
9
12
  export default {
10
13
  title: 'Components/Sidebar',
@@ -39,6 +42,15 @@ export default {
39
42
  control: { type: 'text' },
40
43
  },
41
44
 
45
+ toolbar: {
46
+ type: {
47
+ name: 'string',
48
+ required: false,
49
+ },
50
+
51
+ control: { type: 'text' },
52
+ },
53
+
42
54
  // Props
43
55
  width: {
44
56
  control: { type: 'number' },
@@ -52,6 +64,14 @@ export default {
52
64
  control: { type: 'select' },
53
65
  options: Object.values(OrSidebarPlacement),
54
66
  },
67
+
68
+ draggable: {
69
+ control: { type: 'boolean' },
70
+ },
71
+
72
+ collapsible: {
73
+ control: { type: 'boolean' },
74
+ },
55
75
  },
56
76
 
57
77
  parameters: {
@@ -67,6 +87,7 @@ const DefaultTemplate: StoryFn<typeof OrSidebar> = (args) => ({
67
87
  components: {
68
88
  OrSidebar,
69
89
  OrButton,
90
+ OrIconButton,
70
91
  },
71
92
 
72
93
  setup() {
@@ -78,9 +99,9 @@ const DefaultTemplate: StoryFn<typeof OrSidebar> = (args) => ({
78
99
  },
79
100
 
80
101
  template: `
81
- <div style="display: flex; flex-direction: row; border: 1px solid gray; max-height: 500px">
102
+ <div style="display: flex; flex-direction: row; border: 1px solid gray; max-height: 750px">
82
103
  <div style="flex-grow: 1; overflow: auto">
83
- ${Faker.lorem.paragraphs(3)}
104
+ ${Faker.lorem.paragraphs(10)}
84
105
  </div>
85
106
  <OrSidebar v-bind="args" @change:width="onChangeWidth">
86
107
  <template v-if="${!!args.header}" v-slot:header>
@@ -92,6 +113,9 @@ const DefaultTemplate: StoryFn<typeof OrSidebar> = (args) => ({
92
113
  <template v-if="${!!args.footer}" v-slot:footer>
93
114
  ${args.footer}
94
115
  </template>
116
+ <template v-if="${!!args.toolbar}" v-slot:toolbar>
117
+ ${args.toolbar}
118
+ </template>
95
119
  </OrSidebar>
96
120
  </div>
97
121
  `,
@@ -101,6 +125,7 @@ const LeftTemplate: StoryFn<typeof OrSidebar> = (args) => ({
101
125
  components: {
102
126
  OrSidebar,
103
127
  OrButton,
128
+ OrIconButton,
104
129
  },
105
130
 
106
131
  setup() {
@@ -112,7 +137,7 @@ const LeftTemplate: StoryFn<typeof OrSidebar> = (args) => ({
112
137
  },
113
138
 
114
139
  template: `
115
- <div style="display: flex; flex-direction: row; border: 1px solid gray; max-height: 500px">
140
+ <div style="display: flex; flex-direction: row; border: 1px solid gray; max-height: 750px">
116
141
  <OrSidebar v-bind="args" @change:width="onChangeWidth">
117
142
  <template v-if="${!!args.header}" v-slot:header>
118
143
  ${args.header}
@@ -123,14 +148,137 @@ const LeftTemplate: StoryFn<typeof OrSidebar> = (args) => ({
123
148
  <template v-if="${!!args.footer}" v-slot:footer>
124
149
  ${args.footer}
125
150
  </template>
151
+ <template v-if="${!!args.toolbar}" v-slot:toolbar>
152
+ ${args.toolbar}
153
+ </template>
126
154
  </OrSidebar>
127
155
  <div style="flex-grow: 1; overflow: auto">
128
- ${Faker.lorem.paragraphs(3)}
156
+ ${Faker.lorem.paragraphs(10)}
129
157
  </div>
130
158
  </div>
131
159
  `,
132
160
  });
133
161
 
162
+ const TabsTemplate: StoryFn<typeof OrSidebar> = (args) => ({
163
+ components: {
164
+ OrSidebar,
165
+ OrButton,
166
+ OrIconButton,
167
+ OrTabs,
168
+ },
169
+
170
+ setup() {
171
+ // State
172
+ const model = ref<string>();
173
+
174
+ return {
175
+ args,
176
+ model,
177
+ };
178
+ },
179
+
180
+ methods: {
181
+ onChangeWidth: action('change:width'),
182
+ },
183
+
184
+ template: `
185
+ <div style="display: flex; flex-direction: row; border: 1px solid gray; max-height: 750px">
186
+ <div style="flex-grow: 1; overflow: auto">
187
+ ${Faker.lorem.paragraphs(10)}
188
+ </div>
189
+ <OrSidebar v-bind="args" @change:width="onChangeWidth">
190
+ <template v-if="${!!args.header}" v-slot:header>
191
+ ${args.header}
192
+ </template>
193
+ <template v-if="${!!args.default}" v-slot:default>
194
+ ${args.default}
195
+ </template>
196
+ <template v-else v-slot:default>
197
+ <or-tabs
198
+ v-model="model"
199
+ :items="args.items"
200
+ >
201
+ <template v-for="item in args.items" #[item.value]>
202
+ {{ item.label }} Content
203
+ ${Faker.lorem.paragraphs(3)}
204
+ </template>
205
+ </or-tabs>
206
+ </template>
207
+ <template v-if="${!!args.footer}" v-slot:footer>
208
+ ${args.footer}
209
+ </template>
210
+ <template v-if="${!!args.toolbar}" v-slot:toolbar>
211
+ ${args.toolbar}
212
+ </template>
213
+ </OrSidebar>
214
+ </div>
215
+ `,
216
+ });
217
+
218
+ const longToolbar = `
219
+ <or-icon-button
220
+ icon="refresh"
221
+ color="inherit"
222
+ />
223
+ <hr class="w-full border-outline-variant dark:border-outline-variant-dark" />
224
+ <or-icon-button
225
+ icon="add"
226
+ color="inherit"
227
+ />
228
+ <or-icon-button
229
+ icon="zoom_out_map"
230
+ color="inherit"
231
+ />
232
+ <or-icon-button
233
+ icon="remove"
234
+ color="inherit"
235
+ />
236
+ <hr class="w-full border-outline-variant dark:border-outline-variant-dark" />
237
+ <or-icon-button
238
+ icon="description"
239
+ color="inherit"
240
+ />
241
+ <or-icon-button
242
+ icon="tab_unselected"
243
+ color="inherit"
244
+ />
245
+ <hr class="w-full border-outline-variant dark:border-outline-variant-dark" />
246
+ <or-icon-button
247
+ icon="create_new_folder"
248
+ color="inherit"
249
+ />
250
+ <or-icon-button
251
+ icon="content_paste"
252
+ color="inherit"
253
+ />
254
+ <or-icon-button
255
+ icon="location_on"
256
+ color="inherit"
257
+ />
258
+ <or-icon-button
259
+ icon="copy_all"
260
+ color="inherit"
261
+ />
262
+ <or-icon-button
263
+ icon="call_split"
264
+ color="inherit"
265
+ />
266
+ <hr class="w-full border-outline-variant dark:border-outline-variant-dark" />
267
+ <or-icon-button
268
+ icon="sell"
269
+ color="inherit"
270
+ />
271
+ <div class="mt-auto" />
272
+ <or-icon-button
273
+ icon="terminal"
274
+ color="inherit"
275
+ />
276
+ <or-icon-button
277
+ icon="delete"
278
+ color="inherit"
279
+ />
280
+ `;
281
+
134
282
  export const Default = DefaultTemplate.bind({});
135
283
  Default.args = {
136
284
  header: 'Header',
@@ -138,11 +286,24 @@ Default.args = {
138
286
  footer: 'Footer',
139
287
  };
140
288
 
141
- export const WithMinimumWidth = DefaultTemplate.bind({});
142
- WithMinimumWidth.args = {
289
+ export const WithCustomWidthConstraints = DefaultTemplate.bind({});
290
+ WithCustomWidthConstraints.args = {
143
291
  ...Default.args,
144
292
  width: 250,
145
293
  minimumWidth: 200,
294
+ maximumWidth: 500,
295
+ };
296
+
297
+ export const NotDraggable = DefaultTemplate.bind({});
298
+ NotDraggable.args = {
299
+ ...Default.args,
300
+ draggable: false,
301
+ };
302
+
303
+ export const Collapsible = DefaultTemplate.bind({});
304
+ Collapsible.args = {
305
+ ...Default.args,
306
+ collapsible: true,
146
307
  };
147
308
 
148
309
  export const OnlyContent = DefaultTemplate.bind({});
@@ -167,8 +328,60 @@ WithFooter.args = {
167
328
  `,
168
329
  };
169
330
 
331
+ export const WithToolbar = DefaultTemplate.bind({});
332
+ WithToolbar.args = {
333
+ ...OnlyContent.args,
334
+ toolbar: longToolbar,
335
+ };
336
+
337
+ export const CollapsibleWithToolbar = DefaultTemplate.bind({});
338
+ CollapsibleWithToolbar.args = {
339
+ ...WithToolbar.args,
340
+ collapsible: true,
341
+ };
342
+
343
+ export const WithTabs = TabsTemplate.bind({});
344
+ WithTabs.args = {
345
+ minimumWidth: 352,
346
+ header: 'Headline',
347
+ items: Array.from<string, TabsItem>([
348
+ 'Alfa',
349
+ 'Bravo',
350
+ 'Charlie',
351
+ 'Delta',
352
+ 'Echo',
353
+ 'Foxtrot',
354
+ 'Golf',
355
+ 'Hotel',
356
+ 'India',
357
+ 'Juliett',
358
+ ], (item) => ({
359
+ value: item.toLowerCase(),
360
+ label: item,
361
+ })),
362
+ footer: `
363
+ <div style="display: flex; flex-direction: row; justify-content: end; gap: 16px">
364
+ <or-button color="danger" variant="outlined">Delete</or-button>
365
+ <or-button variant="outlined" class="ml-auto">Cancel</or-button>
366
+ <or-button>Save</or-button>
367
+ </div>
368
+ `,
369
+ };
370
+
170
371
  export const LeftSidebar = LeftTemplate.bind({});
171
372
  LeftSidebar.args = {
172
373
  ...Default.args,
173
374
  side: 'left',
174
375
  };
376
+
377
+ export const WithLeftToolbar = LeftTemplate.bind({});
378
+ WithLeftToolbar.args = {
379
+ ...LeftSidebar.args,
380
+ toolbar: longToolbar,
381
+ };
382
+
383
+ export const CollapsibleWithWithLeftToolbar = LeftTemplate.bind({});
384
+ CollapsibleWithWithLeftToolbar.args = {
385
+ ...WithLeftToolbar.args,
386
+ collapsible: true,
387
+ };