adata-ui 0.1.9 → 0.1.13

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 (38) hide show
  1. package/dist/adata-ui.common.js +28 -21
  2. package/dist/adata-ui.common.js.map +1 -1
  3. package/dist/adata-ui.css +1 -1
  4. package/dist/adata-ui.umd.js +28 -21
  5. package/dist/adata-ui.umd.js.map +1 -1
  6. package/dist/adata-ui.umd.min.js +1 -1
  7. package/dist/adata-ui.umd.min.js.map +1 -1
  8. package/package-lock.json +1065 -136
  9. package/package.json +3 -1
  10. package/public/index.html +2 -2
  11. package/public/logo.svg +4 -0
  12. package/src/components/Alert/Alert.stories.js +5 -5
  13. package/src/components/Button/Button.stories.js +6 -6
  14. package/src/components/Footer/Footer.stories.js +5 -5
  15. package/src/components/Footer/Footer.vue +5 -5
  16. package/src/components/Header/Header.stories.js +6 -6
  17. package/src/components/Header/Header.vue +24 -5
  18. package/src/components/Introduction.stories.mdx +7 -0
  19. package/src/components/PasswordField/PasswordField.stories.js +5 -5
  20. package/src/components/TextField/TextField.stories.js +5 -5
  21. package/src/stories/Button.stories.js +0 -46
  22. package/src/stories/Button.vue +0 -54
  23. package/src/stories/Header.stories.js +0 -21
  24. package/src/stories/Header.vue +0 -59
  25. package/src/stories/Introduction.stories.mdx +0 -211
  26. package/src/stories/Page.stories.js +0 -25
  27. package/src/stories/Page.vue +0 -88
  28. package/src/stories/assets/code-brackets.svg +0 -1
  29. package/src/stories/assets/colors.svg +0 -1
  30. package/src/stories/assets/comments.svg +0 -1
  31. package/src/stories/assets/direction.svg +0 -1
  32. package/src/stories/assets/flow.svg +0 -1
  33. package/src/stories/assets/plugin.svg +0 -1
  34. package/src/stories/assets/repo.svg +0 -1
  35. package/src/stories/assets/stackalt.svg +0 -1
  36. package/src/stories/button.css +0 -30
  37. package/src/stories/header.css +0 -26
  38. package/src/stories/page.css +0 -69
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adata-ui",
3
- "version": "0.1.9",
3
+ "version": "0.1.13",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -12,6 +12,8 @@
12
12
  "test": "jest"
13
13
  },
