Skip to content
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

Fluid datepicker v2 #3243

Merged
merged 81 commits into from
Nov 29, 2022
Merged
Show file tree
Hide file tree
Changes from 72 commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
a0d114a
docs: fluid-inputs
aagonzales Sep 9, 2022
48170ab
removed-dup-section
aagonzales Sep 12, 2022
5266921
Add-text-input-style
aagonzales Sep 15, 2022
4705830
Create text-area-counter.png
aagonzales Sep 15, 2022
d5d629e
fixed-merge-conflict
aagonzales Sep 15, 2022
2c9a2be
image-update
aagonzales Sep 15, 2022
1c49e47
Create text-input-states.png
aagonzales Sep 15, 2022
a6bf633
chore(release): update carbon deps (#3159)
carbon-automation[bot] Sep 16, 2022
6b5e381
feat(website): add accessibility link, update common js (#3155)
tay1orjones Sep 16, 2022
2cf9d87
fix: mdx formatting inside component demo (#3160)
alisonjoseph Sep 16, 2022
835651e
docs: contained-list (#3145)
laurenmrice Sep 16, 2022
00c3c22
docs(grid): updated with API docs and example (#3136)
sstrubberg Sep 16, 2022
75d038d
fix(typography): fix controls bug (#3130)
aledavila Sep 19, 2022
e0059b2
Updated outdated links to storybook (#3164)
aagonzales Sep 20, 2022
94d7e1e
Change tab text of typography from "Styling strategies" to "Style str…
abhilipsasahoo03 Sep 20, 2022
1821a88
Update accessibility.mdx (#3143)
mbgower Sep 21, 2022
7ea3965
Correct verbiage on ibm commerce platform page (#3157)
francinelucca Sep 21, 2022
34f3b22
Compressed Images (#3162)
github-actions[bot] Sep 23, 2022
85db97a
docs(Theme): update Theme docs with new guidance/usage (#2998)
dakahn Sep 26, 2022
cf56acd
docs(team): removed team page and removed photos from partners (#3170)
sstrubberg Sep 26, 2022
0cc48b8
fix(content): broken links (#3167)
alisonjoseph Sep 27, 2022
62338df
docs(meetups): added office hours) (#3165)
sstrubberg Sep 27, 2022
b3416d2
update dataviz meeting time (#3177)
theiliad Sep 28, 2022
8b0bafa
chore(release): update carbon deps (#3178)
carbon-automation[bot] Sep 30, 2022
30d826f
docs: figma v11 release content updates (#3176)
laurenmrice Sep 30, 2022
d6d2b50
Compressed Images (#3184)
github-actions[bot] Oct 3, 2022
5d881e4
docs(Accordion): match Accordion to ken to code (#3180)
tw15egan Oct 4, 2022
f2ff211
Ecosystem updates (#3150)
mzuliani-ibm Oct 4, 2022
a3326c0
feat: add crosslink banner to carbon platform on homepage (#3185)
alisonjoseph Oct 5, 2022
4f6b0ab
docs: add flush accordion content (#3168)
laurenmrice Oct 5, 2022
fee6747
docs(progress-bar): add component live demo (#3182)
janhassel Oct 6, 2022
e280be0
docs(svelte): update resources and intro (#3183)
metonym Oct 7, 2022
b6ebe8e
Compressed Images (#3189)
github-actions[bot] Oct 11, 2022
5a8054e
docs(contact-us): minor updates to contact us page (#3186)
jeffchew Oct 12, 2022
e9bb1ba
chore(release): update carbon deps (#3194)
carbon-automation[bot] Oct 12, 2022
8591c2d
fix(tutorial): remove optimize sass from step 5 (#3192)
tay1orjones Oct 13, 2022
a06adb9
refactor(tutorial): remove badging (#3197)
tay1orjones Oct 13, 2022
9cffd78
chore(release): update carbon deps (#3200)
carbon-automation[bot] Oct 13, 2022
c73744d
fix(Icons): fix broken link (#3196)
tw15egan Oct 14, 2022
9451603
ci(actions): automatically open content sync issues on platform (#3193)
tay1orjones Oct 17, 2022
68a729e
fix(switcher): fix app switcher bugs (#3208)
tw15egan Oct 18, 2022
cec4859
Update accessibility.mdx (#3187)
mbgower Oct 18, 2022
72a86fd
Compressed Images (#3217)
github-actions[bot] Oct 24, 2022
dffcd64
ci(content-sync): provide token proper permissions (#3216)
tay1orjones Oct 24, 2022
fb72b82
fix: hyphens to en dashes (#3215)
mattrosno Oct 25, 2022
4798fd0
Fix GitHub capitalization (#3225)
coliff Oct 27, 2022
c87fa23
fix: broken link on tag style tab (#3219)
laurenmrice Oct 27, 2022
78cc314
chore(release): update carbon deps (#3220)
carbon-automation[bot] Oct 27, 2022
cd7d6c2
fix: broken link ui shell right panel (#3218)
laurenmrice Oct 27, 2022
c1bf547
chore(format): fix format error (#3227)
tw15egan Oct 28, 2022
1acfe16
chore(release): update carbon deps (#3226)
carbon-automation[bot] Oct 28, 2022
c31cd7e
content for accessibility tab (#3212)
mbgower Oct 28, 2022
a21e562
[docs] Update type token weights (#3221)
aagonzales Oct 28, 2022
f0ecbec
Compressed Images (#3230)
github-actions[bot] Nov 1, 2022
25cbd7d
docs(FluidInputs): DatePicker
aagonzales Nov 1, 2022
7003646
Merge branch 'aagonzales-fluid-date-pickers' into fluid-inputs
aagonzales Nov 1, 2022
1692f45
pagination accessibility update (#3224)
mbgower Nov 2, 2022
3192186
accessibilty content for right panel (#3223)
mbgower Nov 2, 2022
a1a45b6
chore(release): update carbon deps (#3234)
carbon-automation[bot] Nov 2, 2022
3beded9
fix(analytics): set SPA to false (#3242)
tay1orjones Nov 3, 2022
35f176b
docs(fluid-input): datepicker v2
aagonzales Nov 3, 2022
fc4ed58
added-missing-images
aagonzales Nov 3, 2022
a494e8b
Update date-picker-style-7.png
aagonzales Nov 4, 2022
5834a06
Add files via upload
alisonjoseph Nov 4, 2022
d167f44
Merge pull request #31 from aagonzales/main
alisonjoseph Nov 4, 2022
fa32b0d
Revert "merge"
alisonjoseph Nov 4, 2022
ed8ca02
Merge pull request #32 from aagonzales/revert-31-main
alisonjoseph Nov 4, 2022
49ed7b6
Merge branch 'fluid-inputs' into fluid-datepicker-v2
alisonjoseph Nov 4, 2022
d54cb82
Merge pull request #33 from aagonzales/fluid-merge-conflicts
alisonjoseph Nov 4, 2022
08e7e89
Revert "Merge branch 'fluid-inputs' into fluid-datepicker-v2"
alisonjoseph Nov 4, 2022
555364d
Merge pull request #34 from aagonzales/revert-33-fluid-merge-conflicts
alisonjoseph Nov 4, 2022
ac0870a
Merge branch 'fluid-inputs' into fluid-datepicker-v2
alisonjoseph Nov 4, 2022
9fa374a
Apply suggestions from design review
aagonzales Nov 14, 2022
bb0582e
updated-images-add-time
aagonzales Nov 14, 2022
74a1b75
added-timePicker
aagonzales Nov 16, 2022
15d0aa4
Update style.mdx
aagonzales Nov 16, 2022
fa46193
design-review-pt2
aagonzales Nov 22, 2022
35ee583
Update date-picker-style-4-fluid.png
aagonzales Nov 23, 2022
628bec4
Update style.mdx
alisonjoseph Nov 28, 2022
180bebd
Update package.json
alisonjoseph Nov 28, 2022
4162742
Merge branch 'fluid-inputs' into fluid-datepicker-v2
aagonzales Nov 29, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/pages/components/date-picker/images/date-picker-anatomy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/pages/components/date-picker/images/date-picker-style-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/pages/components/date-picker/images/date-picker-style-7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
78 changes: 67 additions & 11 deletions src/pages/components/date-picker/style.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,21 @@ tabs: ['Usage', 'Style', 'Code', 'Accessibility']
<Row>
<Column colLg={8}>

![Date picker input states](images/date-picker-style-7.png)
<Tabs>

<Tab label="Fixed">

![Fixed date picker input colors](images/date-picker-style-7.png)

</Tab>

<Tab label="Fluid">

![Fluid date picker input colors](images/date-picker-style-7-fluid.png)

</Tab>

</Tabs>

</Column>
</Row>
Expand Down Expand Up @@ -56,7 +70,21 @@ tabs: ['Usage', 'Style', 'Code', 'Accessibility']
<Row>
<Column colLg={12}>

![Date picker input states](images/date-picker-style-6.png)
<Tabs>

<Tab label="Fixed">

![Fixed date picker input states](images/date-picker-style-6.png)

</Tab>

<Tab label="Fluid">

![Fluid date picker input states](images/date-picker-style-6-fluid.png)

</Tab>

</Tabs>

</Column>
</Row>
Expand Down Expand Up @@ -119,6 +147,8 @@ any proper nouns capitalized, and no more than three words.

### Date inputs

#### Fixed input

The widths of the date inputs may vary based on the grid and layout.

| Element | Property | px / rem | Spacing token |
Expand All @@ -136,23 +166,31 @@ The widths of the date inputs may vary based on the grid and layout.

</div>

<Caption>Structure and spacing for date picker inputs | px / rem</Caption>
<Caption>Structure and spacing for fixed date picker inputs | px / rem</Caption>

### Sizes
#### Fluid input

| Element | Size | Height px / rem |
| ------- | ----------- | --------------- |
| Field | Small (sm) | 32 / 2 |
| | Medium (md) | 40 / 2.5 |
| | Large (lg) | 48 / 3 |
The widths of the date inputs may vary based on the grid and layout.

| Element | Property | px / rem | Spacing token |
| ------------- | --------------------------- | ----------- | ------------- |
| Label | padding-bottom | 4 / 0.25 | `$spacing-02` |
| Field | height | 64 / 4 | `$spacing-10` |
| | padding-left, padding-right | 16 / 1 | `$spacing-05` |
| | padding-top, padding-bottom | 13 / 0.8125 | – |
| | border-bottom | 1px | – |
| Calendar icon | height, width | 16 / 1 | – |
| | padding-left | 8 / 0.5 | `$spacing-03` |
| Focus | border | 2px | – |
| Error | border | 2px | – |

<div className="image--fixed">

![Sizes for simple and single date calendar sizes](images/date-picker-style-size.png)
![Structure for date picker inputs](images/date-picker-style-4-fluid.png)

</div>

<Caption>Sizes for simple and single date calendar sizes | px / rem</Caption>
<Caption>Structure and spacing for fluid date picker inputs | px / rem</Caption>

### Calendar menu

Expand Down Expand Up @@ -202,3 +240,21 @@ select styling.
</div>

<Caption>Structure and spacing for a time picker | px / rem</Caption>

## Sizes

### Fixed inputs

| Element | Size | Height px / rem |
| ------- | ----------- | --------------- |
| Field | Small (sm) | 32 / 2 |
| | Medium (md) | 40 / 2.5 |
| | Large (lg) | 48 / 3 |

<div className="image--fixed">

![Sizes for simple and single date calendar sizes](images/date-picker-style-size.png)

</div>

<Caption>Sizes for simple and single date calendar sizes | px / rem</Caption>
151 changes: 111 additions & 40 deletions src/pages/components/date-picker/usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,29 @@ You can customize the time picker's format depending on location or need.
<Row>
<Column colLg={12}>

![Date picker anatomy](images/date-picker-anatomy.png)
<Tabs>

<Caption>
Anatomy of a simple date input and a single date calendar picker
</Caption>
<Tab label="Fixed">

![Fixed date picker anatomy](images/date-picker-anatomy.png)

</Tab>

<Tab label="Fluid">

![Fluid date picker anatomy](images/date-picker-anatomy-fluid.png)

</Tab>

</Tabs>

</Column>
</Row>

<Caption>
Anatomy of a simple date input and a single date calendar picker.
</Caption>

1. **Label**: Instructs the user what to do with the control.
2. **Date field**: A text input field where the user can manually type in the
date.
Expand All @@ -213,9 +227,9 @@ You can customize the time picker's format depending on location or need.
5. **Calendar**: The menu where a date may be selected.
6. **Month and year controls**: Allows the user to navigate through past and
future time frames.
7. **Week day**: Days of the week.
8. **Previous and next month controls**: Allows the user to move forward or
7. **Previous and next month controls**: Allows the user to move forward or
backward one month at a time.
8. **Week day**: Days of the week.
9. **Day**: Days in the month, see
[calendar variants](/components/date-picker/usage#calendar-variants) for
specific day styles.
Expand All @@ -240,43 +254,85 @@ You can customize the time picker's format depending on location or need.
4. **Timezone selector**: A select control that allows the user to set the
associated time zone.

### Alignment
### Styling

By default, the pickers have fixed widths. If you are placing the picker inline
with other inputs, such as in form, then the widths can be adjusted to match the
other inputs. The picker can either increase or decrease in width as needed. If
you adjust the size, be aware that pickers have minimum widths and the date
content should never horizontal scroll or overflow.
There are two styles of date picker inputs, fixed and fluid. They share the same
functionality but look visually different, influencing where to use them.

| Style | Appearance | Use case |
| ----- | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| Fixed | A traditional style where the label is positioned outside and above the input field. | Use when white space is needed between input components or in productive moments where space is at a premium, and smaller components are needed. |
| Fluid | An alternative style where the label is placed inside of the input field and is stacked inline with the user input text. | Use in expressive moments, fluid forms, contained spaces, or attached to complex components, like a toolbar. |

<Row>
<Column colLg={8}>

![Alignment example](images/date-picker-alignment-01.png)
![An example of a fixed and fluid date picker input](images/date-picker-formatting-styling.png)

</Column>
</Row>

The calendar itself will always remain a fixed width and is not adjustable. It
should always be aligned to the left edge of its assigned text field.
### Sizes

#### Fixed input heights

The fixed input fields for date and time picker come in three height sizes:
small (32px), medium (40px), and large (48px). The calendar menu in the date
picker is a fixed height and width and does not change with the input size.

| Fixed size | Height (px/rem) | Use case |
| ----------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Small (sm) | 32 / 2 | Use when space is constricted or when placing a dropdown in a form that is long and complex. |
| Medium (md) | 40 / 2.5 | This is the default size and the most commonly used size. When in doubt, use the medium size. |
| Large (lg) | 48 / 3 | Use when there is a lot of space to work with. This size is typically used in simple forms or when a dropdown is placed by itself on a page, for example as a filter. |

<Row>
<Column colLg={12}>
<Column colLg={8}>

![Alignment example](images/date-picker-alignment-02.png)
![Fixed input size example](images/date-picker-sizes.png)

</Column>
</Row>

### Sizes
#### Fluid input heights

There is only one fluid input height and it is visually larger than the fixed
heights. The input is a set height of 64px expect when a warning or error
aagonzales marked this conversation as resolved.
Show resolved Hide resolved
message has been added to the bottom.

<Row>
<Column colLg={8}>

The input fields for date and time picker come in three height sizes: small
(32px), medium (40px), and large (48px). The calendar menu in the date picker is
a fixed height and width and does not change with the input size.
![Fluid input size example](images/date-picker-sizes-fluid.png)

</Column>
</Row>

### Alignment

By default, the pickers have set widths. If you are placing the picker inline
with other inputs, such as in form, then the widths can be adjusted to match the
aagonzales marked this conversation as resolved.
Show resolved Hide resolved
other inputs. The picker can either increase or decrease in width as needed. If
you adjust the size, be aware that pickers have minimum widths and the date
content should never horizontal scroll or overflow.
aagonzales marked this conversation as resolved.
Show resolved Hide resolved

<Row>
<Column colLg={8}>

![Size example](images/date-picker-sizes.png)
![Alignment example](images/date-picker-alignment-01.png)

</Column>
</Row>

#### Aligning the calendar menu

The calendar itself will always remain a set width and is not adjustable. It
should always be aligned to the left edge of its assigned text field.

<Row>
<Column colLg={12}>

![Alignment example](images/date-picker-alignment-02.png)

</Column>
</Row>
Expand Down Expand Up @@ -319,8 +375,8 @@ a fixed height and width and does not change with the input size.

### Further guidance

For further content guidance, see
Carbon’s [content guidelines](https://www.carbondesignsystem.com/guidelines/content/overview/).
For further content guidance, see Carbon’s
[content guidelines](/guidelines/content/overview/).

## Universal behaviors

Expand All @@ -330,6 +386,35 @@ sections below.

### States

The date input is a [text input](/components/text-input/usage) and has the same
interactive state and behaviors. Only date pickers with calendars will have the
calendar icon present in the right side of the input field. See the
[style tab](/components/date-picker/style) for more details. For calendar menu
states, see the
[calendar variants](/components/date-picker/usage/#calendar-variants) section.

<Row>
<Column colLg={12}>

<Tabs>

<Tab label="Fixed">

![Fixed date picker states](images/date-picker-usage-states.png)

</Tab>

<Tab label="Fluid">

![Fluid date picker states](images/date-picker-usage-states-fluid.png)

</Tab>

</Tabs>

</Column>
</Row>

#### Validation

Invalid fields should be clearly marked. In pickers with more than one field,
Expand Down Expand Up @@ -362,14 +447,6 @@ interactions that come with the calendar menu or a dropdown.
The simple date input can include _month/year_ or _month/day/year._ The
formatting may be localized and rearranged in sequence of appearance.

<Row>
<Column colLg={8}>

![Simple date input](images/single-date-input.png)

</Column>
</Row>

### When to use

#### Use for memorable dates
Expand All @@ -384,16 +461,10 @@ instead of an exact date, especially in regards to past dates. For example, when
was asking a user when a purchase was made they will most likely easily recall
the month and year (November 2019) versus the specific date (November 22, 2019).

### States

The simple date input is a [text input](/components/text-input/usage) and has
the same interactive state and behaviors. See the
[style tab](/components/date-picker/style) for more details.

<Row>
<Column colLg={12}>
<Column colLg={8}>

![Simple date input states](images/simple-date-input-states.png)
![Simple date input](images/single-date-input.png)

</Column>
</Row>
Expand Down
Binary file modified src/pages/components/loading/images/loading-accessibility-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/pages/components/loading/images/loading-accessibility-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/pages/components/loading/images/loading-accessibility-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/pages/components/text-input/images/text-area-counter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/pages/components/text-input/images/text-area-usage-size.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file modified src/pages/components/text-input/images/text-input-usage-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/pages/components/text-input/images/text-input-usage-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/pages/components/text-input/images/text-input-usage-4-do.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/pages/components/text-input/images/text-input-usage-size.png
Binary file modified src/pages/components/text-input/images/text-input-width-do.png
Binary file modified src/pages/components/text-input/images/text-input-width-dont.png
Loading