@onereach/ui-components 2.72.0 → 2.72.1-beta.2249.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-efd4b98a.js +464 -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 +53 -0
  7. package/dist/bundled/v2/components/or-sidebar-v3/index.js +12 -1
  8. package/dist/bundled/v2/components/or-sidebar-v3/styles.d.ts +9 -1
  9. package/dist/bundled/v2/index.js +2 -2
  10. package/dist/bundled/v3/OrSidebar.vue_vue_type_script_lang-66f8f0fd.js +356 -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 +53 -0
  16. package/dist/bundled/v3/components/or-sidebar-v3/index.js +14 -1
  17. package/dist/bundled/v3/components/or-sidebar-v3/styles.d.ts +9 -1
  18. package/dist/bundled/v3/index.js +25 -9
  19. package/dist/esm/v2/OrSidebar-b7202f16.js +461 -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 +53 -0
  25. package/dist/esm/v2/components/or-sidebar-v3/index.js +12 -1
  26. package/dist/esm/v2/components/or-sidebar-v3/styles.d.ts +9 -1
  27. package/dist/esm/v2/index.js +1 -1
  28. package/dist/esm/v3/OrSidebar-3567338f.js +396 -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 +53 -0
  34. package/dist/esm/v3/components/or-sidebar-v3/index.js +11 -1
  35. package/dist/esm/v3/components/or-sidebar-v3/styles.d.ts +9 -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 +253 -12
  40. package/src/components/or-sidebar-v3/OrSidebar.vue +130 -23
  41. package/src/components/or-sidebar-v3/OrSidebarCollapseButton.stories3.ts +48 -0
  42. package/src/components/or-sidebar-v3/OrSidebarCollapseButton.vue +74 -0
  43. package/src/components/or-sidebar-v3/styles.ts +164 -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,53 @@
1
+ import { PropType } from 'vue-demi';
2
+ import { OrSidebarPlacement } from './props';
3
+ declare const _default: import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<{
4
+ root: import("@vue/composition-api").Ref<HTMLDivElement | undefined>;
5
+ rootStyles: import("@vue/composition-api").ComputedRef<string[]>;
6
+ buttonStyles: import("@vue/composition-api").ComputedRef<string[]>;
7
+ icon: import("@vue/composition-api").ComputedRef<"keyboard_arrow_left" | "keyboard_arrow_right">;
8
+ }> & import("@vue/composition-api").Data, {}, {}, {
9
+ /**
10
+ * Must be `true` if sidebar is collapsed.
11
+ */
12
+ modelValue: {
13
+ type: BooleanConstructor;
14
+ default: boolean;
15
+ };
16
+ side: {
17
+ type: PropType<OrSidebarPlacement>;
18
+ default: OrSidebarPlacement;
19
+ validator: (value?: any) => boolean;
20
+ };
21
+ }, import("@vue/composition-api").ExtractPropTypes<{
22
+ /**
23
+ * Must be `true` if sidebar is collapsed.
24
+ */
25
+ modelValue: {
26
+ type: BooleanConstructor;
27
+ default: boolean;
28
+ };
29
+ side: {
30
+ type: PropType<OrSidebarPlacement>;
31
+ default: OrSidebarPlacement;
32
+ validator: (value?: any) => boolean;
33
+ };
34
+ }>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
35
+ modelValue: boolean;
36
+ side: OrSidebarPlacement;
37
+ } & {} & {
38
+ [x: string & `on${string}`]: ((...args: any[]) => any) | undefined;
39
+ }, import("@vue/composition-api").ShallowUnwrapRef<{
40
+ root: import("@vue/composition-api").Ref<HTMLDivElement | undefined>;
41
+ rootStyles: import("@vue/composition-api").ComputedRef<string[]>;
42
+ buttonStyles: import("@vue/composition-api").ComputedRef<string[]>;
43
+ icon: import("@vue/composition-api").ComputedRef<"keyboard_arrow_left" | "keyboard_arrow_right">;
44
+ }>, import("@vue/composition-api").Data, {}, {}, {}, {}, string[], {
45
+ modelValue: boolean;
46
+ side: OrSidebarPlacement;
47
+ } & {} & {
48
+ [x: string & `on${string}`]: ((...args: any[]) => any) | undefined;
49
+ }, {
50
+ modelValue: boolean;
51
+ side: OrSidebarPlacement;
52
+ }, true>);
53
+ export default _default;
@@ -1,5 +1,15 @@
1
- export { O as OrSidebarPlacement, s as OrSidebarV3 } from '../../OrSidebar-a62972f5.js';
1
+ export { O as OrSidebarPlacement, s as OrSidebarV3 } from '../../OrSidebar-3567338f.js';
2
2
  import '@vueuse/core';
