Skip to content

Commit

Permalink
πŸ’₯ remove default DatePicker style import from component (#3346)
Browse files Browse the repository at this point in the history
* πŸ’₯ remove default DatePicker style import from component

* πŸ“ set version to unreleased
  • Loading branch information
torleifhalseth authored Mar 12, 2024
1 parent bd0a838 commit e0bb72e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions packages/eds-lab-react/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [unreleased] - 2024-03-12

### Changed

- πŸ—‘οΈ `DatePicker`: We removed import of CSS. You need to require the CSS file from `react-datepicker`. We will continue providing the style overrides encapsulated in our DatePicker component abstraction.

## [0.7.6] - 2024-03-01

### Changed
Expand Down
7 changes: 3 additions & 4 deletions packages/eds-lab-react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@ If you use Typescript, make sure you have typescript >= 3.8 as a devDependency:
npm install typescript --save-dev
```

## Known issues and workarounds

### Datepicker
### DatePicker

Under some circumstances `<Datepicker />` is missing it’s styles. A temporary workaround is to import the css explicitly as reported in issue [#2081](https://github.com/equinor/design-system/issues/2081).
You will need to require the CSS file from the `react-datepicker` package (or provide your own). The example below shows how to include the CSS from this package if your build system supports requiring CSS files.

```css
import 'react-datepicker/dist/react-datepicker.css';
```
```
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'react-datepicker/dist/react-datepicker.css'

import { useState } from 'react'
import styled from 'styled-components'
import { StoryObj, Meta } from '@storybook/react'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import DatePicker, {
registerLocale,
ReactDatePickerProps,
} from 'react-datepicker'
import 'react-datepicker/dist/react-datepicker.css'
import { enGB } from 'date-fns/locale'
import styled, {
css,
Expand Down

0 comments on commit e0bb72e

Please sign in to comment.