Internal field component library for eSheet. Provides the 19 built-in field type React components used by @esheet/builder and @esheet/renderer.
⚠️ Not intended for standalone use. These components expect to run inside a host root (@esheet/builderor@esheet/renderer) that provides CSS resets, theme tokens, and dark mode support. Without a host, components will render unstyled.
| Category | Components |
|---|---|
| Text | TextField, LongTextField, MultiTextField |
| Choice | RadioField, CheckField, BooleanField |
| Select | DropdownField, MultiSelectDropdownField |
| Scale | RatingField, RankingField, SliderField |
| Matrix | SingleMatrixField, MultiMatrixField |
| Rich | DisplayField, HtmlField, ImageField, SignatureField, DiagramField |
| Layout | SectionField |
CustomRadio— Themed radio with unselect supportCustomCheckbox— Themed checkboxCustomDropdown— Themed select dropdownDrawingPad— Canvas component (used by SignatureField/DiagramField)- Icons:
TrashIcon,PlusIcon,ArrowUpIcon,ArrowDownIcon,UpDownArrowIcon
import { getFieldComponent, registerCustomFieldTypes } from '@esheet/fields';
// Look up a component by field type
const Component = getFieldComponent('text'); // → TextField
// Register custom field types
registerCustomFieldTypes({
'my-custom': {
component: MyCustomField,
meta: {
type: 'my-custom',
label: 'Custom',
category: 'basic',
defaultProps: {},
},
},
});Fields use Tailwind CSS v4 with ms: prefix (e.g., ms:bg-mssurface, ms:text-mstext). Colors reference CSS custom properties (--ms-color-*) defined by the host root:
- Light mode: Defined in the host's
@themeblock - Dark mode: Overridden when the host root has
.darkclass
Fields do not ship their own CSS resets or dark theme — they inherit from the consuming package.
Run nx build @esheet/fields to build the library.
Run nx test @esheet/fields to execute the unit tests via Vitest.