3
3
  import 'lodash';
4
4
  import 'vue-demi';
5
+ import '../../OrIconButton-2dcfb83e.js';
6
+ import '../../OrIcon-34f59f73.js';
5
7
  import 'vue';
8
+ import '../../OrTooltip-b07616f4.js';
9
+ import '../../OrPopover-40217b49.js';
10
+ import '@floating-ui/dom';
11
+ import '../../useElevation-31bfe1f6.js';
12
+ import '../../useResponsive-a02e95b7.js';
13
+ import '../../OrBottomSheet-13a416ef.js';
14
+ import '../../OrOverlay-afad3aa4.js';
15
+ import '../../OrTeleport.vue3-8099178c.js';
@@ -1,10 +1,18 @@
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 CollapsibleSidebarToolbar: string[];
6
+ export declare const SidebarSides: Record<OrSidebarPlacement, string[]>;
7
+ export declare const SidebarToolbarSides: Record<OrSidebarPlacement, string[]>;
4
8
  export declare const SidebarResize: string[];
5
9
  export declare const SidebarResizeSides: Record<OrSidebarPlacement, string[]>;
10
+ export declare const SidebarCollapseButton: string[];
11
+ export declare const SidebarCollapseButtonSides: Record<OrSidebarPlacement, string[]>;
6
12
  export declare const SidebarResizingSides: Record<OrSidebarPlacement, string[]>;
7
13
  export declare const SidebarMain: string[];
8
14
  export declare const SidebarHeader: string[];
9
15
  export declare const SidebarContent: string[];
10
16
  export declare const SidebarFooter: string[];
17
+ export declare const CollapseButtonContainer: string[];
18
+ export declare const CollapseButton: string[];
@@ -68,7 +68,7 @@ export { s as OrSegmentedControlV3, S as SegmentedControlSize } from './OrSegmen
68
68
  export { s as OrSelect } from './OrSelect-0821b907.js';
69
69
  export { s as OrSelectV3 } from './OrSelect-466e50ca.js';
70
70
  export { s as OrSidebar, O as OrSidebarSide } from './OrSidebar-375c85a3.js';
71
- export { O as OrSidebarPlacement, s as OrSidebarV3 } from './OrSidebar-a62972f5.js';
71
+ export { O as OrSidebarPlacement, s as OrSidebarV3 } from './OrSidebar-3567338f.js';
72
72
  export { s as OrSkeletonCircle, a as OrSkeletonRect, b as OrSkeletonText, O as OrSkeletonTextSizes } from './OrSkeletonText-2b1610ce.js';
73
73
  export { s as OrSkeletonCircleV3, a as OrSkeletonRectV3, b as OrSkeletonTextV3 } from './OrSkeletonText-afd3d007.js';
74
74
  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.72.0",
