@aglyn/shared-ui-jsx 1.0.0-beta.143 → 1.0.0-beta.145
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 +59 -3
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,7 +1,63 @@
|
|
|
1
1
|
# @aglyn/shared-ui-jsx
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Aglyn's general-purpose React and Material UI component library: layout and card primitives, links, menus, an icon component for Material Design Icon paths, shadow-DOM hosts, an error boundary, loading and confirmation contexts, and a set of hooks. The renderer, Besigner, the tenant runtime and every feature plugin build their UI on it. Nothing in it knows about Aglyn's data model, so it can be used in any React and MUI app.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
> Beta. Published from the Aglyn monorepo under the `beta` dist-tag; APIs can change between beta releases.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
npm install @aglyn/shared-ui-jsx@beta
|
|
10
|
+
|
|
11
|
+
Peer dependencies: `react`, `react-dom`, `next`, `@mui/material`, `@mui/system`, `@mui/utils`, `@mui/base`, `@mui/styles` and `@mui/x-data-grid`. `next` is needed by the link and router-event modules, and `@mui/x-data-grid` by the data table.
|
|
12
|
+
|
|
13
|
+
## What's in it
|
|
14
|
+
|
|
15
|
+
**The root entry is deliberately small.** A published Aglyn site imports this barrel, so it re-exports only what a rendered page or the designer needs by name. Everything else is imported by subpath, which keeps heavy components out of bundles that do not use them. The package declares `"sideEffects": false`.
|
|
16
|
+
|
|
17
|
+
From `@aglyn/shared-ui-jsx`:
|
|
18
|
+
|
|
19
|
+
- Components: `AppLink` (a Next.js link rendered as a MUI link, button, icon button or fab, chosen by `variant`), `CardDisplay`, `CardListItem`, `Container`, `GridItems`, `Menu`, `HelpTip`, `AglynText`, `SrOnly`.
|
|
20
|
+
- Icons: `MdiIcon` renders an SVG path inside a MUI `SvgIcon`. `MdiIconFromId` takes an `iconId` that is an `@mdi/js` export name and loads the path on demand, as `useMdiIcon` and `useMdiIcons` do. The root also re-exports all of `@aglyn/shared-data-mdi`, and the Aglyn and Besigner logo components.
|
|
21
|
+
- Isolation and errors: `ShadowDom` and `MuiShadowDom` (render children inside a shadow root, the latter with MUI styles scoped into it), `ErrorBoundaryComponent` and `withErrorBoundary`.
|
|
22
|
+
- Contexts: `LoadingProviderComponent` / `useLoading`, and `ConfirmationContext` / `useConfirmationContext`.
|
|
23
|
+
- Hooks: `useAsyncEffect`, `useSubscribable` (subscribe to an RxJS-style observable), `useMergeRefs` / `mergeRefs`, `useCallbackParamRef`, `useId`, `useIsomorphicLayoutEffect`, and the `useOnRouteChangeStart` family of router-event hooks.
|
|
24
|
+
- Helpers: `createHocWithContextConsumer`, `withHocFactoryBuilder`, `makeLinkElements`, `makeMetaElements`.
|
|
25
|
+
|
|
26
|
+
By subpath, `@aglyn/shared-ui-jsx/components/<file>`, for example:
|
|
27
|
+
|
|
28
|
+
- `data-table.component` — `DataTableComponent`, over MUI X Data Grid
|
|
29
|
+
- `grid-list` — `GridList`, a virtualized grid
|
|
30
|
+
- `empty-state.component` — `EmptyStateComponent`
|
|
31
|
+
- `list-pagination.component` — `ListPagination`
|
|
32
|
+
- `dialog-confirm` — `DialogConfirm`; `confirmation-provider.component` — `ConfirmationProviderComponent`
|
|
33
|
+
- `navigation-drawer.component`, `splash-screen`, `loading-modal`, `sandbox-frame`, `usage-meter.component`
|
|
34
|
+
|
|
35
|
+
## Usage
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
import { CardDisplay, MdiIcon, mdiAbacus } from '@aglyn/shared-ui-jsx'
|
|
39
|
+
|
|
40
|
+
export function Example() {
|
|
41
|
+
return (
|
|
42
|
+
<CardDisplay header="Totals" subheader="This month">
|
|
43
|
+
<MdiIcon path={mdiAbacus.path} fontSize="large" />
|
|
44
|
+
</CardDisplay>
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
A component that is not in the root barrel:
|
|
50
|
+
|
|
51
|
+
```tsx
|
|
52
|
+
import EmptyStateComponent from '@aglyn/shared-ui-jsx/components/empty-state.component'
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Components expect a MUI theme above them. `@aglyn/shared-ui-theme` provides the themes Aglyn uses, including the palette additions some of these components reference.
|
|
56
|
+
|
|
57
|
+
## How it fits
|
|
58
|
+
|
|
59
|
+
A `shared` UI package. It depends on `@aglyn/shared-ui-theme`, `@aglyn/shared-data-mdi`, `@aglyn/shared-util-tools` and `@aglyn/shared-util-vendor`. `@aglyn/shared-ui-jsx-forms`, `@aglyn/shared-ui-next`, `@aglyn/shared-ui-json-editor`, the node renderer, Besigner, the tenant runtime and the feature plugins depend on it. Shared packages are generic: they import only other shared packages and hold no plugin's domain.
|
|
60
|
+
|
|
61
|
+
## License
|
|
62
|
+
|
|
63
|
+
Apache-2.0. Source: https://github.com/aglyn/aglyn/tree/main/libs/shared/ui/jsx
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aglyn/shared-ui-jsx",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.145",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"homepage": "https://aglyn.com",
|
|
6
6
|
"repository": {
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
"./package.json": "./package.json"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@aglyn/shared-data-mdi": "1.0.0-beta.
|
|
29
|
-
"@aglyn/shared-ui-theme": "1.0.0-beta.
|
|
30
|
-
"@aglyn/shared-util-tools": "1.0.0-beta.
|
|
31
|
-
"@aglyn/shared-util-vendor": "1.0.0-beta.
|
|
28
|
+
"@aglyn/shared-data-mdi": "1.0.0-beta.145",
|
|
29
|
+
"@aglyn/shared-ui-theme": "1.0.0-beta.145",
|
|
30
|
+
"@aglyn/shared-util-tools": "1.0.0-beta.145",
|
|
31
|
+
"@aglyn/shared-util-vendor": "1.0.0-beta.145",
|
|
32
32
|
"@mdi/js": "^7.4.47",
|
|
33
33
|
"@swc/helpers": "0.5.23",
|
|
34
34
|
"change-case": "^5.4.4",
|