@brut-ui/react 0.2.0 → 0.3.0

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/dist/index.cjs CHANGED
@@ -21,7 +21,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
23
  Button: () => Button,
24
- Input: () => Input
24
+ Input: () => Input,
25
+ Textarea: () => Textarea
25
26
  });
26
27
  module.exports = __toCommonJS(index_exports);
27
28
 
@@ -88,8 +89,45 @@ var Input = (0, import_react2.forwardRef)(function Input2({ size = INPUT_DEFAULT
88
89
  }
89
90
  );
90
91
  });
92
+
93
+ // src/components/textarea/textarea.tsx
94
+ var import_react3 = require("react");
95
+
96
+ // src/components/textarea/textarea.constants.ts
97
+ var TEXTAREA_DEFAULTS = {
98
+ size: "medium",
99
+ rows: 4
100
+ };
101
+
102
+ // src/components/textarea/textarea.tsx
103
+ var import_jsx_runtime3 = require("react/jsx-runtime");
104
+ var Textarea = (0, import_react3.forwardRef)(
105
+ function Textarea2({
106
+ size = TEXTAREA_DEFAULTS.size,
107
+ rows = TEXTAREA_DEFAULTS.rows,
108
+ error,
109
+ disabled,
110
+ ...rest
111
+ }, ref) {
112
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
113
+ "textarea",
114
+ {
115
+ ref,
116
+ "data-brut-textarea": "",
117
+ "data-size": size,
118
+ "data-error": error || void 0,
119
+ "data-disabled": disabled || void 0,
120
+ disabled,
121
+ "aria-invalid": error || void 0,
122
+ rows,
123
+ ...rest
124
+ }
125
+ );
126
+ }
127
+ );
91
128
  // Annotate the CommonJS export names for ESM import in node:
92
129
  0 && (module.exports = {
93
130
  Button,
94
- Input
131
+ Input,
132
+ Textarea
95
133
  });
package/dist/index.css CHANGED
@@ -98,3 +98,45 @@
98
98
  opacity: 0.4;
99
99
  cursor: not-allowed;
100
100
  }
101
+
102
+ /* src/components/textarea/textarea.css */
103
+ [data-brut-textarea] {
104
+ display: block;
105
+ box-sizing: border-box;
106
+ width: 100%;
107
+ font-family: var(--brut-font-mono);
108
+ font-weight: 400;
109
+ border: var(--brut-border);
110
+ border-radius: var(--brut-radius);
111
+ background: var(--brut-white);
112
+ color: var(--brut-black);
113
+ padding: var(--brut-space-sm) var(--brut-space-md);
114
+ line-height: 1.4;
115
+ resize: vertical;
116
+ }
117
+ [data-brut-textarea]::placeholder {
118
+ color: var(--brut-gray);
119
+ opacity: 1;
120
+ }
121
+ [data-brut-textarea][data-size=small] {
122
+ font-size: 0.75rem;
123
+ padding: var(--brut-space-xs) var(--brut-space-sm);
124
+ }
125
+ [data-brut-textarea][data-size=medium] {
126
+ font-size: 0.875rem;
127
+ }
128
+ [data-brut-textarea][data-size=large] {
129
+ font-size: 1.125rem;
130
+ padding: var(--brut-space-sm) var(--brut-space-lg);
131
+ }
132
+ [data-brut-textarea][data-error] {
133
+ border-color: var(--brut-error);
134
+ }
135
+ [data-brut-textarea]:focus-visible {
136
+ outline: var(--brut-focus-outline);
137
+ outline-offset: var(--brut-focus-offset);
138
+ }
139
+ [data-brut-textarea][data-disabled] {
140
+ opacity: 0.4;
141
+ cursor: not-allowed;
142
+ }
package/dist/index.d.cts CHANGED
@@ -63,4 +63,30 @@ interface InputProps extends Omit<ComponentPropsWithRef<"input">, "size"> {
63
63
  }
64
64
  declare const Input: (props: InputProps) => ReactNode;
65
65
 
66
- export { Button, type ButtonProps, type ButtonSize, type ButtonVariant, Input, type InputProps, type InputSize };
66
+ /** Available size presets for Textarea. */
67
+ declare const TEXTAREA_SIZES: readonly ["small", "medium", "large"];
68
+ type TextareaSize = (typeof TEXTAREA_SIZES)[number];
69
+
70
+ /**
71
+ * Textarea — a brutalist multiline text input.
72
+ *
73
+ * Renders an accessible textarea with thick square borders
74
+ * and monospace typography. Supports `small`, `medium`, and `large` sizes.
75
+ *
76
+ * Error state sets `aria-invalid` and `data-error` for styling hooks.
77
+ *
78
+ * @example
79
+ * ```tsx
80
+ * <Textarea placeholder="Write something..." />
81
+ * <Textarea size="large" error rows={6} />
82
+ * ```
83
+ */
84
+ interface TextareaProps extends Omit<ComponentPropsWithRef<"textarea">, "size"> {
85
+ /** Size preset. @default "medium" */
86
+ size?: TextareaSize;
87
+ /** Error state — sets `data-error` and `aria-invalid`. */
88
+ error?: boolean;
89
+ }
90
+ declare const Textarea: (props: TextareaProps) => ReactNode;
91
+
92
+ export { Button, type ButtonProps, type ButtonSize, type ButtonVariant, Input, type InputProps, type InputSize, Textarea, type TextareaProps, type TextareaSize };
package/dist/index.d.ts CHANGED
@@ -63,4 +63,30 @@ interface InputProps extends Omit<ComponentPropsWithRef<"input">, "size"> {
63
63
  }
64
64
  declare const Input: (props: InputProps) => ReactNode;
65
65
 
66
- export { Button, type ButtonProps, type ButtonSize, type ButtonVariant, Input, type InputProps, type InputSize };
66
+ /** Available size presets for Textarea. */
67
+ declare const TEXTAREA_SIZES: readonly ["small", "medium", "large"];
68
+ type TextareaSize = (typeof TEXTAREA_SIZES)[number];
69
+
70
+ /**
71
+ * Textarea — a brutalist multiline text input.
72
+ *
73
+ * Renders an accessible textarea with thick square borders
74
+ * and monospace typography. Supports `small`, `medium`, and `large` sizes.
75
+ *
76
+ * Error state sets `aria-invalid` and `data-error` for styling hooks.
77
+ *
78
+ * @example
79
+ * ```tsx
80
+ * <Textarea placeholder="Write something..." />
81
+ * <Textarea size="large" error rows={6} />
82
+ * ```
83
+ */
84
+ interface TextareaProps extends Omit<ComponentPropsWithRef<"textarea">, "size"> {
85
+ /** Size preset. @default "medium" */
86
+ size?: TextareaSize;
87
+ /** Error state — sets `data-error` and `aria-invalid`. */
88
+ error?: boolean;
89
+ }
90
+ declare const Textarea: (props: TextareaProps) => ReactNode;
91
+
92
+ export { Button, type ButtonProps, type ButtonSize, type ButtonVariant, Input, type InputProps, type InputSize, Textarea, type TextareaProps, type TextareaSize };
package/dist/index.js CHANGED
@@ -61,7 +61,44 @@ var Input = forwardRef2(function Input2({ size = INPUT_DEFAULTS.size, error, dis
61
61
  }
62
62
  );
63
63
  });
64
+
65
+ // src/components/textarea/textarea.tsx
66
+ import { forwardRef as forwardRef3 } from "react";
67
+
68
+ // src/components/textarea/textarea.constants.ts
69
+ var TEXTAREA_DEFAULTS = {
70
+ size: "medium",
71
+ rows: 4
72
+ };
73
+
74
+ // src/components/textarea/textarea.tsx
75
+ import { jsx as jsx3 } from "react/jsx-runtime";
76
+ var Textarea = forwardRef3(
77
+ function Textarea2({
78
+ size = TEXTAREA_DEFAULTS.size,
79
+ rows = TEXTAREA_DEFAULTS.rows,
80
+ error,
81
+ disabled,
82
+ ...rest
83
+ }, ref) {
84
+ return /* @__PURE__ */ jsx3(
85
+ "textarea",
86
+ {
87
+ ref,
88
+ "data-brut-textarea": "",
89
+ "data-size": size,
90
+ "data-error": error || void 0,
91
+ "data-disabled": disabled || void 0,
92
+ disabled,
93
+ "aria-invalid": error || void 0,
94
+ rows,
95
+ ...rest
96
+ }
97
+ );
98
+ }
99
+ );
64
100
  export {
65
101
  Button,
66
- Input
102
+ Input,
103
+ Textarea
67
104
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brut-ui/react",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Ultra-light brutalist React component library",
5
5
  "keywords": [
6
6
  "react",