3
+ "version": "2.72.1-beta.2249.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": "aa6e685bcb9af17b12d3065373d94ce27814b1e0"
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,11 +64,17 @@ 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: {
58
- layout: 'centered',
59
-
60
78
  docs: {
61
79
  page: OrSidebarDocs,
62
80
  },
@@ -67,6 +85,7 @@ const DefaultTemplate: StoryFn<typeof OrSidebar> = (args) => ({
67
85
  components: {
68
86
  OrSidebar,
69
87
  OrButton,
88
+ OrIconButton,
70
89
  },
71
90
 
72
91
  setup() {
@@ -75,14 +94,24 @@ const DefaultTemplate: StoryFn<typeof OrSidebar> = (args) => ({
75
94
 
76
95
  methods: {
77
96
  onChangeWidth: action('change:width'),
97
+ onOpen: action('open'),
98
+ onClose: action('close'),
78
99
  },
79
100
 
80
101
  template: `
81
- <div style="display: flex; flex-direction: row; border: 1px solid gray; max-height: 500px">
82
- <div style="flex-grow: 1; overflow: auto">
83
- ${Faker.lorem.paragraphs(3)}
102
+ <div style="display: flex; flex-direction: row; border: 1px solid gray; height: 650px">
103
+ <div
104
+ class="theme-background-surface-1 dark:theme-background-surface-1-dark text-on-background dark:text-on-background-dark"
105
+ style="flex-grow: 1; overflow: auto; padding: 16px"
106
+ >
107
+ ${Faker.lorem.paragraphs(10)}
84
108
  </div>
85
- <OrSidebar v-bind="args" @change:width="onChangeWidth">
109
+ <OrSidebar
110
+ v-bind="args"
111
+ @change:width="onChangeWidth"
112
+ @open="onOpen"
113
+ @close="onClose"
114
+ >
86
115
  <template v-if="${!!args.header}" v-slot:header>
87
116
  ${args.header}
88
117
  </template>
@@ -92,6 +121,9 @@ const DefaultTemplate: StoryFn<typeof OrSidebar> = (args) => ({
92
121
  <template v-if="${!!args.footer}" v-slot:footer>
93
122
  ${args.footer}
94
123
  </template>
124
+ <template v-if="${!!args.toolbar}" v-slot:toolbar>
125
+ ${args.toolbar}
126
+ </template>
95
127
  </OrSidebar>
96
128
  </div>
97
129
  `,
@@ -101,6 +133,7 @@ const LeftTemplate: StoryFn<typeof OrSidebar> = (args) => ({
101
133
  components: {
102
134
  OrSidebar,
103
135
  OrButton,
136
+ OrIconButton,
104
137
  },
105
138
 
106
139
  setup() {
@@ -109,11 +142,18 @@ const LeftTemplate: StoryFn<typeof OrSidebar> = (args) => ({
109
142
 
110
143
  methods: {
111
144
  onChangeWidth: action('change:width'),
145
+ onOpen: action('open'),
146
+ onClose: action('close'),
112
147
  },
113
148
 
114
149
  template: `
115
- <div style="display: flex; flex-direction: row; border: 1px solid gray; max-height: 500px">
116
- <OrSidebar v-bind="args" @change:width="onChangeWidth">
150
+ <div style="display: flex; flex-direction: row; border: 1px solid gray; height: 650px">
151
+ <OrSidebar
152
+ v-bind="args"
153
+ @change:width="onChangeWidth"
154
+ @open="onOpen"
155
+ @close="onClose"
156
+ >
117
157
  <template v-if="${!!args.header}" v-slot:header>
118
158
  ${args.header}
119
159
  </template>
@@ -123,14 +163,150 @@ const LeftTemplate: StoryFn<typeof OrSidebar> = (args) => ({
123
163
  <template v-if="${!!args.footer}" v-slot:footer>
124
164
  ${args.footer}
125
165
  </template>
166
+ <template v-if="${!!args.toolbar}" v-slot:toolbar>
167
+ ${args.toolbar}
168
+ </template>
126
169
  </OrSidebar>
127
- <div style="flex-grow: 1; overflow: auto">
128
- ${Faker.lorem.paragraphs(3)}
170
+ <div
171
+ class="theme-background-surface-1 dark:theme-background-surface-1-dark text-on-background dark:text-on-background-dark"
172
+ style="flex-grow: 1; overflow: auto; padding: 16px"
173
+ >
174
+ ${Faker.lorem.paragraphs(10)}
175
+ </div>
176
+ </div>
177
+ `,
178
+ });
179
+
180
+ const TabsTemplate: StoryFn<typeof OrSidebar> = (args) => ({
181
+ components: {
182
+ OrSidebar,
183
+ OrButton,
184
+ OrIconButton,
185
+ OrTabs,
186
+ },
187
+
188
+ setup() {
189
+ // State
190
+ const model = ref<string>();
191
+
192
+ return {
193
+ args,
194
+ model,
195
+ };
196
+ },
197
+
198
+ methods: {
199
+ onChangeWidth: action('change:width'),
200
+ onOpen: action('open'),
201
+ onClose: action('close'),
202
+ },
203
+
204
+ template: `
205
+ <div style="display: flex; flex-direction: row; border: 1px solid gray; height: 650px">
206
+ <div
207
+ class="theme-background-surface-1 dark:theme-background-surface-1-dark text-on-background dark:text-on-background-dark"
208
+ style="flex-grow: 1; overflow: auto; padding: 16px"
209
+ >
210
+ ${Faker.lorem.paragraphs(10)}
129
211
  </div>
212
+ <OrSidebar
213
+ v-bind="args"
214
+ @change:width="onChangeWidth"
215
+ @open="onOpen"
216
+ @close="onClose"
217
+ >
218
+ <template v-if="${!!args.header}" v-slot:header>
219
+ ${args.header}
220
+ </template>
221
+ <template v-if="${!!args.default}" v-slot:default>
222
+ ${args.default}
223
+ </template>
224
+ <template v-else v-slot:default>
225
+ <or-tabs
226
+ v-model="model"
227
+ :items="args.items"
228
+ >
229
+ <template v-for="item in args.items" #[item.value]>
230
+ {{ item.label }} Content
231
+ ${Faker.lorem.paragraphs(3)}
232
+ </template>
233
+ </or-tabs>
234
+ </template>
235
+ <template v-if="${!!args.footer}" v-slot:footer>
236
+ ${args.footer}
237
+ </template>
238
+ <template v-if="${!!args.toolbar}" v-slot:toolbar>
239
+ ${args.toolbar}
240
+ </template>
241
+ </OrSidebar>
130
242
  </div>
131
243
  `,
132
244
  });
133
245
 
246
+ const longToolbar = `
247
+ <or-icon-button
248
+ icon="refresh"
249
+ color="inherit"
250
+ />
251
+ <hr class="w-full border-outline-variant dark:border-outline-variant-dark" />
252
+ <or-icon-button
253
+ icon="add"
254
+ color="inherit"
255
+ />
256
+ <or-icon-button
257
+ icon="zoom_out_map"
258
+ color="inherit"
259
+ />
260
+ <or-icon-button
261
+ icon="remove"
262
+ color="inherit"
263
+ />
264
+ <hr class="w-full border-outline-variant dark:border-outline-variant-dark" />
265
+ <or-icon-button
266
+ icon="description"
267
+ color="inherit"
268
+ />
269
+ <or-icon-button
270
+ icon="tab_unselected"
271
+ color="inherit"
272
+ />
273
+ <hr class="w-full border-outline-variant dark:border-outline-variant-dark" />
274
+ <or-icon-button
275
+ icon="create_new_folder"
276
+ color="inherit"
277
+ />
278
+ <or-icon-button
279
+ icon="content_paste"
280
+ color="inherit"
281
+ />
282
+ <or-icon-button
283
+ icon="location_on"
284
+ color="inherit"
285
+ />
286
+ <or-icon-button
287
+ icon="copy_all"
288
+ color="inherit"
289
+ />
290
+ <or-icon-button
291
+ icon="call_split"
292
+ color="inherit"
293
+ />
294
+ <hr class="w-full border-outline-variant dark:border-outline-variant-dark" />
295
+ <or-icon-button
296
+ icon="sell"
297
+ color="inherit"
298
+ />
299
+ <div class="mt-auto" />
300
+ <or-icon-button
301
+ icon="terminal"
302
+ color="inherit"
303
+ />
304
+ <or-icon-button
305
+ icon="delete"
306
+ color="inherit"
307
+ />
308
+ `;
309
+
134
310
  export const Default = DefaultTemplate.bind({});
135
311
  Default.args = {
136
312
  header: 'Header',
@@ -138,11 +314,24 @@ Default.args = {
138
314
  footer: 'Footer',
139
315
  };
140
316
 
141
- export const WithMinimumWidth = DefaultTemplate.bind({});
142
- WithMinimumWidth.args = {
317
+ export const WithCustomWidthConstraints = DefaultTemplate.bind({});
318
+ WithCustomWidthConstraints.args = {
143
319
  ...Default.args,
144
320
  width: 250,
145
321
  minimumWidth: 200,
322
+ maximumWidth: 500,
323
+ };
324
+
325
+ export const NotDraggable = DefaultTemplate.bind({});
326
+ NotDraggable.args = {
327
+ ...Default.args,
328
+ draggable: false,
329
+ };
330
+
331
+ export const Collapsible = DefaultTemplate.bind({});
332
+ Collapsible.args = {
333
+ ...Default.args,
334
+ collapsible: true,
146
335
  };
147
336
 
148
337
  export const OnlyContent = DefaultTemplate.bind({});
@@ -167,8 +356,60 @@ WithFooter.args = {
167
356
  `,
168
357
  };
169
358
 
359
+ export const WithToolbar = DefaultTemplate.bind({});
360
+ WithToolbar.args = {
361
+ ...OnlyContent.args,
362
+ toolbar: longToolbar,
363
+ };
364
+
365
+ export const CollapsibleWithToolbar = DefaultTemplate.bind({});
366
+ CollapsibleWithToolbar.args = {
367
+ ...WithToolbar.args,
368
+ collapsible: true,
369
+ };
370
+
371
+ export const WithTabs = TabsTemplate.bind({});
372
+ WithTabs.args = {
373
+ minimumWidth: 352,
374
+ header: 'Headline',
375
+ items: Array.from<string, TabsItem>([
376
+ 'Alfa',
377
+ 'Bravo',
378
+ 'Charlie',
379
+ 'Delta',
380
+ 'Echo',
381
+ 'Foxtrot',
382
+ 'Golf',
383
+ 'Hotel',
384
+ 'India',
385
+ 'Juliett',
386
+ ], (item) => ({
387
+ value: item.toLowerCase(),
388
+ label: item,
389
+ })),
390
+ footer: `
391
+ <div style="display: flex; flex-direction: row; justify-content: end; gap: 16px">
392
+ <or-button color="danger" variant="outlined">Delete</or-button>
393
+ <or-button variant="outlined" class="ml-auto">Cancel</or-button>
394
+ <or-button>Save</or-button>
395
+ </div>
396
+ `,
397
+ };
398
+
170
399
  export const LeftSidebar = LeftTemplate.bind({});
171
400
  LeftSidebar.args = {
172
401
  ...Default.args,
173
402
  side: 'left',
174
403
  };
404
+
405
+ export const WithLeftToolbar = LeftTemplate.bind({});
406
+ WithLeftToolbar.args = {
407
+ ...LeftSidebar.args,
408
+ toolbar: longToolbar,
409
+ };
410
+
411
+ export const CollapsibleWithWithLeftToolbar = LeftTemplate.bind({});
412
+ CollapsibleWithWithLeftToolbar.args = {
413
+ ...WithLeftToolbar.args,
414
+ collapsible: true,
415
+ };