tempest-react-sdk 0.73.0 → 0.75.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/BrazilMap.module.cjs.map +1 -1
- package/dist/br/BrazilMap.module.js.map +1 -1
- 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/br/MunicipalitySearch.cjs +1 -1
- package/dist/br/MunicipalitySearch.cjs.map +1 -1
- package/dist/br/MunicipalitySearch.js +66 -48
- package/dist/br/MunicipalitySearch.js.map +1 -1
- package/dist/br/MunicipalitySearch.module.cjs +1 -1
- package/dist/br/MunicipalitySearch.module.cjs.map +1 -1
- package/dist/br/MunicipalitySearch.module.js +4 -3
- package/dist/br/MunicipalitySearch.module.js.map +1 -1
- package/dist/br.d.ts +12 -0
- package/dist/components/AIChat/AIChat.module.cjs.map +1 -1
- package/dist/components/AIChat/AIChat.module.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/AppBar/AppBar.cjs +1 -1
- package/dist/components/AppBar/AppBar.cjs.map +1 -1
- package/dist/components/AppBar/AppBar.js +1 -0
- package/dist/components/AppBar/AppBar.js.map +1 -1
- package/dist/components/AppBar/AppBar.module.cjs +1 -1
- package/dist/components/AppBar/AppBar.module.cjs.map +1 -1
- package/dist/components/AppBar/AppBar.module.js +12 -11
- package/dist/components/AppBar/AppBar.module.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/Carousel/Carousel.module.cjs.map +1 -1
- package/dist/components/Carousel/Carousel.module.js.map +1 -1
- package/dist/components/Chat/Chat.module.cjs.map +1 -1
- package/dist/components/Chat/Chat.module.js.map +1 -1
- 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/Combobox/Combobox.cjs +1 -1
- package/dist/components/Combobox/Combobox.cjs.map +1 -1
- package/dist/components/Combobox/Combobox.js +18 -23
- package/dist/components/Combobox/Combobox.js.map +1 -1
- package/dist/components/Combobox/use-listbox-dismiss.cjs +2 -0
- package/dist/components/Combobox/use-listbox-dismiss.cjs.map +1 -0
- package/dist/components/Combobox/use-listbox-dismiss.js +34 -0
- package/dist/components/Combobox/use-listbox-dismiss.js.map +1 -0
- package/dist/components/Dropzone/Dropzone.module.cjs.map +1 -1
- package/dist/components/Dropzone/Dropzone.module.js.map +1 -1
- package/dist/components/FilterBar/FilterBar.module.cjs.map +1 -1
- package/dist/components/FilterBar/FilterBar.module.js.map +1 -1
- package/dist/components/FloatingActionButton/FloatingActionButton.module.cjs.map +1 -1
- package/dist/components/FloatingActionButton/FloatingActionButton.module.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/ImageCropper/ImageCropper.module.cjs.map +1 -1
- package/dist/components/ImageCropper/ImageCropper.module.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/ListTile/ListTile.module.cjs.map +1 -1
- package/dist/components/ListTile/ListTile.module.js.map +1 -1
- package/dist/components/Markdown/Markdown.module.cjs.map +1 -1
- package/dist/components/Markdown/Markdown.module.js.map +1 -1
- package/dist/components/Menubar/Menubar.module.cjs.map +1 -1
- package/dist/components/Menubar/Menubar.module.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/MultiSelect/MultiSelect.cjs +1 -1
- package/dist/components/MultiSelect/MultiSelect.cjs.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.js +55 -54
- package/dist/components/MultiSelect/MultiSelect.js.map +1 -1
- package/dist/components/Navbar/Navbar.cjs +1 -1
- package/dist/components/Navbar/Navbar.cjs.map +1 -1
- package/dist/components/Navbar/Navbar.js +1 -0
- package/dist/components/Navbar/Navbar.js.map +1 -1
- package/dist/components/Navbar/Navbar.module.cjs +1 -1
- package/dist/components/Navbar/Navbar.module.cjs.map +1 -1
- package/dist/components/Navbar/Navbar.module.js +9 -8
- package/dist/components/Navbar/Navbar.module.js.map +1 -1
- package/dist/components/NavigationMenu/NavigationMenu.module.cjs.map +1 -1
- package/dist/components/NavigationMenu/NavigationMenu.module.js.map +1 -1
- package/dist/components/NavigationRail/NavigationRail.module.cjs.map +1 -1
- package/dist/components/NavigationRail/NavigationRail.module.js.map +1 -1
- package/dist/components/NotificationCenter/NotificationCenter.module.cjs.map +1 -1
- package/dist/components/NotificationCenter/NotificationCenter.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/PasswordInput/PasswordInput.module.cjs.map +1 -1
- package/dist/components/PasswordInput/PasswordInput.module.js.map +1 -1
- package/dist/components/PinInput/PinInput.module.cjs.map +1 -1
- package/dist/components/PinInput/PinInput.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 +66 -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/components/Tour/Tour.module.cjs.map +1 -1
- package/dist/components/Tour/Tour.module.js.map +1 -1
- package/dist/components/Transfer/Transfer.module.cjs.map +1 -1
- package/dist/components/Transfer/Transfer.module.js.map +1 -1
- package/dist/components/VirtualTable/VirtualTable.module.cjs.map +1 -1
- package/dist/components/VirtualTable/VirtualTable.module.js.map +1 -1
- package/dist/geo/TrajectoryMap.module.cjs.map +1 -1
- package/dist/geo/TrajectoryMap.module.js.map +1 -1
- package/dist/icons/IconPicker.module.cjs.map +1 -1
- package/dist/icons/IconPicker.module.js.map +1 -1
- package/dist/styles/Reveal.css +2 -0
- package/dist/styles/SectionHeader.css +2 -0
- package/dist/styles/actions.css +26 -24
- package/dist/styles/base.css +3 -1
- package/dist/styles/br.css +3 -3
- package/dist/styles/chat.css +5 -5
- package/dist/styles/component/AIChat.css +3 -3
- package/dist/styles/component/AppBar.css +1 -0
- package/dist/styles/component/AppShell.css +1 -1
- package/dist/styles/component/BrazilMap.css +2 -2
- package/dist/styles/component/Button.css +25 -23
- package/dist/styles/component/Carousel.css +3 -3
- package/dist/styles/component/Chat.css +2 -2
- package/dist/styles/component/Dropzone.css +2 -1
- package/dist/styles/component/FilterBar.css +2 -2
- package/dist/styles/component/FloatingActionButton.css +1 -1
- package/dist/styles/component/IconPicker.css +1 -1
- package/dist/styles/component/ImageCropper.css +2 -2
- package/dist/styles/component/ListTile.css +1 -1
- package/dist/styles/component/Markdown.css +1 -1
- package/dist/styles/component/Menubar.css +1 -1
- package/dist/styles/component/Modal.css +2 -2
- package/dist/styles/component/MunicipalitySearch.css +1 -1
- package/dist/styles/component/Navbar.css +1 -0
- package/dist/styles/component/NavigationMenu.css +1 -1
- package/dist/styles/component/NavigationRail.css +1 -1
- package/dist/styles/component/NotificationCenter.css +3 -3
- package/dist/styles/component/Page.css +0 -6
- package/dist/styles/component/PasswordInput.css +1 -1
- package/dist/styles/component/PinInput.css +1 -1
- 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/component/Tour.css +2 -2
- package/dist/styles/component/TrajectoryMap.css +1 -1
- package/dist/styles/component/Transfer.css +2 -2
- package/dist/styles/component/VirtualTable.css +2 -2
- package/dist/styles/core.css +3 -1
- package/dist/styles/data.css +15 -15
- package/dist/styles/feedback.css +3 -3
- package/dist/styles/forms.css +6 -5
- package/dist/styles/geo.css +1 -1
- package/dist/styles/icons.css +1 -1
- package/dist/styles/inverse.css +372 -0
- package/dist/styles/layout.css +9 -7
- package/dist/styles/manifest.json +14 -1
- package/dist/styles/navigation.css +8 -6
- 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 +473 -11
- 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 +72 -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-restore.cjs +5 -0
- package/dist/theme/inverse-restore.cjs.map +1 -0
- package/dist/theme/inverse-restore.js +30 -0
- package/dist/theme/inverse-restore.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 +255 -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/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 +1 -1
|
@@ -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';
|
|
@@ -975,7 +976,22 @@ export declare interface AppBarProps extends Omit<HTMLAttributes<HTMLElement>, "
|
|
|
975
976
|
* development the bar says so in the console when it detects it.
|
|
976
977
|
*/
|
|
977
978
|
sticky?: boolean;
|
|
978
|
-
/**
|
|
979
|
+
/**
|
|
980
|
+
* Visual tone. Default `"surface"`.
|
|
981
|
+
*
|
|
982
|
+
* `"inverse"` writes `data-tempest-tone="inverse"` and paints the bar with the
|
|
983
|
+
* inverse surface's `--tempest-bg`, so the back button, the title and the
|
|
984
|
+
* components in `actions` invert with it. The tokens are opt-in:
|
|
985
|
+
* `tempest-react-sdk/styles/inverse.css` for the SDK's own blue, or
|
|
986
|
+
* `createTheme({ primary, inverse: createInverseSurface })` for yours. With
|
|
987
|
+
* neither loaded the bar falls back to the page's `--tempest-bg` and
|
|
988
|
+
* `--tempest-text` — legible, not inverted.
|
|
989
|
+
*
|
|
990
|
+
* A separate tone rather than a change to `"primary"`, because the inverse
|
|
991
|
+
* fill is not always the brand's `500`: for `#0066ff` it is the `800`
|
|
992
|
+
* (`#042e75`), and turning `"primary"` into it would repaint every bar that
|
|
993
|
+
* uses it today.
|
|
994
|
+
*/
|
|
979
995
|
tone?: AppBarTone;
|
|
980
996
|
/** Thin bottom border. Default `true`. */
|
|
981
997
|
bordered?: boolean;
|
|
@@ -983,7 +999,21 @@ export declare interface AppBarProps extends Omit<HTMLAttributes<HTMLElement>, "
|
|
|
983
999
|
safeArea?: boolean;
|
|
984
1000
|
}
|
|
985
1001
|
|
|
986
|
-
|
|
1002
|
+
/**
|
|
1003
|
+
* Visual tone of an {@link AppBar}.
|
|
1004
|
+
*
|
|
1005
|
+
* - `"surface"` — the page's surface and text.
|
|
1006
|
+
* - `"primary"` — the brand fill (`--tempest-primary`) with
|
|
1007
|
+
* `--tempest-primary-foreground` ink. Only the bar's own text and back button
|
|
1008
|
+
* follow the fill: components in `actions` keep the page's tokens. Measured in
|
|
1009
|
+
* Chromium over the SDK's `#0066ff`, a primary `Button` inside it has the same
|
|
1010
|
+
* color as the bar (1:1) and its focus ring reads 1.41:1.
|
|
1011
|
+
* - `"inverse"` — the inverse surface: every color token inverted inside the bar,
|
|
1012
|
+
* so the components in it are measured against the fill. See
|
|
1013
|
+
* {@link AppBarProps.tone}.
|
|
1014
|
+
* - `"transparent"` — no background; the text inherits.
|
|
1015
|
+
*/
|
|
1016
|
+
export declare type AppBarTone = "surface" | "primary" | "inverse" | "transparent";
|
|
987
1017
|
|
|
988
1018
|
/**
|
|
989
1019
|
* The `code` and `message` a thrown value becomes on the wire.
|
|
@@ -2263,13 +2293,64 @@ export declare function buildOpenInChromeIntent(): string | null;
|
|
|
2263
2293
|
*
|
|
2264
2294
|
* Sizes are density-aware — they read from `--tempest-control-height-*`
|
|
2265
2295
|
* tokens which respond to the `data-tempest-density` attribute.
|
|
2296
|
+
*
|
|
2297
|
+
* With `href` it renders an `<a>` with the same look: a call to action that
|
|
2298
|
+
* navigates keeps the middle click, Ctrl+click, "open in new tab" and the URL
|
|
2299
|
+
* preview, which a `<button>` calling `location.assign` loses. `target="_blank"`
|
|
2300
|
+
* gets `noopener noreferrer`. An `<a>` has no `disabled`, so a disabled or loading
|
|
2301
|
+
* link gets `aria-disabled="true"`, `role="link"`, `tabIndex={-1}`, no `href`, and
|
|
2302
|
+
* its click and middle-click cancelled.
|
|
2303
|
+
*
|
|
2304
|
+
* To style another element — a react-router `Link` — use {@link ButtonSlot}. It is
|
|
2305
|
+
* a separate component, not an `asChild` prop, so an app that never uses it does
|
|
2306
|
+
* not ship the prop merge and ref composition it needs.
|
|
2307
|
+
*
|
|
2308
|
+
* The ref is typed per mode: `HTMLButtonElement`, or `HTMLAnchorElement` with
|
|
2309
|
+
* `href`. `forwardRef` takes one ref type for all props, so its result is re-typed
|
|
2310
|
+
* to the per-mode union — the runtime is plain `forwardRef`.
|
|
2311
|
+
*
|
|
2312
|
+
* @example
|
|
2313
|
+
* <Button onClick={save}>Salvar</Button>
|
|
2314
|
+
*
|
|
2315
|
+
* @example
|
|
2316
|
+
* <Button href="https://wa.me/5586999999999" target="_blank" rightIcon={<ExternalLink />}>
|
|
2317
|
+
* Fale conosco
|
|
2318
|
+
* </Button>
|
|
2266
2319
|
*/
|
|
2267
|
-
export declare
|
|
2320
|
+
export declare const Button: ButtonComponent;
|
|
2268
2321
|
|
|
2269
|
-
|
|
2322
|
+
/** `Button` rendering a native `<button>` — the default, when `href` is not set. */
|
|
2323
|
+
export declare interface ButtonAsButtonProps extends ButtonBaseProps, ButtonHTMLAttributes<HTMLButtonElement> {
|
|
2324
|
+
href?: undefined;
|
|
2325
|
+
}
|
|
2326
|
+
|
|
2327
|
+
/**
|
|
2328
|
+
* `Button` rendering an `<a href>` — a call to action that navigates.
|
|
2329
|
+
*
|
|
2330
|
+
* `type` is a `<button>` attribute and is rejected here; `target` and `rel` are
|
|
2331
|
+
* forwarded, and `target="_blank"` always gets `noopener noreferrer` added.
|
|
2332
|
+
*/
|
|
2333
|
+
export declare interface ButtonAsLinkProps extends ButtonBaseProps, Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "href" | "type"> {
|
|
2334
|
+
/** Destination. Its presence is what makes the button an `<a>`. */
|
|
2335
|
+
href: string;
|
|
2336
|
+
type?: never;
|
|
2337
|
+
}
|
|
2338
|
+
|
|
2339
|
+
/** The look of the button — shared by `Button` (`<button>` or `<a>`) and `ButtonSlot`. */
|
|
2340
|
+
export declare interface ButtonBaseProps {
|
|
2270
2341
|
variant?: ButtonVariant;
|
|
2271
2342
|
size?: ButtonSize;
|
|
2343
|
+
/**
|
|
2344
|
+
* Shows the spinner, keeps the width, sets `aria-busy` and blocks activation —
|
|
2345
|
+
* a `<button>` gets `disabled`, a link gets the disabled-link semantics.
|
|
2346
|
+
*/
|
|
2272
2347
|
loading?: boolean;
|
|
2348
|
+
/**
|
|
2349
|
+
* Blocks activation. On a `<button>` this is the native `disabled`; an `<a>` has
|
|
2350
|
+
* no such attribute, so a link gets `aria-disabled="true"`, `tabIndex={-1}` and
|
|
2351
|
+
* no navigable `href` instead.
|
|
2352
|
+
*/
|
|
2353
|
+
disabled?: boolean;
|
|
2273
2354
|
fullWidth?: boolean;
|
|
2274
2355
|
/** Removes horizontal padding and forces a square footprint (use with `aria-label`). */
|
|
2275
2356
|
iconOnly?: boolean;
|
|
@@ -2279,8 +2360,58 @@ export declare interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElem
|
|
|
2279
2360
|
rightIcon?: ReactNode;
|
|
2280
2361
|
}
|
|
2281
2362
|
|
|
2363
|
+
/** `Button`'s call signature: one props union, each member with its own ref type. */
|
|
2364
|
+
declare type ButtonComponent = ((props: ButtonPropsWithRef) => ReactElement) & {
|
|
2365
|
+
displayName?: string;
|
|
2366
|
+
};
|
|
2367
|
+
|
|
2368
|
+
export declare type ButtonProps = ButtonAsButtonProps | ButtonAsLinkProps;
|
|
2369
|
+
|
|
2370
|
+
/**
|
|
2371
|
+
* Each mode's props with the ref type of the element it renders, so a `ref` to an
|
|
2372
|
+
* `HTMLButtonElement` on a link is a type error.
|
|
2373
|
+
*/
|
|
2374
|
+
declare type ButtonPropsWithRef = (ButtonAsButtonProps & RefAttributes<HTMLButtonElement>) | (ButtonAsLinkProps & RefAttributes<HTMLAnchorElement>);
|
|
2375
|
+
|
|
2282
2376
|
export declare type ButtonSize = "xs" | "sm" | "md" | "lg" | "xl";
|
|
2283
2377
|
|
|
2378
|
+
/**
|
|
2379
|
+
* Lends the `Button` look to its single child element instead of rendering one —
|
|
2380
|
+
* the `asChild`/Slot pattern. `<ButtonSlot><Link to="/x">Go</Link></ButtonSlot>`
|
|
2381
|
+
* styles a react-router `Link`, so the route changes without a reload, and no
|
|
2382
|
+
* router is imported here.
|
|
2383
|
+
*
|
|
2384
|
+
* It is a component of its own rather than an `asChild` prop on `Button` because
|
|
2385
|
+
* of what it costs: the prop merge and ref composition are ~0.6 kB brotli, and a
|
|
2386
|
+
* prop is a runtime branch no bundler can drop, so every app using `Button` paid
|
|
2387
|
+
* for it. As a separate export it is tree-shaken away where unused.
|
|
2388
|
+
*
|
|
2389
|
+
* Merge rules: classes are joined (a function `className`, as `NavLink` takes,
|
|
2390
|
+
* stays a function); `ButtonSlot`'s props win over the child's, because they carry
|
|
2391
|
+
* the disabled semantics; handlers run `ButtonSlot`'s first and skip the child's
|
|
2392
|
+
* when the event was prevented; both refs receive the node. A child with
|
|
2393
|
+
* `target="_blank"` gets `noopener noreferrer`.
|
|
2394
|
+
*
|
|
2395
|
+
* Disabled or loading: `aria-disabled="true"`, `tabIndex={-1}`, click and
|
|
2396
|
+
* middle-click cancelled — a router `Link` then skips its navigation because the
|
|
2397
|
+
* event arrives prevented. A plain `<a href>` child also loses the `href` and gets
|
|
2398
|
+
* `role="link"`; a `Link` computes its own `href`, which stays in the DOM.
|
|
2399
|
+
*
|
|
2400
|
+
* @example
|
|
2401
|
+
* <ButtonSlot variant="outline">
|
|
2402
|
+
* <Link to="/planos">Ver planos</Link>
|
|
2403
|
+
* </ButtonSlot>
|
|
2404
|
+
*
|
|
2405
|
+
* @throws {Error} When `children` is not a single React element.
|
|
2406
|
+
*/
|
|
2407
|
+
export declare const ButtonSlot: ForwardRefExoticComponent<ButtonSlotProps & RefAttributes<HTMLElement>>;
|
|
2408
|
+
|
|
2409
|
+
/** Props of {@link ButtonSlot}: the `Button` look, applied to the single child. */
|
|
2410
|
+
export declare interface ButtonSlotProps extends ButtonBaseProps, Omit<HTMLAttributes<HTMLElement>, "children"> {
|
|
2411
|
+
/** The one element that receives the classes, props and ref — e.g. a router `Link`. */
|
|
2412
|
+
children: ReactElement;
|
|
2413
|
+
}
|
|
2414
|
+
|
|
2284
2415
|
export declare type ButtonVariant = "primary" | "secondary" | "danger" | "success" | "ghost" | "soft" | "outline" | "link";
|
|
2285
2416
|
|
|
2286
2417
|
/**
|
|
@@ -3122,7 +3253,9 @@ declare interface ColorScaleOptions {
|
|
|
3122
3253
|
* Combobox — text input with a filterable dropdown of options.
|
|
3123
3254
|
*
|
|
3124
3255
|
* Selecting an option fires `onChange(value)`. Typing filters the list.
|
|
3125
|
-
* Keyboard: ArrowUp/ArrowDown to navigate
|
|
3256
|
+
* Keyboard: ArrowUp/ArrowDown to navigate — the active option is announced
|
|
3257
|
+
* through `aria-activedescendant`, focus stays on the input — Enter to select,
|
|
3258
|
+
* Esc to close, and Tab/Shift+Tab leave the field closing the list.
|
|
3126
3259
|
*/
|
|
3127
3260
|
export declare function Combobox({ options, value, onChange, label, placeholder, helperText, error, disabled, filter, emptyMessage, portal, className, }: ComboboxProps): JSX.Element;
|
|
3128
3261
|
|
|
@@ -3937,6 +4070,30 @@ export declare function createInMemoryFlags(options?: InMemoryFlagsOptions): Fea
|
|
|
3937
4070
|
set: (key: string, value: FlagValue) => void;
|
|
3938
4071
|
};
|
|
3939
4072
|
|
|
4073
|
+
/**
|
|
4074
|
+
* Build the inverse surface for a brand.
|
|
4075
|
+
*
|
|
4076
|
+
* The fill is the brand's own `500` whenever it can carry the scheme, and
|
|
4077
|
+
* otherwise the nearest ramp step that can (see {@link FILL_CANDIDATES}). Whether
|
|
4078
|
+
* the surface reads light-on-dark or dark-on-light follows the fill, so a yellow
|
|
4079
|
+
* brand gets dark ink and a navy one white — the same pick `createTheme` makes
|
|
4080
|
+
* for `--tempest-primary-foreground`.
|
|
4081
|
+
*
|
|
4082
|
+
* The values are literal colors, not references to the page's ramp, so the
|
|
4083
|
+
* section paints the same in the light and the dark page scheme: the brand is
|
|
4084
|
+
* the brand in both.
|
|
4085
|
+
*
|
|
4086
|
+
* The result also carries the rules that let a region inside the surface go
|
|
4087
|
+
* back to the page's tokens (`data-tempest-tone="default"`), written for the
|
|
4088
|
+
* selectors in `options`.
|
|
4089
|
+
*
|
|
4090
|
+
* @param options - The brand, plus the status and chart colors the theme names
|
|
4091
|
+
* and the selectors the surface and the page are written under.
|
|
4092
|
+
* @returns The token map, the scheme it reads as, the fill step used and the
|
|
4093
|
+
* default-tone rules.
|
|
4094
|
+
*/
|
|
4095
|
+
export declare function createInverseSurface(options: InverseSurfaceOptions): InverseSurface;
|
|
4096
|
+
|
|
3940
4097
|
/**
|
|
3941
4098
|
* Build a typed `localStorage` wrapper around a codec.
|
|
3942
4099
|
*
|
|
@@ -4834,6 +4991,25 @@ export declare interface CreateThemeOptions {
|
|
|
4834
4991
|
selector?: string;
|
|
4835
4992
|
/** Selector the dark tokens are written under. Default `'[data-tempest-theme="dark"]'`. */
|
|
4836
4993
|
darkSelector?: string;
|
|
4994
|
+
/**
|
|
4995
|
+
* Also emit the inverse surface — the token set for a section painted in the
|
|
4996
|
+
* brand color — by passing its generator, `createInverseSurface`. Off by
|
|
4997
|
+
* default; ignored without `primary`.
|
|
4998
|
+
*
|
|
4999
|
+
* The generator is passed in rather than switched on with `true` so that
|
|
5000
|
+
* `createTheme` never imports it: an app that does not paint a section in
|
|
5001
|
+
* its brand does not ship the 1.68 kB brotli it costs.
|
|
5002
|
+
*
|
|
5003
|
+
* @example
|
|
5004
|
+
* ```ts
|
|
5005
|
+
* import { createInverseSurface, createTheme } from "tempest-react-sdk";
|
|
5006
|
+
*
|
|
5007
|
+
* createTheme({ primary: "#03184b", inverse: createInverseSurface });
|
|
5008
|
+
* ```
|
|
5009
|
+
*/
|
|
5010
|
+
inverse?: InverseSurfaceGenerator;
|
|
5011
|
+
/** Selector the inverse tokens are written under. Default `'[data-tempest-tone="inverse"]'`. */
|
|
5012
|
+
inverseSelector?: string;
|
|
4837
5013
|
}
|
|
4838
5014
|
|
|
4839
5015
|
/**
|
|
@@ -7434,6 +7610,13 @@ export declare interface FormRowProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
7434
7610
|
* Has its own `layout`/`columns`/`gap` so subsets can stack while the parent
|
|
7435
7611
|
* grids (or vice versa).
|
|
7436
7612
|
*
|
|
7613
|
+
* The header is deliberately not a `SectionHeader`: a field group sits one step
|
|
7614
|
+
* below a page section, and its title is `text-lg` / semibold / `leading-snug`
|
|
7615
|
+
* with `space-3` below, against `text-2xl` / bold / `leading-tight` with
|
|
7616
|
+
* `space-5` for `SectionHeader`. Sharing the component would either grow every
|
|
7617
|
+
* form group to page-section size or add a size switch to `SectionHeader` that
|
|
7618
|
+
* only this caller uses.
|
|
7619
|
+
*
|
|
7437
7620
|
* @example
|
|
7438
7621
|
* <FormSection title="Endereço" description="Usado para entrega" layout="grid" columns={3}>
|
|
7439
7622
|
* <Input label="CEP" />
|
|
@@ -7463,6 +7646,12 @@ export declare interface GeneratedTheme {
|
|
|
7463
7646
|
light: Record<string, string>;
|
|
7464
7647
|
/** Dark-scheme custom properties. */
|
|
7465
7648
|
dark: Record<string, string>;
|
|
7649
|
+
/**
|
|
7650
|
+
* Inverse-surface custom properties — literal colors, identical under the
|
|
7651
|
+
* light and the dark page scheme. Present only when the theme names a
|
|
7652
|
+
* `primary` and passes `inverse`.
|
|
7653
|
+
*/
|
|
7654
|
+
inverse?: Record<string, string>;
|
|
7466
7655
|
/** Both blocks rendered as CSS, ready for {@link applyTheme} or a stylesheet. */
|
|
7467
7656
|
css: string;
|
|
7468
7657
|
}
|
|
@@ -8162,7 +8351,9 @@ export declare interface InstallBannerProps {
|
|
|
8162
8351
|
* Nothing renders only when there is genuinely nothing to offer — already
|
|
8163
8352
|
* installed, running standalone, or inside the decline cooldown.
|
|
8164
8353
|
*
|
|
8165
|
-
* Inherits every {@link Button} prop (`variant`, `size`,
|
|
8354
|
+
* Inherits every {@link Button} prop of the `<button>` mode (`variant`, `size`,
|
|
8355
|
+
* `leftIcon`, …) but not `href`: its click opens the install prompt
|
|
8356
|
+
* or toggles the instruction, which is an action, not a navigation.
|
|
8166
8357
|
*
|
|
8167
8358
|
* @example
|
|
8168
8359
|
* <InstallButton variant="primary" leftIcon={<Download />} />
|
|
@@ -8172,7 +8363,7 @@ export declare interface InstallBannerProps {
|
|
|
8172
8363
|
*/
|
|
8173
8364
|
export declare function InstallButton({ label, hintLabel, onResult, renderHint, manualFallbackDelayMs, wrapperClassName, ...props }: InstallButtonProps): JSX.Element | null;
|
|
8174
8365
|
|
|
8175
|
-
export declare interface InstallButtonProps extends Omit<
|
|
8366
|
+
export declare interface InstallButtonProps extends Omit<ButtonAsButtonProps, "onClick" | "children"> {
|
|
8176
8367
|
/** Button label. Default `"Instalar app"`. */
|
|
8177
8368
|
label?: ReactNode;
|
|
8178
8369
|
/**
|
|
@@ -8318,6 +8509,66 @@ export declare function installSkipWaitingListener(): void;
|
|
|
8318
8509
|
|
|
8319
8510
|
export declare type InterpolationValues = Record<string, string | number>;
|
|
8320
8511
|
|
|
8512
|
+
/** Which way the inverse surface reads: light ink on a dark fill, or the reverse. */
|
|
8513
|
+
export declare type InverseScheme = "light" | "dark";
|
|
8514
|
+
|
|
8515
|
+
/** The inverse surface for one brand. */
|
|
8516
|
+
export declare interface InverseSurface {
|
|
8517
|
+
/** Every color custom property the surface redefines, as literal colors. */
|
|
8518
|
+
tokens: Record<string, string>;
|
|
8519
|
+
/**
|
|
8520
|
+
* `"dark"` when the fill carries light ink (a navy brand), `"light"` when it
|
|
8521
|
+
* carries dark ink (a yellow brand). Written as `color-scheme`, so native
|
|
8522
|
+
* controls inside the section follow the fill rather than the page.
|
|
8523
|
+
*/
|
|
8524
|
+
scheme: InverseScheme;
|
|
8525
|
+
/** Step of the brand's light ramp used as the fill. */
|
|
8526
|
+
step: ScaleStep;
|
|
8527
|
+
/**
|
|
8528
|
+
* CSS written after the surface: the rules that let a region inside it go
|
|
8529
|
+
* back to the page's tokens with `data-tempest-tone="default"`. Rendered by
|
|
8530
|
+
* the generator, so `createTheme` alone does not ship the code that writes it.
|
|
8531
|
+
*/
|
|
8532
|
+
rules?: string;
|
|
8533
|
+
}
|
|
8534
|
+
|
|
8535
|
+
/**
|
|
8536
|
+
* The inverse-surface generator `createTheme` calls when it is handed one —
|
|
8537
|
+
* in practice `createInverseSurface`.
|
|
8538
|
+
*
|
|
8539
|
+
* A function rather than a flag on purpose: `createTheme` never imports the
|
|
8540
|
+
* generator, so an app that does not paint a section in its brand does not ship
|
|
8541
|
+
* it. Measured with `npx size-limit`, `{ createTheme }` is 3.18 kB brotli on its
|
|
8542
|
+
* own and 4.86 kB with the generator inside it — what a boolean option would
|
|
8543
|
+
* have charged every theme.
|
|
8544
|
+
*/
|
|
8545
|
+
export declare type InverseSurfaceGenerator = (options: InverseSurfaceOptions) => InverseSurface;
|
|
8546
|
+
|
|
8547
|
+
/** Input for an {@link InverseSurfaceGenerator} — `createInverseSurface`. */
|
|
8548
|
+
export declare interface InverseSurfaceOptions {
|
|
8549
|
+
/** Brand color — the fill is picked from its ramp. */
|
|
8550
|
+
primary: string;
|
|
8551
|
+
/**
|
|
8552
|
+
* Status colors the theme names; the rest use the SDK's defaults. A named
|
|
8553
|
+
* `danger` is also the warm pole of the diverging chart scale, as on the page.
|
|
8554
|
+
*/
|
|
8555
|
+
statuses?: Partial<Record<ThemeStatus, string>>;
|
|
8556
|
+
/** Categorical chart colors the theme names; else the SDK's defaults. */
|
|
8557
|
+
chart?: readonly string[];
|
|
8558
|
+
/**
|
|
8559
|
+
* Selector the surface is written under, which the default-tone rules keep
|
|
8560
|
+
* out of the elements that save the page's values. Default
|
|
8561
|
+
* `'[data-tempest-tone="inverse"]'`.
|
|
8562
|
+
*/
|
|
8563
|
+
selector?: string;
|
|
8564
|
+
/**
|
|
8565
|
+
* Selectors the page's schemes are written under, so a region restores a
|
|
8566
|
+
* theme scoped to them too. Default `createTheme`'s: `:root` and
|
|
8567
|
+
* `'[data-tempest-theme="dark"]'`.
|
|
8568
|
+
*/
|
|
8569
|
+
page?: PageSelectors;
|
|
8570
|
+
}
|
|
8571
|
+
|
|
8321
8572
|
/**
|
|
8322
8573
|
* Detects any Android browser.
|
|
8323
8574
|
*
|
|
@@ -10019,8 +10270,10 @@ export declare function moveItem<T>(items: T[], from: number, to: number): T[];
|
|
|
10019
10270
|
* removable chips inside the field. Selecting toggles a value; Backspace on an
|
|
10020
10271
|
* empty query removes the last chip.
|
|
10021
10272
|
*
|
|
10022
|
-
* Keyboard: ArrowUp/ArrowDown navigate
|
|
10023
|
-
*
|
|
10273
|
+
* Keyboard: ArrowUp/ArrowDown navigate — the active option is announced through
|
|
10274
|
+
* `aria-activedescendant`, focus stays on the input — Enter toggles the active
|
|
10275
|
+
* option, Esc closes, Backspace (empty input) pops the last chip, and
|
|
10276
|
+
* Tab/Shift+Tab leave the field closing the list.
|
|
10024
10277
|
*/
|
|
10025
10278
|
export declare function MultiSelect({ options, value, onChange, label, placeholder, helperText, error, disabled, maxItems, filter, emptyMessage, portal, className, }: MultiSelectProps): JSX.Element;
|
|
10026
10279
|
|
|
@@ -10085,13 +10338,41 @@ export declare interface NavbarProps extends HTMLAttributes<HTMLElement> {
|
|
|
10085
10338
|
actions?: ReactNode;
|
|
10086
10339
|
/** Make the bar sticky at the top of the scroll container. Default `true`. */
|
|
10087
10340
|
sticky?: boolean;
|
|
10088
|
-
/**
|
|
10341
|
+
/**
|
|
10342
|
+
* Visual tone. Default `"surface"`.
|
|
10343
|
+
*
|
|
10344
|
+
* `"inverse"` writes `data-tempest-tone="inverse"` and paints the bar with the
|
|
10345
|
+
* inverse surface's `--tempest-bg`, so the components in the slots invert with
|
|
10346
|
+
* it. The tokens are opt-in: `tempest-react-sdk/styles/inverse.css` for the
|
|
10347
|
+
* SDK's own blue, or `createTheme({ primary, inverse: createInverseSurface })`
|
|
10348
|
+
* for yours. With neither loaded the bar falls back to the page's
|
|
10349
|
+
* `--tempest-bg` and `--tempest-text` — legible, not inverted.
|
|
10350
|
+
*
|
|
10351
|
+
* A separate tone rather than a change to `"primary"`, because the inverse
|
|
10352
|
+
* fill is not always the brand's `500`: for `#0066ff` it is the `800`
|
|
10353
|
+
* (`#042e75`), and turning `"primary"` into it would repaint every bar that
|
|
10354
|
+
* uses it today.
|
|
10355
|
+
*/
|
|
10089
10356
|
tone?: NavbarTone;
|
|
10090
10357
|
/** When set, renders a thin bottom border. Default `true`. */
|
|
10091
10358
|
bordered?: boolean;
|
|
10092
10359
|
}
|
|
10093
10360
|
|
|
10094
|
-
|
|
10361
|
+
/**
|
|
10362
|
+
* Visual tone of a {@link Navbar}.
|
|
10363
|
+
*
|
|
10364
|
+
* - `"surface"` — the page's surface and text.
|
|
10365
|
+
* - `"primary"` — the brand fill (`--tempest-primary`) with
|
|
10366
|
+
* `--tempest-primary-foreground` ink. Only the bar's own text follows the fill:
|
|
10367
|
+
* components inside it keep the page's tokens. Measured in Chromium over the
|
|
10368
|
+
* SDK's `#0066ff`, a link button inside it reads 1:1, muted text 1.59:1 and the
|
|
10369
|
+
* focus ring 1.41:1. Fine for a bar that holds a logo and plain text.
|
|
10370
|
+
* - `"inverse"` — the inverse surface: every color token inverted inside the bar,
|
|
10371
|
+
* so a primary `Button`, a link, the focus ring and muted text are measured
|
|
10372
|
+
* against the fill. See {@link NavbarProps.tone}.
|
|
10373
|
+
* - `"transparent"` — no background; the text inherits.
|
|
10374
|
+
*/
|
|
10375
|
+
export declare type NavbarTone = "surface" | "primary" | "inverse" | "transparent";
|
|
10095
10376
|
|
|
10096
10377
|
export { Navigate }
|
|
10097
10378
|
|
|
@@ -10987,6 +11268,10 @@ declare type OverriddenDomProps_9 = "onSubmit" | "value" | "defaultValue" | "row
|
|
|
10987
11268
|
* Page wrapper with header + (optional) toolbar + content + footer. Pairs
|
|
10988
11269
|
* with `Container` when you want a max-width content well.
|
|
10989
11270
|
*
|
|
11271
|
+
* The header is a `SectionHeader` at `level={1}`, so the page title and the
|
|
11272
|
+
* `<h2>` of each section below it share one look; when every header slot is
|
|
11273
|
+
* empty no `<header>` is rendered.
|
|
11274
|
+
*
|
|
10990
11275
|
* @example
|
|
10991
11276
|
* <Page title="Pedidos" description="Acompanhe seus pedidos" actions={<Button>Novo</Button>}>
|
|
10992
11277
|
* <Table {...} />
|
|
@@ -11012,6 +11297,14 @@ export declare interface PageProps extends Omit<HTMLAttributes<HTMLElement>, "ti
|
|
|
11012
11297
|
children?: ReactNode;
|
|
11013
11298
|
}
|
|
11014
11299
|
|
|
11300
|
+
/** Where the page's schemes are written: the selectors `createTheme` uses. */
|
|
11301
|
+
export declare interface PageSelectors {
|
|
11302
|
+
/** Selector of the light scheme. Default `:root`. */
|
|
11303
|
+
selector: string;
|
|
11304
|
+
/** Selector of the dark scheme. Default `'[data-tempest-theme="dark"]'`. */
|
|
11305
|
+
darkSelector: string;
|
|
11306
|
+
}
|
|
11307
|
+
|
|
11015
11308
|
/**
|
|
11016
11309
|
* Numeric pagination controls. Pair with {@link usePagination} for state.
|
|
11017
11310
|
*
|
|
@@ -12897,6 +13190,70 @@ export declare interface RetryOptions {
|
|
|
12897
13190
|
signal?: AbortSignal;
|
|
12898
13191
|
}
|
|
12899
13192
|
|
|
13193
|
+
/**
|
|
13194
|
+
* Animate content into view the first time it is scrolled to.
|
|
13195
|
+
*
|
|
13196
|
+
* The three failure modes of a hand-rolled version are handled here, not left to
|
|
13197
|
+
* the docs:
|
|
13198
|
+
*
|
|
13199
|
+
* - **Reduced motion.** Under `prefers-reduced-motion: reduce` the stylesheet
|
|
13200
|
+
* pins the element visible with no transform and no transition, whatever
|
|
13201
|
+
* state it is in — so the setting also wins when it changes mid-session.
|
|
13202
|
+
* - **No `IntersectionObserver`** (old engines, some crawlers, tests): the
|
|
13203
|
+
* element stays in the `"static"` state, which is plain visible content. It is
|
|
13204
|
+
* never hidden waiting for an observation that cannot come.
|
|
13205
|
+
* - **Taller than the viewport.** A box three viewports tall never reaches a
|
|
13206
|
+
* ratio of 0.5, so a raw observer with that threshold never reveals it. The
|
|
13207
|
+
* threshold is rescaled by the highest ratio the element can reach (see
|
|
13208
|
+
* `effectiveThreshold`), read from the first observation.
|
|
13209
|
+
*
|
|
13210
|
+
* Content is hidden only when the client can observe: the server snapshot of
|
|
13211
|
+
* `useSyncExternalStore` is `"static"`, so markup rendered without JavaScript —
|
|
13212
|
+
* or before hydration — is visible. The transition is declared on the `"shown"`
|
|
13213
|
+
* state only, so the switch to `"hidden"` on mount is instant instead of a
|
|
13214
|
+
* fade-out, and with `once={false}` leaving the viewport hides without motion.
|
|
13215
|
+
*
|
|
13216
|
+
* With `once={false}` the element hides only once it is fully out of view. Hiding
|
|
13217
|
+
* on the threshold would oscillate: the hidden state translates the box, which
|
|
13218
|
+
* moves it back across the same threshold.
|
|
13219
|
+
*
|
|
13220
|
+
* @example
|
|
13221
|
+
* <ul>
|
|
13222
|
+
* {steps.map((step, index) => (
|
|
13223
|
+
* <Reveal key={step.id} as="li" delay={index * 80}>
|
|
13224
|
+
* {step.title}
|
|
13225
|
+
* </Reveal>
|
|
13226
|
+
* ))}
|
|
13227
|
+
* </ul>
|
|
13228
|
+
*/
|
|
13229
|
+
export declare function Reveal({ as, variant, delay, duration, once, threshold, rootMargin, className, style, children, ...props }: RevealProps): JSX.Element;
|
|
13230
|
+
|
|
13231
|
+
export declare interface RevealProps extends HTMLAttributes<HTMLElement> {
|
|
13232
|
+
/** Intrinsic element to render, e.g. `"li"` inside a list. Defaults to `"div"`. */
|
|
13233
|
+
as?: keyof JSX.IntrinsicElements;
|
|
13234
|
+
/** How the content enters. Defaults to `"up"`. */
|
|
13235
|
+
variant?: RevealVariant;
|
|
13236
|
+
/** Wait before the entrance starts, in ms. Stagger siblings with `index * step`. */
|
|
13237
|
+
delay?: number;
|
|
13238
|
+
/** Length of the entrance, in ms. Defaults to `--tempest-duration-slower`. */
|
|
13239
|
+
duration?: number;
|
|
13240
|
+
/** Reveal once and stop observing. With `false`, it hides again once fully out of view. Defaults to `true`. */
|
|
13241
|
+
once?: boolean;
|
|
13242
|
+
/**
|
|
13243
|
+
* Fraction of the element — or of the viewport, when the element is taller
|
|
13244
|
+
* than it — that must be visible to reveal. Defaults to `0.15`.
|
|
13245
|
+
*/
|
|
13246
|
+
threshold?: number;
|
|
13247
|
+
/** Margin around the root, as in `IntersectionObserver`. Defaults to `"0px"`. */
|
|
13248
|
+
rootMargin?: string;
|
|
13249
|
+
}
|
|
13250
|
+
|
|
13251
|
+
/** Visual state written to `data-state`. */
|
|
13252
|
+
export declare type RevealState = "static" | "hidden" | "shown";
|
|
13253
|
+
|
|
13254
|
+
/** Direction the content travels from, or `"fade"` / `"scale"` for no travel. */
|
|
13255
|
+
export declare type RevealVariant = "fade" | "up" | "down" | "left" | "right" | "scale";
|
|
13256
|
+
|
|
12900
13257
|
/** Serialize sRGB channels (`0`–`1`, clamped) back to a `#rrggbb` string. */
|
|
12901
13258
|
export declare function rgbToHex(r: number, g: number, b: number): string;
|
|
12902
13259
|
|
|
@@ -13258,6 +13615,111 @@ export declare interface SearchBarProps extends Omit<InputHTMLAttributes<HTMLInp
|
|
|
13258
13615
|
wrapperClassName?: string;
|
|
13259
13616
|
}
|
|
13260
13617
|
|
|
13618
|
+
/**
|
|
13619
|
+
* `<section>` that takes its accessible name from the `SectionHeader` inside it.
|
|
13620
|
+
*
|
|
13621
|
+
* A `<section>` is exposed as a `region` landmark only when it has an
|
|
13622
|
+
* accessible name; without one it is an anonymous group and screen-reader
|
|
13623
|
+
* landmark navigation skips it. Wiring `aria-labelledby` to the heading id is
|
|
13624
|
+
* the same mechanical step on every page, so the section does it: every
|
|
13625
|
+
* `SectionHeader` with a `title` below it reaches the section through context
|
|
13626
|
+
* (so wrappers in between do not break the link) and the first one names it;
|
|
13627
|
+
* when it unmounts, the next one takes over. An explicit `aria-labelledby` or
|
|
13628
|
+
* `aria-label` wins over the automatic one, and once mounted with no titled
|
|
13629
|
+
* heading the attribute is left off rather than pointing at nothing.
|
|
13630
|
+
*
|
|
13631
|
+
* The section owns the id (`useId`), so the link is already in the first
|
|
13632
|
+
* render — `renderToString` and the HTML a server sends — where no effect runs.
|
|
13633
|
+
* The parent's attributes are written before any child renders, so the section
|
|
13634
|
+
* cannot know what is below it: it always writes its own id, and the first
|
|
13635
|
+
* titled `SectionHeader` in render order puts that id on its heading. Two
|
|
13636
|
+
* cases cannot be known on the server, and both are settled on hydration
|
|
13637
|
+
* without a mismatch warning: with no titled heading the server attribute is
|
|
13638
|
+
* dropped (until then it resolves to nothing, which Chromium 153 exposes as
|
|
13639
|
+
* the same anonymous group as no attribute at all), and when that first header
|
|
13640
|
+
* has an explicit `id` the attribute moves to it. A consumer that needs the
|
|
13641
|
+
* explicit id in the server HTML passes `aria-labelledby` itself.
|
|
13642
|
+
*
|
|
13643
|
+
* @example
|
|
13644
|
+
* <Section>
|
|
13645
|
+
* <SectionHeader title="Planos" />
|
|
13646
|
+
* <PlanGrid />
|
|
13647
|
+
* </Section>
|
|
13648
|
+
*
|
|
13649
|
+
* @example
|
|
13650
|
+
* <Section tone="inverse">
|
|
13651
|
+
* <SectionHeader title="Comece agora" />
|
|
13652
|
+
* <Button>Criar conta</Button>
|
|
13653
|
+
* </Section>
|
|
13654
|
+
*/
|
|
13655
|
+
export declare function Section({ children, tone, ...props }: SectionProps): JSX.Element;
|
|
13656
|
+
|
|
13657
|
+
/**
|
|
13658
|
+
* Header of a page or of one section of it: eyebrow, title, description and
|
|
13659
|
+
* actions, with the same look `Page` uses for its own header.
|
|
13660
|
+
*
|
|
13661
|
+
* The heading level is a prop because one page needs one `<h1>` and many
|
|
13662
|
+
* `<h2>` that look alike; the visual stays the same at every level so the
|
|
13663
|
+
* outline is picked by meaning, not by size. Inside a `<Section>` the first
|
|
13664
|
+
* titled header takes the section's own id for its heading (unless `id` is
|
|
13665
|
+
* given) and registers it, which is what gives the `region` landmark its
|
|
13666
|
+
* accessible name — in the server HTML too.
|
|
13667
|
+
*
|
|
13668
|
+
* @example
|
|
13669
|
+
* <Section>
|
|
13670
|
+
* <SectionHeader eyebrow="Soluções" title="O que podemos desenvolver" align="center" />
|
|
13671
|
+
* <p>Conteúdo da seção.</p>
|
|
13672
|
+
* </Section>
|
|
13673
|
+
*/
|
|
13674
|
+
export declare function SectionHeader({ title, eyebrow, description, actions, level, align, id, className, ...props }: SectionHeaderProps): JSX.Element | null;
|
|
13675
|
+
|
|
13676
|
+
export declare type SectionHeaderAlign = "start" | "center";
|
|
13677
|
+
|
|
13678
|
+
export declare type SectionHeaderLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
13679
|
+
|
|
13680
|
+
export declare interface SectionHeaderProps extends Omit<HTMLAttributes<HTMLElement>, "title" | "id"> {
|
|
13681
|
+
/** Heading text, rendered as `<h{level}>`. */
|
|
13682
|
+
title?: ReactNode;
|
|
13683
|
+
/** Short label above the title (category, breadcrumbs). */
|
|
13684
|
+
eyebrow?: ReactNode;
|
|
13685
|
+
/** Supporting text rendered below the title. */
|
|
13686
|
+
description?: ReactNode;
|
|
13687
|
+
/** Trailing slot for buttons or menus. */
|
|
13688
|
+
actions?: ReactNode;
|
|
13689
|
+
/** Heading level — semantics only, the look does not change with it. Default `2`. */
|
|
13690
|
+
level?: SectionHeaderLevel;
|
|
13691
|
+
/** Horizontal alignment of the text block. Default `"start"`. */
|
|
13692
|
+
align?: SectionHeaderAlign;
|
|
13693
|
+
/** Id of the heading element. Generated with `useId` when absent. */
|
|
13694
|
+
id?: string;
|
|
13695
|
+
}
|
|
13696
|
+
|
|
13697
|
+
export declare interface SectionProps extends HTMLAttributes<HTMLElement> {
|
|
13698
|
+
/**
|
|
13699
|
+
* `"inverse"` paints the section in the brand color and inverts every color
|
|
13700
|
+
* token inside it, by writing `data-tempest-tone="inverse"`. The tokens are
|
|
13701
|
+
* opt-in, because most apps never paint a section in the brand: they come
|
|
13702
|
+
* from `tempest-react-sdk/styles/inverse.css` for the SDK's own blue, or from
|
|
13703
|
+
* `createTheme({ primary, inverse: createInverseSurface })` for yours, each
|
|
13704
|
+
* measured against the fill (text and muted text at 4.5:1 or more, the focus
|
|
13705
|
+
* ring at 3:1 or more). With neither loaded the attribute matches nothing and
|
|
13706
|
+
* the section keeps the page's tokens — legible, not inverted. The prop
|
|
13707
|
+
* exists so the tone is typed: a typo in a hand-written attribute fails
|
|
13708
|
+
* silently, a typo here fails the build.
|
|
13709
|
+
*
|
|
13710
|
+
* `"default"` hands a region inside an inverse section back to the page's
|
|
13711
|
+
* tokens — light or dark, whichever the page is on — by writing
|
|
13712
|
+
* `data-tempest-tone="default"`: a white form or price card in a navy hero.
|
|
13713
|
+
* The rules ship with the inverse tokens, so it costs nothing until those are
|
|
13714
|
+
* loaded, and outside an inverse section the tokens it restores are the ones
|
|
13715
|
+
* already there.
|
|
13716
|
+
*/
|
|
13717
|
+
tone?: SectionTone;
|
|
13718
|
+
}
|
|
13719
|
+
|
|
13720
|
+
/** Surface tone a {@link Section} can take. */
|
|
13721
|
+
export declare type SectionTone = "inverse" | "default";
|
|
13722
|
+
|
|
13261
13723
|
/**
|
|
13262
13724
|
* iOS-style segmented control. Two-to-five mutually-exclusive options
|
|
13263
13725
|
* rendered as a single connected pill bar.
|