-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add text-area component #80
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
base: main
Are you sure you want to change the base?
Changes from 3 commits
8b926db
2a64807
149d10d
1f3ebfb
16eb057
fba24ca
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| import { ScoutTextArea } from "@scouterna/ui-react"; | ||
| import preview from "#.storybook/preview"; | ||
|
|
||
| const meta = preview.meta({ | ||
| title: "Uncategorized/Text-Area", | ||
| component: ScoutTextArea, | ||
| parameters: { | ||
| layout: "centered", | ||
| }, | ||
| }); | ||
|
|
||
| export default meta; | ||
|
|
||
| export const BasicExample = meta.story({ | ||
| args: { | ||
| label: "", | ||
| }, | ||
| render: (args) => <ScoutTextArea {...args} />, | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # scout-text-area | ||
|
|
||
| <!-- Auto Generated Below --> | ||
|
|
||
|
|
||
| ## Properties | ||
|
|
||
| | Property | Attribute | Description | Type | Default | | ||
| | ------------- | ------------- | ----------- | --------- | ----------- | | ||
| | `autofocus` | `autofocus` | | `boolean` | `false` | | ||
| | `disabled` | `disabled` | | `boolean` | `undefined` | | ||
| | `form` | `form` | | `string` | `undefined` | | ||
| | `label` | `label` | | `string` | `undefined` | | ||
| | `maxLength` | `max-length` | | `number` | `undefined` | | ||
| | `placeholder` | `placeholder` | | `string` | `undefined` | | ||
| | `readOnly` | `read-only` | | `boolean` | `undefined` | | ||
| | `required` | `required` | | `boolean` | `undefined` | | ||
| | `value` | `value` | | `string` | `undefined` | | ||
|
|
||
|
|
||
| ---------------------------------------------- | ||
|
|
||
| *Built with [StencilJS](https://stenciljs.com/)* |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| :host { | ||
| display: inline-flex; | ||
| } | ||
|
|
||
| .flexbox{ | ||
| display: inline-flex; | ||
| flex-direction: column; | ||
| padding: 0.5rem; | ||
| } | ||
|
|
||
| .textarea{ | ||
| resize: none; | ||
| height: var(--spacing-24); | ||
| width: var(--spacing-50); | ||
| padding: var(--spacing-2); | ||
| font: var(--type-body-base); | ||
| border: 1px solid var(--color-gray-300); | ||
| border-radius: var(--spacing-2); | ||
| background-color: var(--color-white); | ||
| color: var(--color-text-base); | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,50 @@ | ||||||||||
| import { Component, h, Prop } from "@stencil/core"; | ||||||||||
|
|
||||||||||
| @Component({ | ||||||||||
| tag: "scout-text-area", | ||||||||||
| styleUrl: "text-area.css", | ||||||||||
| shadow: { | ||||||||||
| delegatesFocus: true, | ||||||||||
| }, | ||||||||||
|
||||||||||
| shadow: { | |
| delegatesFocus: true, | |
| }, | |
| scoped: true, |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we maybe add the name prop as well? I just realized we don't have it on any of our inputs, so I'll add it to the rest in a separate PR 😊
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should leave out the width and height and let the consumer control this as it will most likely depend on their layout. Maybe instead we can expose the rows attribute as a prop and set the default to something a bit higher, say 3?