@academix-admin/selection-viewer 0.5.7 → 0.5.8

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 (2) hide show
  1. package/README.md +24 -0
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -97,6 +97,30 @@ prop/type (`SelectionViewerProps`, `SelectionState`, `TitleProps`, `SearchProps`
97
97
  `NoResultProps`, `ErrorProps`, `CancelButtonProps`, `LayoutProps`, `Padding`, `SnapPoint`,
98
98
  `RowProps`, `ColumnProps`).
99
99
 
100
+ ## Building your own sections
101
+
102
+ `Row` and `Column` report their loading state up to the viewer, so its `selectionState` reflects every section. To write your own section that takes part:
103
+
104
+ - `RowAggregateContext`: a section reports its own state into the nearest `Column` through this context (`report(id, state)` / `unreport(id)`).
105
+ - `SelectionViewerAggregateContext`: a column reports its combined state to the `SelectionViewer`.
106
+ - `computeAggregateState(states)`: how several states combine. Any `data` wins, then any `loading`; all `empty` is `empty`; any `error` is `error`; otherwise `initial`.
107
+
108
+ ## Styling the parts
109
+
110
+ Each part carries a stable class name you can style from your own CSS. These names are public: a release that renames or removes one is a breaking change (`test/parts.test.ts` holds them).
111
+
112
+ - `.selection-viewer-header`
113
+ - `.selection-viewer-drag-handle`
114
+ - `.selection-viewer-cancel`
115
+ - `.selection-viewer-search`
116
+ - `.selection-viewer-search-back-button`
117
+ - `.selection-viewer-search-clear-button`
118
+ - `.selection-viewer-fullscreen-search`
119
+ - `.selection-viewer-content`
120
+ - `.selection-viewer-loading`
121
+ - `.selection-viewer-no-results`
122
+ - `.selection-viewer-error`
123
+
100
124
  ## License
101
125
 
102
126
  MIT © Academix
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@academix-admin/selection-viewer",
3
- "version": "0.5.7",
3
+ "version": "0.5.8",
4
4
  "description": "Imperative React selection sheet — search + pick from a list — with a controller hook, built on @academix-admin/modal-sheet.",
5
5
  "keywords": [
6
6
  "react",
@@ -55,8 +55,8 @@
55
55
  "typecheck": "tsc --noEmit"
56
56
  },
57
57
  "dependencies": {
58
- "@academix-admin/modal-sheet": "^0.3.0",
59
- "@academix-admin/overlay-route": "^0.1.0"
58
+ "@academix-admin/modal-sheet": "^0.3.2",
59
+ "@academix-admin/overlay-route": "^0.1.2"
60
60
  },
61
61
  "peerDependencies": {
62
62
  "react": ">=18.0.0",