@onereach/ui-components 2.71.0 → 2.71.1-beta.2220.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-d445ecdd.js +463 -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 +13 -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-80e5dc4b.js +355 -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 +15 -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-097a4b55.js +460 -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 +13 -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-f6b2050b.js +395 -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 +12 -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 +230 -10
  40. package/src/components/or-sidebar-v3/OrSidebar.vue +123 -22
  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,16 @@
1
- export { O as OrSidebarPlacement, s as OrSidebarV3 } from '../../OrSidebar-a62972f5.js';
1
+ export { O as OrSidebarPlacement, s as OrSidebarV3 } from '../../OrSidebar-f6b2050b.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,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[];
@@ -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-8fbd88bc.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-f6b2050b.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.71.0",
3
+ "version": "2.71.1-beta.2220.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": "cefc97d698b64427f39d20edb6f637b22a00a362"
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() {
@@ -78,9 +97,12 @@ const DefaultTemplate: StoryFn<typeof OrSidebar> = (args) => ({
78
97
  },
79
98
 
80
99
  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)}
100
+ <div style="display: flex; flex-direction: row; border: 1px solid gray; height: 650px">
101
+ <div
102
+ class="theme-background-surface-1 dark:theme-background-surface-1-dark text-on-background dark:text-on-background-dark"
103
+ style="flex-grow: 1; overflow: auto; padding: 16px"
104
+ >
105
+ ${Faker.lorem.paragraphs(10)}
84
106
  </div>
85
107
  <OrSidebar v-bind="args" @change:width="onChangeWidth">
86
108
  <template v-if="${!!args.header}" v-slot:header>
