@grantbii/design-system 1.0.46 → 1.0.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/atoms/Textarea.d.ts +4 -0
- package/core/atoms/Textarea.js +31 -0
- package/core/atoms/index.d.ts +1 -0
- package/core/atoms/index.js +1 -0
- package/package.json +1 -1
- package/stories/atoms/Textarea.stories.d.ts +7 -0
- package/stories/atoms/Textarea.stories.js +16 -0
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
declare const Textarea: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, {
|
|
2
|
+
$heightPixels?: number;
|
|
3
|
+
}>> & string;
|
|
4
|
+
export default Textarea;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import { Colors } from "../foundations";
|
|
3
|
+
const Textarea = styled.textarea `
|
|
4
|
+
height: ${({ $heightPixels = 100 }) => $heightPixels}px;
|
|
5
|
+
padding: 12px 16px;
|
|
6
|
+
border-radius: 6px;
|
|
7
|
+
|
|
8
|
+
&:disabled {
|
|
9
|
+
background-color: ${Colors.neutral.grey4};
|
|
10
|
+
border: 1px solid ${Colors.neutral.grey3};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
&:valid {
|
|
14
|
+
border: 1px solid ${Colors.neutral.grey3};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&:invalid {
|
|
18
|
+
border: 1px solid ${Colors.accent.red1};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&:focus&:valid {
|
|
22
|
+
border: 1px solid ${Colors.accent.blue1};
|
|
23
|
+
outline: 1px solid ${Colors.accent.blue1};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&:focus&:invalid {
|
|
27
|
+
border: 1px solid ${Colors.accent.red1};
|
|
28
|
+
outline: 1px solid ${Colors.accent.red1};
|
|
29
|
+
}
|
|
30
|
+
`;
|
|
31
|
+
export default Textarea;
|
package/core/atoms/index.d.ts
CHANGED
package/core/atoms/index.js
CHANGED
package/package.json
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Textarea } from "@/.";
|
|
2
|
+
import { Meta, StoryObj } from "@storybook/nextjs-vite";
|
|
3
|
+
declare const meta: Meta<typeof Textarea>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const BasicExample: Story;
|
|
7
|
+
export declare const WithValidation: Story;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Textarea } from "@/.";
|
|
2
|
+
const meta = {
|
|
3
|
+
title: "Atoms/Textarea",
|
|
4
|
+
component: Textarea,
|
|
5
|
+
tags: ["autodocs"],
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: "centered",
|
|
8
|
+
},
|
|
9
|
+
};
|
|
10
|
+
export default meta;
|
|
11
|
+
export const BasicExample = {
|
|
12
|
+
args: { placeholder: "Type here" },
|
|
13
|
+
};
|
|
14
|
+
export const WithValidation = {
|
|
15
|
+
args: { placeholder: "Must be at least 10 characters long", minLength: 10 },
|
|
16
|
+
};
|