tempest-react-sdk 0.72.0 → 0.74.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 +6 -4
- package/dist/br/MapMarkers.cjs +1 -1
- package/dist/br/MapMarkers.cjs.map +1 -1
- package/dist/br/MapMarkers.js +19 -22
- package/dist/br/MapMarkers.js.map +1 -1
- package/dist/components/AIChat/AIChatTurn.cjs +1 -1
- package/dist/components/AIChat/AIChatTurn.cjs.map +1 -1
- package/dist/components/AIChat/AIChatTurn.js +1 -1
- package/dist/components/AIChat/AIChatTurn.js.map +1 -1
- package/dist/components/AppShell/AppShell.module.cjs.map +1 -1
- package/dist/components/AppShell/AppShell.module.js.map +1 -1
- package/dist/components/Button/Button.cjs +1 -1
- package/dist/components/Button/Button.cjs.map +1 -1
- package/dist/components/Button/Button.js +41 -36
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Button/Button.module.cjs.map +1 -1
- package/dist/components/Button/Button.module.js.map +1 -1
- package/dist/components/Button/ButtonContent.cjs +2 -0
- package/dist/components/Button/ButtonContent.cjs.map +1 -0
- package/dist/components/Button/ButtonContent.js +34 -0
- package/dist/components/Button/ButtonContent.js.map +1 -0
- package/dist/components/Button/ButtonSlot.cjs +2 -0
- package/dist/components/Button/ButtonSlot.cjs.map +1 -0
- package/dist/components/Button/ButtonSlot.js +36 -0
- package/dist/components/Button/ButtonSlot.js.map +1 -0
- package/dist/components/Button/button-class.cjs +2 -0
- package/dist/components/Button/button-class.cjs.map +1 -0
- package/dist/components/Button/button-class.js +13 -0
- package/dist/components/Button/button-class.js.map +1 -0
- package/dist/components/Button/link-rel.cjs +2 -0
- package/dist/components/Button/link-rel.cjs.map +1 -0
- package/dist/components/Button/link-rel.js +11 -0
- package/dist/components/Button/link-rel.js.map +1 -0
- package/dist/components/Button/slot.cjs +2 -0
- package/dist/components/Button/slot.cjs.map +1 -0
- package/dist/components/Button/slot.js +41 -0
- package/dist/components/Button/slot.js.map +1 -0
- package/dist/components/Collapsible/Collapsible.cjs +1 -1
- package/dist/components/Collapsible/Collapsible.cjs.map +1 -1
- package/dist/components/Collapsible/Collapsible.js +1 -1
- package/dist/components/Collapsible/Collapsible.js.map +1 -1
- package/dist/components/Form/Form.cjs.map +1 -1
- package/dist/components/Form/Form.js.map +1 -1
- package/dist/components/InstallButton/InstallButton.cjs.map +1 -1
- package/dist/components/InstallButton/InstallButton.js.map +1 -1
- package/dist/components/Modal/Modal.cjs +1 -1
- package/dist/components/Modal/Modal.cjs.map +1 -1
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/Modal/Modal.js.map +1 -1
- package/dist/components/Modal/Modal.module.cjs +1 -1
- package/dist/components/Modal/Modal.module.cjs.map +1 -1
- package/dist/components/Modal/Modal.module.js +1 -1
- package/dist/components/Modal/Modal.module.js.map +1 -1
- package/dist/components/Page/Page.cjs +1 -1
- package/dist/components/Page/Page.cjs.map +1 -1
- package/dist/components/Page/Page.js +23 -39
- package/dist/components/Page/Page.js.map +1 -1
- package/dist/components/Page/Page.module.cjs +1 -1
- package/dist/components/Page/Page.module.cjs.map +1 -1
- package/dist/components/Page/Page.module.js +5 -11
- package/dist/components/Page/Page.module.js.map +1 -1
- package/dist/components/Reveal/Reveal.cjs +2 -0
- package/dist/components/Reveal/Reveal.cjs.map +1 -0
- package/dist/components/Reveal/Reveal.js +56 -0
- package/dist/components/Reveal/Reveal.js.map +1 -0
- package/dist/components/Reveal/Reveal.module.cjs +3 -0
- package/dist/components/Reveal/Reveal.module.cjs.map +1 -0
- package/dist/components/Reveal/Reveal.module.js +7 -0
- package/dist/components/Reveal/Reveal.module.js.map +1 -0
- package/dist/components/Reveal/reveal-threshold.cjs +2 -0
- package/dist/components/Reveal/reveal-threshold.cjs.map +1 -0
- package/dist/components/Reveal/reveal-threshold.js +13 -0
- package/dist/components/Reveal/reveal-threshold.js.map +1 -0
- package/dist/components/SectionHeader/SectionHeader.cjs +2 -0
- package/dist/components/SectionHeader/SectionHeader.cjs.map +1 -0
- package/dist/components/SectionHeader/SectionHeader.js +58 -0
- package/dist/components/SectionHeader/SectionHeader.js.map +1 -0
- package/dist/components/SectionHeader/SectionHeader.module.cjs +3 -0
- package/dist/components/SectionHeader/SectionHeader.module.cjs.map +1 -0
- package/dist/components/SectionHeader/SectionHeader.module.js +15 -0
- package/dist/components/SectionHeader/SectionHeader.module.js.map +1 -0
- package/dist/components/Timeline/Timeline.cjs +1 -1
- package/dist/components/Timeline/Timeline.cjs.map +1 -1
- package/dist/components/Timeline/Timeline.js +22 -15
- package/dist/components/Timeline/Timeline.js.map +1 -1
- package/dist/components/Timeline/Timeline.module.cjs +1 -1
- package/dist/components/Timeline/Timeline.module.cjs.map +1 -1
- package/dist/components/Timeline/Timeline.module.js +1 -1
- package/dist/components/Timeline/Timeline.module.js.map +1 -1
- package/dist/styles/Reveal.css +2 -0
- package/dist/styles/SectionHeader.css +2 -0
- package/dist/styles/actions.css +24 -22
- package/dist/styles/base.css +3 -1
- package/dist/styles/component/AppShell.css +1 -1
- package/dist/styles/component/Button.css +24 -22
- package/dist/styles/component/Modal.css +2 -2
- package/dist/styles/component/Page.css +0 -6
- package/dist/styles/component/Reveal.css +9 -0
- package/dist/styles/component/SectionHeader.css +9 -0
- package/dist/styles/component/Timeline.css +5 -5
- package/dist/styles/core.css +3 -1
- package/dist/styles/data.css +5 -5
- package/dist/styles/inverse.css +147 -0
- package/dist/styles/layout.css +9 -7
- package/dist/styles/manifest.json +14 -1
- package/dist/styles/overlay.css +2 -2
- package/dist/styles/utility.css +8 -0
- package/dist/styles.css +1 -1
- package/dist/tempest-react-sdk.cjs +1 -1
- package/dist/tempest-react-sdk.d.ts +353 -4
- package/dist/tempest-react-sdk.js +350 -346
- package/dist/theme/create-theme.cjs +3 -3
- package/dist/theme/create-theme.cjs.map +1 -1
- package/dist/theme/create-theme.js +67 -55
- package/dist/theme/create-theme.js.map +1 -1
- package/dist/theme/inverse-render.cjs +3 -0
- package/dist/theme/inverse-render.cjs.map +1 -0
- package/dist/theme/inverse-render.js +10 -0
- package/dist/theme/inverse-render.js.map +1 -0
- package/dist/theme/inverse-surface.cjs +2 -0
- package/dist/theme/inverse-surface.cjs.map +1 -0
- package/dist/theme/inverse-surface.js +258 -0
- package/dist/theme/inverse-surface.js.map +1 -0
- package/dist/theme/status-tokens.cjs +2 -0
- package/dist/theme/status-tokens.cjs.map +1 -0
- package/dist/theme/status-tokens.js +15 -0
- package/dist/theme/status-tokens.js.map +1 -0
- package/dist/vision/core/graph.cjs.map +1 -1
- package/dist/vision/core/graph.js.map +1 -1
- package/dist/vision/core/metadata.cjs +2 -2
- package/dist/vision/core/metadata.cjs.map +1 -1
- package/dist/vision/core/metadata.js +101 -29
- package/dist/vision/core/metadata.js.map +1 -1
- package/dist/vision/core/session.cjs +1 -1
- package/dist/vision/core/session.cjs.map +1 -1
- package/dist/vision/core/session.js +59 -48
- package/dist/vision/core/session.js.map +1 -1
- package/dist/vision/index.cjs +1 -1
- package/dist/vision/index.cjs.map +1 -1
- package/dist/vision/index.js +1 -1
- package/dist/vision/index.js.map +1 -1
- package/dist/vision.d.ts +25 -21
- package/dist/vite/create-vite-config.cjs +1 -1
- package/dist/vite/create-vite-config.cjs.map +1 -1
- package/dist/vite/create-vite-config.js +6 -4
- package/dist/vite/create-vite-config.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AnchorHTMLAttributes } from 'react';
|
|
1
2
|
import { AnimationEventHandler } from 'react';
|
|
2
3
|
import { AriaRole } from 'react';
|
|
3
4
|
import { BrowserRouter } from 'react-router';
|
|
@@ -2263,13 +2264,64 @@ export declare function buildOpenInChromeIntent(): string | null;
|
|
|
2263
2264
|
*
|
|
2264
2265
|
* Sizes are density-aware — they read from `--tempest-control-height-*`
|
|
2265
2266
|
* tokens which respond to the `data-tempest-density` attribute.
|
|
2267
|
+
*
|
|
2268
|
+
* With `href` it renders an `<a>` with the same look: a call to action that
|
|
2269
|
+
* navigates keeps the middle click, Ctrl+click, "open in new tab" and the URL
|
|
2270
|
+
* preview, which a `<button>` calling `location.assign` loses. `target="_blank"`
|
|
2271
|
+
* gets `noopener noreferrer`. An `<a>` has no `disabled`, so a disabled or loading
|
|
2272
|
+
* link gets `aria-disabled="true"`, `role="link"`, `tabIndex={-1}`, no `href`, and
|
|
2273
|
+
* its click and middle-click cancelled.
|
|
2274
|
+
*
|
|
2275
|
+
* To style another element — a react-router `Link` — use {@link ButtonSlot}. It is
|
|
2276
|
+
* a separate component, not an `asChild` prop, so an app that never uses it does
|
|
2277
|
+
* not ship the prop merge and ref composition it needs.
|
|
2278
|
+
*
|
|
2279
|
+
* The ref is typed per mode: `HTMLButtonElement`, or `HTMLAnchorElement` with
|
|
2280
|
+
* `href`. `forwardRef` takes one ref type for all props, so its result is re-typed
|
|
2281
|
+
* to the per-mode union — the runtime is plain `forwardRef`.
|
|
2282
|
+
*
|
|
2283
|
+
* @example
|
|
2284
|
+
* <Button onClick={save}>Salvar</Button>
|
|
2285
|
+
*
|
|
2286
|
+
* @example
|
|
2287
|
+
* <Button href="https://wa.me/5586999999999" target="_blank" rightIcon={<ExternalLink />}>
|
|
2288
|
+
* Fale conosco
|
|
2289
|
+
* </Button>
|
|
2266
2290
|
*/
|
|
2267
|
-
export declare
|
|
2291
|
+
export declare const Button: ButtonComponent;
|
|
2292
|
+
|
|
2293
|
+
/** `Button` rendering a native `<button>` — the default, when `href` is not set. */
|
|
2294
|
+
export declare interface ButtonAsButtonProps extends ButtonBaseProps, ButtonHTMLAttributes<HTMLButtonElement> {
|
|
2295
|
+
href?: undefined;
|
|
2296
|
+
}
|
|
2297
|
+
|
|
2298
|
+
/**
|
|
2299
|
+
* `Button` rendering an `<a href>` — a call to action that navigates.
|
|
2300
|
+
*
|
|
2301
|
+
* `type` is a `<button>` attribute and is rejected here; `target` and `rel` are
|
|
2302
|
+
* forwarded, and `target="_blank"` always gets `noopener noreferrer` added.
|
|
2303
|
+
*/
|
|
2304
|
+
export declare interface ButtonAsLinkProps extends ButtonBaseProps, Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "href" | "type"> {
|
|
2305
|
+
/** Destination. Its presence is what makes the button an `<a>`. */
|
|
2306
|
+
href: string;
|
|
2307
|
+
type?: never;
|
|
2308
|
+
}
|
|
2268
2309
|
|
|
2269
|
-
|
|
2310
|
+
/** The look of the button — shared by `Button` (`<button>` or `<a>`) and `ButtonSlot`. */
|
|
2311
|
+
export declare interface ButtonBaseProps {
|
|
2270
2312
|
variant?: ButtonVariant;
|
|
2271
2313
|
size?: ButtonSize;
|
|
2314
|
+
/**
|
|
2315
|
+
* Shows the spinner, keeps the width, sets `aria-busy` and blocks activation —
|
|
2316
|
+
* a `<button>` gets `disabled`, a link gets the disabled-link semantics.
|
|
2317
|
+
*/
|
|
2272
2318
|
loading?: boolean;
|
|
2319
|
+
/**
|
|
2320
|
+
* Blocks activation. On a `<button>` this is the native `disabled`; an `<a>` has
|
|
2321
|
+
* no such attribute, so a link gets `aria-disabled="true"`, `tabIndex={-1}` and
|
|
2322
|
+
* no navigable `href` instead.
|
|
2323
|
+
*/
|
|
2324
|
+
disabled?: boolean;
|
|
2273
2325
|
fullWidth?: boolean;
|
|
2274
2326
|
/** Removes horizontal padding and forces a square footprint (use with `aria-label`). */
|
|
2275
2327
|
iconOnly?: boolean;
|
|
@@ -2279,8 +2331,58 @@ export declare interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElem
|
|
|
2279
2331
|
rightIcon?: ReactNode;
|
|
2280
2332
|
}
|
|
2281
2333
|
|
|
2334
|
+
/** `Button`'s call signature: one props union, each member with its own ref type. */
|
|
2335
|
+
declare type ButtonComponent = ((props: ButtonPropsWithRef) => ReactElement) & {
|
|
2336
|
+
displayName?: string;
|
|
2337
|
+
};
|
|
2338
|
+
|
|
2339
|
+
export declare type ButtonProps = ButtonAsButtonProps | ButtonAsLinkProps;
|
|
2340
|
+
|
|
2341
|
+
/**
|
|
2342
|
+
* Each mode's props with the ref type of the element it renders, so a `ref` to an
|
|
2343
|
+
* `HTMLButtonElement` on a link is a type error.
|
|
2344
|
+
*/
|
|
2345
|
+
declare type ButtonPropsWithRef = (ButtonAsButtonProps & RefAttributes<HTMLButtonElement>) | (ButtonAsLinkProps & RefAttributes<HTMLAnchorElement>);
|
|
2346
|
+
|
|
2282
2347
|
export declare type ButtonSize = "xs" | "sm" | "md" | "lg" | "xl";
|
|
2283
2348
|
|
|
2349
|
+
/**
|
|
2350
|
+
* Lends the `Button` look to its single child element instead of rendering one —
|
|
2351
|
+
* the `asChild`/Slot pattern. `<ButtonSlot><Link to="/x">Go</Link></ButtonSlot>`
|
|
2352
|
+
* styles a react-router `Link`, so the route changes without a reload, and no
|
|
2353
|
+
* router is imported here.
|
|
2354
|
+
*
|
|
2355
|
+
* It is a component of its own rather than an `asChild` prop on `Button` because
|
|
2356
|
+
* of what it costs: the prop merge and ref composition are ~0.6 kB brotli, and a
|
|
2357
|
+
* prop is a runtime branch no bundler can drop, so every app using `Button` paid
|
|
2358
|
+
* for it. As a separate export it is tree-shaken away where unused.
|
|
2359
|
+
*
|
|
2360
|
+
* Merge rules: classes are joined (a function `className`, as `NavLink` takes,
|
|
2361
|
+
* stays a function); `ButtonSlot`'s props win over the child's, because they carry
|
|
2362
|
+
* the disabled semantics; handlers run `ButtonSlot`'s first and skip the child's
|
|
2363
|
+
* when the event was prevented; both refs receive the node. A child with
|
|
2364
|
+
* `target="_blank"` gets `noopener noreferrer`.
|
|
2365
|
+
*
|
|
2366
|
+
* Disabled or loading: `aria-disabled="true"`, `tabIndex={-1}`, click and
|
|
2367
|
+
* middle-click cancelled — a router `Link` then skips its navigation because the
|
|
2368
|
+
* event arrives prevented. A plain `<a href>` child also loses the `href` and gets
|
|
2369
|
+
* `role="link"`; a `Link` computes its own `href`, which stays in the DOM.
|
|
2370
|
+
*
|
|
2371
|
+
* @example
|
|
2372
|
+
* <ButtonSlot variant="outline">
|
|
2373
|
+
* <Link to="/planos">Ver planos</Link>
|
|
2374
|
+
* </ButtonSlot>
|
|
2375
|
+
*
|
|
2376
|
+
* @throws {Error} When `children` is not a single React element.
|
|
2377
|
+
*/
|
|
2378
|
+
export declare const ButtonSlot: ForwardRefExoticComponent<ButtonSlotProps & RefAttributes<HTMLElement>>;
|
|
2379
|
+
|
|
2380
|
+
/** Props of {@link ButtonSlot}: the `Button` look, applied to the single child. */
|
|
2381
|
+
export declare interface ButtonSlotProps extends ButtonBaseProps, Omit<HTMLAttributes<HTMLElement>, "children"> {
|
|
2382
|
+
/** The one element that receives the classes, props and ref — e.g. a router `Link`. */
|
|
2383
|
+
children: ReactElement;
|
|
2384
|
+
}
|
|
2385
|
+
|
|
2284
2386
|
export declare type ButtonVariant = "primary" | "secondary" | "danger" | "success" | "ghost" | "soft" | "outline" | "link";
|
|
2285
2387
|
|
|
2286
2388
|
/**
|
|
@@ -3937,6 +4039,24 @@ export declare function createInMemoryFlags(options?: InMemoryFlagsOptions): Fea
|
|
|
3937
4039
|
set: (key: string, value: FlagValue) => void;
|
|
3938
4040
|
};
|
|
3939
4041
|
|
|
4042
|
+
/**
|
|
4043
|
+
* Build the inverse surface for a brand.
|
|
4044
|
+
*
|
|
4045
|
+
* The fill is the brand's own `500` whenever it can carry the scheme, and
|
|
4046
|
+
* otherwise the nearest ramp step that can (see {@link FILL_CANDIDATES}). Whether
|
|
4047
|
+
* the surface reads light-on-dark or dark-on-light follows the fill, so a yellow
|
|
4048
|
+
* brand gets dark ink and a navy one white — the same pick `createTheme` makes
|
|
4049
|
+
* for `--tempest-primary-foreground`.
|
|
4050
|
+
*
|
|
4051
|
+
* The values are literal colors, not references to the page's ramp, so the
|
|
4052
|
+
* section paints the same in the light and the dark page scheme: the brand is
|
|
4053
|
+
* the brand in both.
|
|
4054
|
+
*
|
|
4055
|
+
* @param options - The brand, plus the status and chart colors the theme names.
|
|
4056
|
+
* @returns The token map, the scheme it reads as, and the fill step used.
|
|
4057
|
+
*/
|
|
4058
|
+
export declare function createInverseSurface(options: InverseSurfaceOptions): InverseSurface;
|
|
4059
|
+
|
|
3940
4060
|
/**
|
|
3941
4061
|
* Build a typed `localStorage` wrapper around a codec.
|
|
3942
4062
|
*
|
|
@@ -4834,6 +4954,25 @@ export declare interface CreateThemeOptions {
|
|
|
4834
4954
|
selector?: string;
|
|
4835
4955
|
/** Selector the dark tokens are written under. Default `'[data-tempest-theme="dark"]'`. */
|
|
4836
4956
|
darkSelector?: string;
|
|
4957
|
+
/**
|
|
4958
|
+
* Also emit the inverse surface — the token set for a section painted in the
|
|
4959
|
+
* brand color — by passing its generator, `createInverseSurface`. Off by
|
|
4960
|
+
* default; ignored without `primary`.
|
|
4961
|
+
*
|
|
4962
|
+
* The generator is passed in rather than switched on with `true` so that
|
|
4963
|
+
* `createTheme` never imports it: an app that does not paint a section in
|
|
4964
|
+
* its brand does not ship the 1.68 kB brotli it costs.
|
|
4965
|
+
*
|
|
4966
|
+
* @example
|
|
4967
|
+
* ```ts
|
|
4968
|
+
* import { createInverseSurface, createTheme } from "tempest-react-sdk";
|
|
4969
|
+
*
|
|
4970
|
+
* createTheme({ primary: "#03184b", inverse: createInverseSurface });
|
|
4971
|
+
* ```
|
|
4972
|
+
*/
|
|
4973
|
+
inverse?: InverseSurfaceGenerator;
|
|
4974
|
+
/** Selector the inverse tokens are written under. Default `'[data-tempest-tone="inverse"]'`. */
|
|
4975
|
+
inverseSelector?: string;
|
|
4837
4976
|
}
|
|
4838
4977
|
|
|
4839
4978
|
/**
|
|
@@ -7434,6 +7573,13 @@ export declare interface FormRowProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
7434
7573
|
* Has its own `layout`/`columns`/`gap` so subsets can stack while the parent
|
|
7435
7574
|
* grids (or vice versa).
|
|
7436
7575
|
*
|
|
7576
|
+
* The header is deliberately not a `SectionHeader`: a field group sits one step
|
|
7577
|
+
* below a page section, and its title is `text-lg` / semibold / `leading-snug`
|
|
7578
|
+
* with `space-3` below, against `text-2xl` / bold / `leading-tight` with
|
|
7579
|
+
* `space-5` for `SectionHeader`. Sharing the component would either grow every
|
|
7580
|
+
* form group to page-section size or add a size switch to `SectionHeader` that
|
|
7581
|
+
* only this caller uses.
|
|
7582
|
+
*
|
|
7437
7583
|
* @example
|
|
7438
7584
|
* <FormSection title="Endereço" description="Usado para entrega" layout="grid" columns={3}>
|
|
7439
7585
|
* <Input label="CEP" />
|
|
@@ -7463,6 +7609,12 @@ export declare interface GeneratedTheme {
|
|
|
7463
7609
|
light: Record<string, string>;
|
|
7464
7610
|
/** Dark-scheme custom properties. */
|
|
7465
7611
|
dark: Record<string, string>;
|
|
7612
|
+
/**
|
|
7613
|
+
* Inverse-surface custom properties — literal colors, identical under the
|
|
7614
|
+
* light and the dark page scheme. Present only when the theme names a
|
|
7615
|
+
* `primary` and passes `inverse`.
|
|
7616
|
+
*/
|
|
7617
|
+
inverse?: Record<string, string>;
|
|
7466
7618
|
/** Both blocks rendered as CSS, ready for {@link applyTheme} or a stylesheet. */
|
|
7467
7619
|
css: string;
|
|
7468
7620
|
}
|
|
@@ -8162,7 +8314,9 @@ export declare interface InstallBannerProps {
|
|
|
8162
8314
|
* Nothing renders only when there is genuinely nothing to offer — already
|
|
8163
8315
|
* installed, running standalone, or inside the decline cooldown.
|
|
8164
8316
|
*
|
|
8165
|
-
* Inherits every {@link Button} prop (`variant`, `size`,
|
|
8317
|
+
* Inherits every {@link Button} prop of the `<button>` mode (`variant`, `size`,
|
|
8318
|
+
* `leftIcon`, …) but not `href`: its click opens the install prompt
|
|
8319
|
+
* or toggles the instruction, which is an action, not a navigation.
|
|
8166
8320
|
*
|
|
8167
8321
|
* @example
|
|
8168
8322
|
* <InstallButton variant="primary" leftIcon={<Download />} />
|
|
@@ -8172,7 +8326,7 @@ export declare interface InstallBannerProps {
|
|
|
8172
8326
|
*/
|
|
8173
8327
|
export declare function InstallButton({ label, hintLabel, onResult, renderHint, manualFallbackDelayMs, wrapperClassName, ...props }: InstallButtonProps): JSX.Element | null;
|
|
8174
8328
|
|
|
8175
|
-
export declare interface InstallButtonProps extends Omit<
|
|
8329
|
+
export declare interface InstallButtonProps extends Omit<ButtonAsButtonProps, "onClick" | "children"> {
|
|
8176
8330
|
/** Button label. Default `"Instalar app"`. */
|
|
8177
8331
|
label?: ReactNode;
|
|
8178
8332
|
/**
|
|
@@ -8318,6 +8472,48 @@ export declare function installSkipWaitingListener(): void;
|
|
|
8318
8472
|
|
|
8319
8473
|
export declare type InterpolationValues = Record<string, string | number>;
|
|
8320
8474
|
|
|
8475
|
+
/** Which way the inverse surface reads: light ink on a dark fill, or the reverse. */
|
|
8476
|
+
export declare type InverseScheme = "light" | "dark";
|
|
8477
|
+
|
|
8478
|
+
/** The inverse surface for one brand. */
|
|
8479
|
+
export declare interface InverseSurface {
|
|
8480
|
+
/** Every color custom property the surface redefines, as literal colors. */
|
|
8481
|
+
tokens: Record<string, string>;
|
|
8482
|
+
/**
|
|
8483
|
+
* `"dark"` when the fill carries light ink (a navy brand), `"light"` when it
|
|
8484
|
+
* carries dark ink (a yellow brand). Written as `color-scheme`, so native
|
|
8485
|
+
* controls inside the section follow the fill rather than the page.
|
|
8486
|
+
*/
|
|
8487
|
+
scheme: InverseScheme;
|
|
8488
|
+
/** Step of the brand's light ramp used as the fill. */
|
|
8489
|
+
step: ScaleStep;
|
|
8490
|
+
}
|
|
8491
|
+
|
|
8492
|
+
/**
|
|
8493
|
+
* The inverse-surface generator `createTheme` calls when it is handed one —
|
|
8494
|
+
* in practice `createInverseSurface`.
|
|
8495
|
+
*
|
|
8496
|
+
* A function rather than a flag on purpose: `createTheme` never imports the
|
|
8497
|
+
* generator, so an app that does not paint a section in its brand does not ship
|
|
8498
|
+
* it. Measured with `npx size-limit`, `{ createTheme }` is 3.18 kB brotli on its
|
|
8499
|
+
* own and 4.86 kB with the generator inside it — what a boolean option would
|
|
8500
|
+
* have charged every theme.
|
|
8501
|
+
*/
|
|
8502
|
+
export declare type InverseSurfaceGenerator = (options: InverseSurfaceOptions) => InverseSurface;
|
|
8503
|
+
|
|
8504
|
+
/** Input for an {@link InverseSurfaceGenerator} — `createInverseSurface`. */
|
|
8505
|
+
export declare interface InverseSurfaceOptions {
|
|
8506
|
+
/** Brand color — the fill is picked from its ramp. */
|
|
8507
|
+
primary: string;
|
|
8508
|
+
/**
|
|
8509
|
+
* Status colors the theme names; the rest use the SDK's defaults. A named
|
|
8510
|
+
* `danger` is also the warm pole of the diverging chart scale, as on the page.
|
|
8511
|
+
*/
|
|
8512
|
+
statuses?: Partial<Record<ThemeStatus, string>>;
|
|
8513
|
+
/** Categorical chart colors the theme names; else the SDK's defaults. */
|
|
8514
|
+
chart?: readonly string[];
|
|
8515
|
+
}
|
|
8516
|
+
|
|
8321
8517
|
/**
|
|
8322
8518
|
* Detects any Android browser.
|
|
8323
8519
|
*
|
|
@@ -10987,6 +11183,10 @@ declare type OverriddenDomProps_9 = "onSubmit" | "value" | "defaultValue" | "row
|
|
|
10987
11183
|
* Page wrapper with header + (optional) toolbar + content + footer. Pairs
|
|
10988
11184
|
* with `Container` when you want a max-width content well.
|
|
10989
11185
|
*
|
|
11186
|
+
* The header is a `SectionHeader` at `level={1}`, so the page title and the
|
|
11187
|
+
* `<h2>` of each section below it share one look; when every header slot is
|
|
11188
|
+
* empty no `<header>` is rendered.
|
|
11189
|
+
*
|
|
10990
11190
|
* @example
|
|
10991
11191
|
* <Page title="Pedidos" description="Acompanhe seus pedidos" actions={<Button>Novo</Button>}>
|
|
10992
11192
|
* <Table {...} />
|
|
@@ -12897,6 +13097,70 @@ export declare interface RetryOptions {
|
|
|
12897
13097
|
signal?: AbortSignal;
|
|
12898
13098
|
}
|
|
12899
13099
|
|
|
13100
|
+
/**
|
|
13101
|
+
* Animate content into view the first time it is scrolled to.
|
|
13102
|
+
*
|
|
13103
|
+
* The three failure modes of a hand-rolled version are handled here, not left to
|
|
13104
|
+
* the docs:
|
|
13105
|
+
*
|
|
13106
|
+
* - **Reduced motion.** Under `prefers-reduced-motion: reduce` the stylesheet
|
|
13107
|
+
* pins the element visible with no transform and no transition, whatever
|
|
13108
|
+
* state it is in — so the setting also wins when it changes mid-session.
|
|
13109
|
+
* - **No `IntersectionObserver`** (old engines, some crawlers, tests): the
|
|
13110
|
+
* element stays in the `"static"` state, which is plain visible content. It is
|
|
13111
|
+
* never hidden waiting for an observation that cannot come.
|
|
13112
|
+
* - **Taller than the viewport.** A box three viewports tall never reaches a
|
|
13113
|
+
* ratio of 0.5, so a raw observer with that threshold never reveals it. The
|
|
13114
|
+
* threshold is rescaled by the highest ratio the element can reach (see
|
|
13115
|
+
* `effectiveThreshold`), read from the first observation.
|
|
13116
|
+
*
|
|
13117
|
+
* Content is hidden only when the client can observe: the server snapshot of
|
|
13118
|
+
* `useSyncExternalStore` is `"static"`, so markup rendered without JavaScript —
|
|
13119
|
+
* or before hydration — is visible. The transition is declared on the `"shown"`
|
|
13120
|
+
* state only, so the switch to `"hidden"` on mount is instant instead of a
|
|
13121
|
+
* fade-out, and with `once={false}` leaving the viewport hides without motion.
|
|
13122
|
+
*
|
|
13123
|
+
* With `once={false}` the element hides only once it is fully out of view. Hiding
|
|
13124
|
+
* on the threshold would oscillate: the hidden state translates the box, which
|
|
13125
|
+
* moves it back across the same threshold.
|
|
13126
|
+
*
|
|
13127
|
+
* @example
|
|
13128
|
+
* <ul>
|
|
13129
|
+
* {steps.map((step, index) => (
|
|
13130
|
+
* <Reveal key={step.id} as="li" delay={index * 80}>
|
|
13131
|
+
* {step.title}
|
|
13132
|
+
* </Reveal>
|
|
13133
|
+
* ))}
|
|
13134
|
+
* </ul>
|
|
13135
|
+
*/
|
|
13136
|
+
export declare function Reveal({ as, variant, delay, duration, once, threshold, rootMargin, className, style, children, ...props }: RevealProps): JSX.Element;
|
|
13137
|
+
|
|
13138
|
+
export declare interface RevealProps extends HTMLAttributes<HTMLElement> {
|
|
13139
|
+
/** Intrinsic element to render, e.g. `"li"` inside a list. Defaults to `"div"`. */
|
|
13140
|
+
as?: keyof JSX.IntrinsicElements;
|
|
13141
|
+
/** How the content enters. Defaults to `"up"`. */
|
|
13142
|
+
variant?: RevealVariant;
|
|
13143
|
+
/** Wait before the entrance starts, in ms. Stagger siblings with `index * step`. */
|
|
13144
|
+
delay?: number;
|
|
13145
|
+
/** Length of the entrance, in ms. Defaults to `--tempest-duration-slower`. */
|
|
13146
|
+
duration?: number;
|
|
13147
|
+
/** Reveal once and stop observing. With `false`, it hides again once fully out of view. Defaults to `true`. */
|
|
13148
|
+
once?: boolean;
|
|
13149
|
+
/**
|
|
13150
|
+
* Fraction of the element — or of the viewport, when the element is taller
|
|
13151
|
+
* than it — that must be visible to reveal. Defaults to `0.15`.
|
|
13152
|
+
*/
|
|
13153
|
+
threshold?: number;
|
|
13154
|
+
/** Margin around the root, as in `IntersectionObserver`. Defaults to `"0px"`. */
|
|
13155
|
+
rootMargin?: string;
|
|
13156
|
+
}
|
|
13157
|
+
|
|
13158
|
+
/** Visual state written to `data-state`. */
|
|
13159
|
+
export declare type RevealState = "static" | "hidden" | "shown";
|
|
13160
|
+
|
|
13161
|
+
/** Direction the content travels from, or `"fade"` / `"scale"` for no travel. */
|
|
13162
|
+
export declare type RevealVariant = "fade" | "up" | "down" | "left" | "right" | "scale";
|
|
13163
|
+
|
|
12900
13164
|
/** Serialize sRGB channels (`0`–`1`, clamped) back to a `#rrggbb` string. */
|
|
12901
13165
|
export declare function rgbToHex(r: number, g: number, b: number): string;
|
|
12902
13166
|
|
|
@@ -13258,6 +13522,91 @@ export declare interface SearchBarProps extends Omit<InputHTMLAttributes<HTMLInp
|
|
|
13258
13522
|
wrapperClassName?: string;
|
|
13259
13523
|
}
|
|
13260
13524
|
|
|
13525
|
+
/**
|
|
13526
|
+
* `<section>` that takes its accessible name from the `SectionHeader` inside it.
|
|
13527
|
+
*
|
|
13528
|
+
* A `<section>` is exposed as a `region` landmark only when it has an
|
|
13529
|
+
* accessible name; without one it is an anonymous group and screen-reader
|
|
13530
|
+
* landmark navigation skips it. Wiring `aria-labelledby` to the heading id is
|
|
13531
|
+
* the same mechanical step on every page, so the section does it: every
|
|
13532
|
+
* `SectionHeader` with a `title` below it registers its id through context (so
|
|
13533
|
+
* wrappers in between do not break the link) and the first one mounted names
|
|
13534
|
+
* the section; when it unmounts, the next one takes over. An explicit
|
|
13535
|
+
* `aria-labelledby` or `aria-label` wins over the registered one, and with no
|
|
13536
|
+
* heading the attribute is left off rather than pointing at nothing.
|
|
13537
|
+
*
|
|
13538
|
+
* @example
|
|
13539
|
+
* <Section>
|
|
13540
|
+
* <SectionHeader title="Planos" />
|
|
13541
|
+
* <PlanGrid />
|
|
13542
|
+
* </Section>
|
|
13543
|
+
*
|
|
13544
|
+
* @example
|
|
13545
|
+
* <Section tone="inverse">
|
|
13546
|
+
* <SectionHeader title="Comece agora" />
|
|
13547
|
+
* <Button>Criar conta</Button>
|
|
13548
|
+
* </Section>
|
|
13549
|
+
*/
|
|
13550
|
+
export declare function Section({ children, tone, ...props }: SectionProps): JSX.Element;
|
|
13551
|
+
|
|
13552
|
+
/**
|
|
13553
|
+
* Header of a page or of one section of it: eyebrow, title, description and
|
|
13554
|
+
* actions, with the same look `Page` uses for its own header.
|
|
13555
|
+
*
|
|
13556
|
+
* The heading level is a prop because one page needs one `<h1>` and many
|
|
13557
|
+
* `<h2>` that look alike; the visual stays the same at every level so the
|
|
13558
|
+
* outline is picked by meaning, not by size. Inside a `<Section>` the heading
|
|
13559
|
+
* id is registered with it, which is what gives the `region` landmark its
|
|
13560
|
+
* accessible name.
|
|
13561
|
+
*
|
|
13562
|
+
* @example
|
|
13563
|
+
* <Section>
|
|
13564
|
+
* <SectionHeader eyebrow="Soluções" title="O que podemos desenvolver" align="center" />
|
|
13565
|
+
* <p>Conteúdo da seção.</p>
|
|
13566
|
+
* </Section>
|
|
13567
|
+
*/
|
|
13568
|
+
export declare function SectionHeader({ title, eyebrow, description, actions, level, align, id, className, ...props }: SectionHeaderProps): JSX.Element | null;
|
|
13569
|
+
|
|
13570
|
+
export declare type SectionHeaderAlign = "start" | "center";
|
|
13571
|
+
|
|
13572
|
+
export declare type SectionHeaderLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
13573
|
+
|
|
13574
|
+
export declare interface SectionHeaderProps extends Omit<HTMLAttributes<HTMLElement>, "title" | "id"> {
|
|
13575
|
+
/** Heading text, rendered as `<h{level}>`. */
|
|
13576
|
+
title?: ReactNode;
|
|
13577
|
+
/** Short label above the title (category, breadcrumbs). */
|
|
13578
|
+
eyebrow?: ReactNode;
|
|
13579
|
+
/** Supporting text rendered below the title. */
|
|
13580
|
+
description?: ReactNode;
|
|
13581
|
+
/** Trailing slot for buttons or menus. */
|
|
13582
|
+
actions?: ReactNode;
|
|
13583
|
+
/** Heading level — semantics only, the look does not change with it. Default `2`. */
|
|
13584
|
+
level?: SectionHeaderLevel;
|
|
13585
|
+
/** Horizontal alignment of the text block. Default `"start"`. */
|
|
13586
|
+
align?: SectionHeaderAlign;
|
|
13587
|
+
/** Id of the heading element. Generated with `useId` when absent. */
|
|
13588
|
+
id?: string;
|
|
13589
|
+
}
|
|
13590
|
+
|
|
13591
|
+
export declare interface SectionProps extends HTMLAttributes<HTMLElement> {
|
|
13592
|
+
/**
|
|
13593
|
+
* `"inverse"` paints the section in the brand color and inverts every color
|
|
13594
|
+
* token inside it, by writing `data-tempest-tone="inverse"`. The tokens are
|
|
13595
|
+
* opt-in, because most apps never paint a section in the brand: they come
|
|
13596
|
+
* from `tempest-react-sdk/styles/inverse.css` for the SDK's own blue, or from
|
|
13597
|
+
* `createTheme({ primary, inverse: createInverseSurface })` for yours, each
|
|
13598
|
+
* measured against the fill (text and muted text at 4.5:1 or more, the focus
|
|
13599
|
+
* ring at 3:1 or more). With neither loaded the attribute matches nothing and
|
|
13600
|
+
* the section keeps the page's tokens — legible, not inverted. The prop
|
|
13601
|
+
* exists so the tone is typed: a typo in a hand-written attribute fails
|
|
13602
|
+
* silently, a typo here fails the build.
|
|
13603
|
+
*/
|
|
13604
|
+
tone?: SectionTone;
|
|
13605
|
+
}
|
|
13606
|
+
|
|
13607
|
+
/** Surface tone a {@link Section} can take. */
|
|
13608
|
+
export declare type SectionTone = "inverse";
|
|
13609
|
+
|
|
13261
13610
|
/**
|
|
13262
13611
|
* iOS-style segmented control. Two-to-five mutually-exclusive options
|
|
13263
13612
|
* rendered as a single connected pill bar.
|