@policystudio/policy-studio-ui-vue 1.0.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/.storybook/main.js +10 -0
- package/.storybook/preview.js +11 -0
- package/README.md +11 -0
- package/package.json +35 -0
- package/postcss.config.js +6 -0
- package/src/assets/scss/base.scss +29 -0
- package/src/assets/scss/tailwind.css +66544 -0
- package/src/assets/scss/tailwind.scss +61088 -0
- package/src/components/buttons/Button.vue +82 -0
- package/src/components/notifications/Dialog.vue +39 -0
- package/src/components/notifications/Toast.vue +53 -0
- package/src/components/tabs/Tabs.vue +99 -0
- package/src/index.js +14 -0
- package/src/stories/Button.stories.js +54 -0
- package/src/stories/Colors.stories.mdx +22 -0
- package/src/stories/Dialog.stories.js +34 -0
- package/src/stories/ElevationSystem.stories.mdx +41 -0
- package/src/stories/Introduction.stories.mdx +211 -0
- package/src/stories/Tabs.stories.js +52 -0
- package/src/stories/Toast.stories.js +58 -0
- package/src/stories/Typography.stories.mdx +120 -0
- package/src/stories/assets/code-brackets.svg +1 -0
- package/src/stories/assets/colors.svg +1 -0
- package/src/stories/assets/comments.svg +1 -0
- package/src/stories/assets/direction.svg +1 -0
- package/src/stories/assets/flow.svg +1 -0
- package/src/stories/assets/plugin.svg +1 -0
- package/src/stories/assets/repo.svg +1 -0
- package/src/stories/assets/stackalt.svg +1 -0
- package/tailwind.config.js +60 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<button
|
|
3
|
+
class="font-bold align-middle flex rounded-md"
|
|
4
|
+
:class="classes"
|
|
5
|
+
@click="onClick()"
|
|
6
|
+
>
|
|
7
|
+
<i
|
|
8
|
+
v-if="icon"
|
|
9
|
+
class="my-auto material-icons mr-2"
|
|
10
|
+
:class="{ 'text-sm': size === 'small' }"
|
|
11
|
+
>
|
|
12
|
+
{{ icon }}
|
|
13
|
+
</i>
|
|
14
|
+
<div class="flex-grow text-left">{{ label }}</div>
|
|
15
|
+
<i
|
|
16
|
+
v-if="iconRight" class="my-auto material-icons ml-2"
|
|
17
|
+
:class="{ 'text-sm': size === 'small' }"
|
|
18
|
+
>
|
|
19
|
+
{{ iconRight }}
|
|
20
|
+
</i>
|
|
21
|
+
</button>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<script>
|
|
25
|
+
export const sizes = ['big', 'medium', 'small']
|
|
26
|
+
export default {
|
|
27
|
+
props: {
|
|
28
|
+
label: {
|
|
29
|
+
type: String,
|
|
30
|
+
required: true
|
|
31
|
+
},
|
|
32
|
+
outline: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: false
|
|
35
|
+
},
|
|
36
|
+
ghost: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: false
|
|
39
|
+
},
|
|
40
|
+
textOnly: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: false
|
|
43
|
+
},
|
|
44
|
+
icon: {
|
|
45
|
+
type: String,
|
|
46
|
+
},
|
|
47
|
+
iconRight: {
|
|
48
|
+
type: String,
|
|
49
|
+
},
|
|
50
|
+
size: {
|
|
51
|
+
type: String,
|
|
52
|
+
default: 'big',
|
|
53
|
+
validator: (value) => sizes.indexOf(value) !== -1
|
|
54
|
+
},
|
|
55
|
+
disabled: {
|
|
56
|
+
type: [Boolean, String]
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
data () {
|
|
60
|
+
return {
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
computed: {
|
|
64
|
+
classes() {
|
|
65
|
+
let sizeCss = 'px-4 py-2'
|
|
66
|
+
if (this.size === 'medium') sizeCss = 'px-4 py-1'
|
|
67
|
+
if (this.size === 'small') sizeCss = 'px-2 py-px text-sm'
|
|
68
|
+
if (this.outline) return `${sizeCss} bg-white border ${this.disabled ? 'border-gray-40 text-gray-40' : 'border-blue-60 text-blue-60'}`
|
|
69
|
+
if (this.ghost) return `${sizeCss} ${this.disabled ? 'bg-gray-20 text-gray-40' : 'bg-blue-20 text-blue-60 active:shadow-inner'}`
|
|
70
|
+
if (this.textOnly) return `${sizeCss} ${this.disabled ? 'text-gray-40' : 'text-blue-60'}`
|
|
71
|
+
if (this.disabled) return `${sizeCss} bg-gray-20 text-gray-40`
|
|
72
|
+
return `${sizeCss} bg-blue-60 hover:bg-blue-50 text-white active:shadow-inner`
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
methods: {
|
|
76
|
+
onClick() {
|
|
77
|
+
if (this.disabled) return false
|
|
78
|
+
this.$emit('click');
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
</script>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="cssClass">
|
|
3
|
+
<div class="material-icons my-auto">info</div>
|
|
4
|
+
<div class="w-full">{{ message }}</div>
|
|
5
|
+
<div class="cursor-pointer font-bold my-auto pr-4">OK</div>
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script>
|
|
10
|
+
export const typeOptions = ['informative', 'success', 'alert']
|
|
11
|
+
export default {
|
|
12
|
+
name: 'Dialog',
|
|
13
|
+
props: {
|
|
14
|
+
type: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: 'informative',
|
|
17
|
+
validator: (value) => typeOptions.indexOf(value) !== -1
|
|
18
|
+
},
|
|
19
|
+
message: {
|
|
20
|
+
type: String,
|
|
21
|
+
required: true
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
data() {
|
|
25
|
+
return {
|
|
26
|
+
colors: {
|
|
27
|
+
informative: { background:'blue-20', color: 'blue-60' },
|
|
28
|
+
success: { background:'green-10', color: 'green-70' },
|
|
29
|
+
alert: { background:'yellow-10', color: 'yellow-70' }
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
computed: {
|
|
34
|
+
cssClass() {
|
|
35
|
+
return `flex space-x-4 font-small rounded-md py-2 px-4 align-middle flex bg-${this.colors[this.type].background} text-${this.colors[this.type].color}`
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
</script>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="cssClass">
|
|
3
|
+
<span class="material-icons mr-4">{{ icon }}</span>
|
|
4
|
+
<div class="w-full">{{ message }}</div>
|
|
5
|
+
<div class="flex space-x-4">
|
|
6
|
+
<slot></slot>
|
|
7
|
+
</div>
|
|
8
|
+
</div>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script>
|
|
12
|
+
export const typeOptions = ['info', 'success', 'warning', 'error']
|
|
13
|
+
export const fillOptions = ['soft', 'intense']
|
|
14
|
+
export default {
|
|
15
|
+
name: 'Toast',
|
|
16
|
+
props: {
|
|
17
|
+
type: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: 'info',
|
|
20
|
+
validator: (value) => typeOptions.indexOf(value) !== -1
|
|
21
|
+
},
|
|
22
|
+
fill: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: 'intense',
|
|
25
|
+
validator: (value) => fillOptions.indexOf(value) !== -1
|
|
26
|
+
},
|
|
27
|
+
message: {
|
|
28
|
+
type: String,
|
|
29
|
+
required: true
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
computed: {
|
|
33
|
+
icon() {
|
|
34
|
+
if (this.type === 'info') return 'info'
|
|
35
|
+
if (this.type === 'success') return 'check_circle'
|
|
36
|
+
return 'warning'
|
|
37
|
+
},
|
|
38
|
+
cssClass() {
|
|
39
|
+
const colors = {
|
|
40
|
+
info: 'blue-60',
|
|
41
|
+
success: 'green-20',
|
|
42
|
+
warning: 'yellow-20',
|
|
43
|
+
error: 'red-20'
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const textColor = this.fill === 'intense' ? 'white': colors[this.type]
|
|
47
|
+
const background = this.fill === 'soft'? `${colors[this.type].split('-', 1)}-10` : colors[this.type]
|
|
48
|
+
|
|
49
|
+
return `font-bold shadow-md rounded-md p-3 h-12 flex bg-${background} text-${textColor}`
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
</script>
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="wrapperClasses" role="group">
|
|
3
|
+
<button
|
|
4
|
+
type="button"
|
|
5
|
+
v-for="item in getItems"
|
|
6
|
+
:key="item[keyValue]"
|
|
7
|
+
@click="selectTab(item)"
|
|
8
|
+
:class="[
|
|
9
|
+
classes,
|
|
10
|
+
{ 'bg-blue-60 text-white': getSelected === item[keyValue] && theme === 'standard' },
|
|
11
|
+
{ 'border-b-2 border-blue-60 text-blue-60 font-bold': getSelected === item[keyValue] && theme === 'underline' },
|
|
12
|
+
{ 'text-blue-60 font-bold bg-white hover:text-blue-60': getSelected === item[keyValue] && theme === 'folder' }
|
|
13
|
+
]"
|
|
14
|
+
>
|
|
15
|
+
{{ item[keyLabel] }}
|
|
16
|
+
</button>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script>
|
|
21
|
+
export const themeOptions = ['standard', 'underline', 'folder']
|
|
22
|
+
export default {
|
|
23
|
+
name: 'Tabs',
|
|
24
|
+
computed: {
|
|
25
|
+
wrapperClasses() {
|
|
26
|
+
if (this.theme === 'underline') {
|
|
27
|
+
return 'flex space-x-4 border-b border-gray-20'
|
|
28
|
+
}
|
|
29
|
+
if (this.theme === 'folder') {
|
|
30
|
+
return 'flex space-x-1'
|
|
31
|
+
}
|
|
32
|
+
return 'inline-flex rounded-md flex gap-x-px'
|
|
33
|
+
},
|
|
34
|
+
classes() {
|
|
35
|
+
if (this.theme === 'underline') {
|
|
36
|
+
return 'text-gray-60 pb-3 hover:text-blue-60'
|
|
37
|
+
}
|
|
38
|
+
if (this.theme === 'folder') {
|
|
39
|
+
return 'bg-gray-10 text-gray-50 py-2 px-4 rounded-t-lg hover:text-gray-60 active:text-blue-60'
|
|
40
|
+
}
|
|
41
|
+
return 'bg-gray-10 px-4 py-2 text-gray-60 hover:text-blue-60 last:rounded-r-lg first:rounded-l-lg active:text-white active:bg-blue-60'
|
|
42
|
+
},
|
|
43
|
+
getIsObject() {
|
|
44
|
+
return typeof this.selected === 'object'
|
|
45
|
+
},
|
|
46
|
+
getSelected() {
|
|
47
|
+
if (this.selected) {
|
|
48
|
+
if (typeof this.selected === 'object' && this.selected[this.keyValue] ) {
|
|
49
|
+
return this.selected[this.keyValue]
|
|
50
|
+
} else {
|
|
51
|
+
return this.selected
|
|
52
|
+
}
|
|
53
|
+
} else {
|
|
54
|
+
return false
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
getItems() {
|
|
58
|
+
if (this.items.length > 0 && typeof this.items[0] !== 'object') {
|
|
59
|
+
return this.items.map((item) => {
|
|
60
|
+
return {
|
|
61
|
+
[this.keyLabel]: item,
|
|
62
|
+
[this.keyValue]: item
|
|
63
|
+
}
|
|
64
|
+
})
|
|
65
|
+
} else {
|
|
66
|
+
return this.items
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
props: {
|
|
72
|
+
theme: {
|
|
73
|
+
type: String,
|
|
74
|
+
default: 'standard',
|
|
75
|
+
validator: (value) => themeOptions.indexOf(value) !== -1
|
|
76
|
+
},
|
|
77
|
+
items: {
|
|
78
|
+
type: Array,
|
|
79
|
+
required: true
|
|
80
|
+
},
|
|
81
|
+
selected: {},
|
|
82
|
+
keyLabel: {
|
|
83
|
+
type: String,
|
|
84
|
+
default: 'label'
|
|
85
|
+
},
|
|
86
|
+
keyValue: {
|
|
87
|
+
type: String,
|
|
88
|
+
default: 'value'
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
methods: {
|
|
92
|
+
selectTab(item) {
|
|
93
|
+
this.$emit('update:selected', this.getIsObject ? item : item[this.keyValue] )
|
|
94
|
+
this.$emit('change', this.getIsObject ? item : item[this.keyValue])
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
}
|
|
99
|
+
</script>
|
package/src/index.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import Toast from './components/notifications/Toast.vue';
|
|
2
|
+
import Dialog from './components/notifications/Dialog.vue';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
install(Vue) {
|
|
6
|
+
Vue.component('Toast', Toast);
|
|
7
|
+
Vue.component('Dialog', Dialog);
|
|
8
|
+
},
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export {
|
|
12
|
+
Toast,
|
|
13
|
+
Dialog
|
|
14
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import Button, { sizes } from '../components/buttons/Button.vue';
|
|
2
|
+
const icons = ['add_circle', 'delete', 'done', 'info', 'send']
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Components/Button',
|
|
5
|
+
component: Button,
|
|
6
|
+
argTypes: {
|
|
7
|
+
size: { control: { type: 'select', options: sizes } },
|
|
8
|
+
disabled: { control: 'boolean' },
|
|
9
|
+
icon: { control: { type: 'select', options: icons} },
|
|
10
|
+
iconRight: { control: { type: 'select', options: icons} }
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const Template = (args, { argTypes }) => ({
|
|
15
|
+
props: Object.keys(argTypes),
|
|
16
|
+
components: { Button },
|
|
17
|
+
template: `
|
|
18
|
+
<Button v-bind="$props" />
|
|
19
|
+
`
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export const Solid = Template.bind({});
|
|
23
|
+
Solid.args = {
|
|
24
|
+
label: 'Solid button',
|
|
25
|
+
size: 'big',
|
|
26
|
+
disabled: false,
|
|
27
|
+
iconRight: 'add_circle'
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const Outline = Template.bind({});
|
|
31
|
+
Outline.args = {
|
|
32
|
+
label: 'Outline button',
|
|
33
|
+
size: 'big',
|
|
34
|
+
disabled: false,
|
|
35
|
+
icon: 'add_circle',
|
|
36
|
+
outline: true
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const Ghost = Template.bind({});
|
|
40
|
+
Ghost.args = {
|
|
41
|
+
label: 'Ghost button',
|
|
42
|
+
size: 'big',
|
|
43
|
+
disabled: false,
|
|
44
|
+
ghost: true
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export const TextOnly = Template.bind({});
|
|
48
|
+
TextOnly.args = {
|
|
49
|
+
label: 'TextOnly button',
|
|
50
|
+
disabled: true,
|
|
51
|
+
icon: 'add_circle',
|
|
52
|
+
size: 'big',
|
|
53
|
+
textOnly: true
|
|
54
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Canvas, Meta, Story } from '@storybook/addon-docs';
|
|
2
|
+
|
|
3
|
+
<Meta title="Colors" />
|
|
4
|
+
|
|
5
|
+
<style>{`
|
|
6
|
+
.mx-auto { margin: 0 auto; }
|
|
7
|
+
`}</style>
|
|
8
|
+
|
|
9
|
+
# Colors
|
|
10
|
+
Out colors are designed to be harmonious, ensure accessible text, and distinguish UI elements and surfaces from one another. The support colors are used as a visual support to communicate and provide better and more meaningful feedback.
|
|
11
|
+
|
|
12
|
+
## Blue
|
|
13
|
+
|
|
14
|
+
<div class="grid grid-flow-col">
|
|
15
|
+
<div class="p-2 h-20 text-white bg-blue-80">Blue 80</div>
|
|
16
|
+
<div class="p-2 h-20 text-white bg-blue-70">Blue 70</div>
|
|
17
|
+
<div class="p-2 h-20 text-white bg-blue-60">Blue 60</div>
|
|
18
|
+
<div class="p-2 h-20 text-white bg-blue-50">Blue 50</div>
|
|
19
|
+
<div class="p-2 h-20 text-blue-70 bg-blue-20">Blue 20</div>
|
|
20
|
+
<div class="p-2 h-20 text-blue-70 bg-blue-10">Blue 10</div>
|
|
21
|
+
<div class="p-2 h-20 text-blue-70 bg-white ">White</div>
|
|
22
|
+
</div>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import Dialog from '../components/notifications/Dialog.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Components/Dialog',
|
|
5
|
+
component: Dialog,
|
|
6
|
+
argTypes: {
|
|
7
|
+
type: { control: { type: 'select', options: ['informative', 'success', 'alert'] } },
|
|
8
|
+
},
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const Template = (args, { argTypes }) => ({
|
|
12
|
+
props: Object.keys(argTypes),
|
|
13
|
+
components: { Dialog },
|
|
14
|
+
template: '<Dialog v-bind="$props" />',
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export const Informative = Template.bind({});
|
|
18
|
+
Informative.args = {
|
|
19
|
+
type: 'informative',
|
|
20
|
+
message: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.'
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const Success = Template.bind({});
|
|
24
|
+
Success.args = {
|
|
25
|
+
type: 'success',
|
|
26
|
+
message: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.'
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const Warning = Template.bind({});
|
|
30
|
+
Warning.args = {
|
|
31
|
+
type: 'alert',
|
|
32
|
+
message: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.'
|
|
33
|
+
};
|
|
34
|
+
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Canvas, Meta, Story } from '@storybook/addon-docs';
|
|
2
|
+
|
|
3
|
+
<Meta title="Elevation system" />
|
|
4
|
+
|
|
5
|
+
<style>{`
|
|
6
|
+
.mx-auto { margin: 0 auto; }
|
|
7
|
+
`}</style>
|
|
8
|
+
|
|
9
|
+
# Elevation system
|
|
10
|
+
Elevation is the distance between two surfaces on the z-axis. Evidenced by the use of shadows.
|
|
11
|
+
|
|
12
|
+
## 1. Introduction
|
|
13
|
+
Elevation is evidenced by the use of shadows. It's another way to establish a visual hierarchy, create prominence, and increase contrast between interface elements and regions. Because shadows express the degree of elevation between surfaces, they must be used consistently across the tool.
|
|
14
|
+
|
|
15
|
+
### 1.1. Shadow and light
|
|
16
|
+
The shadows in our elements are projected by these two light sources: main light and ambient light.
|
|
17
|
+
<div class="grid grid-cols-3 gap-4">
|
|
18
|
+
<div class="bg-gray-20 pt-8">
|
|
19
|
+
<div class="bg-white w-48 h-48 rounded-md shadow mx-auto"></div>
|
|
20
|
+
<p class="text-center">Shadow cast by main light</p>
|
|
21
|
+
</div>
|
|
22
|
+
<div class="bg-gray-20 pt-8">
|
|
23
|
+
<div class="bg-white w-48 h-48 rounded-md shadow-sm mx-auto"></div>
|
|
24
|
+
<p class="text-center">Shadow cast by ambient light</p>
|
|
25
|
+
</div>
|
|
26
|
+
<div class="bg-gray-20 pt-8">
|
|
27
|
+
<div class="bg-white w-48 h-48 rounded-md shadow-md mx-auto"></div>
|
|
28
|
+
<p class="text-center">Combined shadow from main and ambient lights</p>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
## 2. Elevation system
|
|
33
|
+
Shadows provide cues about depth, direction of movement, and surface edges. A surface’s shadow is determined by its elevation and relationship to other surfaces.
|
|
34
|
+
<div class="grid grid-cols-2 gap-6 p-6 bg-gray-20">
|
|
35
|
+
<div class="rounded-md p-8 h-20 shadow-inner">Elevation -5</div>
|
|
36
|
+
<div class="rounded-md p-8 h-20 bg-white shadow-sm">Elevation 5</div>
|
|
37
|
+
<div class="rounded-md p-8 h-20 bg-white shadow">Elevation 10</div>
|
|
38
|
+
<div class="rounded-md p-8 h-20 bg-white shadow-md">Elevation 20</div>
|
|
39
|
+
<div class="rounded-md p-8 h-20 bg-white shadow-lg">Elevation 30</div>
|
|
40
|
+
<div class="rounded-md p-8 h-20 bg-white shadow-xl">Elevation 40</div>
|
|
41
|
+
</div>
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { Meta } from '@storybook/addon-docs';
|
|
2
|
+
import Code from './assets/code-brackets.svg';
|
|
3
|
+
import Colors from './assets/colors.svg';
|
|
4
|
+
import Comments from './assets/comments.svg';
|
|
5
|
+
import Direction from './assets/direction.svg';
|
|
6
|
+
import Flow from './assets/flow.svg';
|
|
7
|
+
import Plugin from './assets/plugin.svg';
|
|
8
|
+
import Repo from './assets/repo.svg';
|
|
9
|
+
import StackAlt from './assets/stackalt.svg';
|
|
10
|
+
|
|
11
|
+
<Meta title="Policy Studio" />
|
|
12
|
+
|
|
13
|
+
<style>{`
|
|
14
|
+
.subheading {
|
|
15
|
+
--mediumdark: '#999999';
|
|
16
|
+
font-weight: 900;
|
|
17
|
+
font-size: 13px;
|
|
18
|
+
color: #999;
|
|
19
|
+
letter-spacing: 6px;
|
|
20
|
+
line-height: 24px;
|
|
21
|
+
text-transform: uppercase;
|
|
22
|
+
margin-bottom: 12px;
|
|
23
|
+
margin-top: 40px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.link-list {
|
|
27
|
+
display: grid;
|
|
28
|
+
grid-template-columns: 1fr;
|
|
29
|
+
grid-template-rows: 1fr 1fr;
|
|
30
|
+
row-gap: 10px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@media (min-width: 620px) {
|
|
34
|
+
.link-list {
|
|
35
|
+
row-gap: 20px;
|
|
36
|
+
column-gap: 20px;
|
|
37
|
+
grid-template-columns: 1fr 1fr;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@media all and (-ms-high-contrast:none) {
|
|
42
|
+
.link-list {
|
|
43
|
+
display: -ms-grid;
|
|
44
|
+
-ms-grid-columns: 1fr 1fr;
|
|
45
|
+
-ms-grid-rows: 1fr 1fr;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.link-item {
|
|
50
|
+
display: block;
|
|
51
|
+
padding: 20px 30px 20px 15px;
|
|
52
|
+
border: 1px solid #00000010;
|
|
53
|
+
border-radius: 5px;
|
|
54
|
+
transition: background 150ms ease-out, border 150ms ease-out, transform 150ms ease-out;
|
|
55
|
+
color: #333333;
|
|
56
|
+
display: flex;
|
|
57
|
+
align-items: flex-start;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.link-item:hover {
|
|
61
|
+
border-color: #1EA7FD50;
|
|
62
|
+
transform: translate3d(0, -3px, 0);
|
|
63
|
+
box-shadow: rgba(0, 0, 0, 0.08) 0 3px 10px 0;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.link-item:active {
|
|
67
|
+
border-color: #1EA7FD;
|
|
68
|
+
transform: translate3d(0, 0, 0);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.link-item strong {
|
|
72
|
+
font-weight: 700;
|
|
73
|
+
display: block;
|
|
74
|
+
margin-bottom: 2px;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.link-item img {
|
|
78
|
+
height: 40px;
|
|
79
|
+
width: 40px;
|
|
80
|
+
margin-right: 15px;
|
|
81
|
+
flex: none;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.link-item span {
|
|
85
|
+
font-size: 14px;
|
|
86
|
+
line-height: 20px;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.tip {
|
|
90
|
+
display: inline-block;
|
|
91
|
+
border-radius: 1em;
|
|
92
|
+
font-size: 11px;
|
|
93
|
+
line-height: 12px;
|
|
94
|
+
font-weight: 700;
|
|
95
|
+
background: #E7FDD8;
|
|
96
|
+
color: #66BF3C;
|
|
97
|
+
padding: 4px 12px;
|
|
98
|
+
margin-right: 10px;
|
|
99
|
+
vertical-align: top;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.tip-wrapper {
|
|
103
|
+
font-size: 13px;
|
|
104
|
+
line-height: 20px;
|
|
105
|
+
margin-top: 40px;
|
|
106
|
+
margin-bottom: 40px;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.tip-wrapper code {
|
|
110
|
+
font-size: 12px;
|
|
111
|
+
display: inline-block;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
`}</style>
|
|
116
|
+
|
|
117
|
+
# Welcome to UI Explorer
|
|
118
|
+
|
|
119
|
+
Storybook helps you build UI components in isolation from your app's business logic, data, and context.
|
|
120
|
+
That makes it easy to develop hard-to-reach states. Save these UI states as **stories** to revisit during development, testing, or QA.
|
|
121
|
+
|
|
122
|
+
Browse example stories now by navigating to them in the sidebar.
|
|
123
|
+
View their code in the `src/stories` directory to learn how they work.
|
|
124
|
+
We recommend building UIs with a [**component-driven**](https://componentdriven.org) process starting with atomic components and ending with pages.
|
|
125
|
+
|
|
126
|
+
<div className="subheading">Configure</div>
|
|
127
|
+
|
|
128
|
+
<div className="link-list">
|
|
129
|
+
<a
|
|
130
|
+
className="link-item"
|
|
131
|
+
href="https://storybook.js.org/docs/react/addons/addon-types"
|
|
132
|
+
target="_blank"
|
|
133
|
+
>
|
|
134
|
+
<img src={Plugin} alt="plugin" />
|
|
135
|
+
<span>
|
|
136
|
+
<strong>Presets for popular tools</strong>
|
|
137
|
+
Easy setup for TypeScript, SCSS and more.
|
|
138
|
+
</span>
|
|
139
|
+
</a>
|
|
140
|
+
<a
|
|
141
|
+
className="link-item"
|
|
142
|
+
href="https://storybook.js.org/docs/react/configure/webpack"
|
|
143
|
+
target="_blank"
|
|
144
|
+
>
|
|
145
|
+
<img src={StackAlt} alt="Build" />
|
|
146
|
+
<span>
|
|
147
|
+
<strong>Build configuration</strong>
|
|
148
|
+
How to customize webpack and Babel
|
|
149
|
+
</span>
|
|
150
|
+
</a>
|
|
151
|
+
<a
|
|
152
|
+
className="link-item"
|
|
153
|
+
href="https://storybook.js.org/docs/react/configure/styling-and-css"
|
|
154
|
+
target="_blank"
|
|
155
|
+
>
|
|
156
|
+
<img src={Colors} alt="colors" />
|
|
157
|
+
<span>
|
|
158
|
+
<strong>Styling</strong>
|
|
159
|
+
How to load and configure CSS libraries
|
|
160
|
+
</span>
|
|
161
|
+
</a>
|
|
162
|
+
<a
|
|
163
|
+
className="link-item"
|
|
164
|
+
href="https://storybook.js.org/docs/react/get-started/setup#configure-storybook-for-your-stack"
|
|
165
|
+
target="_blank"
|
|
166
|
+
>
|
|
167
|
+
<img src={Flow} alt="flow" />
|
|
168
|
+
<span>
|
|
169
|
+
<strong>Data</strong>
|
|
170
|
+
Providers and mocking for data libraries
|
|
171
|
+
</span>
|
|
172
|
+
</a>
|
|
173
|
+
</div>
|
|
174
|
+
|
|
175
|
+
<div className="subheading">Learn</div>
|
|
176
|
+
|
|
177
|
+
<div className="link-list">
|
|
178
|
+
<a className="link-item" href="https://storybook.js.org/docs" target="_blank">
|
|
179
|
+
<img src={Repo} alt="repo" />
|
|
180
|
+
<span>
|
|
181
|
+
<strong>Storybook documentation</strong>
|
|
182
|
+
Configure, customize, and extend
|
|
183
|
+
</span>
|
|
184
|
+
</a>
|
|
185
|
+
<a className="link-item" href="https://storybook.js.org/tutorials/" target="_blank">
|
|
186
|
+
<img src={Direction} alt="direction" />
|
|
187
|
+
<span>
|
|
188
|
+
<strong>In-depth guides</strong>
|
|
189
|
+
Best practices from leading teams
|
|
190
|
+
</span>
|
|
191
|
+
</a>
|
|
192
|
+
<a className="link-item" href="https://github.com/storybookjs/storybook" target="_blank">
|
|
193
|
+
<img src={Code} alt="code" />
|
|
194
|
+
<span>
|
|
195
|
+
<strong>GitHub project</strong>
|
|
196
|
+
View the source and add issues
|
|
197
|
+
</span>
|
|
198
|
+
</a>
|
|
199
|
+
<a className="link-item" href="https://discord.gg/storybook" target="_blank">
|
|
200
|
+
<img src={Comments} alt="comments" />
|
|
201
|
+
<span>
|
|
202
|
+
<strong>Discord chat</strong>
|
|
203
|
+
Chat with maintainers and the community
|
|
204
|
+
</span>
|
|
205
|
+
</a>
|
|
206
|
+
</div>
|
|
207
|
+
|
|
208
|
+
<div className="tip-wrapper">
|
|
209
|
+
<span className="tip">Tip</span>Edit the Markdown in{' '}
|
|
210
|
+
<code>src/stories/Introduction.stories.mdx</code>
|
|
211
|
+
</div>
|