Skip to content

Commit eabdefe

Browse files
Merge pull request #292 from digipolisantwerp/feature/react-18
Feature/react 18
2 parents 82caa84 + dd3b96f commit eabdefe

File tree

13 files changed

+71098
-30948
lines changed

13 files changed

+71098
-30948
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
66

77
## [Unreleased]
88

9+
## v6.4.0 - 2022-xx-xx
10+
11+
### Added
12+
- Added support for React 18
13+
- `Form` - Added placeholder option for datepicker
14+
- `Form` - Added description option for select
15+
- `Form` - Added error description option for select
16+
- `Form` - Added error description option for datepicker
17+
18+
### Fixed
19+
- Made sure no extra space is created when flyout is closed
20+
21+
922
## v6.3.1 - 2022-01-24
1023

1124
### Fixed

package-lock.json

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

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@
6969
"dependencies": {
7070
"@a-ui/core": "^5.0.0",
7171
"classnames": "~2.2.6",
72-
"moment": "^2.29.1",
72+
"moment": "^2.29.3",
7373
"react-input-mask": "^2.0.4",
74-
"react-modal": "~3.5.1",
74+
"react-modal": "~3.15.0",
7575
"rxjs": "^6.6.2"
7676
}
7777
}

packages/flyout/Readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ import Button from '../button/src/Button';
44
<Flyout trigger={
55
<Button type="primary">Click me!</Button>
66
} hasPadding>
7-
this is the flyout
7+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus eu mauris arcu. In ut nulla metus. Cras ut commodo nunc. Nullam augue massa, semper eget pharetra quis, lacinia sit amet metus. Proin magna felis, dictum sed arcu non, maximus tempor massa. Sed id sem sed nisl fringilla volutpat sed eu elit. Donec nec mauris eu sem euismod porttitor eget et dui.
88
</Flyout>
99
```

packages/flyout/rollup.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
2-
31
import resolve from '@rollup/plugin-node-resolve';
42
import babel from '@rollup/plugin-babel';
53
import pkg from './package.json';
4+
import sass from 'rollup-plugin-sass';
65

76
export default {
87
input: 'src/index.js',
@@ -12,6 +11,7 @@ export default {
1211
],
1312
plugins: [
1413
resolve(),
14+
sass({ insert: true }),
1515
babel({
1616
babelHelpers: 'bundled',
1717
exclude: ['node_modules/**'],

packages/flyout/src/Flyout.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import ReactDOM from 'react-dom';
44

55
import FlyoutContent from '../../flyout-button/src/FlyoutContent/FlyoutContent';
66

7+
import './Flyout.scss';
8+
79
const flyoutSizes = {
810
small: 'sm',
911
medium: 'md',

packages/flyout/src/Flyout.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@import '~@a-ui/core/src/styles/_quarks';
2+
3+
.m-flyout .m-flyout__content {
4+
max-height: 0;
5+
transition: visibility 0s ease-in-out .2s, opacity .2s ease-in-out, transform .2s ease-in-out, max-height .2s ease-in-out;
6+
}
7+
8+
.m-flyout.is-open .m-flyout__content {
9+
max-height: 1000000px;
10+
}

packages/form/Readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ const optionsDistrict = [
323323
<div>
324324
<Select label="District"
325325
id={"select-1"}
326+
description={"A brief description about districts"}
326327
label={"Districts"}
327328
name={"select-name"}
328329
value={"2030 Antwerpen"}
@@ -561,6 +562,7 @@ const Datepicker = require('./src').Datepicker;
561562
name={"datepicker-name"}
562563
label={"Datepicker with input mask"}
563564
format={"DD/MM/YYYY"}
565+
placeholder={"dd/mm/yyyy"}
564566
mask={"99/99/9999"}
565567
required={true}
566568
onChange={(date, isValid) => console.log('date is ' + date + ', and is valid ' + isValid)}

packages/form/src/Datepicker/Datepicker.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ type
4444
disabled?: boolean,
4545
/** If it should be free text input or click only */
4646
readOnly?: boolean,
47+
/** Set a placeholder. */
48+
placeholder?: string,
4749
/** enable/disable the days during the weekend. */
4850
noWeekends?: boolean,
4951
/** Every date less than this date will be disabled. */
@@ -52,6 +54,8 @@ type
5254
state?: InputStates,
5355
/** Description to be shown under input. */
5456
description?: string,
57+
/** Error description to be shown under input. */
58+
errorDescription?: string,
5559
/** Every date greater than this date will be disabled. */
5660
maxDate?: string,
5761
/** Event for when the date changes. */
@@ -187,10 +191,12 @@ class Datepicker extends Component<Props> {
187191
id,
188192
state,
189193
description,
194+
errorDescription,
190195
mask,
191196
required,
192197
disabled,
193198
readOnly,
199+
placeholder,
194200
name,
195201
format,
196202
locale = 'nl',
@@ -235,6 +241,7 @@ class Datepicker extends Component<Props> {
235241
name={name}
236242
id={id || this.defaultId}
237243
value={input}
244+
placeholder={placeholder}
238245
required={required}
239246
readOnly={readOnly}
240247
disabled={disabled}
@@ -260,6 +267,7 @@ class Datepicker extends Component<Props> {
260267
}
261268
</div>
262269
{description && <small>{description}</small>}
270+
{errorDescription && <small className="u-text-danger">{errorDescription}</small>}
263271
</div>
264272
;
265273
}

packages/form/src/Select/Select.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ type Props = {
3131
required?: boolean,
3232
loading?: boolean,
3333
placeholder?: string,
34+
description?: string,
35+
errorDescription?: string,
3436
options?: Array<SelectOption>,
3537
onChange?: (e: object) => void,
3638
value?: string,
@@ -51,6 +53,8 @@ class Select extends Component<Props> {
5153
id,
5254
label,
5355
name,
56+
description,
57+
errorDescription,
5458
inline,
5559
className,
5660
state,
@@ -103,6 +107,8 @@ class Select extends Component<Props> {
103107
</Option>
104108
))}
105109
</select>
110+
{description ? <small>{description}</small> : null}
111+
{errorDescription && <small className="u-text-danger">{errorDescription}</small>}
106112
{loading ? <Spinner size="small" className="ai" /> : <Icon name="ai-arrow-down-1" />}
107113
</div>
108114
</div>

0 commit comments

Comments
 (0)