@compilorama/compy 0.4.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/cjs/components/banner/banner.css +1 -0
  3. package/dist/cjs/components/banner/banner.js +1 -0
  4. package/dist/cjs/components/banner/banner.md +38 -0
  5. package/dist/cjs/components/banner/tokens.md +56 -0
  6. package/dist/cjs/components/form-control/form-control.css +1 -0
  7. package/dist/cjs/components/form-control/form-control.js +1 -0
  8. package/dist/cjs/components/form-control/form-control.md +36 -0
  9. package/dist/cjs/components/form-control/tokens.md +11 -0
  10. package/dist/cjs/components/icon/icon.css +1 -0
  11. package/dist/cjs/components/icon/icon.js +1 -0
  12. package/dist/cjs/components/icon/icon.md +39 -0
  13. package/dist/cjs/components/icon/tokens.md +13 -0
  14. package/dist/cjs/components/label/label.css +1 -1
  15. package/dist/cjs/components/label/label.js +1 -1
  16. package/dist/cjs/components/label/label.md +4 -1
  17. package/dist/cjs/components/label/tokens.md +1 -0
  18. package/dist/cjs/docs/components.md +4 -0
  19. package/dist/cjs/docs/tokens.md +39 -0
  20. package/dist/cjs/icons/close/icon-close.js +1 -0
  21. package/dist/cjs/icons/close/icon-close.md +24 -0
  22. package/dist/cjs/index.js +1 -1
  23. package/dist/cjs/vars.css +1 -1
  24. package/dist/docs/components.md +4 -0
  25. package/dist/docs/tokens.md +39 -0
  26. package/dist/es6/components/banner/banner.css +1 -0
  27. package/dist/es6/components/banner/banner.js +1 -0
  28. package/dist/es6/components/banner/banner.md +38 -0
  29. package/dist/es6/components/banner/tokens.md +56 -0
  30. package/dist/es6/components/form-control/form-control.css +1 -0
  31. package/dist/es6/components/form-control/form-control.js +1 -0
  32. package/dist/es6/components/form-control/form-control.md +36 -0
  33. package/dist/es6/components/form-control/tokens.md +11 -0
  34. package/dist/es6/components/icon/icon.css +1 -0
  35. package/dist/es6/components/icon/icon.js +1 -0
  36. package/dist/es6/components/icon/icon.md +39 -0
  37. package/dist/es6/components/icon/tokens.md +13 -0
  38. package/dist/es6/components/label/label.css +1 -1
  39. package/dist/es6/components/label/label.js +1 -1
  40. package/dist/es6/components/label/label.md +4 -1
  41. package/dist/es6/components/label/tokens.md +1 -0
  42. package/dist/es6/docs/components.md +4 -0
  43. package/dist/es6/docs/tokens.md +39 -0
  44. package/dist/es6/icons/close/icon-close.js +1 -0
  45. package/dist/es6/icons/close/icon-close.md +24 -0
  46. package/dist/es6/index.js +1 -1
  47. package/dist/es6/vars.css +1 -1
  48. package/dist/index.d.ts +8 -0
  49. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,31 @@
