Skip to content

Commit fa4e687

Browse files
authored
chore(next): update from [email protected] (#1801)
1 parent e07741f commit fa4e687

File tree

6 files changed

+214
-141
lines changed

6 files changed

+214
-141
lines changed

CHANGELOG.md

Lines changed: 162 additions & 131 deletions
Large diffs are not rendered by default.

docs/changelogs/v8.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@
99
1010
_Note: Gaps between patch versions are faulty, broken or test releases._
1111

12+
## v8.76.2 (2024-05-02)
13+
14+
#### :bug: Bug Fix
15+
* `datepickers`, `forms`
16+
* [#1799](https://github.com/zendeskgarden/react-components/pull/1799) fix(forms): updates Message to receive margin when intermediaries are present ([@geotrev](https://github.com/geotrev))
17+
18+
#### :seedling: Internal
19+
* [#1800](https://github.com/zendeskgarden/react-components/pull/1800) chore(deps-dev): bump ejs from 3.1.9 to 3.1.10 ([@dependabot[bot]](https://github.com/apps/dependabot))
20+
1221
## v8.76.1 (2024-04-18)
1322

1423
#### :bug: Bug Fix

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/datepickers/demo/datePicker.stories.mdx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ import README from '../README.md';
1616
<Canvas>
1717
<Story
1818
name="DatePicker"
19-
args={{ dateStyle: DATE_STYLE_OPTIONS[1], isAnimated: true }}
19+
args={{
20+
dateStyle: DATE_STYLE_OPTIONS[1],
21+
eventsEnabled: true,
22+
isAnimated: true,
23+
message: 'Message'
24+
}}
2025
argTypes={{
2126
value: { control: 'date' },
2227
minValue: { control: 'date' },
@@ -25,6 +30,17 @@ import README from '../README.md';
2530
control: 'radio',
2631
options: DATE_STYLE_OPTIONS,
2732
table: { category: 'Story' }
33+
},
34+
hasMessage: { name: 'Message', control: { type: 'boolean' }, table: 'Story' },
35+
message: { name: 'children', control: { type: 'text' }, table: { category: 'Message' } },
36+
validation: {
37+
options: ['success', 'warning', 'error'],
38+
control: { type: 'radio' },
39+
table: { category: 'Input' }
40+
},
41+
validationLabel: {
42+
control: { type: 'text' },
43+
table: { category: 'Message' }
2844
}
2945
}}
3046
parameters={{

packages/datepickers/demo/stories/DatePickerStory.tsx

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,45 @@
77

88
import React from 'react';
99
import { Story } from '@storybook/react';
10-
import { Field, Input } from '@zendeskgarden/react-forms';
1110
import { Grid } from '@zendeskgarden/react-grid';
11+
import { Field, Input } from '@zendeskgarden/react-forms';
1212
import { DatePicker, IDatePickerProps } from '@zendeskgarden/react-datepickers';
1313
import { DATE_STYLE } from './types';
1414

1515
interface IArgs extends IDatePickerProps {
1616
dateStyle: DATE_STYLE;
17+
hasMessage?: boolean;
18+
message?: string;
19+
validation?: 'success' | 'warning' | 'error';
20+
validationLabel?: string;
1721
}
1822

19-
export const DatePickerStory: Story<IArgs> = ({ dateStyle, isCompact, ...args }) => {
23+
export const DatePickerStory: Story<IArgs> = ({
24+
dateStyle,
25+
isCompact,
26+
hasMessage,
27+
message,
28+
validation,
29+
validationLabel,
30+
...args
31+
}) => {
2032
const formatDate = (date: Date) =>
2133
new Intl.DateTimeFormat(args.locale, { dateStyle }).format(date);
2234

2335
return (
2436
<Grid>
25-
<Grid.Row style={{ height: 'calc(100vh - 80px)' }}>
26-
<Grid.Col textAlign="center" alignSelf="center">
37+
<Grid.Row justifyContent="center" style={{ height: 'calc(100vh - 80px)' }}>
38+
<Grid.Col alignSelf="center">
2739
<Field>
2840
<Field.Label hidden>{DatePicker.displayName}</Field.Label>
2941
<DatePicker {...args} formatDate={formatDate} isCompact={isCompact}>
30-
<Input isCompact={isCompact} style={{ width: isCompact ? 256 : 320 }} />
42+
<Input isCompact={isCompact} validation={validation} />
3143
</DatePicker>
44+
{hasMessage && (
45+
<Field.Message validation={validation} validationLabel={validationLabel}>
46+
{message}
47+
</Field.Message>
48+
)}
3249
</Field>
3350
</Grid.Col>
3451
</Grid.Row>

packages/forms/src/styled/text/StyledTextInput.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ const sizeStyles = (props: IStyledTextInputProps & ThemeProps<DefaultTheme>) =>
192192
${StyledHint} + &&,
193193
${StyledMessage} + &&,
194194
&& + ${StyledHint},
195-
&& + ${StyledMessage} {
195+
&& ~ ${StyledMessage} {
196196
margin-top: ${props.theme.space.base * (props.isCompact ? 1 : 2)}px;
197197
}
198198
/* stylelint-enable */

0 commit comments

Comments
 (0)