@@ -92,6 +114,9 @@ const DefaultTemplate: StoryFn<typeof OrSidebar> = (args) => ({
92
114
  <template v-if="${!!args.footer}" v-slot:footer>
93
115
  ${args.footer}
94
116
  </template>
117
+ <template v-if="${!!args.toolbar}" v-slot:toolbar>
118
+ ${args.toolbar}
119
+ </template>
95
120
  </OrSidebar>
96
121
  </div>
97
122
  `,
@@ -101,6 +126,7 @@ const LeftTemplate: StoryFn<typeof OrSidebar> = (args) => ({
101
126
  components: {
102
127
  OrSidebar,
103
128
  OrButton,
129
+ OrIconButton,
104
130
  },
105
131
 
106
132
  setup() {
@@ -112,7 +138,7 @@ const LeftTemplate: StoryFn<typeof OrSidebar> = (args) => ({
112
138
  },
113
139
 
114
140
  template: `
115
- <div style="display: flex; flex-direction: row; border: 1px solid gray; max-height: 500px">
141
+ <div style="display: flex; flex-direction: row; border: 1px solid gray; height: 650px">
116
142
  <OrSidebar v-bind="args" @change:width="onChangeWidth">
117
143
  <template v-if="${!!args.header}" v-slot:header>
118
144
  ${args.header}
@@ -123,14 +149,143 @@ const LeftTemplate: StoryFn<typeof OrSidebar> = (args) => ({
123
149
  <template v-if="${!!args.footer}" v-slot:footer>
124
150
  ${args.footer}
125
151
  </template>
152
+ <template v-if="${!!args.toolbar}" v-slot:toolbar>
153
+ ${args.toolbar}
154
+ </template>
126
155
  </OrSidebar>
127
- <div style="flex-grow: 1; overflow: auto">
128
- ${Faker.lorem.paragraphs(3)}
156
+ <div
157
+ class="theme-background-surface-1 dark:theme-background-surface-1-dark text-on-background dark:text-on-background-dark"
158
+ style="flex-grow: 1; overflow: auto; padding: 16px"
159
+ >
160
+ ${Faker.lorem.paragraphs(10)}
129
161
  </div>
130
162
  </div>
131
163
  `,
132
164
  });
133
165
 
166
+ const TabsTemplate: StoryFn<typeof OrSidebar> = (args) => ({
167
+ components: {
168
+ OrSidebar,
169
+ OrButton,
170
+ OrIconButton,
171
+ OrTabs,
172
+ },
173
+
174
+ setup() {
175
+ // State
176
+ const model = ref<string>();
177
+
178
+ return {
179
+ args,
180
+ model,
181
+ };
182
+ },
183
+
184
+ methods: {
185
+ onChangeWidth: action('change:width'),
186
+ },
187
+
188
+ template: `
189
+ <div style="display: flex; flex-direction: row; border: 1px solid gray; height: 650px">
190
+ <div
191
+ class="theme-background-surface-1 dark:theme-background-surface-1-dark text-on-background dark:text-on-background-dark"
192
+ style="flex-grow: 1; overflow: auto; padding: 16px"
193
+ >
194
+ ${Faker.lorem.paragraphs(10)}
195
+ </div>
196
+ <OrSidebar v-bind="args" @change:width="onChangeWidth">
197
+ <template v-if="${!!args.header}" v-slot:header>
198
+ ${args.header}
199
+ </template>
200
+ <template v-if="${!!args.default}" v-slot:default>
201
+ ${args.default}
202
+ </template>
203
+ <template v-else v-slot:default>
204
+ <or-tabs
205
+ v-model="model"
206
+ :items="args.items"
207
+ >
208
+ <template v-for="item in args.items" #[item.value]>
209
+ {{ item.label }} Content
210
+ ${Faker.lorem.paragraphs(3)}
211
+ </template>
212
+ </or-tabs>
213
+ </template>
214
+ <template v-if="${!!args.footer}" v-slot:footer>
215
+ ${args.footer}
216
+ </template>
217
+ <template v-if="${!!args.toolbar}" v-slot:toolbar>
218
+ ${args.toolbar}
219
+ </template>
220
+ </OrSidebar>
221
+ </div>
222
+ `,
223
+ });
224
+
225
+ const longToolbar = `
226
+ <or-icon-button
227
+ icon="refresh"
228
+ color="inherit"
229
+ />
230
+ <hr class="w-full border-outline-variant dark:border-outline-variant-dark" />
231
+ <or-icon-button
232
+ icon="add"
233
+ color="inherit"
234
+ />
235
+ <or-icon-button
236
+ icon="zoom_out_map"
237
+ color="inherit"
238
+ />
239
+ <or-icon-button
240
+ icon="remove"
241
+ color="inherit"
242
+ />
243
+ <hr class="w-full border-outline-variant dark:border-outline-variant-dark" />
244
+ <or-icon-button
245
+ icon="description"
246
+ color="inherit"
247
+ />
248
+ <or-icon-button
249
+ icon="tab_unselected"
250
+ color="inherit"
251
+ />
252
+ <hr class="w-full border-outline-variant dark:border-outline-variant-dark" />
253
+ <or-icon-button
254
+ icon="create_new_folder"
255
+ color="inherit"
256
+ />
257
+ <or-icon-button
258
+ icon="content_paste"
259
+ color="inherit"
260
+ />
261
+ <or-icon-button
262
+ icon="location_on"
263
+ color="inherit"
264
+ />
265
+ <or-icon-button
266
+ icon="copy_all"
267
+ color="inherit"
268
+ />
269
+ <or-icon-button
270
+ icon="call_split"
271
+ color="inherit"
272
+ />
273
+ <hr class="w-full border-outline-variant dark:border-outline-variant-dark" />
274
+ <or-icon-button
275
+ icon="sell"
276
+ color="inherit"
277
+ />
278
+ <div class="mt-auto" />
279
+ <or-icon-button
280
+ icon="terminal"
281
+ color="inherit"
282
+ />
283
+ <or-icon-button
284
+ icon="delete"
285
+ color="inherit"
286
+ />
287
+ `;
288
+
134
289
  export const Default = DefaultTemplate.bind({});
135
290
  Default.args = {
136
291
  header: 'Header',
@@ -138,11 +293,24 @@ Default.args = {
138
293
  footer: 'Footer',
139
294
  };
140
295
 
141
- export const WithMinimumWidth = DefaultTemplate.bind({});
142
- WithMinimumWidth.args = {
296
+ export const WithCustomWidthConstraints = DefaultTemplate.bind({});
297
+ WithCustomWidthConstraints.args = {
143
298
  ...Default.args,
144
299
  width: 250,
145
300
  minimumWidth: 200,
301
+ maximumWidth: 500,
302
+ };
303
+
304
+ export const NotDraggable = DefaultTemplate.bind({});
305
+ NotDraggable.args = {
306
+ ...Default.args,
307
+ draggable: false,
308
+ };
309
+
310
+ export const Collapsible = DefaultTemplate.bind({});
311
+ Collapsible.args = {
312
+ ...Default.args,
313
+ collapsible: true,
146
314
  };
147
315
 
148
316
  export const OnlyContent = DefaultTemplate.bind({});
@@ -167,8 +335,60 @@ WithFooter.args = {
167
335
  `,
168
336
  };
169
337
 
338
+ export const WithToolbar = DefaultTemplate.bind({});
339
+ WithToolbar.args = {
340
+ ...OnlyContent.args,
341
+ toolbar: longToolbar,
342
+ };
343
+
344
+ export const CollapsibleWithToolbar = DefaultTemplate.bind({});
345
+ CollapsibleWithToolbar.args = {
346
+ ...WithToolbar.args,
347
+ collapsible: true,
348
+ };
349
+
350
+ export const WithTabs = TabsTemplate.bind({});
351
+ WithTabs.args = {
352
+ minimumWidth: 352,
353
+ header: 'Headline',
354
+ items: Array.from<string, TabsItem>([
355
+ 'Alfa',
356
+ 'Bravo',
357
+ 'Charlie',
358
+ 'Delta',
359
+ 'Echo',
360
+ 'Foxtrot',
361
+ 'Golf',
362
+ 'Hotel',
363
+ 'India',
364
+ 'Juliett',
365
+ ], (item) => ({
366
+ value: item.toLowerCase(),
367
+ label: item,
368
+ })),
369
+ footer: `
370
+ <div style="display: flex; flex-direction: row; justify-content: end; gap: 16px">
371
+ <or-button color="danger" variant="outlined">Delete</or-button>
372
+ <or-button variant="outlined" class="ml-auto">Cancel</or-button>
373
+ <or-button>Save</or-button>
374
+ </div>
375
+ `,
376
+ };
377
+
170
378
  export const LeftSidebar = LeftTemplate.bind({});
171
379
  LeftSidebar.args = {
172
380
  ...Default.args,
173
381
  side: 'left',
174
382
  };
383
+
384
+ export const WithLeftToolbar = LeftTemplate.bind({});
385
+ WithLeftToolbar.args = {
386
+ ...LeftSidebar.args,
387
+ toolbar: longToolbar,
388
+ };
389
+
390
+ export const CollapsibleWithWithLeftToolbar = LeftTemplate.bind({});
391
+ CollapsibleWithWithLeftToolbar.args = {
392
+ ...WithLeftToolbar.args,
393
+ collapsible: true,
394
+ };