1
+ # [0.6.0](https://github.com/compilorama/compy/compare/v0.5.0...v0.6.0) (2026-11-23)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **banner:** move close icon stroke width to the banner stylesheet ([6d83ad8](https://github.com/compilorama/compy/commit/6d83ad885c48ef50cae4bacb74860d6c236d1c12))
7
+ * **banner:** set close icon stroke width through the strokeWidth prop ([86e5b45](https://github.com/compilorama/compy/commit/86e5b4555e8dc557e9ceea8e6f483f3cc745fd09))
8
+ * **icon:** set default stroke width to 1px ([a606c3f](https://github.com/compilorama/compy/commit/a606c3f483c1d342f84bf4ee40c5b4eb51ba382c))
9
+
10
+
11
+ ### Features
12
+
13
+ * **banner:** add Banner component and color scales ([db5f324](https://github.com/compilorama/compy/commit/db5f3240383d338bb15339216afc6219196763e8))
14
+ * **icon:** add Icon component and IconClose ([ef3f1be](https://github.com/compilorama/compy/commit/ef3f1be92848e056be3af0fb0bc403d7fde9667a))
15
+
16
+ # [0.5.0](https://github.com/compilorama/compy/compare/v0.4.0...v0.5.0) (2026-11-22)
17
+
18
+
19
+ ### Bug Fixes
20
+
21
+ * add left margin to form control label and error message ([93570b3](https://github.com/compilorama/compy/commit/93570b3744dc656ad6421606537a257f3ba2ad5f))
22
+
23
+
24
+ ### Features
25
+
26
+ * **form-control:** add FormControl component ([6dedcb7](https://github.com/compilorama/compy/commit/6dedcb7fcab05f986cecfc131a9db30eb5246573))
27
+ * **label:** add required prop ([f929f1b](https://github.com/compilorama/compy/commit/f929f1b130703f6f6af79c013b9be31836de4477))
28
+
1
29
  # [0.4.0](https://github.com/compilorama/compy/compare/v0.3.0...v0.4.0) (2026-11-21)
2
30
 
3
31
 
@@ -0,0 +1 @@
1
+ .c-banner{--c-banner-background: var(--c-color-blue-95);--c-banner-content: var(--c-color-blue-50);--c-banner-close-icon: var(--c-color-blue-60);--c-banner-close-background-hover: var(--c-color-blue-90);--c-banner-radius: 15px;--c-banner-close-radius: 10px;--c-banner-close-size: 30px;display:block;position:relative;padding:10px 15px;min-height:40px;background:var(--c-banner-background);color:var(--c-banner-content);font-family:var(--c-font-family-primary);font-size:var(--c-font-size-sm);font-weight:400;line-height:20px;border-radius:var(--c-banner-radius);box-sizing:border-box}.c-banner.is-dismissable{padding-right:45px}.c-banner.is-warning{--c-banner-background: var(--c-color-orange-95);--c-banner-content: var(--c-color-orange-50);--c-banner-close-icon: var(--c-color-orange-50);--c-banner-close-background-hover: var(--c-color-orange-90)}.c-banner.is-success{--c-banner-background: var(--c-color-green-95);--c-banner-content: var(--c-color-green-30);--c-banner-close-icon: var(--c-color-green-30);--c-banner-close-background-hover: var(--c-color-green-85)}.c-banner.is-error{--c-banner-background: var(--c-color-red-95);--c-banner-content: var(--c-color-red-60);--c-banner-close-icon: var(--c-color-red-60);--c-banner-close-background-hover: var(--c-color-red-90)}.c-banner button.c-button.is-isometric{--c-button-width: var(--c-banner-close-size);--c-button-height: var(--c-banner-close-size);--c-button-radius: var(--c-banner-close-radius);--c-button-background: transparent;--c-button-background-hover: var(--c-banner-close-background-hover);--c-button-border-color: transparent;--c-button-box-shadow-color: transparent;position:absolute;top:5px;right:5px}.c-banner button.c-button.is-isometric:focus-visible{background:var(--c-banner-close-background-hover)}
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _react=require("react"),_button=_interopRequireDefault(require("../button/button.jsx")),_iconClose=_interopRequireDefault(require("../../icons/close/icon-close.jsx"));require("./banner.css");var _jsxRuntime=require("react/jsx-runtime");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const Banner=({theme:e,dismissable:r,closeButtonLabel:t,className:s,children:n,...o})=>{const[i,u]=(0,_react.useState)(!0),l=buildBannerClasses({theme:e,dismissable:r,className:s}),a=()=>u(!1);return i?(0,_jsxRuntime.jsxs)("div",{className:l,...o,children:[n,r&&renderCloseButton({closeButtonLabel:t,onClick:a})]}):null};function buildBannerClasses({theme:e,dismissable:r,className:t}){return["c-banner",e&&`is-${e}`,r&&"is-dismissable",t].filter(Boolean).join(" ")}function renderCloseButton({closeButtonLabel:e="Close",onClick:r}){return(0,_jsxRuntime.jsx)(_button.default,{type:"button","aria-label":e,onClick:r,isometric:!0,children:(0,_jsxRuntime.jsx)(_iconClose.default,{size:"20px",strokeWidth:4,strokeColor:"var(--c-banner-close-icon)"})})}var _default=exports.default=Banner;
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: Banner
3
+ description: A colored message box with four themes and an optional dismiss button.
4
+ purpose: Show tips and feedback messages with consistent styling, and let users dismiss them.
5
+ ---
6
+
7
+ # Banner
8
+
9
+ A block-level message box with rounded corners. The `children` are rendered inside it, so rich content such as links, buttons, and formatted text is accepted. Without a `theme`, the banner uses the default blue theme.
10
+
11
+ With `dismissable`, a dismiss button (an isometric `Button` with an `IconClose`) is rendered in the top-right corner, and the content never overlaps it. Clicking the button removes the banner from the DOM by itself: the banner is autonomous and has no dismiss callback, and the dismissed state is not persisted.
12
+
13
+ ## Props
14
+
15
+ The Banner API extends the native HTML `div` attributes, which are forwarded to the container.
16
+
17
+ <!-- BEGIN GENERATED PROPS -->
18
+ _Also inherits all props from `HTMLAttributes<HTMLDivElement>`._
19
+
20
+ | Name | Type | Required | Default | Description |
21
+ | --- | --- | --- | --- | --- |
22
+ | children | `ReactNode` | No | `undefined` | Banner content. Accepts any React node, such as links, buttons, and formatted text. |
23
+ | closeButtonLabel | `string` | No | `"Close"` | Accessible name (`aria-label`) of the dismiss button. |
24
+ | dismissable | `boolean` | No | `false` | Renders a dismiss button in the top-right corner. Clicking it removes the banner from the DOM. |
25
+ | theme | `"success" \| "warning" \| "error"` | No | `undefined` | Color theme of the banner. When omitted, the default blue theme is used. |
26
+ <!-- END GENERATED PROPS -->
27
+
28
+ ## When to use
29
+
30
+ - Showing tips, warnings, success feedback, or error messages inside the page flow
31
+ - Messages that the user may want to dismiss
32
+ - Messages with rich content, such as links or buttons
33
+
34
+ ## When NOT to use
35
+
36
+ - **Blocking confirmations** — use a dialog or modal when the user must decide before continuing.
37
+ - **Field-level validation** — use the error message of `FormControl` next to the field.
38
+ - **Transient notifications** — a banner stays in the page until dismissed, so do not use it for toasts that disappear on their own.
@@ -0,0 +1,56 @@
1
+ # Banner tokens
2
+
3
+ Generated from `src/components/banner/banner.css`.
4
+
5
+ ## Base tokens
6
+
7
+ | Token | Declared value | Resolution |
8
+ | --- | --- | --- |
9
+ | `--c-banner-background` | `var(--c-color-blue-95)` | `var(--c-color-blue-95) → hsl(220 100% 95%)` |
10
+ | `--c-banner-close-background-hover` | `var(--c-color-blue-90)` | `var(--c-color-blue-90) → hsl(220 100% 90%)` |
11
+ | `--c-banner-close-icon` | `var(--c-color-blue-60)` | `var(--c-color-blue-60) → hsl(220 100% 60%)` |
12
+ | `--c-banner-close-radius` | `10px` | `10px` |
13
+ | `--c-banner-close-size` | `30px` | `30px` |
14
+ | `--c-banner-content` | `var(--c-color-blue-50)` | `var(--c-color-blue-50) → hsl(220 100% 50%)` |
15
+ | `--c-banner-radius` | `15px` | `15px` |
16
+
17
+ ## Modifier overrides
18
+
19
+ ### `.c-banner.is-warning`
20
+
21
+ | Token | Declared value | Resolution |
22
+ | --- | --- | --- |
23
+ | `--c-banner-background` | `var(--c-color-orange-95)` | `var(--c-color-orange-95) → hsl(30 100% 95%)` |
24
+ | `--c-banner-close-background-hover` | `var(--c-color-orange-90)` | `var(--c-color-orange-90) → hsl(30 100% 90%)` |
25
+ | `--c-banner-close-icon` | `var(--c-color-orange-50)` | `var(--c-color-orange-50) → hsl(30 100% 50%)` |
26
+ | `--c-banner-content` | `var(--c-color-orange-50)` | `var(--c-color-orange-50) → hsl(30 100% 50%)` |
27
+
28
+ ### `.c-banner.is-success`
29
+
30
+ | Token | Declared value | Resolution |
31
+ | --- | --- | --- |
32
+ | `--c-banner-background` | `var(--c-color-green-95)` | `var(--c-color-green-95) → hsl(145 100% 95%)` |
33
+ | `--c-banner-close-background-hover` | `var(--c-color-green-85)` | `var(--c-color-green-85) → hsl(145 100% 85%)` |
34
+ | `--c-banner-close-icon` | `var(--c-color-green-30)` | `var(--c-color-green-30) → hsl(145 100% 30%)` |
35
+ | `--c-banner-content` | `var(--c-color-green-30)` | `var(--c-color-green-30) → hsl(145 100% 30%)` |
36
+
37
+ ### `.c-banner.is-error`
38
+
39
+ | Token | Declared value | Resolution |
40
+ | --- | --- | --- |
41
+ | `--c-banner-background` | `var(--c-color-red-95)` | `var(--c-color-red-95) → hsl(0 100% 95%)` |
42
+ | `--c-banner-close-background-hover` | `var(--c-color-red-90)` | `var(--c-color-red-90) → hsl(0 100% 90%)` |
43
+ | `--c-banner-close-icon` | `var(--c-color-red-60)` | `var(--c-color-red-60) → hsl(0 100% 60%)` |
44
+ | `--c-banner-content` | `var(--c-color-red-60)` | `var(--c-color-red-60) → hsl(0 100% 60%)` |
45
+
46
+ ### `.c-banner button.c-button.is-isometric`
47
+
48
+ | Token | Declared value | Resolution |
49
+ | --- | --- | --- |
50
+ | `--c-button-background` | `transparent` | `transparent` |
51
+ | `--c-button-background-hover` | `var(--c-banner-close-background-hover)` | `var(--c-banner-close-background-hover) → var(--c-color-blue-90) → hsl(220 100% 90%)` |
52
+ | `--c-button-border-color` | `transparent` | `transparent` |
53
+ | `--c-button-box-shadow-color` | `transparent` | `transparent` |
54
+ | `--c-button-height` | `var(--c-banner-close-size)` | `var(--c-banner-close-size) → 30px` |
55
+ | `--c-button-radius` | `var(--c-banner-close-radius)` | `var(--c-banner-close-radius) → 10px` |
56
+ | `--c-button-width` | `var(--c-banner-close-size)` | `var(--c-banner-close-size) → 30px` |
@@ -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` |
@@ -0,0 +1 @@
1
+ .c-icon{--c-icon-stroke-color: var(--c-color-gray-10);--c-icon-stroke-width: 1px;--c-icon-shape-color: var(--c-color-gray-10);--c-icon-width: 40px;--c-icon-height: 40px;display:inline-flex;width:var(--c-icon-width);height:var(--c-icon-height)}.c-icon svg{width:100%;height:100%}.c-icon [data-stroke]{fill:none;stroke:var(--c-icon-stroke-color);stroke-width:var(--c-icon-stroke-width);stroke-linecap:round;stroke-linejoin:round}.c-icon [data-shape]{fill:var(--c-icon-shape-color)}
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0,require("./icon.css");var _jsxRuntime=require("react/jsx-runtime");const Icon=({name:r,strokeColor:i,strokeWidth:t,size:e,style:o,className:c,children:s,...n})=>{const u=["c-icon",`c-icon-${r}`,c].filter(Boolean).join(" "),d=buildCustomProperties({strokeColor:i,strokeWidth:t,size:e});return(0,_jsxRuntime.jsx)("div",{className:u,style:{...d,...o},"aria-hidden":"true",...n,children:(0,_jsxRuntime.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 40 40",children:s})})};function buildCustomProperties({strokeColor:r,strokeWidth:i,size:t}){return Object.entries({"--c-icon-stroke-color":r,"--c-icon-stroke-width":i,"--c-icon-width":t,"--c-icon-height":t}).filter(([,e])=>e!==void 0).reduce((e,[o,c])=>({...e,[o]:c}),{})}var _default=exports.default=Icon;
@@ -0,0 +1,39 @@
1
+ ---
2
+ name: Icon
3
+ description: A base container that renders inline SVG shapes in a 40×40 viewBox, themeable through design tokens.
4
+ purpose: Build icon components with a consistent size, stroke, and color strategy.
5
+ ---
6
+
7
+ # Icon
8
+
9
+ The base of every icon in the library. It renders a decorative container (`aria-hidden="true"`) with an inline `<svg>` that uses a `0 0 40 40` viewBox, and the `children` are the SVG shapes. Icons ready to use live in `src/icons/` (for example `IconClose`) and are built on top of `Icon`.
10
+
11
+ Shapes must not carry presentational attributes. Mark outlines with `data-stroke` (no fill, round line caps and joins) and filled shapes with `data-shape`. The default color of both is `--c-color-gray-10`: it is never inherited from the parent. Only `strokeColor` (or the `--c-icon-stroke-color` custom property) changes the stroke color. The default stroke width is 1px and the default size is 40px.
12
+
13
+ `strokeColor`, `strokeWidth`, and `size` are applied as `--c-icon-*` custom properties on the container, only when given. Values passed in `style` take precedence over them.
14
+
15
+ ## Props
16
+
17
+ The Icon API extends the native HTML `div` attributes, which are forwarded to the container.
18
+
19
+ <!-- BEGIN GENERATED PROPS -->
20
+ _Also inherits all props from `HTMLAttributes<HTMLDivElement>`._
21
+
22
+ | Name | Type | Required | Default | Description |
23
+ | --- | --- | --- | --- | --- |
24
+ | children | `ReactNode` | No | `undefined` | SVG shapes drawn inside the 40×40 viewBox. Use `data-stroke` for outlines and `data-shape` for filled shapes. |
25
+ | name | `string` | Yes | | Name of the icon. Builds the `c-icon-<name>` css class of the container. |
26
+ | size | `string` | No | `undefined` | Width and height of the icon (for example `20px`), applied as `--c-icon-width` and `--c-icon-height`. |
27
+ | strokeColor | `string` | No | `undefined` | Stroke color of the outlines, applied as `--c-icon-stroke-color`. |
28
+ | strokeWidth | `string \| number` | No | `undefined` | Stroke width of the outlines in viewBox units, applied as `--c-icon-stroke-width`. |
29
+ <!-- END GENERATED PROPS -->
30
+
31
+ ## When to use
32
+
33
+ - Building a new icon component for `src/icons/`
34
+ - Rendering a one-off SVG that must follow the library's stroke, shape, and size tokens
35
+
36
+ ## When NOT to use
37
+
38
+ - **Existing icons** — import the ready-made icon component (for example `IconClose`) instead of drawing its shapes again.
39
+ - **Images and illustrations** — use an `<img>` or an inline SVG for artwork that is not an icon.
@@ -0,0 +1,13 @@
1
+ # Icon tokens
2
+
3
+ Generated from `src/components/icon/icon.css`.
4
+
5
+ ## Base tokens
6
+
7
+ | Token | Declared value | Resolution |
8
+ | --- | --- | --- |
9
+ | `--c-icon-height` | `40px` | `40px` |
10
+ | `--c-icon-shape-color` | `var(--c-color-gray-10)` | `var(--c-color-gray-10) → hsl(0 0% 10%)` |
11
+ | `--c-icon-stroke-color` | `var(--c-color-gray-10)` | `var(--c-color-gray-10) → hsl(0 0% 10%)` |
12
+ | `--c-icon-stroke-width` | `1px` | `1px` |
13
+ | `--c-icon-width` | `40px` | `40px` |
@@ -1 +1 @@
1
- .c-label{--c-label-content: var(--c-color-gray-15);--c-label-content-disabled: var(--c-color-gray-50);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)}
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)}
@@ -1 +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,className:l,children:e,...r})=>{const t=buildLabelClasses({disabled:s,className:l});return(0,_jsxRuntime.jsx)("label",{className:t,...r,children:e})};function buildLabelClasses({disabled:s,className:l}){const e=["c-label"];return s&&e.push("is-disabled"),[...e,l].filter(Boolean).join(" ")}var _default=exports.default=Label;
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;
@@ -6,7 +6,7 @@ purpose: Name a form control with consistent label typography, on its own or nex
6
6
 
7
7
  # Label
8
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 one visual prop, `disabled`, that renders the text in the disabled color.
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
10
 
11
11
  ## Props
12
12
 
@@ -18,14 +18,17 @@ _Also inherits all props from `LabelHTMLAttributes<HTMLLabelElement>`._
18
18
  | Name | Type | Required | Default | Description |
19
19
  | --- | --- | --- | --- | --- |
20
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. |
21
22
  <!-- END GENERATED PROPS -->
22
23
 
23
24
  ## When to use
24
25
 
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
26
28
  - Showing a label that follows the library typography, with a disabled look next to a disabled control
27
29
 
28
30
  ## When NOT to use
29
31
 
30
32
  - **Checkbox or radio captions** — use the `label` prop of the checkbox or radio component, which renders and associates a label for you.
31
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.
@@ -6,5 +6,6 @@ Generated from `src/components/label/label.css`.
6
6
 
7
7
  | Token | Declared value | Resolution |
8
8
  | --- | --- | --- |
9
+ | `--c-label-asterisk` | `var(--c-color-red-70)` | `var(--c-color-red-70) → hsl(0 100% 70%)` |
9
10
  | `--c-label-content` | `var(--c-color-gray-15)` | `var(--c-color-gray-15) → hsl(0 0% 15%)` |
10
11
  | `--c-label-content-disabled` | `var(--c-color-gray-50)` | `var(--c-color-gray-50) → hsl(0 0% 50%)` |
@@ -4,8 +4,12 @@ Generated from component frontmatter. Human usage sections live in each componen
4
4
 
5
5
  | Component | Description | Purpose | Doc path |
6
6
  | --- | --- | --- | --- |
7
+ | Banner | A colored message box with four themes and an optional dismiss button. | Show tips and feedback messages with consistent styling, and let users dismiss them. | [`../components/banner/banner.md`](../components/banner/banner.md) |
7
8
  | 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
9
  | 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) |
10
+ | 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) |
11
+ | Icon | A base container that renders inline SVG shapes in a 40×40 viewBox, themeable through design tokens. | Build icon components with a consistent size, stroke, and color strategy. | [`../components/icon/icon.md`](../components/icon/icon.md) |
12
+ | IconClose | A close icon made of two crossing lines, built on top of Icon. | Represent closing, dismissing, or removing something. | [`../icons/close/icon-close.md`](../icons/close/icon-close.md) |
9
13
  | 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) |
10
14
  | 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) |
11
15
  | 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) |
@@ -17,6 +17,19 @@ Generated from `src/vars.css`. Values show the declared token and the resolved r
17
17
  | `--c-color-accented-85` | `var(--c-color-gray-85)` | `var(--c-color-gray-85) → hsl(0 0% 85%)` |
18
18
  | `--c-color-accented-90` | `var(--c-color-gray-90)` | `var(--c-color-gray-90) → hsl(0 0% 90%)` |
19
19
  | `--c-color-accented-95` | `var(--c-color-gray-95)` | `var(--c-color-gray-95) → hsl(0 0% 95%)` |
20
+ | `--c-color-blue-10` | `hsl(220 100% 10%)` | `hsl(220 100% 10%)` |
21
+ | `--c-color-blue-15` | `hsl(220 100% 15%)` | `hsl(220 100% 15%)` |
22
+ | `--c-color-blue-20` | `hsl(220 100% 20%)` | `hsl(220 100% 20%)` |
23
+ | `--c-color-blue-30` | `hsl(220 100% 30%)` | `hsl(220 100% 30%)` |
24
+ | `--c-color-blue-40` | `hsl(220 100% 40%)` | `hsl(220 100% 40%)` |
25
+ | `--c-color-blue-5` | `hsl(220 100% 5%)` | `hsl(220 100% 5%)` |
26
+ | `--c-color-blue-50` | `hsl(220 100% 50%)` | `hsl(220 100% 50%)` |
27
+ | `--c-color-blue-60` | `hsl(220 100% 60%)` | `hsl(220 100% 60%)` |
28
+ | `--c-color-blue-70` | `hsl(220 100% 70%)` | `hsl(220 100% 70%)` |
29
+ | `--c-color-blue-80` | `hsl(220 100% 80%)` | `hsl(220 100% 80%)` |
30
+ | `--c-color-blue-85` | `hsl(220 100% 85%)` | `hsl(220 100% 85%)` |
31
+ | `--c-color-blue-90` | `hsl(220 100% 90%)` | `hsl(220 100% 90%)` |
32
+ | `--c-color-blue-95` | `hsl(220 100% 95%)` | `hsl(220 100% 95%)` |
20
33
  | `--c-color-gray-10` | `hsl(0 0% 10%)` | `hsl(0 0% 10%)` |
21
34
  | `--c-color-gray-15` | `hsl(0 0% 15%)` | `hsl(0 0% 15%)` |
22
35
  | `--c-color-gray-20` | `hsl(0 0% 20%)` | `hsl(0 0% 20%)` |
@@ -30,6 +43,32 @@ Generated from `src/vars.css`. Values show the declared token and the resolved r
30
43
  | `--c-color-gray-85` | `hsl(0 0% 85%)` | `hsl(0 0% 85%)` |
31
44
  | `--c-color-gray-90` | `hsl(0 0% 90%)` | `hsl(0 0% 90%)` |
32
45
  | `--c-color-gray-95` | `hsl(0 0% 95%)` | `hsl(0 0% 95%)` |
46
+ | `--c-color-green-10` | `hsl(145 100% 10%)` | `hsl(145 100% 10%)` |
47
+ | `--c-color-green-15` | `hsl(145 100% 15%)` | `hsl(145 100% 15%)` |
48
+ | `--c-color-green-20` | `hsl(145 100% 20%)` | `hsl(145 100% 20%)` |
49
+ | `--c-color-green-30` | `hsl(145 100% 30%)` | `hsl(145 100% 30%)` |
50
+ | `--c-color-green-40` | `hsl(145 100% 40%)` | `hsl(145 100% 40%)` |
51
+ | `--c-color-green-5` | `hsl(145 100% 5%)` | `hsl(145 100% 5%)` |
52
+ | `--c-color-green-50` | `hsl(145 100% 50%)` | `hsl(145 100% 50%)` |
53
+ | `--c-color-green-60` | `hsl(145 100% 60%)` | `hsl(145 100% 60%)` |
54
+ | `--c-color-green-70` | `hsl(145 100% 70%)` | `hsl(145 100% 70%)` |
55
+ | `--c-color-green-80` | `hsl(145 100% 80%)` | `hsl(145 100% 80%)` |
56
+ | `--c-color-green-85` | `hsl(145 100% 85%)` | `hsl(145 100% 85%)` |
57
+ | `--c-color-green-90` | `hsl(145 100% 90%)` | `hsl(145 100% 90%)` |
58
+ | `--c-color-green-95` | `hsl(145 100% 95%)` | `hsl(145 100% 95%)` |
59
+ | `--c-color-orange-10` | `hsl(30 100% 10%)` | `hsl(30 100% 10%)` |
60
+ | `--c-color-orange-15` | `hsl(30 100% 15%)` | `hsl(30 100% 15%)` |
61
+ | `--c-color-orange-20` | `hsl(30 100% 20%)` | `hsl(30 100% 20%)` |
62
+ | `--c-color-orange-30` | `hsl(30 100% 30%)` | `hsl(30 100% 30%)` |
63
+ | `--c-color-orange-40` | `hsl(30 100% 40%)` | `hsl(30 100% 40%)` |
64
+ | `--c-color-orange-5` | `hsl(30 100% 5%)` | `hsl(30 100% 5%)` |
65
+ | `--c-color-orange-50` | `hsl(30 100% 50%)` | `hsl(30 100% 50%)` |
66
+ | `--c-color-orange-60` | `hsl(30 100% 60%)` | `hsl(30 100% 60%)` |
67
+ | `--c-color-orange-70` | `hsl(30 100% 70%)` | `hsl(30 100% 70%)` |
68
+ | `--c-color-orange-80` | `hsl(30 100% 80%)` | `hsl(30 100% 80%)` |
69
+ | `--c-color-orange-85` | `hsl(30 100% 85%)` | `hsl(30 100% 85%)` |
70
+ | `--c-color-orange-90` | `hsl(30 100% 90%)` | `hsl(30 100% 90%)` |
71
+ | `--c-color-orange-95` | `hsl(30 100% 95%)` | `hsl(30 100% 95%)` |
33
72
  | `--c-color-red-10` | `hsl(0 100% 10%)` | `hsl(0 100% 10%)` |
34
73
  | `--c-color-red-15` | `hsl(0 100% 15%)` | `hsl(0 100% 15%)` |
35
74
  | `--c-color-red-20` | `hsl(0 100% 20%)` | `hsl(0 100% 20%)` |
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _icon=_interopRequireDefault(require("../../components/icon/icon.jsx")),_jsxRuntime=require("react/jsx-runtime");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const IconClose=e=>(0,_jsxRuntime.jsxs)(_icon.default,{...e,name:"close",children:[(0,_jsxRuntime.jsx)("path",{"data-stroke":!0,d:"M12,28L28,12"}),(0,_jsxRuntime.jsx)("path",{"data-stroke":!0,d:"M28,28L12,12"})]});var _default=exports.default=IconClose;
@@ -0,0 +1,24 @@
1
+ ---
2
+ name: IconClose
3
+ description: A close icon made of two crossing lines, built on top of Icon.
4
+ purpose: Represent closing, dismissing, or removing something.
5
+ ---
6
+
7
+ # IconClose
8
+
9
+ Two crossing lines drawn through [`Icon`](../../components/icon/icon.md), with the class `c-icon-close`. It accepts and forwards every `Icon` prop (`size`, `strokeColor`, `strokeWidth`, `className`, etc.), except `name` and `children`, which are fixed.
10
+
11
+ ## Props
12
+
13
+ <!-- BEGIN GENERATED PROPS -->
14
+ _Also inherits all props from `Omit<IconProps, 'name' | 'children'>`._
15
+ <!-- END GENERATED PROPS -->
16
+
17
+ ## When to use
18
+
19
+ - Dismiss or close buttons (for example inside an isometric `Button`)
20
+ - Removing an item from a list
21
+
22
+ ## When NOT to use
23
+
24
+ - **Text-only actions** — use a `Button` with a text label when the action needs words to be clear.
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,"Checkbox",{enumerable:!0,get:function(){return _checkbox.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")),_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}}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"Banner",{enumerable:!0,get:function(){return _banner.default}}),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,"Icon",{enumerable:!0,get:function(){return _icon.default}}),Object.defineProperty(exports,"IconClose",{enumerable:!0,get:function(){return _iconClose.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 _banner=_interopRequireDefault(require("./components/banner/banner.jsx")),_button=_interopRequireDefault(require("./components/button/button.jsx")),_checkbox=_interopRequireDefault(require("./components/checkbox/checkbox.jsx")),_formControl=_interopRequireDefault(require("./components/form-control/form-control.jsx")),_icon=_interopRequireDefault(require("./components/icon/icon.jsx")),_iconClose=_interopRequireDefault(require("./icons/close/icon-close.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-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)}
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-blue-95: hsl(220 100% 95%);--c-color-blue-90: hsl(220 100% 90%);--c-color-blue-85: hsl(220 100% 85%);--c-color-blue-80: hsl(220 100% 80%);--c-color-blue-70: hsl(220 100% 70%);--c-color-blue-60: hsl(220 100% 60%);--c-color-blue-50: hsl(220 100% 50%);--c-color-blue-40: hsl(220 100% 40%);--c-color-blue-30: hsl(220 100% 30%);--c-color-blue-20: hsl(220 100% 20%);--c-color-blue-15: hsl(220 100% 15%);--c-color-blue-10: hsl(220 100% 10%);--c-color-blue-5: hsl(220 100% 5%);--c-color-orange-95: hsl(30 100% 95%);--c-color-orange-90: hsl(30 100% 90%);--c-color-orange-85: hsl(30 100% 85%);--c-color-orange-80: hsl(30 100% 80%);--c-color-orange-70: hsl(30 100% 70%);--c-color-orange-60: hsl(30 100% 60%);--c-color-orange-50: hsl(30 100% 50%);--c-color-orange-40: hsl(30 100% 40%);--c-color-orange-30: hsl(30 100% 30%);--c-color-orange-20: hsl(30 100% 20%);--c-color-orange-15: hsl(30 100% 15%);--c-color-orange-10: hsl(30 100% 10%);--c-color-orange-5: hsl(30 100% 5%);--c-color-green-95: hsl(145 100% 95%);--c-color-green-90: hsl(145 100% 90%);--c-color-green-85: hsl(145 100% 85%);--c-color-green-80: hsl(145 100% 80%);--c-color-green-70: hsl(145 100% 70%);--c-color-green-60: hsl(145 100% 60%);--c-color-green-50: hsl(145 100% 50%);--c-color-green-40: hsl(145 100% 40%);--c-color-green-30: hsl(145 100% 30%);--c-color-green-20: hsl(145 100% 20%);--c-color-green-15: hsl(145 100% 15%);--c-color-green-10: hsl(145 100% 10%);--c-color-green-5: hsl(145 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)}
@@ -4,8 +4,12 @@ Generated from component frontmatter. Human usage sections live in each componen
4
4
 
5
5
  | Component | Description | Purpose | Doc path |
6
6
  | --- | --- | --- | --- |
7
+ | Banner | A colored message box with four themes and an optional dismiss button. | Show tips and feedback messages with consistent styling, and let users dismiss them. | [`../components/banner/banner.md`](../components/banner/banner.md) |
7
8
  | 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
9
  | 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) |
10
+ | 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) |
11
+ | Icon | A base container that renders inline SVG shapes in a 40×40 viewBox, themeable through design tokens. | Build icon components with a consistent size, stroke, and color strategy. | [`../components/icon/icon.md`](../components/icon/icon.md) |
12
+ | IconClose | A close icon made of two crossing lines, built on top of Icon. | Represent closing, dismissing, or removing something. | [`../icons/close/icon-close.md`](../icons/close/icon-close.md) |
9
13
  | 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) |
10
14
  | 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) |
11
15
  | 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) |
@@ -17,6 +17,19 @@ Generated from `src/vars.css`. Values show the declared token and the resolved r
17
17
  | `--c-color-accented-85` | `var(--c-color-gray-85)` | `var(--c-color-gray-85) → hsl(0 0% 85%)` |
18
18
  | `--c-color-accented-90` | `var(--c-color-gray-90)` | `var(--c-color-gray-90) → hsl(0 0% 90%)` |
19
19
  | `--c-color-accented-95` | `var(--c-color-gray-95)` | `var(--c-color-gray-95) → hsl(0 0% 95%)` |
20
+ | `--c-color-blue-10` | `hsl(220 100% 10%)` | `hsl(220 100% 10%)` |
21
+ | `--c-color-blue-15` | `hsl(220 100% 15%)` | `hsl(220 100% 15%)` |
22
+ | `--c-color-blue-20` | `hsl(220 100% 20%)` | `hsl(220 100% 20%)` |
23
+ | `--c-color-blue-30` | `hsl(220 100% 30%)` | `hsl(220 100% 30%)` |
24
+ | `--c-color-blue-40` | `hsl(220 100% 40%)` | `hsl(220 100% 40%)` |
25
+ | `--c-color-blue-5` | `hsl(220 100% 5%)` | `hsl(220 100% 5%)` |
26
+ | `--c-color-blue-50` | `hsl(220 100% 50%)` | `hsl(220 100% 50%)` |
27
+ | `--c-color-blue-60` | `hsl(220 100% 60%)` | `hsl(220 100% 60%)` |
28
+ | `--c-color-blue-70` | `hsl(220 100% 70%)` | `hsl(220 100% 70%)` |
29
+ | `--c-color-blue-80` | `hsl(220 100% 80%)` | `hsl(220 100% 80%)` |
30
+ | `--c-color-blue-85` | `hsl(220 100% 85%)` | `hsl(220 100% 85%)` |
31
+ | `--c-color-blue-90` | `hsl(220 100% 90%)` | `hsl(220 100% 90%)` |
32
+ | `--c-color-blue-95` | `hsl(220 100% 95%)` | `hsl(220 100% 95%)` |
20
33
  | `--c-color-gray-10` | `hsl(0 0% 10%)` | `hsl(0 0% 10%)` |
21
34
  | `--c-color-gray-15` | `hsl(0 0% 15%)` | `hsl(0 0% 15%)` |
22
35
  | `--c-color-gray-20` | `hsl(0 0% 20%)` | `hsl(0 0% 20%)` |
@@ -30,6 +43,32 @@ Generated from `src/vars.css`. Values show the declared token and the resolved r
30
43
  | `--c-color-gray-85` | `hsl(0 0% 85%)` | `hsl(0 0% 85%)` |
31
44
  | `--c-color-gray-90` | `hsl(0 0% 90%)` | `hsl(0 0% 90%)` |
32
45
  | `--c-color-gray-95` | `hsl(0 0% 95%)` | `hsl(0 0% 95%)` |
46
+ | `--c-color-green-10` | `hsl(145 100% 10%)` | `hsl(145 100% 10%)` |
47
+ | `--c-color-green-15` | `hsl(145 100% 15%)` | `hsl(145 100% 15%)` |
48
+ | `--c-color-green-20` | `hsl(145 100% 20%)` | `hsl(145 100% 20%)` |
49
+ | `--c-color-green-30` | `hsl(145 100% 30%)` | `hsl(145 100% 30%)` |
50
+ | `--c-color-green-40` | `hsl(145 100% 40%)` | `hsl(145 100% 40%)` |
51
+ | `--c-color-green-5` | `hsl(145 100% 5%)` | `hsl(145 100% 5%)` |
52
+ | `--c-color-green-50` | `hsl(145 100% 50%)` | `hsl(145 100% 50%)` |
53
+ | `--c-color-green-60` | `hsl(145 100% 60%)` | `hsl(145 100% 60%)` |
54
+ | `--c-color-green-70` | `hsl(145 100% 70%)` | `hsl(145 100% 70%)` |
55
+ | `--c-color-green-80` | `hsl(145 100% 80%)` | `hsl(145 100% 80%)` |
56
+ | `--c-color-green-85` | `hsl(145 100% 85%)` | `hsl(145 100% 85%)` |
57
+ | `--c-color-green-90` | `hsl(145 100% 90%)` | `hsl(145 100% 90%)` |
58
+ | `--c-color-green-95` | `hsl(145 100% 95%)` | `hsl(145 100% 95%)` |
59
+ | `--c-color-orange-10` | `hsl(30 100% 10%)` | `hsl(30 100% 10%)` |
60
+ | `--c-color-orange-15` | `hsl(30 100% 15%)` | `hsl(30 100% 15%)` |
61
+ | `--c-color-orange-20` | `hsl(30 100% 20%)` | `hsl(30 100% 20%)` |
62
+ | `--c-color-orange-30` | `hsl(30 100% 30%)` | `hsl(30 100% 30%)` |
63
+ | `--c-color-orange-40` | `hsl(30 100% 40%)` | `hsl(30 100% 40%)` |
64
+ | `--c-color-orange-5` | `hsl(30 100% 5%)` | `hsl(30 100% 5%)` |
65
+ | `--c-color-orange-50` | `hsl(30 100% 50%)` | `hsl(30 100% 50%)` |
66
+ | `--c-color-orange-60` | `hsl(30 100% 60%)` | `hsl(30 100% 60%)` |
67
+ | `--c-color-orange-70` | `hsl(30 100% 70%)` | `hsl(30 100% 70%)` |
68
+ | `--c-color-orange-80` | `hsl(30 100% 80%)` | `hsl(30 100% 80%)` |
69
+ | `--c-color-orange-85` | `hsl(30 100% 85%)` | `hsl(30 100% 85%)` |
70
+ | `--c-color-orange-90` | `hsl(30 100% 90%)` | `hsl(30 100% 90%)` |
71
+ | `--c-color-orange-95` | `hsl(30 100% 95%)` | `hsl(30 100% 95%)` |
33
72
  | `--c-color-red-10` | `hsl(0 100% 10%)` | `hsl(0 100% 10%)` |
34
73
  | `--c-color-red-15` | `hsl(0 100% 15%)` | `hsl(0 100% 15%)` |
35
74
  | `--c-color-red-20` | `hsl(0 100% 20%)` | `hsl(0 100% 20%)` |
@@ -0,0 +1 @@
1
+ .c-banner{--c-banner-background: var(--c-color-blue-95);--c-banner-content: var(--c-color-blue-50);--c-banner-close-icon: var(--c-color-blue-60);--c-banner-close-background-hover: var(--c-color-blue-90);--c-banner-radius: 15px;--c-banner-close-radius: 10px;--c-banner-close-size: 30px;display:block;position:relative;padding:10px 15px;min-height:40px;background:var(--c-banner-background);color:var(--c-banner-content);font-family:var(--c-font-family-primary);font-size:var(--c-font-size-sm);font-weight:400;line-height:20px;border-radius:var(--c-banner-radius);box-sizing:border-box}.c-banner.is-dismissable{padding-right:45px}.c-banner.is-warning{--c-banner-background: var(--c-color-orange-95);--c-banner-content: var(--c-color-orange-50);--c-banner-close-icon: var(--c-color-orange-50);--c-banner-close-background-hover: var(--c-color-orange-90)}.c-banner.is-success{--c-banner-background: var(--c-color-green-95);--c-banner-content: var(--c-color-green-30);--c-banner-close-icon: var(--c-color-green-30);--c-banner-close-background-hover: var(--c-color-green-85)}.c-banner.is-error{--c-banner-background: var(--c-color-red-95);--c-banner-content: var(--c-color-red-60);--c-banner-close-icon: var(--c-color-red-60);--c-banner-close-background-hover: var(--c-color-red-90)}.c-banner button.c-button.is-isometric{--c-button-width: var(--c-banner-close-size);--c-button-height: var(--c-banner-close-size);--c-button-radius: var(--c-banner-close-radius);--c-button-background: transparent;--c-button-background-hover: var(--c-banner-close-background-hover);--c-button-border-color: transparent;--c-button-box-shadow-color: transparent;position:absolute;top:5px;right:5px}.c-banner button.c-button.is-isometric:focus-visible{background:var(--c-banner-close-background-hover)}
@@ -0,0 +1 @@
1
+ import{useState as f}from"react";import m from"../button/button.js";import d from"../../icons/close/icon-close.js";import"./banner.css";import{jsxs as p,jsx as r}from"react/jsx-runtime";const C=({theme:e,dismissable:s,closeButtonLabel:o,className:n,children:t,...i})=>{const[l,a]=f(!0),c=b({theme:e,dismissable:s,className:n}),u=()=>a(!1);return l?p("div",{className:c,...i,children:[t,s&&x({closeButtonLabel:o,onClick:u})]}):null};function b({theme:e,dismissable:s,className:o}){return["c-banner",e&&`is-${e}`,s&&"is-dismissable",o].filter(Boolean).join(" ")}function x({closeButtonLabel:e="Close",onClick:s}){return r(m,{type:"button","aria-label":e,onClick:s,isometric:!0,children:r(d,{size:"20px",strokeWidth:4,strokeColor:"var(--c-banner-close-icon)"})})}export default C;
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: Banner
3
+ description: A colored message box with four themes and an optional dismiss button.
4
+ purpose: Show tips and feedback messages with consistent styling, and let users dismiss them.
5
+ ---
6
+
7
+ # Banner
8
+
9
+ A block-level message box with rounded corners. The `children` are rendered inside it, so rich content such as links, buttons, and formatted text is accepted. Without a `theme`, the banner uses the default blue theme.
10
+
11
+ With `dismissable`, a dismiss button (an isometric `Button` with an `IconClose`) is rendered in the top-right corner, and the content never overlaps it. Clicking the button removes the banner from the DOM by itself: the banner is autonomous and has no dismiss callback, and the dismissed state is not persisted.
12
+
13
+ ## Props
14
+
15
+ The Banner API extends the native HTML `div` attributes, which are forwarded to the container.
16
+
17
+ <!-- BEGIN GENERATED PROPS -->
18
+ _Also inherits all props from `HTMLAttributes<HTMLDivElement>`._
19
+
20
+ | Name | Type | Required | Default | Description |
21
+ | --- | --- | --- | --- | --- |
22
+ | children | `ReactNode` | No | `undefined` | Banner content. Accepts any React node, such as links, buttons, and formatted text. |
23
+ | closeButtonLabel | `string` | No | `"Close"` | Accessible name (`aria-label`) of the dismiss button. |
24
+ | dismissable | `boolean` | No | `false` | Renders a dismiss button in the top-right corner. Clicking it removes the banner from the DOM. |
25
+ | theme | `"success" \| "warning" \| "error"` | No | `undefined` | Color theme of the banner. When omitted, the default blue theme is used. |
26
+ <!-- END GENERATED PROPS -->
27
+
28
+ ## When to use
29
+
30
+ - Showing tips, warnings, success feedback, or error messages inside the page flow
31
+ - Messages that the user may want to dismiss
32
+ - Messages with rich content, such as links or buttons
33
+
34
+ ## When NOT to use
35
+
36
+ - **Blocking confirmations** — use a dialog or modal when the user must decide before continuing.
37
+ - **Field-level validation** — use the error message of `FormControl` next to the field.
38
+ - **Transient notifications** — a banner stays in the page until dismissed, so do not use it for toasts that disappear on their own.
@@ -0,0 +1,56 @@
1
+ # Banner tokens
2
+
3
+ Generated from `src/components/banner/banner.css`.
4
+
5
+ ## Base tokens
6
+
7
+ | Token | Declared value | Resolution |
8
+ | --- | --- | --- |
9
+ | `--c-banner-background` | `var(--c-color-blue-95)` | `var(--c-color-blue-95) → hsl(220 100% 95%)` |
10
+ | `--c-banner-close-background-hover` | `var(--c-color-blue-90)` | `var(--c-color-blue-90) → hsl(220 100% 90%)` |
11
+ | `--c-banner-close-icon` | `var(--c-color-blue-60)` | `var(--c-color-blue-60) → hsl(220 100% 60%)` |
12
+ | `--c-banner-close-radius` | `10px` | `10px` |
13
+ | `--c-banner-close-size` | `30px` | `30px` |
14
+ | `--c-banner-content` | `var(--c-color-blue-50)` | `var(--c-color-blue-50) → hsl(220 100% 50%)` |
15
+ | `--c-banner-radius` | `15px` | `15px` |
16
+
17
+ ## Modifier overrides
18
+
19
+ ### `.c-banner.is-warning`
20
+
21
+ | Token | Declared value | Resolution |
22
+ | --- | --- | --- |
23
+ | `--c-banner-background` | `var(--c-color-orange-95)` | `var(--c-color-orange-95) → hsl(30 100% 95%)` |
24
+ | `--c-banner-close-background-hover` | `var(--c-color-orange-90)` | `var(--c-color-orange-90) → hsl(30 100% 90%)` |
25
+ | `--c-banner-close-icon` | `var(--c-color-orange-50)` | `var(--c-color-orange-50) → hsl(30 100% 50%)` |
26
+ | `--c-banner-content` | `var(--c-color-orange-50)` | `var(--c-color-orange-50) → hsl(30 100% 50%)` |
27
+
28
+ ### `.c-banner.is-success`
29
+
30
+ | Token | Declared value | Resolution |
31
+ | --- | --- | --- |
32
+ | `--c-banner-background` | `var(--c-color-green-95)` | `var(--c-color-green-95) → hsl(145 100% 95%)` |
33
+ | `--c-banner-close-background-hover` | `var(--c-color-green-85)` | `var(--c-color-green-85) → hsl(145 100% 85%)` |
34
+ | `--c-banner-close-icon` | `var(--c-color-green-30)` | `var(--c-color-green-30) → hsl(145 100% 30%)` |
35
+ | `--c-banner-content` | `var(--c-color-green-30)` | `var(--c-color-green-30) → hsl(145 100% 30%)` |
36
+
37
+ ### `.c-banner.is-error`
38
+
39
+ | Token | Declared value | Resolution |
40
+ | --- | --- | --- |
41
+ | `--c-banner-background` | `var(--c-color-red-95)` | `var(--c-color-red-95) → hsl(0 100% 95%)` |
42
+ | `--c-banner-close-background-hover` | `var(--c-color-red-90)` | `var(--c-color-red-90) → hsl(0 100% 90%)` |
43
+ | `--c-banner-close-icon` | `var(--c-color-red-60)` | `var(--c-color-red-60) → hsl(0 100% 60%)` |
44
+ | `--c-banner-content` | `var(--c-color-red-60)` | `var(--c-color-red-60) → hsl(0 100% 60%)` |
45
+
46
+ ### `.c-banner button.c-button.is-isometric`
47
+
48
+ | Token | Declared value | Resolution |
49
+ | --- | --- | --- |
50
+ | `--c-button-background` | `transparent` | `transparent` |
51
+ | `--c-button-background-hover` | `var(--c-banner-close-background-hover)` | `var(--c-banner-close-background-hover) → var(--c-color-blue-90) → hsl(220 100% 90%)` |
52
+ | `--c-button-border-color` | `transparent` | `transparent` |
53
+ | `--c-button-box-shadow-color` | `transparent` | `transparent` |
54
+ | `--c-button-height` | `var(--c-banner-close-size)` | `var(--c-banner-close-size) → 30px` |
55
+ | `--c-button-radius` | `var(--c-banner-close-radius)` | `var(--c-banner-close-radius) → 10px` |
56
+ | `--c-button-width` | `var(--c-banner-close-size)` | `var(--c-banner-close-size) → 30px` |
@@ -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` |
@@ -0,0 +1 @@
1
+ .c-icon{--c-icon-stroke-color: var(--c-color-gray-10);--c-icon-stroke-width: 1px;--c-icon-shape-color: var(--c-color-gray-10);--c-icon-width: 40px;--c-icon-height: 40px;display:inline-flex;width:var(--c-icon-width);height:var(--c-icon-height)}.c-icon svg{width:100%;height:100%}.c-icon [data-stroke]{fill:none;stroke:var(--c-icon-stroke-color);stroke-width:var(--c-icon-stroke-width);stroke-linecap:round;stroke-linejoin:round}.c-icon [data-shape]{fill:var(--c-icon-shape-color)}
@@ -0,0 +1 @@
1
+ import"./icon.css";import{jsx as n}from"react/jsx-runtime";const a=({name:t,strokeColor:c,strokeWidth:o,size:e,style:i,className:r,children:s,...d})=>{const l=["c-icon",`c-icon-${t}`,r].filter(Boolean).join(" "),u=h({strokeColor:c,strokeWidth:o,size:e});return n("div",{className:l,style:{...u,...i},"aria-hidden":"true",...d,children:n("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 40 40",children:s})})};function h({strokeColor:t,strokeWidth:c,size:o}){return Object.entries({"--c-icon-stroke-color":t,"--c-icon-stroke-width":c,"--c-icon-width":o,"--c-icon-height":o}).filter(([,e])=>e!==void 0).reduce((e,[i,r])=>({...e,[i]:r}),{})}export default a;
@@ -0,0 +1,39 @@
1
+ ---
2
+ name: Icon
3
+ description: A base container that renders inline SVG shapes in a 40×40 viewBox, themeable through design tokens.
4
+ purpose: Build icon components with a consistent size, stroke, and color strategy.
5
+ ---
6
+
7
+ # Icon
8
+
9
+ The base of every icon in the library. It renders a decorative container (`aria-hidden="true"`) with an inline `<svg>` that uses a `0 0 40 40` viewBox, and the `children` are the SVG shapes. Icons ready to use live in `src/icons/` (for example `IconClose`) and are built on top of `Icon`.
10
+
11
+ Shapes must not carry presentational attributes. Mark outlines with `data-stroke` (no fill, round line caps and joins) and filled shapes with `data-shape`. The default color of both is `--c-color-gray-10`: it is never inherited from the parent. Only `strokeColor` (or the `--c-icon-stroke-color` custom property) changes the stroke color. The default stroke width is 1px and the default size is 40px.
12
+
13
+ `strokeColor`, `strokeWidth`, and `size` are applied as `--c-icon-*` custom properties on the container, only when given. Values passed in `style` take precedence over them.
14
+
15
+ ## Props
16
+
17
+ The Icon API extends the native HTML `div` attributes, which are forwarded to the container.
18
+
19
+ <!-- BEGIN GENERATED PROPS -->
20
+ _Also inherits all props from `HTMLAttributes<HTMLDivElement>`._
21
+
22
+ | Name | Type | Required | Default | Description |
23
+ | --- | --- | --- | --- | --- |
24
+ | children | `ReactNode` | No | `undefined` | SVG shapes drawn inside the 40×40 viewBox. Use `data-stroke` for outlines and `data-shape` for filled shapes. |
25
+ | name | `string` | Yes | | Name of the icon. Builds the `c-icon-<name>` css class of the container. |
26
+ | size | `string` | No | `undefined` | Width and height of the icon (for example `20px`), applied as `--c-icon-width` and `--c-icon-height`. |
27
+ | strokeColor | `string` | No | `undefined` | Stroke color of the outlines, applied as `--c-icon-stroke-color`. |
28
+ | strokeWidth | `string \| number` | No | `undefined` | Stroke width of the outlines in viewBox units, applied as `--c-icon-stroke-width`. |
29
+ <!-- END GENERATED PROPS -->
30
+
31
+ ## When to use
32
+
33
+ - Building a new icon component for `src/icons/`
34
+ - Rendering a one-off SVG that must follow the library's stroke, shape, and size tokens
35
+
36
+ ## When NOT to use
37
+
38
+ - **Existing icons** — import the ready-made icon component (for example `IconClose`) instead of drawing its shapes again.
39
+ - **Images and illustrations** — use an `<img>` or an inline SVG for artwork that is not an icon.
@@ -0,0 +1,13 @@
1
+ # Icon tokens
2
+
3
+ Generated from `src/components/icon/icon.css`.
4
+
5
+ ## Base tokens
6
+
7
+ | Token | Declared value | Resolution |
8
+ | --- | --- | --- |
9
+ | `--c-icon-height` | `40px` | `40px` |
10
+ | `--c-icon-shape-color` | `var(--c-color-gray-10)` | `var(--c-color-gray-10) → hsl(0 0% 10%)` |
11
+ | `--c-icon-stroke-color` | `var(--c-color-gray-10)` | `var(--c-color-gray-10) → hsl(0 0% 10%)` |
12
+ | `--c-icon-stroke-width` | `1px` | `1px` |
13
+ | `--c-icon-width` | `40px` | `40px` |
@@ -1 +1 @@
1
- .c-label{--c-label-content: var(--c-color-gray-15);--c-label-content-disabled: var(--c-color-gray-50);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)}
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)}
@@ -1 +1 @@
1
- import"./label.css";import{jsx as t}from"react/jsx-runtime";const i=({disabled:e,className:l,children:s,...a})=>{const o=n({disabled:e,className:l});return t("label",{className:o,...a,children:s})};function n({disabled:e,className:l}){const s=["c-label"];return e&&s.push("is-disabled"),[...s,l].filter(Boolean).join(" ")}export default i;
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;
@@ -6,7 +6,7 @@ purpose: Name a form control with consistent label typography, on its own or nex
6
6
 
7
7
  # Label
8
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 one visual prop, `disabled`, that renders the text in the disabled color.
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
10
 
11
11
  ## Props
12
12
 
@@ -18,14 +18,17 @@ _Also inherits all props from `LabelHTMLAttributes<HTMLLabelElement>`._
18
18
  | Name | Type | Required | Default | Description |
19
19
  | --- | --- | --- | --- | --- |
20
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. |
21
22
  <!-- END GENERATED PROPS -->
22
23
 
23
24
  ## When to use
24
25
 
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
26
28
  - Showing a label that follows the library typography, with a disabled look next to a disabled control
27
29
 
28
30
  ## When NOT to use
29
31
 
30
32
  - **Checkbox or radio captions** — use the `label` prop of the checkbox or radio component, which renders and associates a label for you.
31
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.
@@ -6,5 +6,6 @@ Generated from `src/components/label/label.css`.
6
6
 
7
7
  | Token | Declared value | Resolution |
8
8
  | --- | --- | --- |
9
+ | `--c-label-asterisk` | `var(--c-color-red-70)` | `var(--c-color-red-70) → hsl(0 100% 70%)` |
9
10
  | `--c-label-content` | `var(--c-color-gray-15)` | `var(--c-color-gray-15) → hsl(0 0% 15%)` |
10
11
  | `--c-label-content-disabled` | `var(--c-color-gray-50)` | `var(--c-color-gray-50) → hsl(0 0% 50%)` |
@@ -4,8 +4,12 @@ Generated from component frontmatter. Human usage sections live in each componen
4
4
 
5
5
  | Component | Description | Purpose | Doc path |
6
6
  | --- | --- | --- | --- |
7
+ | Banner | A colored message box with four themes and an optional dismiss button. | Show tips and feedback messages with consistent styling, and let users dismiss them. | [`../components/banner/banner.md`](../components/banner/banner.md) |
7
8
  | 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
9
  | 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) |
10
+ | 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) |
11
+ | Icon | A base container that renders inline SVG shapes in a 40×40 viewBox, themeable through design tokens. | Build icon components with a consistent size, stroke, and color strategy. | [`../components/icon/icon.md`](../components/icon/icon.md) |
12
+ | IconClose | A close icon made of two crossing lines, built on top of Icon. | Represent closing, dismissing, or removing something. | [`../icons/close/icon-close.md`](../icons/close/icon-close.md) |
9
13
  | 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) |
10
14
  | 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) |
11
15
  | 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) |
@@ -17,6 +17,19 @@ Generated from `src/vars.css`. Values show the declared token and the resolved r
17
17
  | `--c-color-accented-85` | `var(--c-color-gray-85)` | `var(--c-color-gray-85) → hsl(0 0% 85%)` |
18
18
  | `--c-color-accented-90` | `var(--c-color-gray-90)` | `var(--c-color-gray-90) → hsl(0 0% 90%)` |
19
19
  | `--c-color-accented-95` | `var(--c-color-gray-95)` | `var(--c-color-gray-95) → hsl(0 0% 95%)` |
20
+ | `--c-color-blue-10` | `hsl(220 100% 10%)` | `hsl(220 100% 10%)` |
21
+ | `--c-color-blue-15` | `hsl(220 100% 15%)` | `hsl(220 100% 15%)` |
22
+ | `--c-color-blue-20` | `hsl(220 100% 20%)` | `hsl(220 100% 20%)` |
23
+ | `--c-color-blue-30` | `hsl(220 100% 30%)` | `hsl(220 100% 30%)` |
24
+ | `--c-color-blue-40` | `hsl(220 100% 40%)` | `hsl(220 100% 40%)` |
25
+ | `--c-color-blue-5` | `hsl(220 100% 5%)` | `hsl(220 100% 5%)` |
26
+ | `--c-color-blue-50` | `hsl(220 100% 50%)` | `hsl(220 100% 50%)` |
27
+ | `--c-color-blue-60` | `hsl(220 100% 60%)` | `hsl(220 100% 60%)` |
28
+ | `--c-color-blue-70` | `hsl(220 100% 70%)` | `hsl(220 100% 70%)` |
29
+ | `--c-color-blue-80` | `hsl(220 100% 80%)` | `hsl(220 100% 80%)` |
30
+ | `--c-color-blue-85` | `hsl(220 100% 85%)` | `hsl(220 100% 85%)` |
31
+ | `--c-color-blue-90` | `hsl(220 100% 90%)` | `hsl(220 100% 90%)` |
32
+ | `--c-color-blue-95` | `hsl(220 100% 95%)` | `hsl(220 100% 95%)` |
20
33
  | `--c-color-gray-10` | `hsl(0 0% 10%)` | `hsl(0 0% 10%)` |
21
34
  | `--c-color-gray-15` | `hsl(0 0% 15%)` | `hsl(0 0% 15%)` |
22
35
  | `--c-color-gray-20` | `hsl(0 0% 20%)` | `hsl(0 0% 20%)` |
@@ -30,6 +43,32 @@ Generated from `src/vars.css`. Values show the declared token and the resolved r
30
43
  | `--c-color-gray-85` | `hsl(0 0% 85%)` | `hsl(0 0% 85%)` |
31
44
  | `--c-color-gray-90` | `hsl(0 0% 90%)` | `hsl(0 0% 90%)` |
32
45
  | `--c-color-gray-95` | `hsl(0 0% 95%)` | `hsl(0 0% 95%)` |
46
+ | `--c-color-green-10` | `hsl(145 100% 10%)` | `hsl(145 100% 10%)` |
47
+ | `--c-color-green-15` | `hsl(145 100% 15%)` | `hsl(145 100% 15%)` |
48
+ | `--c-color-green-20` | `hsl(145 100% 20%)` | `hsl(145 100% 20%)` |
49
+ | `--c-color-green-30` | `hsl(145 100% 30%)` | `hsl(145 100% 30%)` |
50
+ | `--c-color-green-40` | `hsl(145 100% 40%)` | `hsl(145 100% 40%)` |
51
+ | `--c-color-green-5` | `hsl(145 100% 5%)` | `hsl(145 100% 5%)` |
52
+ | `--c-color-green-50` | `hsl(145 100% 50%)` | `hsl(145 100% 50%)` |
53
+ | `--c-color-green-60` | `hsl(145 100% 60%)` | `hsl(145 100% 60%)` |
54
+ | `--c-color-green-70` | `hsl(145 100% 70%)` | `hsl(145 100% 70%)` |
55
+ | `--c-color-green-80` | `hsl(145 100% 80%)` | `hsl(145 100% 80%)` |
56
+ | `--c-color-green-85` | `hsl(145 100% 85%)` | `hsl(145 100% 85%)` |
57
+ | `--c-color-green-90` | `hsl(145 100% 90%)` | `hsl(145 100% 90%)` |
58
+ | `--c-color-green-95` | `hsl(145 100% 95%)` | `hsl(145 100% 95%)` |
59
+ | `--c-color-orange-10` | `hsl(30 100% 10%)` | `hsl(30 100% 10%)` |
60
+ | `--c-color-orange-15` | `hsl(30 100% 15%)` | `hsl(30 100% 15%)` |
61
+ | `--c-color-orange-20` | `hsl(30 100% 20%)` | `hsl(30 100% 20%)` |
62
+ | `--c-color-orange-30` | `hsl(30 100% 30%)` | `hsl(30 100% 30%)` |
63
+ | `--c-color-orange-40` | `hsl(30 100% 40%)` | `hsl(30 100% 40%)` |
64
+ | `--c-color-orange-5` | `hsl(30 100% 5%)` | `hsl(30 100% 5%)` |
65
+ | `--c-color-orange-50` | `hsl(30 100% 50%)` | `hsl(30 100% 50%)` |
66
+ | `--c-color-orange-60` | `hsl(30 100% 60%)` | `hsl(30 100% 60%)` |
67
+ | `--c-color-orange-70` | `hsl(30 100% 70%)` | `hsl(30 100% 70%)` |
68
+ | `--c-color-orange-80` | `hsl(30 100% 80%)` | `hsl(30 100% 80%)` |
69
+ | `--c-color-orange-85` | `hsl(30 100% 85%)` | `hsl(30 100% 85%)` |
70
+ | `--c-color-orange-90` | `hsl(30 100% 90%)` | `hsl(30 100% 90%)` |
71
+ | `--c-color-orange-95` | `hsl(30 100% 95%)` | `hsl(30 100% 95%)` |
33
72
  | `--c-color-red-10` | `hsl(0 100% 10%)` | `hsl(0 100% 10%)` |
34
73
  | `--c-color-red-15` | `hsl(0 100% 15%)` | `hsl(0 100% 15%)` |
35
74
  | `--c-color-red-20` | `hsl(0 100% 20%)` | `hsl(0 100% 20%)` |
@@ -0,0 +1 @@
1
+ import o from"../../components/icon/icon.js";import{jsx as t,jsxs as r}from"react/jsx-runtime";const e=s=>r(o,{...s,name:"close",children:[t("path",{"data-stroke":!0,d:"M12,28L28,12"}),t("path",{"data-stroke":!0,d:"M28,28L12,12"})]});export default e;
@@ -0,0 +1,24 @@
1
+ ---
2
+ name: IconClose
3
+ description: A close icon made of two crossing lines, built on top of Icon.
4
+ purpose: Represent closing, dismissing, or removing something.
5
+ ---
6
+
7
+ # IconClose
8
+
9
+ Two crossing lines drawn through [`Icon`](../../components/icon/icon.md), with the class `c-icon-close`. It accepts and forwards every `Icon` prop (`size`, `strokeColor`, `strokeWidth`, `className`, etc.), except `name` and `children`, which are fixed.
10
+
11
+ ## Props
12
+
13
+ <!-- BEGIN GENERATED PROPS -->
14
+ _Also inherits all props from `Omit<IconProps, 'name' | 'children'>`._
15
+ <!-- END GENERATED PROPS -->
16
+
17
+ ## When to use
18
+
19
+ - Dismiss or close buttons (for example inside an isometric `Button`)
20
+ - Removing an item from a list
21
+
22
+ ## When NOT to use
23
+
24
+ - **Text-only actions** — use a `Button` with a text label when the action needs words to be clear.
package/dist/es6/index.js CHANGED
@@ -1 +1 @@
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 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";
1
+ import"./index.css";export{default as Banner}from"./components/banner/banner.js";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 Icon}from"./components/icon/icon.js";export{default as IconClose}from"./icons/close/icon-close.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-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)}
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-blue-95: hsl(220 100% 95%);--c-color-blue-90: hsl(220 100% 90%);--c-color-blue-85: hsl(220 100% 85%);--c-color-blue-80: hsl(220 100% 80%);--c-color-blue-70: hsl(220 100% 70%);--c-color-blue-60: hsl(220 100% 60%);--c-color-blue-50: hsl(220 100% 50%);--c-color-blue-40: hsl(220 100% 40%);--c-color-blue-30: hsl(220 100% 30%);--c-color-blue-20: hsl(220 100% 20%);--c-color-blue-15: hsl(220 100% 15%);--c-color-blue-10: hsl(220 100% 10%);--c-color-blue-5: hsl(220 100% 5%);--c-color-orange-95: hsl(30 100% 95%);--c-color-orange-90: hsl(30 100% 90%);--c-color-orange-85: hsl(30 100% 85%);--c-color-orange-80: hsl(30 100% 80%);--c-color-orange-70: hsl(30 100% 70%);--c-color-orange-60: hsl(30 100% 60%);--c-color-orange-50: hsl(30 100% 50%);--c-color-orange-40: hsl(30 100% 40%);--c-color-orange-30: hsl(30 100% 30%);--c-color-orange-20: hsl(30 100% 20%);--c-color-orange-15: hsl(30 100% 15%);--c-color-orange-10: hsl(30 100% 10%);--c-color-orange-5: hsl(30 100% 5%);--c-color-green-95: hsl(145 100% 95%);--c-color-green-90: hsl(145 100% 90%);--c-color-green-85: hsl(145 100% 85%);--c-color-green-80: hsl(145 100% 80%);--c-color-green-70: hsl(145 100% 70%);--c-color-green-60: hsl(145 100% 60%);--c-color-green-50: hsl(145 100% 50%);--c-color-green-40: hsl(145 100% 40%);--c-color-green-30: hsl(145 100% 30%);--c-color-green-20: hsl(145 100% 20%);--c-color-green-15: hsl(145 100% 15%);--c-color-green-10: hsl(145 100% 10%);--c-color-green-5: hsl(145 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
+ export type { BannerProps } from './components/banner/banner.d.ts';
2
+ export { default as Banner } from './components/banner/banner.d.ts';
1
3
  export type { ButtonProps } from './components/button/button.d.ts';
2
4
  export { default as Button } from './components/button/button.d.ts';
3
5
  export type { CheckboxProps } from './components/checkbox/checkbox.d.ts';
4
6
  export { default as Checkbox } from './components/checkbox/checkbox.d.ts';
7
+ export type { FormControlProps } from './components/form-control/form-control.d.ts';
8
+ export { default as FormControl } from './components/form-control/form-control.d.ts';
9
+ export type { IconProps } from './components/icon/icon.d.ts';
10
+ export { default as Icon } from './components/icon/icon.d.ts';
11
+ export type { IconCloseProps } from './icons/close/icon-close.d.ts';
12
+ export { default as IconClose } from './icons/close/icon-close.d.ts';
5
13
  export type { InputProps } from './components/input/input.d.ts';
6
14
  export { default as Input } from './components/input/input.d.ts';
7
15
  export type { LabelProps } from './components/label/label.d.ts';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compilorama/compy",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "description": "React UI component library",
5
5
  "license": "MIT",
6
6
  "author": "Rafael Camargo <hello@rafaelcamargo.com>",