@avakhula/ui 0.0.14 → 0.0.16

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 (39) hide show
  1. package/.storybook/preview.js +3 -2
  2. package/dist/index.js +1808 -1795
  3. package/dist/index.umd.cjs +36 -36
  4. package/dist/style.css +1 -1
  5. package/package.json +13 -13
  6. package/src/App.vue +68 -26
  7. package/src/components/Alert/Alert.stories.js +21 -29
  8. package/src/components/Alert/readme.mdx +1 -1
  9. package/src/components/Badge/readme.mdx +1 -1
  10. package/src/components/Button/Button.stories.js +2 -18
  11. package/src/components/Button/readme.mdx +1 -1
  12. package/src/components/ButtonGroup/ButtonGroup.stories.js +3 -0
  13. package/src/components/Dropdown/readme.mdx +1 -0
  14. package/src/components/Form/Checkbox/readme.mdx +5 -10
  15. package/src/components/Form/CheckboxGroup/readme.mdx +7 -17
  16. package/src/components/Form/DatePicker/readme.mdx +7 -16
  17. package/src/components/Form/Input/readme.mdx +6 -15
  18. package/src/components/Form/Label/Label.vue +1 -0
  19. package/src/components/Form/Label/readme.mdx +3 -5
  20. package/src/components/Form/PhoneInput/readme.mdx +4 -7
  21. package/src/components/Form/Radio/readme.mdx +3 -4
  22. package/src/components/Form/TextEditor/readme.mdx +5 -12
  23. package/src/components/Form/Textarea/readme.mdx +5 -12
  24. package/src/components/Form/Toggle/readme.mdx +3 -5
  25. package/src/components/IconButton/readme.mdx +5 -15
  26. package/src/components/Modal/readme.mdx +3 -4
  27. package/src/components/Popover/readme.mdx +3 -3
  28. package/src/components/ProgressBar/readme.mdx +4 -7
  29. package/src/components/SplitButton/readme.mdx +3 -3
  30. package/src/components/TagPill/readme.mdx +3 -4
  31. package/src/components/ToggleTip/readme.mdx +3 -4
  32. package/src/components/Tooltip/readme.mdx +3 -4
  33. package/src/components/TreeSelect/Option.vue +7 -1
  34. package/src/components/TreeSelect/Select.vue +20 -4
  35. package/src/stories/link.readme.mdx +6 -10
  36. package/static/favicon.ico +0 -0
  37. package/dist/favicon.ico +0 -0
  38. package/public/favicon.ico +0 -0
  39. /package/src/stories/{link.stories.js → Link.stories.js} +0 -0
@@ -1,14 +1,13 @@
1
1
  # IbTextArea
2
2
 
3
- import { Story, Canvas } from "@storybook/addon-docs";
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 { Story, Canvas } from "@storybook/addon-docs";
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 { Story, Canvas } from "@storybook/addon-docs";
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
- <Canvas>
24
- <Story id="popover--default" />
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 { Story, Canvas } from "@storybook/addon-docs";
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
- <Canvas>
22
- <Story id="splitbutton--default" />
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 { Story, Canvas } from "@storybook/addon-docs";
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 { Story, Canvas } from "@storybook/addon-docs";
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 { Story, Canvas } from "@storybook/addon-docs";
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 |
@@ -200,7 +200,13 @@ export default {
200
200
  }
201
201
  },
202
202
  onChange() {
203
- this.$refs.component?.onChange();
203
+ if (!this.isMultiple && !this.isChecked) {
204
+ this.$refs.component?.onChange();
205
+ }
206
+
207
+ if (this.isMultiple) {
208
+ this.$refs.component?.onChange();
209
+ }
204
210
  },
205
211
  toggle(value, checkChildren = true) {
206
212
  this.check(this.option, value, true, checkChildren);
@@ -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
- value(value) {
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,
@@ -581,6 +592,7 @@ export default {
581
592
  this.allOptionsIsChecked = false;
582
593
  this.countVisibleChildren = 0;
583
594
  this.selected = [];
595
+ this.$emit("update:modelValue", null);
584
596
  },
585
597
  clearValue() {
586
598
  this.clear();
@@ -616,9 +628,9 @@ export default {
616
628
  option.isDisabled = false;
617
629
 
618
630
  option.checked = this.isMultiple
619
- ? this.value !== null &&
620
- this.value.findIndex((el) => option.id == el) > -1
621
- : this.value !== null && this.value == option.id;
631
+ ? this.val !== null &&
632
+ this.val.findIndex((el) => option.id == el) > -1
633
+ : this.val !== null && this.val == option.id;
622
634
 
623
635
  if (option.checked) {
624
636
  if (!this.onlyEndNodes || !option.children) {
@@ -711,8 +723,10 @@ export default {
711
723
  change() {
712
724
  const values = Object.keys(this.selected);
713
725
  if (this.isMultiple) {
726
+ this.$emit("update:modelValue", values);
714
727
  this.$emit("input", values);
715
728
  } else {
729
+ this.$emit("update:modelValue", values[0]);
716
730
  this.$emit("input", values[0]);
717
731
  }
718
732
  this.$globalEvents.$emit("select-" + this.filterId + ":update", {
@@ -733,6 +747,7 @@ export default {
733
747
  ) {
734
748
  this.selected[option.id] = option;
735
749
  this.$emit("input", Object.keys(this.selected));
750
+ this.$emit("update:modelValue", Object.keys(this.selected));
736
751
  }
737
752
  } else {
738
753
  const selectedOptionKey = Object.keys(this.selected)[0];
@@ -748,6 +763,7 @@ export default {
748
763
  delete this.selected[option.id];
749
764
  option.checked = false;
750
765
  this.$emit("input", Object.keys(this.selected));
766
+ this.$emit("update:modelValue", Object.keys(this.selected));
751
767
  }
752
768
 
753
769
  this.toggleDuplicateOptions(this.actualOptions, option.id, isChecked);
@@ -1,6 +1,7 @@
1
1
  # IbLink
2
2
 
3
- import { Story, Canvas } from "@storybook/addon-docs";
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
- <Story id="links--standalone-link-with-icon" />
57
- </Canvas>
52
+ <Canvas of={LinkStories.StandaloneLinkWithIcon} />
53
+
Binary file
package/dist/favicon.ico DELETED
Binary file
Binary file