From d37541bf36e773ff51f55d5fadc1c692183b89c4 Mon Sep 17 00:00:00 2001 From: Joely Date: Sat, 7 Nov 2026 14:34:28 -0500 Subject: [PATCH 1/3] Revert "components 0.5.5 (unpublished): Form.BusinessInfo showLocation, for a host that asks the address itself" This reverts commit 8557b80c2e02ab244ad3abdd132b9e60fc2e5409. It reached main without review: a VS Code sync on a branch that tracked origin/main pushed it (2026-11-07). The owner then chose another design: the store address is picked from Google's suggestions inside Form.BusinessInfo itself, once the library has a single entry (plan: retire lib/portable). main goes back to cf906c7, version 0.5.4, so nothing is published with showLocation. Co-Authored-By: Claude Opus 5.5 --- packages/components/package-lock.json | 4 +-- packages/components/package.json | 2 +- packages/components/src/Form/Form.stories.js | 14 -------- .../components/src/Form/FormBusinessInfo.js | 33 ++++++++----------- .../src/Form/__tests__/Form.test.js | 16 --------- 5 files changed, 17 insertions(+), 52 deletions(-) diff --git a/packages/components/package-lock.json b/packages/components/package-lock.json index 050c8300..093f6fb4 100644 --- a/packages/components/package-lock.json +++ b/packages/components/package-lock.json @@ -1,12 +1,12 @@ { "name": "@jmstechnologiesinc/react-native-components", - "version": "0.5.5", + "version": "0.5.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@jmstechnologiesinc/react-native-components", - "version": "0.5.5", + "version": "0.5.4", "license": "ISC", "devDependencies": { "@jmstechnologiesinc/partner": "0.2.54", diff --git a/packages/components/package.json b/packages/components/package.json index b228be14..6e6afe64 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -1,6 +1,6 @@ { "name": "@jmstechnologiesinc/react-native-components", - "version": "0.5.5", + "version": "0.5.4", "description": "Biblioteca de componentes de interfaz compartida por las aplicaciones de Daxir.", "author": "yerloveraaa ", "homepage": "https://github.com/jmstechnologiesinc/react-native-components#readme", diff --git a/packages/components/src/Form/Form.stories.js b/packages/components/src/Form/Form.stories.js index 1c0c25bb..d31d0f26 100644 --- a/packages/components/src/Form/Form.stories.js +++ b/packages/components/src/Form/Form.stories.js @@ -210,20 +210,6 @@ export const BusinessInfoHighlighted = () => ( /> ); -// The store sign-up's form: the app asks the address with Google's suggestions, so the form leaves its field out, as -// it leaves out the phone and the email. -export const BusinessInfoWithoutLocation = () => ( - {}} - /> -); - // The driver's answers as a reviewer sees them: read-only (no disclosure, the // secrets masked), a changed field marked and a server error under its field. export const DriverInfoReadOnly = () => ( diff --git a/packages/components/src/Form/FormBusinessInfo.js b/packages/components/src/Form/FormBusinessInfo.js index 0c10caff..bff71f9d 100644 --- a/packages/components/src/Form/FormBusinessInfo.js +++ b/packages/components/src/Form/FormBusinessInfo.js @@ -87,9 +87,6 @@ const FormBusinessInfo = ({ storeTitle, location, line2, - // A host that asks the store address with its own input (the app's Google suggestions, barrel only) hides this - // field, as the sign-up hides the phone and the email. - showLocation = true, showWebsite = true, showPhoneNumber = true, showEmail = true, @@ -141,22 +138,20 @@ const FormBusinessInfo = ({ onChangeText={(text) => inputActionHandler('description', text)} /> - {showLocation ? ( - - inputActionHandler('location', text)} - /> - - ) : null} + + inputActionHandler('location', text)} + /> + { expect(hidden.root.findAll((node) => node.props.value === 'Casa Nostra LLC')).toHaveLength(0); }); - // The app asks the store address with Google's suggestions (barrel only) and hides this field, as it hides the - // phone and the email; the field's own errors are then the host's to show. - it('hides the store address under showLocation={false}, and keeps the other fields', () => { - const hidden = render( - - ); - expect(inputWithValue(hidden, '1 Main St')).toBeUndefined(); - expect(hostOf(hidden, 'error.location')).toHaveLength(0); - expect(inputWithValue(hidden, 'Suite 2')).toBeDefined(); - expect(inputWithValue(render(), '1 Main St')).toBeDefined(); - }); - it('names the tax id on file (masked) instead of showing it', () => { const tree = render(); expect(JSON.stringify(tree.toJSON())).toContain('•••••6789'); From 58bd16d4f099837415aa3041dd978542ea00852a Mon Sep 17 00:00:00 2001 From: Joely Date: Sat, 7 Nov 2026 14:39:23 -0500 Subject: [PATCH 2/3] components 0.5.5 (unpublished): Form.BusinessInfo asks the store address with Google's suggestions; portable deprecated MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Owner, 2026-11-07 (plan: retire lib/portable, phase 2). - Form.BusinessInfo: while the form can be edited, the store address is AutoCompleteInput, as the driver's operating address is (no GPS button, no «use my location» row). The picked suggestion's description is reported as `location`, clearing it reports '', and its server errors are listed under it (FieldErrorText). The suggestions have no read-only state, so under readOnly (the console) or isDisabled (a locked store) the address stays the field it was, and those renders are unchanged. - The barrel serves ZOOM and useModalFocus, which only portable.js served, so a host can drop lib/portable. portable.js is deprecated and goes in 0.6.0; PROJECT.md says so and documents the address. - Story BusinessInfoReadOnly. Tests: the suggestions while editable, the field under readOnly and isDisabled, the address's error, and the barrel serving the two names. NOT RUN (owner's decision, 2026-11-07): this repository cannot install (the root lock fails with ERESOLVE, as every CI run since 2026-09-18), so no test or lint ran; the changed files parse. The pinned render «app path: Form.BusinessInfo (editable, server errors)» (legacyTrees.json) now differs on purpose, the address being the suggestions; it is recaptured when the suite can run again. The test setup is unchanged: the barrel already loads under it (A-3). The app verifies this version once installed (plan phases 3, 4 and 6). Co-Authored-By: Claude Opus 5.5 --- PROJECT.md | 16 +++++-- .../components/__tests__/components.test.js | 3 +- packages/components/package-lock.json | 4 +- packages/components/package.json | 2 +- packages/components/src/Form/Form.stories.js | 12 +++++ .../components/src/Form/FormBusinessInfo.js | 48 +++++++++++++------ .../src/Form/__tests__/Form.test.js | 42 ++++++++++++++-- packages/components/src/index.js | 5 +- packages/components/src/portable.js | 5 ++ 9 files changed, 112 insertions(+), 25 deletions(-) diff --git a/PROJECT.md b/PROJECT.md index 7a9c274f..b6293544 100644 --- a/PROJECT.md +++ b/PROJECT.md @@ -65,9 +65,8 @@ Bigger features are folders with an `index.js` and internal sub-components + hoo 1. `packages/components/src//.js` 2. `packages/components/src//.stories.js` -3. Export it from `packages/components/src/index.js` — otherwise it does not exist for consumers. If it - loads on the web without native modules, export it from `portable.js` too (the guard test will tell you - if it does not). +3. Export it from `packages/components/src/index.js` — otherwise it does not exist for consumers. Nothing new + goes into `portable.js`: it is deprecated since 0.5.5 and removed in 0.6.0 (see "Portable entry"). 4. Add the folder's glob to `.storybook/main.ts` (see "Storybook" below — the web config is a hand-maintained list, not a glob over `src/**`). 5. Any user-facing string goes into **both** `Translations/en.json` and `es.json` via `localized()`. @@ -182,6 +181,12 @@ the components take the result and paint it. ## Portable entry (C-35) and partner components (K-22) — 0.4.0-dev +**Deprecated since 0.5.5, removed in 0.6.0** (owner, 2026-11-07). The web host it was made for (`admin-web`) is +gone, and since B-52 the console mounts the whole app and, with it, the barrel and its web stubs. One entry is the +standard: web differences live in `.web.js` twins, native modules in the host's web stubs. The barrel serves +everything this entry served (`ZOOM` and `useModalFocus` joined it in 0.5.5). `Form.BusinessInfo` asks the store +address with `AutoCompleteInput`, whose library imports the barrel back, so this entry no longer keeps it out. + `src/portable.js` (published as `lib/portable`) is what a **web host** imports: the partner console (`CustomerApp/admin-web`) and the presentational views it borrows from the app. It re-exports only modules that load on react-native-web **without stubs**: List, ScreenWrapper, ChipList, Tabs, @@ -285,6 +290,11 @@ themed through `useTheme()` so a host's theme applies: platform words there. A new partner component joins its `SCOPE`. - Stories register the package catalogue (`registerFlatCatalog({ en: EN, es: ES })`), as a host does. +`Form.BusinessInfo`'s store address (0.5.5, owner 2026-11-07): while the form can be edited it is `AutoCompleteInput` +(Google's suggestions, as the driver's operating address: no GPS button, no «use my location» row), the picked +suggestion's `description` reported as `location` and its server errors listed under it (`FieldErrorText`). The +suggestions have no read-only state, so under `readOnly` or `isDisabled` the address stays the field it was. + Forms (C-25): `Form.PersonInfo`, `Form.VehicleInfo` and `Form.BusinessInfo` take `readOnly` and `highlightFields: string[]` (the names the form reports to `inputActionHandler`), which outlines the field in `primary` and adds a «Changed» helper line (colour alone is not a marker; on a disabled input, where Paper diff --git a/packages/components/__tests__/components.test.js b/packages/components/__tests__/components.test.js index 485a65d6..13c9c9dd 100644 --- a/packages/components/__tests__/components.test.js +++ b/packages/components/__tests__/components.test.js @@ -31,7 +31,8 @@ describe('el barril de componentes', () => { }); it('sirve los nombres que sus consumidores importan', () => { - for (const name of ['List', 'Form', 'VendorList', 'CartList', 'styles']) { + // `ZOOM` and `useModalFocus`: the console's, which only `portable.js` served until 0.5.5. + for (const name of ['List', 'Form', 'VendorList', 'CartList', 'styles', 'ZOOM', 'useModalFocus']) { expect(`${name}:${name in components}`).toBe(`${name}:true`); } }); diff --git a/packages/components/package-lock.json b/packages/components/package-lock.json index 093f6fb4..050c8300 100644 --- a/packages/components/package-lock.json +++ b/packages/components/package-lock.json @@ -1,12 +1,12 @@ { "name": "@jmstechnologiesinc/react-native-components", - "version": "0.5.4", + "version": "0.5.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@jmstechnologiesinc/react-native-components", - "version": "0.5.4", + "version": "0.5.5", "license": "ISC", "devDependencies": { "@jmstechnologiesinc/partner": "0.2.54", diff --git a/packages/components/package.json b/packages/components/package.json index 6e6afe64..b228be14 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -1,6 +1,6 @@ { "name": "@jmstechnologiesinc/react-native-components", - "version": "0.5.4", + "version": "0.5.5", "description": "Biblioteca de componentes de interfaz compartida por las aplicaciones de Daxir.", "author": "yerloveraaa ", "homepage": "https://github.com/jmstechnologiesinc/react-native-components#readme", diff --git a/packages/components/src/Form/Form.stories.js b/packages/components/src/Form/Form.stories.js index d31d0f26..1f3848ee 100644 --- a/packages/components/src/Form/Form.stories.js +++ b/packages/components/src/Form/Form.stories.js @@ -210,6 +210,18 @@ export const BusinessInfoHighlighted = () => ( /> ); +// A store as the console shows it (read-only): the address is a field. While the form can be edited, as above, the +// address is picked from Google's suggestions. +export const BusinessInfoReadOnly = () => ( + {}} + /> +); + // The driver's answers as a reviewer sees them: read-only (no disclosure, the // secrets masked), a changed field marked and a server error under its field. export const DriverInfoReadOnly = () => ( diff --git a/packages/components/src/Form/FormBusinessInfo.js b/packages/components/src/Form/FormBusinessInfo.js index bff71f9d..6944b12d 100644 --- a/packages/components/src/Form/FormBusinessInfo.js +++ b/packages/components/src/Form/FormBusinessInfo.js @@ -5,6 +5,7 @@ import { HelperText, Divider, MD3LightTheme } from '@jmstechnologiesinc/react-na import { VENDOR_INDUSTRIES_MAPPING, VENDOR_INDUSTRIES } from '@jmstechnologiesinc/vendor'; import ScreenWrapper from '../ScreenWrapper'; +import AutoCompleteInput from '../AutoCompleteInput'; import { localized } from '../Localization/Localization'; import OptionPickerActionSheet from '../OptionPicker/OptionPickerActionSheet'; @@ -138,20 +139,39 @@ const FormBusinessInfo = ({ onChangeText={(text) => inputActionHandler('description', text)} /> - - inputActionHandler('location', text)} - /> - + {readOnly || disabled ? ( + + inputActionHandler('location', text)} + /> + + ) : ( + <> + {/* Picked from Google's suggestions, as the driver's operating address is: the server places + it with the same geocoding and refuses one it cannot (owner, 2026-11-07). The suggestions + have no read-only state, so the console (readOnly) and a locked store (isDisabled) keep + the field. */} + inputActionHandler('location', place.description ?? '')} + onClear={() => inputActionHandler('location', '')} + /> + + + )} { expect(drawnAs(render(), values)).toEqual(disabledLines(values)); }); + // Owner, 2026-11-07: the store address is picked from Google's suggestions, as the driver's is. + it('asks the address with the suggestions while editable and reports the picked one as `location`', () => { + const changes = []; + const tree = render( + changes.push([field, value])} /> + ); + const search = tree.root.findByType(AutoCompleteInput); + expect(search.props.value).toBe('1 Main St'); + act(() => search.props.onPress({ description: '2 Elm St, Boston, MA, USA' })); + act(() => search.props.onClear()); + expect(changes).toEqual([ + ['location', '2 Elm St, Boston, MA, USA'], + ['location', ''], + ]); + }); + + it('keeps the address as its field, with no suggestions, under readOnly and under isDisabled', () => { + const readOnly = render(); + const locked = render(); + expect(readOnly.root.findAllByType(AutoCompleteInput)).toHaveLength(0); + expect(locked.root.findAllByType(AutoCompleteInput)).toHaveLength(0); + }); + it('shows the industries as plain chips under readOnly: nothing to pick, remove or open, nothing greyed out', () => { const tree = render(); expect(tree.root.findAllByType(ButtonWrapper)).toHaveLength(0); @@ -305,6 +329,18 @@ describe('server errors on the forms', () => { expect(inError(tree, 'Pasta')).toBe(false); }); + it('shows an error of the store address under its suggestions', () => { + const tree = render( + + ); + const lines = hostOf(tree, 'error.location'); + expect(lines).toHaveLength(1); + expect(textOf(lines[0])).toContain('Address not found'); + }); + it('ignores errors of fields the form does not render', () => { const tree = render( diff --git a/packages/components/src/index.js b/packages/components/src/index.js index 578027ed..322507eb 100644 --- a/packages/components/src/index.js +++ b/packages/components/src/index.js @@ -84,8 +84,11 @@ export { default as DocumentRequirementCard } from './Partner/DocumentRequiremen export { default as DocumentVersionList } from './Partner/DocumentVersionList'; // Contract request #117: the card with its capture; native (the photo picker), so not in portable.js. export { default as DocumentCaptureCard } from './Partner/DocumentCaptureCard'; -export { default as DocumentViewer } from './DocumentViewer/DocumentViewer'; +export { default as DocumentViewer, ZOOM } from './DocumentViewer/DocumentViewer'; export { default as DecisionDialog } from './DecisionDialog/DecisionDialog'; +// The web keyboard contract of a modal surface (focus in, Tab trap, Esc, focus back to the opener); a no-op off the +// web. Until 0.5.5 only `portable.js` served it and `ZOOM`. +export { useModalFocus } from './useModalFocus'; export { default as Timeline } from './Timeline/Timeline'; export { default as StateFlow } from './StateFlow/StateFlow'; export { STATUS_TONES, toneColors } from './tones'; diff --git a/packages/components/src/portable.js b/packages/components/src/portable.js index 28033742..0706d90a 100644 --- a/packages/components/src/portable.js +++ b/packages/components/src/portable.js @@ -1,3 +1,8 @@ +// @deprecated since 0.5.5, removed in 0.6.0: import the package itself. The web hosts mount the whole app, and with +// it the barrel and their web stubs (CustomerApp B-52), so a second entry only splits the forms in two. +// `Form.BusinessInfo` now asks the store address with `AutoCompleteInput`, whose library imports the barrel back: +// this entry no longer keeps the barrel out (its guard's static walk does not follow into that library). +// // C-35 — THE PORTABLE ENTRY: what loads on the web with no stubs. // // The barrel (`index.js`) reaches maps, geolocation, permissions, the image From dfc439362f21d36c219df7872dcb8b29a4eef5d1 Mon Sep 17 00:00:00 2001 From: Joely Date: Sat, 7 Nov 2026 14:59:03 -0500 Subject: [PATCH 3/3] components 0.6.0 (unpublished): one entry; lib/portable removed Owner, 2026-11-07 (plan: retire lib/portable, phase 5). Breaking: hosts import the package itself. CustomerApp stopped importing lib/portable in its phase 3. - src/portable.js and its guard (__tests__/portableEntry.test.js) are gone. ButtonWrapper's test no longer compares the two entries. - PROJECT.md: "One entry (0.6.0)" replaces the portable section: web differences live in .web.js twins, native modules in the host's web stubs, and a host's jest mock must not spread the barrel while it loads (two of its libraries import it back). The other mentions of the portable entry go. NOT RUN: as for 0.5.5, this repository cannot install (root lock ERESOLVE), so no test or lint ran; the changed files parse. Merge after the app's phase 3 is merged; then the owner publishes 0.6.0. Co-Authored-By: Claude Opus 5.5 --- PROJECT.md | 68 ++--- .../__tests__/portableEntry.test.js | 255 ------------------ packages/components/package-lock.json | 4 +- packages/components/package.json | 2 +- .../__tests__/ButtonWrapper.test.js | 7 +- .../components/src/Form/FormSelectField.js | 2 +- packages/components/src/Layout/index.js | 2 +- .../src/Partner/DocumentCaptureCard.js | 2 +- packages/components/src/index.js | 12 +- packages/components/src/portable.js | 163 ----------- 10 files changed, 42 insertions(+), 475 deletions(-) delete mode 100644 packages/components/__tests__/portableEntry.test.js delete mode 100644 packages/components/src/portable.js diff --git a/PROJECT.md b/PROJECT.md index b6293544..66665026 100644 --- a/PROJECT.md +++ b/PROJECT.md @@ -43,7 +43,6 @@ change would break a consumer, stop and ask (§9). ``` packages/components/src/ index.js THE public API — the single barrel. Nothing is public unless exported here. - portable.js the web-safe subset of the barrel (C-35), for web hosts — see "Portable entry" styles.js shared style objects built from MD3LightTheme tokens tones.js status tones (success/warning/danger/neutral/info) -> theme roles + icons consts.js shared constants (LAYOUT_MODE, …) @@ -65,8 +64,8 @@ Bigger features are folders with an `index.js` and internal sub-components + hoo 1. `packages/components/src//.js` 2. `packages/components/src//.stories.js` -3. Export it from `packages/components/src/index.js` — otherwise it does not exist for consumers. Nothing new - goes into `portable.js`: it is deprecated since 0.5.5 and removed in 0.6.0 (see "Portable entry"). +3. Export it from `packages/components/src/index.js` — otherwise it does not exist for consumers. It is the + package's only entry (see "One entry"). 4. Add the folder's glob to `.storybook/main.ts` (see "Storybook" below — the web config is a hand-maintained list, not a glob over `src/**`). 5. Any user-facing string goes into **both** `Translations/en.json` and `es.json` via `localized()`. @@ -146,7 +145,7 @@ Since **0.4.0** (C-25): i18next as a resource bundle, so `react-i18next` readers see it. `%{}` interpolates as everywhere. - **`currentLocale()`** is exported by both twins; `format.js` reads it. It used to read `i18n-js` directly, so on the web every date was formatted in `en`. -- `merge` (deep merge of nested catalogues) is exported from the barrel and the portable entry. +- `merge` (deep merge of nested catalogues) is exported from the barrel. `Localization.web.js` is the web twin, and as of 0.2.0 it really is one: same loader, same `%{}` placeholder syntax (i18next's default `{{}}` would have shown narration placeholders raw), same @@ -179,35 +178,27 @@ the components take the result and paint it. `file:` until 0.2.0 is published, then `^0.2.0`. `Order/__tests__/d50.test.js` keeps every legacy reference contained inside it and fails if one appears anywhere else — or if that file stops being the legacy table. -## Portable entry (C-35) and partner components (K-22) — 0.4.0-dev - -**Deprecated since 0.5.5, removed in 0.6.0** (owner, 2026-11-07). The web host it was made for (`admin-web`) is -gone, and since B-52 the console mounts the whole app and, with it, the barrel and its web stubs. One entry is the -standard: web differences live in `.web.js` twins, native modules in the host's web stubs. The barrel serves -everything this entry served (`ZOOM` and `useModalFocus` joined it in 0.5.5). `Form.BusinessInfo` asks the store -address with `AutoCompleteInput`, whose library imports the barrel back, so this entry no longer keeps it out. - -`src/portable.js` (published as `lib/portable`) is what a **web host** imports: the partner console -(`CustomerApp/admin-web`) and the presentational views it borrows from the app. It re-exports only -modules that load on react-native-web **without stubs**: List, ScreenWrapper, ChipList, Tabs, -SegmentedButtonGroup, ActionGroup, SideNav, TouchableRippleWrapper, TN*, `ButtonWrapper`, -`PhotoGalleryDisplay`, `styles`, `LAYOUT_MODE`, a `Form` subset (PersonInfo, VehicleInfo, -BusinessInfo, DriverInfo, EmailPassword, SecretInputText), `StripeForm.AccountBank`, Localization (`localized`, -`setI18nConfig`, `registerFlatCatalog`, `currentLocale`, `merge`), the formatters, the Order and Partner view -models, the K-22 components and the generic web-host UI (next section). `ImagePicker` is **not** portable (picker, permissions, draggable list): a web host shows -photos with `PhotoGalleryDisplay` and the app injects the picker. - -- `packages/components/__tests__/portableEntry.test.js` walks its static import graph the way a web - bundler does (`.web.js` first) and fails if a native-only module becomes reachable (react-native-config, - dotenv, localize, image picker, action sheet, permissions, geolocation, gesture handler, reanimated, - draggable list, mapbox, bottom sheets, centrifuge) — or the package's own name, which drags the barrel in. +## One entry (0.6.0) and partner components (K-22) + +The package has **one entry**, `index.js` (the barrel), as React Native and its web toolchains expect (owner, +2026-11-07). `lib/portable`, the web-safe subset served from C-35 (0.4.0) to 0.5.5, was removed in 0.6.0: the web +host it was made for (`admin-web`) is gone, and since B-52 the console mounts the whole app and, with it, the barrel. +How the barrel runs on the web: + +- **Web differences live in `.web.js` twins** inside this package (`Config`, `Localization`, `MapboxGLWrapper`, + `OptionPicker/OptionSheet`); a web bundler resolves them first. +- **Native modules a web bundle cannot load are the host's web stubs** (CustomerApp `web-stubs/`: + `react-native-config`, the map wrapper's override, `navigator.geolocation`), applied only on the web. - **`Config.web.js`**: on the web the host calls `configureComponents({ IMAGEKIT_URL, … })` once before rendering. Native `Config.js` exports the same function (merge, no behaviour change). - **Never import this package by its published name from inside it**, and import `../ScreenWrapper` (the index that attaches `.Section`/`.Container`), not `../ScreenWrapper/ScreenWrapper`. - `OptionPicker/OptionSheet.js` is the native action sheet; `OptionSheet.web.js` is a Paper modal with the same `show()`/`hide()` ref, which is what lets `Form.BusinessInfo` load on the web. -- `lib/*` deep imports keep working; there is deliberately no `exports` map yet. +- `lib/*` deep imports keep working; there is deliberately no `exports` map yet. Hosts import the package itself. +- Two of its libraries, the phone input and the places autocomplete, import the package back by name. A host's jest + mock that spreads the real barrel runs again while the barrel loads (CustomerApp `src/testUtils/actualModuleWith.js` + shows the way around it). K-22 components (APIs frozen in `CustomerApp/admin-web/docs/ARCHITECTURE.md` §5), RN primitives + Paper, themed through `useTheme()` so a host's theme applies: @@ -220,7 +211,7 @@ themed through `useTheme()` so a host's theme applies: - `Timeline` — `history` and `steps`. - Document requirements (contract request #117, 0.5.4), fed by a `getMyStatus` checklist item, so no host keeps a document type of its own: - - `Partner/DocumentRequirementCard` (portable) — a Paper `Card` composed as Paper composes one: the title is + - `Partner/DocumentRequirementCard` — a Paper `Card` composed as Paper composes one: the title is `requirementTitle(item)` (the rule's name for the market, else the catalogue's), `subtitle` is the host's, then, in its `Card.Content`, `covers` (the photos taken and not sent, in order, each `{ uri, label }` with the name a screen reader says), `note` and the rule's explanation, and `actions` @@ -230,7 +221,7 @@ themed through `useTheme()` so a host's theme applies: `aria-live`) that stays mounted, so a screen reader announces each next step. `Card.Actions` gets, through its `style`, `flexWrap` and a `spacing.x2` row gap (it does not wrap by itself; its alignment and padding stay), and its buttons are keyed by position, as `Card.Actions` itself tells them apart (a label changes as photos are taken). - - `Partner/DocumentCovers` (portable, not exported) — the card's photos: one is a `Card.Cover`; more are a + - `Partner/DocumentCovers` (not exported) — the card's photos: one is a `Card.Cover`; more are a Material 3 hero carousel (a horizontal `ScrollView`: `snapToInterval` on the phone, `pagingEnabled`'s CSS scroll snap on the web; items `spacing.x2` apart, the next peeking `spacing.x14`, Material's 8 dp and 56 dp), or all whole side by side where the measured width fits them at Material's largest large item (twice the cover's height, which @@ -241,12 +232,12 @@ themed through `useTheme()` so a host's theme applies: the safe-area insets; the internal `SheetHeader` with its `global.close`) on that page, with the document's sides (the covers' labels) when there are two. testIDs: `-covers`, `-carousel`, `-cover-`, `-viewer`, `-viewer-header-close`, `-viewer-document`. - - `Partner/DocumentVersionList` (portable) — `item.versions` as `ListRow`s from `documentVersionRows`; they open + - `Partner/DocumentVersionList` — `item.versions` as `ListRow`s from `documentVersionRows`; they open nothing, so no chevron. A row's description: when it was sent, the scan's catalogue label while the scan is not `SCAN_STATUS.CLEAN` (pending, and partner 0.2.54's infected, never spelled here), the details code's label, and `documentExpiresOn` («Expires Nov 23, 2026»): `expires_at` is a calendar day, formatted by `formatDateTime` in UTC so no reader's zone moves it. `documentExpires` stays for the app's older list. - - `Partner/DocumentCaptureCard` (barrel only: the picker is native) — the card with the way to send it, as + - `Partner/DocumentCaptureCard` (native: the picker) — the card with the way to send it, as `item.capture` says (`pages` 1, or 2 = the front then the back). Controlled: `{ item, subtitle?, pages = [], onPagesChange(pages), onSend(), isSending = false, testID = 'document-requirement' }` — the host owns the pages (the picker's assets, in order) and clears them only once its send succeeded, so a failed send keeps them; the @@ -275,7 +266,7 @@ themed through `useTheme()` so a host's theme applies: `documentExpiresOn`) live in `Translations/*.json`, in the catalogue's «Agregar»; the stories (`Partner/DocumentRequirement.stories.js`) use the local circuit's real items, and render the capture card itself with `pages` for the photo states. -- `Partner/viewModel.js` (barrel/portable: `PartnerViewModel`, because `statusLabel` is the Order one): +- `Partner/viewModel.js` (barrel: `PartnerViewModel`, because `statusLabel` is the Order one): the key is the package's `statusLabelKey(group, value)` resolved with `localized`; a value outside the vocabulary, or a key the registered catalogue lacks, renders the raw value. Each kind's group is read from the package's `LABEL_GROUPS` (never spelled here). `TONE_BY_KIND` and `INTENT_PRESENTATION` stay @@ -330,13 +321,13 @@ does not render are ignored, and the forms' own required messages are unchanged. makes, models }` (each `Array<{ value, label }>`, labelled by the host) plus `vehicleType`, `makeId`, `modelId`, `licensePlateRegion` and `vin`, it renders the market schema in canon §9.15's order (type → year → make → model, color, plate, plate region, optional VIN) with `Form/FormSelectField.js` (an outlined input that -opens a Paper `Menu`, portable). A make or model pick reports its id and its name (`makeId` + `make`); with no +opens a Paper `Menu`, web-safe). A make or model pick reports its id and its name (`makeId` + `make`); with no `makes`/`models` (no catalogue slice for that type and year) they stay typed text. Without `catalog` the form is the tree it always was, pinned by `legacyRendering.test.js` (`Form.VehicleInfo (vehicle form)`, captured from `admin-app` @ 516446e). `PhotoGalleryDisplay({ photoUrls, title?, emptyLabel?, highlighted?, size?, testID? })` -(`ImagePicker/PhotoGalleryDisplay.js`, barrel and portable): **resolved** URIs, never rewritten; a horizontal +(`ImagePicker/PhotoGalleryDisplay.js`): **resolved** URIs, never rewritten; a horizontal strip of RN `Image`s, each labelled «Photo i of n» (`global.photoOf`); `global.noPhotos` when empty or all blank; `title` defaults to `photos` (`null` hides it); `highlighted` adds the «Changed» line. testIDs: `` (the strip), `.photo.`, `.empty`; `testID` defaults to `photo-gallery`. @@ -377,7 +368,7 @@ re-renders the existing consumers' props (CustomerApp's `drawerSideNav` and `Inv ## Generic UI for web hosts — 0.4.0-dev The partner console's generic UI (`CustomerApp/admin-web/src/ui`) lives here now, for the console and the -AdminApp port alike. Every piece is in the barrel **and** `portable.js`, one folder per component, JS, themed +AdminApp port alike. Every piece is in the barrel, one folder per component, JS, themed through `useTheme()` (a host theme's roles apply) and built on Paper components **as they are**: no hand-made copy of a Paper component, even to work around a web accessibility quirk — those are recorded below as Paper fork items. Labels come by props, with `global.*` defaults of this library's catalogue (never `partner.*`). @@ -523,14 +514,13 @@ consumers must have this package inside their Metro/Babel transform path. Conseq `@jmstechnologiesinc/react-native-paper`, `@react-navigation/elements`, `@jmstechnologiesinc/order`, `@jmstechnologiesinc/order-narration` and `@jmstechnologiesinc/partner` — the last pinned **exactly** (canon R4; also a devDependency), because the view model and its tests read its vocabulary, and - both the barrel and the portable entry import `Partner/viewModel`. The harness links the main checkout's + the barrel imports `Partner/viewModel`. The harness links the main checkout's root `node_modules`, which does not carry it; in a worktree it is unpacked into `packages/components/node_modules` (`npm pack @jmstechnologiesinc/partner@` + extract), where Jest resolves it with no `moduleNameMapper`. The barrel additionally expects the host to provide what the app already has (`centrifuge`, `react-native-gesture-handler`, `react-native-reanimated`, - `react-native-vector-icons`, …); the portable entry needs only `react-native-safe-area-context`, - `react-native-vector-icons`, `color`, `@jmstechnologiesinc/commons`/`vendor`/`react-native-size-matters` and, on - the web, `i18next`, `i18next-browser-languagedetector` and `react-i18next`. All of them are now declared + `react-native-vector-icons`, …) and, on the web, `i18next`, `i18next-browser-languagedetector` and + `react-i18next`. All of them are now declared as peers (C-35, 2026-10-03): every package `lib/` imports, at the range CustomerApp declares (so the main host never conflicts). The commented-out `expo-blur` and `showcase-template` are not. `partner` is a peer at **^0.2.33** (0.4.3, owner 2026-10-04: an exact pin refused every contract patch the app installs, B-8) and a diff --git a/packages/components/__tests__/portableEntry.test.js b/packages/components/__tests__/portableEntry.test.js deleted file mode 100644 index 668b2b49..00000000 --- a/packages/components/__tests__/portableEntry.test.js +++ /dev/null @@ -1,255 +0,0 @@ -'use strict'; - -/* C-35 — THE PORTABLE ENTRY LOADS ON THE WEB WITHOUT STUBS. - * - * A web bundler resolves a module's `.web.js` twin before the module itself. - * This walks the STATIC import graph of `src/portable.js` the same way and - * fails if any module on the list below becomes reachable: each one either - * throws when a web bundle evaluates it (a TurboModule react-native-web does not - * provide) or needs a Babel plugin a host bundler does not run. The graph is - * this package's own source; a bare import is checked by package name and not - * followed. - */ - -const fs = require('fs'); -const path = require('path'); -const { parse } = require('@babel/parser'); - -const SRC = path.resolve(__dirname, '../src'); -const ENTRY = path.join(SRC, 'portable.js'); - -const FORBIDDEN = [ - 'react-native-config', - 'react-native-dotenv', - 'react-native-localize', - 'react-native-image-picker', - 'react-native-actions-sheet', - 'react-native-permissions', - 'react-native-geolocation-service', - 'react-native-gesture-handler', - 'react-native-reanimated', - 'react-native-draggable-flatlist', - '@rnmapbox/maps', - 'mapbox-gl', - 'react-map-gl', - '@gorhom/bottom-sheet', - '@jmstechnologiesinc/bottom-sheet', - 'centrifuge', - // Importing the package by its own name drags the whole barrel back in. - '@jmstechnologiesinc/react-native-components', -]; - -const packageOf = (specifier) => { - const parts = specifier.split('/'); - return specifier.startsWith('@') ? parts.slice(0, 2).join('/') : parts[0]; -}; - -const resolveRelative = (from, specifier) => { - const base = path.resolve(path.dirname(from), specifier); - const candidates = [ - `${base}.web.js`, - `${base}.js`, - path.join(base, 'index.web.js'), - path.join(base, 'index.js'), - base, - ]; - const found = candidates.find((file) => fs.existsSync(file) && fs.statSync(file).isFile()); - if (!found) throw new Error(`cannot resolve ${specifier} from ${path.relative(SRC, from)}`); - return found; -}; - -const specifiersOf = (file) => { - const ast = parse(fs.readFileSync(file, 'utf8'), { sourceType: 'module', plugins: ['jsx'] }); - const found = []; - const visit = (node) => { - if (!node || typeof node.type !== 'string') return; - if ( - (node.type === 'ImportDeclaration' || - node.type === 'ExportNamedDeclaration' || - node.type === 'ExportAllDeclaration') && - node.source - ) { - found.push(node.source.value); - } - if ( - node.type === 'CallExpression' && - ((node.callee.type === 'Identifier' && node.callee.name === 'require') || node.callee.type === 'Import') && - node.arguments[0]?.type === 'StringLiteral' - ) { - found.push(node.arguments[0].value); - } - for (const value of Object.values(node)) { - if (Array.isArray(value)) value.forEach(visit); - else if (value && typeof value === 'object' && value.type) visit(value); - } - }; - visit(ast.program); - return found; -}; - -// file -> [the chain of files that reached it], so a failure names its path. -const walk = () => { - const reached = new Map([[ENTRY, [ENTRY]]]); - const packages = new Map(); - const queue = [ENTRY]; - while (queue.length) { - const file = queue.shift(); - if (!file.endsWith('.js')) continue; - for (const specifier of specifiersOf(file)) { - if (specifier.startsWith('.')) { - const target = resolveRelative(file, specifier); - if (!reached.has(target)) { - reached.set(target, [...reached.get(file), target]); - queue.push(target); - } - } else if (!packages.has(packageOf(specifier))) { - packages.set(packageOf(specifier), reached.get(file)); - } - } - } - return { reached, packages }; -}; - -const { reached, packages } = walk(); -const relative = (file) => path.relative(SRC, file); - -describe('the portable entry (C-35)', () => { - it.each(FORBIDDEN)('never reaches %s', (name) => { - const chain = packages.get(name); - expect(chain ? `${name} via ${chain.map(relative).join(' -> ')}` : null).toBeNull(); - }); - - it('takes the web twins, as a web bundler would', () => { - const files = [...reached.keys()].map(relative); - expect(files).toEqual( - expect.arrayContaining([ - 'Config.web.js', - 'Localization/Localization.web.js', - 'OptionPicker/OptionSheet.web.js', - ]) - ); - expect(files).not.toContain('Config.js'); - expect(files).not.toContain('Localization/Localization.js'); - expect(files).not.toContain('index.js'); - // The display-only gallery is portable; the picker namespace is not. - expect(files).toContain('ImagePicker/PhotoGalleryDisplay.js'); - expect(files).not.toContain('ImagePicker/ImagePickerAvatar.js'); - expect(files).not.toContain('ImagePicker/ImagePicker.js'); - expect(files).not.toContain('ImagePicker/PhotoGallery.js'); - // The address rows are portable; the map picker and geolocation behind the Geoposition index are not. - expect(files).toContain('Geoposition/RecentLocations.js'); - expect(files).not.toContain('Geoposition/index.js'); - expect(files).not.toContain('Geoposition/MapPicker/index.js'); - }); - - it('loads under Jest and serves what the web host imports', () => { - const portable = require('../src/portable'); - const expected = [ - 'List', - 'ScreenWrapper', - 'ChipList', - 'Tabs', - 'SegmentedButtonGroup', - 'ActionGroup', - 'SideNav', - 'TouchableRippleWrapper', - 'TNActivityIndicator', - 'TNEmptyStateView', - 'styles', - 'LAYOUT_MODE', - 'configureComponents', - 'Form', - 'StripeForm', - 'localized', - 'setI18nConfig', - 'registerFlatCatalog', - 'currentLocale', - 'merge', - 'formatDateTime', - 'formatTime', - 'formatRelativeTime', - 'orderViewModel', - 'statusLabel', - 'PartnerViewModel', - 'StatusChip', - 'SlaChip', - 'DocumentViewer', - 'ZOOM', - 'DecisionDialog', - 'useModalFocus', - 'Timeline', - 'ButtonWrapper', - 'PhotoGalleryDisplay', - // The console's generic UI, moved here (0.4.0-dev). - 'LAYOUT', - 'PANE', - 'SIZE_CLASS', - 'SUPPORTING_MODE', - 'paneMetrics', - 'sizeClassOf', - 'tokenScale', - 'useWindowSizeClass', - 'paneArrangement', - 'usePaneContext', - 'PaneLayout', - 'Pane', - 'PaneHeader', - 'PaneFooter', - 'BottomSheet', - 'SectionCard', - 'KeyValueList', - 'ListRow', - 'iconSlot', - 'nodeSlot', - 'MutedText', - 'EmptyState', - 'LoadingState', - 'ErrorState', - 'DataTableView', - 'SORT_DIRECTION', - 'sortRows', - 'CodeBlock', - 'NoteField', - 'CheckboxListField', - 'FilterChips', - 'StatusBanner', - 'ChangedHelperText', - 'FieldErrorText', - 'FieldErrorList', - 'useNow', - 'valueText', - 'formatCalendarDate', - 'parseCalendarDate', - 'formatDateInput', - 'parseDateInput', - 'parseDay', - 'isBlankDay', - // The account projection's views (Payouts, Addresses). - 'Accounting', - 'LOCATION_LIST_ITEM', - 'LOCATION_LIST_ITEM_MAPPING', - 'interpunctLocationListItemDescription', - 'LocationListItem', - 'RecentLocations', - ]; - expect(expected.filter((name) => portable[name] === undefined)).toEqual([]); - // Not public: nothing used them (the rail is `SideNav variant="rail"`, the app's snackbar is its own) or they - // are the scaffold's own pieces (the side sheet and the sheets' header). - const retired = [ - 'SideSheet', - 'SheetHeader', - 'NavigationRail', - 'SnackbarProvider', - 'useSnackbar', - 'RadioGroupField', - 'AvatarDisplay', - ]; - expect(retired.filter((name) => portable[name] !== undefined)).toEqual([]); - expect(Object.keys(portable.Form).sort()).toEqual( - ['BusinessInfo', 'DriverInfo', 'EmailPassword', 'PersonInfo', 'SecretInputText', 'VehicleInfo'].sort() - ); - expect(Object.keys(portable.StripeForm).sort()).toEqual(['AccountBank', 'PaymentFrequency']); - expect(typeof portable.ScreenWrapper.Section).toBe('function'); - expect(typeof portable.Tabs.Bar).toBe('function'); - }); -}); diff --git a/packages/components/package-lock.json b/packages/components/package-lock.json index 050c8300..f9312ac8 100644 --- a/packages/components/package-lock.json +++ b/packages/components/package-lock.json @@ -1,12 +1,12 @@ { "name": "@jmstechnologiesinc/react-native-components", - "version": "0.5.5", + "version": "0.6.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@jmstechnologiesinc/react-native-components", - "version": "0.5.5", + "version": "0.6.0", "license": "ISC", "devDependencies": { "@jmstechnologiesinc/partner": "0.2.54", diff --git a/packages/components/package.json b/packages/components/package.json index b228be14..d572fff8 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -1,6 +1,6 @@ { "name": "@jmstechnologiesinc/react-native-components", - "version": "0.5.5", + "version": "0.6.0", "description": "Biblioteca de componentes de interfaz compartida por las aplicaciones de Daxir.", "author": "yerloveraaa ", "homepage": "https://github.com/jmstechnologiesinc/react-native-components#readme", diff --git a/packages/components/src/ButtonWrapper/__tests__/ButtonWrapper.test.js b/packages/components/src/ButtonWrapper/__tests__/ButtonWrapper.test.js index abfeed64..d6547ea7 100644 --- a/packages/components/src/ButtonWrapper/__tests__/ButtonWrapper.test.js +++ b/packages/components/src/ButtonWrapper/__tests__/ButtonWrapper.test.js @@ -1,11 +1,10 @@ -// C-35 — `ButtonWrapper` is Paper only, so the portable entry serves it. +// C-35 — `ButtonWrapper` is Paper only. import React from 'react'; import renderer, { act } from 'react-test-renderer'; import { MD3LightTheme, Provider } from '@jmstechnologiesinc/react-native-paper'; import ButtonWrapper from '../ButtonWrapper'; -import { ButtonWrapper as PortableButtonWrapper } from '../../portable'; jest.useFakeTimers(); @@ -30,10 +29,6 @@ afterEach(() => { const buttonOf = (tree) => tree.root.findAll((node) => node.props.accessibilityRole === 'button')[0]; describe('ButtonWrapper', () => { - it('is the same component in the portable entry', () => { - expect(PortableButtonWrapper).toBe(ButtonWrapper); - }); - it('renders its title and calls onPress', () => { const onPress = jest.fn(); const tree = render(); diff --git a/packages/components/src/Form/FormSelectField.js b/packages/components/src/Form/FormSelectField.js index ed732235..2cd2639a 100644 --- a/packages/components/src/Form/FormSelectField.js +++ b/packages/components/src/Form/FormSelectField.js @@ -7,7 +7,7 @@ import FormField from './FormField'; /** * A form field whose value is picked from the host's options (C-22): the outlined input the other fields use, - * opening a Paper `Menu` (portable, so the console renders it on the web too). The options are the host's — the + * opening a Paper `Menu` (web-safe, so the console renders it on the web too). The options are the host's — the * catalogue, the package's vocabulary — and choosing one only reports it; nothing is validated here (K-32). * * `displayValue` is shown when `value` is not among the options (a stored make the current catalogue slice no diff --git a/packages/components/src/Layout/index.js b/packages/components/src/Layout/index.js index a1d2176e..8af1ecc0 100644 --- a/packages/components/src/Layout/index.js +++ b/packages/components/src/Layout/index.js @@ -1,7 +1,7 @@ // The MD3 pane system: window size classes, the collapse table, the pane // scaffold and its pieces, and the bottom sheet a host opens itself. The side // sheet and the sheets' header are the scaffold's own (PaneLayout, BottomSheet); -// the rail is `SideNav variant="rail"`. Portable +// the rail is `SideNav variant="rail"`. Web-safe // (react-native-web without stubs) and themed through `useTheme()`; every size // is a token of the theme in use (`metrics.js`). export { diff --git a/packages/components/src/Partner/DocumentCaptureCard.js b/packages/components/src/Partner/DocumentCaptureCard.js index d13610a8..ca89ecea 100644 --- a/packages/components/src/Partner/DocumentCaptureCard.js +++ b/packages/components/src/Partner/DocumentCaptureCard.js @@ -30,7 +30,7 @@ const DOCUMENT_CAPTURE_OPTIONS = Object.freeze({ * card's covers (both sides in a carousel, owner 2026-11-04), and «Send to review» sends them once every page is * there. The card only sends (owner, 2026-11-04): it says nothing of where the requirement stands, which its versions * and its row in the lists say. The photo sheet is the library's picker, opened by the card's own button - * (`variant="sheet"`). Not portable: the picker is native. + * (`variant="sheet"`). Native: the picker. * * Controlled: the host owns `pages` (the picker's assets, in order) and gets each change through * `onPagesChange(pages)`. «Send to review» calls `onSend()`; the card never clears the pages itself, so a send that diff --git a/packages/components/src/index.js b/packages/components/src/index.js index 322507eb..691026a8 100644 --- a/packages/components/src/index.js +++ b/packages/components/src/index.js @@ -46,7 +46,7 @@ export { default as SwipeToDelete } from './SwipeToDelete/SwipeToDelete'; export { default as SideNav } from './SideNav/SideNav'; export { default as Swipeable } from './SwipeToDelete/SwipeToDelete'; export { default as ButtonWrapper } from './ButtonWrapper/ButtonWrapper'; -// C-35 — the display-only gallery (resolved URIs, no picker); also in `portable.js`. +// C-35 — the display-only gallery (resolved URIs, no picker). export { default as PhotoGalleryDisplay } from './ImagePicker/PhotoGalleryDisplay'; export { makeLinkingCall, @@ -77,17 +77,17 @@ export { merge } from './Localization/catalog'; export { formatDateTime, formatTime, formatRelativeTime } from './Localization/format'; export { localizedAuthError } from './Localization/authErrors'; -// K-22 — also served by `portable.js`, the entry a web host imports. +// K-22 — the partner components. export { default as StatusChip, SlaChip, LabelChip } from './Partner/StatusChip'; export { default as RuleClauseList } from './Partner/RuleClauseList'; export { default as DocumentRequirementCard } from './Partner/DocumentRequirementCard'; export { default as DocumentVersionList } from './Partner/DocumentVersionList'; -// Contract request #117: the card with its capture; native (the photo picker), so not in portable.js. +// Contract request #117: the card with its capture (native: the photo picker). export { default as DocumentCaptureCard } from './Partner/DocumentCaptureCard'; export { default as DocumentViewer, ZOOM } from './DocumentViewer/DocumentViewer'; export { default as DecisionDialog } from './DecisionDialog/DecisionDialog'; // The web keyboard contract of a modal surface (focus in, Tab trap, Esc, focus back to the opener); a no-op off the -// web. Until 0.5.5 only `portable.js` served it and `ZOOM`. +// web. export { useModalFocus } from './useModalFocus'; export { default as Timeline } from './Timeline/Timeline'; export { default as StateFlow } from './StateFlow/StateFlow'; @@ -95,8 +95,8 @@ export { STATUS_TONES, toneColors } from './tones'; // The generic UI of a web host (the partner console, the admin app), moved // here from the console: the MD3 pane system, data display and feedback, -// fields and utilities. Portable, themed through `useTheme()`, labels by props -// with `global.*` defaults. Also served by `portable.js`. +// fields and utilities. Themed through `useTheme()`, labels by props with +// `global.*` defaults. export { BOTTOM_SHEET_MAX_HEIGHT, LAYOUT, diff --git a/packages/components/src/portable.js b/packages/components/src/portable.js deleted file mode 100644 index 0706d90a..00000000 --- a/packages/components/src/portable.js +++ /dev/null @@ -1,163 +0,0 @@ -// @deprecated since 0.5.5, removed in 0.6.0: import the package itself. The web hosts mount the whole app, and with -// it the barrel and their web stubs (CustomerApp B-52), so a second entry only splits the forms in two. -// `Form.BusinessInfo` now asks the store address with `AutoCompleteInput`, whose library imports the barrel back: -// this entry no longer keeps the barrel out (its guard's static walk does not follow into that library). -// -// C-35 — THE PORTABLE ENTRY: what loads on the web with no stubs. -// -// The barrel (`index.js`) reaches maps, geolocation, permissions, the image -// picker, action and bottom sheets, gesture and animation libraries and the -// real-time client, none of which a web bundle can load. A web host — the -// partner console, the presentational views it borrows from the app (canon -// §17.6) — imports `lib/portable` instead and gets only what runs on -// react-native-web. `__tests__/portableEntry.test.js` walks this file's import -// graph the way a web bundler does (`.web.js` first) and fails if a native-only -// module becomes reachable. -// -// On the web the host configures the library at runtime with -// `configureComponents` (see `Config.web.js`) and registers the partner -// catalogue with `registerFlatCatalog`. -import * as List from './List/List'; -import * as Tabs from './Tabs/Tabs'; -import * as ActionGroup from './ActionGroup/ActionGroup'; -import * as PartnerViewModel from './Partner/viewModel'; -import FormPersonInfo from './Form/FormPersonInfo'; -import FormVehicleInfo from './Form/FormVehicleInfo'; -import FormBusinessInfo from './Form/FormBusinessInfo'; -import FormDriverInfo from './Form/FormDriverInfo'; -import FormEmailPassword from './Form/FormEmailPassword'; -import SecretInputText from './Form/SecretInputText'; -import StripeFormAccountBank from './StripeForm/StripeFormAccountBank'; -import StripeFormPaymentFrequency from './StripeForm/StripeFormPaymentFrequency'; - -// The forms the web needs (canon §17.4, §17.6); `DriverInfo` shows a driver's -// answers read-only in the admin app. `Form.PhoneNumber` stays in the barrel -// because its phone-input library imports this package's barrel back; the -// others are not used by any partner view. -const Form = Object.freeze({ - PersonInfo: FormPersonInfo, - VehicleInfo: FormVehicleInfo, - BusinessInfo: FormBusinessInfo, - DriverInfo: FormDriverInfo, - EmailPassword: FormEmailPassword, - SecretInputText, -}); - -// `PaymentFrequency` shows a payout interval (read-only in the console's -// payouts section). -const StripeForm = Object.freeze({ - AccountBank: StripeFormAccountBank, - PaymentFrequency: StripeFormPaymentFrequency, -}); - -export { List, Tabs, ActionGroup, Form, StripeForm, PartnerViewModel }; - -export { default as styles } from './styles'; -export { LAYOUT_MODE } from './consts'; -export { configureComponents } from './Config'; - -export { default as ScreenWrapper } from './ScreenWrapper'; -export { default as ChipList } from './ChipList/ChipList'; -export { default as SegmentedButtonGroup } from './SegmentedButtonGroup/SegmentedButtonGroup'; -export { default as SideNav } from './SideNav/SideNav'; -export { default as TouchableRippleWrapper } from './TouchableRippleWrapper/TouchableRippleWrapper'; -export { default as TNActivityIndicator } from './truly-native/TNActivityIndicator'; -export { default as TNEmptyStateView } from './truly-native/TNEmptyStateView'; -// Paper only: the app's «add» text button. -export { default as ButtonWrapper } from './ButtonWrapper/ButtonWrapper'; -// The photos of a gallery, display only. `ImagePicker` itself (picker, -// permissions, draggable list) stays native: the host injects it. -export { default as PhotoGalleryDisplay } from './ImagePicker/PhotoGalleryDisplay'; - -export { localized, setI18nConfig, registerFlatCatalog, currentLocale } from './Localization/Localization'; -export { merge } from './Localization/catalog'; -export { formatDateTime, formatTime, formatRelativeTime } from './Localization/format'; - -export { orderViewModel, fromDescriptor, statusLabel } from './Order/viewModel'; - -// K-22 -export { default as StatusChip, SlaChip, LabelChip } from './Partner/StatusChip'; -export { default as RuleClauseList } from './Partner/RuleClauseList'; -// Contract request #117: a document requirement and its versions, read-only (the capture card is native). -export { default as DocumentRequirementCard } from './Partner/DocumentRequirementCard'; -export { default as DocumentVersionList } from './Partner/DocumentVersionList'; -export { default as DocumentViewer, ZOOM } from './DocumentViewer/DocumentViewer'; -export { default as DecisionDialog } from './DecisionDialog/DecisionDialog'; -// The web keyboard contract of a modal surface (focus in, Tab trap, Esc, -// focus back to the opener); DecisionDialog uses it, and a host's own sheets -// and dialogs share it. A no-op off the web. -export { useModalFocus } from './useModalFocus'; -export { default as Timeline } from './Timeline/Timeline'; -export { default as StateFlow } from './StateFlow/StateFlow'; -export { STATUS_TONES, toneColors } from './tones'; - -// The generic UI of a web host (the partner console, the admin app), moved -// here from the console: the MD3 pane system, data display and feedback, -// fields and utilities. Portable, themed through `useTheme()`, labels by props -// with `global.*` defaults. Also served by `portable.js`. -export { - BOTTOM_SHEET_MAX_HEIGHT, - LAYOUT, - PANE, - SIZE_CLASS, - SIZE_CLASS_BREAKPOINTS, - SUPPORTING_MODE, - paneMetrics, - sizeClassOf, - tokenScale, - usePaneMetrics, - useWindowSizeClass, - paneArrangement, - usePaneContext, - PaneLayout, - ListDetail, - fitsListDetail, - Breadcrumbs, - Pane, - PaneHeader, - PaneFooter, - footerButtons, - BottomSheet, -} from './Layout'; -export { default as SectionCard } from './SectionCard/SectionCard'; -export { default as KeyValueList } from './KeyValueList/KeyValueList'; -export { default as ListRow } from './ListRow/ListRow'; -export { default as ChipRow } from './ChipRow/ChipRow'; -export { iconSlot, nodeSlot } from './ListRow/listSlots'; -export { default as MutedText } from './MutedText/MutedText'; -export { EmptyState, LoadingState, ErrorState } from './States/States'; -export { default as DataTableView, SORT_DIRECTION, SORT_MODE, sortRows, nextSort } from './DataTableView/DataTableView'; -export { default as DataTableList } from './DataTableView/DataTableList'; -export { default as CodeBlock, codeText } from './CodeBlock/CodeBlock'; -export { default as NoteField } from './NoteField/NoteField'; -export { default as CheckboxListField } from './CheckboxListField/CheckboxListField'; -export { default as FilterChips } from './FilterChips/FilterChips'; -export { default as StatusBanner } from './StatusBanner/StatusBanner'; -// A filter chip whose single choice opens in a menu (the partner directory's filters, 2026-10-09). -export { default as MenuFilterChip } from './MenuFilterChip/MenuFilterChip'; -export { ChangedHelperText, FieldErrorText, FieldErrorList } from './Form/FormField'; -export { useNow } from './useNow'; -export { valueText, EMPTY_VALUE } from './valueText'; -export { - DATE_PATTERN, - DATE_TIME_PATTERN, - formatCalendarDate, - formatDateInput, - parseCalendarDate, - parseDateInput, - isBlankDay, - parseDay, -} from './DateInput'; - -// The account projection's views (Payouts, Addresses; ACCOUNT-PROJECTION.md): -// the balance breakdown and the address rows the app already draws. Paper and -// the catalogue only. `RecentLocations` comes from its own file, never from the -// `Geoposition` index, which reaches the native map picker and geolocation. -export { default as Accounting } from './Accounting/Accounting'; -export { - LOCATION_LIST_ITEM, - LOCATION_LIST_ITEM_MAPPING, - interpunctLocationListItemDescription, - LocationListItem, -} from './LocationListItem/LocationListItem'; -export { default as RecentLocations } from './Geoposition/RecentLocations';