@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,87 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="ib-checkbox-group"
|
|
4
|
+
:class="{ 'ib-checkbox-group-horizontal': horizontal }"
|
|
5
|
+
>
|
|
6
|
+
<ib-label
|
|
7
|
+
v-if="labelText.length"
|
|
8
|
+
class="ib-checkbox-group-label"
|
|
9
|
+
:required="required"
|
|
10
|
+
>
|
|
11
|
+
{{ labelText }}
|
|
12
|
+
</ib-label>
|
|
13
|
+
|
|
14
|
+
<ib-alert v-if="errorMessage.length" class="ib-error-message">
|
|
15
|
+
{{ errorMessage }}
|
|
16
|
+
</ib-alert>
|
|
17
|
+
|
|
18
|
+
<div class="ib-checkbox-group-content">
|
|
19
|
+
<slot></slot>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<script>
|
|
25
|
+
import IbLabel from "../Label/Label.vue";
|
|
26
|
+
import IbAlert from "../../Alert/Alert.vue";
|
|
27
|
+
|
|
28
|
+
export default {
|
|
29
|
+
name: "IbInputGroup",
|
|
30
|
+
props: {
|
|
31
|
+
labelText: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: "",
|
|
34
|
+
},
|
|
35
|
+
required: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
required: false,
|
|
38
|
+
},
|
|
39
|
+
horizontal: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: false,
|
|
42
|
+
},
|
|
43
|
+
errorMessage: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: "",
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
components: {
|
|
49
|
+
IbLabel,
|
|
50
|
+
IbAlert,
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
</script>
|
|
54
|
+
|
|
55
|
+
<style lang="scss">
|
|
56
|
+
.ib-checkbox-group {
|
|
57
|
+
.ib-checkbox-group-label {
|
|
58
|
+
display: block;
|
|
59
|
+
margin-bottom: 10px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.ib-checkbox-group-content {
|
|
63
|
+
display: flex;
|
|
64
|
+
flex-direction: column;
|
|
65
|
+
.ib-radio:not(:last-child),
|
|
66
|
+
.ib-checkbox:not(:last-child) {
|
|
67
|
+
margin-bottom: 10px;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.ib-error-message {
|
|
72
|
+
margin-bottom: 5px;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&.ib-checkbox-group-horizontal {
|
|
76
|
+
.ib-checkbox-group-content {
|
|
77
|
+
flex-direction: row;
|
|
78
|
+
|
|
79
|
+
.ib-radio:not(:last-child),
|
|
80
|
+
.ib-checkbox:not(:last-child) {
|
|
81
|
+
margin-bottom: 0;
|
|
82
|
+
margin-right: 25px;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
</style>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# IbCheckboxGroup
|
|
2
|
+
|
|
3
|
+
import { Story, Canvas } from "@storybook/addon-docs";
|
|
4
|
+
|
|
5
|
+
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
|
+
## Default
|
|
8
|
+
|
|
9
|
+
<Canvas>
|
|
10
|
+
<Story id="form-checkbox-group--default" />
|
|
11
|
+
</Canvas>
|
|
12
|
+
|
|
13
|
+
### Props
|
|
14
|
+
|
|
15
|
+
| Prop name | Type | Default | Description |
|
|
16
|
+
| ------------ | ------- | ------- | ----------------------------------------------------------------------- |
|
|
17
|
+
| labelText | String | '' | The text that will be displayed as the label for the checkbox group |
|
|
18
|
+
| required | Boolean | false | If true, a required indicator will be displayed next to the label |
|
|
19
|
+
| horizontal | Boolean | false | If true, the checkboxes or radio buttons will be displayed horizontally |
|
|
20
|
+
| errorMessage | String | '' | Responsible for displaying an error |
|
|
21
|
+
|
|
22
|
+
### Slots
|
|
23
|
+
|
|
24
|
+
| Slot name | Description |
|
|
25
|
+
| --------- | ----------------------------------------------------------------- |
|
|
26
|
+
| default | The slot where the checkboxes or radio buttons will be displayed. |
|
|
27
|
+
|
|
28
|
+
### Events
|
|
29
|
+
|
|
30
|
+
This component does not emit any events.
|
|
31
|
+
|
|
32
|
+
### Aligmens
|
|
33
|
+
|
|
34
|
+
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
|
+
|
|
36
|
+
- #### Vertical
|
|
37
|
+
|
|
38
|
+
<Canvas>
|
|
39
|
+
<Story id="form-checkbox-group--default" />
|
|
40
|
+
</Canvas>
|
|
41
|
+
|
|
42
|
+
- #### Horizontal
|
|
43
|
+
<Canvas>
|
|
44
|
+
<Story id="form-checkbox-group--horizontal-alignment" />
|
|
45
|
+
</Canvas>
|
|
46
|
+
|
|
47
|
+
### Use radio
|
|
48
|
+
|
|
49
|
+
<Canvas>
|
|
50
|
+
<Story id="form-checkbox-group--radio-group" />
|
|
51
|
+
</Canvas>
|
|
52
|
+
|
|
53
|
+
### Has error
|
|
54
|
+
<Canvas>
|
|
55
|
+
<Story id="form-checkbox-group--checkbox-group-error" />
|
|
56
|
+
</Canvas>
|
|
@@ -0,0 +1,479 @@
|
|
|
1
|
+
@import "../../../assets/scss/mixins.scss";
|
|
2
|
+
@import "../../../assets/scss/typography.scss";
|
|
3
|
+
@import "../../../assets/scss/variables/colors.scss";
|
|
4
|
+
@import "../../../assets/scss/variables/shadows.scss";
|
|
5
|
+
|
|
6
|
+
$datepicker-shadow: $ib-shadow-3;
|
|
7
|
+
$datepicker-bg: $white;
|
|
8
|
+
|
|
9
|
+
// Prev/Next month buttons
|
|
10
|
+
$ghost-btn-background: transparent;
|
|
11
|
+
$ghost-btn-hover-background: $blue-100;
|
|
12
|
+
$ghost-btn-color: $neutral-900;
|
|
13
|
+
$ghost-btn-hover-color: $blue-700;
|
|
14
|
+
$ghost-btn-disabled-background: transparent;
|
|
15
|
+
$ghost-btn-active-background: $blue-50;
|
|
16
|
+
$ghost-btn-active-color: $blue-900;
|
|
17
|
+
$ghost-btn-hover-border-color: $blue-300;
|
|
18
|
+
|
|
19
|
+
// Week day
|
|
20
|
+
$weekday-color: $gray-600;
|
|
21
|
+
|
|
22
|
+
// Day of the week
|
|
23
|
+
$day-prev-next-color: $gray-600;
|
|
24
|
+
$day-color: $neutral-900;
|
|
25
|
+
$day-border: transparent;
|
|
26
|
+
$day-hover-color: $blue-700;
|
|
27
|
+
$day-hover-border-color: $blue-700;
|
|
28
|
+
$day-hover-bg: $blue-100;
|
|
29
|
+
$day-selected-color: $blue-900;
|
|
30
|
+
$day-selected-bg: $blue-200;
|
|
31
|
+
$day-selected-in-range: $gray-100;
|
|
32
|
+
$day-start-end-range-color: $blue-900;
|
|
33
|
+
$day-start-end-range-bg: $blue-200;
|
|
34
|
+
$day-today-color: $white;
|
|
35
|
+
$day-today-bg: $blue-800;
|
|
36
|
+
// Input
|
|
37
|
+
$input-bg: $gray-100;
|
|
38
|
+
$input-color: $neutral-900;
|
|
39
|
+
$input-border-color: $gray-500;
|
|
40
|
+
$input-placeholder-color: $neutral-900;
|
|
41
|
+
$input-disabled-color: $neutral-500;
|
|
42
|
+
$input-disabled-bg: $gray-100;
|
|
43
|
+
$input-disabled-border-color: $neutral-500;
|
|
44
|
+
$input-disabled-placeholder-color: $neutral-500;
|
|
45
|
+
$input-hover-color: $neutral-900;
|
|
46
|
+
$input-hover-bg: $blue-200;
|
|
47
|
+
$input-hover-border-color: $blue-700;
|
|
48
|
+
$input-hover-placeholder-color: $neutral-900;
|
|
49
|
+
$input-hover-error-color: $red-800;
|
|
50
|
+
$input-active-bg: $blue-50;
|
|
51
|
+
|
|
52
|
+
// Calendar icon
|
|
53
|
+
$calendar-icon: $neutral-900;
|
|
54
|
+
$calendar-active-icon: $blue-900;
|
|
55
|
+
$calendar-hover-icon: $blue-700;
|
|
56
|
+
$calendar-disabled-icon: $neutral-500;
|
|
57
|
+
$calendar-focus-icon: $blue-900;
|
|
58
|
+
|
|
59
|
+
.flatpickr-wrapper {
|
|
60
|
+
width: 100%;
|
|
61
|
+
|
|
62
|
+
.label {
|
|
63
|
+
display: block;
|
|
64
|
+
margin-bottom: 5px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.support-text {
|
|
68
|
+
@include Ib-H5-regular;
|
|
69
|
+
margin-top: 5px;
|
|
70
|
+
color: $neutral-900;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.input-wrapper {
|
|
74
|
+
position: relative;
|
|
75
|
+
|
|
76
|
+
.calendar-icon {
|
|
77
|
+
position: absolute;
|
|
78
|
+
right: 10px;
|
|
79
|
+
top: 50%;
|
|
80
|
+
transform: translateY(-50%);
|
|
81
|
+
color: $calendar-icon;
|
|
82
|
+
font-size: 16px;
|
|
83
|
+
cursor: pointer;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&.active {
|
|
87
|
+
.date-picker-input {
|
|
88
|
+
border-bottom-color: $blue-900;
|
|
89
|
+
background-color: $input-active-bg;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.calendar-icon {
|
|
93
|
+
color: $calendar-active-icon;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.error-message {
|
|
99
|
+
margin-bottom: 5px;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.dropdown {
|
|
103
|
+
position: relative;
|
|
104
|
+
|
|
105
|
+
.flatpickr-calendar {
|
|
106
|
+
position: absolute;
|
|
107
|
+
top: 5px !important;
|
|
108
|
+
left: 0 !important;
|
|
109
|
+
right: auto !important;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
&.has-error {
|
|
114
|
+
position: relative;
|
|
115
|
+
|
|
116
|
+
&.has-labels,
|
|
117
|
+
&.has-label {
|
|
118
|
+
padding-top: 24px;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.label {
|
|
122
|
+
top: 0;
|
|
123
|
+
position: absolute;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
&.is-range {
|
|
128
|
+
max-width: 312px;
|
|
129
|
+
|
|
130
|
+
.input-group-wrapper {
|
|
131
|
+
width: calc(50% - 7.5px);
|
|
132
|
+
}
|
|
133
|
+
.inputs-wrapper {
|
|
134
|
+
display: flex;
|
|
135
|
+
justify-content: space-between;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
.date-picker-input {
|
|
143
|
+
width: 100%;
|
|
144
|
+
@include Ib-H4-regular;
|
|
145
|
+
padding: 0 30px 0 15px;
|
|
146
|
+
height: 36px;
|
|
147
|
+
border-radius: 4px 4px 0 0;
|
|
148
|
+
background-color: $input-bg;
|
|
149
|
+
color: $input-color;
|
|
150
|
+
cursor: pointer;
|
|
151
|
+
border: none;
|
|
152
|
+
outline: none;
|
|
153
|
+
border-bottom: 1px solid $input-border-color;
|
|
154
|
+
transition: color 0.3s, border-bottom-color 0.3s, border-radius 0.3s, background-color 0.3s;
|
|
155
|
+
|
|
156
|
+
&::placeholder {
|
|
157
|
+
@include Ib-H4-regular;
|
|
158
|
+
color: $input-placeholder-color;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
&:disabled {
|
|
162
|
+
color: $input-disabled-color;
|
|
163
|
+
background-color: $input-disabled-bg;
|
|
164
|
+
border-bottom-color: $neutral-900;
|
|
165
|
+
|
|
166
|
+
&::placeholder {
|
|
167
|
+
color: $input-disabled-placeholder-color;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
& + .calendar-icon {
|
|
171
|
+
color: $calendar-disabled-icon;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
&:focus {
|
|
176
|
+
border-radius: 4px;
|
|
177
|
+
border-bottom-color: transparent;
|
|
178
|
+
@include focus();
|
|
179
|
+
|
|
180
|
+
& + .calendar-icon {
|
|
181
|
+
color: $calendar-focus-icon;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
.input-wrapper:hover {
|
|
186
|
+
.date-picker-input {
|
|
187
|
+
color: $input-hover-color;
|
|
188
|
+
background-color: $input-hover-bg;
|
|
189
|
+
border-bottom-color: $input-hover-border-color;
|
|
190
|
+
|
|
191
|
+
&::placeholder {
|
|
192
|
+
color: $input-hover-placeholder-color;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
& + .calendar-icon {
|
|
196
|
+
color: $calendar-hover-icon;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.flatpickr-wrapper {
|
|
202
|
+
position: relative;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.flatpickr-calendar {
|
|
206
|
+
padding: 15px;
|
|
207
|
+
box-shadow: $datepicker-shadow;
|
|
208
|
+
width: 312px;
|
|
209
|
+
min-width: 312px;
|
|
210
|
+
max-width: 312px;
|
|
211
|
+
background-color: $datepicker-bg;
|
|
212
|
+
|
|
213
|
+
&::after,
|
|
214
|
+
&::before {
|
|
215
|
+
display: none;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.numInputWrapper {
|
|
219
|
+
width: 60px;
|
|
220
|
+
padding: 5px 0px 5px 10px;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.cur-year {
|
|
224
|
+
padding: 0 !important;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.numInputWrapper,
|
|
228
|
+
.flatpickr-monthDropdown-months {
|
|
229
|
+
@include Ib-H4-medium;
|
|
230
|
+
padding: 5px 10px;
|
|
231
|
+
border-radius: 4px;
|
|
232
|
+
border: 2px solid transparent;
|
|
233
|
+
|
|
234
|
+
&:hover {
|
|
235
|
+
border-color: $blue-300;
|
|
236
|
+
background-color: $blue-100;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.numInput {
|
|
241
|
+
@include Ib-H4-medium;
|
|
242
|
+
font-weight: 500!important;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.flatpickr-months {
|
|
246
|
+
display: flex;
|
|
247
|
+
align-items: center;
|
|
248
|
+
height: 36px;
|
|
249
|
+
margin-bottom: 5px;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.flatpickr-prev-month,
|
|
253
|
+
.flatpickr-next-month {
|
|
254
|
+
position: initial;
|
|
255
|
+
width: 24px;
|
|
256
|
+
height: 24px;
|
|
257
|
+
border: 2px solid transparent;
|
|
258
|
+
transition: border 0.3s;
|
|
259
|
+
padding: 0;
|
|
260
|
+
display: flex;
|
|
261
|
+
align-items: center;
|
|
262
|
+
justify-content: center;
|
|
263
|
+
font-size: 16px;
|
|
264
|
+
border-radius: 4px;
|
|
265
|
+
background: $ghost-btn-background;
|
|
266
|
+
|
|
267
|
+
svg {
|
|
268
|
+
width: 16px;
|
|
269
|
+
height: 16px;
|
|
270
|
+
|
|
271
|
+
path {
|
|
272
|
+
stroke: $ghost-btn-color;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
&:focus,
|
|
277
|
+
&:hover {
|
|
278
|
+
background: $ghost-btn-hover-background;
|
|
279
|
+
border-color: $ghost-btn-hover-border-color;
|
|
280
|
+
|
|
281
|
+
svg {
|
|
282
|
+
fill: transparent;
|
|
283
|
+
|
|
284
|
+
path {
|
|
285
|
+
stroke: $ghost-btn-hover-color;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
&:active {
|
|
291
|
+
color: $ghost-btn-active-color;
|
|
292
|
+
background: $ghost-btn-active-background;
|
|
293
|
+
svg path {
|
|
294
|
+
stroke: $ghost-btn-active-color;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
.flatpickr-days,
|
|
299
|
+
.flatpickr-innerContainer {
|
|
300
|
+
overflow: visible;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.flatpickr-current-month {
|
|
304
|
+
@include Ib-H4-medium;
|
|
305
|
+
padding: 0;
|
|
306
|
+
display: flex;
|
|
307
|
+
align-items: center;
|
|
308
|
+
justify-content: space-between;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.flatpickr-weekday {
|
|
312
|
+
@include Ib-H4-medium;
|
|
313
|
+
color: $weekday-color;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
.flatpickr-weekdaycontainer,
|
|
317
|
+
.dayContainer {
|
|
318
|
+
width: 287px;
|
|
319
|
+
max-width: 287px;
|
|
320
|
+
min-width: 287px;
|
|
321
|
+
margin-left: -5px;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.flatpickr-day {
|
|
325
|
+
@include Ib-H4-medium;
|
|
326
|
+
color: $day-color;
|
|
327
|
+
border-radius: 4px;
|
|
328
|
+
border: 2px solid $day-border;
|
|
329
|
+
|
|
330
|
+
&.prevMonthDay,
|
|
331
|
+
&.nextMonthDay {
|
|
332
|
+
color: $day-prev-next-color;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
&:focus {
|
|
336
|
+
border: transparent;
|
|
337
|
+
background-color: transparent;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
&:hover {
|
|
341
|
+
color: $day-hover-color;
|
|
342
|
+
background-color: $day-hover-bg;
|
|
343
|
+
border-color: $day-hover-border-color;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
&:focus {
|
|
347
|
+
@include focus(2px);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
&.selected {
|
|
351
|
+
color: $day-selected-color;
|
|
352
|
+
background-color: $day-selected-bg;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
&.startRange {
|
|
356
|
+
box-shadow: 5px 0 0 $day-selected-in-range;
|
|
357
|
+
&.startRange:hover {
|
|
358
|
+
box-shadow: none;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
&.endRange {
|
|
363
|
+
box-shadow: -5px 0 0 $day-selected-in-range;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
&.startRange,
|
|
367
|
+
&.endRange {
|
|
368
|
+
color: $day-start-end-range-color;
|
|
369
|
+
background-color: $day-start-end-range-bg;
|
|
370
|
+
border-radius: 4px;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
&.startRange.endRange {
|
|
374
|
+
color: $day-start-end-range-color;
|
|
375
|
+
background-color: $day-start-end-range-bg;
|
|
376
|
+
border-radius: 4px;
|
|
377
|
+
box-shadow: none;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
&.inRange {
|
|
381
|
+
border-radius: 4px !important;
|
|
382
|
+
border-radius: 0;
|
|
383
|
+
background-color: $day-selected-in-range;
|
|
384
|
+
box-shadow: -5px 0 0 $day-selected-in-range,
|
|
385
|
+
5px 0 0 $day-selected-in-range;
|
|
386
|
+
|
|
387
|
+
&.prevMonthDay,
|
|
388
|
+
&.nextMonthDay {
|
|
389
|
+
color: $day-color;
|
|
390
|
+
border: transparent;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
&:focus {
|
|
394
|
+
z-index: 100;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
&.inRange {
|
|
399
|
+
border-radius: 4px;
|
|
400
|
+
|
|
401
|
+
&:hover {
|
|
402
|
+
position: relative;
|
|
403
|
+
color: $day-hover-color;
|
|
404
|
+
background-color: $day-hover-bg;
|
|
405
|
+
border: 2px solid $day-hover-border-color;
|
|
406
|
+
z-index: 1000;
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
&.today.inRange,
|
|
411
|
+
&.today {
|
|
412
|
+
color: $white;
|
|
413
|
+
border-color: transparent;
|
|
414
|
+
background-color: $blue-800;
|
|
415
|
+
transition: border 0.3s, color 0.3s, background-color 0.3s;
|
|
416
|
+
|
|
417
|
+
&:focus,
|
|
418
|
+
&:hover {
|
|
419
|
+
border: transparent;
|
|
420
|
+
background-color: $blue-700;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
&:active {
|
|
424
|
+
border: transparent;
|
|
425
|
+
background-color: $blue-900;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
&:nth-child(7n) {
|
|
430
|
+
border-radius: 0 4px 4px 0 !important;
|
|
431
|
+
|
|
432
|
+
&.inRange {
|
|
433
|
+
box-shadow: -5px 0 0 $day-selected-in-range;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
&.selected,
|
|
437
|
+
&:hover,
|
|
438
|
+
&:focus {
|
|
439
|
+
border-radius: 4px !important;
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
&:nth-child(7n + 1) {
|
|
444
|
+
border-radius: 4px 0 0 4px !important;
|
|
445
|
+
|
|
446
|
+
&.inRange {
|
|
447
|
+
box-shadow: 5px 0 0 $day-selected-in-range;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
&.endRange {
|
|
451
|
+
box-shadow: none !important;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
&.selected,
|
|
455
|
+
&:hover,
|
|
456
|
+
&:focus {
|
|
457
|
+
border-radius: 4px !important;
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
.flatpickr-day,
|
|
463
|
+
.flatpickr-weekday {
|
|
464
|
+
display: flex;
|
|
465
|
+
height: 36px;
|
|
466
|
+
width: 36px;
|
|
467
|
+
max-width: 36px;
|
|
468
|
+
min-width: 36px;
|
|
469
|
+
align-items: center;
|
|
470
|
+
justify-content: center;
|
|
471
|
+
margin: 0 0 5px 5px;
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
.flatpickr-day.selected.startRange + .endRange:not(:nth-child(7n + 1)),
|
|
476
|
+
.flatpickr-day.startRange.startRange + .endRange:not(:nth-child(7n + 1)),
|
|
477
|
+
.flatpickr-day.endRange.startRange + .endRange:not(:nth-child(7n + 1)) {
|
|
478
|
+
box-shadow: -5px 0 0 $day-selected-in-range;
|
|
479
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import IbDatePicker from "./DatePicker.vue";
|
|
2
|
+
import readme from "./readme.mdx";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: "Form/Date Picker",
|
|
6
|
+
component: IbDatePicker,
|
|
7
|
+
argTypes: {
|
|
8
|
+
mode: {
|
|
9
|
+
control: { type: "select" },
|
|
10
|
+
options: ["single", "range"],
|
|
11
|
+
},
|
|
12
|
+
onInput: { action: "input" },
|
|
13
|
+
},
|
|
14
|
+
parameters: {
|
|
15
|
+
docs: {
|
|
16
|
+
page: readme,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const Template = (args) => ({
|
|
22
|
+
components: { IbDatePicker },
|
|
23
|
+
setup() {
|
|
24
|
+
return { args };
|
|
25
|
+
},
|
|
26
|
+
template: `<ib-date-picker v-bind="args"></ib-date-picker>`,
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export const Default = Template.bind({});
|
|
30
|
+
Default.args = {
|
|
31
|
+
placeholder: "YY-MM-DD",
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export const SingleMax = Template.bind({});
|
|
35
|
+
SingleMax.args = {
|
|
36
|
+
placeholder: "YY-MM-DD",
|
|
37
|
+
required: true,
|
|
38
|
+
label: "Date",
|
|
39
|
+
supportText: "Supporting text",
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const SingleWithError = Template.bind({});
|
|
43
|
+
SingleWithError.args = {
|
|
44
|
+
placeholder: "YY-MM-DD",
|
|
45
|
+
required: true,
|
|
46
|
+
label: "Date",
|
|
47
|
+
supportText: "Supporting text",
|
|
48
|
+
errorMessage: "Error message",
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const Range = Template.bind({});
|
|
52
|
+
Range.args = {
|
|
53
|
+
mode: "range",
|
|
54
|
+
placeholder: "YY-MM-DD",
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export const RangeMax = Template.bind({});
|
|
58
|
+
RangeMax.args = {
|
|
59
|
+
placeholder: "YY-MM-DD",
|
|
60
|
+
required: true,
|
|
61
|
+
mode: "range",
|
|
62
|
+
label: "Date",
|
|
63
|
+
endDateLabel: "End date",
|
|
64
|
+
supportText: "Supporting text",
|
|
65
|
+
endDateSupportText: "Supporting text",
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export const RangeWithError = Template.bind({});
|
|
69
|
+
RangeWithError.args = {
|
|
70
|
+
placeholder: "YY-MM-DD",
|
|
71
|
+
required: true,
|
|
72
|
+
mode: "range",
|
|
73
|
+
label: "Start Date",
|
|
74
|
+
endDateLabel: "End date",
|
|
75
|
+
supportText: "Supporting text",
|
|
76
|
+
endDateSupportText: "Supporting text",
|
|
77
|
+
errorMessage: "Error message",
|
|
78
|
+
};
|