@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.
- package/.babelrc.json +14 -0
- package/.eslintrc.cjs +15 -0
- package/.nvmrc +1 -0
- package/.prettierrc.json +1 -0
- package/.storybook/intelliboardTheme.js +10 -0
- package/.storybook/main.js +25 -0
- package/.storybook/manager.js +7 -0
- package/.storybook/preview-head.html +11 -0
- package/.storybook/preview.js +24 -0
- package/.storybook/scss-loader.scss +6 -0
- package/.storybook/withSource.js +97 -0
- package/README.md +35 -0
- package/dist/favicon.ico +0 -0
- package/dist/index.mjs +19366 -0
- package/dist/index.umd.js +209 -0
- package/dist/style.css +1 -0
- package/index.html +21 -0
- package/package.json +63 -0
- package/public/favicon.ico +0 -0
- package/src/App.vue +37 -0
- package/src/EventEmmiter.js +19 -0
- package/src/assets/scss/mixins/dropdown-list-item.scss +45 -0
- package/src/assets/scss/mixins/tooltip-position.scss +147 -0
- package/src/assets/scss/mixins.scss +21 -0
- package/src/assets/scss/reset.scss +12 -0
- package/src/assets/scss/style.scss +73 -0
- package/src/assets/scss/typography.scss +155 -0
- package/src/assets/scss/variables/colors.scss +115 -0
- package/src/assets/scss/variables/shadows.scss +17 -0
- package/src/components/Accordion/Accordion.scss +94 -0
- package/src/components/Accordion/Accordion.stories.js +41 -0
- package/src/components/Accordion/Accordion.vue +104 -0
- package/src/components/Accordion/readme.mdx +38 -0
- package/src/components/Alert/Alert.stories.js +69 -0
- package/src/components/Alert/Alert.vue +131 -0
- package/src/components/Alert/alert.scss +166 -0
- package/src/components/Alert/constants.js +6 -0
- package/src/components/Alert/readme.mdx +63 -0
- package/src/components/Badge/Badge.stories.js +53 -0
- package/src/components/Badge/Badge.vue +58 -0
- package/src/components/Badge/readme.mdx +38 -0
- package/src/components/Breadcrumbs/Breadcrumbs.vue +98 -0
- package/src/components/Breadcrumbs/breadcrumbs.scss +77 -0
- package/src/components/Breadcrumbs/breadcrumbs.stories.js +37 -0
- package/src/components/Button/Button.stories.js +124 -0
- package/src/components/Button/Button.vue +165 -0
- package/src/components/Button/button.scss +217 -0
- package/src/components/Button/constants.js +8 -0
- package/src/components/Button/readme.mdx +118 -0
- package/src/components/ButtonGroup/ButtonGroup.stories.js +27 -0
- package/src/components/ButtonGroup/ButtonGroup.vue +24 -0
- package/src/components/ButtonGroup/readme.mdx +10 -0
- package/src/components/Dropdown/Dropdown.spec.js +90 -0
- package/src/components/Dropdown/Dropdown.stories.js +48 -0
- package/src/components/Dropdown/Dropdown.vue +313 -0
- package/src/components/Dropdown/DropdownDivider.vue +15 -0
- package/src/components/Dropdown/DropdownItem.vue +59 -0
- package/src/components/Dropdown/DropdownList.stories.js +174 -0
- package/src/components/Dropdown/DropdownList.vue +93 -0
- package/src/components/Dropdown/constants.js +10 -0
- package/src/components/Dropdown/readme.mdx +88 -0
- package/src/components/Form/CharactersCount.vue +55 -0
- package/src/components/Form/Checkbox/Checkbox.scss +226 -0
- package/src/components/Form/Checkbox/Checkbox.stories.js +63 -0
- package/src/components/Form/Checkbox/Checkbox.vue +128 -0
- package/src/components/Form/Checkbox/readme.mdx +69 -0
- package/src/components/Form/CheckboxGroup/CheckboxGroup.stories.js +64 -0
- package/src/components/Form/CheckboxGroup/CheckboxGroup.vue +87 -0
- package/src/components/Form/CheckboxGroup/readme.mdx +56 -0
- package/src/components/Form/DatePicker/DatePicker.scss +479 -0
- package/src/components/Form/DatePicker/DatePicker.stories.js +78 -0
- package/src/components/Form/DatePicker/DatePicker.vue +284 -0
- package/src/components/Form/DatePicker/Icons/chevron-back.js +5 -0
- package/src/components/Form/DatePicker/Icons/chevron-forward.js +5 -0
- package/src/components/Form/DatePicker/readme.mdx +115 -0
- package/src/components/Form/FormGroup/FormGroup.stories.js +48 -0
- package/src/components/Form/FormGroup/FormGroup.vue +61 -0
- package/src/components/Form/FormGroup/FormGroupSet.stories.js +32 -0
- package/src/components/Form/FormGroup/FormGroupSet.vue +75 -0
- package/src/components/Form/Input/Input.stories.js +137 -0
- package/src/components/Form/Input/Input.vue +231 -0
- package/src/components/Form/Input/constants.js +5 -0
- package/src/components/Form/Input/input.scss +133 -0
- package/src/components/Form/Input/readme.mdx +68 -0
- package/src/components/Form/Label/Label.stories.js +29 -0
- package/src/components/Form/Label/Label.vue +87 -0
- package/src/components/Form/Label/readme.mdx +25 -0
- package/src/components/Form/PhoneInput/PhoneInput.stories.js +43 -0
- package/src/components/Form/PhoneInput/PhoneInput.vue +105 -0
- package/src/components/Form/PhoneInput/phoneInput.scss +197 -0
- package/src/components/Form/PhoneInput/readme.mdx +37 -0
- package/src/components/Form/Radio/Radio.stories.js +34 -0
- package/src/components/Form/Radio/Radio.vue +109 -0
- package/src/components/Form/Radio/radio.scss +187 -0
- package/src/components/Form/Radio/readme.mdx +48 -0
- package/src/components/Form/TextEditor/TextEditor.stories.js +58 -0
- package/src/components/Form/TextEditor/TextEditor.vue +305 -0
- package/src/components/Form/TextEditor/icons/svg/chevron-down.svg +3 -0
- package/src/components/Form/TextEditor/icons/toolbarIcons.js +111 -0
- package/src/components/Form/TextEditor/plugins/alphabetList.js +43 -0
- package/src/components/Form/TextEditor/readme.mdx +59 -0
- package/src/components/Form/TextEditor/textEditor.scss +684 -0
- package/src/components/Form/Textarea/Textarea.spec.js +107 -0
- package/src/components/Form/Textarea/Textarea.stories.js +68 -0
- package/src/components/Form/Textarea/Textarea.vue +102 -0
- package/src/components/Form/Textarea/readme.mdx +45 -0
- package/src/components/Form/Textarea/textarea.scss +84 -0
- package/src/components/Form/Toggle/Toggle.stories.js +44 -0
- package/src/components/Form/Toggle/Toggle.vue +122 -0
- package/src/components/Form/Toggle/readme.mdx +39 -0
- package/src/components/Form/Toggle/toggle.scss +166 -0
- package/src/components/Icon.vue +41 -0
- package/src/components/IconButton/IconButton.scss +91 -0
- package/src/components/IconButton/IconButton.stories.js +115 -0
- package/src/components/IconButton/IconButton.vue +100 -0
- package/src/components/IconButton/constants.js +14 -0
- package/src/components/IconButton/readme.mdx +66 -0
- package/src/components/List.vue +150 -0
- package/src/components/Modal/Modal.stories.js +48 -0
- package/src/components/Modal/Modal.vue +231 -0
- package/src/components/Modal/readme.mdx +76 -0
- package/src/components/Pagination/LimitSelector.vue +73 -0
- package/src/components/Pagination/Pagination.stories.js +54 -0
- package/src/components/Pagination/Pagination.vue +227 -0
- package/src/components/Pagination/pagination.scss +189 -0
- package/src/components/Popover/Popover.stories.js +46 -0
- package/src/components/Popover/Popover.vue +81 -0
- package/src/components/Popover/constants.js +14 -0
- package/src/components/Popover/popover.scss +26 -0
- package/src/components/Popover/readme.mdx +42 -0
- package/src/components/ProgressBar/ProgressBar.stories.js +90 -0
- package/src/components/ProgressBar/ProgressBar.vue +58 -0
- package/src/components/ProgressBar/constants.js +6 -0
- package/src/components/ProgressBar/progressBar.scss +116 -0
- package/src/components/ProgressBar/readme.mdx +67 -0
- package/src/components/Sorting/Sorting.stories.js +35 -0
- package/src/components/Sorting/Sorting.vue +128 -0
- package/src/components/Sorting/constants.js +10 -0
- package/src/components/Sorting/sorting.scss +87 -0
- package/src/components/SplitButton/SplitButton.stories.js +39 -0
- package/src/components/SplitButton/SplitButton.vue +132 -0
- package/src/components/SplitButton/SplitButtonItem.vue +34 -0
- package/src/components/SplitButton/constants.js +4 -0
- package/src/components/SplitButton/readme.mdx +77 -0
- package/src/components/SplitButton/splitButton.scss +161 -0
- package/src/components/StatusIndicator/StatusIndicator.stories.js +40 -0
- package/src/components/StatusIndicator/StatusIndicator.vue +52 -0
- package/src/components/StatusIndicator/constants.js +10 -0
- package/src/components/StatusIndicator/icons.js +48 -0
- package/src/components/StatusIndicator/readme.mdx +21 -0
- package/src/components/Table/Cells/Cell.vue +71 -0
- package/src/components/Table/Cells/CheckboxCell.vue +48 -0
- package/src/components/Table/Row.vue +26 -0
- package/src/components/Table/Table.stories.js +59 -0
- package/src/components/Table/Table.vue +36 -0
- package/src/components/Tabs/Tab.vue +37 -0
- package/src/components/Tabs/TabDropdown.vue +93 -0
- package/src/components/Tabs/Tabs.stories.js +57 -0
- package/src/components/Tabs/Tabs.vue +94 -0
- package/src/components/Tabs/tabs.scss +157 -0
- package/src/components/TagPill/TagPill.stories.js +30 -0
- package/src/components/TagPill/TagPill.vue +133 -0
- package/src/components/TagPill/constants.js +9 -0
- package/src/components/TagPill/readme.mdx +37 -0
- package/src/components/ToggleTip/ToggleTip.stories.js +98 -0
- package/src/components/ToggleTip/ToggleTip.vue +112 -0
- package/src/components/ToggleTip/constants.js +14 -0
- package/src/components/ToggleTip/readme.mdx +46 -0
- package/src/components/ToggleTip/toggleTip.scss +55 -0
- package/src/components/Tooltip/Tooltip.stories.js +56 -0
- package/src/components/Tooltip/Tooltip.vue +49 -0
- package/src/components/Tooltip/readme.mdx +43 -0
- package/src/components/TreeSelect/Option.vue +325 -0
- package/src/components/TreeSelect/Select.stories.js +349 -0
- package/src/components/TreeSelect/Select.vue +909 -0
- package/src/components/TreeSelect/TreeSelect.stories.js +270 -0
- package/src/components/TreeSelect/scss/option.scss +204 -0
- package/src/components/TreeSelect/scss/select.scss +166 -0
- package/src/constants/events.js +2 -0
- package/src/constants/keyCodes.js +8 -0
- package/src/directives/outside/outside.js +81 -0
- package/src/directives/outside/outside.stories.js +29 -0
- package/src/directives/outside/readme.mdx +24 -0
- package/src/helpers/generateUID.js +3 -0
- package/src/helpers/getHrefFromID.js +3 -0
- package/src/helpers/multiLineOverflows.js +3 -0
- package/src/helpers/removeEvents.js +9 -0
- package/src/index.js +49 -0
- package/src/main.js +12 -0
- package/src/stories/link.readme.mdx +57 -0
- package/src/stories/link.stories.js +59 -0
- package/static/Logo.svg +25 -0
- package/static/docks/button.pdf +147566 -0
- package/vite.config.js +47 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# IbAlert
|
|
2
|
+
|
|
3
|
+
import { Story, Canvas } from "@storybook/addon-docs";
|
|
4
|
+
import * as AlertStories from "./Alert.stories";
|
|
5
|
+
|
|
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.
|
|
7
|
+
|
|
8
|
+
Notifications provide limited space for content, and therefore the content must be short and concise. A user should be able to quickly scan the notification, be apprised of the situation, and know what to do next.
|
|
9
|
+
|
|
10
|
+
#### Title
|
|
11
|
+
|
|
12
|
+
- The title type format should use the Title Case.
|
|
13
|
+
- The title should be short and descriptive, explaining the most important piece of information.
|
|
14
|
+
- When possible, communicate the main message using just the title.
|
|
15
|
+
- Use a period only if the title is a full sentence.
|
|
16
|
+
- When using rich text, such as in a title, a screen reader will read aloud the entire message as one sentence. Since the message will be read as one string, make sure that any text styling does not convey meaning.
|
|
17
|
+
|
|
18
|
+
#### Body content
|
|
19
|
+
|
|
20
|
+
- Be concise and avoid repeating or paraphrasing the title.
|
|
21
|
+
- Limit content to one or two short sentences.
|
|
22
|
+
- Explain how to resolve the issue by including any troubleshooting actions or next steps. You can include links within the notification body that redirect the user to next steps by using an actionable notification.
|
|
23
|
+
|
|
24
|
+
#### Action (actionable only)
|
|
25
|
+
|
|
26
|
+
- Only actionable notifications can contain interactive elements such as a
|
|
27
|
+
link or button.
|
|
28
|
+
- Keep labels concise and clearly indicate the action the user can take.
|
|
29
|
+
|
|
30
|
+
Limit action labels to one or two words. For a list of recommended action labels, see Carbon’s content guidelines.
|
|
31
|
+
|
|
32
|
+
### Props
|
|
33
|
+
|
|
34
|
+
| Name | type | Default Value | Required | Description |
|
|
35
|
+
| --------------- | ------- | ------------- | -------- | --------------------------------------------------------------------------- |
|
|
36
|
+
| type | String | "alert" | No | The type of alert to be displayed. It can be "alert", "success", or "info". |
|
|
37
|
+
| showIcon | Boolean | false | No | Determines whether to display an icon with the alert message. |
|
|
38
|
+
| showCloseButton | Boolean | false | No | Determines whether to display a close button with the alert message. |
|
|
39
|
+
| title | String | "" | No | The title of the alert message. |
|
|
40
|
+
|
|
41
|
+
### Slots
|
|
42
|
+
|
|
43
|
+
| Slot name | Description |
|
|
44
|
+
| --------- | ------------------------------------------------------------------ |
|
|
45
|
+
| link | The link slot can be used to display a link with the alert message |
|
|
46
|
+
| default | default slot is used to display the text of the alert message. |
|
|
47
|
+
|
|
48
|
+
### Events
|
|
49
|
+
|
|
50
|
+
| Events name | Description |
|
|
51
|
+
| ----------- | ------------------------------------------------ |
|
|
52
|
+
| Close | Emits when the close button is clicked on alert. |
|
|
53
|
+
|
|
54
|
+
### Default
|
|
55
|
+
<Canvas of={AlertStories.Default} />
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
### All alert types
|
|
59
|
+
<Canvas of={AlertStories.Types} />
|
|
60
|
+
|
|
61
|
+
### Alert when we have large content and link
|
|
62
|
+
<Canvas of={AlertStories.LargeAlert} />
|
|
63
|
+
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import ibBadge from "./Badge.vue";
|
|
2
|
+
import IbIconButton from "../IconButton/IconButton.vue";
|
|
3
|
+
import readme from "./readme.mdx";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: "Badge",
|
|
7
|
+
component: ibBadge,
|
|
8
|
+
parameters: {
|
|
9
|
+
docs: {
|
|
10
|
+
page: readme,
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const Template = (args) => ({
|
|
16
|
+
components: { ibBadge, IbIconButton },
|
|
17
|
+
setup() {
|
|
18
|
+
return { args };
|
|
19
|
+
},
|
|
20
|
+
template: `
|
|
21
|
+
<div style="position: relative; width: fit-content;">
|
|
22
|
+
<ib-badge style="position: absolute; top: -2px; right: -2px;" v-bind="args"></ib-badge>
|
|
23
|
+
|
|
24
|
+
<ib-icon-button kind="ghost">
|
|
25
|
+
<ion-icon style="font-size=20px" name="add"></ion-icon>
|
|
26
|
+
</ib-icon-button>
|
|
27
|
+
</div>
|
|
28
|
+
`,
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const TemplateLarge = (args) => ({
|
|
32
|
+
components: { ibBadge, IbIconButton },
|
|
33
|
+
setup() {
|
|
34
|
+
return { args };
|
|
35
|
+
},
|
|
36
|
+
template: `
|
|
37
|
+
<div style="position: relative; width: fit-content;">
|
|
38
|
+
<ib-badge style="position: absolute; top: -7px; left: 16px;" v-bind="args"></ib-badge>
|
|
39
|
+
|
|
40
|
+
<ib-icon-button kind="ghost">
|
|
41
|
+
<ion-icon style="font-size=20px" name="add"></ion-icon>
|
|
42
|
+
</ib-icon-button>
|
|
43
|
+
</div>
|
|
44
|
+
`,
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
export const Default = Template.bind({});
|
|
48
|
+
Default.args = {};
|
|
49
|
+
|
|
50
|
+
export const Large = TemplateLarge.bind({});
|
|
51
|
+
Large.args = {
|
|
52
|
+
content: 10000,
|
|
53
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<span :class="classes">
|
|
3
|
+
{{ normalizeContent }}
|
|
4
|
+
</span>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
export default {
|
|
9
|
+
name: "IbBadge",
|
|
10
|
+
props: {
|
|
11
|
+
content: {
|
|
12
|
+
type: [String, Number],
|
|
13
|
+
default: "",
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
computed: {
|
|
17
|
+
classes() {
|
|
18
|
+
const classList = ["ib-badge"];
|
|
19
|
+
|
|
20
|
+
if (this.content.toString().length) {
|
|
21
|
+
classList.push("ib-badge-large");
|
|
22
|
+
}
|
|
23
|
+
return classList;
|
|
24
|
+
},
|
|
25
|
+
normalizeContent() {
|
|
26
|
+
if (typeof this.content === "number" && this.content > 99) {
|
|
27
|
+
return "99+";
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return this.content;
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<style lang="scss" scoped>
|
|
37
|
+
@import "../../assets/scss/typography.scss";
|
|
38
|
+
@import "../../assets/scss/variables/colors.scss";
|
|
39
|
+
|
|
40
|
+
$badge-bg: $blue-800;
|
|
41
|
+
$badge-color: $white;
|
|
42
|
+
|
|
43
|
+
.ib-badge {
|
|
44
|
+
width: 8px;
|
|
45
|
+
height: 8px;
|
|
46
|
+
background-color: $badge-bg;
|
|
47
|
+
border-radius: 100%;
|
|
48
|
+
color: $badge-color;
|
|
49
|
+
|
|
50
|
+
&-large {
|
|
51
|
+
@include Ib-H6-regular;
|
|
52
|
+
width: auto;
|
|
53
|
+
height: auto;
|
|
54
|
+
border-radius: 6px;
|
|
55
|
+
padding: 0 4px 1px;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
</style>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# IbBadge
|
|
2
|
+
|
|
3
|
+
import { Story, Canvas } from "@storybook/addon-docs";
|
|
4
|
+
|
|
5
|
+
The `IbBadge` component is a small component used to display a notification badge with a count or indicator on a parent component.
|
|
6
|
+
### Usage
|
|
7
|
+
* Use badges with items to convey dynamic information associated with that destination
|
|
8
|
+
* Small badges use only shape to indicate a status change or new notification
|
|
9
|
+
* Large badges display numbers within a container to indicate a quantifiable status change
|
|
10
|
+
|
|
11
|
+
#### There are 2 types of badges:
|
|
12
|
+
1. **Small badge.** Simple dot, used to indicate an unread notification.
|
|
13
|
+
2. **Large badge.** contains label text communicating item count information.
|
|
14
|
+
|
|
15
|
+
#### **Large Badge Sizing**
|
|
16
|
+
Label large badges with counts or a status. The maximum number of characters within large badge label text is tree, including a + to indicate more.
|
|
17
|
+
|
|
18
|
+
### Props
|
|
19
|
+
| Name | type | Default Value | Description |
|
|
20
|
+
| ------- | ---------------- | ------------- | --------------------------------------------------------------------------------------------------------------------- |
|
|
21
|
+
| Content | String or Number | `""` | The content to display within the badge. If a number greater than 99 is passed, the badge will display "99+" instead. |
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Slots
|
|
25
|
+
The IbBadge component does not have any slots.
|
|
26
|
+
|
|
27
|
+
### Events
|
|
28
|
+
The IbBadge component does not emit any events.
|
|
29
|
+
|
|
30
|
+
### Default
|
|
31
|
+
<Canvas>
|
|
32
|
+
<Story id="badge--default"/>
|
|
33
|
+
</Canvas>
|
|
34
|
+
|
|
35
|
+
### Large
|
|
36
|
+
<Canvas>
|
|
37
|
+
<Story id="badge--large"/>
|
|
38
|
+
</Canvas>
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<nav aria-label="breadcrumb">
|
|
3
|
+
<ul class="breadcrumb">
|
|
4
|
+
<li
|
|
5
|
+
class="breadcrumb-item"
|
|
6
|
+
:class="index === last ? 'active' : ''"
|
|
7
|
+
aria-current="page"
|
|
8
|
+
v-for="(item, index) in items"
|
|
9
|
+
:key="index"
|
|
10
|
+
>
|
|
11
|
+
<a
|
|
12
|
+
class="ib-link"
|
|
13
|
+
:href="item.url"
|
|
14
|
+
v-if="(index !== last && index > items.length - 4) || index === 0"
|
|
15
|
+
>
|
|
16
|
+
{{ item.title }}
|
|
17
|
+
</a>
|
|
18
|
+
|
|
19
|
+
<p v-if="index === last">
|
|
20
|
+
{{ item.title }}
|
|
21
|
+
</p>
|
|
22
|
+
|
|
23
|
+
<ib-dropdown-list
|
|
24
|
+
horizontal="center"
|
|
25
|
+
v-if="initContextMenu && index === items.length - 4"
|
|
26
|
+
>
|
|
27
|
+
<template #trigger>
|
|
28
|
+
<ib-icon-button kind="ghost">
|
|
29
|
+
<ib-icon name="ellipsis-horizontal-sharp" />
|
|
30
|
+
<ib-tooltip v-if="tooltipTextContext" :text="tooltipTextContext">
|
|
31
|
+
</ib-tooltip>
|
|
32
|
+
</ib-icon-button>
|
|
33
|
+
</template>
|
|
34
|
+
|
|
35
|
+
<template #body>
|
|
36
|
+
<ib-dropdown-item
|
|
37
|
+
v-for="(item, index) in setItemsContextMenu"
|
|
38
|
+
:key="index"
|
|
39
|
+
>
|
|
40
|
+
<a class="context-breadcrums" :href="item.url">
|
|
41
|
+
{{ item.title }}
|
|
42
|
+
</a>
|
|
43
|
+
</ib-dropdown-item>
|
|
44
|
+
</template>
|
|
45
|
+
</ib-dropdown-list>
|
|
46
|
+
|
|
47
|
+
<ib-icon
|
|
48
|
+
v-if="(index !== last && index > items.length - 5) || index === 0"
|
|
49
|
+
name="chevron-forward-outline"
|
|
50
|
+
/>
|
|
51
|
+
</li>
|
|
52
|
+
</ul>
|
|
53
|
+
</nav>
|
|
54
|
+
</template>
|
|
55
|
+
|
|
56
|
+
<script>
|
|
57
|
+
import IbIcon from "../Icon.vue";
|
|
58
|
+
import IbIconButton from "../IconButton/IconButton.vue";
|
|
59
|
+
import IbDropdownList from "../Dropdown/DropdownList.vue";
|
|
60
|
+
import IbDropdownItem from "../Dropdown/DropdownItem.vue";
|
|
61
|
+
import IbTooltip from "../Tooltip/Tooltip.vue";
|
|
62
|
+
|
|
63
|
+
export default {
|
|
64
|
+
name: "IbBreadcrumbs",
|
|
65
|
+
props: {
|
|
66
|
+
items: {
|
|
67
|
+
type: Array,
|
|
68
|
+
default: () => [],
|
|
69
|
+
},
|
|
70
|
+
tooltipTextContext: {
|
|
71
|
+
type: String,
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
computed: {
|
|
75
|
+
last() {
|
|
76
|
+
return this.items.length ? this.items.length - 1 : null;
|
|
77
|
+
},
|
|
78
|
+
initContextMenu() {
|
|
79
|
+
return this.items.length > 4 ? true : false;
|
|
80
|
+
},
|
|
81
|
+
setItemsContextMenu() {
|
|
82
|
+
let items = this.items.slice(0, -3);
|
|
83
|
+
return items;
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
components: {
|
|
87
|
+
IbIcon,
|
|
88
|
+
IbIconButton,
|
|
89
|
+
IbDropdownItem,
|
|
90
|
+
IbDropdownList,
|
|
91
|
+
IbTooltip,
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
</script>
|
|
95
|
+
|
|
96
|
+
<style scoped lang="scss">
|
|
97
|
+
@import "./breadcrumbs.scss";
|
|
98
|
+
</style>
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
@import "../../assets/scss/variables/colors.scss";
|
|
2
|
+
@import "../../assets/scss/typography.scss";
|
|
3
|
+
@import "../../assets/scss/mixins.scss";
|
|
4
|
+
@import "../../assets/scss/reset.scss";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
.breadcrumb {
|
|
8
|
+
margin: 0;
|
|
9
|
+
padding: 0;
|
|
10
|
+
list-style: none;
|
|
11
|
+
display: flex;
|
|
12
|
+
|
|
13
|
+
.context-breadcrums {
|
|
14
|
+
@include Ib-H4-medium;
|
|
15
|
+
text-decoration: none;
|
|
16
|
+
color: $neutral-900;
|
|
17
|
+
|
|
18
|
+
&:hover {
|
|
19
|
+
text-decoration: none;
|
|
20
|
+
color: $neutral-900;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.breadcrumb-item{
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
height: 36px;
|
|
28
|
+
display: flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
a {
|
|
33
|
+
text-decoration: none;
|
|
34
|
+
color: $neutral-900;
|
|
35
|
+
height: inherit;
|
|
36
|
+
display: flex;
|
|
37
|
+
align-items: center;
|
|
38
|
+
white-space: nowrap;
|
|
39
|
+
@include Ib-H4-medium;
|
|
40
|
+
|
|
41
|
+
&:hover {
|
|
42
|
+
text-decoration: none;
|
|
43
|
+
color: $blue-700;
|
|
44
|
+
text-decoration: underline $blue-700;
|
|
45
|
+
text-underline-offset: 4px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&:active {
|
|
49
|
+
color: $blue-900;
|
|
50
|
+
text-decoration: underline $blue-900;
|
|
51
|
+
text-underline-offset: 4px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&:focus {
|
|
55
|
+
@include focus(2px);
|
|
56
|
+
border-radius: 4px;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&>ion-icon {
|
|
61
|
+
color: $gray-600;
|
|
62
|
+
font-size: 12px;
|
|
63
|
+
padding: 0 5px;
|
|
64
|
+
padding-top: 3px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
p {
|
|
68
|
+
color: $gray-600;
|
|
69
|
+
@include Ib-H4-regular;
|
|
70
|
+
@include lineClamp(1);
|
|
71
|
+
|
|
72
|
+
&:hover {
|
|
73
|
+
cursor: not-allowed;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import IbBreadcrumbs from "./Breadcrumbs.vue";
|
|
2
|
+
export default {
|
|
3
|
+
title: "Breadcrumbs",
|
|
4
|
+
component: IbBreadcrumbs,
|
|
5
|
+
};
|
|
6
|
+
const Template = (args) => ({
|
|
7
|
+
components: { IbBreadcrumbs },
|
|
8
|
+
setup() {
|
|
9
|
+
return { args };
|
|
10
|
+
},
|
|
11
|
+
template: '<ib-breadcrumbs v-bind="args" />',
|
|
12
|
+
});
|
|
13
|
+
export const Default = Template.bind({});
|
|
14
|
+
Default.args = {
|
|
15
|
+
items: [
|
|
16
|
+
{
|
|
17
|
+
title: "Page 1",
|
|
18
|
+
url: "first URL",
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
title: "Page 2",
|
|
22
|
+
url: "second URL",
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
title: "Page 3",
|
|
26
|
+
url: "Third URL",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
title: "Page 4",
|
|
30
|
+
url: "Fourth URL",
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
title: "Page 5",
|
|
34
|
+
url: "Fifth URL",
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
};
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import IbButton from "./Button.vue";
|
|
2
|
+
import { buttonKindOptions } from "./constants";
|
|
3
|
+
import readme from "./readme.mdx";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: "Button",
|
|
7
|
+
component: IbButton,
|
|
8
|
+
argTypes: {
|
|
9
|
+
onClick: { action: "click" },
|
|
10
|
+
kind: {
|
|
11
|
+
control: { type: "select" },
|
|
12
|
+
options: Object.values(buttonKindOptions),
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
parameters: {
|
|
16
|
+
docs: {
|
|
17
|
+
page: readme,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const Template = (args) => ({
|
|
23
|
+
components: { IbButton },
|
|
24
|
+
setup() {
|
|
25
|
+
return { args };
|
|
26
|
+
},
|
|
27
|
+
template: '<ib-button v-bind="args">Button</ib-button>',
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const IconTemplate = (args) => ({
|
|
31
|
+
components: { IbButton },
|
|
32
|
+
setup() {
|
|
33
|
+
return { args };
|
|
34
|
+
},
|
|
35
|
+
template: `
|
|
36
|
+
<ib-button v-bind="args">
|
|
37
|
+
<template #icon>
|
|
38
|
+
<ion-icon name="add"></ion-icon>
|
|
39
|
+
</template>
|
|
40
|
+
Button
|
|
41
|
+
</ib-button>`,
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
const KindsTemplate = (args) => ({
|
|
45
|
+
components: { IbButton },
|
|
46
|
+
setup() {
|
|
47
|
+
return { args };
|
|
48
|
+
},
|
|
49
|
+
template: `
|
|
50
|
+
<ib-button style="margin-right: 5px;" kind="primary">
|
|
51
|
+
Primary
|
|
52
|
+
</ib-button>
|
|
53
|
+
|
|
54
|
+
<ib-button style="margin-right: 5px;" kind="secondary">
|
|
55
|
+
Secondary
|
|
56
|
+
</ib-button>
|
|
57
|
+
|
|
58
|
+
<ib-button style="margin-right: 5px;" kind="tertiary">
|
|
59
|
+
Tertiary
|
|
60
|
+
</ib-button>
|
|
61
|
+
|
|
62
|
+
<ib-button style="margin-right: 5px;" kind="ghost">
|
|
63
|
+
Ghost
|
|
64
|
+
</ib-button>
|
|
65
|
+
|
|
66
|
+
<ib-button style="margin-right: 5px;" kind="danger">
|
|
67
|
+
Danger
|
|
68
|
+
</ib-button>
|
|
69
|
+
|
|
70
|
+
<ib-button style="margin-right: 5px;" kind="ghostDanger">
|
|
71
|
+
Ghost Danger
|
|
72
|
+
</ib-button>
|
|
73
|
+
`,
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
export const Default = Template.bind({});
|
|
77
|
+
Default.args = {};
|
|
78
|
+
|
|
79
|
+
export const Secondary = Template.bind({});
|
|
80
|
+
Secondary.args = {
|
|
81
|
+
kind: "secondary",
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export const Tertiary = Template.bind({});
|
|
85
|
+
Tertiary.args = {
|
|
86
|
+
kind: "tertiary",
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export const Ghost = Template.bind({});
|
|
90
|
+
Ghost.args = {
|
|
91
|
+
kind: "ghost",
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export const Danger = Template.bind({});
|
|
95
|
+
Danger.args = {
|
|
96
|
+
kind: "danger",
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
export const DangerGhost = Template.bind({});
|
|
100
|
+
DangerGhost.args = {
|
|
101
|
+
kind: "ghostDanger",
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export const Block = Template.bind({});
|
|
105
|
+
Block.args = {
|
|
106
|
+
block: true,
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export const Disabled = Template.bind({});
|
|
110
|
+
Disabled.args = {
|
|
111
|
+
disabled: true,
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
export const ButtonWithIcon = IconTemplate.bind({});
|
|
115
|
+
ButtonWithIcon.args = {};
|
|
116
|
+
|
|
117
|
+
export const Kinds = KindsTemplate.bind({});
|
|
118
|
+
Kinds.args = {};
|
|
119
|
+
Kinds.decorators = [
|
|
120
|
+
() => ({
|
|
121
|
+
template:
|
|
122
|
+
'<div style="padding:20px; display: flex; flex: wrap: wrap; justify-content: space-between"><story /></div>',
|
|
123
|
+
}),
|
|
124
|
+
];
|