@avakhula/ui 0.0.13 → 0.0.15
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/preview.js +3 -2
- package/dist/index.js +1814 -1801
- package/dist/index.umd.cjs +36 -36
- package/dist/style.css +1 -1
- package/package.json +15 -15
- package/src/App.vue +68 -26
- package/src/components/Alert/Alert.stories.js +21 -29
- package/src/components/Alert/readme.mdx +1 -1
- package/src/components/Badge/readme.mdx +1 -1
- package/src/components/Button/Button.stories.js +2 -18
- package/src/components/Button/readme.mdx +1 -1
- package/src/components/ButtonGroup/ButtonGroup.stories.js +3 -0
- package/src/components/Dropdown/readme.mdx +1 -0
- package/src/components/Form/Checkbox/readme.mdx +5 -10
- package/src/components/Form/CheckboxGroup/readme.mdx +7 -17
- package/src/components/Form/DatePicker/readme.mdx +7 -16
- package/src/components/Form/Input/readme.mdx +6 -15
- package/src/components/Form/Label/Label.vue +1 -0
- package/src/components/Form/Label/readme.mdx +3 -5
- package/src/components/Form/PhoneInput/readme.mdx +4 -7
- package/src/components/Form/Radio/readme.mdx +3 -4
- package/src/components/Form/TextEditor/readme.mdx +5 -12
- package/src/components/Form/Textarea/readme.mdx +5 -12
- package/src/components/Form/Toggle/readme.mdx +3 -5
- package/src/components/IconButton/readme.mdx +5 -15
- package/src/components/Modal/Modal.vue +2 -2
- package/src/components/Modal/readme.mdx +3 -4
- package/src/components/Popover/readme.mdx +3 -3
- package/src/components/ProgressBar/readme.mdx +4 -7
- package/src/components/SplitButton/readme.mdx +3 -3
- package/src/components/TagPill/readme.mdx +3 -4
- package/src/components/ToggleTip/readme.mdx +3 -4
- package/src/components/Tooltip/readme.mdx +3 -4
- package/src/components/TreeSelect/Select.vue +19 -4
- package/src/stories/link.readme.mdx +6 -10
- package/static/favicon.ico +0 -0
- package/dist/favicon.ico +0 -0
- package/public/favicon.ico +0 -0
- /package/src/stories/{link.stories.js → Link.stories.js} +0 -0
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@avakhula/ui",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"main": "dist/index.
|
|
5
|
-
"module": "dist/index.
|
|
3
|
+
"version": "0.0.15",
|
|
4
|
+
"main": "dist/index.js",
|
|
5
|
+
"module": "dist/index.umd.cjs",
|
|
6
6
|
"source": "src/index.js",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"private": false,
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"build-storybook": "storybook build"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@vueup/vue-quill": "^1.
|
|
24
|
+
"@vueup/vue-quill": "^1.2.0",
|
|
25
25
|
"mitt": "^3.0.0",
|
|
26
26
|
"vue": "^3.2.45"
|
|
27
27
|
},
|
|
@@ -29,23 +29,23 @@
|
|
|
29
29
|
"@babel/core": "^7.20.7",
|
|
30
30
|
"@babel/preset-env": "^7.21.4",
|
|
31
31
|
"@rushstack/eslint-patch": "^1.1.4",
|
|
32
|
-
"@storybook/addon-a11y": "^7.0.
|
|
33
|
-
"@storybook/addon-actions": "^7.0.
|
|
34
|
-
"@storybook/addon-docs": "^7.0.
|
|
35
|
-
"@storybook/addon-essentials": "^7.0.
|
|
36
|
-
"@storybook/addon-interactions": "^7.0.
|
|
37
|
-
"@storybook/addon-links": "^7.0.
|
|
38
|
-
"@storybook/addon-mdx-gfm": "^7.0.
|
|
32
|
+
"@storybook/addon-a11y": "^7.0.11",
|
|
33
|
+
"@storybook/addon-actions": "^7.0.11",
|
|
34
|
+
"@storybook/addon-docs": "^7.0.11",
|
|
35
|
+
"@storybook/addon-essentials": "^7.0.11",
|
|
36
|
+
"@storybook/addon-interactions": "^7.0.11",
|
|
37
|
+
"@storybook/addon-links": "^7.0.11",
|
|
38
|
+
"@storybook/addon-mdx-gfm": "^7.0.11",
|
|
39
39
|
"@storybook/testing-library": "^0.1.0",
|
|
40
|
-
"@storybook/vue3": "^7.0.
|
|
41
|
-
"@storybook/vue3-vite": "^7.0.
|
|
40
|
+
"@storybook/vue3": "^7.0.11",
|
|
41
|
+
"@storybook/vue3-vite": "^7.0.11",
|
|
42
42
|
"@vitejs/plugin-vue": "^4.0.0",
|
|
43
43
|
"@vitest/coverage-c8": "^0.28.4",
|
|
44
44
|
"@vue/eslint-config-prettier": "^7.0.0",
|
|
45
45
|
"@vue/test-utils": "^2.2.10",
|
|
46
46
|
"babel-loader": "^8.3.0",
|
|
47
47
|
"eslint": "^8.22.0",
|
|
48
|
-
"eslint-plugin-storybook": "^0.6.
|
|
48
|
+
"eslint-plugin-storybook": "^0.6.12",
|
|
49
49
|
"eslint-plugin-vue": "^9.3.0",
|
|
50
50
|
"flatpickr": "^4.6.13",
|
|
51
51
|
"jsdom": "^21.1.0",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"react-dom": "^18.2.0",
|
|
57
57
|
"sass": "^1.57.1",
|
|
58
58
|
"sass-loader": "^13.2.0",
|
|
59
|
-
"storybook": "^7.0.
|
|
59
|
+
"storybook": "^7.0.11",
|
|
60
60
|
"vite": "^4.0.0",
|
|
61
61
|
"vitest": "^0.28.4",
|
|
62
62
|
"vue-loader": "^16.8.3",
|
package/src/App.vue
CHANGED
|
@@ -1,40 +1,82 @@
|
|
|
1
1
|
<template>
|
|
2
|
+
<ib-select
|
|
3
|
+
v-model="test"
|
|
4
|
+
:options="options"
|
|
5
|
+
:is-required="true"
|
|
6
|
+
:is-multiple="false"
|
|
7
|
+
/>
|
|
2
8
|
|
|
3
|
-
<button @click="
|
|
4
|
-
<ib-modal :active="active" @close="onClose">
|
|
5
|
-
<template #body>
|
|
6
|
-
test
|
|
7
|
-
</template>
|
|
8
|
-
</ib-modal>
|
|
9
|
+
<button @click="changeValue">test</button>
|
|
9
10
|
</template>
|
|
10
11
|
|
|
11
12
|
<script>
|
|
12
|
-
import
|
|
13
|
+
import IbSelect from "./components/TreeSelect/Select.vue";
|
|
14
|
+
const testData = [
|
|
15
|
+
{
|
|
16
|
+
id: "1",
|
|
17
|
+
title: "Education",
|
|
18
|
+
is_category: true,
|
|
19
|
+
initiallyVisible: true,
|
|
20
|
+
visible: true,
|
|
21
|
+
isDisabled: false,
|
|
22
|
+
checked: true,
|
|
23
|
+
isChildrenVisible: true,
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
id: "2",
|
|
27
|
+
title: "Education 2",
|
|
28
|
+
is_category: true,
|
|
29
|
+
initiallyVisible: true,
|
|
30
|
+
visible: true,
|
|
31
|
+
isDisabled: false,
|
|
32
|
+
checked: false,
|
|
33
|
+
isChildrenVisible: true,
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: "3",
|
|
37
|
+
title: "Education 3",
|
|
38
|
+
is_category: true,
|
|
39
|
+
initiallyVisible: true,
|
|
40
|
+
visible: true,
|
|
41
|
+
isDisabled: false,
|
|
42
|
+
checked: false,
|
|
43
|
+
isChildrenVisible: true,
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
id: "4",
|
|
47
|
+
title: "Education 4",
|
|
48
|
+
is_category: true,
|
|
49
|
+
initiallyVisible: true,
|
|
50
|
+
visible: true,
|
|
51
|
+
isDisabled: false,
|
|
52
|
+
checked: false,
|
|
53
|
+
isChildrenVisible: true,
|
|
54
|
+
},
|
|
55
|
+
];
|
|
13
56
|
|
|
14
57
|
export default {
|
|
15
|
-
components: { IbModal },
|
|
16
58
|
data() {
|
|
17
59
|
return {
|
|
18
|
-
|
|
60
|
+
options: testData,
|
|
61
|
+
test: testData[1].id
|
|
19
62
|
};
|
|
20
63
|
},
|
|
21
|
-
methods: {
|
|
22
|
-
onClose() {
|
|
23
|
-
console.log('called OnClose')
|
|
24
|
-
this.active = !this.active
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
64
|
watch: {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
if(val) {
|
|
32
|
-
setTimeout(() => {
|
|
33
|
-
this.active = false
|
|
34
|
-
}, 5000)
|
|
35
|
-
}
|
|
65
|
+
test(val) {
|
|
66
|
+
console.log('test', val)
|
|
36
67
|
}
|
|
37
|
-
}
|
|
38
|
-
|
|
68
|
+
},
|
|
69
|
+
components: {
|
|
70
|
+
IbSelect,
|
|
71
|
+
},
|
|
72
|
+
methods: {
|
|
73
|
+
changeValue() {
|
|
74
|
+
console.log('test')
|
|
75
|
+
this.test = testData[2].id
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
</script>
|
|
39
80
|
|
|
40
|
-
|
|
81
|
+
<style>
|
|
82
|
+
</style>
|
|
@@ -25,53 +25,45 @@ const Template = (args) => ({
|
|
|
25
25
|
},
|
|
26
26
|
template: `
|
|
27
27
|
<ib-alert v-bind="args">
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
<template #link v-if="args.link">
|
|
31
|
-
<span v-html="args.link"></span>
|
|
32
|
-
</template>
|
|
28
|
+
Alert message
|
|
33
29
|
</ib-alert>`,
|
|
34
30
|
});
|
|
35
31
|
|
|
36
32
|
export const Default = Template.bind({});
|
|
37
|
-
|
|
38
|
-
default: "Default message",
|
|
39
|
-
};
|
|
33
|
+
|
|
40
34
|
const Type = (args) => ({
|
|
41
35
|
components: { IbAlert },
|
|
42
36
|
setup() {
|
|
43
37
|
return { args };
|
|
44
38
|
},
|
|
45
39
|
template: `
|
|
46
|
-
<ib-alert style="margin-bottom: 5px;">
|
|
47
|
-
|
|
48
|
-
</ib-alert>
|
|
49
|
-
|
|
50
|
-
<ib-alert style="margin-bottom: 5px;" type="warning">
|
|
51
|
-
{{args.default}}
|
|
52
|
-
</ib-alert>
|
|
53
|
-
|
|
54
|
-
<ib-alert style="margin-bottom: 5px;" type="success">
|
|
55
|
-
{{args.default}}
|
|
56
|
-
</ib-alert>
|
|
57
|
-
|
|
58
|
-
<ib-alert type="info">
|
|
59
|
-
{{args.default}}
|
|
60
|
-
</ib-alert>
|
|
40
|
+
<ib-alert style="margin-bottom: 5px;">Alert message</ib-alert>
|
|
41
|
+
<ib-alert style="margin-bottom: 5px;" type="warning">Warning message</ib-alert>
|
|
42
|
+
<ib-alert style="margin-bottom: 5px;" type="success">Success message</ib-alert>
|
|
43
|
+
<ib-alert type="info">Info message</ib-alert>
|
|
61
44
|
`,
|
|
62
45
|
});
|
|
63
46
|
|
|
64
47
|
export const Types = Type.bind({});
|
|
65
|
-
Types.args = {
|
|
66
|
-
default: "Default message",
|
|
67
|
-
};
|
|
68
48
|
Type.parameters = { controls: { disable: true } };
|
|
69
49
|
|
|
70
|
-
|
|
50
|
+
const LargeTemplate = (args) => ({
|
|
51
|
+
components: { IbAlert },
|
|
52
|
+
setup() {
|
|
53
|
+
return { args };
|
|
54
|
+
},
|
|
55
|
+
template: `
|
|
56
|
+
<ib-alert v-bind="args">
|
|
57
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
|
58
|
+
<template #link>
|
|
59
|
+
<a href="#" class="ib-standalone-link">View Server</a>
|
|
60
|
+
</template>
|
|
61
|
+
</ib-alert>`,
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
export const LargeAlert = LargeTemplate.bind({});
|
|
71
65
|
LargeAlert.args = {
|
|
72
66
|
showCloseButton: true,
|
|
73
67
|
showIcon: true,
|
|
74
68
|
title: "It is Title",
|
|
75
|
-
default: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
|
|
76
|
-
link: `<a class='ib-standalone-link'>View Server</a>`,
|
|
77
69
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# IbAlert
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { Canvas } from "@storybook/addon-docs";
|
|
4
4
|
import * as AlertStories from "./Alert.stories";
|
|
5
5
|
|
|
6
6
|
Notifications are an important method of communicating with users and providing feedback. They range from granular, inline responses to user actions to system-wide messages.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# IbBadge
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { Canvas } from "@storybook/addon-docs";
|
|
4
4
|
import * as BadgeStories from "./Badge.stories";
|
|
5
5
|
|
|
6
6
|
The `IbBadge` component is a small component used to display a notification badge with a count or indicator on a parent component.
|
|
@@ -24,12 +24,7 @@ const Template = (args) => ({
|
|
|
24
24
|
setup() {
|
|
25
25
|
return { args };
|
|
26
26
|
},
|
|
27
|
-
template:
|
|
28
|
-
{{args.default}}
|
|
29
|
-
<template #icon v-if="args.icon">
|
|
30
|
-
<span style="display: contents" v-html="args.icon"></span>
|
|
31
|
-
</template>
|
|
32
|
-
</ib-button>`,
|
|
27
|
+
template: '<ib-button v-bind="args">Button</ib-button>',
|
|
33
28
|
});
|
|
34
29
|
|
|
35
30
|
const IconTemplate = (args) => ({
|
|
@@ -79,51 +74,40 @@ const KindsTemplate = (args) => ({
|
|
|
79
74
|
});
|
|
80
75
|
|
|
81
76
|
export const Default = Template.bind({});
|
|
82
|
-
Default.args = {
|
|
83
|
-
default: "Default",
|
|
84
|
-
// icon: `<ion-icon name="add"></ion-icon>`,
|
|
85
|
-
icon: ``,
|
|
86
|
-
};
|
|
77
|
+
Default.args = {};
|
|
87
78
|
|
|
88
79
|
export const Secondary = Template.bind({});
|
|
89
80
|
Secondary.args = {
|
|
90
|
-
default: "Secondary",
|
|
91
81
|
kind: "secondary",
|
|
92
82
|
};
|
|
93
83
|
|
|
94
84
|
export const Tertiary = Template.bind({});
|
|
95
85
|
Tertiary.args = {
|
|
96
|
-
default: "Tertiary",
|
|
97
86
|
kind: "tertiary",
|
|
98
87
|
};
|
|
99
88
|
|
|
100
89
|
export const Ghost = Template.bind({});
|
|
101
90
|
Ghost.args = {
|
|
102
|
-
default: "Ghost",
|
|
103
91
|
kind: "ghost",
|
|
104
92
|
};
|
|
105
93
|
|
|
106
94
|
export const Danger = Template.bind({});
|
|
107
95
|
Danger.args = {
|
|
108
|
-
default: "Danger",
|
|
109
96
|
kind: "danger",
|
|
110
97
|
};
|
|
111
98
|
|
|
112
99
|
export const DangerGhost = Template.bind({});
|
|
113
100
|
DangerGhost.args = {
|
|
114
|
-
default: "Danger-ghost",
|
|
115
101
|
kind: "ghostDanger",
|
|
116
102
|
};
|
|
117
103
|
|
|
118
104
|
export const Block = Template.bind({});
|
|
119
105
|
Block.args = {
|
|
120
|
-
default: "Block",
|
|
121
106
|
block: true,
|
|
122
107
|
};
|
|
123
108
|
|
|
124
109
|
export const Disabled = Template.bind({});
|
|
125
110
|
Disabled.args = {
|
|
126
|
-
default: "Disabled",
|
|
127
111
|
disabled: true,
|
|
128
112
|
};
|
|
129
113
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# IbButton
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { Canvas } from "@storybook/addon-docs";
|
|
4
4
|
import * as ButtonStories from "./Button.stories";
|
|
5
5
|
|
|
6
6
|
Buttons are used to initialize an action. Button labels express what action will occur when the user interacts with it.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# IbCheckbox
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { Canvas } from "@storybook/addon-docs";
|
|
4
|
+
import * as CheckboxStories from "./Checkbox.stories";
|
|
4
5
|
|
|
5
6
|
Checkboxes are used when there are multiple items to select in a list. Users can select zero, one, or any number of items.
|
|
6
7
|
|
|
@@ -26,9 +27,7 @@ Used when there is a parent and child relationship. You can use a parent checkbo
|
|
|
26
27
|
|
|
27
28
|
### Default
|
|
28
29
|
|
|
29
|
-
<Canvas
|
|
30
|
-
<Story id="form-checkbox--default" />
|
|
31
|
-
</Canvas>
|
|
30
|
+
<Canvas of={CheckboxStories.Default}/>
|
|
32
31
|
|
|
33
32
|
### Props
|
|
34
33
|
|
|
@@ -58,12 +57,8 @@ The component has no named slots, but you can place any content inside the compo
|
|
|
58
57
|
|
|
59
58
|
To get the indeterminate state, need isChecked prop set to null. The indeterminate state is visually represented by a horizontal line inside the checkbox.
|
|
60
59
|
|
|
61
|
-
<Canvas
|
|
62
|
-
<Story id="form-checkbox--indeterminate" />
|
|
63
|
-
</Canvas>
|
|
60
|
+
<Canvas of={CheckboxStories.Indeterminate}/>
|
|
64
61
|
|
|
65
62
|
### Error state
|
|
66
63
|
|
|
67
|
-
<Canvas
|
|
68
|
-
<Story id="form-checkbox--error" />
|
|
69
|
-
</Canvas>
|
|
64
|
+
<Canvas of={CheckboxStories.Default}/>
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
# IbCheckboxGroup
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { Canvas } from "@storybook/addon-docs";
|
|
4
|
+
import * as CheckboxGroupStories from "./CheckboxGroup.stories";
|
|
4
5
|
|
|
5
6
|
The IbCheckboxGroup component is a wrapper component that helps to group and display a set of checkboxes or radio buttons together. It provides a label, an error message and an option to display the checkboxes or radio buttons horizontally.
|
|
6
7
|
|
|
7
8
|
## Default
|
|
8
9
|
|
|
9
|
-
<Canvas
|
|
10
|
-
<Story id="form-checkbox-group--default" />
|
|
11
|
-
</Canvas>
|
|
10
|
+
<Canvas of={CheckboxGroupStories.Default}/>
|
|
12
11
|
|
|
13
12
|
### Props
|
|
14
13
|
|
|
@@ -34,23 +33,14 @@ This component does not emit any events.
|
|
|
34
33
|
Checkbox labels are positioned to the right of their inputs. If there is a checkbox grouping, they can be laid out vertically or horizontally depending on the use case and the structure of the UI. When possible, arrange the checkbox and radio button groups vertically for easier reading.
|
|
35
34
|
|
|
36
35
|
- #### Vertical
|
|
37
|
-
|
|
38
|
-
<Canvas>
|
|
39
|
-
<Story id="form-checkbox-group--default" />
|
|
40
|
-
</Canvas>
|
|
36
|
+
<Canvas of={CheckboxGroupStories.Default}/>
|
|
41
37
|
|
|
42
38
|
- #### Horizontal
|
|
43
|
-
|
|
44
|
-
<Story id="form-checkbox-group--horizontal-alignment" />
|
|
45
|
-
</Canvas>
|
|
39
|
+
<Canvas of={CheckboxGroupStories.HorizontalAlignment}/>
|
|
46
40
|
|
|
47
41
|
### Use radio
|
|
48
42
|
|
|
49
|
-
<Canvas
|
|
50
|
-
<Story id="form-checkbox-group--radio-group" />
|
|
51
|
-
</Canvas>
|
|
43
|
+
<Canvas of={CheckboxGroupStories.RadioGroup}/>
|
|
52
44
|
|
|
53
45
|
### Has error
|
|
54
|
-
<Canvas
|
|
55
|
-
<Story id="form-checkbox-group--checkbox-group-error" />
|
|
56
|
-
</Canvas>
|
|
46
|
+
<Canvas of={CheckboxGroupStories.CheckboxGroupError}/>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# IbDatePicker
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { Canvas } from "@storybook/addon-docs";
|
|
4
|
+
import * as DatePickerStories from "./DatePicker.stories";
|
|
4
5
|
|
|
5
6
|
Date and time pickers allow users to select a single instance or range of dates and times.
|
|
6
7
|
|
|
@@ -38,9 +39,7 @@ Date pickers allow users to select past, present, or future dates. The type of d
|
|
|
38
39
|
|
|
39
40
|
Internationalization, also referred to as globalization, refers to software adapting to different languages, regional peculiarities, and technical requirements of a target locale without additional code changes. This means that if the location is known, then formatting of a date or time can automatically change to the acceptable local format. You should always try to design for internationalization.
|
|
40
41
|
|
|
41
|
-
<Canvas
|
|
42
|
-
<Story id="form-date-picker--default" />
|
|
43
|
-
</Canvas>
|
|
42
|
+
<Canvas of={DatePickerStories.Default}/>
|
|
44
43
|
|
|
45
44
|
### Props
|
|
46
45
|
|
|
@@ -75,9 +74,7 @@ The simple date input provides the user with only a text field in which they can
|
|
|
75
74
|
|
|
76
75
|
The simple date input can include month/year or month/day/year. The formatting may be localized and rearranged in sequence of appearance.
|
|
77
76
|
|
|
78
|
-
<Canvas
|
|
79
|
-
<Story id="form-date-picker--single-max" />
|
|
80
|
-
</Canvas>
|
|
77
|
+
<Canvas of={DatePickerStories.SingleMax}/>
|
|
81
78
|
|
|
82
79
|
#### When to use
|
|
83
80
|
|
|
@@ -95,21 +92,15 @@ A date can be selected by manually entering a date in the text input field.
|
|
|
95
92
|
|
|
96
93
|
**Example single date picker width error**
|
|
97
94
|
|
|
98
|
-
<Canvas
|
|
99
|
-
<Story id="form-date-picker--single-with-error" />
|
|
100
|
-
</Canvas>
|
|
95
|
+
<Canvas of={DatePickerStories.SingleWithError}/>
|
|
101
96
|
|
|
102
97
|
## Range Input
|
|
103
98
|
|
|
104
99
|
Date range picker
|
|
105
100
|
The date range picker functions much like the single date picker but instead of choosing just one date the user can choose a start and end date. For each date in the range, users have the option to manually enter the date in a text field or select the date in the calendar. Each point requires a day, month, and year to be selected.
|
|
106
101
|
|
|
107
|
-
<Canvas
|
|
108
|
-
<Story id="form-date-picker--range-max" />
|
|
109
|
-
</Canvas>
|
|
102
|
+
<Canvas of={DatePickerStories.RangeMax}/>
|
|
110
103
|
|
|
111
104
|
**Example range date picker width error**
|
|
112
105
|
|
|
113
|
-
<Canvas
|
|
114
|
-
<Story id="form-date-picker--range-with-error" />
|
|
115
|
-
</Canvas>
|
|
106
|
+
<Canvas of={DatePickerStories.RangeWithError}/>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# IbInput
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { Canvas } from "@storybook/addon-docs";
|
|
4
|
+
import * as InputStories from "./Input.stories";
|
|
4
5
|
|
|
5
6
|
Text inputs enable users to enter free-form text data. The type of text field used should reflect the length of the content you expect the user to enter. The default text input is for short, one-line content, whereas text area is for longer, multi-line entries.
|
|
6
7
|
|
|
@@ -13,9 +14,7 @@ Text inputs enable users to enter free-form text data. The type of text field us
|
|
|
13
14
|
|
|
14
15
|
- If a user can only enter an option from a predefined list then avoid using a free-form text input as it is likely to result in an error. Consider using a selection control such as a select dropdown, or radio button group instead.
|
|
15
16
|
|
|
16
|
-
<Canvas
|
|
17
|
-
<Story id="form-input--text" />
|
|
18
|
-
</Canvas>
|
|
17
|
+
<Canvas of={InputStories.Text}/>
|
|
19
18
|
|
|
20
19
|
### Props
|
|
21
20
|
|
|
@@ -52,17 +51,9 @@ Text inputs enable users to enter free-form text data. The type of text field us
|
|
|
52
51
|
| settings | Content that will be displayed in the dropdown menu. |
|
|
53
52
|
|
|
54
53
|
## Hass custom dropdown
|
|
54
|
+
<Canvas of={InputStories.Search}/>
|
|
55
55
|
|
|
56
|
-
<Canvas
|
|
57
|
-
<Story id="form-input--search" />
|
|
58
|
-
</Canvas>
|
|
59
|
-
|
|
60
|
-
<Canvas>
|
|
61
|
-
<Story id="form-input--search-large" />
|
|
62
|
-
</Canvas>
|
|
56
|
+
<Canvas of={InputStories.SearchLarge}/>
|
|
63
57
|
|
|
64
58
|
## Password
|
|
65
|
-
|
|
66
|
-
<Canvas>
|
|
67
|
-
<Story id="form-input--password" />
|
|
68
|
-
</Canvas>
|
|
59
|
+
<Canvas of={InputStories.Password}/>
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
# IbLabel
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { Canvas } from "@storybook/addon-docs";
|
|
4
|
+
import * as LabelStories from "./Label.stories";
|
|
4
5
|
|
|
5
6
|
This component styles the default `<label>` component
|
|
6
7
|
|
|
7
8
|
### Default
|
|
8
9
|
|
|
9
|
-
<Canvas
|
|
10
|
-
<Story id="form-label--default" />
|
|
11
|
-
</Canvas>
|
|
12
|
-
|
|
10
|
+
<Canvas of={LabelStories.Default} />
|
|
13
11
|
|
|
14
12
|
### Props
|
|
15
13
|
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
# IbPhoneInput
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { Canvas } from "@storybook/addon-docs";
|
|
4
|
+
import * as PhoneInputStories from "./PhoneInput.stories";
|
|
4
5
|
|
|
5
6
|
This component provides a phone input field with country code selection functionality. It utilizes the VueTelInput library for the phone input and allows users to select a country from a dropdown menu.
|
|
6
7
|
|
|
7
8
|
### Default
|
|
8
9
|
|
|
9
|
-
<Canvas
|
|
10
|
-
<Story id="form-phone-input--default" />
|
|
11
|
-
</Canvas>
|
|
10
|
+
<Canvas of={PhoneInputStories.Default}/>
|
|
12
11
|
|
|
13
12
|
### Props
|
|
14
13
|
|
|
@@ -32,6 +31,4 @@ This component has no default events but has global events `countrySelectValue`
|
|
|
32
31
|
|
|
33
32
|
### Error state
|
|
34
33
|
|
|
35
|
-
<Canvas
|
|
36
|
-
<Story id="form-phone-input--error" />
|
|
37
|
-
</Canvas>
|
|
34
|
+
<Canvas of={PhoneInputStories.Error}/>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# IbRadio
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { Canvas } from "@storybook/addon-docs";
|
|
4
|
+
import * as RadioStories from "./Radio.stories";
|
|
4
5
|
|
|
5
6
|
Radio buttons are used for mutually exclusive choices, not for multiple choices. Only one radio button can be selected at a time. When a user chooses a new item, the previous choice is automatically deselected.
|
|
6
7
|
|
|
@@ -20,9 +21,7 @@ If a user can select from multiple options, use [checkboxes](?path=/story/form-c
|
|
|
20
21
|
|
|
21
22
|
### Default
|
|
22
23
|
|
|
23
|
-
<Canvas
|
|
24
|
-
<Story id="form-radio--default" />
|
|
25
|
-
</Canvas>
|
|
24
|
+
<Canvas of={RadioStories.Default}/>
|
|
26
25
|
|
|
27
26
|
### Props
|
|
28
27
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# IbTextEditor
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { Canvas } from "@storybook/addon-docs";
|
|
4
|
+
import * as TextEditorStories from "./TextEditor.stories";
|
|
4
5
|
|
|
5
6
|
Text inputs enable users to enter free-form text data. The type of text field used should reflect the length of the content you expect the user to enter. The default text input is for short, one-line content, whereas text area is for longer, multi-line entries.
|
|
6
7
|
|
|
@@ -13,9 +14,7 @@ Text inputs enable users to enter free-form text data. The type of text field us
|
|
|
13
14
|
|
|
14
15
|
- If a user can only enter an option from a predefined list then avoid using a free-form text input as it is likely to result in an error. Consider using a selection control such as a select dropdown, or radio button group instead.
|
|
15
16
|
|
|
16
|
-
<Canvas
|
|
17
|
-
<Story id="form-text-editor--default" />
|
|
18
|
-
</Canvas>
|
|
17
|
+
<Canvas of={TextEditorStories.Default}/>
|
|
19
18
|
|
|
20
19
|
### Props
|
|
21
20
|
|
|
@@ -47,13 +46,7 @@ Text inputs enable users to enter free-form text data. The type of text field us
|
|
|
47
46
|
This component don't support slots
|
|
48
47
|
|
|
49
48
|
### Used in form group
|
|
50
|
-
|
|
51
|
-
<Canvas>
|
|
52
|
-
<Story id="form-text-editor--width-form-group" />
|
|
53
|
-
</Canvas>
|
|
49
|
+
<Canvas of={TextEditorStories.WidthFormGroup}/>
|
|
54
50
|
|
|
55
51
|
### Error state
|
|
56
|
-
|
|
57
|
-
<Canvas>
|
|
58
|
-
<Story id="form-text-editor--width-form-group" />
|
|
59
|
-
</Canvas>
|
|
52
|
+
<Canvas of={TextEditorStories.ErrorState}/>
|