@onereach/ui-components 2.68.0-beta.2003.0 → 2.68.0-beta.2016.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/components/or-input-box-v3/OrInputBox.vue.d.ts +1 -1
- package/dist/bundled/v2/index.js +1 -1
- package/dist/bundled/v3/components/or-input-box-v3/OrInputBox.vue.d.ts +1 -1
- package/dist/bundled/v3/index.js +1 -1
- package/dist/esm/v2/components/or-input-box-v3/OrInputBox.vue.d.ts +1 -1
- package/dist/esm/v3/OrInput-4f55c0eb.js +1 -1
- package/dist/esm/v3/{OrInputBox-634230b1.js → OrInputBox-542d2f2c.js} +1 -1
- package/dist/esm/v3/OrSearch-d74891a5.js +1 -1
- package/dist/esm/v3/OrSelect-b3a233cc.js +1 -1
- package/dist/esm/v3/OrTextarea-98895b2a.js +1 -1
- package/dist/esm/v3/components/index.js +1 -1
- package/dist/esm/v3/components/or-card-collection-v3/index.js +1 -1
- package/dist/esm/v3/components/or-confirm-v3/index.js +1 -1
- package/dist/esm/v3/components/or-input-box-v3/OrInputBox.vue.d.ts +1 -1
- package/dist/esm/v3/components/or-input-box-v3/index.js +2 -2
- package/dist/esm/v3/components/or-input-v3/index.js +1 -1
- package/dist/esm/v3/components/or-search-v3/index.js +1 -1
- package/dist/esm/v3/components/or-select-v3/index.js +1 -1
- package/dist/esm/v3/components/or-textarea-v3/index.js +1 -1
- package/dist/esm/v3/index.js +1 -1
- package/package.json +10 -2
- package/src/components/or-input-box-v3/OrInputBox.vue +1 -1
- package/src/utils/functions/text.ts +2 -2
- package/dist/bundled/v2/components/or-empty-state-v3/OrEmptyState.stories3.d.ts +0 -39
- package/dist/bundled/v2/components/or-empty-state-v3/OrEmptyState.vue.d.ts +0 -109
- package/dist/bundled/v2/components/or-empty-state-v3/index.d.ts +0 -2
- package/dist/bundled/v2/components/or-empty-state-v3/index.js +0 -131
- package/dist/bundled/v2/components/or-empty-state-v3/types.d.ts +0 -2
- package/dist/bundled/v3/components/or-empty-state-v3/OrEmptyState.stories3.d.ts +0 -39
- package/dist/bundled/v3/components/or-empty-state-v3/OrEmptyState.vue.d.ts +0 -109
- package/dist/bundled/v3/components/or-empty-state-v3/index.d.ts +0 -2
- package/dist/bundled/v3/components/or-empty-state-v3/index.js +0 -111
- package/dist/bundled/v3/components/or-empty-state-v3/types.d.ts +0 -2
- package/dist/esm/v2/components/or-empty-state-v3/OrEmptyState.stories3.d.ts +0 -39
- package/dist/esm/v2/components/or-empty-state-v3/OrEmptyState.vue.d.ts +0 -109
- package/dist/esm/v2/components/or-empty-state-v3/index.d.ts +0 -2
- package/dist/esm/v2/components/or-empty-state-v3/index.js +0 -129
- package/dist/esm/v2/components/or-empty-state-v3/types.d.ts +0 -2
- package/dist/esm/v3/components/or-empty-state-v3/OrEmptyState.stories3.d.ts +0 -39
- package/dist/esm/v3/components/or-empty-state-v3/OrEmptyState.vue.d.ts +0 -109
- package/dist/esm/v3/components/or-empty-state-v3/index.d.ts +0 -2
- package/dist/esm/v3/components/or-empty-state-v3/index.js +0 -111
- package/dist/esm/v3/components/or-empty-state-v3/types.d.ts +0 -2
- package/src/components/or-empty-state-v3/OrEmptyState.stories3.ts +0 -203
- package/src/components/or-empty-state-v3/OrEmptyState.vue +0 -101
- package/src/components/or-empty-state-v3/index.ts +0 -2
- package/src/components/or-empty-state-v3/types.ts +0 -3
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { LoaderVariant } from '../or-loader-v3';
|
|
2
|
-
import { PropType } from 'vue-demi';
|
|
3
|
-
import { EmptyStateLoader } from '.';
|
|
4
|
-
declare const _default: import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<import("@vue/composition-api").Data> & import("@vue/composition-api").Data, {}, {
|
|
5
|
-
loaderVariant(): LoaderVariant | undefined;
|
|
6
|
-
}, {
|
|
7
|
-
/**
|
|
8
|
-
* The heading of the empty state block.
|
|
9
|
-
*/
|
|
10
|
-
heading: {
|
|
11
|
-
type: StringConstructor;
|
|
12
|
-
default: string;
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Additional text such as a hint for a user with proposed next steps.
|
|
16
|
-
*/
|
|
17
|
-
text: {
|
|
18
|
-
type: StringConstructor;
|
|
19
|
-
default: string;
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Material icon name to display above the heading.
|
|
23
|
-
*/
|
|
24
|
-
icon: {
|
|
25
|
-
type: StringConstructor;
|
|
26
|
-
default: undefined;
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* Path to the image to display above the heading.
|
|
30
|
-
* Image height is scaled to 48px, width is undefined to preserve aspect ratio.
|
|
31
|
-
*/
|
|
32
|
-
iconSrc: {
|
|
33
|
-
type: StringConstructor;
|
|
34
|
-
default: undefined;
|
|
35
|
-
};
|
|
36
|
-
/**
|
|
37
|
-
* If provided, then loader is being displayed.
|
|
38
|
-
* Accepts booleans and OrLoader::variant values. `true` falls back to 'linear'.
|
|
39
|
-
*/
|
|
40
|
-
loader: {
|
|
41
|
-
type: PropType<EmptyStateLoader>;
|
|
42
|
-
default: boolean;
|
|
43
|
-
};
|
|
44
|
-
}, import("@vue/composition-api").ExtractPropTypes<{
|
|
45
|
-
/**
|
|
46
|
-
* The heading of the empty state block.
|
|
47
|
-
*/
|
|
48
|
-
heading: {
|
|
49
|
-
type: StringConstructor;
|
|
50
|
-
default: string;
|
|
51
|
-
};
|
|
52
|
-
/**
|
|
53
|
-
* Additional text such as a hint for a user with proposed next steps.
|
|
54
|
-
*/
|
|
55
|
-
text: {
|
|
56
|
-
type: StringConstructor;
|
|
57
|
-
default: string;
|
|
58
|
-
};
|
|
59
|
-
/**
|
|
60
|
-
* Material icon name to display above the heading.
|
|
61
|
-
*/
|
|
62
|
-
icon: {
|
|
63
|
-
type: StringConstructor;
|
|
64
|
-
default: undefined;
|
|
65
|
-
};
|
|
66
|
-
/**
|
|
67
|
-
* Path to the image to display above the heading.
|
|
68
|
-
* Image height is scaled to 48px, width is undefined to preserve aspect ratio.
|
|
69
|
-
*/
|
|
70
|
-
iconSrc: {
|
|
71
|
-
type: StringConstructor;
|
|
72
|
-
default: undefined;
|
|
73
|
-
};
|
|
74
|
-
/**
|
|
75
|
-
* If provided, then loader is being displayed.
|
|
76
|
-
* Accepts booleans and OrLoader::variant values. `true` falls back to 'linear'.
|
|
77
|
-
*/
|
|
78
|
-
loader: {
|
|
79
|
-
type: PropType<EmptyStateLoader>;
|
|
80
|
-
default: boolean;
|
|
81
|
-
};
|
|
82
|
-
}>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
|
|
83
|
-
heading: string;
|
|
84
|
-
text: string;
|
|
85
|
-
icon: string;
|
|
86
|
-
iconSrc: string;
|
|
87
|
-
loader: EmptyStateLoader;
|
|
88
|
-
} & {}, import("@vue/composition-api").ShallowUnwrapRef<import("@vue/composition-api").Data>, import("@vue/composition-api").Data, {
|
|
89
|
-
loaderVariant(): LoaderVariant | undefined;
|
|
90
|
-
}, {}, {}, {}, {}, {
|
|
91
|
-
heading: string;
|
|
92
|
-
text: string;
|
|
93
|
-
icon: string;
|
|
94
|
-
iconSrc: string;
|
|
95
|
-
loader: EmptyStateLoader;
|
|
96
|
-
} & {}, {
|
|
97
|
-
heading: string;
|
|
98
|
-
text: string;
|
|
99
|
-
icon: string;
|
|
100
|
-
iconSrc: string;
|
|
101
|
-
loader: EmptyStateLoader;
|
|
102
|
-
}, true>);
|
|
103
|
-
/**
|
|
104
|
-
* The component to display when there is no content on a page,
|
|
105
|
-
* no records found or selected, or while the data is being loaded.
|
|
106
|
-
* Provides a hint to the user on what to do.
|
|
107
|
-
* Consists of text message, optional icon and optional loader.
|
|
108
|
-
*/
|
|
109
|
-
export default _default;
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import { s as script$2, L as LoaderVariant } from '../../OrLoader-60943812.js';
|
|
2
|
-
import { s as script$1 } from '../../OrIcon-e2fa4cf8.js';
|
|
3
|
-
import { defineComponent } from 'vue-demi';
|
|
4
|
-
import { resolveComponent, openBlock, createElementBlock, createBlock, createCommentVNode, createElementVNode, toDisplayString, createVNode, renderSlot } from 'vue';
|
|
5
|
-
import '../../useClassAttribute-47fdb016.js';
|
|
6
|
-
import '@vueuse/core';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* The component to display when there is no content on a page,
|
|
10
|
-
* no records found or selected, or while the data is being loaded.
|
|
11
|
-
* Provides a hint to the user on what to do.
|
|
12
|
-
* Consists of text message, optional icon and optional loader.
|
|
13
|
-
*/
|
|
14
|
-
var script = defineComponent({
|
|
15
|
-
name: 'OrEmptyState',
|
|
16
|
-
components: {
|
|
17
|
-
OrIcon: script$1,
|
|
18
|
-
OrLoader: script$2
|
|
19
|
-
},
|
|
20
|
-
props: {
|
|
21
|
-
/**
|
|
22
|
-
* The heading of the empty state block.
|
|
23
|
-
*/
|
|
24
|
-
heading: {
|
|
25
|
-
type: String,
|
|
26
|
-
default: ''
|
|
27
|
-
},
|
|
28
|
-
/**
|
|
29
|
-
* Additional text such as a hint for a user with proposed next steps.
|
|
30
|
-
*/
|
|
31
|
-
text: {
|
|
32
|
-
type: String,
|
|
33
|
-
default: ''
|
|
34
|
-
},
|
|
35
|
-
/**
|
|
36
|
-
* Material icon name to display above the heading.
|
|
37
|
-
*/
|
|
38
|
-
icon: {
|
|
39
|
-
type: String,
|
|
40
|
-
default: undefined
|
|
41
|
-
},
|
|
42
|
-
/**
|
|
43
|
-
* Path to the image to display above the heading.
|
|
44
|
-
* Image height is scaled to 48px, width is undefined to preserve aspect ratio.
|
|
45
|
-
*/
|
|
46
|
-
iconSrc: {
|
|
47
|
-
type: String,
|
|
48
|
-
default: undefined
|
|
49
|
-
},
|
|
50
|
-
/**
|
|
51
|
-
* If provided, then loader is being displayed.
|
|
52
|
-
* Accepts booleans and OrLoader::variant values. `true` falls back to 'linear'.
|
|
53
|
-
*/
|
|
54
|
-
loader: {
|
|
55
|
-
type: [String, Boolean],
|
|
56
|
-
default: false
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
computed: {
|
|
60
|
-
loaderVariant() {
|
|
61
|
-
if (typeof this.loader === 'string') {
|
|
62
|
-
return this.loader;
|
|
63
|
-
} else if (this.loader === true) {
|
|
64
|
-
return LoaderVariant.Linear;
|
|
65
|
-
} else {
|
|
66
|
-
return undefined;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
const _hoisted_1 = {
|
|
73
|
-
class: "empty-state w-full grow flex flex-col justify-center items-center gap-sm"
|
|
74
|
-
};
|
|
75
|
-
const _hoisted_2 = ["src"];
|
|
76
|
-
const _hoisted_3 = {
|
|
77
|
-
class: "empty-state_heading text-on-background dark:text-on-background-dark text-headline-4 font-headline-4"
|
|
78
|
-
};
|
|
79
|
-
const _hoisted_4 = {
|
|
80
|
-
key: 2,
|
|
81
|
-
class: "empty-state_loader max-w-[432px] w-2/5 flex justify-center my-sm"
|
|
82
|
-
};
|
|
83
|
-
const _hoisted_5 = {
|
|
84
|
-
key: 3,
|
|
85
|
-
class: "empty-state_content text-center text-outline dark:text-outline-dark text-caption-regular font-caption-regular"
|
|
86
|
-
};
|
|
87
|
-
const _hoisted_6 = {
|
|
88
|
-
class: "empty-state_content text-center text-outline dark:text-outline-dark text-caption-regular font-caption-regular"
|
|
89
|
-
};
|
|
90
|
-
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
91
|
-
const _component_OrIcon = resolveComponent("OrIcon");
|
|
92
|
-
const _component_OrLoader = resolveComponent("OrLoader");
|
|
93
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [_ctx.icon ? (openBlock(), createBlock(_component_OrIcon, {
|
|
94
|
-
key: 0,
|
|
95
|
-
icon: _ctx.icon,
|
|
96
|
-
size: "inherit",
|
|
97
|
-
class: "empty-state_icon w-2xl h-2xl text-[48px] text-on-surface-variant dark:text-on-surface-variant-dark mb-sm"
|
|
98
|
-
}, null, 8 /* PROPS */, ["icon"])) : createCommentVNode("v-if", true), _ctx.iconSrc ? (openBlock(), createElementBlock("img", {
|
|
99
|
-
key: 1,
|
|
100
|
-
src: _ctx.iconSrc,
|
|
101
|
-
class: "empty-state_image h-2xl mb-sm",
|
|
102
|
-
alt: ""
|
|
103
|
-
}, null, 8 /* PROPS */, _hoisted_2)) : createCommentVNode("v-if", true), createElementVNode("div", _hoisted_3, toDisplayString(_ctx.heading), 1 /* TEXT */), _ctx.loader ? (openBlock(), createElementBlock("div", _hoisted_4, [createVNode(_component_OrLoader, {
|
|
104
|
-
variant: _ctx.loaderVariant
|
|
105
|
-
}, null, 8 /* PROPS */, ["variant"])])) : createCommentVNode("v-if", true), _ctx.$slots.default ? (openBlock(), createElementBlock("div", _hoisted_5, [createCommentVNode(" @slot Additional content can be inserted via default slot. The slot uses the same font as a 'text' prop. "), renderSlot(_ctx.$slots, "default")])) : createCommentVNode("v-if", true), createElementVNode("div", _hoisted_6, toDisplayString(_ctx.text), 1 /* TEXT */)]);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
script.render = render;
|
|
109
|
-
script.__file = "src/components/or-empty-state-v3/OrEmptyState.vue";
|
|
110
|
-
|
|
111
|
-
export { script as OrEmptyStateV3 };
|
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryFn } from '@storybook/vue3';
|
|
2
|
-
import OrEmptyState from './OrEmptyState.vue';
|
|
3
|
-
import successPng from '../../assets/success.png';
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
title: 'Components/Empty State',
|
|
7
|
-
component: OrEmptyState,
|
|
8
|
-
argTypes: {
|
|
9
|
-
loader: {
|
|
10
|
-
control: {
|
|
11
|
-
type: 'inline-radio',
|
|
12
|
-
labels: {
|
|
13
|
-
'linear': "'linear'",
|
|
14
|
-
'circular': "'circular'",
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
options: [false, true, 'linear', 'circular'],
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
parameters: {
|
|
21
|
-
layout: 'centered',
|
|
22
|
-
},
|
|
23
|
-
} as Meta<typeof OrEmptyState>
|
|
24
|
-
|
|
25
|
-
const Template: StoryFn<typeof OrEmptyState> = (args) => ({
|
|
26
|
-
components: { OrEmptyState },
|
|
27
|
-
setup() {
|
|
28
|
-
return { args };
|
|
29
|
-
},
|
|
30
|
-
template: `
|
|
31
|
-
<OrEmptyState v-bind="args"/>
|
|
32
|
-
`,
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
export const Default = Template.bind({});
|
|
36
|
-
Default.args = {
|
|
37
|
-
heading: 'No aliens detected',
|
|
38
|
-
text: 'Invite some aliens to your planet.'
|
|
39
|
-
};
|
|
40
|
-
Default.parameters = {
|
|
41
|
-
layout: 'fullscreen',
|
|
42
|
-
};
|
|
43
|
-
Default.decorators = [
|
|
44
|
-
() => ({
|
|
45
|
-
template: `
|
|
46
|
-
<div class="
|
|
47
|
-
demo-wrapper w-full min-h-[200px] h-screen box-border relative
|
|
48
|
-
gap-sm p-md bg-surface-variant
|
|
49
|
-
flex flex-col
|
|
50
|
-
text-body-2-regular">
|
|
51
|
-
<div>
|
|
52
|
-
Note: This frame is added for demo purpose.<br>
|
|
53
|
-
The OrEmptyState component is transparent and has <code>width:100%</code> and <code>flex-grow:1</code> attributes.<br>
|
|
54
|
-
It is recommended to put it inside a column flex container or a row flex container that wraps.
|
|
55
|
-
</div>
|
|
56
|
-
<div class="demo-container grow bg-background dark:bg-background-dark flex flex-col"><story /></div>
|
|
57
|
-
</div>
|
|
58
|
-
`
|
|
59
|
-
})
|
|
60
|
-
];
|
|
61
|
-
|
|
62
|
-
export const LinearLoader = Template.bind({});
|
|
63
|
-
LinearLoader.args = {
|
|
64
|
-
heading: 'Looking for aliens',
|
|
65
|
-
text: '27 aliens detected so far.',
|
|
66
|
-
loader: true,
|
|
67
|
-
};
|
|
68
|
-
LinearLoader.parameters = {
|
|
69
|
-
layout: 'fullscreen',
|
|
70
|
-
};
|
|
71
|
-
LinearLoader.decorators = [
|
|
72
|
-
() => ({
|
|
73
|
-
template: `
|
|
74
|
-
<div class="
|
|
75
|
-
demo-wrapper w-full h-[200px] box-border relative
|
|
76
|
-
gap-sm p-md bg-surface-variant
|
|
77
|
-
flex flex-col
|
|
78
|
-
text-body-2-regular">
|
|
79
|
-
<div>Note: Use linear loader (values <b>true</b> or <b>'linear'</b>) on pages and inside wide containers.</div>
|
|
80
|
-
<div class="demo-container grow bg-background dark:bg-background-dark flex flex-col"><story /></div>
|
|
81
|
-
</div>
|
|
82
|
-
`
|
|
83
|
-
})
|
|
84
|
-
];
|
|
85
|
-
|
|
86
|
-
export const CircularLoader = Template.bind({});
|
|
87
|
-
CircularLoader.args = {
|
|
88
|
-
heading: 'Looking for aliens',
|
|
89
|
-
text: '27 aliens detected so far.',
|
|
90
|
-
loader: 'circular',
|
|
91
|
-
};
|
|
92
|
-
CircularLoader.parameters = {
|
|
93
|
-
layout: 'fullscreen',
|
|
94
|
-
};
|
|
95
|
-
CircularLoader.decorators = [
|
|
96
|
-
() => ({
|
|
97
|
-
template: `
|
|
98
|
-
<div class="
|
|
99
|
-
demo-wrapper w-full min-h-[200px] h-screen box-border relative
|
|
100
|
-
gap-sm p-md bg-surface-variant
|
|
101
|
-
flex flex-col
|
|
102
|
-
text-body-2-regular">
|
|
103
|
-
<div>Note: Use circular loader (value <b>'circular'</b>) in narrow containers and sidebars.</div>
|
|
104
|
-
<div class="demo-container w-[300px] grow bg-background dark:bg-background-dark flex flex-col"><story /></div>
|
|
105
|
-
</div>
|
|
106
|
-
`
|
|
107
|
-
})
|
|
108
|
-
];
|
|
109
|
-
|
|
110
|
-
export const MaterialIcon = Template.bind({});
|
|
111
|
-
MaterialIcon.args = {
|
|
112
|
-
...Default.args,
|
|
113
|
-
icon: 'travel_explore',
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
export const ImageIcon = Template.bind({});
|
|
117
|
-
ImageIcon.args = {
|
|
118
|
-
heading: 'Planet populated',
|
|
119
|
-
text: 'So many aliens on this planet!',
|
|
120
|
-
iconSrc: successPng,
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
export const ExtraContentInSlot: StoryFn<typeof OrEmptyState> = (args) => ({
|
|
124
|
-
components: { OrEmptyState },
|
|
125
|
-
setup() {
|
|
126
|
-
return { args };
|
|
127
|
-
},
|
|
128
|
-
template: `
|
|
129
|
-
<OrEmptyState v-bind="args" heading="Alien not found" text="Pass formatted content via a default slot.">
|
|
130
|
-
Alien named <b>Garry</b> not found.<br>
|
|
131
|
-
The text in the slot is by default formatted as a component's text prop.
|
|
132
|
-
</OrEmptyState>
|
|
133
|
-
`,
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
export const Containers = Template.bind({});
|
|
137
|
-
Containers.args = {
|
|
138
|
-
...Default.args,
|
|
139
|
-
};
|
|
140
|
-
Containers.parameters = {
|
|
141
|
-
layout: 'fullscreen',
|
|
142
|
-
};
|
|
143
|
-
Containers.decorators = [
|
|
144
|
-
() => ({
|
|
145
|
-
template: `
|
|
146
|
-
<div class="
|
|
147
|
-
demo-wrapper w-full min-h-screen box-border relative
|
|
148
|
-
gap-md p-md bg-surface-variant dark:bg-surface-variant-dark
|
|
149
|
-
grid grid-cols-3 grid-rows-[1fr_repeat(auto)]
|
|
150
|
-
text-caption-regular dark:text-secondary-dark dark:text-[12px]">
|
|
151
|
-
<!--Demo Container 1. Narrow-->
|
|
152
|
-
<div class="demo-1 demo-container row-span-3 flex flex-col gap-sm">
|
|
153
|
-
<div>
|
|
154
|
-
Narrow vertical container; flex flex-col;<br>
|
|
155
|
-
Background <code>bg-background</code> applied directly to the component
|
|
156
|
-
</div>
|
|
157
|
-
<story class="bg-background dark:bg-background-dark" loader="circular"/>
|
|
158
|
-
</div>
|
|
159
|
-
<!--Demo Container 2. Fixed-->
|
|
160
|
-
<div class="demo-2 flex flex-col gap-sm justify-center items-center">
|
|
161
|
-
<div>
|
|
162
|
-
Fixed size container; flex flex-col;<br>
|
|
163
|
-
Background bg-surface-1 applied to the container
|
|
164
|
-
</div>
|
|
165
|
-
<div class="demo-container w-[240px] h-[200px] bg-surface-1 dark:bg-surface-1-dark flex flex-col">
|
|
166
|
-
<story />
|
|
167
|
-
</div>
|
|
168
|
-
</div>
|
|
169
|
-
<!--Demo Container 3. No container-->
|
|
170
|
-
<div class="demo-3">
|
|
171
|
-
<div>No container or simple block container; no background </div>
|
|
172
|
-
<div class="demo-container w-fit"><story /></div>
|
|
173
|
-
</div>
|
|
174
|
-
<!--Demo Container 4. Wide not wrap-->
|
|
175
|
-
<div class="demo-4 col-span-2 flex flex-col gap-sm">
|
|
176
|
-
<div class="w-full">
|
|
177
|
-
Wide horizontal <b>no-wrap</b> container; flex flex-row;<br>
|
|
178
|
-
Background <code>bg-surface-1</code> applied to the container<br>
|
|
179
|
-
Background <code>bg-surface-4</code> applied to the component
|
|
180
|
-
</div>
|
|
181
|
-
<div class="demo-container bg-surface-1 dark:bg-surface-1-dark flex">
|
|
182
|
-
<div>Left item</div>
|
|
183
|
-
<story class="bg-surface-4 dark:bg-surface-4-dark" loader="linear"/>
|
|
184
|
-
<div>Right item</div>
|
|
185
|
-
</div>
|
|
186
|
-
</div>
|
|
187
|
-
<!--Demo Container 5. Wide wrap-->
|
|
188
|
-
<div class="demo-5 col-span-2 flex flex-col gap-sm">
|
|
189
|
-
<div class="w-full">
|
|
190
|
-
Wide horizontal <b>wrap</b> container; flex flex-row flex-wrap;<br>
|
|
191
|
-
Background <code>bg-surface-1</code> applied to the container<br>
|
|
192
|
-
Background <code>bg-surface-4</code> applied to the component
|
|
193
|
-
</div>
|
|
194
|
-
<div class="demo-container bg-surface-1 dark:bg-surface-1-dark flex flex-wrap">
|
|
195
|
-
<div>Left item</div>
|
|
196
|
-
<story class="bg-surface-4 dark:bg-surface-4-dark" loader="linear"/>
|
|
197
|
-
<div>Right item</div>
|
|
198
|
-
</div>
|
|
199
|
-
</div>
|
|
200
|
-
</div>
|
|
201
|
-
`
|
|
202
|
-
})
|
|
203
|
-
];
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="empty-state w-full grow flex flex-col justify-center items-center gap-sm">
|
|
3
|
-
<OrIcon v-if="icon"
|
|
4
|
-
:icon="icon"
|
|
5
|
-
size="inherit"
|
|
6
|
-
class="empty-state_icon w-2xl h-2xl text-[48px] text-on-surface-variant dark:text-on-surface-variant-dark mb-sm" />
|
|
7
|
-
<img v-if="iconSrc" :src="iconSrc" class="empty-state_image h-2xl mb-sm" alt="">
|
|
8
|
-
<div class="empty-state_heading text-on-background dark:text-on-background-dark text-headline-4 font-headline-4">
|
|
9
|
-
{{ heading }}
|
|
10
|
-
</div>
|
|
11
|
-
<div v-if="loader" class="empty-state_loader max-w-[432px] w-2/5 flex justify-center my-sm">
|
|
12
|
-
<OrLoader :variant="loaderVariant" />
|
|
13
|
-
</div>
|
|
14
|
-
<div v-if="$slots.default" class="empty-state_content text-center text-outline dark:text-outline-dark text-caption-regular font-caption-regular">
|
|
15
|
-
<!-- @slot Additional content can be inserted via default slot. The slot uses the same font as a 'text' prop. -->
|
|
16
|
-
<slot/>
|
|
17
|
-
</div>
|
|
18
|
-
<div class="empty-state_content text-center text-outline dark:text-outline-dark text-caption-regular font-caption-regular">
|
|
19
|
-
{{ text }}
|
|
20
|
-
</div>
|
|
21
|
-
</div>
|
|
22
|
-
</template>
|
|
23
|
-
|
|
24
|
-
<script lang="ts">
|
|
25
|
-
import {
|
|
26
|
-
LoaderVariant,
|
|
27
|
-
OrLoaderV3 as OrLoader,
|
|
28
|
-
} from '../or-loader-v3';
|
|
29
|
-
import {
|
|
30
|
-
OrIconV3 as OrIcon,
|
|
31
|
-
} from '../or-icon-v3';
|
|
32
|
-
import { defineComponent, PropType } from 'vue-demi';
|
|
33
|
-
import { EmptyStateLoader } from '.';
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* The component to display when there is no content on a page,
|
|
37
|
-
* no records found or selected, or while the data is being loaded.
|
|
38
|
-
* Provides a hint to the user on what to do.
|
|
39
|
-
* Consists of text message, optional icon and optional loader.
|
|
40
|
-
*/
|
|
41
|
-
export default defineComponent({
|
|
42
|
-
name: 'OrEmptyState',
|
|
43
|
-
components: {
|
|
44
|
-
OrIcon,
|
|
45
|
-
OrLoader,
|
|
46
|
-
},
|
|
47
|
-
props: {
|
|
48
|
-
/**
|
|
49
|
-
* The heading of the empty state block.
|
|
50
|
-
*/
|
|
51
|
-
heading: {
|
|
52
|
-
type: String,
|
|
53
|
-
default: '',
|
|
54
|
-
},
|
|
55
|
-
/**
|
|
56
|
-
* Additional text such as a hint for a user with proposed next steps.
|
|
57
|
-
*/
|
|
58
|
-
text: {
|
|
59
|
-
type: String,
|
|
60
|
-
default: '',
|
|
61
|
-
},
|
|
62
|
-
/**
|
|
63
|
-
* Material icon name to display above the heading.
|
|
64
|
-
*/
|
|
65
|
-
icon: {
|
|
66
|
-
type: String,
|
|
67
|
-
default: undefined,
|
|
68
|
-
},
|
|
69
|
-
/**
|
|
70
|
-
* Path to the image to display above the heading.
|
|
71
|
-
* Image height is scaled to 48px, width is undefined to preserve aspect ratio.
|
|
72
|
-
*/
|
|
73
|
-
iconSrc: {
|
|
74
|
-
type: String,
|
|
75
|
-
default: undefined,
|
|
76
|
-
},
|
|
77
|
-
/**
|
|
78
|
-
* If provided, then loader is being displayed.
|
|
79
|
-
* Accepts booleans and OrLoader::variant values. `true` falls back to 'linear'.
|
|
80
|
-
*/
|
|
81
|
-
loader: {
|
|
82
|
-
type: [String, Boolean] as PropType<EmptyStateLoader>,
|
|
83
|
-
default: false,
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
computed: {
|
|
87
|
-
loaderVariant(): LoaderVariant | undefined {
|
|
88
|
-
if (typeof this.loader === 'string') {
|
|
89
|
-
return this.loader;
|
|
90
|
-
} else if (this.loader === true) {
|
|
91
|
-
return LoaderVariant.Linear;
|
|
92
|
-
} else {
|
|
93
|
-
return undefined;
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
});
|
|
98
|
-
</script>
|
|
99
|
-
|
|
100
|
-
<style scoped>
|
|
101
|
-
</style>
|