@furcrer/fullstack-components 0.1.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/README.md +328 -0
- package/dist/index.js +2067 -0
- package/dist/styles.css +1 -0
- package/dist/types/components/containers/Grid/Grid.d.ts +7 -0
- package/dist/types/components/containers/Grid/Grid.fixture.d.ts +2 -0
- package/dist/types/components/containers/Grid/index.d.ts +2 -0
- package/dist/types/components/containers/Stack/Stack.d.ts +7 -0
- package/dist/types/components/containers/Stack/Stack.fixture.d.ts +2 -0
- package/dist/types/components/containers/Stack/index.d.ts +2 -0
- package/dist/types/components/data/CrudExample/CrudExample.d.ts +4 -0
- package/dist/types/components/data/CrudExample/CrudExample.preview.d.ts +2 -0
- package/dist/types/components/data/CrudExample/index.d.ts +2 -0
- package/dist/types/components/data/ResourceTable/ResourceTable.d.ts +12 -0
- package/dist/types/components/data/ResourceTable/ResourceTable.preview.d.ts +2 -0
- package/dist/types/components/data/ResourceTable/index.d.ts +2 -0
- package/dist/types/components/forms/ColorInput/ColorInput.d.ts +5 -0
- package/dist/types/components/forms/ColorInput/ColorInput.fixture.d.ts +2 -0
- package/dist/types/components/forms/ColorInput/index.d.ts +2 -0
- package/dist/types/components/forms/DateInput/DateInput.d.ts +5 -0
- package/dist/types/components/forms/DateInput/DateInput.fixture.d.ts +2 -0
- package/dist/types/components/forms/DateInput/index.d.ts +2 -0
- package/dist/types/components/forms/FileInput/FileInput.d.ts +4 -0
- package/dist/types/components/forms/FileInput/FileInput.fixture.d.ts +2 -0
- package/dist/types/components/forms/FileInput/index.d.ts +2 -0
- package/dist/types/components/forms/NumberInput/NumberInput.d.ts +4 -0
- package/dist/types/components/forms/NumberInput/NumberInput.fixture.d.ts +2 -0
- package/dist/types/components/forms/NumberInput/index.d.ts +2 -0
- package/dist/types/components/forms/PasswordInput/PasswordInput.d.ts +4 -0
- package/dist/types/components/forms/PasswordInput/PasswordInput.fixture.d.ts +2 -0
- package/dist/types/components/forms/PasswordInput/index.d.ts +2 -0
- package/dist/types/components/forms/RadioGroup/RadioGroup.d.ts +13 -0
- package/dist/types/components/forms/RadioGroup/RadioGroup.fixture.d.ts +2 -0
- package/dist/types/components/forms/RadioGroup/index.d.ts +2 -0
- package/dist/types/components/forms/SearchInput/SearchInput.d.ts +4 -0
- package/dist/types/components/forms/SearchInput/SearchInput.fixture.d.ts +2 -0
- package/dist/types/components/forms/SearchInput/index.d.ts +2 -0
- package/dist/types/components/forms/Slider/Slider.d.ts +5 -0
- package/dist/types/components/forms/Slider/Slider.fixture.d.ts +2 -0
- package/dist/types/components/forms/Slider/index.d.ts +2 -0
- package/dist/types/components/primitives/Accordion/Accordion.d.ts +10 -0
- package/dist/types/components/primitives/Accordion/Accordion.fixture.d.ts +2 -0
- package/dist/types/components/primitives/Accordion/index.d.ts +2 -0
- package/dist/types/components/primitives/Alert/Alert.d.ts +6 -0
- package/dist/types/components/primitives/Alert/Alert.fixture.d.ts +2 -0
- package/dist/types/components/primitives/Alert/index.d.ts +2 -0
- package/dist/types/components/primitives/Avatar/Avatar.d.ts +8 -0
- package/dist/types/components/primitives/Avatar/Avatar.fixture.d.ts +2 -0
- package/dist/types/components/primitives/Avatar/index.d.ts +2 -0
- package/dist/types/components/primitives/Badge/Badge.d.ts +3 -0
- package/dist/types/components/primitives/Badge/Badge.fixture.d.ts +3 -0
- package/dist/types/components/primitives/Badge/Badge.types.d.ts +9 -0
- package/dist/types/components/primitives/Badge/index.d.ts +2 -0
- package/dist/types/components/primitives/Button/Button.d.ts +6 -0
- package/dist/types/components/primitives/Button/Button.fixture.d.ts +3 -0
- package/dist/types/components/primitives/Button/Button.types.d.ts +15 -0
- package/dist/types/components/primitives/Button/index.d.ts +2 -0
- package/dist/types/components/primitives/Card/Card.d.ts +3 -0
- package/dist/types/components/primitives/Card/Card.fixture.d.ts +3 -0
- package/dist/types/components/primitives/Card/Card.types.d.ts +9 -0
- package/dist/types/components/primitives/Card/index.d.ts +2 -0
- package/dist/types/components/primitives/Carousel/Carousel.d.ts +7 -0
- package/dist/types/components/primitives/Carousel/Carousel.fixture.d.ts +2 -0
- package/dist/types/components/primitives/Carousel/index.d.ts +2 -0
- package/dist/types/components/primitives/Checkbox/Checkbox.d.ts +3 -0
- package/dist/types/components/primitives/Checkbox/Checkbox.fixture.d.ts +3 -0
- package/dist/types/components/primitives/Checkbox/Checkbox.types.d.ts +5 -0
- package/dist/types/components/primitives/Checkbox/index.d.ts +2 -0
- package/dist/types/components/primitives/Combobox/Combobox.d.ts +14 -0
- package/dist/types/components/primitives/Combobox/Combobox.fixture.d.ts +2 -0
- package/dist/types/components/primitives/Combobox/index.d.ts +2 -0
- package/dist/types/components/primitives/CommandPalette/CommandPalette.d.ts +14 -0
- package/dist/types/components/primitives/CommandPalette/CommandPalette.fixture.d.ts +2 -0
- package/dist/types/components/primitives/CommandPalette/index.d.ts +2 -0
- package/dist/types/components/primitives/ContextMenu/ContextMenu.d.ts +11 -0
- package/dist/types/components/primitives/ContextMenu/ContextMenu.fixture.d.ts +2 -0
- package/dist/types/components/primitives/ContextMenu/index.d.ts +2 -0
- package/dist/types/components/primitives/DatePicker/DatePicker.d.ts +8 -0
- package/dist/types/components/primitives/DatePicker/DatePicker.fixture.d.ts +2 -0
- package/dist/types/components/primitives/DatePicker/index.d.ts +2 -0
- package/dist/types/components/primitives/Drawer/Drawer.d.ts +9 -0
- package/dist/types/components/primitives/Drawer/Drawer.fixture.d.ts +2 -0
- package/dist/types/components/primitives/Drawer/index.d.ts +2 -0
- package/dist/types/components/primitives/DropdownMenu/DropdownMenu.d.ts +11 -0
- package/dist/types/components/primitives/DropdownMenu/DropdownMenu.fixture.d.ts +2 -0
- package/dist/types/components/primitives/DropdownMenu/index.d.ts +2 -0
- package/dist/types/components/primitives/EmptyState/EmptyState.d.ts +3 -0
- package/dist/types/components/primitives/EmptyState/EmptyState.fixture.d.ts +3 -0
- package/dist/types/components/primitives/EmptyState/EmptyState.types.d.ts +9 -0
- package/dist/types/components/primitives/EmptyState/index.d.ts +2 -0
- package/dist/types/components/primitives/ErrorState/ErrorState.d.ts +3 -0
- package/dist/types/components/primitives/ErrorState/ErrorState.fixture.d.ts +3 -0
- package/dist/types/components/primitives/ErrorState/ErrorState.types.d.ts +9 -0
- package/dist/types/components/primitives/ErrorState/index.d.ts +2 -0
- package/dist/types/components/primitives/FileUpload/FileUpload.d.ts +8 -0
- package/dist/types/components/primitives/FileUpload/FileUpload.fixture.d.ts +2 -0
- package/dist/types/components/primitives/FileUpload/index.d.ts +2 -0
- package/dist/types/components/primitives/FormField/FormField.d.ts +3 -0
- package/dist/types/components/primitives/FormField/FormField.fixture.d.ts +3 -0
- package/dist/types/components/primitives/FormField/FormField.types.d.ts +11 -0
- package/dist/types/components/primitives/FormField/index.d.ts +2 -0
- package/dist/types/components/primitives/Heading/Heading.d.ts +6 -0
- package/dist/types/components/primitives/Heading/Heading.fixture.d.ts +2 -0
- package/dist/types/components/primitives/Heading/index.d.ts +2 -0
- package/dist/types/components/primitives/IconButton/IconButton.d.ts +3 -0
- package/dist/types/components/primitives/IconButton/IconButton.fixture.d.ts +3 -0
- package/dist/types/components/primitives/IconButton/IconButton.types.d.ts +13 -0
- package/dist/types/components/primitives/IconButton/index.d.ts +2 -0
- package/dist/types/components/primitives/Input/Input.d.ts +3 -0
- package/dist/types/components/primitives/Input/Input.fixture.d.ts +3 -0
- package/dist/types/components/primitives/Input/Input.types.d.ts +5 -0
- package/dist/types/components/primitives/Input/index.d.ts +2 -0
- package/dist/types/components/primitives/Label/Label.d.ts +3 -0
- package/dist/types/components/primitives/Label/Label.fixture.d.ts +3 -0
- package/dist/types/components/primitives/Label/Label.types.d.ts +7 -0
- package/dist/types/components/primitives/Label/index.d.ts +2 -0
- package/dist/types/components/primitives/Link/Link.d.ts +5 -0
- package/dist/types/components/primitives/Link/Link.fixture.d.ts +2 -0
- package/dist/types/components/primitives/Link/index.d.ts +2 -0
- package/dist/types/components/primitives/LoadingState/LoadingState.d.ts +3 -0
- package/dist/types/components/primitives/LoadingState/LoadingState.fixture.d.ts +3 -0
- package/dist/types/components/primitives/LoadingState/LoadingState.types.d.ts +7 -0
- package/dist/types/components/primitives/LoadingState/index.d.ts +2 -0
- package/dist/types/components/primitives/Menubar/Menubar.d.ts +9 -0
- package/dist/types/components/primitives/Menubar/Menubar.fixture.d.ts +2 -0
- package/dist/types/components/primitives/Menubar/index.d.ts +2 -0
- package/dist/types/components/primitives/Modal/Modal.d.ts +3 -0
- package/dist/types/components/primitives/Modal/Modal.fixture.d.ts +3 -0
- package/dist/types/components/primitives/Modal/Modal.types.d.ts +13 -0
- package/dist/types/components/primitives/Modal/index.d.ts +2 -0
- package/dist/types/components/primitives/MultiSelect/MultiSelect.d.ts +13 -0
- package/dist/types/components/primitives/MultiSelect/MultiSelect.fixture.d.ts +2 -0
- package/dist/types/components/primitives/MultiSelect/index.d.ts +2 -0
- package/dist/types/components/primitives/NavigationMenu/NavigationMenu.d.ts +10 -0
- package/dist/types/components/primitives/NavigationMenu/NavigationMenu.fixture.d.ts +2 -0
- package/dist/types/components/primitives/NavigationMenu/index.d.ts +2 -0
- package/dist/types/components/primitives/Pagination/Pagination.d.ts +7 -0
- package/dist/types/components/primitives/Pagination/Pagination.fixture.d.ts +2 -0
- package/dist/types/components/primitives/Pagination/index.d.ts +2 -0
- package/dist/types/components/primitives/Popover/Popover.d.ts +8 -0
- package/dist/types/components/primitives/Popover/Popover.fixture.d.ts +2 -0
- package/dist/types/components/primitives/Popover/index.d.ts +2 -0
- package/dist/types/components/primitives/Progress/Progress.d.ts +7 -0
- package/dist/types/components/primitives/Progress/Progress.fixture.d.ts +2 -0
- package/dist/types/components/primitives/Progress/index.d.ts +2 -0
- package/dist/types/components/primitives/Radio/Radio.d.ts +3 -0
- package/dist/types/components/primitives/Radio/Radio.fixture.d.ts +3 -0
- package/dist/types/components/primitives/Radio/Radio.types.d.ts +5 -0
- package/dist/types/components/primitives/Radio/index.d.ts +2 -0
- package/dist/types/components/primitives/ResizablePanel/ResizablePanel.d.ts +8 -0
- package/dist/types/components/primitives/ResizablePanel/ResizablePanel.fixture.d.ts +2 -0
- package/dist/types/components/primitives/ResizablePanel/index.d.ts +2 -0
- package/dist/types/components/primitives/SearchBar/SearchBar.d.ts +5 -0
- package/dist/types/components/primitives/SearchBar/SearchBar.fixture.d.ts +2 -0
- package/dist/types/components/primitives/SearchBar/index.d.ts +2 -0
- package/dist/types/components/primitives/Select/Select.d.ts +3 -0
- package/dist/types/components/primitives/Select/Select.fixture.d.ts +3 -0
- package/dist/types/components/primitives/Select/Select.types.d.ts +15 -0
- package/dist/types/components/primitives/Select/index.d.ts +2 -0
- package/dist/types/components/primitives/Separator/Separator.d.ts +5 -0
- package/dist/types/components/primitives/Separator/Separator.fixture.d.ts +2 -0
- package/dist/types/components/primitives/Separator/index.d.ts +2 -0
- package/dist/types/components/primitives/Sidebar/Sidebar.d.ts +7 -0
- package/dist/types/components/primitives/Sidebar/Sidebar.fixture.d.ts +2 -0
- package/dist/types/components/primitives/Sidebar/index.d.ts +2 -0
- package/dist/types/components/primitives/Skeleton/Skeleton.d.ts +7 -0
- package/dist/types/components/primitives/Skeleton/Skeleton.fixture.d.ts +2 -0
- package/dist/types/components/primitives/Skeleton/index.d.ts +2 -0
- package/dist/types/components/primitives/Spinner/Spinner.d.ts +6 -0
- package/dist/types/components/primitives/Spinner/Spinner.fixture.d.ts +2 -0
- package/dist/types/components/primitives/Spinner/index.d.ts +2 -0
- package/dist/types/components/primitives/StatCard/StatCard.d.ts +3 -0
- package/dist/types/components/primitives/StatCard/StatCard.fixture.d.ts +3 -0
- package/dist/types/components/primitives/StatCard/StatCard.preview.d.ts +3 -0
- package/dist/types/components/primitives/StatCard/StatCard.types.d.ts +13 -0
- package/dist/types/components/primitives/StatCard/index.d.ts +2 -0
- package/dist/types/components/primitives/Stepper/Stepper.d.ts +13 -0
- package/dist/types/components/primitives/Stepper/Stepper.fixture.d.ts +2 -0
- package/dist/types/components/primitives/Stepper/index.d.ts +2 -0
- package/dist/types/components/primitives/Switch/Switch.d.ts +3 -0
- package/dist/types/components/primitives/Switch/Switch.fixture.d.ts +3 -0
- package/dist/types/components/primitives/Switch/Switch.types.d.ts +5 -0
- package/dist/types/components/primitives/Switch/index.d.ts +2 -0
- package/dist/types/components/primitives/Tabs/Tabs.d.ts +14 -0
- package/dist/types/components/primitives/Tabs/Tabs.fixture.d.ts +2 -0
- package/dist/types/components/primitives/Tabs/index.d.ts +2 -0
- package/dist/types/components/primitives/Text/Text.d.ts +6 -0
- package/dist/types/components/primitives/Text/Text.fixture.d.ts +2 -0
- package/dist/types/components/primitives/Text/index.d.ts +2 -0
- package/dist/types/components/primitives/Textarea/Textarea.d.ts +3 -0
- package/dist/types/components/primitives/Textarea/Textarea.fixture.d.ts +3 -0
- package/dist/types/components/primitives/Textarea/Textarea.types.d.ts +7 -0
- package/dist/types/components/primitives/Textarea/index.d.ts +2 -0
- package/dist/types/components/primitives/Toast/Toast.d.ts +8 -0
- package/dist/types/components/primitives/Toast/Toast.fixture.d.ts +2 -0
- package/dist/types/components/primitives/Toast/index.d.ts +2 -0
- package/dist/types/components/primitives/Tooltip/Tooltip.d.ts +6 -0
- package/dist/types/components/primitives/Tooltip/Tooltip.fixture.d.ts +2 -0
- package/dist/types/components/primitives/Tooltip/index.d.ts +2 -0
- package/dist/types/components/primitives/TreeView/TreeView.d.ts +12 -0
- package/dist/types/components/primitives/TreeView/TreeView.fixture.d.ts +2 -0
- package/dist/types/components/primitives/TreeView/index.d.ts +2 -0
- package/dist/types/data/Table.d.ts +13 -0
- package/dist/types/data/Table.fixture.d.ts +2 -0
- package/dist/types/data/api.d.ts +25 -0
- package/dist/types/data/crud.d.ts +20 -0
- package/dist/types/data/index.d.ts +9 -0
- package/dist/types/data/react-crud.d.ts +6 -0
- package/dist/types/data/react-table.d.ts +6 -0
- package/dist/types/data/resource-controller.d.ts +28 -0
- package/dist/types/data/resource-controller.test.d.ts +1 -0
- package/dist/types/data/resource.d.ts +2 -0
- package/dist/types/data/table-controller.d.ts +28 -0
- package/dist/types/data/types.d.ts +36 -0
- package/dist/types/forms/FormActions.d.ts +4 -0
- package/dist/types/forms/FormActions.fixture.d.ts +3 -0
- package/dist/types/forms/FormField.d.ts +8 -0
- package/dist/types/forms/FormField.fixture.d.ts +2 -0
- package/dist/types/forms/adapters.d.ts +19 -0
- package/dist/types/forms/adapters.fixture.d.ts +2 -0
- package/dist/types/forms/field.d.ts +16 -0
- package/dist/types/forms/form-store.d.ts +8 -0
- package/dist/types/forms/index.d.ts +10 -0
- package/dist/types/forms/react-field.d.ts +7 -0
- package/dist/types/forms/react-form.d.ts +10 -0
- package/dist/types/forms/react-form.fixture.d.ts +2 -0
- package/dist/types/forms/react.d.ts +16 -0
- package/dist/types/forms/react.fixture.d.ts +2 -0
- package/dist/types/forms/resource-form.d.ts +13 -0
- package/dist/types/forms/types.d.ts +25 -0
- package/dist/types/generated/component-registry.d.ts +2238 -0
- package/dist/types/generated/public-exports.d.ts +123 -0
- package/dist/types/index.d.ts +17 -0
- package/dist/types/theme/index.d.ts +4 -0
- package/dist/types/theme/provider.d.ts +20 -0
- package/dist/types/theme/theme.d.ts +47 -0
- package/dist/types/theme/theme.test.d.ts +1 -0
- package/dist/types/tokens/index.d.ts +1 -0
- package/dist/types/tokens/tokens.d.ts +55 -0
- package/dist/types/tooling/discovery/discover.d.ts +9 -0
- package/dist/types/tooling/discovery/discover.test.d.ts +1 -0
- package/dist/types/tooling/discovery/generate-exports.d.ts +6 -0
- package/dist/types/tooling/discovery/generate-registry.d.ts +6 -0
- package/dist/types/tooling/discovery/generate-registry.test.d.ts +1 -0
- package/dist/types/tooling/discovery/generate.d.ts +1 -0
- package/dist/types/tooling/discovery/vite-plugin.d.ts +8 -0
- package/dist/types/types/component.d.ts +12 -0
- package/dist/types/types/index.d.ts +2 -0
- package/dist/types/types/metadata.d.ts +48 -0
- package/package.json +56 -0
package/README.md
ADDED
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
# FullStack Components
|
|
2
|
+
|
|
3
|
+
Universal React + TypeScript component and application library.
|
|
4
|
+
|
|
5
|
+
## Current foundation
|
|
6
|
+
|
|
7
|
+
The repository currently provides:
|
|
8
|
+
|
|
9
|
+
- automatically discovered React components and generated metadata
|
|
10
|
+
- a local component playground with props, events, fixtures, zoom, pan and responsive viewport modes
|
|
11
|
+
- reusable native form primitives and accessible state components
|
|
12
|
+
- an accessible Modal/Dialog with focus management
|
|
13
|
+
- generic Table, Resource, form and CRUD abstractions
|
|
14
|
+
- framework-agnostic API adapters
|
|
15
|
+
- theme tokens with light/dark foundations and runtime theme validation
|
|
16
|
+
- `ThemeProvider` / `useTheme` with light, dark and system modes
|
|
17
|
+
- automated typecheck, test, build, package-consumer and browser validation
|
|
18
|
+
|
|
19
|
+
The project is intentionally backend-agnostic. React components do not depend on a specific database, API framework or application framework.
|
|
20
|
+
|
|
21
|
+
## Architecture
|
|
22
|
+
|
|
23
|
+
The library is built in layers:
|
|
24
|
+
|
|
25
|
+
1. Primitive UI components
|
|
26
|
+
2. Composed components
|
|
27
|
+
3. Forms and validation
|
|
28
|
+
4. Data and table components
|
|
29
|
+
5. Resource/API abstractions
|
|
30
|
+
6. CRUD workflows
|
|
31
|
+
7. Development preview and automatic metadata generation
|
|
32
|
+
|
|
33
|
+
Components are discovered automatically from `src/components`, with data and form component directories also included in the development discovery configuration. The tooling generates metadata and a registry from the source tree instead of requiring manual component registration.
|
|
34
|
+
|
|
35
|
+
## Development preview
|
|
36
|
+
|
|
37
|
+
The repository contains a local component playground. It automatically discovers components and displays:
|
|
38
|
+
|
|
39
|
+
- the component catalog with category information
|
|
40
|
+
- centered live component preview
|
|
41
|
+
- detected props and generated controls
|
|
42
|
+
- emitted events
|
|
43
|
+
- optional custom previews
|
|
44
|
+
- desktop, tablet and mobile viewport modes
|
|
45
|
+
- zoom controls and mouse-wheel zoom
|
|
46
|
+
- canvas panning
|
|
47
|
+
- preview reset
|
|
48
|
+
- light, dark and system theme controls
|
|
49
|
+
|
|
50
|
+
Inside the preview canvas:
|
|
51
|
+
|
|
52
|
+
- mouse wheel zooms in and out
|
|
53
|
+
- drag the canvas background to move the preview
|
|
54
|
+
- `+` / `-` change zoom
|
|
55
|
+
- `0` resets zoom and position
|
|
56
|
+
- `Desktop`, `Tablet` and `Mobile` change the preview viewport
|
|
57
|
+
- `Reset` returns the preview to 100% and its centered position
|
|
58
|
+
|
|
59
|
+
New components should appear automatically after saving their files; the Vite discovery plugin regenerates the registry and reloads the preview.
|
|
60
|
+
|
|
61
|
+
### Component discovery contract
|
|
62
|
+
|
|
63
|
+
A public component is discovered from a `.ts` or `.tsx` source file under the configured source directories when the discovery scanner identifies a PascalCase React component export. Discovery metadata includes the component name, category, source path and detected props.
|
|
64
|
+
|
|
65
|
+
Adjacent `*.fixture.tsx` files provide reusable preview fixtures. An adjacent `*.preview.tsx` file is a curated preview override and takes precedence over a fixture when both exist. Discovery ignores type-only declarations and known fixture/preview/type files rather than exposing them as catalogue entries.
|
|
66
|
+
|
|
67
|
+
The generated files under `src/generated` are build outputs and are intentionally not handwritten or treated as the source of truth.
|
|
68
|
+
|
|
69
|
+
## Start locally
|
|
70
|
+
|
|
71
|
+
Requirements: Node.js 20+ and npm.
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
npm install
|
|
75
|
+
npm run dev
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Then open the local URL printed by Vite, normally:
|
|
79
|
+
|
|
80
|
+
```text
|
|
81
|
+
http://localhost:5173
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
For validation and library builds:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
npm run typecheck
|
|
88
|
+
npm test
|
|
89
|
+
npm run build
|
|
90
|
+
npm run test:package
|
|
91
|
+
npm run test:e2e
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
`npm run build` generates the public component registry, TypeScript declaration files and the Vite library bundle.
|
|
95
|
+
|
|
96
|
+
`npm run test:package` packs the library exactly as npm would and installs it into a temporary consumer project. The smoke test verifies representative UI, theme, form and data APIs from the package root, checks generic type consumption from a clean TypeScript project and verifies that generated public component declarations are present in the packed package.
|
|
97
|
+
|
|
98
|
+
## Primitive components
|
|
99
|
+
|
|
100
|
+
The public UI catalogue includes foundational primitives such as `Badge`, `Button`, `Card`, `Checkbox`, `EmptyState`, `ErrorState`, `FormField`, `IconButton`, `Input`, `Label`, `LoadingState`, `Modal`, `Radio`, `Select`, `StatCard`, `Switch`, `Textarea`, `Skeleton`, `Spinner`, `Alert`, `Progress`, `Avatar`, `Separator`, `Breadcrumb`, `Pagination`, `Tabs`, `Accordion`, `Tooltip`, `DropdownMenu`, `Drawer`, `Toast`, `Heading`, `Text` and `Link`; layout primitives `Stack` and `Grid`; common form controls `NumberInput`, `SearchInput`, `PasswordInput`, `DateInput`, `ColorInput`, `FileInput`, `Slider` and `RadioGroup`; plus the data-oriented `Table`, `ResourceTable` and discovered form infrastructure components.
|
|
101
|
+
|
|
102
|
+
Native HTML semantics are preferred for interactive primitives. For example:
|
|
103
|
+
|
|
104
|
+
```tsx
|
|
105
|
+
import {
|
|
106
|
+
Button,
|
|
107
|
+
Checkbox,
|
|
108
|
+
FormField,
|
|
109
|
+
Input,
|
|
110
|
+
Select,
|
|
111
|
+
} from "@furcrer/fullstack-components";
|
|
112
|
+
|
|
113
|
+
export function Example() {
|
|
114
|
+
return (
|
|
115
|
+
<form>
|
|
116
|
+
<FormField label="Email" type="email" required />
|
|
117
|
+
<Input aria-label="Search" placeholder="Search" />
|
|
118
|
+
<Select
|
|
119
|
+
aria-label="Sort order"
|
|
120
|
+
options={[
|
|
121
|
+
{ value: "name", label: "Name" },
|
|
122
|
+
{ value: "price", label: "Price" },
|
|
123
|
+
]}
|
|
124
|
+
/>
|
|
125
|
+
<label>
|
|
126
|
+
<Checkbox />
|
|
127
|
+
Accept terms
|
|
128
|
+
</label>
|
|
129
|
+
<Button type="submit">Save</Button>
|
|
130
|
+
</form>
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
`Button` supports `primary`, `secondary` and `ghost` variants, `small`/`medium`/`large` sizes and a `loading` state. Loading automatically disables the native button and exposes `aria-busy="true"`.
|
|
136
|
+
|
|
137
|
+
`Modal` requires `open` and `title`, supports optional `onClose`/`dismissible`, moves focus into the dialog, traps Tab navigation while open, closes on Escape when dismissible and restores focus to the trigger when it closes.
|
|
138
|
+
|
|
139
|
+
## Forms API
|
|
140
|
+
|
|
141
|
+
The form infrastructure is framework-light and can be used without a specific API library.
|
|
142
|
+
|
|
143
|
+
```tsx
|
|
144
|
+
import {
|
|
145
|
+
FormProvider,
|
|
146
|
+
FormSubmit,
|
|
147
|
+
createFormStore,
|
|
148
|
+
useFormState,
|
|
149
|
+
} from "@furcrer/fullstack-components";
|
|
150
|
+
|
|
151
|
+
type FormValues = {
|
|
152
|
+
name: string;
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
const store = createFormStore<FormValues>({
|
|
156
|
+
initialValues: { name: "" },
|
|
157
|
+
validate: async (values) =>
|
|
158
|
+
values.name.trim() ? {} : { name: "Name is required." },
|
|
159
|
+
onSubmit: async (values) => {
|
|
160
|
+
console.log(values.name);
|
|
161
|
+
},
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
function SubmitState() {
|
|
165
|
+
const { submitting, status } = useFormState<FormValues>();
|
|
166
|
+
return <span>{submitting ? "Saving…" : status}</span>;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export function FormExample() {
|
|
170
|
+
return (
|
|
171
|
+
<FormProvider store={store}>
|
|
172
|
+
<form onSubmit={(event) => { event.preventDefault(); void store.submit(); }}>
|
|
173
|
+
<input
|
|
174
|
+
name="name"
|
|
175
|
+
value={store.getState().values.name}
|
|
176
|
+
onChange={(event) => store.setValue("name", event.target.value)}
|
|
177
|
+
/>
|
|
178
|
+
<FormSubmit>Save</FormSubmit>
|
|
179
|
+
<SubmitState />
|
|
180
|
+
</form>
|
|
181
|
+
</FormProvider>
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
For strongly typed field-level bindings, use `createFieldController` or the `BoundFormField` API. `BoundFormField` is the form-state-aware field component exported under an explicit name because the generated visual `FormField` already uses that name at the package root.
|
|
187
|
+
|
|
188
|
+
The forms family also includes `FormReset`, adapters and `createResourceForm` for resource-backed create/edit flows.
|
|
189
|
+
|
|
190
|
+
## Data, tables and resources
|
|
191
|
+
|
|
192
|
+
`Table` is the low-level generic table. It accepts typed row data and typed column definitions while preserving native table semantics.
|
|
193
|
+
|
|
194
|
+
```tsx
|
|
195
|
+
import { Table, type TableColumn } from "@furcrer/fullstack-components";
|
|
196
|
+
|
|
197
|
+
type Product = {
|
|
198
|
+
id: string;
|
|
199
|
+
name: string;
|
|
200
|
+
price: number;
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
const columns: TableColumn<Product>[] = [
|
|
204
|
+
{ key: "name", header: "Name" },
|
|
205
|
+
{ key: "price", header: "Price", render: (value) => `${String(value)} €` },
|
|
206
|
+
];
|
|
207
|
+
|
|
208
|
+
export function ProductTable({ products }: { products: Product[] }) {
|
|
209
|
+
return (
|
|
210
|
+
<Table
|
|
211
|
+
caption="Products"
|
|
212
|
+
data={products}
|
|
213
|
+
columns={columns}
|
|
214
|
+
emptyState="No products found."
|
|
215
|
+
/>
|
|
216
|
+
);
|
|
217
|
+
}
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
For resource-backed tables and CRUD, use a `Resource<TData, TId>` implementation with `ResourceController`, `ResourceTable` or `useResourceCrud`.
|
|
221
|
+
|
|
222
|
+
```ts
|
|
223
|
+
import {
|
|
224
|
+
createArrayResource,
|
|
225
|
+
createResourceController,
|
|
226
|
+
} from "@furcrer/fullstack-components";
|
|
227
|
+
|
|
228
|
+
const products = createArrayResource("products", [
|
|
229
|
+
{ id: "1", name: "Phone", price: 499 },
|
|
230
|
+
]);
|
|
231
|
+
|
|
232
|
+
const controller = createResourceController(products);
|
|
233
|
+
|
|
234
|
+
await controller.list({
|
|
235
|
+
page: 1,
|
|
236
|
+
pageSize: 10,
|
|
237
|
+
search: "phone",
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
await controller.update("1", { price: 449 });
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
`createArrayResource` is intended for local/in-memory examples and development workflows. `createApiResource` adapts a typed `ApiClient` to the same `Resource` contract, while `createFetchApiClient` provides a framework-agnostic fetch implementation.
|
|
244
|
+
|
|
245
|
+
## CRUD workflow
|
|
246
|
+
|
|
247
|
+
A typical resource-backed CRUD flow is:
|
|
248
|
+
|
|
249
|
+
1. create or inject a `Resource<TData, TId>`
|
|
250
|
+
2. create a `ResourceController` or use `useResourceCrud`
|
|
251
|
+
3. render data with `ResourceTable`
|
|
252
|
+
4. use `createResourceForm` for typed create/edit form state
|
|
253
|
+
5. refresh/list through the controller after mutations
|
|
254
|
+
6. surface controller/form errors through the provided state objects
|
|
255
|
+
|
|
256
|
+
`CrudExample` in the component catalogue is a working in-repository example of this workflow, including create, edit, delete, validation, busy state and event reporting.
|
|
257
|
+
|
|
258
|
+
## Theme API
|
|
259
|
+
|
|
260
|
+
Wrap application content in `ThemeProvider` to enable runtime theme variables. The `system` mode follows the user's `prefers-color-scheme` preference.
|
|
261
|
+
|
|
262
|
+
```tsx
|
|
263
|
+
import {
|
|
264
|
+
ResourceTable,
|
|
265
|
+
StatCard,
|
|
266
|
+
ThemeProvider,
|
|
267
|
+
createArrayResource,
|
|
268
|
+
} from "@furcrer/fullstack-components";
|
|
269
|
+
|
|
270
|
+
const orders = createArrayResource("orders", [
|
|
271
|
+
{ id: "1", name: "First order" },
|
|
272
|
+
]);
|
|
273
|
+
|
|
274
|
+
export function App() {
|
|
275
|
+
return (
|
|
276
|
+
<ThemeProvider defaultMode="system">
|
|
277
|
+
<main>
|
|
278
|
+
<StatCard label="Orders" value="128" trend="up" trendValue="+12%" />
|
|
279
|
+
<ResourceTable resource={orders} columns={[{ key: "name", header: "Name" }]} />
|
|
280
|
+
</main>
|
|
281
|
+
</ThemeProvider>
|
|
282
|
+
);
|
|
283
|
+
}
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
`ThemeProvider` supports `light`, `dark` and `system` modes and injects the `--fsc-*` token variables into the document root or a supplied container. Use `useTheme()` inside the provider to read `mode`, `resolvedMode`, the active theme and `setMode`.
|
|
287
|
+
|
|
288
|
+
The theme model also exposes `createTheme`, `defaultTheme`, `darkTheme`, `applyTheme`, `themeToCss`, `themeToCssVariables` and `validateTheme` for consumers that need lower-level control.
|
|
289
|
+
|
|
290
|
+
The library entrypoint loads the CSS layer used by the visual components.
|
|
291
|
+
|
|
292
|
+
## Accessibility
|
|
293
|
+
|
|
294
|
+
Public components follow the accessibility contract in `src/components/ACCESSIBILITY.md`.
|
|
295
|
+
|
|
296
|
+
The baseline includes native control semantics, accessible naming, validation relationships, live status/error regions, dialog focus management, keyboard behaviour and table semantics. Accessibility contracts are backed by automated tests where practical.
|
|
297
|
+
|
|
298
|
+
Important consumer rules remain simple:
|
|
299
|
+
|
|
300
|
+
- give standalone interactive controls an accessible name
|
|
301
|
+
- use labels for form controls instead of visual text alone
|
|
302
|
+
- provide useful `aria-describedby` content when additional instructions or validation messages describe a control
|
|
303
|
+
- keep native disabled controls genuinely disabled
|
|
304
|
+
- do not rely on colour alone to communicate status
|
|
305
|
+
- keep focus visible
|
|
306
|
+
|
|
307
|
+
## Package API
|
|
308
|
+
|
|
309
|
+
The package root exports generated public components together with shared types, tokens, themes, forms and data abstractions from `src/index.ts`.
|
|
310
|
+
|
|
311
|
+
The public UI surface is generated from the component catalogue. The root API also exposes theme utilities, form state/controllers, resource/data APIs, CRUD hooks and fetch-based API adapters.
|
|
312
|
+
|
|
313
|
+
The root intentionally keeps the generated visual `FormField` separate from the form-state-aware `BoundFormField` name.
|
|
314
|
+
|
|
315
|
+
The package currently uses version `0.1.0`. Publishing is still intentionally manual and should happen only after the complete CI pipeline is green and npm credentials/configuration are available.
|
|
316
|
+
|
|
317
|
+
## Release readiness
|
|
318
|
+
|
|
319
|
+
The repository has automated verification for:
|
|
320
|
+
|
|
321
|
+
- TypeScript typechecking
|
|
322
|
+
- unit/integration tests
|
|
323
|
+
- production package build and declaration generation
|
|
324
|
+
- packed npm consumer imports and type consumption
|
|
325
|
+
- critical playground browser flows
|
|
326
|
+
- responsive narrow-viewport browser checks
|
|
327
|
+
|
|
328
|
+
Remaining work is focused on release polish: completing the public API audit, deeper accessibility/theme coverage, final successful CI verification after the latest audit commits, and the eventual 1.0.0/release decision.
|