@tesouro/embedded-components-react 0.9.1 → 0.9.4
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 +76 -0
- package/dist/core.js +1 -0
- package/dist/index.css +387 -65
- package/dist/index.d.ts +74 -2
- package/dist/index.js +57 -55
- package/dist/libs/tesouro-embedded-components-react/balances-widget/feature/dist/lib/BalancesWidget/BalancesWidgetContext.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/BankAccountOnboardingWidget.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/buildOnboardingPrefill.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/feature/dist/index4.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/lib/formatters.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/lib/useBankAccountsWidget.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index16.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index19.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index2.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index21.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index22.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index24.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index25.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index27.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index29.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index31.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index32.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index36.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index38.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index39.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index42.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index44.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index45.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index47.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index5.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index6.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/data-access/dist/index2.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/data-access/dist/index4.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/feature/dist/index6.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index14.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index15.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index16.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index19.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index2.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/invalidatePayableQueries/hasLiveScheduledRecord.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/useApplyDuplicateVerdictsMutation.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillPayWidget.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/analytics/events.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/feature/dist/index10.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/feature/dist/index11.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/feature/dist/index13.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/feature/dist/index14.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/feature/dist/index4.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/feature/dist/index8.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/util/dist/index.js +17 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/util/dist/lib/formatBillMoney.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/util/dist/lib/formatScheduledDateLabel.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/lib/formatters.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/feature/dist/index4.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/feature/dist/index8.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/lib/formatters.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartDetailsContainer.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartsWidget.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/ExpenseManagementWidget/mapTransactionRow.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/lib/TransactionDetails/TransactionDetailsFeature.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/feature/dist/index2.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/apiValidationErrors.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/discount.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/helpers.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/lineItems.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/paymentRecord.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/preview.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/totals.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActions.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableBankAccount.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableDetails.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableForm.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablePaymentRecord.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableReminders.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/useLinkedAccountsWidget.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/products-widget/ui/dist/index5.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/feature/dist/lib/RemoteCheckCaptureWidget/useRemoteCheckCaptureWidget.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/settings-widget/chart-of-accounts/feature/dist/index7.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/settings-widget/profile/feature/dist/index4.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index11.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index4.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/lib/policyViewModel.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useAddressForm.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartForm.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useDeleteController.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useSubEntityForm.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetTokenRefreshProvider.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/index.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/MeasureUnitsManagerContainer.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/helpers.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/HostIsolationScope/HostIsolationScope.js +20 -15
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/HostIsolationScope/usePortalThemeSync.js +45 -0
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/HostIsolationScope/useRenderedThemeCheck.js +20 -0
- package/dist/libs/tesouro-embedded-components-react/shared/util/dist/index.js +30 -0
- package/dist/libs/tesouro-embedded-components-react/shared/util/dist/lib/theme/color.js +182 -0
- package/dist/libs/tesouro-embedded-components-react/shared/util/dist/lib/theme/createTheme.js +109 -0
- package/dist/libs/tesouro-embedded-components-react/shared/util/dist/lib/theme/index.js +3 -0
- package/dist/libs/tesouro-embedded-components-react/shared/util/dist/lib/theme/themeTokens.js +170 -0
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/TransfersWidgetInner.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/transferViews.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/useTransferMoneyModalController.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/lib/WidgetSuite/labels.js +1 -0
- package/dist/packages/shared-ui-shadcn/dist/index.js +28 -13
- package/dist/theme.d.ts +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -165,6 +165,82 @@ all utilities are `ttw`-prefixed, so it won't collide with your own Tailwind.
|
|
|
165
165
|
Design tokens (`--ttw-*`) are declared on `:root` / `.dark`. Dark mode follows an
|
|
166
166
|
ancestor `.dark` class, and you can set the widget font with `--ttw-font-family`.
|
|
167
167
|
|
|
168
|
+
### Theming
|
|
169
|
+
|
|
170
|
+
Widgets read their look from `--ttw-*` CSS variables. Set them on `:root`, or
|
|
171
|
+
on any element around the widgets, in plain CSS or with `createTheme`.
|
|
172
|
+
|
|
173
|
+
**Basic theming** is all most integrations need: your brand color, the corner
|
|
174
|
+
radius and the font.
|
|
175
|
+
|
|
176
|
+
```tsx
|
|
177
|
+
import type { CSSProperties } from 'react';
|
|
178
|
+
import { createTheme, themeToCss } from '@tesouro/embedded-components-react';
|
|
179
|
+
|
|
180
|
+
const theme = createTheme({
|
|
181
|
+
primary: '#0f766e',
|
|
182
|
+
primaryForeground: '#ffffff',
|
|
183
|
+
radius: '0.5rem',
|
|
184
|
+
fontFamily: 'Inter, sans-serif',
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
// On a wrapper around the widgets…
|
|
188
|
+
<div style={theme as CSSProperties}>{/* widgets */}</div>;
|
|
189
|
+
// …or once for the page: themeToCss(theme) prints a `:root { … }` rule.
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
A wrapper theme reaches the widgets' dialogs, sheets and menus too, although
|
|
193
|
+
they render at the end of `<body>`: the widgets copy the wrapper's values onto
|
|
194
|
+
their overlay root each time they render.
|
|
195
|
+
|
|
196
|
+
Nested widgets share that overlay root. When a themed widget sits inside
|
|
197
|
+
another widget (or inside another `WidgetProvider` / `RootWidgetProvider`
|
|
198
|
+
scope), its dialogs, sheets and menus render into the outer scope's overlay
|
|
199
|
+
root and so take the outer theme. If two widgets need different themes, theme
|
|
200
|
+
the outermost wrapper, or render them side by side rather than nested.
|
|
201
|
+
|
|
202
|
+
**Advanced theming** reaches every public variable:
|
|
203
|
+
|
|
204
|
+
| Group | Keys (`createTheme`) and variables |
|
|
205
|
+
| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
206
|
+
| Surfaces | `background`, `foreground`, `card`, `cardForeground`, `popover`, `popoverForeground`, `muted`, `mutedForeground` (`--ttw-background` …) |
|
|
207
|
+
| Actions | `primary`, `primaryForeground`, `secondary`, `secondaryForeground`, `accent`, `accentForeground`, `destructive`, `destructiveForeground` |
|
|
208
|
+
| Lines | `border`, `input`, `ring` |
|
|
209
|
+
| Tones | `info`, `success`, `warning`, and `destructive`: one color each for a status badge |
|
|
210
|
+
| Accents | `violet`, `cyan`: for a status no tone carries |
|
|
211
|
+
| Overrides | `<tone>Subtle` and `<tone>Foreground` (`--ttw-success-subtle`, `--ttw-success-foreground`; for destructive, `destructiveSubtle` and `destructiveSubtleForeground`), all optional |
|
|
212
|
+
| Overlay | `overlay`: the scrim behind dialogs and sheets, black at 50% by default |
|
|
213
|
+
| Shape/type | `radius` (0–1.25rem), `fontFamily` |
|
|
214
|
+
|
|
215
|
+
A tone or accent is one color. The badge's tinted fill and its text are
|
|
216
|
+
derived from it where the badge is painted, so they follow a dark card or a
|
|
217
|
+
tinted page without extra variables; set the `Subtle` / `Foreground` override
|
|
218
|
+
only to pick either half yourself.
|
|
219
|
+
|
|
220
|
+
**Compatibility variables.** `surfaceSubtle` (`--ttw-surface-subtle`) and the
|
|
221
|
+
eight sidebar keys (`sidebar`, `sidebarForeground`, `sidebarPrimary`,
|
|
222
|
+
`sidebarPrimaryForeground`, `sidebarAccent`, `sidebarAccentForeground`,
|
|
223
|
+
`sidebarBorder`, `sidebarRing`) keep working for existing themes and will be
|
|
224
|
+
removed in a future major version. None is declared: until you set one,
|
|
225
|
+
`surfaceSubtle` is `muted` and each sidebar color is its base color (`card`,
|
|
226
|
+
`foreground`, `primary`, `accent`, `border`, `ring`). A new theme can leave
|
|
227
|
+
them out.
|
|
228
|
+
|
|
229
|
+
In development, `createTheme` warns once in the console about unknown keys,
|
|
230
|
+
text under 4.5:1 contrast (3:1 for `mutedForeground` on `muted`) and a radius
|
|
231
|
+
outside 0–1.25rem, and the widgets run the same contrast check once against
|
|
232
|
+
the theme they actually render with.
|
|
233
|
+
Nothing warns in production, and a warning never stops a widget rendering.
|
|
234
|
+
`themeIssues(tokens)` returns the same findings as data, for a test in your
|
|
235
|
+
own CI; a variable you leave out is judged at its default, so
|
|
236
|
+
`themeIssues(createTheme({ primary }))` checks `primary` against the default
|
|
237
|
+
`primaryForeground`.
|
|
238
|
+
|
|
239
|
+
Only the variables above are supported. Tailwind's own variables share the
|
|
240
|
+
`--ttw-` prefix (`--ttw-spacing`, `--ttw-text-sm`, `--ttw-color-*` …) because
|
|
241
|
+
the utilities are prefixed `ttw`; they are pinned inside the widgets, so
|
|
242
|
+
setting one has no effect. `--ttw-chart-*` were removed.
|
|
243
|
+
|
|
168
244
|
<!-- BEGIN GENERATED REFERENCE -->
|
|
169
245
|
|
|
170
246
|
## Providers
|
package/dist/core.js
CHANGED