@avakhula/ui 0.0.14 → 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 +1805 -1792
- package/dist/index.umd.cjs +36 -36
- package/dist/style.css +1 -1
- package/package.json +13 -13
- 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/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
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
# IbTextArea
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { Canvas } from "@storybook/addon-docs";
|
|
4
|
+
import * as TextareaStories from "./Textarea.stories";
|
|
4
5
|
|
|
5
6
|
The IbTextarea component is a customizable textarea input that provides additional features such as character count and error messages. It can be used to receive and display large amounts of text input from the user.
|
|
6
7
|
|
|
7
8
|
### Default
|
|
8
9
|
|
|
9
|
-
<Canvas
|
|
10
|
-
<Story id="form-textarea--default" />
|
|
11
|
-
</Canvas>
|
|
10
|
+
<Canvas of={TextareaStories.Default}/>
|
|
12
11
|
|
|
13
12
|
### Props
|
|
14
13
|
|
|
@@ -33,13 +32,7 @@ This component has no slots.
|
|
|
33
32
|
| blur | String | Emitted when the input loses focus. The payload is the current input value. |
|
|
34
33
|
|
|
35
34
|
### Disabled
|
|
36
|
-
|
|
37
|
-
<Canvas>
|
|
38
|
-
<Story id="form-textarea--disabled" />
|
|
39
|
-
</Canvas>
|
|
35
|
+
<Canvas of={TextareaStories.Disabled}/>
|
|
40
36
|
|
|
41
37
|
### Width Form Group
|
|
42
|
-
|
|
43
|
-
<Canvas>
|
|
44
|
-
<Story id="form-textarea--width-form-group" />
|
|
45
|
-
</Canvas>
|
|
38
|
+
<Canvas of={TextareaStories.WidthFormGroup}/>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# IbToogle
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { Canvas } from "@storybook/addon-docs";
|
|
4
|
+
import * as ToggleStories from "./Toggle.stories";
|
|
4
5
|
|
|
5
6
|
A toggle is used to quickly switch between two possible states. They are commonly used for “on/off” switches.
|
|
6
7
|
|
|
@@ -9,10 +10,7 @@ A toggle is used to quickly switch between two possible states. They are commonl
|
|
|
9
10
|
Toggle is a control that is used to quickly switch between two possible states. Toggles are only used for these binary actions that occur immediately after the user “flips the switch”. They are commonly used for “on/off” switches.
|
|
10
11
|
|
|
11
12
|
### Default
|
|
12
|
-
|
|
13
|
-
<Canvas>
|
|
14
|
-
<Story id="form-toggle--default" />
|
|
15
|
-
</Canvas>
|
|
13
|
+
<Canvas of={ToggleStories.Default}/>
|
|
16
14
|
|
|
17
15
|
### Props
|
|
18
16
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# IbIconButton
|
|
2
2
|
|
|
3
3
|
import { Story, Canvas } from "@storybook/addon-docs";
|
|
4
|
+
import * as IconButtonStories from "./IconButton.stories";
|
|
4
5
|
|
|
5
6
|
Icon buttons allow users to take actions, and make choices, with a single tap. The icon Button should always have a tooltip.
|
|
6
7
|
|
|
@@ -42,25 +43,14 @@ Do not use buttons as navigational elements. Instead, use [links](?path=/story/l
|
|
|
42
43
|
|
|
43
44
|
### Default
|
|
44
45
|
|
|
45
|
-
<Canvas
|
|
46
|
-
<Story id="icon-button--default" />
|
|
47
|
-
</Canvas>
|
|
46
|
+
<Canvas of={IconButtonStories.Default}/>
|
|
48
47
|
|
|
49
48
|
### Rounded
|
|
50
|
-
|
|
51
|
-
<Canvas>
|
|
52
|
-
<Story id="icon-button--rounded-button" />
|
|
53
|
-
</Canvas>
|
|
49
|
+
<Canvas of={IconButtonStories.RoundedButton}/>
|
|
54
50
|
|
|
55
51
|
### With tooltip
|
|
56
|
-
|
|
57
|
-
<Canvas>
|
|
58
|
-
<Story id="icon-button--button-with-tooltip" />
|
|
59
|
-
</Canvas>
|
|
52
|
+
<Canvas of={IconButtonStories.ButtonWithTooltip}/>
|
|
60
53
|
|
|
61
54
|
|
|
62
55
|
### All sizes
|
|
63
|
-
|
|
64
|
-
<Canvas>
|
|
65
|
-
<Story id="icon-button--sizes" />
|
|
66
|
-
</Canvas>
|
|
56
|
+
<Canvas of={IconButtonStories.Sizes}/>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# IbModal
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { Canvas } from "@storybook/addon-docs";
|
|
4
|
+
import * as ModalStories from "./Modal.stories";
|
|
4
5
|
|
|
5
6
|
Modals focus the user’s attention exclusively on one task or piece of information via a window that sits on top of the page content.
|
|
6
7
|
|
|
@@ -72,6 +73,4 @@ Modal content should never scroll horizontally; instead, use a larger size modal
|
|
|
72
73
|
|
|
73
74
|
### Default
|
|
74
75
|
|
|
75
|
-
<Canvas
|
|
76
|
-
<Story id="modal--default" />
|
|
77
|
-
</Canvas>
|
|
76
|
+
<Canvas of={Modal.Default}/>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# IbPopover
|
|
2
2
|
import { Story, Canvas } from "@storybook/addon-docs";
|
|
3
|
+
import * as PopoverStories from "./Popover.stories";
|
|
3
4
|
|
|
4
5
|
A popover is a layer that pops up over all other elements on a page and has wide variation of passive content to display.
|
|
5
6
|
|
|
@@ -20,9 +21,8 @@ A popover is controlled by a trigger button. By default, we use an icon button t
|
|
|
20
21
|
|
|
21
22
|
### Usage
|
|
22
23
|
For correct use component `<ib-popover>`, need to insert inside the element that should show this `<ib-popover>` when hovering and focusing.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
</Canvas>
|
|
24
|
+
|
|
25
|
+
<Canvas of={PopoverStories.Default}/>
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
### Props
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# IbProgressBar
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { Canvas } from "@storybook/addon-docs";
|
|
4
|
+
import * as ProgressBarStories from "./ProgressBar.stories";
|
|
4
5
|
|
|
5
6
|
A progress bar provides feedback about the duration and progression of a process, such as a download, file transfer, or installation, to indicate how long a user will be waiting.
|
|
6
7
|
|
|
@@ -28,9 +29,7 @@ Determinate progress bars are used when the loading progress can be tracked and
|
|
|
28
29
|
Use a determinate progress bar when the progress can be calculated against a specific goal.
|
|
29
30
|
It’s best to give the user transparency about the process which usually leads to increased trust in the software or platform.
|
|
30
31
|
|
|
31
|
-
<Canvas
|
|
32
|
-
<Story id="progress-bar--default" />
|
|
33
|
-
</Canvas>
|
|
32
|
+
<Canvas of={ProgressBarStories.Default}/>
|
|
34
33
|
|
|
35
34
|
### Props
|
|
36
35
|
|
|
@@ -55,9 +54,7 @@ There are four states for the progress bar: in progress, success, error, cancell
|
|
|
55
54
|
- **Success.** The success loading state, conveyed by a full-width green progress bar and checkmark icon, indicates that the action completed successfully.
|
|
56
55
|
- **Error.** The error loading state indicates that the action did not successfully complete. If an error occurs, an inline notification or error handling within the form should appear. As soon as a process fails, the indicator bar’s progress spans full width, turns red, and remains visible. A failed icon is also shown.
|
|
57
56
|
- **Cancelled.** -
|
|
58
|
-
<Canvas
|
|
59
|
-
<Story id="progress-bar--states" />
|
|
60
|
-
</Canvas>
|
|
57
|
+
<Canvas of={ProgressBarStories.States}/>
|
|
61
58
|
|
|
62
59
|
### Percent-done animation
|
|
63
60
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# IbSplitButton
|
|
2
2
|
|
|
3
3
|
import { Story, Canvas } from "@storybook/addon-docs";
|
|
4
|
+
import * as SplitButtonStories from "./SplitButton.stories";
|
|
4
5
|
|
|
5
6
|
Split buttons are for presenting several related tools if one option is used most frequently. Making the most commonly accessed option a default lowers the interaction cost to use that option since it removes the need to open the menu before selecting the item.
|
|
6
7
|
|
|
@@ -18,9 +19,8 @@ It is a hybrid between a [button](?path=/docs/button--default) and a [drop-down
|
|
|
18
19
|
|
|
19
20
|
### Default
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
</Canvas>
|
|
22
|
+
|
|
23
|
+
<Canvas of={SplitButtonStories.Default} />
|
|
24
24
|
|
|
25
25
|
### Props
|
|
26
26
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# IbTagPill
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { Canvas } from "@storybook/addon-docs";
|
|
4
|
+
import * as TagPillStories from "./TagPill.stories";
|
|
4
5
|
|
|
5
6
|
A status Pill is a visual indicator used to highlight an item's status for quick recognition.
|
|
6
7
|
|
|
@@ -9,9 +10,7 @@ Use the icon together with the label in Lozenge to help user quicker understand
|
|
|
9
10
|
|
|
10
11
|
### Default
|
|
11
12
|
|
|
12
|
-
<Canvas
|
|
13
|
-
<Story id="tag-pill--default" />
|
|
14
|
-
</Canvas>
|
|
13
|
+
<Canvas of={TagPillStories.Default} />
|
|
15
14
|
|
|
16
15
|
### Temporary status Pills
|
|
17
16
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# IbToggleTip
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { Canvas } from "@storybook/addon-docs";
|
|
4
|
+
import * as ToggleTipStories from "./ToggleTip.stories";
|
|
4
5
|
|
|
5
6
|
Toggletips use the disclosure pattern to toggle the visibility of a popover. They display additional, hidden information upon the click of a UI trigger element and can contain interactive elements.
|
|
6
7
|
Toggletip should be used in place of tooltip if your content will contain interactive elements. If it does not have any interactive content, consider using [Tooltip](?path=/story/tooltip--default) or [Popover](?path=/story/popover--default) instead.
|
|
@@ -41,6 +42,4 @@ The toggletip component has two states—active and inactive. By default, the to
|
|
|
41
42
|
| close | | Emitted when the Toggletip is closed. |
|
|
42
43
|
|
|
43
44
|
### Default
|
|
44
|
-
<Canvas
|
|
45
|
-
<Story id="toggletip--has-buttons" />
|
|
46
|
-
</Canvas>
|
|
45
|
+
<Canvas of={ToggleTipStories.HasButtons} />
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# IbTooltip
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { Canvas } from "@storybook/addon-docs";
|
|
4
|
+
import * as TooltipStories from "./Tooltip.stories";
|
|
4
5
|
|
|
5
6
|
Tooltips display additional information upon hover or focus. The information included should be contextual, helpful, and nonessential while providing that extra ability to communicate and give clarity to a user.
|
|
6
7
|
|
|
@@ -22,10 +23,8 @@ A tooltip is a message box that is displayed when a user hovers over or gives fo
|
|
|
22
23
|
|
|
23
24
|
### Usage
|
|
24
25
|
For correct use component `<ib-polltip>`, need to insert inside the element that should show this `<ib-polltip>` when hovering and focusing.
|
|
25
|
-
<Canvas>
|
|
26
|
-
<Story id="tooltip--default" />
|
|
27
|
-
</Canvas>
|
|
28
26
|
|
|
27
|
+
<Canvas of={TooltipStories.Default} />
|
|
29
28
|
|
|
30
29
|
### Props
|
|
31
30
|
| Name | type | Default Value | required | Description |
|
|
@@ -273,6 +273,12 @@ export default {
|
|
|
273
273
|
return [];
|
|
274
274
|
},
|
|
275
275
|
},
|
|
276
|
+
modelValue: {
|
|
277
|
+
type: [Number, String, Array],
|
|
278
|
+
default() {
|
|
279
|
+
return [];
|
|
280
|
+
},
|
|
281
|
+
},
|
|
276
282
|
value: {
|
|
277
283
|
type: [Number, String, Array],
|
|
278
284
|
default() {
|
|
@@ -365,7 +371,11 @@ export default {
|
|
|
365
371
|
},
|
|
366
372
|
},
|
|
367
373
|
watch: {
|
|
368
|
-
|
|
374
|
+
modelValue(value) {
|
|
375
|
+
this.val = value;
|
|
376
|
+
this.setPreparedValues();
|
|
377
|
+
},
|
|
378
|
+
val(value) {
|
|
369
379
|
if (
|
|
370
380
|
this.watchClearValue &&
|
|
371
381
|
(!value || (Array.isArray(value) && !value.length))
|
|
@@ -445,6 +455,7 @@ export default {
|
|
|
445
455
|
};
|
|
446
456
|
|
|
447
457
|
return {
|
|
458
|
+
val: this.modelValue ? this.modelValue : this.value,
|
|
448
459
|
size: {
|
|
449
460
|
left: (this.initialSize && this.initialSize.left) || 0,
|
|
450
461
|
right: (this.initialSize && this.initialSize.right) || 0,
|
|
@@ -616,9 +627,9 @@ export default {
|
|
|
616
627
|
option.isDisabled = false;
|
|
617
628
|
|
|
618
629
|
option.checked = this.isMultiple
|
|
619
|
-
? this.
|
|
620
|
-
this.
|
|
621
|
-
: this.
|
|
630
|
+
? this.val !== null &&
|
|
631
|
+
this.val.findIndex((el) => option.id == el) > -1
|
|
632
|
+
: this.val !== null && this.val == option.id;
|
|
622
633
|
|
|
623
634
|
if (option.checked) {
|
|
624
635
|
if (!this.onlyEndNodes || !option.children) {
|
|
@@ -711,8 +722,10 @@ export default {
|
|
|
711
722
|
change() {
|
|
712
723
|
const values = Object.keys(this.selected);
|
|
713
724
|
if (this.isMultiple) {
|
|
725
|
+
this.$emit("update:modelValue", values);
|
|
714
726
|
this.$emit("input", values);
|
|
715
727
|
} else {
|
|
728
|
+
this.$emit("update:modelValue", values[0]);
|
|
716
729
|
this.$emit("input", values[0]);
|
|
717
730
|
}
|
|
718
731
|
this.$globalEvents.$emit("select-" + this.filterId + ":update", {
|
|
@@ -733,6 +746,7 @@ export default {
|
|
|
733
746
|
) {
|
|
734
747
|
this.selected[option.id] = option;
|
|
735
748
|
this.$emit("input", Object.keys(this.selected));
|
|
749
|
+
this.$emit("update:modelValue", Object.keys(this.selected));
|
|
736
750
|
}
|
|
737
751
|
} else {
|
|
738
752
|
const selectedOptionKey = Object.keys(this.selected)[0];
|
|
@@ -748,6 +762,7 @@ export default {
|
|
|
748
762
|
delete this.selected[option.id];
|
|
749
763
|
option.checked = false;
|
|
750
764
|
this.$emit("input", Object.keys(this.selected));
|
|
765
|
+
this.$emit("update:modelValue", Object.keys(this.selected));
|
|
751
766
|
}
|
|
752
767
|
|
|
753
768
|
this.toggleDuplicateOptions(this.actualOptions, option.id, isChecked);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# IbLink
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { Canvas } from "@storybook/addon-docs";
|
|
4
|
+
import * as LinkStories from "./Link.stories";
|
|
4
5
|
|
|
5
6
|
## Inline Link
|
|
6
7
|
|
|
@@ -10,9 +11,7 @@ Links are used as navigational elements and can be used on their own or inline w
|
|
|
10
11
|
|
|
11
12
|
For usage need add class `.ib-link` to tag `a`.
|
|
12
13
|
|
|
13
|
-
<Canvas
|
|
14
|
-
<Story id="links--inline-link" />
|
|
15
|
-
</Canvas>
|
|
14
|
+
<Canvas of={LinkStories.InlineLink} />
|
|
16
15
|
|
|
17
16
|
### Use links when you want users to:
|
|
18
17
|
|
|
@@ -33,9 +32,7 @@ Links are used as navigational elements and can be used on their own or inline w
|
|
|
33
32
|
|
|
34
33
|
For usage need add class `.ib-standalone-link` to tag `a`.
|
|
35
34
|
|
|
36
|
-
<Canvas
|
|
37
|
-
<Story id="links--standalone-link" />
|
|
38
|
-
</Canvas>
|
|
35
|
+
<Canvas of={LinkStories.StandaloneLink} />
|
|
39
36
|
|
|
40
37
|
### Use links when you want users to:
|
|
41
38
|
|
|
@@ -52,6 +49,5 @@ Use a button instead of a link for actions that will change data or manipulate h
|
|
|
52
49
|
|
|
53
50
|
The standalone link component can be paired with an icon. Use 16px icons and place them to the right of the link. Icons should always be the same color as the link text.
|
|
54
51
|
|
|
55
|
-
<Canvas
|
|
56
|
-
|
|
57
|
-
</Canvas>
|
|
52
|
+
<Canvas of={LinkStories.StandaloneLinkWithIcon} />
|
|
53
|
+
|
|
Binary file
|
package/dist/favicon.ico
DELETED
|
Binary file
|
package/public/favicon.ico
DELETED
|
Binary file
|
|
File without changes
|