-
Notifications
You must be signed in to change notification settings - Fork 109
feat(fantasy): add calendar #59
Merged
Merged
Changes from 9 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
623b7fb
feat(fantasy): add fantasy design, pt.1
tx44 e9f2f05
Merge branch 'master' into feat/add-fantasy-1
tx44 8912bad
fix(fantasy): use vars for main-fantasy styles
tx44 de04b4c
fix(fantasy): update color vars
tx44 d48bd35
fix(fantasy): remove heading align & weight props
tx44 3bb6df4
fix(fantasy): remove styleguide builds
tx44 6879f5a
fix(fantasy): append licence to files
tx44 77dfbcd
feat(fantasy): add calendar
tx44 686e40a
fix(fantasy): fix calendar style vars
tx44 5e5b5ed
refactor(calendar): remove unused error element in styles
tx44 03bf456
Merge branch 'master' into feat/add-fantasy-calendar
tx44 6dd92ed
Merge branch 'master' into feat/add-fantasy-calendar
tx44 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
``` | ||
initialState = { | ||
date: Date.now() | ||
}; | ||
<Calendar | ||
value={ state.date } | ||
onValueChange={ (newDate) => { | ||
setState({ | ||
date: newDate | ||
}); | ||
} } | ||
/> | ||
``` | ||
|
||
``` | ||
const addDays = require('date-fns/add_days'); | ||
const startOfDay = require('date-fns/start_of_day'); | ||
const subtractDays = require('date-fns/sub_days'); | ||
initialState = { | ||
date: Date.now(), | ||
earlierLimit: subtractDays(new Date(), 3).valueOf(), | ||
laterLimit: addDays(new Date(), 1).valueOf() | ||
}; | ||
|
||
<Calendar | ||
value={ state.date } | ||
earlierLimit={ state.earlierLimit } | ||
laterLimit={ state.laterLimit } | ||
onValueChange={ (newDate) => { | ||
setState({ | ||
date: newDate | ||
}); | ||
} } | ||
/> | ||
``` | ||
|
||
``` | ||
const addDays = require('date-fns/add_days'); | ||
const startOfDay = require('date-fns/start_of_day'); | ||
const subtractDays = require('date-fns/sub_days'); | ||
initialState = { | ||
date: Date.now() | ||
}; | ||
const offDays = [subtractDays(new Date(), 2), addDays(new Date(), 2)] | ||
.map(date => startOfDay().valueOf()); | ||
|
||
<Calendar | ||
value={ state.date } | ||
offDays={ offDays } | ||
onValueChange={ (newDate) => { | ||
setState({ | ||
date: newDate | ||
}); | ||
} } | ||
/> | ||
``` |
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,113 @@ | ||
@import '../../vars-fantasy.css'; | ||
|
||
.calendar { | ||
display: inline-block; | ||
padding: 0; | ||
outline: 0; | ||
font-family: var(--font); | ||
font-size: var(--font-size-m); | ||
font-weight: var(--font-weight-normal); | ||
border-radius: var(--border-radius-control); | ||
|
||
&__name { | ||
text-align: center; | ||
} | ||
|
||
&__layout { | ||
border-collapse: separate; | ||
border-spacing: 0; | ||
} | ||
|
||
&__title { | ||
vertical-align: middle; | ||
padding: 20px 15px 5px; | ||
line-height: 20px; | ||
} | ||
|
||
&__layout { | ||
padding: 0 15px 15px; | ||
} | ||
|
||
&__dayname, | ||
&__day { | ||
font-size: var(--font-size-s); | ||
} | ||
|
||
&__dayname { | ||
cursor: default; | ||
font-size: var(--font-size-xs); | ||
font-weight: var(--font-weight-normal); | ||
line-height: 34px; | ||
text-align: center; | ||
} | ||
|
||
&__day { | ||
width: 35px; | ||
cursor: pointer; | ||
line-height: 30px; | ||
text-align: center; | ||
} | ||
|
||
&__arrow, &__double_arrow { | ||
opacity: var(--opacity-minor); | ||
width: 18px; | ||
height: 18px; | ||
cursor: pointer; | ||
transition: all 0.1s ease-out; | ||
background-position: center; | ||
background-repeat: no-repeat; | ||
} | ||
|
||
&__arrow:hover { | ||
opacity: 1; | ||
} | ||
|
||
&__arrow_direction_left, &__double_arrow_direction_left { | ||
float: left; | ||
} | ||
|
||
&__arrow_direction_right, &__double_arrow_direction_right { | ||
float: right; | ||
} | ||
|
||
&__day_type_weekend { | ||
font-weight: var(--font-weight-medium); | ||
} | ||
|
||
&__day_state_current { | ||
position: relative; | ||
margin: 0; | ||
outline: 0; | ||
user-select: none; | ||
color: var(--color-accent-content); | ||
text-align: center; | ||
z-index: 2; | ||
|
||
&:before { | ||
content: ''; | ||
position: absolute; | ||
top: 3px; | ||
right: 0; | ||
bottom: 2px; | ||
left: 0; | ||
background: var(--color-accent); | ||
border-radius: 14px; | ||
z-index: -1; | ||
} | ||
} | ||
|
||
&__day_type_off, | ||
&__day_type_weekend-off { | ||
cursor: default; | ||
opacity: var(--opacity-minor); | ||
} | ||
|
||
&__arrow_disabled { | ||
visibility: hidden; | ||
} | ||
|
||
&__error { | ||
width: 240px; | ||
margin: 7px; | ||
} | ||
} |
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,22 @@ | ||
@import '../../vars-fantasy.css'; | ||
|
||
.calendar_theme_alfa-on-color { | ||
color: var(--color-content-alfa-on-color); | ||
background-color: var(--color-background-alfa-on-color); | ||
|
||
.calendar__arrow_direction_left { | ||
background-image: url(../images/arrow_cl.svg); | ||
|
||
&.calendar__arrow_double { | ||
background-image: url(../images/2_arrow_cl.svg); | ||
} | ||
} | ||
|
||
.calendar__arrow_direction_right { | ||
background-image: url(../images/arrow_cr.svg); | ||
|
||
&.calendar__arrow_double { | ||
background-image: url(../images/2_arrow_cr.svg); | ||
} | ||
} | ||
} |
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,22 @@ | ||
@import '../../vars-fantasy.css'; | ||
|
||
.calendar_theme_alfa-on-white { | ||
color: var(--color-content-alfa-on-white); | ||
background-color: var(--color-background-alfa-on-white); | ||
|
||
.calendar__arrow_direction_left { | ||
background-image: url(../images/arrow_wl.svg); | ||
|
||
&.calendar__arrow_double { | ||
background-image: url(../images/2_arrow_wl.svg); | ||
} | ||
} | ||
|
||
.calendar__arrow_direction_right { | ||
background-image: url(../images/arrow_wr.svg); | ||
|
||
&.calendar__arrow_double { | ||
background-image: url(../images/2_arrow_wr.svg); | ||
} | ||
} | ||
} |
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 @@ | ||
import './calendar.css'; | ||
import './calendar_theme_alfa-on-white.css'; | ||
import './calendar_theme_alfa-on-color.css'; | ||
|
||
export default from '../calendar'; |
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,9 @@ | ||
``` | ||
<div> | ||
<Heading>Heading H1 by default</Heading> | ||
<Heading size='s'>Heading H4</Heading> | ||
<Heading size='m'>Heading H3</Heading> | ||
<Heading size='l'>Heading H2</Heading> | ||
<Heading size='xl'>Heading H1</Heading> | ||
</div> | ||
``` |
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,53 @@ | ||
@import '../../vars-fantasy.css'; | ||
|
||
.heading { | ||
font-family: var(--font); | ||
font-weight: var(--font-weight-black); | ||
line-height: var(--line-height-condensed); | ||
|
||
&_size_s { | ||
margin-top: 20px; | ||
margin-bottom: 20px; | ||
font-size: var(--font-size-l); | ||
} | ||
|
||
&_size_m { | ||
margin-top: 20px; | ||
margin-bottom: 20px; | ||
font-size: var(--font-size-xl); | ||
|
||
@media (--medium) { | ||
font-size: var(--font-size-2xl); | ||
} | ||
} | ||
|
||
&_size_l { | ||
margin-top: 30px; | ||
margin-bottom: 25px; | ||
font-size: var(--font-size-2xl); | ||
|
||
@media (--medium) { | ||
font-size: var(--font-size-3xl); | ||
} | ||
} | ||
|
||
&_size_xl { | ||
margin-top: 25px; | ||
margin-bottom: 20px; | ||
font-size: var(--font-size-3xl); | ||
|
||
@media (--large) { | ||
margin-top: 35px; | ||
margin-bottom: 30px; | ||
font-size: var(--font-size-4xl); | ||
} | ||
} | ||
|
||
&_theme_alfa-on-color { | ||
color: var(--color-content-alfa-on-color); | ||
} | ||
|
||
&_theme_alfa-on-white { | ||
color: var(--color-content-alfa-on-white); | ||
} | ||
} |
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,3 @@ | ||
import './heading.css'; | ||
|
||
export default from '../heading'; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
@import './vars-fantasy.css'; | ||
|
||
*, | ||
*:before, | ||
*:after { | ||
box-sizing: border-box; | ||
} | ||
|
||
html, body { | ||
margin: 0; | ||
padding: 0; | ||
height: 100%; | ||
} | ||
|
||
body { | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
color: var(--color-content-alfa-on-white); | ||
font-family: var(--font); | ||
font-size: var(--font-size-m); | ||
font-style: normal; | ||
font-weight: var(--font-weight-normal); | ||
letter-spacing: 0; | ||
background-color: var(--color-background-alfa-on-white); | ||
} | ||
|
||
#react-app { | ||
display: table; | ||
table-layout: fixed; | ||
width: 100%; | ||
height: inherit; | ||
} |
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 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
@import './vars/fantasy/font.css'; | ||
@import './vars/fantasy/color.css'; | ||
@import './vars/fantasy/color-theme_alfa-on-color.css'; | ||
@import './vars/fantasy/color-theme_alfa-on-white.css'; | ||
@import './vars/fantasy/opacity.css'; | ||
@import './vars/fantasy/border-radius.css'; | ||
@import './vars/fantasy/shadow.css'; | ||
|
||
:root { | ||
--small-screen-padding: 12px; | ||
--small-header-height: 80px; | ||
--large-screen-content-width: 1000px; | ||
--xlarge-screen-content-width: 1100px; | ||
} |
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,10 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
:root { | ||
/** | ||
* Стандартное скругление углов. | ||
*/ | ||
--border-radius-control: 3px; | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Вроде теперь он не должен уметь показывать ошибку?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Подчистил.