-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PLAY-48]Configure the Date Picker Kit to be able to select month onl…
…y as an option (#1735) * React code done * Change prop name/added rails code * hallelujah * clean code * Fixed styles * fixed hover color
- Loading branch information
Showing
11 changed files
with
172 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
playbook/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_month_and_year.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<%= pb_rails("date_picker", props: { | ||
label: "Date Picker", | ||
plugins: true, | ||
picker_id: "disabled_date" | ||
}) %> |
18 changes: 18 additions & 0 deletions
18
playbook/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_month_and_year.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React from 'react' | ||
|
||
import DatePicker from '../_date_picker' | ||
|
||
const DatePickerMonthAndYear = (props) => { | ||
return ( | ||
<div> | ||
<DatePicker | ||
label="Date Picker" | ||
pickerId="disabled-date" | ||
plugins | ||
{...props} | ||
/> | ||
</div> | ||
) | ||
} | ||
|
||
export default DatePickerMonthAndYear |
1 change: 1 addition & 0 deletions
1
playbook/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_month_and_year.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
By default month&year plugin is disabled. To activate it set `plugins` prop to `true`. If you're using React just pass a `plugins` prop to the kit. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
127 changes: 127 additions & 0 deletions
127
playbook/app/pb_kits/playbook/pb_date_picker/sass_partials/_month_and_year_styles.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
@import "../../tokens/colors"; | ||
|
||
|
||
.numInput { | ||
border-left: none !important; | ||
} | ||
|
||
// Manual Import | ||
.flatpickr-monthSelect-months { | ||
margin: 10px 1px 3px 1px; | ||
flex-wrap: wrap; | ||
} | ||
|
||
.flatpickr-monthSelect-month { | ||
background: none; | ||
border: 1px solid transparent; | ||
border-radius: 4px; | ||
-webkit-box-sizing: border-box; | ||
box-sizing: border-box; | ||
color: $text_lt_default; | ||
cursor: pointer; | ||
display: inline-block; | ||
font-weight: 400; | ||
margin: 0.5px; | ||
justify-content: center; | ||
padding: 10px; | ||
position: relative; | ||
-webkit-box-pack: center; | ||
-webkit-justify-content: center; | ||
-ms-flex-pack: center; | ||
text-align: center; | ||
width: 33%; | ||
} | ||
|
||
.flatpickr-monthSelect-month.flatpickr-disabled { | ||
color: #eee; | ||
} | ||
|
||
.flatpickr-monthSelect-month.flatpickr-disabled:hover, | ||
.flatpickr-monthSelect-month.flatpickr-disabled:focus { | ||
cursor: not-allowed; | ||
background: none !important; | ||
} | ||
|
||
.flatpickr-monthSelect-theme-dark { | ||
background: #3f4458; | ||
} | ||
|
||
.flatpickr-monthSelect-theme-dark .flatpickr-current-month input.cur-year { | ||
color: #fff; | ||
} | ||
|
||
.flatpickr-monthSelect-theme-dark .flatpickr-months .flatpickr-prev-month, | ||
.flatpickr-monthSelect-theme-dark .flatpickr-months .flatpickr-next-month { | ||
color: #fff; | ||
fill: #fff; | ||
} | ||
|
||
.flatpickr-monthSelect-theme-dark .flatpickr-monthSelect-month { | ||
color: rgba(255, 255, 255, 0.95); | ||
} | ||
|
||
.flatpickr-monthSelect-month.today { | ||
border-color: #959ea9; | ||
} | ||
|
||
.flatpickr-monthSelect-month.inRange, | ||
.flatpickr-monthSelect-month.inRange.today, | ||
.flatpickr-monthSelect-month:hover, | ||
.flatpickr-monthSelect-month:focus { | ||
background: $active_light; | ||
font-weight: $bold; | ||
color: $text_lt_default; | ||
cursor: pointer; | ||
outline: 0; | ||
} | ||
|
||
.flatpickr-monthSelect-theme-dark .flatpickr-monthSelect-month.inRange, | ||
.flatpickr-monthSelect-theme-dark .flatpickr-monthSelect-month:hover, | ||
.flatpickr-monthSelect-theme-dark .flatpickr-monthSelect-month:focus { | ||
background: #646c8c; | ||
border-color: #646c8c; | ||
} | ||
|
||
.flatpickr-monthSelect-month.today:hover, | ||
.flatpickr-monthSelect-month.today:focus { | ||
background: #959ea9; | ||
border-color: #959ea9; | ||
color: #fff; | ||
} | ||
|
||
.flatpickr-monthSelect-month.selected, | ||
.flatpickr-monthSelect-month.startRange, | ||
.flatpickr-monthSelect-month.endRange { | ||
background-color: $primary; | ||
font-weight: $bold; | ||
box-shadow: none; | ||
color: #fff; | ||
border-color: $primary; | ||
} | ||
|
||
.flatpickr-monthSelect-month.startRange { | ||
border-radius: 50px 0 0 50px; | ||
} | ||
|
||
.flatpickr-monthSelect-month.endRange { | ||
border-radius: 0 50px 50px 0; | ||
} | ||
|
||
.flatpickr-monthSelect-month.startRange.endRange { | ||
border-radius: 50px; | ||
} | ||
|
||
.flatpickr-monthSelect-month.inRange { | ||
border-radius: 0; | ||
box-shadow: -5px 0 0 #e6e6e6, 5px 0 0 #e6e6e6; | ||
} | ||
|
||
.flatpickr-monthSelect-theme-dark .flatpickr-monthSelect-month.selected, | ||
.flatpickr-monthSelect-theme-dark .flatpickr-monthSelect-month.startRange, | ||
.flatpickr-monthSelect-theme-dark .flatpickr-monthSelect-month.endRange { | ||
background: #80cbc4; | ||
-webkit-box-shadow: none; | ||
box-shadow: none; | ||
color: #fff; | ||
border-color: #80cbc4; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters