@compilorama/compy 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.
Files changed (37) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/cjs/components/input/input.css +1 -0
  3. package/dist/cjs/components/input/input.js +1 -0
  4. package/dist/cjs/components/input/input.md +32 -0
  5. package/dist/cjs/components/input/tokens.md +22 -0
  6. package/dist/cjs/components/select/select.css +1 -0
  7. package/dist/cjs/components/select/select.js +1 -0
  8. package/dist/cjs/components/select/select.md +33 -0
  9. package/dist/cjs/components/select/tokens.md +25 -0
  10. package/dist/cjs/components/textarea/textarea.css +1 -0
  11. package/dist/cjs/components/textarea/textarea.js +1 -0
  12. package/dist/cjs/components/textarea/textarea.md +32 -0
  13. package/dist/cjs/components/textarea/tokens.md +22 -0
  14. package/dist/cjs/docs/components.md +3 -0
  15. package/dist/cjs/docs/tokens.md +13 -0
  16. package/dist/cjs/index.js +1 -1
  17. package/dist/cjs/vars.css +1 -1
  18. package/dist/docs/components.md +3 -0
  19. package/dist/docs/tokens.md +13 -0
  20. package/dist/es6/components/input/input.css +1 -0
  21. package/dist/es6/components/input/input.js +1 -0
  22. package/dist/es6/components/input/input.md +32 -0
  23. package/dist/es6/components/input/tokens.md +22 -0
  24. package/dist/es6/components/select/select.css +1 -0
  25. package/dist/es6/components/select/select.js +1 -0
  26. package/dist/es6/components/select/select.md +33 -0
  27. package/dist/es6/components/select/tokens.md +25 -0
  28. package/dist/es6/components/textarea/textarea.css +1 -0
  29. package/dist/es6/components/textarea/textarea.js +1 -0
  30. package/dist/es6/components/textarea/textarea.md +32 -0
  31. package/dist/es6/components/textarea/tokens.md +22 -0
  32. package/dist/es6/docs/components.md +3 -0
  33. package/dist/es6/docs/tokens.md +13 -0
  34. package/dist/es6/index.js +1 -1
  35. package/dist/es6/vars.css +1 -1
  36. package/dist/index.d.ts +7 -1
  37. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [0.3.0](https://github.com/compilorama/compy/compare/v0.2.0...v0.3.0) (2026-11-17)
2
+
3
+
4
+ ### Features
5
+
6
+ * add Input, Select, and Textarea form components ([986374e](https://github.com/compilorama/compy/commit/986374e9eb2830087a8cf3154482a059952c108d))
7
+
1
8
  # [0.2.0](https://github.com/compilorama/compy/compare/v0.1.0...v0.2.0) (2026-11-16)
2
9
 
3
10
 
@@ -0,0 +1 @@
1
+ .c-input{--c-input-background: var(--c-color-gray-95);--c-input-background-focus: #ffffff;--c-input-background-disabled: var(--c-color-gray-85);--c-input-content: var(--c-color-gray-15);--c-input-content-disabled: var(--c-color-gray-30);--c-input-placeholder: var(--c-color-gray-60);--c-input-placeholder-focus: var(--c-color-gray-70);--c-input-placeholder-disabled: var(--c-color-gray-50);--c-input-border-color: var(--c-color-gray-85);--c-input-border-color-invalid: var(--c-color-red-70);--c-input-border-color-disabled: var(--c-color-gray-85);--c-input-radius: 10px;--c-input-height: 40px;--c-input-padding: 10px 15px;box-sizing:border-box;width:100%;height:var(--c-input-height);padding:var(--c-input-padding);background:var(--c-input-background);color:var(--c-input-content);font-family:var(--c-font-family-primary);font-size:1rem;line-height:1;border:1px solid var(--c-input-border-color);border-radius:var(--c-input-radius);outline:none;box-shadow:0 0 0 0 var(--c-color-gray-95);transition:all .3s ease-in}.c-input::placeholder{color:var(--c-input-placeholder)}.c-input:focus-visible{background:var(--c-input-background-focus);box-shadow:0 0 0 5px var(--c-color-gray-95)}.c-input:focus-visible::placeholder{color:var(--c-input-placeholder-focus)}.c-input:disabled{background:var(--c-input-background-disabled);color:var(--c-input-content-disabled);border-color:var(--c-input-border-color-disabled)}.c-input:disabled::placeholder{color:var(--c-input-placeholder-disabled)}.c-input.is-invalid{border-color:var(--c-input-border-color-invalid)}
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0,require("./input.css");var _jsxRuntime=require("react/jsx-runtime");const Input=({invalid:s,className:t,...e})=>{const u=buildInputClasses({invalid:s,className:t});return(0,_jsxRuntime.jsx)("input",{className:u,...e})};function buildInputClasses({invalid:s,className:t}){const e=["c-input"];return s&&e.push("is-invalid"),[...e,t].filter(Boolean).join(" ")}var _default=exports.default=Input;
@@ -0,0 +1,32 @@
1
+ ---
2
+ name: Input
3
+ description: A single-line text field that extends the native HTML input element.
4
+ purpose: Collect short text values in forms with consistent field styling and error indication.
5
+ ---
6
+
7
+ # Input
8
+
9
+ A single-line text field. It extends the native HTML `input` element, so every native attribute (`type`, `value`, `placeholder`, `disabled`, `onChange`, etc.) is accepted. The component adds one visual prop, `invalid`, that marks the field as having an error.
10
+
11
+ ## Props
12
+
13
+ The Input API extends the native HTML `input` attributes. Props such as `disabled` and `placeholder` come from the native element and are not listed below.
14
+
15
+ <!-- BEGIN GENERATED PROPS -->
16
+ _Also inherits all props from `InputHTMLAttributes<HTMLInputElement>`._
17
+
18
+ | Name | Type | Required | Default | Description |
19
+ | --- | --- | --- | --- | --- |
20
+ | invalid | `boolean` | No | `false` | Marks the field as invalid by changing its border to the error color. |
21
+ <!-- END GENERATED PROPS -->
22
+
23
+ ## When to use
24
+
25
+ - Collecting short text such as name, email, or search queries
26
+ - Form fields where a single line of text is enough
27
+ - Surfacing validation errors with the `invalid` prop alongside accessible error messaging
28
+
29
+ ## When NOT to use
30
+
31
+ - **Multi-line text** — use a textarea for longer or formatted text.
32
+ - **Fixed option lists** — use a select or radio group when the user must pick from predefined choices.
@@ -0,0 +1,22 @@
1
+ # Input tokens
2
+
3
+ Generated from `src/components/input/input.css`.
4
+
5
+ ## Base tokens
6
+
7
+ | Token | Declared value | Resolution |
8
+ | --- | --- | --- |
9
+ | `--c-input-background` | `var(--c-color-gray-95)` | `var(--c-color-gray-95) → hsl(0 0% 95%)` |
10
+ | `--c-input-background-disabled` | `var(--c-color-gray-85)` | `var(--c-color-gray-85) → hsl(0 0% 85%)` |
11
+ | `--c-input-background-focus` | `#ffffff` | `#ffffff` |
12
+ | `--c-input-border-color` | `var(--c-color-gray-85)` | `var(--c-color-gray-85) → hsl(0 0% 85%)` |
13
+ | `--c-input-border-color-disabled` | `var(--c-color-gray-85)` | `var(--c-color-gray-85) → hsl(0 0% 85%)` |
14
+ | `--c-input-border-color-invalid` | `var(--c-color-red-70)` | `var(--c-color-red-70) → hsl(0 100% 70%)` |
15
+ | `--c-input-content` | `var(--c-color-gray-15)` | `var(--c-color-gray-15) → hsl(0 0% 15%)` |
16
+ | `--c-input-content-disabled` | `var(--c-color-gray-30)` | `var(--c-color-gray-30) → hsl(0 0% 30%)` |
17
+ | `--c-input-height` | `40px` | `40px` |
18
+ | `--c-input-padding` | `10px 15px` | `10px 15px` |
19
+ | `--c-input-placeholder` | `var(--c-color-gray-60)` | `var(--c-color-gray-60) → hsl(0 0% 60%)` |
20
+ | `--c-input-placeholder-disabled` | `var(--c-color-gray-50)` | `var(--c-color-gray-50) → hsl(0 0% 50%)` |
21
+ | `--c-input-placeholder-focus` | `var(--c-color-gray-70)` | `var(--c-color-gray-70) → hsl(0 0% 70%)` |
22
+ | `--c-input-radius` | `10px` | `10px` |
@@ -0,0 +1 @@
1
+ .c-select{--c-select-background: var(--c-color-gray-95);--c-select-background-focus: #ffffff;--c-select-background-disabled: var(--c-color-gray-85);--c-select-content: var(--c-color-gray-15);--c-select-content-disabled: var(--c-color-gray-30);--c-select-placeholder: var(--c-color-gray-60);--c-select-placeholder-focus: var(--c-color-gray-70);--c-select-placeholder-disabled: var(--c-color-gray-50);--c-select-border-color: var(--c-select-background);--c-select-border-color-focus: var(--c-color-gray-85);--c-select-border-color-invalid: var(--c-color-red-70);--c-select-border-color-disabled: var(--c-select-background-disabled);--c-select-arrow: url("data:image/svg+xml,%3Csvg%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%2040%2040%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20style%3D%22fill-rule%3Aevenodd%3Bclip-rule%3Aevenodd%3Bstroke-linecap%3Around%3Bstroke-miterlimit%3A10%3B%22%3E%20%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%2240%22%20height%3D%2240%22%20style%3D%22fill%3Anone%3B%22%2F%3E%20%3Cpath%20d%3D%22M23.07%2C16L20%2C12.93L16.93%2C16M16.93%2C24L20%2C27.07L23.07%2C24%22%20style%3D%22fill%3Anone%3Bfill-rule%3Anonzero%3Bstroke%3Argb(38%2C38%2C38)%3Bstroke-width%3A1px%3B%22%2F%3E%20%3C%2Fsvg%3E");--c-select-arrow-disabled: url("data:image/svg+xml,%3Csvg%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%2040%2040%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20style%3D%22fill-rule%3Aevenodd%3Bclip-rule%3Aevenodd%3Bstroke-linecap%3Around%3Bstroke-miterlimit%3A10%3B%22%3E%20%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%2240%22%20height%3D%2240%22%20style%3D%22fill%3Anone%3B%22%2F%3E%20%3Cpath%20d%3D%22M23.07%2C16L20%2C12.93L16.93%2C16M16.93%2C24L20%2C27.07L23.07%2C24%22%20style%3D%22fill%3Anone%3Bfill-rule%3Anonzero%3Bstroke%3Argb(128%2C128%2C128)%3Bstroke-width%3A1px%3B%22%2F%3E%20%3C%2Fsvg%3E");--c-select-radius: 10px;--c-select-height: 40px;--c-select-padding: 10px 40px 10px 15px;appearance:none;-webkit-appearance:none;-moz-appearance:none;box-sizing:border-box;width:100%;height:var(--c-select-height);padding:var(--c-select-padding);background-color:var(--c-select-background);background-image:var(--c-select-arrow);background-repeat:no-repeat;background-position:right center;background-size:40px 40px;color:var(--c-select-content);font-family:var(--c-font-family-primary);font-size:1rem;line-height:1;border:1px solid var(--c-select-border-color);border-radius:var(--c-select-radius);outline:none;box-shadow:0 0 0 0 var(--c-color-gray-95);cursor:pointer;transition:all .3s ease-in}.c-select:focus-visible{background-color:var(--c-select-background-focus);border-color:var(--c-select-border-color-focus);box-shadow:0 0 0 5px var(--c-color-gray-95)}.c-select:disabled{background-color:var(--c-select-background-disabled);background-image:var(--c-select-arrow-disabled);color:var(--c-select-content-disabled);border-color:var(--c-select-border-color-disabled);cursor:default;opacity:1}.c-select.is-blank{color:var(--c-select-placeholder)}.c-select.is-blank:focus-visible{color:var(--c-select-placeholder-focus)}.c-select.is-blank:disabled{color:var(--c-select-placeholder-disabled)}.c-select.is-invalid{border-color:var(--c-select-border-color-invalid)}
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _react=require("react");require("./select.css");var _jsxRuntime=require("react/jsx-runtime");const Select=({invalid:t,className:r,value:s,onChange:e,children:n,...u})=>{const a=(0,_react.useRef)(),[i,l]=(0,_react.useState)(!1),o=buildSelectClasses({invalid:t,isBlank:i,className:r}),f=c=>{l(c.target.value===""),e?.(c)};return(0,_react.useEffect)(()=>{l(a.current.value==="")},[s]),(0,_jsxRuntime.jsx)("select",{ref:a,className:o,value:s,...u,onChange:f,children:n})};function buildSelectClasses({invalid:t,isBlank:r,className:s}){const e=["c-select"];return t&&e.push("is-invalid"),r&&e.push("is-blank"),[...e,s].filter(Boolean).join(" ")}var _default=exports.default=Select;
@@ -0,0 +1,33 @@
1
+ ---
2
+ name: Select
3
+ description: Dropdown field that lets the user choose one option from a fixed list.
4
+ purpose: Let the user choose one option from a fixed list.
5
+ ---
6
+
7
+ # Select
8
+
9
+ A dropdown field. It extends the native HTML `select` element, so every native attribute (`value`, `multiple`, `disabled`, `onChange`, etc.) is accepted. The component adds one visual prop, `invalid`, that marks the field as having an error. The border matches the fill color in every state except `focus-visible` (`gray-85` on a white fill) and `invalid` (`red-70`).
10
+
11
+ ## Props
12
+
13
+ The Select API extends the native HTML `select` attributes. Props such as `disabled` and `value` come from the native element and are not listed below.
14
+
15
+ <!-- BEGIN GENERATED PROPS -->
16
+ _Also inherits all props from `SelectHTMLAttributes<HTMLSelectElement>`._
17
+
18
+ | Name | Type | Required | Default | Description |
19
+ | --- | --- | --- | --- | --- |
20
+ | children | `ReactNode` | No | `undefined` | Option elements rendered inside the select. |
21
+ | invalid | `boolean` | No | `false` | Marks the field as invalid by changing its border to the error color. |
22
+ <!-- END GENERATED PROPS -->
23
+
24
+ ## When to use
25
+
26
+ - Choosing one option from a fixed list of values
27
+ - Form fields where a compact dropdown is enough
28
+ - Surfacing validation errors with the `invalid` prop alongside accessible error messaging
29
+
30
+ ## When NOT to use
31
+
32
+ - **Free text** — use Input or Textarea when the user types their own value.
33
+ - **Few always-visible options** — use a radio group when all choices should stay on screen.
@@ -0,0 +1,25 @@
1
+ # Select tokens
2
+
3
+ Generated from `src/components/select/select.css`.
4
+
5
+ ## Base tokens
6
+
7
+ | Token | Declared value | Resolution |
8
+ | --- | --- | --- |
9
+ | `--c-select-arrow` | `url("data:image/svg+xml,%3Csvg%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%2040%2040%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20style%3D%22fill-rule%3Aevenodd%3Bclip-rule%3Aevenodd%3Bstroke-linecap%3Around%3Bstroke-miterlimit%3A10%3B%22%3E%20%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%2240%22%20height%3D%2240%22%20style%3D%22fill%3Anone%3B%22%2F%3E%20%3Cpath%20d%3D%22M23.07%2C16L20%2C12.93L16.93%2C16M16.93%2C24L20%2C27.07L23.07%2C24%22%20style%3D%22fill%3Anone%3Bfill-rule%3Anonzero%3Bstroke%3Argb(38%2C38%2C38)%3Bstroke-width%3A1px%3B%22%2F%3E%20%3C%2Fsvg%3E")` | `url("data:image/svg+xml,%3Csvg%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%2040%2040%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20style%3D%22fill-rule%3Aevenodd%3Bclip-rule%3Aevenodd%3Bstroke-linecap%3Around%3Bstroke-miterlimit%3A10%3B%22%3E%20%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%2240%22%20height%3D%2240%22%20style%3D%22fill%3Anone%3B%22%2F%3E%20%3Cpath%20d%3D%22M23.07%2C16L20%2C12.93L16.93%2C16M16.93%2C24L20%2C27.07L23.07%2C24%22%20style%3D%22fill%3Anone%3Bfill-rule%3Anonzero%3Bstroke%3Argb(38%2C38%2C38)%3Bstroke-width%3A1px%3B%22%2F%3E%20%3C%2Fsvg%3E")` |
10
+ | `--c-select-arrow-disabled` | `url("data:image/svg+xml,%3Csvg%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%2040%2040%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20style%3D%22fill-rule%3Aevenodd%3Bclip-rule%3Aevenodd%3Bstroke-linecap%3Around%3Bstroke-miterlimit%3A10%3B%22%3E%20%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%2240%22%20height%3D%2240%22%20style%3D%22fill%3Anone%3B%22%2F%3E%20%3Cpath%20d%3D%22M23.07%2C16L20%2C12.93L16.93%2C16M16.93%2C24L20%2C27.07L23.07%2C24%22%20style%3D%22fill%3Anone%3Bfill-rule%3Anonzero%3Bstroke%3Argb(128%2C128%2C128)%3Bstroke-width%3A1px%3B%22%2F%3E%20%3C%2Fsvg%3E")` | `url("data:image/svg+xml,%3Csvg%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%2040%2040%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20style%3D%22fill-rule%3Aevenodd%3Bclip-rule%3Aevenodd%3Bstroke-linecap%3Around%3Bstroke-miterlimit%3A10%3B%22%3E%20%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%2240%22%20height%3D%2240%22%20style%3D%22fill%3Anone%3B%22%2F%3E%20%3Cpath%20d%3D%22M23.07%2C16L20%2C12.93L16.93%2C16M16.93%2C24L20%2C27.07L23.07%2C24%22%20style%3D%22fill%3Anone%3Bfill-rule%3Anonzero%3Bstroke%3Argb(128%2C128%2C128)%3Bstroke-width%3A1px%3B%22%2F%3E%20%3C%2Fsvg%3E")` |
11
+ | `--c-select-background` | `var(--c-color-gray-95)` | `var(--c-color-gray-95) → hsl(0 0% 95%)` |
12
+ | `--c-select-background-disabled` | `var(--c-color-gray-85)` | `var(--c-color-gray-85) → hsl(0 0% 85%)` |
13
+ | `--c-select-background-focus` | `#ffffff` | `#ffffff` |
14
+ | `--c-select-border-color` | `var(--c-select-background)` | `var(--c-select-background) → var(--c-color-gray-95) → hsl(0 0% 95%)` |
15
+ | `--c-select-border-color-disabled` | `var(--c-select-background-disabled)` | `var(--c-select-background-disabled) → var(--c-color-gray-85) → hsl(0 0% 85%)` |
16
+ | `--c-select-border-color-focus` | `var(--c-color-gray-85)` | `var(--c-color-gray-85) → hsl(0 0% 85%)` |
17
+ | `--c-select-border-color-invalid` | `var(--c-color-red-70)` | `var(--c-color-red-70) → hsl(0 100% 70%)` |
18
+ | `--c-select-content` | `var(--c-color-gray-15)` | `var(--c-color-gray-15) → hsl(0 0% 15%)` |
19
+ | `--c-select-content-disabled` | `var(--c-color-gray-30)` | `var(--c-color-gray-30) → hsl(0 0% 30%)` |
20
+ | `--c-select-height` | `40px` | `40px` |
21
+ | `--c-select-padding` | `10px 40px 10px 15px` | `10px 40px 10px 15px` |
22
+ | `--c-select-placeholder` | `var(--c-color-gray-60)` | `var(--c-color-gray-60) → hsl(0 0% 60%)` |
23
+ | `--c-select-placeholder-disabled` | `var(--c-color-gray-50)` | `var(--c-color-gray-50) → hsl(0 0% 50%)` |
24
+ | `--c-select-placeholder-focus` | `var(--c-color-gray-70)` | `var(--c-color-gray-70) → hsl(0 0% 70%)` |
25
+ | `--c-select-radius` | `10px` | `10px` |
@@ -0,0 +1 @@
1
+ .c-textarea{--c-textarea-background: var(--c-color-gray-95);--c-textarea-background-focus: #ffffff;--c-textarea-background-disabled: var(--c-color-gray-85);--c-textarea-content: var(--c-color-gray-15);--c-textarea-content-disabled: var(--c-color-gray-30);--c-textarea-placeholder: var(--c-color-gray-60);--c-textarea-placeholder-focus: var(--c-color-gray-70);--c-textarea-placeholder-disabled: var(--c-color-gray-50);--c-textarea-border-color: var(--c-color-gray-85);--c-textarea-border-color-invalid: var(--c-color-red-70);--c-textarea-border-color-disabled: var(--c-color-gray-85);--c-textarea-radius: 10px;--c-textarea-min-height: 40px;--c-textarea-padding: 10px 15px;box-sizing:border-box;width:100%;min-height:var(--c-textarea-min-height);padding:var(--c-textarea-padding);background:var(--c-textarea-background);color:var(--c-textarea-content);font-family:var(--c-font-family-primary);font-size:1rem;border:1px solid var(--c-textarea-border-color);border-radius:var(--c-textarea-radius);resize:vertical;outline:none;box-shadow:0 0 0 0 var(--c-color-gray-95);transition:background .3s ease-in,box-shadow .3s ease-in,border-color .3s ease-in,color .3s ease-in}.c-textarea::placeholder{color:var(--c-textarea-placeholder)}.c-textarea:focus-visible{background:var(--c-textarea-background-focus);box-shadow:0 0 0 5px var(--c-color-gray-95)}.c-textarea:focus-visible::placeholder{color:var(--c-textarea-placeholder-focus)}.c-textarea:disabled{background:var(--c-textarea-background-disabled);color:var(--c-textarea-content-disabled);border-color:var(--c-textarea-border-color-disabled)}.c-textarea:disabled::placeholder{color:var(--c-textarea-placeholder-disabled)}.c-textarea.is-invalid{border-color:var(--c-textarea-border-color-invalid)}
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0,require("./textarea.css");var _jsxRuntime=require("react/jsx-runtime");const Textarea=({invalid:t,className:s,...e})=>{const r=buildTextareaClasses({invalid:t,className:s});return(0,_jsxRuntime.jsx)("textarea",{className:r,...e})};function buildTextareaClasses({invalid:t,className:s}){const e=["c-textarea"];return t&&e.push("is-invalid"),[...e,s].filter(Boolean).join(" ")}var _default=exports.default=Textarea;
@@ -0,0 +1,32 @@
1
+ ---
2
+ name: Textarea
3
+ description: Multi-line text field that collects a longer text value from the user.
4
+ purpose: Collect a longer text value such as a comment or a message.
5
+ ---
6
+
7
+ # Textarea
8
+
9
+ A multi-line text field. It extends the native HTML `textarea` element, so every native attribute (`value`, `rows`, `disabled`, `onChange`, etc.) is accepted. The component adds one visual prop, `invalid`, that marks the field as having an error. Its visual states match the Input.
10
+
11
+ ## Props
12
+
13
+ The Textarea API extends the native HTML `textarea` attributes. Props such as `disabled` come from the native element and are not listed below.
14
+
15
+ <!-- BEGIN GENERATED PROPS -->
16
+ _Also inherits all props from `TextareaHTMLAttributes<HTMLTextAreaElement>`._
17
+
18
+ | Name | Type | Required | Default | Description |
19
+ | --- | --- | --- | --- | --- |
20
+ | invalid | `boolean` | No | `false` | Marks the field as invalid by changing its border to the error color. |
21
+ <!-- END GENERATED PROPS -->
22
+
23
+ ## When to use
24
+
25
+ - Collecting longer text such as comments, messages, or descriptions
26
+ - Form fields where the user needs more than one line
27
+ - Surfacing validation errors with the `invalid` prop alongside accessible error messaging
28
+
29
+ ## When NOT to use
30
+
31
+ - **Short single-line text** — use Input for names, emails, or search queries.
32
+ - **Fixed option lists** — use a select or radio group when the user must pick from predefined choices.
@@ -0,0 +1,22 @@
1
+ # Textarea tokens
2
+
3
+ Generated from `src/components/textarea/textarea.css`.
4
+
5
+ ## Base tokens
6
+
7
+ | Token | Declared value | Resolution |
8
+ | --- | --- | --- |
9
+ | `--c-textarea-background` | `var(--c-color-gray-95)` | `var(--c-color-gray-95) → hsl(0 0% 95%)` |
10
+ | `--c-textarea-background-disabled` | `var(--c-color-gray-85)` | `var(--c-color-gray-85) → hsl(0 0% 85%)` |
11
+ | `--c-textarea-background-focus` | `#ffffff` | `#ffffff` |
12
+ | `--c-textarea-border-color` | `var(--c-color-gray-85)` | `var(--c-color-gray-85) → hsl(0 0% 85%)` |
13
+ | `--c-textarea-border-color-disabled` | `var(--c-color-gray-85)` | `var(--c-color-gray-85) → hsl(0 0% 85%)` |
14
+ | `--c-textarea-border-color-invalid` | `var(--c-color-red-70)` | `var(--c-color-red-70) → hsl(0 100% 70%)` |
15
+ | `--c-textarea-content` | `var(--c-color-gray-15)` | `var(--c-color-gray-15) → hsl(0 0% 15%)` |
16
+ | `--c-textarea-content-disabled` | `var(--c-color-gray-30)` | `var(--c-color-gray-30) → hsl(0 0% 30%)` |
17
+ | `--c-textarea-min-height` | `40px` | `40px` |
18
+ | `--c-textarea-padding` | `10px 15px` | `10px 15px` |
19
+ | `--c-textarea-placeholder` | `var(--c-color-gray-60)` | `var(--c-color-gray-60) → hsl(0 0% 60%)` |
20
+ | `--c-textarea-placeholder-disabled` | `var(--c-color-gray-50)` | `var(--c-color-gray-50) → hsl(0 0% 50%)` |
21
+ | `--c-textarea-placeholder-focus` | `var(--c-color-gray-70)` | `var(--c-color-gray-70) → hsl(0 0% 70%)` |
22
+ | `--c-textarea-radius` | `10px` | `10px` |
@@ -5,3 +5,6 @@ Generated from component frontmatter. Human usage sections live in each componen
5
5
  | Component | Description | Purpose | Doc path |
6
6
  | --- | --- | --- | --- |
7
7
  | Button | A native button element with variant styles driven by design tokens. | Trigger actions and submit forms with consistent visual variants. | [`../components/button/button.md`](../components/button/button.md) |
8
+ | Input | A single-line text field that extends the native HTML input element. | Collect short text values in forms with consistent field styling and error indication. | [`../components/input/input.md`](../components/input/input.md) |
9
+ | Select | Dropdown field that lets the user choose one option from a fixed list. | Let the user choose one option from a fixed list. | [`../components/select/select.md`](../components/select/select.md) |
10
+ | Textarea | Multi-line text field that collects a longer text value from the user. | Collect a longer text value such as a comment or a message. | [`../components/textarea/textarea.md`](../components/textarea/textarea.md) |
@@ -30,4 +30,17 @@ Generated from `src/vars.css`. Values show the declared token and the resolved r
30
30
  | `--c-color-gray-85` | `hsl(0 0% 85%)` | `hsl(0 0% 85%)` |
31
31
  | `--c-color-gray-90` | `hsl(0 0% 90%)` | `hsl(0 0% 90%)` |
32
32
  | `--c-color-gray-95` | `hsl(0 0% 95%)` | `hsl(0 0% 95%)` |
33
+ | `--c-color-red-10` | `hsl(0 100% 10%)` | `hsl(0 100% 10%)` |
34
+ | `--c-color-red-15` | `hsl(0 100% 15%)` | `hsl(0 100% 15%)` |
35
+ | `--c-color-red-20` | `hsl(0 100% 20%)` | `hsl(0 100% 20%)` |
36
+ | `--c-color-red-30` | `hsl(0 100% 30%)` | `hsl(0 100% 30%)` |
37
+ | `--c-color-red-40` | `hsl(0 100% 40%)` | `hsl(0 100% 40%)` |
38
+ | `--c-color-red-5` | `hsl(0 100% 5%)` | `hsl(0 100% 5%)` |
39
+ | `--c-color-red-50` | `hsl(0 100% 50%)` | `hsl(0 100% 50%)` |
40
+ | `--c-color-red-60` | `hsl(0 100% 60%)` | `hsl(0 100% 60%)` |
41
+ | `--c-color-red-70` | `hsl(0 100% 70%)` | `hsl(0 100% 70%)` |
42
+ | `--c-color-red-80` | `hsl(0 100% 80%)` | `hsl(0 100% 80%)` |
43
+ | `--c-color-red-85` | `hsl(0 100% 85%)` | `hsl(0 100% 85%)` |
44
+ | `--c-color-red-90` | `hsl(0 100% 90%)` | `hsl(0 100% 90%)` |
45
+ | `--c-color-red-95` | `hsl(0 100% 95%)` | `hsl(0 100% 95%)` |
33
46
  | `--c-font-family-primary` | `'Inter', sans-serif` | `'Inter', sans-serif` |
package/dist/cjs/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"Button",{enumerable:!0,get:function(){return _button.default}}),require("./index.css");var _button=_interopRequireDefault(require("./components/button/button.jsx"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"Button",{enumerable:!0,get:function(){return _button.default}}),Object.defineProperty(exports,"Input",{enumerable:!0,get:function(){return _input.default}}),Object.defineProperty(exports,"Select",{enumerable:!0,get:function(){return _select.default}}),Object.defineProperty(exports,"Textarea",{enumerable:!0,get:function(){return _textarea.default}}),require("./index.css");var _button=_interopRequireDefault(require("./components/button/button.jsx")),_input=_interopRequireDefault(require("./components/input/input.jsx")),_select=_interopRequireDefault(require("./components/select/select.jsx")),_textarea=_interopRequireDefault(require("./components/textarea/textarea.jsx"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}
package/dist/cjs/vars.css CHANGED
@@ -1 +1 @@
1
- :root{--c-font-family-primary: "Inter", sans-serif;--c-color-gray-95: hsl(0 0% 95%);--c-color-gray-90: hsl(0 0% 90%);--c-color-gray-85: hsl(0 0% 85%);--c-color-gray-80: hsl(0 0% 80%);--c-color-gray-70: hsl(0 0% 70%);--c-color-gray-60: hsl(0 0% 60%);--c-color-gray-50: hsl(0 0% 50%);--c-color-gray-40: hsl(0 0% 40%);--c-color-gray-30: hsl(0 0% 30%);--c-color-gray-20: hsl(0 0% 20%);--c-color-gray-15: hsl(0 0% 15%);--c-color-gray-10: hsl(0 0% 10%);--c-color-gray-5: hsl(0 0% 5%);--c-color-accented-95: var(--c-color-gray-95);--c-color-accented-90: var(--c-color-gray-90);--c-color-accented-85: var(--c-color-gray-85);--c-color-accented-80: var(--c-color-gray-80);--c-color-accented-70: var(--c-color-gray-70);--c-color-accented-60: var(--c-color-gray-60);--c-color-accented-50: var(--c-color-gray-50);--c-color-accented-40: var(--c-color-gray-40);--c-color-accented-30: var(--c-color-gray-30);--c-color-accented-20: var(--c-color-gray-20);--c-color-accented-15: var(--c-color-gray-15);--c-color-accented-10: var(--c-color-gray-10);--c-color-accented-5: var(--c-color-gray-5)}
1
+ :root{--c-font-family-primary: "Inter", sans-serif;--c-color-gray-95: hsl(0 0% 95%);--c-color-gray-90: hsl(0 0% 90%);--c-color-gray-85: hsl(0 0% 85%);--c-color-gray-80: hsl(0 0% 80%);--c-color-gray-70: hsl(0 0% 70%);--c-color-gray-60: hsl(0 0% 60%);--c-color-gray-50: hsl(0 0% 50%);--c-color-gray-40: hsl(0 0% 40%);--c-color-gray-30: hsl(0 0% 30%);--c-color-gray-20: hsl(0 0% 20%);--c-color-gray-15: hsl(0 0% 15%);--c-color-gray-10: hsl(0 0% 10%);--c-color-gray-5: hsl(0 0% 5%);--c-color-red-95: hsl(0 100% 95%);--c-color-red-90: hsl(0 100% 90%);--c-color-red-85: hsl(0 100% 85%);--c-color-red-80: hsl(0 100% 80%);--c-color-red-70: hsl(0 100% 70%);--c-color-red-60: hsl(0 100% 60%);--c-color-red-50: hsl(0 100% 50%);--c-color-red-40: hsl(0 100% 40%);--c-color-red-30: hsl(0 100% 30%);--c-color-red-20: hsl(0 100% 20%);--c-color-red-15: hsl(0 100% 15%);--c-color-red-10: hsl(0 100% 10%);--c-color-red-5: hsl(0 100% 5%);--c-color-accented-95: var(--c-color-gray-95);--c-color-accented-90: var(--c-color-gray-90);--c-color-accented-85: var(--c-color-gray-85);--c-color-accented-80: var(--c-color-gray-80);--c-color-accented-70: var(--c-color-gray-70);--c-color-accented-60: var(--c-color-gray-60);--c-color-accented-50: var(--c-color-gray-50);--c-color-accented-40: var(--c-color-gray-40);--c-color-accented-30: var(--c-color-gray-30);--c-color-accented-20: var(--c-color-gray-20);--c-color-accented-15: var(--c-color-gray-15);--c-color-accented-10: var(--c-color-gray-10);--c-color-accented-5: var(--c-color-gray-5)}
@@ -5,3 +5,6 @@ Generated from component frontmatter. Human usage sections live in each componen
5
5
  | Component | Description | Purpose | Doc path |
6
6
  | --- | --- | --- | --- |
7
7
  | Button | A native button element with variant styles driven by design tokens. | Trigger actions and submit forms with consistent visual variants. | [`../components/button/button.md`](../components/button/button.md) |
8
+ | Input | A single-line text field that extends the native HTML input element. | Collect short text values in forms with consistent field styling and error indication. | [`../components/input/input.md`](../components/input/input.md) |
9
+ | Select | Dropdown field that lets the user choose one option from a fixed list. | Let the user choose one option from a fixed list. | [`../components/select/select.md`](../components/select/select.md) |
10
+ | Textarea | Multi-line text field that collects a longer text value from the user. | Collect a longer text value such as a comment or a message. | [`../components/textarea/textarea.md`](../components/textarea/textarea.md) |
@@ -30,4 +30,17 @@ Generated from `src/vars.css`. Values show the declared token and the resolved r
30
30
  | `--c-color-gray-85` | `hsl(0 0% 85%)` | `hsl(0 0% 85%)` |
31
31
  | `--c-color-gray-90` | `hsl(0 0% 90%)` | `hsl(0 0% 90%)` |
32
32
  | `--c-color-gray-95` | `hsl(0 0% 95%)` | `hsl(0 0% 95%)` |
33
+ | `--c-color-red-10` | `hsl(0 100% 10%)` | `hsl(0 100% 10%)` |
34
+ | `--c-color-red-15` | `hsl(0 100% 15%)` | `hsl(0 100% 15%)` |
35
+ | `--c-color-red-20` | `hsl(0 100% 20%)` | `hsl(0 100% 20%)` |
36
+ | `--c-color-red-30` | `hsl(0 100% 30%)` | `hsl(0 100% 30%)` |
37
+ | `--c-color-red-40` | `hsl(0 100% 40%)` | `hsl(0 100% 40%)` |
38
+ | `--c-color-red-5` | `hsl(0 100% 5%)` | `hsl(0 100% 5%)` |
39
+ | `--c-color-red-50` | `hsl(0 100% 50%)` | `hsl(0 100% 50%)` |
40
+ | `--c-color-red-60` | `hsl(0 100% 60%)` | `hsl(0 100% 60%)` |
41
+ | `--c-color-red-70` | `hsl(0 100% 70%)` | `hsl(0 100% 70%)` |
42
+ | `--c-color-red-80` | `hsl(0 100% 80%)` | `hsl(0 100% 80%)` |
43
+ | `--c-color-red-85` | `hsl(0 100% 85%)` | `hsl(0 100% 85%)` |
44
+ | `--c-color-red-90` | `hsl(0 100% 90%)` | `hsl(0 100% 90%)` |
45
+ | `--c-color-red-95` | `hsl(0 100% 95%)` | `hsl(0 100% 95%)` |
33
46
  | `--c-font-family-primary` | `'Inter', sans-serif` | `'Inter', sans-serif` |
@@ -0,0 +1 @@
1
+ .c-input{--c-input-background: var(--c-color-gray-95);--c-input-background-focus: #ffffff;--c-input-background-disabled: var(--c-color-gray-85);--c-input-content: var(--c-color-gray-15);--c-input-content-disabled: var(--c-color-gray-30);--c-input-placeholder: var(--c-color-gray-60);--c-input-placeholder-focus: var(--c-color-gray-70);--c-input-placeholder-disabled: var(--c-color-gray-50);--c-input-border-color: var(--c-color-gray-85);--c-input-border-color-invalid: var(--c-color-red-70);--c-input-border-color-disabled: var(--c-color-gray-85);--c-input-radius: 10px;--c-input-height: 40px;--c-input-padding: 10px 15px;box-sizing:border-box;width:100%;height:var(--c-input-height);padding:var(--c-input-padding);background:var(--c-input-background);color:var(--c-input-content);font-family:var(--c-font-family-primary);font-size:1rem;line-height:1;border:1px solid var(--c-input-border-color);border-radius:var(--c-input-radius);outline:none;box-shadow:0 0 0 0 var(--c-color-gray-95);transition:all .3s ease-in}.c-input::placeholder{color:var(--c-input-placeholder)}.c-input:focus-visible{background:var(--c-input-background-focus);box-shadow:0 0 0 5px var(--c-color-gray-95)}.c-input:focus-visible::placeholder{color:var(--c-input-placeholder-focus)}.c-input:disabled{background:var(--c-input-background-disabled);color:var(--c-input-content-disabled);border-color:var(--c-input-border-color-disabled)}.c-input:disabled::placeholder{color:var(--c-input-placeholder-disabled)}.c-input.is-invalid{border-color:var(--c-input-border-color-invalid)}
@@ -0,0 +1 @@
1
+ import"./input.css";import{jsx as o}from"react/jsx-runtime";const e=({invalid:t,className:n,...s})=>{const i=u({invalid:t,className:n});return o("input",{className:i,...s})};function u({invalid:t,className:n}){const s=["c-input"];return t&&s.push("is-invalid"),[...s,n].filter(Boolean).join(" ")}export default e;
@@ -0,0 +1,32 @@
1
+ ---
2
+ name: Input
3
+ description: A single-line text field that extends the native HTML input element.
4
+ purpose: Collect short text values in forms with consistent field styling and error indication.
5
+ ---
6
+
7
+ # Input
8
+
9
+ A single-line text field. It extends the native HTML `input` element, so every native attribute (`type`, `value`, `placeholder`, `disabled`, `onChange`, etc.) is accepted. The component adds one visual prop, `invalid`, that marks the field as having an error.
10
+
11
+ ## Props
12
+
13
+ The Input API extends the native HTML `input` attributes. Props such as `disabled` and `placeholder` come from the native element and are not listed below.
14
+
15
+ <!-- BEGIN GENERATED PROPS -->
16
+ _Also inherits all props from `InputHTMLAttributes<HTMLInputElement>`._
17
+
18
+ | Name | Type | Required | Default | Description |
19
+ | --- | --- | --- | --- | --- |
20
+ | invalid | `boolean` | No | `false` | Marks the field as invalid by changing its border to the error color. |
21
+ <!-- END GENERATED PROPS -->
22
+
23
+ ## When to use
24
+
25
+ - Collecting short text such as name, email, or search queries
26
+ - Form fields where a single line of text is enough
27
+ - Surfacing validation errors with the `invalid` prop alongside accessible error messaging
28
+
29
+ ## When NOT to use
30
+
31
+ - **Multi-line text** — use a textarea for longer or formatted text.
32
+ - **Fixed option lists** — use a select or radio group when the user must pick from predefined choices.
@@ -0,0 +1,22 @@
1
+ # Input tokens
2
+
3
+ Generated from `src/components/input/input.css`.
4
+
5
+ ## Base tokens
6
+
7
+ | Token | Declared value | Resolution |
8
+ | --- | --- | --- |
9
+ | `--c-input-background` | `var(--c-color-gray-95)` | `var(--c-color-gray-95) → hsl(0 0% 95%)` |
10
+ | `--c-input-background-disabled` | `var(--c-color-gray-85)` | `var(--c-color-gray-85) → hsl(0 0% 85%)` |
11
+ | `--c-input-background-focus` | `#ffffff` | `#ffffff` |
12
+ | `--c-input-border-color` | `var(--c-color-gray-85)` | `var(--c-color-gray-85) → hsl(0 0% 85%)` |
13
+ | `--c-input-border-color-disabled` | `var(--c-color-gray-85)` | `var(--c-color-gray-85) → hsl(0 0% 85%)` |
14
+ | `--c-input-border-color-invalid` | `var(--c-color-red-70)` | `var(--c-color-red-70) → hsl(0 100% 70%)` |
15
+ | `--c-input-content` | `var(--c-color-gray-15)` | `var(--c-color-gray-15) → hsl(0 0% 15%)` |
16
+ | `--c-input-content-disabled` | `var(--c-color-gray-30)` | `var(--c-color-gray-30) → hsl(0 0% 30%)` |
17
+ | `--c-input-height` | `40px` | `40px` |
18
+ | `--c-input-padding` | `10px 15px` | `10px 15px` |
19
+ | `--c-input-placeholder` | `var(--c-color-gray-60)` | `var(--c-color-gray-60) → hsl(0 0% 60%)` |
20
+ | `--c-input-placeholder-disabled` | `var(--c-color-gray-50)` | `var(--c-color-gray-50) → hsl(0 0% 50%)` |
21
+ | `--c-input-placeholder-focus` | `var(--c-color-gray-70)` | `var(--c-color-gray-70) → hsl(0 0% 70%)` |
22
+ | `--c-input-radius` | `10px` | `10px` |
@@ -0,0 +1 @@
1
+ .c-select{--c-select-background: var(--c-color-gray-95);--c-select-background-focus: #ffffff;--c-select-background-disabled: var(--c-color-gray-85);--c-select-content: var(--c-color-gray-15);--c-select-content-disabled: var(--c-color-gray-30);--c-select-placeholder: var(--c-color-gray-60);--c-select-placeholder-focus: var(--c-color-gray-70);--c-select-placeholder-disabled: var(--c-color-gray-50);--c-select-border-color: var(--c-select-background);--c-select-border-color-focus: var(--c-color-gray-85);--c-select-border-color-invalid: var(--c-color-red-70);--c-select-border-color-disabled: var(--c-select-background-disabled);--c-select-arrow: url("data:image/svg+xml,%3Csvg%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%2040%2040%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20style%3D%22fill-rule%3Aevenodd%3Bclip-rule%3Aevenodd%3Bstroke-linecap%3Around%3Bstroke-miterlimit%3A10%3B%22%3E%20%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%2240%22%20height%3D%2240%22%20style%3D%22fill%3Anone%3B%22%2F%3E%20%3Cpath%20d%3D%22M23.07%2C16L20%2C12.93L16.93%2C16M16.93%2C24L20%2C27.07L23.07%2C24%22%20style%3D%22fill%3Anone%3Bfill-rule%3Anonzero%3Bstroke%3Argb(38%2C38%2C38)%3Bstroke-width%3A1px%3B%22%2F%3E%20%3C%2Fsvg%3E");--c-select-arrow-disabled: url("data:image/svg+xml,%3Csvg%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%2040%2040%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20style%3D%22fill-rule%3Aevenodd%3Bclip-rule%3Aevenodd%3Bstroke-linecap%3Around%3Bstroke-miterlimit%3A10%3B%22%3E%20%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%2240%22%20height%3D%2240%22%20style%3D%22fill%3Anone%3B%22%2F%3E%20%3Cpath%20d%3D%22M23.07%2C16L20%2C12.93L16.93%2C16M16.93%2C24L20%2C27.07L23.07%2C24%22%20style%3D%22fill%3Anone%3Bfill-rule%3Anonzero%3Bstroke%3Argb(128%2C128%2C128)%3Bstroke-width%3A1px%3B%22%2F%3E%20%3C%2Fsvg%3E");--c-select-radius: 10px;--c-select-height: 40px;--c-select-padding: 10px 40px 10px 15px;appearance:none;-webkit-appearance:none;-moz-appearance:none;box-sizing:border-box;width:100%;height:var(--c-select-height);padding:var(--c-select-padding);background-color:var(--c-select-background);background-image:var(--c-select-arrow);background-repeat:no-repeat;background-position:right center;background-size:40px 40px;color:var(--c-select-content);font-family:var(--c-font-family-primary);font-size:1rem;line-height:1;border:1px solid var(--c-select-border-color);border-radius:var(--c-select-radius);outline:none;box-shadow:0 0 0 0 var(--c-color-gray-95);cursor:pointer;transition:all .3s ease-in}.c-select:focus-visible{background-color:var(--c-select-background-focus);border-color:var(--c-select-border-color-focus);box-shadow:0 0 0 5px var(--c-color-gray-95)}.c-select:disabled{background-color:var(--c-select-background-disabled);background-image:var(--c-select-arrow-disabled);color:var(--c-select-content-disabled);border-color:var(--c-select-border-color-disabled);cursor:default;opacity:1}.c-select.is-blank{color:var(--c-select-placeholder)}.c-select.is-blank:focus-visible{color:var(--c-select-placeholder-focus)}.c-select.is-blank:disabled{color:var(--c-select-placeholder-disabled)}.c-select.is-invalid{border-color:var(--c-select-border-color-invalid)}
@@ -0,0 +1 @@
1
+ import{useEffect as h,useRef as m,useState as p}from"react";import"./select.css";import{jsx as d}from"react/jsx-runtime";const g=({invalid:t,className:l,value:s,onChange:e,children:o,...r})=>{const n=m(),[i,a]=p(!1),f=j({invalid:t,isBlank:i,className:l}),u=c=>{a(c.target.value===""),e?.(c)};return h(()=>{a(n.current.value==="")},[s]),d("select",{ref:n,className:f,value:s,...r,onChange:u,children:o})};function j({invalid:t,isBlank:l,className:s}){const e=["c-select"];return t&&e.push("is-invalid"),l&&e.push("is-blank"),[...e,s].filter(Boolean).join(" ")}export default g;
@@ -0,0 +1,33 @@
1
+ ---
2
+ name: Select
3
+ description: Dropdown field that lets the user choose one option from a fixed list.
4
+ purpose: Let the user choose one option from a fixed list.
5
+ ---
6
+
7
+ # Select
8
+
9
+ A dropdown field. It extends the native HTML `select` element, so every native attribute (`value`, `multiple`, `disabled`, `onChange`, etc.) is accepted. The component adds one visual prop, `invalid`, that marks the field as having an error. The border matches the fill color in every state except `focus-visible` (`gray-85` on a white fill) and `invalid` (`red-70`).
10
+
11
+ ## Props
12
+
13
+ The Select API extends the native HTML `select` attributes. Props such as `disabled` and `value` come from the native element and are not listed below.
14
+
15
+ <!-- BEGIN GENERATED PROPS -->
16
+ _Also inherits all props from `SelectHTMLAttributes<HTMLSelectElement>`._
17
+
18
+ | Name | Type | Required | Default | Description |
19
+ | --- | --- | --- | --- | --- |
20
+ | children | `ReactNode` | No | `undefined` | Option elements rendered inside the select. |
21
+ | invalid | `boolean` | No | `false` | Marks the field as invalid by changing its border to the error color. |
22
+ <!-- END GENERATED PROPS -->
23
+
24
+ ## When to use
25
+
26
+ - Choosing one option from a fixed list of values
27
+ - Form fields where a compact dropdown is enough
28
+ - Surfacing validation errors with the `invalid` prop alongside accessible error messaging
29
+
30
+ ## When NOT to use
31
+
32
+ - **Free text** — use Input or Textarea when the user types their own value.
33
+ - **Few always-visible options** — use a radio group when all choices should stay on screen.
@@ -0,0 +1,25 @@
1
+ # Select tokens
2
+
3
+ Generated from `src/components/select/select.css`.
4
+
5
+ ## Base tokens
6
+
7
+ | Token | Declared value | Resolution |
8
+ | --- | --- | --- |
9
+ | `--c-select-arrow` | `url("data:image/svg+xml,%3Csvg%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%2040%2040%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20style%3D%22fill-rule%3Aevenodd%3Bclip-rule%3Aevenodd%3Bstroke-linecap%3Around%3Bstroke-miterlimit%3A10%3B%22%3E%20%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%2240%22%20height%3D%2240%22%20style%3D%22fill%3Anone%3B%22%2F%3E%20%3Cpath%20d%3D%22M23.07%2C16L20%2C12.93L16.93%2C16M16.93%2C24L20%2C27.07L23.07%2C24%22%20style%3D%22fill%3Anone%3Bfill-rule%3Anonzero%3Bstroke%3Argb(38%2C38%2C38)%3Bstroke-width%3A1px%3B%22%2F%3E%20%3C%2Fsvg%3E")` | `url("data:image/svg+xml,%3Csvg%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%2040%2040%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20style%3D%22fill-rule%3Aevenodd%3Bclip-rule%3Aevenodd%3Bstroke-linecap%3Around%3Bstroke-miterlimit%3A10%3B%22%3E%20%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%2240%22%20height%3D%2240%22%20style%3D%22fill%3Anone%3B%22%2F%3E%20%3Cpath%20d%3D%22M23.07%2C16L20%2C12.93L16.93%2C16M16.93%2C24L20%2C27.07L23.07%2C24%22%20style%3D%22fill%3Anone%3Bfill-rule%3Anonzero%3Bstroke%3Argb(38%2C38%2C38)%3Bstroke-width%3A1px%3B%22%2F%3E%20%3C%2Fsvg%3E")` |
10
+ | `--c-select-arrow-disabled` | `url("data:image/svg+xml,%3Csvg%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%2040%2040%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20style%3D%22fill-rule%3Aevenodd%3Bclip-rule%3Aevenodd%3Bstroke-linecap%3Around%3Bstroke-miterlimit%3A10%3B%22%3E%20%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%2240%22%20height%3D%2240%22%20style%3D%22fill%3Anone%3B%22%2F%3E%20%3Cpath%20d%3D%22M23.07%2C16L20%2C12.93L16.93%2C16M16.93%2C24L20%2C27.07L23.07%2C24%22%20style%3D%22fill%3Anone%3Bfill-rule%3Anonzero%3Bstroke%3Argb(128%2C128%2C128)%3Bstroke-width%3A1px%3B%22%2F%3E%20%3C%2Fsvg%3E")` | `url("data:image/svg+xml,%3Csvg%20width%3D%22100%25%22%20height%3D%22100%25%22%20viewBox%3D%220%200%2040%2040%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20style%3D%22fill-rule%3Aevenodd%3Bclip-rule%3Aevenodd%3Bstroke-linecap%3Around%3Bstroke-miterlimit%3A10%3B%22%3E%20%3Crect%20x%3D%220%22%20y%3D%220%22%20width%3D%2240%22%20height%3D%2240%22%20style%3D%22fill%3Anone%3B%22%2F%3E%20%3Cpath%20d%3D%22M23.07%2C16L20%2C12.93L16.93%2C16M16.93%2C24L20%2C27.07L23.07%2C24%22%20style%3D%22fill%3Anone%3Bfill-rule%3Anonzero%3Bstroke%3Argb(128%2C128%2C128)%3Bstroke-width%3A1px%3B%22%2F%3E%20%3C%2Fsvg%3E")` |
11
+ | `--c-select-background` | `var(--c-color-gray-95)` | `var(--c-color-gray-95) → hsl(0 0% 95%)` |
12
+ | `--c-select-background-disabled` | `var(--c-color-gray-85)` | `var(--c-color-gray-85) → hsl(0 0% 85%)` |
13
+ | `--c-select-background-focus` | `#ffffff` | `#ffffff` |
14
+ | `--c-select-border-color` | `var(--c-select-background)` | `var(--c-select-background) → var(--c-color-gray-95) → hsl(0 0% 95%)` |
15
+ | `--c-select-border-color-disabled` | `var(--c-select-background-disabled)` | `var(--c-select-background-disabled) → var(--c-color-gray-85) → hsl(0 0% 85%)` |
16
+ | `--c-select-border-color-focus` | `var(--c-color-gray-85)` | `var(--c-color-gray-85) → hsl(0 0% 85%)` |
17
+ | `--c-select-border-color-invalid` | `var(--c-color-red-70)` | `var(--c-color-red-70) → hsl(0 100% 70%)` |
18
+ | `--c-select-content` | `var(--c-color-gray-15)` | `var(--c-color-gray-15) → hsl(0 0% 15%)` |
19
+ | `--c-select-content-disabled` | `var(--c-color-gray-30)` | `var(--c-color-gray-30) → hsl(0 0% 30%)` |
20
+ | `--c-select-height` | `40px` | `40px` |
21
+ | `--c-select-padding` | `10px 40px 10px 15px` | `10px 40px 10px 15px` |
22
+ | `--c-select-placeholder` | `var(--c-color-gray-60)` | `var(--c-color-gray-60) → hsl(0 0% 60%)` |
23
+ | `--c-select-placeholder-disabled` | `var(--c-color-gray-50)` | `var(--c-color-gray-50) → hsl(0 0% 50%)` |
24
+ | `--c-select-placeholder-focus` | `var(--c-color-gray-70)` | `var(--c-color-gray-70) → hsl(0 0% 70%)` |
25
+ | `--c-select-radius` | `10px` | `10px` |
@@ -0,0 +1 @@
1
+ .c-textarea{--c-textarea-background: var(--c-color-gray-95);--c-textarea-background-focus: #ffffff;--c-textarea-background-disabled: var(--c-color-gray-85);--c-textarea-content: var(--c-color-gray-15);--c-textarea-content-disabled: var(--c-color-gray-30);--c-textarea-placeholder: var(--c-color-gray-60);--c-textarea-placeholder-focus: var(--c-color-gray-70);--c-textarea-placeholder-disabled: var(--c-color-gray-50);--c-textarea-border-color: var(--c-color-gray-85);--c-textarea-border-color-invalid: var(--c-color-red-70);--c-textarea-border-color-disabled: var(--c-color-gray-85);--c-textarea-radius: 10px;--c-textarea-min-height: 40px;--c-textarea-padding: 10px 15px;box-sizing:border-box;width:100%;min-height:var(--c-textarea-min-height);padding:var(--c-textarea-padding);background:var(--c-textarea-background);color:var(--c-textarea-content);font-family:var(--c-font-family-primary);font-size:1rem;border:1px solid var(--c-textarea-border-color);border-radius:var(--c-textarea-radius);resize:vertical;outline:none;box-shadow:0 0 0 0 var(--c-color-gray-95);transition:background .3s ease-in,box-shadow .3s ease-in,border-color .3s ease-in,color .3s ease-in}.c-textarea::placeholder{color:var(--c-textarea-placeholder)}.c-textarea:focus-visible{background:var(--c-textarea-background-focus);box-shadow:0 0 0 5px var(--c-color-gray-95)}.c-textarea:focus-visible::placeholder{color:var(--c-textarea-placeholder-focus)}.c-textarea:disabled{background:var(--c-textarea-background-disabled);color:var(--c-textarea-content-disabled);border-color:var(--c-textarea-border-color-disabled)}.c-textarea:disabled::placeholder{color:var(--c-textarea-placeholder-disabled)}.c-textarea.is-invalid{border-color:var(--c-textarea-border-color-invalid)}
@@ -0,0 +1 @@
1
+ import"./textarea.css";import{jsx as r}from"react/jsx-runtime";const o=({invalid:e,className:a,...s})=>{const t=i({invalid:e,className:a});return r("textarea",{className:t,...s})};function i({invalid:e,className:a}){const s=["c-textarea"];return e&&s.push("is-invalid"),[...s,a].filter(Boolean).join(" ")}export default o;
@@ -0,0 +1,32 @@
1
+ ---
2
+ name: Textarea
3
+ description: Multi-line text field that collects a longer text value from the user.
4
+ purpose: Collect a longer text value such as a comment or a message.
5
+ ---
6
+
7
+ # Textarea
8
+
9
+ A multi-line text field. It extends the native HTML `textarea` element, so every native attribute (`value`, `rows`, `disabled`, `onChange`, etc.) is accepted. The component adds one visual prop, `invalid`, that marks the field as having an error. Its visual states match the Input.
10
+
11
+ ## Props
12
+
13
+ The Textarea API extends the native HTML `textarea` attributes. Props such as `disabled` come from the native element and are not listed below.
14
+
15
+ <!-- BEGIN GENERATED PROPS -->
16
+ _Also inherits all props from `TextareaHTMLAttributes<HTMLTextAreaElement>`._
17
+
18
+ | Name | Type | Required | Default | Description |
19
+ | --- | --- | --- | --- | --- |
20
+ | invalid | `boolean` | No | `false` | Marks the field as invalid by changing its border to the error color. |
21
+ <!-- END GENERATED PROPS -->
22
+
23
+ ## When to use
24
+
25
+ - Collecting longer text such as comments, messages, or descriptions
26
+ - Form fields where the user needs more than one line
27
+ - Surfacing validation errors with the `invalid` prop alongside accessible error messaging
28
+
29
+ ## When NOT to use
30
+
31
+ - **Short single-line text** — use Input for names, emails, or search queries.
32
+ - **Fixed option lists** — use a select or radio group when the user must pick from predefined choices.
@@ -0,0 +1,22 @@
1
+ # Textarea tokens
2
+
3
+ Generated from `src/components/textarea/textarea.css`.
4
+
5
+ ## Base tokens
6
+
7
+ | Token | Declared value | Resolution |
8
+ | --- | --- | --- |
9
+ | `--c-textarea-background` | `var(--c-color-gray-95)` | `var(--c-color-gray-95) → hsl(0 0% 95%)` |
10
+ | `--c-textarea-background-disabled` | `var(--c-color-gray-85)` | `var(--c-color-gray-85) → hsl(0 0% 85%)` |
11
+ | `--c-textarea-background-focus` | `#ffffff` | `#ffffff` |
12
+ | `--c-textarea-border-color` | `var(--c-color-gray-85)` | `var(--c-color-gray-85) → hsl(0 0% 85%)` |
13
+ | `--c-textarea-border-color-disabled` | `var(--c-color-gray-85)` | `var(--c-color-gray-85) → hsl(0 0% 85%)` |
14
+ | `--c-textarea-border-color-invalid` | `var(--c-color-red-70)` | `var(--c-color-red-70) → hsl(0 100% 70%)` |
15
+ | `--c-textarea-content` | `var(--c-color-gray-15)` | `var(--c-color-gray-15) → hsl(0 0% 15%)` |
16
+ | `--c-textarea-content-disabled` | `var(--c-color-gray-30)` | `var(--c-color-gray-30) → hsl(0 0% 30%)` |
17
+ | `--c-textarea-min-height` | `40px` | `40px` |
18
+ | `--c-textarea-padding` | `10px 15px` | `10px 15px` |
19
+ | `--c-textarea-placeholder` | `var(--c-color-gray-60)` | `var(--c-color-gray-60) → hsl(0 0% 60%)` |
20
+ | `--c-textarea-placeholder-disabled` | `var(--c-color-gray-50)` | `var(--c-color-gray-50) → hsl(0 0% 50%)` |
21
+ | `--c-textarea-placeholder-focus` | `var(--c-color-gray-70)` | `var(--c-color-gray-70) → hsl(0 0% 70%)` |
22
+ | `--c-textarea-radius` | `10px` | `10px` |
@@ -5,3 +5,6 @@ Generated from component frontmatter. Human usage sections live in each componen
5
5
  | Component | Description | Purpose | Doc path |
6
6
  | --- | --- | --- | --- |
7
7
  | Button | A native button element with variant styles driven by design tokens. | Trigger actions and submit forms with consistent visual variants. | [`../components/button/button.md`](../components/button/button.md) |
8
+ | Input | A single-line text field that extends the native HTML input element. | Collect short text values in forms with consistent field styling and error indication. | [`../components/input/input.md`](../components/input/input.md) |
9
+ | Select | Dropdown field that lets the user choose one option from a fixed list. | Let the user choose one option from a fixed list. | [`../components/select/select.md`](../components/select/select.md) |
10
+ | Textarea | Multi-line text field that collects a longer text value from the user. | Collect a longer text value such as a comment or a message. | [`../components/textarea/textarea.md`](../components/textarea/textarea.md) |
@@ -30,4 +30,17 @@ Generated from `src/vars.css`. Values show the declared token and the resolved r
30
30
  | `--c-color-gray-85` | `hsl(0 0% 85%)` | `hsl(0 0% 85%)` |
31
31
  | `--c-color-gray-90` | `hsl(0 0% 90%)` | `hsl(0 0% 90%)` |
32
32
  | `--c-color-gray-95` | `hsl(0 0% 95%)` | `hsl(0 0% 95%)` |
33
+ | `--c-color-red-10` | `hsl(0 100% 10%)` | `hsl(0 100% 10%)` |
34
+ | `--c-color-red-15` | `hsl(0 100% 15%)` | `hsl(0 100% 15%)` |
35
+ | `--c-color-red-20` | `hsl(0 100% 20%)` | `hsl(0 100% 20%)` |
36
+ | `--c-color-red-30` | `hsl(0 100% 30%)` | `hsl(0 100% 30%)` |
37
+ | `--c-color-red-40` | `hsl(0 100% 40%)` | `hsl(0 100% 40%)` |
38
+ | `--c-color-red-5` | `hsl(0 100% 5%)` | `hsl(0 100% 5%)` |
39
+ | `--c-color-red-50` | `hsl(0 100% 50%)` | `hsl(0 100% 50%)` |
40
+ | `--c-color-red-60` | `hsl(0 100% 60%)` | `hsl(0 100% 60%)` |
41
+ | `--c-color-red-70` | `hsl(0 100% 70%)` | `hsl(0 100% 70%)` |
42
+ | `--c-color-red-80` | `hsl(0 100% 80%)` | `hsl(0 100% 80%)` |
43
+ | `--c-color-red-85` | `hsl(0 100% 85%)` | `hsl(0 100% 85%)` |
44
+ | `--c-color-red-90` | `hsl(0 100% 90%)` | `hsl(0 100% 90%)` |
45
+ | `--c-color-red-95` | `hsl(0 100% 95%)` | `hsl(0 100% 95%)` |
33
46
  | `--c-font-family-primary` | `'Inter', sans-serif` | `'Inter', sans-serif` |
package/dist/es6/index.js CHANGED
@@ -1 +1 @@
1
- import"./index.css";export{default as Button}from"./components/button/button.js";
1
+ import"./index.css";export{default as Button}from"./components/button/button.js";export{default as Input}from"./components/input/input.js";export{default as Select}from"./components/select/select.js";export{default as Textarea}from"./components/textarea/textarea.js";
package/dist/es6/vars.css CHANGED
@@ -1 +1 @@
1
- :root{--c-font-family-primary: "Inter", sans-serif;--c-color-gray-95: hsl(0 0% 95%);--c-color-gray-90: hsl(0 0% 90%);--c-color-gray-85: hsl(0 0% 85%);--c-color-gray-80: hsl(0 0% 80%);--c-color-gray-70: hsl(0 0% 70%);--c-color-gray-60: hsl(0 0% 60%);--c-color-gray-50: hsl(0 0% 50%);--c-color-gray-40: hsl(0 0% 40%);--c-color-gray-30: hsl(0 0% 30%);--c-color-gray-20: hsl(0 0% 20%);--c-color-gray-15: hsl(0 0% 15%);--c-color-gray-10: hsl(0 0% 10%);--c-color-gray-5: hsl(0 0% 5%);--c-color-accented-95: var(--c-color-gray-95);--c-color-accented-90: var(--c-color-gray-90);--c-color-accented-85: var(--c-color-gray-85);--c-color-accented-80: var(--c-color-gray-80);--c-color-accented-70: var(--c-color-gray-70);--c-color-accented-60: var(--c-color-gray-60);--c-color-accented-50: var(--c-color-gray-50);--c-color-accented-40: var(--c-color-gray-40);--c-color-accented-30: var(--c-color-gray-30);--c-color-accented-20: var(--c-color-gray-20);--c-color-accented-15: var(--c-color-gray-15);--c-color-accented-10: var(--c-color-gray-10);--c-color-accented-5: var(--c-color-gray-5)}
1
+ :root{--c-font-family-primary: "Inter", sans-serif;--c-color-gray-95: hsl(0 0% 95%);--c-color-gray-90: hsl(0 0% 90%);--c-color-gray-85: hsl(0 0% 85%);--c-color-gray-80: hsl(0 0% 80%);--c-color-gray-70: hsl(0 0% 70%);--c-color-gray-60: hsl(0 0% 60%);--c-color-gray-50: hsl(0 0% 50%);--c-color-gray-40: hsl(0 0% 40%);--c-color-gray-30: hsl(0 0% 30%);--c-color-gray-20: hsl(0 0% 20%);--c-color-gray-15: hsl(0 0% 15%);--c-color-gray-10: hsl(0 0% 10%);--c-color-gray-5: hsl(0 0% 5%);--c-color-red-95: hsl(0 100% 95%);--c-color-red-90: hsl(0 100% 90%);--c-color-red-85: hsl(0 100% 85%);--c-color-red-80: hsl(0 100% 80%);--c-color-red-70: hsl(0 100% 70%);--c-color-red-60: hsl(0 100% 60%);--c-color-red-50: hsl(0 100% 50%);--c-color-red-40: hsl(0 100% 40%);--c-color-red-30: hsl(0 100% 30%);--c-color-red-20: hsl(0 100% 20%);--c-color-red-15: hsl(0 100% 15%);--c-color-red-10: hsl(0 100% 10%);--c-color-red-5: hsl(0 100% 5%);--c-color-accented-95: var(--c-color-gray-95);--c-color-accented-90: var(--c-color-gray-90);--c-color-accented-85: var(--c-color-gray-85);--c-color-accented-80: var(--c-color-gray-80);--c-color-accented-70: var(--c-color-gray-70);--c-color-accented-60: var(--c-color-gray-60);--c-color-accented-50: var(--c-color-gray-50);--c-color-accented-40: var(--c-color-gray-40);--c-color-accented-30: var(--c-color-gray-30);--c-color-accented-20: var(--c-color-gray-20);--c-color-accented-15: var(--c-color-gray-15);--c-color-accented-10: var(--c-color-gray-10);--c-color-accented-5: var(--c-color-gray-5)}
package/dist/index.d.ts CHANGED
@@ -1,2 +1,8 @@
1
1
  export type { ButtonProps } from './components/button/button.d.ts';
2
- export { default as Button } from './components/button/button.d.ts';
2
+ export { default as Button } from './components/button/button.d.ts';
3
+ export type { InputProps } from './components/input/input.d.ts';
4
+ export { default as Input } from './components/input/input.d.ts';
5
+ export type { SelectProps } from './components/select/select.d.ts';
6
+ export { default as Select } from './components/select/select.d.ts';
7
+ export type { TextareaProps } from './components/textarea/textarea.d.ts';
8
+ export { default as Textarea } from './components/textarea/textarea.d.ts';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compilorama/compy",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "React UI component library",
5
5
  "license": "MIT",
6
6
  "author": "Rafael Camargo <hello@rafaelcamargo.com>",