14
14
  "dependencies": {
15
+ "@storybook/addons": "^6.4.14",
16
+ "@storybook/theming": "^6.4.14",
15
17
  "core-js": "^3.6.5",
16
18
  "node-sass": "^5.0.0",
17
19
  "user": "0.0.0",
package/public/index.html CHANGED
@@ -4,8 +4,8 @@
4
4
  <meta charset="utf-8">
5
5
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
6
  <meta name="viewport" content="width=device-width,initial-scale=1.0">
7
- <link rel="icon" href="<%= BASE_URL %>favicon.ico">
8
- <title><%= htmlWebpackPlugin.options.title %></title>
7
+ <link rel="icon" href="<%= BASE_URL %>logo.svg">
8
+ <title>Adata UI</title>
9
9
  </head>
10
10
  <body>
11
11
  <noscript>
@@ -0,0 +1,4 @@
1
+ <svg width="40" height="38" viewBox="0 0 28 26" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M13.3117 8.26147H13.2237C13.1861 8.71085 13.0938 9.15443 12.9487 9.58314L11.231 14.7333H15.2706L13.5754 9.63513C13.4383 9.18726 13.3499 8.7269 13.3117 8.26147Z" fill="#2C3E50"/>
3
+ <path d="M24.3463 0H2.70514C1.98769 0 1.29963 0.273926 0.792318 0.76152C0.285006 1.24911 0 1.91044 0 2.6V23.4C0 24.0896 0.285006 24.7509 0.792318 25.2385C1.29963 25.7261 1.98769 26 2.70514 26H24.3463C25.0637 26 25.7518 25.7261 26.2591 25.2385C26.7664 24.7509 27.0514 24.0896 27.0514 23.4V2.6C27.0514 1.91044 26.7664 1.24911 26.2591 0.76152C25.7518 0.273926 25.0637 0 24.3463 0ZM17.2069 20.7242L16.0798 17.3485H10.4666L9.35527 20.7242H5.50721L11.2534 5.55751H15.4689L21.0821 20.7242H17.2069Z" fill="#2C3E50"/>
4
+ </svg>
@@ -1,15 +1,15 @@
1
- import Alert from './Alert.vue'
1
+ import AAlert from './Alert.vue'
2
2
 
3
3
  export default {
4
4
  title: 'Alert',
5
- component: Alert,
6
- template: '<alert>button</alert>'
5
+ component: AAlert,
6
+ template: '<a-alert>button</a-alert>'
7
7
  }
8
8
 
9
9
  const Template = (args, { argTypes }) => ({
10
- components: { Alert },
10
+ components: { AAlert },
11
11
  props: Object.keys(argTypes),
12
- template: '<alert v-bind="$props">Alert</alert>'
12
+ template: '<a-alert v-bind="$props">Alert</a-alert>'
13
13
  })
14
14
 
15
15
  export const Info = Template.bind({})
@@ -1,16 +1,16 @@
1
- import BaseButton from './BaseButton.vue'
1
+ import AButton from './BaseButton.vue'
2
2
  import { action } from "@storybook/addon-actions"
3
3
 
4
4
  export default {
5
- title: 'BaseButton',
6
- component: BaseButton,
7
- template: '<base-button>Button</base-button>'
5
+ title: 'Button',
6
+ component: AButton,
7
+ template: '<a-button>Button</a-button>'
8
8
  }
9
9
 
10
10
  const Template = (args, { argTypes }) => ({
11
- components: { BaseButton },
11
+ components: { AButton },
12
12
  props: Object.keys(argTypes),
13
- template: '<base-button @click="action" v-bind="$props">Button</base-button>',
13
+ template: '<a-button @click="action" v-bind="$props">Button</a-button>',
14
14
  methods: {
15
15
  action: action('click')
16
16
  }
@@ -1,15 +1,15 @@
1
- import Footer from './Footer.vue'
1
+ import AFooter from './Footer.vue'
2
2
 
3
3
  export default {
4
4
  title: 'Footer',
5
- component: Footer,
6
- template: '<Footer></Footer>'
5
+ component: AFooter,
6
+ template: '<a-footer></a-footer>'
7
7
  };
8
8
 
9
9
  const Template = (args, { argTypes }) => ({
10
- components: { Footer },
10
+ components: { AFooter },
11
11
  props: Object.keys(argTypes),
12
- template: '<Footer v-bind="$props"></Footer>'
12
+ template: '<a-footer v-bind="$props"></a-footer>'
13
13
  });
14
14
 
15
15
  export const MainFooter = Template.bind({});
@@ -1,9 +1,9 @@
1
1
  <template>
2
- <footer class="footer" :class="[{'paddinged': hasBottomMenu}]">
3
- <div class="footer__top">
2
+ <footer class="a-footer" :class="[{'paddinged': hasBottomMenu}]">
3
+ <div class="a-footer__top">
4
4
  <ul class="nav">
5
5
  <a class="logo adata-logo" href="https://adata.kz">
6
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 166 48">
6
+ <svg fill="#2C3E50" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 166 48">
7
7
  <path d="M62.926 38.22v-28h10.316c10.342 0 15.511 4.55 15.508 13.652 0 4.36-1.41 7.843-4.232 10.448-2.822 2.605-6.58 3.907-11.276 3.904l-10.316-.004zm6.56-22.868v17.752h3.248c2.839 0 5.069-.82 6.69-2.46 1.622-1.64 2.43-3.873 2.424-6.7 0-2.667-.8-4.767-2.403-6.3-1.602-1.533-3.853-2.297-6.752-2.292h-3.206zM118.5 38.22h-7.131l-2.079-6.228H98.958l-2.079 6.228h-7.093l10.598-28h7.775l10.341 28zm-10.723-11.072l-3.127-9.416a11.94 11.94 0 01-.486-2.516h-.162c-.07.83-.24 1.649-.508 2.44l-3.168 9.492h7.451zm31.833-11.796h-8.316V38.22h-6.557V15.352h-8.274v-5.136h23.147v5.136zM166 38.22h-7.143l-2.079-6.228h-10.349l-2.05 6.228h-7.106l10.598-28h7.776l10.353 28zm-10.719-11.072l-3.127-9.416a11.94 11.94 0 01-.486-2.516h-.163c-.069.83-.239 1.649-.507 2.44l-3.168 9.492h7.451zM24.553 15.252h-.163c-.069.83-.24 1.649-.507 2.44L20.715 27.2h7.45l-3.126-9.412a12.02 12.02 0 01-.486-2.536z"></path>
8
8
  <path d="M44.905 0H4.99a5.091 5.091 0 00-3.528 1.406A4.71 4.71 0 000 4.8v38.4a4.71 4.71 0 001.461 3.394A5.091 5.091 0 004.99 48h39.916a5.091 5.091 0 003.528-1.406 4.71 4.71 0 001.462-3.394V4.8a4.71 4.71 0 00-1.462-3.394A5.091 5.091 0 0044.905 0zM31.737 38.26l-2.079-6.232H19.305l-2.05 6.232h-7.097l10.598-28h7.776l10.353 28h-7.148z"></path>
9
9
  </svg>
@@ -49,7 +49,7 @@
49
49
  </li>
50
50
  </ul>
51
51
  </div>
52
- <div class="footer__bottom"><span>2022 © ТОО "Alldata"</span></div>
52
+ <div class="a-footer__bottom"><span>2022 © ТОО "Alldata"</span></div>
53
53
  </footer>
54
54
  </template>
55
55
 
@@ -82,7 +82,7 @@ a {
82
82
  padding: 0;
83
83
  }
84
84
 
85
- .footer {
85
+ .a-footer {
86
86
  background: #BDC7CE4C;
87
87
  font-size: 14px;
88
88
  margin-top: 20px;
@@ -1,21 +1,21 @@
1
- import Header from './Header.vue'
1
+ import AHeader from './Header.vue'
2
2
  import {action} from "@storybook/addon-actions";
3
3
 
4
4
  export default {
5
5
  title: 'Header',
6
- component: Header,
7
- template: '<Header></Header>'
6
+ component: AHeader,
7
+ template: '<a-header></a-header>'
8
8
  };
9
9
 
10
10
  const Template = (args, { argTypes }) => ({
11
- components: { Header },
11
+ components: { AHeader },
12
12
  props: Object.keys(argTypes),
13
- template: '<Header @menuOpen="openMenu' +
13
+ template: '<a-header @menuOpen="openMenu' +
14
14
  '" @showBalanceModal="showBalance"' +
15
15
  ' @setShowModal="showModal"' +
16
16
  ' @logout="logoutClick"' +
17
17
  ' @setIsReplenishModal="setReplenishModal" v-bind="$props"' +
18
- '></Header>',
18
+ '></a-header>',
19
19
  methods: {
20
20
  openMenu(val) {
21
21
  console.log(val);
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <header class="a-header">
2
+ <header class="a-header" :class="[{'bordered': isBordered}, {'fixed': isFixed}]">
3
3
  <div class="container">
4
4
  <div class="a-header__left">
5
5
  <a class="logo" :href="toAdtdev('https://adata.kz')">
@@ -12,7 +12,7 @@
12
12
  <div v-for="(item, index) in subheaderItems"
13
13
  :key="index"
14
14
  class="menu__wrapper menu__items"
15
- :class="{active: locationUrl.includes(item.url)}"
15
+ :class="{active: locationUrl.includes(toAdtdev(item.url))}"
16
16
  @click="handleClick(item.url)"
17
17
  >
18
18
  {{ item.name }}
@@ -21,7 +21,6 @@
21
21
  </div>
22
22
  <div class="a-header__right">
23
23
  <slot name="chooseCountry"></slot>
24
- <slot name="profile"></slot>
25
24
  <Profile
26
25
  v-bind:profileDropDown="profileDropDown"
27
26
  :isDev="isDev"
@@ -63,7 +62,7 @@
63
62
  v-for="(item, index) in subheaderItems"
64
63
  :key="index"
65
64
  class="menu_mobile-wrapper"
66
- :class="{'active-burger-tab': locationUrl.includes(item.url)}"
65
+ :class="{'active-burger-tab': locationUrl.includes(toAdtdev(item.url))}"
67
66
  @click="handleClick(item.url)"
68
67
  >
69
68
  {{ item.name }}
@@ -93,6 +92,14 @@ export default {
93
92
  type: Boolean,
94
93
  default: false
95
94
  },
95
+ isBordered: {
96
+ type: Boolean,
97
+ default: false
98
+ },
99
+ isFixed: {
100
+ type: Boolean,
101
+ default: false
102
+ },
96
103
  requestCount: {
97
104
  type: Number,
98
105
  default: null
@@ -172,7 +179,7 @@ export default {
172
179
  }
173
180
 
174
181
  .a-header {
175
- width: 100%;
182
+ width: 100vw;
176
183
  background: #ffffff;
177
184
  max-height: 62px;
178
185
  height: 62px;
@@ -183,7 +190,19 @@ export default {
183
190
  height: 40px;
184
191
  }
185
192
 
193
+ &.bordered {
194
+ border-bottom: 1px solid #2C3E5026;
195
+ }
196
+
197
+ &.fixed {
198
+ position: fixed;
199
+ z-index: 1000;
200
+ top: 0;
201
+ left: 0;
202
+ }
203
+
186
204
  & > .container {
205
+ width: 100%;
187
206
  display: flex;
188
207
  justify-content: space-between;
189
208
  align-items: center;
@@ -0,0 +1,7 @@
1
+ <Meta title="Adata UI Introduction" />
2
+
3
+ # Welcome to Adata UI kit
4
+
5
+
6
+
7
+ to install library run **npm i adata-ui**
@@ -1,15 +1,15 @@
1
- import PasswordField from "./PasswordField.vue";
1
+ import APasswordField from "./PasswordField.vue";
2
2
 
3
3
  export default {
4
4
  title: 'PasswordField',
5
- component: PasswordField,
6
- template: "<password-field label='Example'></password-field>"
5
+ component: APasswordField,
6
+ template: "<a-password-field label='Example'></a-password-field>"
7
7
  }
8
8
 
9
9
  const Template = (args, { argTypes }) => ({
10
- components: { PasswordField },
10
+ components: { APasswordField },
11
11
  props: Object.keys(argTypes),
12
- template: '<password-field v-bind="$props"></password-field>'
12
+ template: '<a-password-field v-bind="$props"></a-password-field>'
13
13
  })
14
14
 
15
15
  export const BasePasswordField = Template.bind({});
@@ -1,16 +1,16 @@
1
- import TextField from "./TextField.vue";
1
+ import ATextField from "./TextField.vue";
2
2
 
3
3
  export default {
4
4
  title: 'TextField',
5
- component: TextField,
5
+ component: ATextField,
6
6
  data: () => ({ value: "" }),
7
- template: "<text-field @input='(val) => {this.value = val}' label='Example'></text-field>>"
7
+ template: "<a-text-field @input='(val) => {this.value = val}' label='Example'></a-text-field>>"
8
8
  }
9
9
 
10
10
  const Template = (args, { argTypes }) => ({
11
- components: { TextField },
11
+ components: { ATextField },
12
12
  props: Object.keys(argTypes),
13
- template: '<text-field v-bind="$props"></text-field>'
13
+ template: '<a-text-field v-bind="$props"></a-text-field>'
14
14
  })
15
15
 
16
16
  export const Clearable = Template.bind({});
@@ -1,46 +0,0 @@
1
- import MyButton from './Button.vue';
2
-
3
- // More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
4
- export default {
5
- title: 'Example/Button',
6
- component: MyButton,
7
- // More on argTypes: https://storybook.js.org/docs/vue/api/argtypes
8
- argTypes: {
9
- backgroundColor: { control: 'color' },
10
- size: {
11
- control: { type: 'select' },
12
- options: ['small', 'medium', 'large'],
13
- },
14
- },
15
- };
16
-
17
- // More on component templates: https://storybook.js.org/docs/vue/writing-stories/introduction#using-args
18
- const Template = (args, { argTypes }) => ({
19
- props: Object.keys(argTypes),
20
- components: { MyButton },
21
- template: '<my-button @onClick="onClick" v-bind="$props" />',
22
- });
23
-
24
- export const Primary = Template.bind({});
25
- // More on args: https://storybook.js.org/docs/vue/writing-stories/args
26
- Primary.args = {
27
- primary: true,
28
- label: 'Button',
29
- };
30
-
31
- export const Secondary = Template.bind({});
32
- Secondary.args = {
33
- label: 'Button',
34
- };
35
-
36
- export const Large = Template.bind({});
37
- Large.args = {
38
- size: 'large',
39
- label: 'Button',
40
- };
41
-
42
- export const Small = Template.bind({});
43
- Small.args = {
44
- size: 'small',
45
- label: 'Button',
46
- };
@@ -1,54 +0,0 @@
1
- <template>
2
- <button type="button" :class="classes" @click="onClick" :style="style">{{ label }}</button>
3
- </template>
4
-
5
- <script>
6
- import './button.css';
7
-
8
- export default {
9
- name: 'my-button',
10
-
11
- props: {
12
- label: {
13
- type: String,
14
- required: true,
15
- },
16
- primary: {
17
- type: Boolean,
18
- default: false,
19
- },
20
- size: {
21
- type: String,
22
- default: 'medium',
23
- validator: function (value) {
24
- return ['small', 'medium', 'large'].indexOf(value) !== -1;
25
- },
26
- },
27
- backgroundColor: {
28
- type: String,
29
- },
30
- },
31
-
32
- computed: {
33
- classes() {
34
- return {
35
- 'storybook-button': true,
36
- 'storybook-button--primary': this.primary,
37
- 'storybook-button--secondary': !this.primary,
38
- [`storybook-button--${this.size}`]: true,
39
- };
40
- },
41
- style() {
42
- return {
43
- backgroundColor: this.backgroundColor,
44
- };
45
- },
46
- },
47
-
48
- methods: {
49
- onClick() {
50
- this.$emit('onClick');
51
- },
52
- },
53
- };
54
- </script>
@@ -1,21 +0,0 @@
1
- import MyHeader from './Header';
2
-
3
- export default {
4
- title: 'Example/Header',
5
- component: MyHeader,
6
- };
7
-
8
- const Template = (args, { argTypes }) => ({
9
- props: Object.keys(argTypes),
10
- components: { MyHeader },
11
- template:
12
- '<my-header :user="user" @onLogin="onLogin" @onLogout="onLogout" @onCreateAccount="onCreateAccount" />',
13
- });
14
-
15
- export const LoggedIn = Template.bind({});
16
- LoggedIn.args = {
17
- user: {},
18
- };
19
-
20
- export const LoggedOut = Template.bind({});
21
- LoggedOut.args = {};
@@ -1,59 +0,0 @@
1
- <template>
2
- <header>
3
- <div class="wrapper">
4
- <div>
5
- <svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
6
- <g fill="none" fill-rule="evenodd">
7
- <path
8
- d="M10 0h12a10 10 0 0110 10v12a10 10 0 01-10 10H10A10 10 0 010 22V10A10 10 0 0110 0z"
9
- fill="#FFF"
10
- />
11
- <path
12
- d="M5.3 10.6l10.4 6v11.1l-10.4-6v-11zm11.4-6.2l9.7 5.5-9.7 5.6V4.4z"
13
- fill="#555AB9"
14
- />
15
- <path
16
- d="M27.2 10.6v11.2l-10.5 6V16.5l10.5-6zM15.7 4.4v11L6 10l9.7-5.5z"
17
- fill="#91BAF8"
18
- />
19
- </g>
20
- </svg>
21
- <h1>Acme</h1>
22
- </div>
23
- <div>
24
- <my-button size="small" @onClick="onLogout" label="Log out" v-if="user" />
25
- <my-button size="small" @onClick="onLogin" label="Log in" v-if="!user" />
26
- <my-button primary size="small" @onClick="onCreateAccount" label="Sign up" v-if="!user" />
27
- </div>
28
- </div>
29
- </header>
30
- </template>
31
-
32
- <script>
33
- import './header.css';
34
- import MyButton from './Button.vue';
35
-
36
- export default {
37
- name: 'my-header',
38
-
39
- components: { MyButton },
40
-
41
- props: {
42
- user: {
43
- type: Object,
44
- },
45
- },
46
-
47
- methods: {
48
- onLogin() {
49
- this.$emit('onLogin');
50
- },
51
- onLogout() {
52
- this.$emit('onLogout');
53
- },
54
- onCreateAccount() {
55
- this.$emit('onCreateAccount');
56
- },
57
- },
58
- };
59
- </script>