@compilorama/compy 0.3.0 → 0.5.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/CHANGELOG.md +22 -0
- package/dist/cjs/components/button/button.css +1 -1
- package/dist/cjs/components/checkbox/checkbox.css +1 -0
- package/dist/cjs/components/checkbox/checkbox.js +1 -0
- package/dist/cjs/components/checkbox/checkbox.md +31 -0
- package/dist/cjs/components/checkbox/tokens.md +19 -0
- package/dist/cjs/components/form-control/form-control.css +1 -0
- package/dist/cjs/components/form-control/form-control.js +1 -0
- package/dist/cjs/components/form-control/form-control.md +36 -0
- package/dist/cjs/components/form-control/tokens.md +11 -0
- package/dist/cjs/components/input/input.css +1 -1
- package/dist/cjs/components/label/label.css +1 -0
- package/dist/cjs/components/label/label.js +1 -0
- package/dist/cjs/components/label/label.md +34 -0
- package/dist/cjs/components/label/tokens.md +11 -0
- package/dist/cjs/components/radio/radio.css +1 -0
- package/dist/cjs/components/radio/radio.js +1 -0
- package/dist/cjs/components/radio/radio.md +33 -0
- package/dist/cjs/components/radio/tokens.md +18 -0
- package/dist/cjs/components/select/select.css +1 -1
- package/dist/cjs/components/textarea/textarea.css +1 -1
- package/dist/cjs/docs/components.md +4 -0
- package/dist/cjs/docs/tokens.md +9 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/vars.css +1 -1
- package/dist/docs/components.md +4 -0
- package/dist/docs/tokens.md +9 -0
- package/dist/es6/components/button/button.css +1 -1
- package/dist/es6/components/checkbox/checkbox.css +1 -0
- package/dist/es6/components/checkbox/checkbox.js +1 -0
- package/dist/es6/components/checkbox/checkbox.md +31 -0
- package/dist/es6/components/checkbox/tokens.md +19 -0
- package/dist/es6/components/form-control/form-control.css +1 -0
- package/dist/es6/components/form-control/form-control.js +1 -0
- package/dist/es6/components/form-control/form-control.md +36 -0
- package/dist/es6/components/form-control/tokens.md +11 -0
- package/dist/es6/components/input/input.css +1 -1
- package/dist/es6/components/label/label.css +1 -0
- package/dist/es6/components/label/label.js +1 -0
- package/dist/es6/components/label/label.md +34 -0
- package/dist/es6/components/label/tokens.md +11 -0
- package/dist/es6/components/radio/radio.css +1 -0
- package/dist/es6/components/radio/radio.js +1 -0
- package/dist/es6/components/radio/radio.md +33 -0
- package/dist/es6/components/radio/tokens.md +18 -0
- package/dist/es6/components/select/select.css +1 -1
- package/dist/es6/components/textarea/textarea.css +1 -1
- package/dist/es6/docs/components.md +4 -0
- package/dist/es6/docs/tokens.md +9 -0
- package/dist/es6/index.js +1 -1
- package/dist/es6/vars.css +1 -1
- package/dist/index.d.ts +8 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
# [0.5.0](https://github.com/compilorama/compy/compare/v0.4.0...v0.5.0) (2026-11-22)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* add left margin to form control label and error message ([93570b3](https://github.com/compilorama/compy/commit/93570b3744dc656ad6421606537a257f3ba2ad5f))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **form-control:** add FormControl component ([6dedcb7](https://github.com/compilorama/compy/commit/6dedcb7fcab05f986cecfc131a9db30eb5246573))
|
|
12
|
+
* **label:** add required prop ([f929f1b](https://github.com/compilorama/compy/commit/f929f1b130703f6f6af79c013b9be31836de4477))
|
|
13
|
+
|
|
14
|
+
# [0.4.0](https://github.com/compilorama/compy/compare/v0.3.0...v0.4.0) (2026-11-21)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* add Checkbox component ([b61af3e](https://github.com/compilorama/compy/commit/b61af3e3cbd60699c132cb99678a69b95cdc16f8))
|
|
20
|
+
* add Label component and global font-size tokens ([f8074de](https://github.com/compilorama/compy/commit/f8074debee2c00a3822e8666f30dcff7beb5f753))
|
|
21
|
+
* add Radio component ([914f80a](https://github.com/compilorama/compy/commit/914f80ad15f29072d361a78ab641e2a55aa86567))
|
|
22
|
+
|
|
1
23
|
# [0.3.0](https://github.com/compilorama/compy/compare/v0.2.0...v0.3.0) (2026-11-17)
|
|
2
24
|
|
|
3
25
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.c-button{--c-button-background: var(--c-color-gray-90);--c-button-background-hover: var(--c-color-gray-95);--c-button-background-disabled: var(--c-color-gray-95);--c-button-content: var(--c-color-gray-10);--c-button-content-disabled: var(--c-color-gray-60);--c-button-border-color: var(--c-color-gray-90);--c-button-border-color-disabled: var(--c-color-gray-95);--c-button-box-shadow-color: var(--c-color-gray-95);--c-button-radius: 10px;--c-button-height: 40px;--c-button-width: auto;--c-button-padding: 10px 25px;display:inline-flex;position:relative;align-items:center;justify-content:center;width:var(--c-button-width);height:var(--c-button-height);padding:var(--c-button-padding);background:var(--c-button-background);color:var(--c-button-content);font-family:var(--c-font-family-primary);font-size:1rem;font-weight:700;line-height:1;border:1px solid var(--c-button-border-color);border-radius:var(--c-button-radius);box-shadow:0 0 0 0 var(--c-button-box-shadow-color);box-sizing:border-box;cursor:pointer;outline:0;transition:
|
|
1
|
+
.c-button{--c-button-background: var(--c-color-gray-90);--c-button-background-hover: var(--c-color-gray-95);--c-button-background-disabled: var(--c-color-gray-95);--c-button-content: var(--c-color-gray-10);--c-button-content-disabled: var(--c-color-gray-60);--c-button-border-color: var(--c-color-gray-90);--c-button-border-color-disabled: var(--c-color-gray-95);--c-button-box-shadow-color: var(--c-color-gray-95);--c-button-radius: 10px;--c-button-height: 40px;--c-button-width: auto;--c-button-padding: 10px 25px;display:inline-flex;position:relative;align-items:center;justify-content:center;width:var(--c-button-width);height:var(--c-button-height);padding:var(--c-button-padding);background:var(--c-button-background);color:var(--c-button-content);font-family:var(--c-font-family-primary);font-size:1rem;font-weight:700;line-height:1;border:1px solid var(--c-button-border-color);border-radius:var(--c-button-radius);box-shadow:0 0 0 0 var(--c-button-box-shadow-color);box-sizing:border-box;cursor:pointer;outline:0;transition:background-color .15s ease-out,border-color .15s ease-out,box-shadow .15s ease-out,color .15s ease-out}.c-button:hover:not(:disabled){background:var(--c-button-background-hover)}.c-button:focus-visible{box-shadow:0 0 0 5px var(--c-button-box-shadow-color)}.c-button.is-accented:not(.is-outline):focus-visible{box-shadow:0 0 0 5px var(--c-color-accented-80)}.c-button.is-outline:focus-visible,.c-button.is-borderless:focus-visible{box-shadow:0 0 0 5px var(--c-color-accented-90)}.c-button:disabled{background:var(--c-button-background-disabled);color:var(--c-button-content-disabled);border-color:var(--c-button-border-color-disabled);cursor:default}.c-button.is-accented{--c-button-background: var(--c-color-accented-10);--c-button-background-hover: var(--c-color-accented-20);--c-button-background-disabled: var(--c-color-accented-30);--c-button-content: var(--c-color-accented-95);--c-button-content-disabled: var(--c-color-accented-80);--c-button-border-color: var(--c-color-accented-10);--c-button-border-color-disabled: var(--c-color-accented-30)}.c-button.is-outline{--c-button-background: transparent;--c-button-background-hover: var(--c-color-gray-95);--c-button-background-disabled: transparent;--c-button-border-color: var(--c-color-gray-70);--c-button-border-color-disabled: var(--c-color-gray-85);--c-button-content: var(--c-color-gray-20)}.c-button.is-borderless{--c-button-background: transparent;--c-button-background-hover: var(--c-color-gray-95);--c-button-background-disabled: transparent;--c-button-border-color: transparent;--c-button-border-color-disabled: transparent;--c-button-content: var(--c-color-gray-30)}.c-button.is-accented.is-outline{--c-button-content: var(--c-color-accented-10);--c-button-content-disabled: var(--c-color-accented-70);--c-button-border-color: var(--c-color-accented-10);--c-button-border-color-disabled: var(--c-color-accented-70)}.c-button.is-accented.is-borderless{--c-button-content: var(--c-color-accented-10)}.c-button.is-round{--c-button-radius: 20px}.c-button.is-isometric{--c-button-height: 40px;--c-button-width: 40px;--c-button-padding: 0}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.c-checkbox-wrapper{display:inline-flex;align-items:center;gap:10px}.c-checkbox-wrapper .c-label:hover:not(.is-disabled){cursor:pointer}.c-checkbox{--c-checkbox-background: var(--c-color-gray-95);--c-checkbox-background-disabled: var(--c-color-gray-85);--c-checkbox-background-checked: var(--c-color-gray-10);--c-checkbox-border-color: var(--c-color-gray-85);--c-checkbox-border-color-disabled: var(--c-color-gray-85);--c-checkbox-border-color-checked: var(--c-color-gray-10);--c-checkbox-check: url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%228.5%22%20height%3D%227.9%22%20viewBox%3D%22386.595%20103.67%208.5%207.855%22%3E%3Cpath%20d%3D%22M395.057,104.851L389.957,111.396C389.917,111.437%20389.851,111.525%20389.77,111.525C389.686,111.525%20389.631,111.466%20389.583,111.418C389.535,111.37%20386.69,108.635%20386.69,108.635L386.635,108.58C386.613,108.547%20386.595,108.507%20386.595,108.463C386.595,108.419%20386.613,108.378%20386.635,108.345C386.65,108.331%20386.66,108.32%20386.675,108.301C386.957,108.004%20387.529,107.403%20387.566,107.367C387.614,107.319%20387.654,107.256%20387.742,107.256C387.834,107.256%20387.892,107.334%20387.936,107.378C387.98,107.421%20389.586,108.965%20389.586,108.965L393.668,103.722C393.704,103.692%20393.749,103.67%20393.796,103.67C393.844,103.67%20393.887,103.688%20393.925,103.718L395.046,104.602C395.076,104.638%20395.094,104.682%20395.094,104.73C395.098,104.778%20395.079,104.818%20395.057,104.851%22%20fill%3D%22white%22%2F%3E%3C%2Fsvg%3E);--c-checkbox-check-disabled: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%228.5%22%20height%3D%227.9%22%20viewBox%3D%22386.595%20103.67%208.5%207.855%22%3E%3Cpath%20d%3D%22M395.057,104.851L389.957,111.396C389.917,111.437%20389.851,111.525%20389.77,111.525C389.686,111.525%20389.631,111.466%20389.583,111.418C389.535,111.37%20386.69,108.635%20386.69,108.635L386.635,108.58C386.613,108.547%20386.595,108.507%20386.595,108.463C386.595,108.419%20386.613,108.378%20386.635,108.345C386.65,108.331%20386.66,108.32%20386.675,108.301C386.957,108.004%20387.529,107.403%20387.566,107.367C387.614,107.319%20387.654,107.256%20387.742,107.256C387.834,107.256%20387.892,107.334%20387.936,107.378C387.98,107.421%20389.586,108.965%20389.586,108.965L393.668,103.722C393.704,103.692%20393.749,103.67%20393.796,103.67C393.844,103.67%20393.887,103.688%20393.925,103.718L395.046,104.602C395.076,104.638%20395.094,104.682%20395.094,104.73C395.098,104.778%20395.079,104.818%20395.057,104.851%22%20fill%3D%22rgb(128,128,128)%22%2F%3E%3C%2Fsvg%3E");--c-checkbox-radius: 5px;--c-checkbox-size: 18px;--c-checkbox-check-size: 8.5px 7.9px;appearance:none;-webkit-appearance:none;-moz-appearance:none;display:inline-block;flex-shrink:0;margin:0;width:var(--c-checkbox-size);height:var(--c-checkbox-size);background-color:var(--c-checkbox-background);background-repeat:no-repeat;background-position:center;background-size:var(--c-checkbox-check-size);border:1px solid var(--c-checkbox-border-color);border-radius:var(--c-checkbox-radius);outline:none;box-shadow:0 0 0 0 var(--c-color-gray-95);box-sizing:border-box;cursor:pointer;transition:background-color .15s ease-out,border-color .15s ease-out,box-shadow .15s ease-out}.c-checkbox:checked{background-color:var(--c-checkbox-background-checked);background-image:var(--c-checkbox-check);border-color:var(--c-checkbox-border-color-checked)}.c-checkbox:focus-visible{box-shadow:0 0 0 5px var(--c-color-gray-95)}.c-checkbox:focus-visible:not(:checked){background-color:#fff}.c-checkbox:focus-visible:checked{box-shadow:0 0 0 5px var(--c-color-accented-80)}.c-checkbox:disabled{background-color:var(--c-checkbox-background-disabled);border-color:var(--c-checkbox-border-color-disabled);cursor:default}.c-checkbox:disabled:checked{background-image:var(--c-checkbox-check-disabled)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _react=require("react"),_label=_interopRequireDefault(require("../label/label.jsx"));require("./checkbox.css");var _jsxRuntime=require("react/jsx-runtime");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const Checkbox=({id:e,label:r,className:a,...t})=>{const u=(0,_react.useId)(),s=e||u,o=["c-checkbox",a].filter(Boolean).join(" "),c=(0,_jsxRuntime.jsx)("input",{id:r?s:e,className:o,...t,type:"checkbox"});return r?(0,_jsxRuntime.jsxs)("span",{className:"c-checkbox-wrapper",children:[c,(0,_jsxRuntime.jsx)(_label.default,{htmlFor:s,disabled:t.disabled,children:r})]}):c};var _default=exports.default=Checkbox;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Checkbox
|
|
3
|
+
description: A native checkbox input with the library look and an optional built-in label.
|
|
4
|
+
purpose: Let the user turn an option on or off, or pick several options from a list.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Checkbox
|
|
8
|
+
|
|
9
|
+
A styled native `input` of type `checkbox`. Every native input attribute (`checked`, `defaultChecked`, `disabled`, `onChange`, `name`, `id`, etc.) is forwarded to the input. When `label` is given, the component also renders a `Label` next to the input and associates both, so clicking the text toggles the checkbox.
|
|
10
|
+
|
|
11
|
+
## Props
|
|
12
|
+
|
|
13
|
+
The Checkbox API extends the native HTML `input` attributes, except `type`. Props such as `checked`, `disabled` and `onChange` come from the native element and are not listed below.
|
|
14
|
+
|
|
15
|
+
<!-- BEGIN GENERATED PROPS -->
|
|
16
|
+
_Also inherits all props from `Omit<InputHTMLAttributes<HTMLInputElement>, 'type'>`._
|
|
17
|
+
|
|
18
|
+
| Name | Type | Required | Default | Description |
|
|
19
|
+
| --- | --- | --- | --- | --- |
|
|
20
|
+
| label | `string` | No | | Text of the label rendered next to the checkbox and associated with it. |
|
|
21
|
+
<!-- END GENERATED PROPS -->
|
|
22
|
+
|
|
23
|
+
## When to use
|
|
24
|
+
|
|
25
|
+
- Turning a single option on or off, such as accepting terms
|
|
26
|
+
- Letting the user pick any number of options from a list
|
|
27
|
+
|
|
28
|
+
## When NOT to use
|
|
29
|
+
|
|
30
|
+
- **Mutually exclusive options** — use a radio group when only one option can be picked.
|
|
31
|
+
- **Immediate actions** — use a button when the interaction triggers something right away.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Checkbox tokens
|
|
2
|
+
|
|
3
|
+
Generated from `src/components/checkbox/checkbox.css`.
|
|
4
|
+
|
|
5
|
+
## Base tokens
|
|
6
|
+
|
|
7
|
+
| Token | Declared value | Resolution |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| `--c-checkbox-background` | `var(--c-color-gray-95)` | `var(--c-color-gray-95) → hsl(0 0% 95%)` |
|
|
10
|
+
| `--c-checkbox-background-checked` | `var(--c-color-gray-10)` | `var(--c-color-gray-10) → hsl(0 0% 10%)` |
|
|
11
|
+
| `--c-checkbox-background-disabled` | `var(--c-color-gray-85)` | `var(--c-color-gray-85) → hsl(0 0% 85%)` |
|
|
12
|
+
| `--c-checkbox-border-color` | `var(--c-color-gray-85)` | `var(--c-color-gray-85) → hsl(0 0% 85%)` |
|
|
13
|
+
| `--c-checkbox-border-color-checked` | `var(--c-color-gray-10)` | `var(--c-color-gray-10) → hsl(0 0% 10%)` |
|
|
14
|
+
| `--c-checkbox-border-color-disabled` | `var(--c-color-gray-85)` | `var(--c-color-gray-85) → hsl(0 0% 85%)` |
|
|
15
|
+
| `--c-checkbox-check` | `url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%228.5%22%20height%3D%227.9%22%20viewBox%3D%22386.595%20103.67%208.5%207.855%22%3E%3Cpath%20d%3D%22M395.057,104.851L389.957,111.396C389.917,111.437%20389.851,111.525%20389.77,111.525C389.686,111.525%20389.631,111.466%20389.583,111.418C389.535,111.37%20386.69,108.635%20386.69,108.635L386.635,108.58C386.613,108.547%20386.595,108.507%20386.595,108.463C386.595,108.419%20386.613,108.378%20386.635,108.345C386.65,108.331%20386.66,108.32%20386.675,108.301C386.957,108.004%20387.529,107.403%20387.566,107.367C387.614,107.319%20387.654,107.256%20387.742,107.256C387.834,107.256%20387.892,107.334%20387.936,107.378C387.98,107.421%20389.586,108.965%20389.586,108.965L393.668,103.722C393.704,103.692%20393.749,103.67%20393.796,103.67C393.844,103.67%20393.887,103.688%20393.925,103.718L395.046,104.602C395.076,104.638%20395.094,104.682%20395.094,104.73C395.098,104.778%20395.079,104.818%20395.057,104.851%22%20fill%3D%22white%22%2F%3E%3C%2Fsvg%3E")` | `url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%228.5%22%20height%3D%227.9%22%20viewBox%3D%22386.595%20103.67%208.5%207.855%22%3E%3Cpath%20d%3D%22M395.057,104.851L389.957,111.396C389.917,111.437%20389.851,111.525%20389.77,111.525C389.686,111.525%20389.631,111.466%20389.583,111.418C389.535,111.37%20386.69,108.635%20386.69,108.635L386.635,108.58C386.613,108.547%20386.595,108.507%20386.595,108.463C386.595,108.419%20386.613,108.378%20386.635,108.345C386.65,108.331%20386.66,108.32%20386.675,108.301C386.957,108.004%20387.529,107.403%20387.566,107.367C387.614,107.319%20387.654,107.256%20387.742,107.256C387.834,107.256%20387.892,107.334%20387.936,107.378C387.98,107.421%20389.586,108.965%20389.586,108.965L393.668,103.722C393.704,103.692%20393.749,103.67%20393.796,103.67C393.844,103.67%20393.887,103.688%20393.925,103.718L395.046,104.602C395.076,104.638%20395.094,104.682%20395.094,104.73C395.098,104.778%20395.079,104.818%20395.057,104.851%22%20fill%3D%22white%22%2F%3E%3C%2Fsvg%3E")` |
|
|
16
|
+
| `--c-checkbox-check-disabled` | `url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%228.5%22%20height%3D%227.9%22%20viewBox%3D%22386.595%20103.67%208.5%207.855%22%3E%3Cpath%20d%3D%22M395.057,104.851L389.957,111.396C389.917,111.437%20389.851,111.525%20389.77,111.525C389.686,111.525%20389.631,111.466%20389.583,111.418C389.535,111.37%20386.69,108.635%20386.69,108.635L386.635,108.58C386.613,108.547%20386.595,108.507%20386.595,108.463C386.595,108.419%20386.613,108.378%20386.635,108.345C386.65,108.331%20386.66,108.32%20386.675,108.301C386.957,108.004%20387.529,107.403%20387.566,107.367C387.614,107.319%20387.654,107.256%20387.742,107.256C387.834,107.256%20387.892,107.334%20387.936,107.378C387.98,107.421%20389.586,108.965%20389.586,108.965L393.668,103.722C393.704,103.692%20393.749,103.67%20393.796,103.67C393.844,103.67%20393.887,103.688%20393.925,103.718L395.046,104.602C395.076,104.638%20395.094,104.682%20395.094,104.73C395.098,104.778%20395.079,104.818%20395.057,104.851%22%20fill%3D%22rgb(128,128,128)%22%2F%3E%3C%2Fsvg%3E")` | `url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%228.5%22%20height%3D%227.9%22%20viewBox%3D%22386.595%20103.67%208.5%207.855%22%3E%3Cpath%20d%3D%22M395.057,104.851L389.957,111.396C389.917,111.437%20389.851,111.525%20389.77,111.525C389.686,111.525%20389.631,111.466%20389.583,111.418C389.535,111.37%20386.69,108.635%20386.69,108.635L386.635,108.58C386.613,108.547%20386.595,108.507%20386.595,108.463C386.595,108.419%20386.613,108.378%20386.635,108.345C386.65,108.331%20386.66,108.32%20386.675,108.301C386.957,108.004%20387.529,107.403%20387.566,107.367C387.614,107.319%20387.654,107.256%20387.742,107.256C387.834,107.256%20387.892,107.334%20387.936,107.378C387.98,107.421%20389.586,108.965%20389.586,108.965L393.668,103.722C393.704,103.692%20393.749,103.67%20393.796,103.67C393.844,103.67%20393.887,103.688%20393.925,103.718L395.046,104.602C395.076,104.638%20395.094,104.682%20395.094,104.73C395.098,104.778%20395.079,104.818%20395.057,104.851%22%20fill%3D%22rgb(128,128,128)%22%2F%3E%3C%2Fsvg%3E")` |
|
|
17
|
+
| `--c-checkbox-check-size` | `8.5px 7.9px` | `8.5px 7.9px` |
|
|
18
|
+
| `--c-checkbox-radius` | `5px` | `5px` |
|
|
19
|
+
| `--c-checkbox-size` | `18px` | `18px` |
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.c-form-control{--c-form-control-gap: 10px;--c-form-control-inset: 10px;--c-form-control-error-content: var(--c-color-red-70);display:flex;flex-direction:column;gap:var(--c-form-control-gap)}.c-form-control>label{align-self:flex-start;margin-left:var(--c-form-control-inset)}.c-form-control-error-message{margin-left:var(--c-form-control-inset);color:var(--c-form-control-error-content);font-family:var(--c-font-family-primary);font-size:var(--c-font-size-xs);font-weight:400}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _label=_interopRequireDefault(require("../label/label.jsx"));require("./form-control.css");var _jsxRuntime=require("react/jsx-runtime");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const FormControl=({label:e,htmlFor:t,required:o,errorMessage:r,className:l,children:s,...u})=>{const a=["c-form-control",l].filter(Boolean).join(" ");return(0,_jsxRuntime.jsxs)("div",{className:a,...u,children:[e&&(0,_jsxRuntime.jsx)(_label.default,{htmlFor:t,required:o,children:e}),s,r&&(0,_jsxRuntime.jsx)("span",{className:"c-form-control-error-message",children:r})]})};var _default=exports.default=FormControl;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: FormControl
|
|
3
|
+
description: A wrapper that places a label above a form field and an optional error message below it.
|
|
4
|
+
purpose: Compose a label, a field, and an error message with consistent spacing, so consumers do not do it by hand.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# FormControl
|
|
8
|
+
|
|
9
|
+
Wraps a form field (`Input`, `Select`, `Textarea`, etc.), passed as `children`, with a `Label` above it and an optional error message below it. Extra native `div` attributes and `className` are applied to the root element.
|
|
10
|
+
|
|
11
|
+
`FormControl` does not manage the field. It never sets `id`, `invalid`, `required`, `disabled`, or any other attribute on the children. The label is rendered only when `label` is given. To associate the label with the field, pass `htmlFor` and give the field the same value as its `id`.
|
|
12
|
+
|
|
13
|
+
## Props
|
|
14
|
+
|
|
15
|
+
The FormControl API extends the native HTML `div` attributes.
|
|
16
|
+
|
|
17
|
+
<!-- BEGIN GENERATED PROPS -->
|
|
18
|
+
_Also inherits all props from `HTMLAttributes<HTMLDivElement>`._
|
|
19
|
+
|
|
20
|
+
| Name | Type | Required | Default | Description |
|
|
21
|
+
| --- | --- | --- | --- | --- |
|
|
22
|
+
| errorMessage | `string` | No | | Message rendered below the field. Nothing is rendered when empty. |
|
|
23
|
+
| htmlFor | `string` | No | | Forwarded to the label as `htmlFor`. Give the field the same value as its `id` to associate them. |
|
|
24
|
+
| label | `string` | No | | Text of the label rendered above the field. When not given, no label is rendered. |
|
|
25
|
+
| required | `boolean` | No | `false` | Shows the required asterisk in the label. Visual only: it does not set `required` on the field. |
|
|
26
|
+
<!-- END GENERATED PROPS -->
|
|
27
|
+
|
|
28
|
+
## When to use
|
|
29
|
+
|
|
30
|
+
- Showing a label, a field, and an error message together with consistent spacing
|
|
31
|
+
- Marking a field as required in the label while the field itself is controlled by the consumer
|
|
32
|
+
|
|
33
|
+
## When NOT to use
|
|
34
|
+
|
|
35
|
+
- **Checkbox or radio captions** — use the `label` prop of the checkbox or radio component.
|
|
36
|
+
- **Validation or `invalid` handling** — `FormControl` only displays the message you give it; set `invalid` on the field yourself.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Form-control tokens
|
|
2
|
+
|
|
3
|
+
Generated from `src/components/form-control/form-control.css`.
|
|
4
|
+
|
|
5
|
+
## Base tokens
|
|
6
|
+
|
|
7
|
+
| Token | Declared value | Resolution |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| `--c-form-control-error-content` | `var(--c-color-red-70)` | `var(--c-color-red-70) → hsl(0 100% 70%)` |
|
|
10
|
+
| `--c-form-control-gap` | `10px` | `10px` |
|
|
11
|
+
| `--c-form-control-inset` | `10px` | `10px` |
|
|
@@ -1 +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:
|
|
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:background-color .15s ease-out,border-color .15s ease-out,box-shadow .15s ease-out,color .15s ease-out}.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
|
+
.c-label{--c-label-content: var(--c-color-gray-15);--c-label-content-disabled: var(--c-color-gray-50);--c-label-asterisk: var(--c-color-red-70);color:var(--c-label-content);font-family:var(--c-font-family-primary);font-size:var(--c-font-size-xs);font-weight:600}.c-label.is-disabled{color:var(--c-label-content-disabled)}.c-label.is-required:after{margin-left:5px;content:"*";color:var(--c-label-asterisk)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0,require("./label.css");var _jsxRuntime=require("react/jsx-runtime");const Label=({disabled:s,required:r,className:l,children:e,...t})=>{const a=buildLabelClasses({disabled:s,required:r,className:l});return(0,_jsxRuntime.jsx)("label",{className:a,...t,children:e})};function buildLabelClasses({disabled:s,required:r,className:l}){const e=["c-label"];return s&&e.push("is-disabled"),r&&e.push("is-required"),[...e,l].filter(Boolean).join(" ")}var _default=exports.default=Label;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Label
|
|
3
|
+
description: A text label that extends the native HTML label element.
|
|
4
|
+
purpose: Name a form control with consistent label typography, on its own or next to any control.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Label
|
|
8
|
+
|
|
9
|
+
A standalone form label. It extends the native HTML `label` element, so every native attribute (`htmlFor`, `className`, `data-*`, etc.) is accepted. The component adds two visual props: `disabled`, which renders the text in the disabled color, and `required`, which shows a red asterisk after the text. The asterisk is drawn with CSS only, so it is not part of the label text.
|
|
10
|
+
|
|
11
|
+
## Props
|
|
12
|
+
|
|
13
|
+
The Label API extends the native HTML `label` attributes. Props such as `htmlFor` come from the native element and are not listed below.
|
|
14
|
+
|
|
15
|
+
<!-- BEGIN GENERATED PROPS -->
|
|
16
|
+
_Also inherits all props from `LabelHTMLAttributes<HTMLLabelElement>`._
|
|
17
|
+
|
|
18
|
+
| Name | Type | Required | Default | Description |
|
|
19
|
+
| --- | --- | --- | --- | --- |
|
|
20
|
+
| disabled | `boolean` | No | `false` | Renders the text in the disabled color. Visual only: it does not disable any control. |
|
|
21
|
+
| required | `boolean` | No | `false` | Shows a red asterisk after the text. Visual only: the asterisk is drawn with CSS and it does not make any control required. |
|
|
22
|
+
<!-- END GENERATED PROPS -->
|
|
23
|
+
|
|
24
|
+
## When to use
|
|
25
|
+
|
|
26
|
+
- Naming a form control by pairing `htmlFor` with the control `id`
|
|
27
|
+
- Signaling that the named control is required with the `required` prop
|
|
28
|
+
- Showing a label that follows the library typography, with a disabled look next to a disabled control
|
|
29
|
+
|
|
30
|
+
## When NOT to use
|
|
31
|
+
|
|
32
|
+
- **Checkbox or radio captions** — use the `label` prop of the checkbox or radio component, which renders and associates a label for you.
|
|
33
|
+
- **Disabling a control** — the `disabled` prop is visual only; disable the control itself.
|
|
34
|
+
- **Making a control required** — the `required` prop is visual only; set `required` on the control itself.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Label tokens
|
|
2
|
+
|
|
3
|
+
Generated from `src/components/label/label.css`.
|
|
4
|
+
|
|
5
|
+
## Base tokens
|
|
6
|
+
|
|
7
|
+
| Token | Declared value | Resolution |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| `--c-label-asterisk` | `var(--c-color-red-70)` | `var(--c-color-red-70) → hsl(0 100% 70%)` |
|
|
10
|
+
| `--c-label-content` | `var(--c-color-gray-15)` | `var(--c-color-gray-15) → hsl(0 0% 15%)` |
|
|
11
|
+
| `--c-label-content-disabled` | `var(--c-color-gray-50)` | `var(--c-color-gray-50) → hsl(0 0% 50%)` |
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.c-radio-wrapper{display:inline-flex;align-items:center;gap:10px}.c-radio-wrapper .c-label:hover:not(.is-disabled){cursor:pointer}.c-radio{--c-radio-background: var(--c-color-gray-95);--c-radio-background-disabled: var(--c-color-gray-85);--c-radio-background-checked: var(--c-color-gray-10);--c-radio-border-color: var(--c-color-gray-85);--c-radio-border-color-disabled: var(--c-color-gray-85);--c-radio-border-color-checked: var(--c-color-gray-10);--c-radio-check: url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%228.5%22%20height%3D%227.9%22%20viewBox%3D%22386.595%20103.67%208.5%207.855%22%3E%3Cpath%20d%3D%22M395.057,104.851L389.957,111.396C389.917,111.437%20389.851,111.525%20389.77,111.525C389.686,111.525%20389.631,111.466%20389.583,111.418C389.535,111.37%20386.69,108.635%20386.69,108.635L386.635,108.58C386.613,108.547%20386.595,108.507%20386.595,108.463C386.595,108.419%20386.613,108.378%20386.635,108.345C386.65,108.331%20386.66,108.32%20386.675,108.301C386.957,108.004%20387.529,107.403%20387.566,107.367C387.614,107.319%20387.654,107.256%20387.742,107.256C387.834,107.256%20387.892,107.334%20387.936,107.378C387.98,107.421%20389.586,108.965%20389.586,108.965L393.668,103.722C393.704,103.692%20393.749,103.67%20393.796,103.67C393.844,103.67%20393.887,103.688%20393.925,103.718L395.046,104.602C395.076,104.638%20395.094,104.682%20395.094,104.73C395.098,104.778%20395.079,104.818%20395.057,104.851%22%20fill%3D%22white%22%2F%3E%3C%2Fsvg%3E);--c-radio-check-disabled: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%228.5%22%20height%3D%227.9%22%20viewBox%3D%22386.595%20103.67%208.5%207.855%22%3E%3Cpath%20d%3D%22M395.057,104.851L389.957,111.396C389.917,111.437%20389.851,111.525%20389.77,111.525C389.686,111.525%20389.631,111.466%20389.583,111.418C389.535,111.37%20386.69,108.635%20386.69,108.635L386.635,108.58C386.613,108.547%20386.595,108.507%20386.595,108.463C386.595,108.419%20386.613,108.378%20386.635,108.345C386.65,108.331%20386.66,108.32%20386.675,108.301C386.957,108.004%20387.529,107.403%20387.566,107.367C387.614,107.319%20387.654,107.256%20387.742,107.256C387.834,107.256%20387.892,107.334%20387.936,107.378C387.98,107.421%20389.586,108.965%20389.586,108.965L393.668,103.722C393.704,103.692%20393.749,103.67%20393.796,103.67C393.844,103.67%20393.887,103.688%20393.925,103.718L395.046,104.602C395.076,104.638%20395.094,104.682%20395.094,104.73C395.098,104.778%20395.079,104.818%20395.057,104.851%22%20fill%3D%22rgb(128,128,128)%22%2F%3E%3C%2Fsvg%3E");--c-radio-size: 18px;--c-radio-check-size: 8.5px 7.9px;appearance:none;-webkit-appearance:none;-moz-appearance:none;display:inline-block;flex-shrink:0;margin:0;width:var(--c-radio-size);height:var(--c-radio-size);background-color:var(--c-radio-background);background-repeat:no-repeat;background-position:center;background-size:var(--c-radio-check-size);border:1px solid var(--c-radio-border-color);border-radius:50%;outline:none;box-shadow:0 0 0 0 var(--c-color-gray-95);box-sizing:border-box;cursor:pointer;transition:background-color .15s ease-out,border-color .15s ease-out,box-shadow .15s ease-out}.c-radio:checked{background-color:var(--c-radio-background-checked);background-image:var(--c-radio-check);border-color:var(--c-radio-border-color-checked)}.c-radio:focus-visible{box-shadow:0 0 0 5px var(--c-color-gray-95)}.c-radio:focus-visible:not(:checked){background-color:#fff}.c-radio:focus-visible:checked{box-shadow:0 0 0 5px var(--c-color-accented-80)}.c-radio:disabled{background-color:var(--c-radio-background-disabled);border-color:var(--c-radio-border-color-disabled);cursor:default}.c-radio:disabled:checked{background-image:var(--c-radio-check-disabled)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _react=require("react"),_label=_interopRequireDefault(require("../label/label.jsx"));require("./radio.css");var _jsxRuntime=require("react/jsx-runtime");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const Radio=({id:e,label:r,className:i,...t})=>{const u=(0,_react.useId)(),a=e||u,d=["c-radio",i].filter(Boolean).join(" "),s=(0,_jsxRuntime.jsx)("input",{id:r?a:e,className:d,...t,type:"radio"});return r?(0,_jsxRuntime.jsxs)("span",{className:"c-radio-wrapper",children:[s,(0,_jsxRuntime.jsx)(_label.default,{htmlFor:a,disabled:t.disabled,children:r})]}):s};var _default=exports.default=Radio;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Radio
|
|
3
|
+
description: A native radio input with the library look and an optional built-in label.
|
|
4
|
+
purpose: Let the user pick exactly one option from a small group of mutually exclusive options.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Radio
|
|
8
|
+
|
|
9
|
+
A styled native `input` of type `radio`. Every native input attribute (`checked`, `defaultChecked`, `disabled`, `onChange`, `name`, `value`, `id`, etc.) is forwarded to the input. Radios sharing a `name` are mutually exclusive, with native keyboard navigation. When `label` is given, the component also renders a `Label` next to the input and associates both, so clicking the text selects the radio.
|
|
10
|
+
|
|
11
|
+
## Props
|
|
12
|
+
|
|
13
|
+
The Radio API extends the native HTML `input` attributes, except `type`. Props such as `name`, `checked` and `onChange` come from the native element and are not listed below.
|
|
14
|
+
|
|
15
|
+
> **Note:** always pass the same `name` to every radio in a group. Without it, each radio becomes its own group: the keyboard focuses each one separately and the arrow keys do not move between options.
|
|
16
|
+
|
|
17
|
+
<!-- BEGIN GENERATED PROPS -->
|
|
18
|
+
_Also inherits all props from `Omit<InputHTMLAttributes<HTMLInputElement>, 'type'>`._
|
|
19
|
+
|
|
20
|
+
| Name | Type | Required | Default | Description |
|
|
21
|
+
| --- | --- | --- | --- | --- |
|
|
22
|
+
| label | `string` | No | | Text of the label rendered next to the radio and associated with it. |
|
|
23
|
+
<!-- END GENERATED PROPS -->
|
|
24
|
+
|
|
25
|
+
## When to use
|
|
26
|
+
|
|
27
|
+
- Picking exactly one option from a short, visible list
|
|
28
|
+
- Groups of options where the user should compare all choices at once
|
|
29
|
+
|
|
30
|
+
## When NOT to use
|
|
31
|
+
|
|
32
|
+
- **Multiple selections** — use checkboxes when any number of options can be picked.
|
|
33
|
+
- **Long option lists** — use a select when there are many options.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Radio tokens
|
|
2
|
+
|
|
3
|
+
Generated from `src/components/radio/radio.css`.
|
|
4
|
+
|
|
5
|
+
## Base tokens
|
|
6
|
+
|
|
7
|
+
| Token | Declared value | Resolution |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| `--c-radio-background` | `var(--c-color-gray-95)` | `var(--c-color-gray-95) → hsl(0 0% 95%)` |
|
|
10
|
+
| `--c-radio-background-checked` | `var(--c-color-gray-10)` | `var(--c-color-gray-10) → hsl(0 0% 10%)` |
|
|
11
|
+
| `--c-radio-background-disabled` | `var(--c-color-gray-85)` | `var(--c-color-gray-85) → hsl(0 0% 85%)` |
|
|
12
|
+
| `--c-radio-border-color` | `var(--c-color-gray-85)` | `var(--c-color-gray-85) → hsl(0 0% 85%)` |
|
|
13
|
+
| `--c-radio-border-color-checked` | `var(--c-color-gray-10)` | `var(--c-color-gray-10) → hsl(0 0% 10%)` |
|
|
14
|
+
| `--c-radio-border-color-disabled` | `var(--c-color-gray-85)` | `var(--c-color-gray-85) → hsl(0 0% 85%)` |
|
|
15
|
+
| `--c-radio-check` | `url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%228.5%22%20height%3D%227.9%22%20viewBox%3D%22386.595%20103.67%208.5%207.855%22%3E%3Cpath%20d%3D%22M395.057,104.851L389.957,111.396C389.917,111.437%20389.851,111.525%20389.77,111.525C389.686,111.525%20389.631,111.466%20389.583,111.418C389.535,111.37%20386.69,108.635%20386.69,108.635L386.635,108.58C386.613,108.547%20386.595,108.507%20386.595,108.463C386.595,108.419%20386.613,108.378%20386.635,108.345C386.65,108.331%20386.66,108.32%20386.675,108.301C386.957,108.004%20387.529,107.403%20387.566,107.367C387.614,107.319%20387.654,107.256%20387.742,107.256C387.834,107.256%20387.892,107.334%20387.936,107.378C387.98,107.421%20389.586,108.965%20389.586,108.965L393.668,103.722C393.704,103.692%20393.749,103.67%20393.796,103.67C393.844,103.67%20393.887,103.688%20393.925,103.718L395.046,104.602C395.076,104.638%20395.094,104.682%20395.094,104.73C395.098,104.778%20395.079,104.818%20395.057,104.851%22%20fill%3D%22white%22%2F%3E%3C%2Fsvg%3E")` | `url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%228.5%22%20height%3D%227.9%22%20viewBox%3D%22386.595%20103.67%208.5%207.855%22%3E%3Cpath%20d%3D%22M395.057,104.851L389.957,111.396C389.917,111.437%20389.851,111.525%20389.77,111.525C389.686,111.525%20389.631,111.466%20389.583,111.418C389.535,111.37%20386.69,108.635%20386.69,108.635L386.635,108.58C386.613,108.547%20386.595,108.507%20386.595,108.463C386.595,108.419%20386.613,108.378%20386.635,108.345C386.65,108.331%20386.66,108.32%20386.675,108.301C386.957,108.004%20387.529,107.403%20387.566,107.367C387.614,107.319%20387.654,107.256%20387.742,107.256C387.834,107.256%20387.892,107.334%20387.936,107.378C387.98,107.421%20389.586,108.965%20389.586,108.965L393.668,103.722C393.704,103.692%20393.749,103.67%20393.796,103.67C393.844,103.67%20393.887,103.688%20393.925,103.718L395.046,104.602C395.076,104.638%20395.094,104.682%20395.094,104.73C395.098,104.778%20395.079,104.818%20395.057,104.851%22%20fill%3D%22white%22%2F%3E%3C%2Fsvg%3E")` |
|
|
16
|
+
| `--c-radio-check-disabled` | `url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%228.5%22%20height%3D%227.9%22%20viewBox%3D%22386.595%20103.67%208.5%207.855%22%3E%3Cpath%20d%3D%22M395.057,104.851L389.957,111.396C389.917,111.437%20389.851,111.525%20389.77,111.525C389.686,111.525%20389.631,111.466%20389.583,111.418C389.535,111.37%20386.69,108.635%20386.69,108.635L386.635,108.58C386.613,108.547%20386.595,108.507%20386.595,108.463C386.595,108.419%20386.613,108.378%20386.635,108.345C386.65,108.331%20386.66,108.32%20386.675,108.301C386.957,108.004%20387.529,107.403%20387.566,107.367C387.614,107.319%20387.654,107.256%20387.742,107.256C387.834,107.256%20387.892,107.334%20387.936,107.378C387.98,107.421%20389.586,108.965%20389.586,108.965L393.668,103.722C393.704,103.692%20393.749,103.67%20393.796,103.67C393.844,103.67%20393.887,103.688%20393.925,103.718L395.046,104.602C395.076,104.638%20395.094,104.682%20395.094,104.73C395.098,104.778%20395.079,104.818%20395.057,104.851%22%20fill%3D%22rgb(128,128,128)%22%2F%3E%3C%2Fsvg%3E")` | `url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%228.5%22%20height%3D%227.9%22%20viewBox%3D%22386.595%20103.67%208.5%207.855%22%3E%3Cpath%20d%3D%22M395.057,104.851L389.957,111.396C389.917,111.437%20389.851,111.525%20389.77,111.525C389.686,111.525%20389.631,111.466%20389.583,111.418C389.535,111.37%20386.69,108.635%20386.69,108.635L386.635,108.58C386.613,108.547%20386.595,108.507%20386.595,108.463C386.595,108.419%20386.613,108.378%20386.635,108.345C386.65,108.331%20386.66,108.32%20386.675,108.301C386.957,108.004%20387.529,107.403%20387.566,107.367C387.614,107.319%20387.654,107.256%20387.742,107.256C387.834,107.256%20387.892,107.334%20387.936,107.378C387.98,107.421%20389.586,108.965%20389.586,108.965L393.668,103.722C393.704,103.692%20393.749,103.67%20393.796,103.67C393.844,103.67%20393.887,103.688%20393.925,103.718L395.046,104.602C395.076,104.638%20395.094,104.682%20395.094,104.73C395.098,104.778%20395.079,104.818%20395.057,104.851%22%20fill%3D%22rgb(128,128,128)%22%2F%3E%3C%2Fsvg%3E")` |
|
|
17
|
+
| `--c-radio-check-size` | `8.5px 7.9px` | `8.5px 7.9px` |
|
|
18
|
+
| `--c-radio-size` | `18px` | `18px` |
|
|
@@ -1 +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:
|
|
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:background-color .15s ease-out,border-color .15s ease-out,box-shadow .15s ease-out,color .15s ease-out}.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)}
|
|
@@ -1 +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 .
|
|
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-color .15s ease-out,border-color .15s ease-out,box-shadow .15s ease-out,color .15s ease-out}.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)}
|
|
@@ -5,6 +5,10 @@ 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
|
+
| Checkbox | A native checkbox input with the library look and an optional built-in label. | Let the user turn an option on or off, or pick several options from a list. | [`../components/checkbox/checkbox.md`](../components/checkbox/checkbox.md) |
|
|
9
|
+
| FormControl | A wrapper that places a label above a form field and an optional error message below it. | Compose a label, a field, and an error message with consistent spacing, so consumers do not do it by hand. | [`../components/form-control/form-control.md`](../components/form-control/form-control.md) |
|
|
8
10
|
| 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) |
|
|
11
|
+
| Label | A text label that extends the native HTML label element. | Name a form control with consistent label typography, on its own or next to any control. | [`../components/label/label.md`](../components/label/label.md) |
|
|
12
|
+
| Radio | A native radio input with the library look and an optional built-in label. | Let the user pick exactly one option from a small group of mutually exclusive options. | [`../components/radio/radio.md`](../components/radio/radio.md) |
|
|
9
13
|
| 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
14
|
| 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) |
|
package/dist/cjs/docs/tokens.md
CHANGED
|
@@ -44,3 +44,12 @@ Generated from `src/vars.css`. Values show the declared token and the resolved r
|
|
|
44
44
|
| `--c-color-red-90` | `hsl(0 100% 90%)` | `hsl(0 100% 90%)` |
|
|
45
45
|
| `--c-color-red-95` | `hsl(0 100% 95%)` | `hsl(0 100% 95%)` |
|
|
46
46
|
| `--c-font-family-primary` | `'Inter', sans-serif` | `'Inter', sans-serif` |
|
|
47
|
+
| `--c-font-size-lg` | `1.250rem` | `1.250rem` |
|
|
48
|
+
| `--c-font-size-md` | `1.125rem` | `1.125rem` |
|
|
49
|
+
| `--c-font-size-sm` | `1.000rem` | `1.000rem` |
|
|
50
|
+
| `--c-font-size-xl` | `1.500rem` | `1.500rem` |
|
|
51
|
+
| `--c-font-size-xs` | `0.875rem` | `0.875rem` |
|
|
52
|
+
| `--c-font-size-xxl` | `2.250rem` | `2.250rem` |
|
|
53
|
+
| `--c-font-size-xxs` | `0.750rem` | `0.750rem` |
|
|
54
|
+
| `--c-font-size-xxxl` | `3.000rem` | `3.000rem` |
|
|
55
|
+
| `--c-font-size-xxxs` | `0.625rem` | `0.625rem` |
|
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}}),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}}
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"Button",{enumerable:!0,get:function(){return _button.default}}),Object.defineProperty(exports,"Checkbox",{enumerable:!0,get:function(){return _checkbox.default}}),Object.defineProperty(exports,"FormControl",{enumerable:!0,get:function(){return _formControl.default}}),Object.defineProperty(exports,"Input",{enumerable:!0,get:function(){return _input.default}}),Object.defineProperty(exports,"Label",{enumerable:!0,get:function(){return _label.default}}),Object.defineProperty(exports,"Radio",{enumerable:!0,get:function(){return _radio.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")),_checkbox=_interopRequireDefault(require("./components/checkbox/checkbox.jsx")),_formControl=_interopRequireDefault(require("./components/form-control/form-control.jsx")),_input=_interopRequireDefault(require("./components/input/input.jsx")),_label=_interopRequireDefault(require("./components/label/label.jsx")),_radio=_interopRequireDefault(require("./components/radio/radio.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-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)}
|
|
1
|
+
:root{--c-font-family-primary: "Inter", sans-serif;--c-font-size-xxxs: .625rem;--c-font-size-xxs: .75rem;--c-font-size-xs: .875rem;--c-font-size-sm: 1rem;--c-font-size-md: 1.125rem;--c-font-size-lg: 1.25rem;--c-font-size-xl: 1.5rem;--c-font-size-xxl: 2.25rem;--c-font-size-xxxl: 3rem;--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/docs/components.md
CHANGED
|
@@ -5,6 +5,10 @@ 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
|
+
| Checkbox | A native checkbox input with the library look and an optional built-in label. | Let the user turn an option on or off, or pick several options from a list. | [`../components/checkbox/checkbox.md`](../components/checkbox/checkbox.md) |
|
|
9
|
+
| FormControl | A wrapper that places a label above a form field and an optional error message below it. | Compose a label, a field, and an error message with consistent spacing, so consumers do not do it by hand. | [`../components/form-control/form-control.md`](../components/form-control/form-control.md) |
|
|
8
10
|
| 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) |
|
|
11
|
+
| Label | A text label that extends the native HTML label element. | Name a form control with consistent label typography, on its own or next to any control. | [`../components/label/label.md`](../components/label/label.md) |
|
|
12
|
+
| Radio | A native radio input with the library look and an optional built-in label. | Let the user pick exactly one option from a small group of mutually exclusive options. | [`../components/radio/radio.md`](../components/radio/radio.md) |
|
|
9
13
|
| 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
14
|
| 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) |
|
package/dist/docs/tokens.md
CHANGED
|
@@ -44,3 +44,12 @@ Generated from `src/vars.css`. Values show the declared token and the resolved r
|
|
|
44
44
|
| `--c-color-red-90` | `hsl(0 100% 90%)` | `hsl(0 100% 90%)` |
|
|
45
45
|
| `--c-color-red-95` | `hsl(0 100% 95%)` | `hsl(0 100% 95%)` |
|
|
46
46
|
| `--c-font-family-primary` | `'Inter', sans-serif` | `'Inter', sans-serif` |
|
|
47
|
+
| `--c-font-size-lg` | `1.250rem` | `1.250rem` |
|
|
48
|
+
| `--c-font-size-md` | `1.125rem` | `1.125rem` |
|
|
49
|
+
| `--c-font-size-sm` | `1.000rem` | `1.000rem` |
|
|
50
|
+
| `--c-font-size-xl` | `1.500rem` | `1.500rem` |
|
|
51
|
+
| `--c-font-size-xs` | `0.875rem` | `0.875rem` |
|
|
52
|
+
| `--c-font-size-xxl` | `2.250rem` | `2.250rem` |
|
|
53
|
+
| `--c-font-size-xxs` | `0.750rem` | `0.750rem` |
|
|
54
|
+
| `--c-font-size-xxxl` | `3.000rem` | `3.000rem` |
|
|
55
|
+
| `--c-font-size-xxxs` | `0.625rem` | `0.625rem` |
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.c-button{--c-button-background: var(--c-color-gray-90);--c-button-background-hover: var(--c-color-gray-95);--c-button-background-disabled: var(--c-color-gray-95);--c-button-content: var(--c-color-gray-10);--c-button-content-disabled: var(--c-color-gray-60);--c-button-border-color: var(--c-color-gray-90);--c-button-border-color-disabled: var(--c-color-gray-95);--c-button-box-shadow-color: var(--c-color-gray-95);--c-button-radius: 10px;--c-button-height: 40px;--c-button-width: auto;--c-button-padding: 10px 25px;display:inline-flex;position:relative;align-items:center;justify-content:center;width:var(--c-button-width);height:var(--c-button-height);padding:var(--c-button-padding);background:var(--c-button-background);color:var(--c-button-content);font-family:var(--c-font-family-primary);font-size:1rem;font-weight:700;line-height:1;border:1px solid var(--c-button-border-color);border-radius:var(--c-button-radius);box-shadow:0 0 0 0 var(--c-button-box-shadow-color);box-sizing:border-box;cursor:pointer;outline:0;transition:
|
|
1
|
+
.c-button{--c-button-background: var(--c-color-gray-90);--c-button-background-hover: var(--c-color-gray-95);--c-button-background-disabled: var(--c-color-gray-95);--c-button-content: var(--c-color-gray-10);--c-button-content-disabled: var(--c-color-gray-60);--c-button-border-color: var(--c-color-gray-90);--c-button-border-color-disabled: var(--c-color-gray-95);--c-button-box-shadow-color: var(--c-color-gray-95);--c-button-radius: 10px;--c-button-height: 40px;--c-button-width: auto;--c-button-padding: 10px 25px;display:inline-flex;position:relative;align-items:center;justify-content:center;width:var(--c-button-width);height:var(--c-button-height);padding:var(--c-button-padding);background:var(--c-button-background);color:var(--c-button-content);font-family:var(--c-font-family-primary);font-size:1rem;font-weight:700;line-height:1;border:1px solid var(--c-button-border-color);border-radius:var(--c-button-radius);box-shadow:0 0 0 0 var(--c-button-box-shadow-color);box-sizing:border-box;cursor:pointer;outline:0;transition:background-color .15s ease-out,border-color .15s ease-out,box-shadow .15s ease-out,color .15s ease-out}.c-button:hover:not(:disabled){background:var(--c-button-background-hover)}.c-button:focus-visible{box-shadow:0 0 0 5px var(--c-button-box-shadow-color)}.c-button.is-accented:not(.is-outline):focus-visible{box-shadow:0 0 0 5px var(--c-color-accented-80)}.c-button.is-outline:focus-visible,.c-button.is-borderless:focus-visible{box-shadow:0 0 0 5px var(--c-color-accented-90)}.c-button:disabled{background:var(--c-button-background-disabled);color:var(--c-button-content-disabled);border-color:var(--c-button-border-color-disabled);cursor:default}.c-button.is-accented{--c-button-background: var(--c-color-accented-10);--c-button-background-hover: var(--c-color-accented-20);--c-button-background-disabled: var(--c-color-accented-30);--c-button-content: var(--c-color-accented-95);--c-button-content-disabled: var(--c-color-accented-80);--c-button-border-color: var(--c-color-accented-10);--c-button-border-color-disabled: var(--c-color-accented-30)}.c-button.is-outline{--c-button-background: transparent;--c-button-background-hover: var(--c-color-gray-95);--c-button-background-disabled: transparent;--c-button-border-color: var(--c-color-gray-70);--c-button-border-color-disabled: var(--c-color-gray-85);--c-button-content: var(--c-color-gray-20)}.c-button.is-borderless{--c-button-background: transparent;--c-button-background-hover: var(--c-color-gray-95);--c-button-background-disabled: transparent;--c-button-border-color: transparent;--c-button-border-color-disabled: transparent;--c-button-content: var(--c-color-gray-30)}.c-button.is-accented.is-outline{--c-button-content: var(--c-color-accented-10);--c-button-content-disabled: var(--c-color-accented-70);--c-button-border-color: var(--c-color-accented-10);--c-button-border-color-disabled: var(--c-color-accented-70)}.c-button.is-accented.is-borderless{--c-button-content: var(--c-color-accented-10)}.c-button.is-round{--c-button-radius: 20px}.c-button.is-isometric{--c-button-height: 40px;--c-button-width: 40px;--c-button-padding: 0}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.c-checkbox-wrapper{display:inline-flex;align-items:center;gap:10px}.c-checkbox-wrapper .c-label:hover:not(.is-disabled){cursor:pointer}.c-checkbox{--c-checkbox-background: var(--c-color-gray-95);--c-checkbox-background-disabled: var(--c-color-gray-85);--c-checkbox-background-checked: var(--c-color-gray-10);--c-checkbox-border-color: var(--c-color-gray-85);--c-checkbox-border-color-disabled: var(--c-color-gray-85);--c-checkbox-border-color-checked: var(--c-color-gray-10);--c-checkbox-check: url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%228.5%22%20height%3D%227.9%22%20viewBox%3D%22386.595%20103.67%208.5%207.855%22%3E%3Cpath%20d%3D%22M395.057,104.851L389.957,111.396C389.917,111.437%20389.851,111.525%20389.77,111.525C389.686,111.525%20389.631,111.466%20389.583,111.418C389.535,111.37%20386.69,108.635%20386.69,108.635L386.635,108.58C386.613,108.547%20386.595,108.507%20386.595,108.463C386.595,108.419%20386.613,108.378%20386.635,108.345C386.65,108.331%20386.66,108.32%20386.675,108.301C386.957,108.004%20387.529,107.403%20387.566,107.367C387.614,107.319%20387.654,107.256%20387.742,107.256C387.834,107.256%20387.892,107.334%20387.936,107.378C387.98,107.421%20389.586,108.965%20389.586,108.965L393.668,103.722C393.704,103.692%20393.749,103.67%20393.796,103.67C393.844,103.67%20393.887,103.688%20393.925,103.718L395.046,104.602C395.076,104.638%20395.094,104.682%20395.094,104.73C395.098,104.778%20395.079,104.818%20395.057,104.851%22%20fill%3D%22white%22%2F%3E%3C%2Fsvg%3E);--c-checkbox-check-disabled: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%228.5%22%20height%3D%227.9%22%20viewBox%3D%22386.595%20103.67%208.5%207.855%22%3E%3Cpath%20d%3D%22M395.057,104.851L389.957,111.396C389.917,111.437%20389.851,111.525%20389.77,111.525C389.686,111.525%20389.631,111.466%20389.583,111.418C389.535,111.37%20386.69,108.635%20386.69,108.635L386.635,108.58C386.613,108.547%20386.595,108.507%20386.595,108.463C386.595,108.419%20386.613,108.378%20386.635,108.345C386.65,108.331%20386.66,108.32%20386.675,108.301C386.957,108.004%20387.529,107.403%20387.566,107.367C387.614,107.319%20387.654,107.256%20387.742,107.256C387.834,107.256%20387.892,107.334%20387.936,107.378C387.98,107.421%20389.586,108.965%20389.586,108.965L393.668,103.722C393.704,103.692%20393.749,103.67%20393.796,103.67C393.844,103.67%20393.887,103.688%20393.925,103.718L395.046,104.602C395.076,104.638%20395.094,104.682%20395.094,104.73C395.098,104.778%20395.079,104.818%20395.057,104.851%22%20fill%3D%22rgb(128,128,128)%22%2F%3E%3C%2Fsvg%3E");--c-checkbox-radius: 5px;--c-checkbox-size: 18px;--c-checkbox-check-size: 8.5px 7.9px;appearance:none;-webkit-appearance:none;-moz-appearance:none;display:inline-block;flex-shrink:0;margin:0;width:var(--c-checkbox-size);height:var(--c-checkbox-size);background-color:var(--c-checkbox-background);background-repeat:no-repeat;background-position:center;background-size:var(--c-checkbox-check-size);border:1px solid var(--c-checkbox-border-color);border-radius:var(--c-checkbox-radius);outline:none;box-shadow:0 0 0 0 var(--c-color-gray-95);box-sizing:border-box;cursor:pointer;transition:background-color .15s ease-out,border-color .15s ease-out,box-shadow .15s ease-out}.c-checkbox:checked{background-color:var(--c-checkbox-background-checked);background-image:var(--c-checkbox-check);border-color:var(--c-checkbox-border-color-checked)}.c-checkbox:focus-visible{box-shadow:0 0 0 5px var(--c-color-gray-95)}.c-checkbox:focus-visible:not(:checked){background-color:#fff}.c-checkbox:focus-visible:checked{box-shadow:0 0 0 5px var(--c-color-accented-80)}.c-checkbox:disabled{background-color:var(--c-checkbox-background-disabled);border-color:var(--c-checkbox-border-color-disabled);cursor:default}.c-checkbox:disabled:checked{background-image:var(--c-checkbox-check-disabled)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useId as p}from"react";import d from"../label/label.js";import"./checkbox.css";import{jsx as r,jsxs as m}from"react/jsx-runtime";const x=({id:o,label:s,className:n,...e})=>{const a=p(),c=o||a,i=["c-checkbox",n].filter(Boolean).join(" "),t=r("input",{id:s?c:o,className:i,...e,type:"checkbox"});return s?m("span",{className:"c-checkbox-wrapper",children:[t,r(d,{htmlFor:c,disabled:e.disabled,children:s})]}):t};export default x;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Checkbox
|
|
3
|
+
description: A native checkbox input with the library look and an optional built-in label.
|
|
4
|
+
purpose: Let the user turn an option on or off, or pick several options from a list.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Checkbox
|
|
8
|
+
|
|
9
|
+
A styled native `input` of type `checkbox`. Every native input attribute (`checked`, `defaultChecked`, `disabled`, `onChange`, `name`, `id`, etc.) is forwarded to the input. When `label` is given, the component also renders a `Label` next to the input and associates both, so clicking the text toggles the checkbox.
|
|
10
|
+
|
|
11
|
+
## Props
|
|
12
|
+
|
|
13
|
+
The Checkbox API extends the native HTML `input` attributes, except `type`. Props such as `checked`, `disabled` and `onChange` come from the native element and are not listed below.
|
|
14
|
+
|
|
15
|
+
<!-- BEGIN GENERATED PROPS -->
|
|
16
|
+
_Also inherits all props from `Omit<InputHTMLAttributes<HTMLInputElement>, 'type'>`._
|
|
17
|
+
|
|
18
|
+
| Name | Type | Required | Default | Description |
|
|
19
|
+
| --- | --- | --- | --- | --- |
|
|
20
|
+
| label | `string` | No | | Text of the label rendered next to the checkbox and associated with it. |
|
|
21
|
+
<!-- END GENERATED PROPS -->
|
|
22
|
+
|
|
23
|
+
## When to use
|
|
24
|
+
|
|
25
|
+
- Turning a single option on or off, such as accepting terms
|
|
26
|
+
- Letting the user pick any number of options from a list
|
|
27
|
+
|
|
28
|
+
## When NOT to use
|
|
29
|
+
|
|
30
|
+
- **Mutually exclusive options** — use a radio group when only one option can be picked.
|
|
31
|
+
- **Immediate actions** — use a button when the interaction triggers something right away.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Checkbox tokens
|
|
2
|
+
|
|
3
|
+
Generated from `src/components/checkbox/checkbox.css`.
|
|
4
|
+
|
|
5
|
+
## Base tokens
|
|
6
|
+
|
|
7
|
+
| Token | Declared value | Resolution |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| `--c-checkbox-background` | `var(--c-color-gray-95)` | `var(--c-color-gray-95) → hsl(0 0% 95%)` |
|
|
10
|
+
| `--c-checkbox-background-checked` | `var(--c-color-gray-10)` | `var(--c-color-gray-10) → hsl(0 0% 10%)` |
|
|
11
|
+
| `--c-checkbox-background-disabled` | `var(--c-color-gray-85)` | `var(--c-color-gray-85) → hsl(0 0% 85%)` |
|
|
12
|
+
| `--c-checkbox-border-color` | `var(--c-color-gray-85)` | `var(--c-color-gray-85) → hsl(0 0% 85%)` |
|
|
13
|
+
| `--c-checkbox-border-color-checked` | `var(--c-color-gray-10)` | `var(--c-color-gray-10) → hsl(0 0% 10%)` |
|
|
14
|
+
| `--c-checkbox-border-color-disabled` | `var(--c-color-gray-85)` | `var(--c-color-gray-85) → hsl(0 0% 85%)` |
|
|
15
|
+
| `--c-checkbox-check` | `url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%228.5%22%20height%3D%227.9%22%20viewBox%3D%22386.595%20103.67%208.5%207.855%22%3E%3Cpath%20d%3D%22M395.057,104.851L389.957,111.396C389.917,111.437%20389.851,111.525%20389.77,111.525C389.686,111.525%20389.631,111.466%20389.583,111.418C389.535,111.37%20386.69,108.635%20386.69,108.635L386.635,108.58C386.613,108.547%20386.595,108.507%20386.595,108.463C386.595,108.419%20386.613,108.378%20386.635,108.345C386.65,108.331%20386.66,108.32%20386.675,108.301C386.957,108.004%20387.529,107.403%20387.566,107.367C387.614,107.319%20387.654,107.256%20387.742,107.256C387.834,107.256%20387.892,107.334%20387.936,107.378C387.98,107.421%20389.586,108.965%20389.586,108.965L393.668,103.722C393.704,103.692%20393.749,103.67%20393.796,103.67C393.844,103.67%20393.887,103.688%20393.925,103.718L395.046,104.602C395.076,104.638%20395.094,104.682%20395.094,104.73C395.098,104.778%20395.079,104.818%20395.057,104.851%22%20fill%3D%22white%22%2F%3E%3C%2Fsvg%3E")` | `url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%228.5%22%20height%3D%227.9%22%20viewBox%3D%22386.595%20103.67%208.5%207.855%22%3E%3Cpath%20d%3D%22M395.057,104.851L389.957,111.396C389.917,111.437%20389.851,111.525%20389.77,111.525C389.686,111.525%20389.631,111.466%20389.583,111.418C389.535,111.37%20386.69,108.635%20386.69,108.635L386.635,108.58C386.613,108.547%20386.595,108.507%20386.595,108.463C386.595,108.419%20386.613,108.378%20386.635,108.345C386.65,108.331%20386.66,108.32%20386.675,108.301C386.957,108.004%20387.529,107.403%20387.566,107.367C387.614,107.319%20387.654,107.256%20387.742,107.256C387.834,107.256%20387.892,107.334%20387.936,107.378C387.98,107.421%20389.586,108.965%20389.586,108.965L393.668,103.722C393.704,103.692%20393.749,103.67%20393.796,103.67C393.844,103.67%20393.887,103.688%20393.925,103.718L395.046,104.602C395.076,104.638%20395.094,104.682%20395.094,104.73C395.098,104.778%20395.079,104.818%20395.057,104.851%22%20fill%3D%22white%22%2F%3E%3C%2Fsvg%3E")` |
|
|
16
|
+
| `--c-checkbox-check-disabled` | `url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%228.5%22%20height%3D%227.9%22%20viewBox%3D%22386.595%20103.67%208.5%207.855%22%3E%3Cpath%20d%3D%22M395.057,104.851L389.957,111.396C389.917,111.437%20389.851,111.525%20389.77,111.525C389.686,111.525%20389.631,111.466%20389.583,111.418C389.535,111.37%20386.69,108.635%20386.69,108.635L386.635,108.58C386.613,108.547%20386.595,108.507%20386.595,108.463C386.595,108.419%20386.613,108.378%20386.635,108.345C386.65,108.331%20386.66,108.32%20386.675,108.301C386.957,108.004%20387.529,107.403%20387.566,107.367C387.614,107.319%20387.654,107.256%20387.742,107.256C387.834,107.256%20387.892,107.334%20387.936,107.378C387.98,107.421%20389.586,108.965%20389.586,108.965L393.668,103.722C393.704,103.692%20393.749,103.67%20393.796,103.67C393.844,103.67%20393.887,103.688%20393.925,103.718L395.046,104.602C395.076,104.638%20395.094,104.682%20395.094,104.73C395.098,104.778%20395.079,104.818%20395.057,104.851%22%20fill%3D%22rgb(128,128,128)%22%2F%3E%3C%2Fsvg%3E")` | `url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%228.5%22%20height%3D%227.9%22%20viewBox%3D%22386.595%20103.67%208.5%207.855%22%3E%3Cpath%20d%3D%22M395.057,104.851L389.957,111.396C389.917,111.437%20389.851,111.525%20389.77,111.525C389.686,111.525%20389.631,111.466%20389.583,111.418C389.535,111.37%20386.69,108.635%20386.69,108.635L386.635,108.58C386.613,108.547%20386.595,108.507%20386.595,108.463C386.595,108.419%20386.613,108.378%20386.635,108.345C386.65,108.331%20386.66,108.32%20386.675,108.301C386.957,108.004%20387.529,107.403%20387.566,107.367C387.614,107.319%20387.654,107.256%20387.742,107.256C387.834,107.256%20387.892,107.334%20387.936,107.378C387.98,107.421%20389.586,108.965%20389.586,108.965L393.668,103.722C393.704,103.692%20393.749,103.67%20393.796,103.67C393.844,103.67%20393.887,103.688%20393.925,103.718L395.046,104.602C395.076,104.638%20395.094,104.682%20395.094,104.73C395.098,104.778%20395.079,104.818%20395.057,104.851%22%20fill%3D%22rgb(128,128,128)%22%2F%3E%3C%2Fsvg%3E")` |
|
|
17
|
+
| `--c-checkbox-check-size` | `8.5px 7.9px` | `8.5px 7.9px` |
|
|
18
|
+
| `--c-checkbox-radius` | `5px` | `5px` |
|
|
19
|
+
| `--c-checkbox-size` | `18px` | `18px` |
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.c-form-control{--c-form-control-gap: 10px;--c-form-control-inset: 10px;--c-form-control-error-content: var(--c-color-red-70);display:flex;flex-direction:column;gap:var(--c-form-control-gap)}.c-form-control>label{align-self:flex-start;margin-left:var(--c-form-control-inset)}.c-form-control-error-message{margin-left:var(--c-form-control-inset);color:var(--c-form-control-error-content);font-family:var(--c-font-family-primary);font-size:var(--c-font-size-xs);font-weight:400}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import a from"../label/label.js";import"./form-control.css";import{jsx as s,jsxs as i}from"react/jsx-runtime";const d=({label:o,htmlFor:e,required:t,errorMessage:r,className:c,children:l,...m})=>{const n=["c-form-control",c].filter(Boolean).join(" ");return i("div",{className:n,...m,children:[o&&s(a,{htmlFor:e,required:t,children:o}),l,r&&s("span",{className:"c-form-control-error-message",children:r})]})};export default d;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: FormControl
|
|
3
|
+
description: A wrapper that places a label above a form field and an optional error message below it.
|
|
4
|
+
purpose: Compose a label, a field, and an error message with consistent spacing, so consumers do not do it by hand.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# FormControl
|
|
8
|
+
|
|
9
|
+
Wraps a form field (`Input`, `Select`, `Textarea`, etc.), passed as `children`, with a `Label` above it and an optional error message below it. Extra native `div` attributes and `className` are applied to the root element.
|
|
10
|
+
|
|
11
|
+
`FormControl` does not manage the field. It never sets `id`, `invalid`, `required`, `disabled`, or any other attribute on the children. The label is rendered only when `label` is given. To associate the label with the field, pass `htmlFor` and give the field the same value as its `id`.
|
|
12
|
+
|
|
13
|
+
## Props
|
|
14
|
+
|
|
15
|
+
The FormControl API extends the native HTML `div` attributes.
|
|
16
|
+
|
|
17
|
+
<!-- BEGIN GENERATED PROPS -->
|
|
18
|
+
_Also inherits all props from `HTMLAttributes<HTMLDivElement>`._
|
|
19
|
+
|
|
20
|
+
| Name | Type | Required | Default | Description |
|
|
21
|
+
| --- | --- | --- | --- | --- |
|
|
22
|
+
| errorMessage | `string` | No | | Message rendered below the field. Nothing is rendered when empty. |
|
|
23
|
+
| htmlFor | `string` | No | | Forwarded to the label as `htmlFor`. Give the field the same value as its `id` to associate them. |
|
|
24
|
+
| label | `string` | No | | Text of the label rendered above the field. When not given, no label is rendered. |
|
|
25
|
+
| required | `boolean` | No | `false` | Shows the required asterisk in the label. Visual only: it does not set `required` on the field. |
|
|
26
|
+
<!-- END GENERATED PROPS -->
|
|
27
|
+
|
|
28
|
+
## When to use
|
|
29
|
+
|
|
30
|
+
- Showing a label, a field, and an error message together with consistent spacing
|
|
31
|
+
- Marking a field as required in the label while the field itself is controlled by the consumer
|
|
32
|
+
|
|
33
|
+
## When NOT to use
|
|
34
|
+
|
|
35
|
+
- **Checkbox or radio captions** — use the `label` prop of the checkbox or radio component.
|
|
36
|
+
- **Validation or `invalid` handling** — `FormControl` only displays the message you give it; set `invalid` on the field yourself.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Form-control tokens
|
|
2
|
+
|
|
3
|
+
Generated from `src/components/form-control/form-control.css`.
|
|
4
|
+
|
|
5
|
+
## Base tokens
|
|
6
|
+
|
|
7
|
+
| Token | Declared value | Resolution |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| `--c-form-control-error-content` | `var(--c-color-red-70)` | `var(--c-color-red-70) → hsl(0 100% 70%)` |
|
|
10
|
+
| `--c-form-control-gap` | `10px` | `10px` |
|
|
11
|
+
| `--c-form-control-inset` | `10px` | `10px` |
|
|
@@ -1 +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:
|
|
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:background-color .15s ease-out,border-color .15s ease-out,box-shadow .15s ease-out,color .15s ease-out}.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
|
+
.c-label{--c-label-content: var(--c-color-gray-15);--c-label-content-disabled: var(--c-color-gray-50);--c-label-asterisk: var(--c-color-red-70);color:var(--c-label-content);font-family:var(--c-font-family-primary);font-size:var(--c-font-size-xs);font-weight:600}.c-label.is-disabled{color:var(--c-label-content-disabled)}.c-label.is-required:after{margin-left:5px;content:"*";color:var(--c-label-asterisk)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./label.css";import{jsx as o}from"react/jsx-runtime";const t=({disabled:e,required:l,className:a,children:s,...i})=>{const r=n({disabled:e,required:l,className:a});return o("label",{className:r,...i,children:s})};function n({disabled:e,required:l,className:a}){const s=["c-label"];return e&&s.push("is-disabled"),l&&s.push("is-required"),[...s,a].filter(Boolean).join(" ")}export default t;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Label
|
|
3
|
+
description: A text label that extends the native HTML label element.
|
|
4
|
+
purpose: Name a form control with consistent label typography, on its own or next to any control.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Label
|
|
8
|
+
|
|
9
|
+
A standalone form label. It extends the native HTML `label` element, so every native attribute (`htmlFor`, `className`, `data-*`, etc.) is accepted. The component adds two visual props: `disabled`, which renders the text in the disabled color, and `required`, which shows a red asterisk after the text. The asterisk is drawn with CSS only, so it is not part of the label text.
|
|
10
|
+
|
|
11
|
+
## Props
|
|
12
|
+
|
|
13
|
+
The Label API extends the native HTML `label` attributes. Props such as `htmlFor` come from the native element and are not listed below.
|
|
14
|
+
|
|
15
|
+
<!-- BEGIN GENERATED PROPS -->
|
|
16
|
+
_Also inherits all props from `LabelHTMLAttributes<HTMLLabelElement>`._
|
|
17
|
+
|
|
18
|
+
| Name | Type | Required | Default | Description |
|
|
19
|
+
| --- | --- | --- | --- | --- |
|
|
20
|
+
| disabled | `boolean` | No | `false` | Renders the text in the disabled color. Visual only: it does not disable any control. |
|
|
21
|
+
| required | `boolean` | No | `false` | Shows a red asterisk after the text. Visual only: the asterisk is drawn with CSS and it does not make any control required. |
|
|
22
|
+
<!-- END GENERATED PROPS -->
|
|
23
|
+
|
|
24
|
+
## When to use
|
|
25
|
+
|
|
26
|
+
- Naming a form control by pairing `htmlFor` with the control `id`
|
|
27
|
+
- Signaling that the named control is required with the `required` prop
|
|
28
|
+
- Showing a label that follows the library typography, with a disabled look next to a disabled control
|
|
29
|
+
|
|
30
|
+
## When NOT to use
|
|
31
|
+
|
|
32
|
+
- **Checkbox or radio captions** — use the `label` prop of the checkbox or radio component, which renders and associates a label for you.
|
|
33
|
+
- **Disabling a control** — the `disabled` prop is visual only; disable the control itself.
|
|
34
|
+
- **Making a control required** — the `required` prop is visual only; set `required` on the control itself.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Label tokens
|
|
2
|
+
|
|
3
|
+
Generated from `src/components/label/label.css`.
|
|
4
|
+
|
|
5
|
+
## Base tokens
|
|
6
|
+
|
|
7
|
+
| Token | Declared value | Resolution |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| `--c-label-asterisk` | `var(--c-color-red-70)` | `var(--c-color-red-70) → hsl(0 100% 70%)` |
|
|
10
|
+
| `--c-label-content` | `var(--c-color-gray-15)` | `var(--c-color-gray-15) → hsl(0 0% 15%)` |
|
|
11
|
+
| `--c-label-content-disabled` | `var(--c-color-gray-50)` | `var(--c-color-gray-50) → hsl(0 0% 50%)` |
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.c-radio-wrapper{display:inline-flex;align-items:center;gap:10px}.c-radio-wrapper .c-label:hover:not(.is-disabled){cursor:pointer}.c-radio{--c-radio-background: var(--c-color-gray-95);--c-radio-background-disabled: var(--c-color-gray-85);--c-radio-background-checked: var(--c-color-gray-10);--c-radio-border-color: var(--c-color-gray-85);--c-radio-border-color-disabled: var(--c-color-gray-85);--c-radio-border-color-checked: var(--c-color-gray-10);--c-radio-check: url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%228.5%22%20height%3D%227.9%22%20viewBox%3D%22386.595%20103.67%208.5%207.855%22%3E%3Cpath%20d%3D%22M395.057,104.851L389.957,111.396C389.917,111.437%20389.851,111.525%20389.77,111.525C389.686,111.525%20389.631,111.466%20389.583,111.418C389.535,111.37%20386.69,108.635%20386.69,108.635L386.635,108.58C386.613,108.547%20386.595,108.507%20386.595,108.463C386.595,108.419%20386.613,108.378%20386.635,108.345C386.65,108.331%20386.66,108.32%20386.675,108.301C386.957,108.004%20387.529,107.403%20387.566,107.367C387.614,107.319%20387.654,107.256%20387.742,107.256C387.834,107.256%20387.892,107.334%20387.936,107.378C387.98,107.421%20389.586,108.965%20389.586,108.965L393.668,103.722C393.704,103.692%20393.749,103.67%20393.796,103.67C393.844,103.67%20393.887,103.688%20393.925,103.718L395.046,104.602C395.076,104.638%20395.094,104.682%20395.094,104.73C395.098,104.778%20395.079,104.818%20395.057,104.851%22%20fill%3D%22white%22%2F%3E%3C%2Fsvg%3E);--c-radio-check-disabled: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%228.5%22%20height%3D%227.9%22%20viewBox%3D%22386.595%20103.67%208.5%207.855%22%3E%3Cpath%20d%3D%22M395.057,104.851L389.957,111.396C389.917,111.437%20389.851,111.525%20389.77,111.525C389.686,111.525%20389.631,111.466%20389.583,111.418C389.535,111.37%20386.69,108.635%20386.69,108.635L386.635,108.58C386.613,108.547%20386.595,108.507%20386.595,108.463C386.595,108.419%20386.613,108.378%20386.635,108.345C386.65,108.331%20386.66,108.32%20386.675,108.301C386.957,108.004%20387.529,107.403%20387.566,107.367C387.614,107.319%20387.654,107.256%20387.742,107.256C387.834,107.256%20387.892,107.334%20387.936,107.378C387.98,107.421%20389.586,108.965%20389.586,108.965L393.668,103.722C393.704,103.692%20393.749,103.67%20393.796,103.67C393.844,103.67%20393.887,103.688%20393.925,103.718L395.046,104.602C395.076,104.638%20395.094,104.682%20395.094,104.73C395.098,104.778%20395.079,104.818%20395.057,104.851%22%20fill%3D%22rgb(128,128,128)%22%2F%3E%3C%2Fsvg%3E");--c-radio-size: 18px;--c-radio-check-size: 8.5px 7.9px;appearance:none;-webkit-appearance:none;-moz-appearance:none;display:inline-block;flex-shrink:0;margin:0;width:var(--c-radio-size);height:var(--c-radio-size);background-color:var(--c-radio-background);background-repeat:no-repeat;background-position:center;background-size:var(--c-radio-check-size);border:1px solid var(--c-radio-border-color);border-radius:50%;outline:none;box-shadow:0 0 0 0 var(--c-color-gray-95);box-sizing:border-box;cursor:pointer;transition:background-color .15s ease-out,border-color .15s ease-out,box-shadow .15s ease-out}.c-radio:checked{background-color:var(--c-radio-background-checked);background-image:var(--c-radio-check);border-color:var(--c-radio-border-color-checked)}.c-radio:focus-visible{box-shadow:0 0 0 5px var(--c-color-gray-95)}.c-radio:focus-visible:not(:checked){background-color:#fff}.c-radio:focus-visible:checked{box-shadow:0 0 0 5px var(--c-color-accented-80)}.c-radio:disabled{background-color:var(--c-radio-background-disabled);border-color:var(--c-radio-border-color-disabled);cursor:default}.c-radio:disabled:checked{background-image:var(--c-radio-check-disabled)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useId as c}from"react";import p from"../label/label.js";import"./radio.css";import{jsx as i,jsxs as m}from"react/jsx-runtime";const l=({id:o,label:s,className:e,...r})=>{const d=c(),t=o||d,n=["c-radio",e].filter(Boolean).join(" "),a=i("input",{id:s?t:o,className:n,...r,type:"radio"});return s?m("span",{className:"c-radio-wrapper",children:[a,i(p,{htmlFor:t,disabled:r.disabled,children:s})]}):a};export default l;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Radio
|
|
3
|
+
description: A native radio input with the library look and an optional built-in label.
|
|
4
|
+
purpose: Let the user pick exactly one option from a small group of mutually exclusive options.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Radio
|
|
8
|
+
|
|
9
|
+
A styled native `input` of type `radio`. Every native input attribute (`checked`, `defaultChecked`, `disabled`, `onChange`, `name`, `value`, `id`, etc.) is forwarded to the input. Radios sharing a `name` are mutually exclusive, with native keyboard navigation. When `label` is given, the component also renders a `Label` next to the input and associates both, so clicking the text selects the radio.
|
|
10
|
+
|
|
11
|
+
## Props
|
|
12
|
+
|
|
13
|
+
The Radio API extends the native HTML `input` attributes, except `type`. Props such as `name`, `checked` and `onChange` come from the native element and are not listed below.
|
|
14
|
+
|
|
15
|
+
> **Note:** always pass the same `name` to every radio in a group. Without it, each radio becomes its own group: the keyboard focuses each one separately and the arrow keys do not move between options.
|
|
16
|
+
|
|
17
|
+
<!-- BEGIN GENERATED PROPS -->
|
|
18
|
+
_Also inherits all props from `Omit<InputHTMLAttributes<HTMLInputElement>, 'type'>`._
|
|
19
|
+
|
|
20
|
+
| Name | Type | Required | Default | Description |
|
|
21
|
+
| --- | --- | --- | --- | --- |
|
|
22
|
+
| label | `string` | No | | Text of the label rendered next to the radio and associated with it. |
|
|
23
|
+
<!-- END GENERATED PROPS -->
|
|
24
|
+
|
|
25
|
+
## When to use
|
|
26
|
+
|
|
27
|
+
- Picking exactly one option from a short, visible list
|
|
28
|
+
- Groups of options where the user should compare all choices at once
|
|
29
|
+
|
|
30
|
+
## When NOT to use
|
|
31
|
+
|
|
32
|
+
- **Multiple selections** — use checkboxes when any number of options can be picked.
|
|
33
|
+
- **Long option lists** — use a select when there are many options.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Radio tokens
|
|
2
|
+
|
|
3
|
+
Generated from `src/components/radio/radio.css`.
|
|
4
|
+
|
|
5
|
+
## Base tokens
|
|
6
|
+
|
|
7
|
+
| Token | Declared value | Resolution |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| `--c-radio-background` | `var(--c-color-gray-95)` | `var(--c-color-gray-95) → hsl(0 0% 95%)` |
|
|
10
|
+
| `--c-radio-background-checked` | `var(--c-color-gray-10)` | `var(--c-color-gray-10) → hsl(0 0% 10%)` |
|
|
11
|
+
| `--c-radio-background-disabled` | `var(--c-color-gray-85)` | `var(--c-color-gray-85) → hsl(0 0% 85%)` |
|
|
12
|
+
| `--c-radio-border-color` | `var(--c-color-gray-85)` | `var(--c-color-gray-85) → hsl(0 0% 85%)` |
|
|
13
|
+
| `--c-radio-border-color-checked` | `var(--c-color-gray-10)` | `var(--c-color-gray-10) → hsl(0 0% 10%)` |
|
|
14
|
+
| `--c-radio-border-color-disabled` | `var(--c-color-gray-85)` | `var(--c-color-gray-85) → hsl(0 0% 85%)` |
|
|
15
|
+
| `--c-radio-check` | `url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%228.5%22%20height%3D%227.9%22%20viewBox%3D%22386.595%20103.67%208.5%207.855%22%3E%3Cpath%20d%3D%22M395.057,104.851L389.957,111.396C389.917,111.437%20389.851,111.525%20389.77,111.525C389.686,111.525%20389.631,111.466%20389.583,111.418C389.535,111.37%20386.69,108.635%20386.69,108.635L386.635,108.58C386.613,108.547%20386.595,108.507%20386.595,108.463C386.595,108.419%20386.613,108.378%20386.635,108.345C386.65,108.331%20386.66,108.32%20386.675,108.301C386.957,108.004%20387.529,107.403%20387.566,107.367C387.614,107.319%20387.654,107.256%20387.742,107.256C387.834,107.256%20387.892,107.334%20387.936,107.378C387.98,107.421%20389.586,108.965%20389.586,108.965L393.668,103.722C393.704,103.692%20393.749,103.67%20393.796,103.67C393.844,103.67%20393.887,103.688%20393.925,103.718L395.046,104.602C395.076,104.638%20395.094,104.682%20395.094,104.73C395.098,104.778%20395.079,104.818%20395.057,104.851%22%20fill%3D%22white%22%2F%3E%3C%2Fsvg%3E")` | `url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%228.5%22%20height%3D%227.9%22%20viewBox%3D%22386.595%20103.67%208.5%207.855%22%3E%3Cpath%20d%3D%22M395.057,104.851L389.957,111.396C389.917,111.437%20389.851,111.525%20389.77,111.525C389.686,111.525%20389.631,111.466%20389.583,111.418C389.535,111.37%20386.69,108.635%20386.69,108.635L386.635,108.58C386.613,108.547%20386.595,108.507%20386.595,108.463C386.595,108.419%20386.613,108.378%20386.635,108.345C386.65,108.331%20386.66,108.32%20386.675,108.301C386.957,108.004%20387.529,107.403%20387.566,107.367C387.614,107.319%20387.654,107.256%20387.742,107.256C387.834,107.256%20387.892,107.334%20387.936,107.378C387.98,107.421%20389.586,108.965%20389.586,108.965L393.668,103.722C393.704,103.692%20393.749,103.67%20393.796,103.67C393.844,103.67%20393.887,103.688%20393.925,103.718L395.046,104.602C395.076,104.638%20395.094,104.682%20395.094,104.73C395.098,104.778%20395.079,104.818%20395.057,104.851%22%20fill%3D%22white%22%2F%3E%3C%2Fsvg%3E")` |
|
|
16
|
+
| `--c-radio-check-disabled` | `url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%228.5%22%20height%3D%227.9%22%20viewBox%3D%22386.595%20103.67%208.5%207.855%22%3E%3Cpath%20d%3D%22M395.057,104.851L389.957,111.396C389.917,111.437%20389.851,111.525%20389.77,111.525C389.686,111.525%20389.631,111.466%20389.583,111.418C389.535,111.37%20386.69,108.635%20386.69,108.635L386.635,108.58C386.613,108.547%20386.595,108.507%20386.595,108.463C386.595,108.419%20386.613,108.378%20386.635,108.345C386.65,108.331%20386.66,108.32%20386.675,108.301C386.957,108.004%20387.529,107.403%20387.566,107.367C387.614,107.319%20387.654,107.256%20387.742,107.256C387.834,107.256%20387.892,107.334%20387.936,107.378C387.98,107.421%20389.586,108.965%20389.586,108.965L393.668,103.722C393.704,103.692%20393.749,103.67%20393.796,103.67C393.844,103.67%20393.887,103.688%20393.925,103.718L395.046,104.602C395.076,104.638%20395.094,104.682%20395.094,104.73C395.098,104.778%20395.079,104.818%20395.057,104.851%22%20fill%3D%22rgb(128,128,128)%22%2F%3E%3C%2Fsvg%3E")` | `url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%228.5%22%20height%3D%227.9%22%20viewBox%3D%22386.595%20103.67%208.5%207.855%22%3E%3Cpath%20d%3D%22M395.057,104.851L389.957,111.396C389.917,111.437%20389.851,111.525%20389.77,111.525C389.686,111.525%20389.631,111.466%20389.583,111.418C389.535,111.37%20386.69,108.635%20386.69,108.635L386.635,108.58C386.613,108.547%20386.595,108.507%20386.595,108.463C386.595,108.419%20386.613,108.378%20386.635,108.345C386.65,108.331%20386.66,108.32%20386.675,108.301C386.957,108.004%20387.529,107.403%20387.566,107.367C387.614,107.319%20387.654,107.256%20387.742,107.256C387.834,107.256%20387.892,107.334%20387.936,107.378C387.98,107.421%20389.586,108.965%20389.586,108.965L393.668,103.722C393.704,103.692%20393.749,103.67%20393.796,103.67C393.844,103.67%20393.887,103.688%20393.925,103.718L395.046,104.602C395.076,104.638%20395.094,104.682%20395.094,104.73C395.098,104.778%20395.079,104.818%20395.057,104.851%22%20fill%3D%22rgb(128,128,128)%22%2F%3E%3C%2Fsvg%3E")` |
|
|
17
|
+
| `--c-radio-check-size` | `8.5px 7.9px` | `8.5px 7.9px` |
|
|
18
|
+
| `--c-radio-size` | `18px` | `18px` |
|
|
@@ -1 +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:
|
|
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:background-color .15s ease-out,border-color .15s ease-out,box-shadow .15s ease-out,color .15s ease-out}.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)}
|
|
@@ -1 +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 .
|
|
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-color .15s ease-out,border-color .15s ease-out,box-shadow .15s ease-out,color .15s ease-out}.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)}
|
|
@@ -5,6 +5,10 @@ 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
|
+
| Checkbox | A native checkbox input with the library look and an optional built-in label. | Let the user turn an option on or off, or pick several options from a list. | [`../components/checkbox/checkbox.md`](../components/checkbox/checkbox.md) |
|
|
9
|
+
| FormControl | A wrapper that places a label above a form field and an optional error message below it. | Compose a label, a field, and an error message with consistent spacing, so consumers do not do it by hand. | [`../components/form-control/form-control.md`](../components/form-control/form-control.md) |
|
|
8
10
|
| 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) |
|
|
11
|
+
| Label | A text label that extends the native HTML label element. | Name a form control with consistent label typography, on its own or next to any control. | [`../components/label/label.md`](../components/label/label.md) |
|
|
12
|
+
| Radio | A native radio input with the library look and an optional built-in label. | Let the user pick exactly one option from a small group of mutually exclusive options. | [`../components/radio/radio.md`](../components/radio/radio.md) |
|
|
9
13
|
| 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
14
|
| 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) |
|
package/dist/es6/docs/tokens.md
CHANGED
|
@@ -44,3 +44,12 @@ Generated from `src/vars.css`. Values show the declared token and the resolved r
|
|
|
44
44
|
| `--c-color-red-90` | `hsl(0 100% 90%)` | `hsl(0 100% 90%)` |
|
|
45
45
|
| `--c-color-red-95` | `hsl(0 100% 95%)` | `hsl(0 100% 95%)` |
|
|
46
46
|
| `--c-font-family-primary` | `'Inter', sans-serif` | `'Inter', sans-serif` |
|
|
47
|
+
| `--c-font-size-lg` | `1.250rem` | `1.250rem` |
|
|
48
|
+
| `--c-font-size-md` | `1.125rem` | `1.125rem` |
|
|
49
|
+
| `--c-font-size-sm` | `1.000rem` | `1.000rem` |
|
|
50
|
+
| `--c-font-size-xl` | `1.500rem` | `1.500rem` |
|
|
51
|
+
| `--c-font-size-xs` | `0.875rem` | `0.875rem` |
|
|
52
|
+
| `--c-font-size-xxl` | `2.250rem` | `2.250rem` |
|
|
53
|
+
| `--c-font-size-xxs` | `0.750rem` | `0.750rem` |
|
|
54
|
+
| `--c-font-size-xxxl` | `3.000rem` | `3.000rem` |
|
|
55
|
+
| `--c-font-size-xxxs` | `0.625rem` | `0.625rem` |
|
package/dist/es6/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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";
|
|
1
|
+
import"./index.css";export{default as Button}from"./components/button/button.js";export{default as Checkbox}from"./components/checkbox/checkbox.js";export{default as FormControl}from"./components/form-control/form-control.js";export{default as Input}from"./components/input/input.js";export{default as Label}from"./components/label/label.js";export{default as Radio}from"./components/radio/radio.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-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)}
|
|
1
|
+
:root{--c-font-family-primary: "Inter", sans-serif;--c-font-size-xxxs: .625rem;--c-font-size-xxs: .75rem;--c-font-size-xs: .875rem;--c-font-size-sm: 1rem;--c-font-size-md: 1.125rem;--c-font-size-lg: 1.25rem;--c-font-size-xl: 1.5rem;--c-font-size-xxl: 2.25rem;--c-font-size-xxxl: 3rem;--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,7 +1,15 @@
|
|
|
1
1
|
export type { ButtonProps } from './components/button/button.d.ts';
|
|
2
2
|
export { default as Button } from './components/button/button.d.ts';
|
|
3
|
+
export type { CheckboxProps } from './components/checkbox/checkbox.d.ts';
|
|
4
|
+
export { default as Checkbox } from './components/checkbox/checkbox.d.ts';
|
|
5
|
+
export type { FormControlProps } from './components/form-control/form-control.d.ts';
|
|
6
|
+
export { default as FormControl } from './components/form-control/form-control.d.ts';
|
|
3
7
|
export type { InputProps } from './components/input/input.d.ts';
|
|
4
8
|
export { default as Input } from './components/input/input.d.ts';
|
|
9
|
+
export type { LabelProps } from './components/label/label.d.ts';
|
|
10
|
+
export { default as Label } from './components/label/label.d.ts';
|
|
11
|
+
export type { RadioProps } from './components/radio/radio.d.ts';
|
|
12
|
+
export { default as Radio } from './components/radio/radio.d.ts';
|
|
5
13
|
export type { SelectProps } from './components/select/select.d.ts';
|
|
6
14
|
export { default as Select } from './components/select/select.d.ts';
|
|
7
15
|
export type { TextareaProps } from './components/textarea/textarea.d.ts';
|