@avakhula/ui 0.0.10

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 (194) hide show
  1. package/.babelrc.json +14 -0
  2. package/.eslintrc.cjs +15 -0
  3. package/.nvmrc +1 -0
  4. package/.prettierrc.json +1 -0
  5. package/.storybook/intelliboardTheme.js +10 -0
  6. package/.storybook/main.js +25 -0
  7. package/.storybook/manager.js +7 -0
  8. package/.storybook/preview-head.html +11 -0
  9. package/.storybook/preview.js +24 -0
  10. package/.storybook/scss-loader.scss +6 -0
  11. package/.storybook/withSource.js +97 -0
  12. package/README.md +35 -0
  13. package/dist/favicon.ico +0 -0
  14. package/dist/index.mjs +19366 -0
  15. package/dist/index.umd.js +209 -0
  16. package/dist/style.css +1 -0
  17. package/index.html +21 -0
  18. package/package.json +63 -0
  19. package/public/favicon.ico +0 -0
  20. package/src/App.vue +37 -0
  21. package/src/EventEmmiter.js +19 -0
  22. package/src/assets/scss/mixins/dropdown-list-item.scss +45 -0
  23. package/src/assets/scss/mixins/tooltip-position.scss +147 -0
  24. package/src/assets/scss/mixins.scss +21 -0
  25. package/src/assets/scss/reset.scss +12 -0
  26. package/src/assets/scss/style.scss +73 -0
  27. package/src/assets/scss/typography.scss +155 -0
  28. package/src/assets/scss/variables/colors.scss +115 -0
  29. package/src/assets/scss/variables/shadows.scss +17 -0
  30. package/src/components/Accordion/Accordion.scss +94 -0
  31. package/src/components/Accordion/Accordion.stories.js +41 -0
  32. package/src/components/Accordion/Accordion.vue +104 -0
  33. package/src/components/Accordion/readme.mdx +38 -0
  34. package/src/components/Alert/Alert.stories.js +69 -0
  35. package/src/components/Alert/Alert.vue +131 -0
  36. package/src/components/Alert/alert.scss +166 -0
  37. package/src/components/Alert/constants.js +6 -0
  38. package/src/components/Alert/readme.mdx +63 -0
  39. package/src/components/Badge/Badge.stories.js +53 -0
  40. package/src/components/Badge/Badge.vue +58 -0
  41. package/src/components/Badge/readme.mdx +38 -0
  42. package/src/components/Breadcrumbs/Breadcrumbs.vue +98 -0
  43. package/src/components/Breadcrumbs/breadcrumbs.scss +77 -0
  44. package/src/components/Breadcrumbs/breadcrumbs.stories.js +37 -0
  45. package/src/components/Button/Button.stories.js +124 -0
  46. package/src/components/Button/Button.vue +165 -0
  47. package/src/components/Button/button.scss +217 -0
  48. package/src/components/Button/constants.js +8 -0
  49. package/src/components/Button/readme.mdx +118 -0
  50. package/src/components/ButtonGroup/ButtonGroup.stories.js +27 -0
  51. package/src/components/ButtonGroup/ButtonGroup.vue +24 -0
  52. package/src/components/ButtonGroup/readme.mdx +10 -0
  53. package/src/components/Dropdown/Dropdown.spec.js +90 -0
  54. package/src/components/Dropdown/Dropdown.stories.js +48 -0
  55. package/src/components/Dropdown/Dropdown.vue +313 -0
  56. package/src/components/Dropdown/DropdownDivider.vue +15 -0
  57. package/src/components/Dropdown/DropdownItem.vue +59 -0
  58. package/src/components/Dropdown/DropdownList.stories.js +174 -0
  59. package/src/components/Dropdown/DropdownList.vue +93 -0
  60. package/src/components/Dropdown/constants.js +10 -0
  61. package/src/components/Dropdown/readme.mdx +88 -0
  62. package/src/components/Form/CharactersCount.vue +55 -0
  63. package/src/components/Form/Checkbox/Checkbox.scss +226 -0
  64. package/src/components/Form/Checkbox/Checkbox.stories.js +63 -0
  65. package/src/components/Form/Checkbox/Checkbox.vue +128 -0
  66. package/src/components/Form/Checkbox/readme.mdx +69 -0
  67. package/src/components/Form/CheckboxGroup/CheckboxGroup.stories.js +64 -0
  68. package/src/components/Form/CheckboxGroup/CheckboxGroup.vue +87 -0
  69. package/src/components/Form/CheckboxGroup/readme.mdx +56 -0
  70. package/src/components/Form/DatePicker/DatePicker.scss +479 -0
  71. package/src/components/Form/DatePicker/DatePicker.stories.js +78 -0
  72. package/src/components/Form/DatePicker/DatePicker.vue +284 -0
  73. package/src/components/Form/DatePicker/Icons/chevron-back.js +5 -0
  74. package/src/components/Form/DatePicker/Icons/chevron-forward.js +5 -0
  75. package/src/components/Form/DatePicker/readme.mdx +115 -0
  76. package/src/components/Form/FormGroup/FormGroup.stories.js +48 -0
  77. package/src/components/Form/FormGroup/FormGroup.vue +61 -0
  78. package/src/components/Form/FormGroup/FormGroupSet.stories.js +32 -0
  79. package/src/components/Form/FormGroup/FormGroupSet.vue +75 -0
  80. package/src/components/Form/Input/Input.stories.js +137 -0
  81. package/src/components/Form/Input/Input.vue +231 -0
  82. package/src/components/Form/Input/constants.js +5 -0
  83. package/src/components/Form/Input/input.scss +133 -0
  84. package/src/components/Form/Input/readme.mdx +68 -0
  85. package/src/components/Form/Label/Label.stories.js +29 -0
  86. package/src/components/Form/Label/Label.vue +87 -0
  87. package/src/components/Form/Label/readme.mdx +25 -0
  88. package/src/components/Form/PhoneInput/PhoneInput.stories.js +43 -0
  89. package/src/components/Form/PhoneInput/PhoneInput.vue +105 -0
  90. package/src/components/Form/PhoneInput/phoneInput.scss +197 -0
  91. package/src/components/Form/PhoneInput/readme.mdx +37 -0
  92. package/src/components/Form/Radio/Radio.stories.js +34 -0
  93. package/src/components/Form/Radio/Radio.vue +109 -0
  94. package/src/components/Form/Radio/radio.scss +187 -0
  95. package/src/components/Form/Radio/readme.mdx +48 -0
  96. package/src/components/Form/TextEditor/TextEditor.stories.js +58 -0
  97. package/src/components/Form/TextEditor/TextEditor.vue +305 -0
  98. package/src/components/Form/TextEditor/icons/svg/chevron-down.svg +3 -0
  99. package/src/components/Form/TextEditor/icons/toolbarIcons.js +111 -0
  100. package/src/components/Form/TextEditor/plugins/alphabetList.js +43 -0
  101. package/src/components/Form/TextEditor/readme.mdx +59 -0
  102. package/src/components/Form/TextEditor/textEditor.scss +684 -0
  103. package/src/components/Form/Textarea/Textarea.spec.js +107 -0
  104. package/src/components/Form/Textarea/Textarea.stories.js +68 -0
  105. package/src/components/Form/Textarea/Textarea.vue +102 -0
  106. package/src/components/Form/Textarea/readme.mdx +45 -0
  107. package/src/components/Form/Textarea/textarea.scss +84 -0
  108. package/src/components/Form/Toggle/Toggle.stories.js +44 -0
  109. package/src/components/Form/Toggle/Toggle.vue +122 -0
  110. package/src/components/Form/Toggle/readme.mdx +39 -0
  111. package/src/components/Form/Toggle/toggle.scss +166 -0
  112. package/src/components/Icon.vue +41 -0
  113. package/src/components/IconButton/IconButton.scss +91 -0
  114. package/src/components/IconButton/IconButton.stories.js +115 -0
  115. package/src/components/IconButton/IconButton.vue +100 -0
  116. package/src/components/IconButton/constants.js +14 -0
  117. package/src/components/IconButton/readme.mdx +66 -0
  118. package/src/components/List.vue +150 -0
  119. package/src/components/Modal/Modal.stories.js +48 -0
  120. package/src/components/Modal/Modal.vue +231 -0
  121. package/src/components/Modal/readme.mdx +76 -0
  122. package/src/components/Pagination/LimitSelector.vue +73 -0
  123. package/src/components/Pagination/Pagination.stories.js +54 -0
  124. package/src/components/Pagination/Pagination.vue +227 -0
  125. package/src/components/Pagination/pagination.scss +189 -0
  126. package/src/components/Popover/Popover.stories.js +46 -0
  127. package/src/components/Popover/Popover.vue +81 -0
  128. package/src/components/Popover/constants.js +14 -0
  129. package/src/components/Popover/popover.scss +26 -0
  130. package/src/components/Popover/readme.mdx +42 -0
  131. package/src/components/ProgressBar/ProgressBar.stories.js +90 -0
  132. package/src/components/ProgressBar/ProgressBar.vue +58 -0
  133. package/src/components/ProgressBar/constants.js +6 -0
  134. package/src/components/ProgressBar/progressBar.scss +116 -0
  135. package/src/components/ProgressBar/readme.mdx +67 -0
  136. package/src/components/Sorting/Sorting.stories.js +35 -0
  137. package/src/components/Sorting/Sorting.vue +128 -0
  138. package/src/components/Sorting/constants.js +10 -0
  139. package/src/components/Sorting/sorting.scss +87 -0
  140. package/src/components/SplitButton/SplitButton.stories.js +39 -0
  141. package/src/components/SplitButton/SplitButton.vue +132 -0
  142. package/src/components/SplitButton/SplitButtonItem.vue +34 -0
  143. package/src/components/SplitButton/constants.js +4 -0
  144. package/src/components/SplitButton/readme.mdx +77 -0
  145. package/src/components/SplitButton/splitButton.scss +161 -0
  146. package/src/components/StatusIndicator/StatusIndicator.stories.js +40 -0
  147. package/src/components/StatusIndicator/StatusIndicator.vue +52 -0
  148. package/src/components/StatusIndicator/constants.js +10 -0
  149. package/src/components/StatusIndicator/icons.js +48 -0
  150. package/src/components/StatusIndicator/readme.mdx +21 -0
  151. package/src/components/Table/Cells/Cell.vue +71 -0
  152. package/src/components/Table/Cells/CheckboxCell.vue +48 -0
  153. package/src/components/Table/Row.vue +26 -0
  154. package/src/components/Table/Table.stories.js +59 -0
  155. package/src/components/Table/Table.vue +36 -0
  156. package/src/components/Tabs/Tab.vue +37 -0
  157. package/src/components/Tabs/TabDropdown.vue +93 -0
  158. package/src/components/Tabs/Tabs.stories.js +57 -0
  159. package/src/components/Tabs/Tabs.vue +94 -0
  160. package/src/components/Tabs/tabs.scss +157 -0
  161. package/src/components/TagPill/TagPill.stories.js +30 -0
  162. package/src/components/TagPill/TagPill.vue +133 -0
  163. package/src/components/TagPill/constants.js +9 -0
  164. package/src/components/TagPill/readme.mdx +37 -0
  165. package/src/components/ToggleTip/ToggleTip.stories.js +98 -0
  166. package/src/components/ToggleTip/ToggleTip.vue +112 -0
  167. package/src/components/ToggleTip/constants.js +14 -0
  168. package/src/components/ToggleTip/readme.mdx +46 -0
  169. package/src/components/ToggleTip/toggleTip.scss +55 -0
  170. package/src/components/Tooltip/Tooltip.stories.js +56 -0
  171. package/src/components/Tooltip/Tooltip.vue +49 -0
  172. package/src/components/Tooltip/readme.mdx +43 -0
  173. package/src/components/TreeSelect/Option.vue +325 -0
  174. package/src/components/TreeSelect/Select.stories.js +349 -0
  175. package/src/components/TreeSelect/Select.vue +909 -0
  176. package/src/components/TreeSelect/TreeSelect.stories.js +270 -0
  177. package/src/components/TreeSelect/scss/option.scss +204 -0
  178. package/src/components/TreeSelect/scss/select.scss +166 -0
  179. package/src/constants/events.js +2 -0
  180. package/src/constants/keyCodes.js +8 -0
  181. package/src/directives/outside/outside.js +81 -0
  182. package/src/directives/outside/outside.stories.js +29 -0
  183. package/src/directives/outside/readme.mdx +24 -0
  184. package/src/helpers/generateUID.js +3 -0
  185. package/src/helpers/getHrefFromID.js +3 -0
  186. package/src/helpers/multiLineOverflows.js +3 -0
  187. package/src/helpers/removeEvents.js +9 -0
  188. package/src/index.js +49 -0
  189. package/src/main.js +12 -0
  190. package/src/stories/link.readme.mdx +57 -0
  191. package/src/stories/link.stories.js +59 -0
  192. package/static/Logo.svg +25 -0
  193. package/static/docks/button.pdf +147566 -0
  194. package/vite.config.js +47 -0
