-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(RangeDatePickerV2): new variant of component #1464
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
2ebf49f
feat(DatePicker): lib update and related changes
marcinsawicki 1abb2fe
feat(DatePicker): fixes
marcinsawicki ae83adb
feat(DatePicker): fixes
marcinsawicki b8099d9
feat(RangeDatePickerV2): new variant of component
marcinsawicki 91b70d3
feat(RangeDatePickerV2): adjusted selecting
marcinsawicki 5cbadc5
feat(RangeDatePickerV2): fixes and unit test
marcinsawicki e35bcb9
feat(RangeDatePickerV2): moved to seperate folder to prevent circual …
marcinsawicki 59192b9
feat(RangeDatePickerV2): merge with main and conflicts resolve
marcinsawicki 69cdb4d
feat(RangeDatePickerV2): keyboard control
marcinsawicki 20a20bb
feat(RangeDatePickerV2): changes after review
marcinsawicki a9819f6
feat(RangeDatePickerV2): test fix
marcinsawicki ddb2971
feat(RangeDatePickerV2): keyboard control fix
marcinsawicki e5cdf82
feat(RangeDatePickerV2): merge with main
marcinsawicki ebac4b9
feat(RangeDatePickerV2): set the default month if date range is selected
marcinsawicki c3411e6
feat(RangeDatePickerV2): change callendars number on smaller view
marcinsawicki 66f9c5f
Merge branch 'main' into feature/range-date-picker-v2
marcinsawicki c6d0afc
feat(RangeDatePickerV2): tests update
marcinsawicki 1ae0e3e
Merge branch 'feature/range-date-picker-v2' of github.com:livechat/de…
marcinsawicki 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
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
31 changes: 31 additions & 0 deletions
31
packages/react-components/src/components/RangeDatePickerV2/RangeDatePickerV2.mdx
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,31 @@ | ||
import { Canvas, ArgTypes, Meta, Title } from '@storybook/blocks'; | ||
|
||
import * as RangeDatePickerV2 from './RangeDatePickerV2.stories'; | ||
|
||
<Meta of={RangeDatePickerV2} /> | ||
|
||
<Title>RangeDatePickerV2</Title> | ||
|
||
[Intro](#Intro) | [Component API](#ComponentAPI) | ||
|
||
## Intro <a id="Intro" /> | ||
|
||
RangeDatePickerV2 is a component that allows you to select a date range using a calendar by selecting the start and end date, or using predefined options. The whole thing is displayed after interacting with a trigger that displays the selected dates, which makes it much easier to use the component in places where every free space counts. | ||
|
||
Comment on lines
+11
to
+14
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Enhance documentation with usage guidelines and accessibility info. Add sections for:
|
||
<Canvas of={RangeDatePickerV2.Default} sourceState="none" /> | ||
|
||
#### Example implementation | ||
|
||
```jsx | ||
import { RangeDatePickerV2 } from '@livechat/design-system-react-components'; | ||
|
||
<RangeDatePickerV2 | ||
initialFromDate={new Date()} | ||
initialToDate={new Date()} | ||
onRangeSelect={({ from, to }) => {}} | ||
/> | ||
``` | ||
|
||
## Component API <a id="ComponentAPI" /> | ||
|
||
<ArgTypes of={RangeDatePickerV2.Default} sort="requiredFirst" /> |
Oops, something went wrong.
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.
🛠️ Refactor suggestion
Prevent duplicate range selection callbacks
onRangeSelect
could be called multiple times with the same values.