fermmap-shared
v0.2.4
Published
Public (private) deploy of FermMap-specific React components built using React Aria Components and React Spectrum S2 style-macros
Downloads
1,861
Maintainers
Readme
@fermmap/shared
Public (private) deploy of FermMap-specific React components built using React Aria Components and React Spectrum S2 style-macros.
Overview
This package contains a collection of accessible, themeed React components designed for the FermMap application. All components are built on top of React Aria Components for accessibility and use React Spectrum S2 style-macros for consistent, type-safe atomic styling.
Installation
npm install @fermmap/shared
# or
yarn add @fermmap/sharedImporting Components
import { Button, TextField, Table } from '@fermmap/shared';
import type { ColumnDef } from '@fermmap/shared';
// CSS is imported automatically from the built bundleAvailable Components
UI Components
AlertDialog,PromptDialog- Accessible dialogsAutocomplete,AutocompleteTable- Searchable inputsBadge- Status and category badgesButton,CloseButton- Button componentsCheckbox,RadioGroup,Switch- Form inputsComboBox,Select- Dropdown inputsDisclosureGroup- Expandable panelsFilterTabs- Tab-style filters with countsLabeledValue,StatCard- Data displayLink- Styled linksProgressBar- Progress indicatorsSearchField- Search inputsSegmentedControl- iOS-style segmented controlTable- Data tables with sorting/selectionTabs,TabList,Tab,TabPanel- Tabbed interfacesTextArea,TextField- Text inputs
Hooks & Utilities
- Custom hooks for common patterns
- Shared utility functions
- Style utilities
Usage
import { Button, TextField, Table } from '@fermmap/shared';
import type { ColumnDef } from '@fermmap/shared';
function MyComponent() {
return (
<div>
<TextField
label="Name"
value={name}
onChange={setName}
/>
<Button onPress={handleSubmit}>
Submit
</Button>
</div>
);
}Importing Styles
import '@fermmap/shared/styles/variables.css';Development
Building
yarn buildThis uses Parcel to build the package, generating both CommonJS and ESM outputs with TypeScript definitions.
Publishing
# Update version in package.json first
yarn publishThe prepublishOnly script will automatically clean and build the package before publishing.
Features
- ✅ Fully accessible components (WCAG 2.0 AA)
- ✅ Dark mode support via React Spectrum S2 tokens
- ✅ Type-safe with TypeScript
- ✅ Tree-shakeable ESM builds
- ✅ Consistent styling with S2 style-macros
- ✅ Responsive and mobile-friendly
- ✅ RTL (Right-to-Left) language support
License
MIT
Contributing
This is a private package for the FermMap project. For internal use only.