@@ -0,0 +1,150 @@
1
+ <template>
2
+ <ul :class="rootClass" @keydown="onKeydown">
3
+ <slot></slot>
4
+ </ul>
5
+ </template>
6
+
7
+ <script>
8
+ import { ARROW_DOWN_KEY_CODE, ARROW_UP_KEY_CODE } from "../constants/keyCodes";
9
+
10
+ export default {
11
+ name: "IbList",
12
+ data() {
13
+ return {
14
+ rootClass: "ib-list",
15
+ };
16
+ },
17
+ methods: {
18
+ onKeydown(e) {
19
+ if (e.keyCode === ARROW_DOWN_KEY_CODE) {
20
+ if (this.$el.parentNode.closest(`.${this.rootClass}`)) return;
21
+
22
+ e.preventDefault();
23
+ const activeElement = document.activeElement;
24
+ const childList = activeElement.querySelector(`.${this.rootClass}`);
25
+
26
+ let nextSibling = activeElement.nextElementSibling
27
+ ? activeElement.nextElementSibling
28
+ : activeElement.parentNode.nextElementSibling?.childNodes[0];
29
+
30
+ if (
31
+ childList &&
32
+ window.getComputedStyle(childList).display !== "none"
33
+ ) {
34
+ childList.querySelector('a, button, input, [tabindex="0"]').focus();
35
+ return;
36
+ }
37
+
38
+ if (nextSibling) {
39
+ nextSibling.focus();
40
+ return;
41
+ }
42
+
43
+ const parentNextItem = activeElement.closest(`.${this.rootClass}`)
44
+ .parentNode?.parentNode?.nextElementSibling.childNodes[0];
45
+
46
+ if (parentNextItem && parentNextItem.nodeName !== "#text") {
47
+ parentNextItem.focus();
48
+ }
49
+ }
50
+
51
+ if (e.keyCode === ARROW_UP_KEY_CODE) {
52
+ if (this.$el.parentNode.closest(`.${this.rootClass}`)) return;
53
+
54
+ e.preventDefault();
55
+ const activeElement = document.activeElement;
56
+ const prevSibling = activeElement.previousElementSibling
57
+ ? activeElement.previousElementSibling
58
+ : activeElement.parentNode.previousElementSibling?.childNodes[0];
59
+
60
+ if (!prevSibling) {
61
+ activeElement.closest(`.${this.rootClass}`).parentNode.focus();
62
+ return;
63
+ }
64
+ if (prevSibling && prevSibling.nodeName !== "#text") {
65
+ const parentNodeList = prevSibling?.querySelector(
66
+ `.${this.rootClass}`
67
+ );
68
+
69
+ if (
70
+ parentNodeList &&
71
+ window.getComputedStyle(parentNodeList).display !== "none"
72
+ ) {
73
+ const items = Array.from(parentNodeList.childNodes).filter(
74
+ (node) => node.nodeName !== "#text"
75
+ );
76
+ items[items.length - 1]?.childNodes[0].focus();
77
+ return;
78
+ }
79
+
80
+ prevSibling.focus();
81
+ }
82
+ }
83
+ },
84
+ },
85
+ };
86
+ </script>
87
+
88
+ <style lang="scss">
89
+ @import "../assets/scss/variables/colors.scss";
90
+
91
+ $item-checked-bg: $gray-100;
92
+ $item-hover-bg: $gray-100;
93
+
94
+ .ib-list {
95
+ padding: 0;
96
+ display: flex;
97
+ flex-direction: column;
98
+ margin: 6.5px 0;
99
+
100
+ .ib-toggle-container {
101
+ padding: 10px 15px 7px;
102
+ transition: background-color 0.3s;
103
+
104
+ &:focus {
105
+ border-radius: 0;
106
+ outline-offset: -2px;
107
+ }
108
+
109
+ &:hover {
110
+ background-color: $item-hover-bg;
111
+ }
112
+
113
+ &.toggle-on {
114
+ background-color: $item-checked-bg;
115
+
116
+ &:hover {
117
+ background-color: $blue-50;
118
+ }
119
+ }
120
+ }
121
+
122
+ .ib-checkbox {
123
+ transition: background-color 0.3s;
124
+
125
+ .ib-checkbox-body {
126
+ padding: 10px 15px 7px;
127
+ width: 100%;
128
+ }
129
+
130
+ &:focus {
131
+ .ib-checkbox-body {
132
+ border-radius: 0;
133
+ outline-offset: -2px;
134
+ }
135
+ }
136
+
137
+ &:hover {
138
+ background-color: $item-hover-bg;
139
+ }
140
+
141
+ &.ib-checkbox-filled {
142
+ background-color: $item-checked-bg;
143
+
144
+ &:hover {
145
+ background-color: $blue-50;
146
+ }
147
+ }
148
+ }
149
+ }
150
+ </style>
@@ -0,0 +1,48 @@
1
+ import IbModal from "./Modal.vue";
2
+ import IbButton from "../Button/Button.vue";
3
+ import IbButtonGroup from "../ButtonGroup/ButtonGroup.vue";
4
+ import readme from "./readme.mdx";
5
+
6
+ export default {
7
+ title: "Modal",
8
+ component: IbModal,
9
+ argTypes: {
10
+ onOpen: { action: "open" },
11
+ onClose: { action: "close" },
12
+ },
13
+ parameters: {
14
+ docs: {
15
+ page: readme,
16
+ },
17
+ },
18
+ };
19
+
20
+ const Template = (args) => ({
21
+ components: { IbModal, IbButton, IbButtonGroup },
22
+ setup() {
23
+ return { args };
24
+ },
25
+ template: `
26
+ <ib-modal v-bind="args">
27
+ <template #trigger>
28
+ <ib-button>Show modal</ib-button>
29
+ </template>
30
+ <template #header>
31
+ Remove
32
+ </template>
33
+ <template #body>
34
+ <p style="font-size: 14px;">
35
+ All data will be lost! Are you sure you want to remove this report?
36
+ </p>
37
+ </template>
38
+ <template #footer>
39
+ <ib-button-group>
40
+ <ib-button kind="ghost">Cancel</ib-button>
41
+ <ib-button kind="danger">Remove report</ib-button>
42
+ </ib-button-group>
43
+ </template>
44
+ </ib-modal>
45
+ `,
46
+ });
47
+
48
+ export const Default = Template.bind({});
@@ -0,0 +1,231 @@
1
+ <template>
2
+ <div
3
+ class="modal-trigger"
4
+ ref="trigger"
5
+ @blur.capture="onTriggerBlur"
6
+ @click="open"
7
+ v-if="hasTrigger"
8
+ >
9
+ <slot name="trigger"></slot>
10
+ </div>
11
+
12
+ <Teleport to="body">
13
+ <div class="modal" :class="classList" v-show="isActive" ref="modal">
14
+ <div class="modal-body" v-outside="clickOutside">
15
+ <ib-icon-button class="modal-close-icon" kind="ghost" @click="close">
16
+ <ib-icon name="close-outline" />
17
+ </ib-icon-button>
18
+
19
+ <p class="modal-header" v-if="hasHeader">
20
+ <slot name="header" :showModal="showModal"></slot>
21
+ </p>
22
+
23
+ <div class="modal-content" :class="{ 'without-title': !hasHeader }">
24
+ <slot name="body" :showModal="showModal"></slot>
25
+ </div>
26
+
27
+ <div class="modal-footer" v-if="hasFooter">
28
+ <slot name="footer" :showModal="showModal"></slot>
29
+ </div>
30
+ </div>
31
+ </div>
32
+ </Teleport>
33
+ </template>
34
+
35
+ <script>
36
+ import IbIconButton from "../IconButton/IconButton.vue";
37
+ import IbIcon from "../Icon.vue";
38
+ import { OutsideDirective as Outside } from "../../directives/outside/outside";
39
+ import { ESC_KEY_CODE, TAB_KEY_CODE } from "../../constants/keyCodes";
40
+
41
+ export default {
42
+ name: "IbModal",
43
+ directives: { Outside },
44
+ props: {
45
+ active: {
46
+ type: Boolean,
47
+ default: false,
48
+ },
49
+ classList: {
50
+ type: String,
51
+ default: "",
52
+ },
53
+ stopPropagation: {
54
+ type: Boolean,
55
+ default: false,
56
+ },
57
+ },
58
+ watch: {
59
+ active(val) {
60
+ this.isActive = val;
61
+ },
62
+ isActive(val) {
63
+ if (val) {
64
+ this.open();
65
+ } else {
66
+ this.close();
67
+ }
68
+ },
69
+ },
70
+ mounted() {
71
+
72
+ console.log(this.classList, 'test')
73
+
74
+ const focusableItems = this.$refs?.modal?.querySelectorAll(
75
+ "[tabindex], a, button, input, select, textarea"
76
+ );
77
+
78
+ focusableItems[0].addEventListener("keydown", (e) => {
79
+ if (e.keyCode === TAB_KEY_CODE && e.shiftKey) {
80
+ e.preventDefault();
81
+ focusableItems[focusableItems.length - 1].focus();
82
+ }
83
+ });
84
+
85
+ focusableItems[focusableItems.length - 1].addEventListener(
86
+ "keydown",
87
+ (e) => {
88
+ if (e.keyCode === TAB_KEY_CODE && !e.shiftKey) {
89
+ e.preventDefault();
90
+ focusableItems[0].focus();
91
+ }
92
+ }
93
+ );
94
+
95
+ document.addEventListener("keydown", (e) => {
96
+ if (e.keyCode === ESC_KEY_CODE && !this.stopPropagation) {
97
+ this.close();
98
+ }
99
+ });
100
+ },
101
+ data() {
102
+ return {
103
+ isActive: this.active,
104
+ };
105
+ },
106
+ methods: {
107
+ showModal(value) {
108
+ if (value) {
109
+ this.open();
110
+ } else {
111
+ this.close();
112
+ }
113
+ },
114
+ onTriggerBlur() {
115
+ this.$refs.modal?.querySelector("a, button, [tabindex]")?.focus();
116
+ },
117
+ open() {
118
+ this.isActive = true;
119
+ document.body.classList.add("modal-open");
120
+ this.$emit("open");
121
+ },
122
+ close() {
123
+ this.isActive = false;
124
+ this.$refs.trigger?.querySelector("a, button, [tabindex]")?.focus();
125
+ document.body.classList.remove("modal-open");
126
+ this.$emit("close");
127
+ },
128
+ clickOutside(e) {
129
+ if (this.stopPropagation) {
130
+ return;
131
+ }
132
+
133
+ if (!this.$refs.trigger?.contains(e.target) && this.isActive) {
134
+ this.close();
135
+ }
136
+ },
137
+ },
138
+ computed: {
139
+ hasTrigger() {
140
+ return !!this.$slots.trigger;
141
+ },
142
+ hasHeader() {
143
+ return !!this.$slots.header;
144
+ },
145
+ hasFooter() {
146
+ return !!this.$slots.footer;
147
+ },
148
+ },
149
+ components: {
150
+ IbIconButton,
151
+ IbIcon,
152
+ },
153
+ beforeUnmount() {
154
+ if (this.isActive) {
155
+ this.close();
156
+ }
157
+ },
158
+ };
159
+ </script>
160
+
161
+ <style lang="scss" scoped>
162
+ @import "../../assets/scss/variables/colors.scss";
163
+ @import "../../assets/scss/variables/shadows.scss";
164
+ @import "../../assets/scss/typography.scss";
165
+
166
+ $backdrop-bg: $black-t20;
167
+ $modal-title-color: $neutral-900;
168
+ $modal-bg: $white;
169
+ $modal-shadow: $ib-shadow-6;
170
+ body.modal-open {
171
+ overflow: hidden;
172
+ }
173
+
174
+ .modal-open .modal {
175
+ overflow-x: hidden;
176
+ overflow-y: auto;
177
+ }
178
+
179
+ .modal {
180
+ -webkit-backdrop-filter: blur(4px);
181
+ backdrop-filter: blur(4px);
182
+ background: $backdrop-bg;
183
+ z-index: 10050;
184
+ position: fixed;
185
+ top: 0;
186
+ left: 0;
187
+ width: 100%;
188
+ height: 100%;
189
+ }
190
+
191
+ .modal-body {
192
+ background-color: $modal-bg;
193
+ padding: 20px;
194
+ top: 50%;
195
+ left: 50%;
196
+ transform: translate(-50%, -50%);
197
+ position: relative;
198
+ width: fit-content;
199
+ min-width: 380px;
200
+ border-radius: 8px;
201
+ max-width: calc(100% - 40px);
202
+ box-shadow: $modal-shadow;
203
+
204
+ .modal-header {
205
+ @include Ib-H2-medium;
206
+ color: $modal-title-color;
207
+ margin-bottom: 15px;
208
+ }
209
+
210
+ .modal-content.without-title {
211
+ padding-right: 25px;
212
+ padding-top: 4px;
213
+ }
214
+
215
+ .modal-close-icon {
216
+ position: absolute;
217
+ top: 20px;
218
+ right: 20px;
219
+
220
+ ion-icon {
221
+ font-size: 20px;
222
+ }
223
+ }
224
+
225
+ .modal-footer {
226
+ margin-top: 20px;
227
+ display: flex;
228
+ justify-content: flex-end;
229
+ }
230
+ }
231
+ </style>
@@ -0,0 +1,76 @@
1
+ # IbModal
2
+
3
+ import { Story, Canvas } from "@storybook/addon-docs";
4
+
5
+ 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
+ ## Overview
8
+
9
+ Modals used to pr
10
+ sent critical information or request user input needed to complete a user’s workflow. Modals interrupt a user’s workflow by design. When active, a user is blocked from the on-page content and cannot return to their previous workflow until the modal task is completed or the user dismisses the modal. While effective when used correctly, modals should be used sparingly to limit disruption to the user.
11
+ Modal dialogs are commonly used for short and non-frequent tasks, such as editing or management tasks. If a user needs to repeatably preform a task, consider making the task do-able from the main page.
12
+
13
+ Modal supports close on ESC, close on backdrop click, and the X close button in the header.
14
+
15
+ ### When to use
16
+
17
+ **Require an immediate response from the user.** Use a dialog to request information that is preventing the system from continuing a user-initiated process.
18
+
19
+ **Notify the user of urgent information.** Use a modal dialog to notify the user of urgent information concerning their current work. Modal dialogs are commonly used to report system errors or convey a consequence of a user’s action.
20
+
21
+ **Confirm a user decision.** Use a modal dialog to confirm user decisions. Clearly describe the action being confirmed and explain any potential consequences that it may cause. Both the title and the button should reflect the action that will occur. If the action is destructive or irreversible then use a transactional danger modal.
22
+
23
+ ### Best practices:
24
+
25
+ - Only display one modal notification at a time.
26
+ - Use modals when you need to immediately interrupt a user’s task.
27
+ - Give users clear steps to resolve and dismiss the notification.
28
+
29
+ ### Sizing
30
+
31
+ Modal container is a flexible component and its sizing depends on specific usecases. Choose a size that works best for the amount of modal content you have. Modals with short messages should use a small modal size to avoid long single lines; for complex components, like data table a large size will be more accommodating.
32
+
33
+ **There is no specific size guides for modals on this design stage of IntelliBoard Next New Design. It can be added in the future.**
34
+
35
+ ### Props
36
+
37
+ | Name | type | Default Value | Description |
38
+ | --------------- | ------- | ------------- | -------------------------------------------------- |
39
+ | isActive | Boolean | false | Controls the visibility of the modal. |
40
+ | classList | String | "" | Classes for modal. |
41
+ | stopPropagation | Boolean | false | Disable modal close on click outside and press ESC |
42
+
43
+ ### Events
44
+
45
+ | Event name | Parameters | Description |
46
+ | ---------- | ---------- | --------------------------------- |
47
+ | open | null | Emitted when the modal is opened. |
48
+ | close | null | Emitted when the modal is closed. |
49
+
50
+ ### Slots
51
+
52
+ | Slot name | Description |
53
+ | --------- | -------------------------------------------------------------------------------------------------------------------- |
54
+ | trigger | Use this slot to insert a trigger button that opens the modal. The trigger button can be placed anywhere in the DOM. |
55
+ | header | Use this slot to insert a title. |
56
+ | body | Use this slot to insert custom body content for the modal. |
57
+ | footer | Use this slot to insert custom footer content for the modal. |
58
+
59
+ ### Content
60
+
61
+ Main elements
62
+
63
+ - **Title.** The title should be brief, using a verb plus noun combination that clearly describes the modal’s task or purpose. For short, direct messages the title can include the whole message to add visual clarity to an otherwise repetitive title and body message. When using this style, no other body copy may be included.
64
+ - **Body.** A modal should include only content relevant to completing the current task.
65
+ - **Footer.** Use descriptive words for the actions such as Add, Delete, and Save. Avoid vague words like Done or OK. For a list of approved action labels. If you need to include a “docs” or other non-primary action, include it as a link in the modal’s body.
66
+
67
+ ### Overflow content
68
+
69
+ When the modal content is longer than the modal height then the body section should scroll vertically with the header and footer remaining fixed in place. The content should visibly fade at the end of the modal body area to indicate there is additional content out of view.
70
+ Modal content should never scroll horizontally; instead, use a larger size modal.
71
+
72
+ ### Default
73
+
74
+ <Canvas>
75
+ <Story id="modal--default" />
76
+ </Canvas>
@@ -0,0 +1,73 @@
1
+ <template>
2
+ <div class="report-limit-selector">
3
+ <ib-label>{{ labelSelect }}</ib-label>
4
+ <ib-select
5
+ class="report-limit-selector-select"
6
+ :value="value"
7
+ :options="prepareOptions"
8
+ :is-multiple="false"
9
+ :show-clear-button="false"
10
+ @input="selectItem"
11
+ />
12
+ </div>
13
+ </template>
14
+
15
+ <script>
16
+ import IbLabel from "../Form/Label/Label.vue";
17
+ import IbSelect from "../TreeSelect/Select.vue";
18
+ export default {
19
+ name: "IbLimitSelector",
20
+ props: {
21
+ labelSelect: {
22
+ type: String,
23
+ required: true,
24
+ },
25
+ value: {
26
+ type: Number,
27
+ },
28
+ options: {
29
+ type: Array,
30
+ default: () => [10, 25, 50, 100],
31
+ },
32
+ },
33
+ watch(val) {
34
+ this.selected = val;
35
+ },
36
+ data() {
37
+ return {
38
+ selected: this.value,
39
+ };
40
+ },
41
+ methods: {
42
+ selectItem(item) {
43
+ this.selected = item;
44
+ this.onChange(item);
45
+ },
46
+ onChange(count) {
47
+ if (Number.isInteger(+count)) {
48
+ this.$emit("select", +count);
49
+ }
50
+ },
51
+ },
52
+ computed: {
53
+ prepareOptions() {
54
+ return this.options.map((item) => {
55
+ return { id: item, title: item };
56
+ });
57
+ },
58
+ },
59
+ components: {
60
+ IbLabel,
61
+ IbSelect,
62
+ },
63
+ };
64
+ </script>
65
+ <style lang="scss">
66
+ .report-limit-selector {
67
+ .report-limit-selector-select {
68
+ .tree-choice {
69
+ width: auto;
70
+ }
71
+ }
72
+ }
73
+ </style>
@@ -0,0 +1,54 @@
1
+ import IbPagination from "./Pagination.vue";
2
+ import IbLimitSelector from "./LimitSelector.vue";
3
+
4
+ export default {
5
+ title: "Pagination",
6
+ component: IbPagination, IbLimitSelector,
7
+ parameters: {
8
+ docs: {
9
+ description: {
10
+ component:
11
+ "Pagination has component LimitSelector, and have callback @select and @select-limit to change page with rows",
12
+ },
13
+ },
14
+ },
15
+ argTypes: {
16
+ limitSelector: {
17
+ control: { type: "select" },
18
+ options: [10, 25, 50, 100],
19
+ },
20
+ },
21
+ };
22
+
23
+ const Template = (args) => ({
24
+ components: { IbPagination },
25
+ setup() {
26
+ return { args };
27
+ },
28
+ template: '<ib-pagination v-bind="args" />',
29
+ });
30
+
31
+ export const Default = Template.bind({});
32
+
33
+ Default.args = {
34
+ current: 1,
35
+ countRows: 222,
36
+ limitSelector: 25,
37
+ labelInput: "Go to:",
38
+ labelSelect: "Rows per page:",
39
+ };
40
+
41
+ const LimitTemplate = (args) => ({
42
+ components: { IbLimitSelector },
43
+ setup() {
44
+ return { args };
45
+ },
46
+ template: '<ib-limit-selector v-bind="args" />',
47
+ });
48
+
49
+ export const LimitSelector = LimitTemplate.bind({});
50
+
51
+ LimitSelector.args = {
52
+ value: 25,
53
+ labelSelect: "Rows per page:",
54
+ };