Skip to content

Commit

Permalink
Merge pull request #205 from dnbexperience/develop
Browse files Browse the repository at this point in the history
use core-js v2 instead of 3
  • Loading branch information
tujoworker authored Jun 20, 2019
2 parents d5a2ef3 + 82adec0 commit 637d67e
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 42 deletions.
4 changes: 3 additions & 1 deletion packages/dnb-design-system-portal/scripts/commitPages.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ if (require.main === module) {
commitToBranch({
requiredBranch: 'develop',
what: 'pages',
filePathsWhitelist: ['/version.json', '/src/pages/', '/src/uilib/'],
skipCI: files => files.length === 1, // in case we only update the "version.lock"
filePathsWhitelist: ['version.json', '/src/pages/', '/src/uilib/'],
// isNotAFeature: ['version.json'],
isFeature: false
})
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,22 @@ draft: true

import ComponentBox from 'Tags/ComponentBox'

<ComponentBox hideCode caption="Default Textarea">
{`
<FormRow vertical={true}>
<label className="dnb-form-label" htmlFor="textarea-default">Label:</label>
<textarea id="textarea-default" className="dnb-textarea" rows="2" cols="20" defaultValue="Nec litora inceptos vestibulum id interdum donec gravida nostra lacinia bibendum hendrerit porttitor volutpat nam duis nisl scelerisque sapien erat" />
</FormRow>
`}
</ComponentBox>
# Textarea

<ComponentBox hideCode caption="Disabled Textarea">
{`
<FormRow>
<label className="dnb-form-label" htmlFor="vestibulum">Label:</label>
<textarea id="vestibulum" className="dnb-textarea" rows="5" cols="33" disabled defaultValue="Nec litora inceptos vestibulum id interdum donec gravida nostra lacinia bibendum hendrerit porttitor volutpat nam duis nisl scelerisque sapien erat" />
</FormRow>
`}
</ComponentBox>
This is a demo on how to get a `textarea` style on a vanilla HTML element. You may have a look at the [React Textarea component](/uilib/components/textarea) as well.

## Demos

<ComponentBox hideCode caption="Textarea with status message">
<ComponentBox hideCode caption="Default Textarea">
{`
<FormRow vertical={true}>
<label className="dnb-form-label" htmlFor="vestibulum">Label:</label>
<textarea id="vestibulum" className="dnb-textarea status--error" rows="5" cols="33" defaultValue="Nec litora inceptos vestibulum id interdum donec gravida nostra lacinia bibendum hendrerit porttitor volutpat nam duis nisl scelerisque sapien erat" />
<FormStatus text="Message to the user" />
</FormRow>
<label className="dnb-form-label" htmlFor="textarea-default">Label:</label>
<textarea id="textarea-default" className="dnb-textarea" rows="2" cols="20" defaultValue="Nec litora inceptos vestibulum id interdum donec gravida nostra lacinia bibendum hendrerit porttitor volutpat nam duis nisl scelerisque sapien erat" />
`}
</ComponentBox>
<ComponentBox hideCode>
<ComponentBox hideCode caption="Disabled Textarea">
{`
<FormRow vertical={true}>
<label className="dnb-form-label" htmlFor="gravida">Label:</label>
<textarea id="gravida" className="dnb-textarea" rows="3" cols="33" defaultValue="Nec litora inceptos vestibulum id interdum donec gravida nostra lacinia bibendum hendrerit porttitor volutpat nam duis nisl scelerisque sapien erat" />
<FormStatus status="info" text="Message to the user" />
</FormRow>
<label className="dnb-form-label" htmlFor="textarea-disabled">Label:</label>
<textarea id="textarea-disabled" className="dnb-textarea" rows="5" cols="33" disabled defaultValue="Nec litora inceptos vestibulum id interdum donec gravida nostra lacinia bibendum hendrerit porttitor volutpat nam duis nisl scelerisque sapien erat" />
`}
</ComponentBox>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ draft: true
---

import Examples from 'Pages/uilib/components/textarea/Examples'
import TextareaAsElement from 'Pages/uilib/components/textarea/textarea-element'

## Description

Expand All @@ -13,6 +12,4 @@ The `Textarea` component has to be used as a multi-line text input control with

<Examples />

### Textarea as HTML element only

<TextareaAsElement />
[Textarea as HTML element only](/uilib/components/textarea/textarea-element/)
5 changes: 5 additions & 0 deletions packages/dnb-ui-lib/.ncurc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"reject": [
"core-js"
]
}
4 changes: 2 additions & 2 deletions packages/dnb-ui-lib/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const production = {
'@babel/preset-env',
{
useBuiltIns: 'usage',
corejs: 3
corejs: 2
}
],
'@babel/preset-react'
Expand Down Expand Up @@ -80,7 +80,7 @@ module.exports = {
'@babel/preset-env',
{
useBuiltIns: 'usage',
corejs: 3,
corejs: 2,
modules: false
}
],
Expand Down
2 changes: 1 addition & 1 deletion packages/dnb-ui-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"@babel/runtime": "^7.4.5",
"body-scroll-lock": "^2.6.1",
"classnames": "^2.2.6",
"core-js": "3",
"core-js": "2",
"date-fns": "^1.30.1",
"keycode": "^2.2.0",
"react-text-mask": "^5.4.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/dnb-ui-lib/scripts/figma/version.lock
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"1a3caba565dddc0a936aaddc29a82887":"139944278"}
{"1a3caba565dddc0a936aaddc29a82887":"142118864"}
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6461,11 +6461,6 @@ core-js@2, core-js@^2.4.0, core-js@^2.4.1, core-js@^2.5.0, core-js@^2.5.7, core-
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.5.tgz#44bc8d249e7fb2ff5d00e0341a7ffb94fbf67895"
integrity sha512-klh/kDpwX8hryYL14M9w/xei6vrv6sE8gTHDG7/T/+SEovB/G4ejwcfE/CBzO6Edsu+OETZMZ3wcX/EjUkrl5A==

core-js@3:
version "3.0.1"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.0.1.tgz#1343182634298f7f38622f95e73f54e48ddf4738"
integrity sha512-sco40rF+2KlE0ROMvydjkrVMMG1vYilP2ALoRXcYR4obqbYIuV3Bg+51GEDW+HF8n7NRA+iaA4qD0nD9lo9mew==

[email protected], core-js@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.0.0.tgz#a8dbfa978d29bfc263bfb66c556d0ca924c28957"
Expand Down

0 comments on commit 637d67e

Please sign in to comment.