@senvenli/react 0.3.2 → 0.3.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.
Files changed (97) hide show
  1. package/dist/action/fab.d.ts +7 -0
  2. package/dist/action/fab.js +22 -3
  3. package/dist/action/fab.js.map +1 -1
  4. package/dist/collection/data-table.d.ts +1 -1
  5. package/dist/collection/data-table.js +2 -2
  6. package/dist/collection/data-table.js.map +1 -1
  7. package/dist/collection/table.d.ts +7 -2
  8. package/dist/collection/table.js +17 -7
  9. package/dist/collection/table.js.map +1 -1
  10. package/dist/i18n.d.ts +8 -0
  11. package/dist/i18n.js +18 -1
  12. package/dist/i18n.js.map +1 -1
  13. package/dist/navigation/index.d.ts +2 -2
  14. package/dist/navigation/index.js +1 -1
  15. package/dist/navigation/index.js.map +1 -1
  16. package/dist/navigation/sidebar.d.ts +18 -0
  17. package/dist/navigation/sidebar.js +26 -2
  18. package/dist/navigation/sidebar.js.map +1 -1
  19. package/dist/overlay/floating.js +4 -1
  20. package/dist/overlay/floating.js.map +1 -1
  21. package/dist/overlay/index.d.ts +2 -0
  22. package/dist/overlay/index.js +2 -1
  23. package/dist/overlay/index.js.map +1 -1
  24. package/dist/overlay/tour.d.ts +88 -0
  25. package/dist/overlay/tour.js +302 -0
  26. package/dist/overlay/tour.js.map +1 -0
  27. package/manifests/data-table.json +1 -1
  28. package/manifests/index.json +2 -1
  29. package/manifests/sidebar.json +55 -2
  30. package/manifests/table.json +2 -2
  31. package/package.json +2 -2
  32. package/dist/action/files.d.ts +0 -70
  33. package/dist/action/files.js +0 -156
  34. package/dist/action/files.js.map +0 -1
  35. package/dist/action/theme-toggle.d.ts +0 -43
  36. package/dist/action/theme-toggle.js +0 -259
  37. package/dist/action/theme-toggle.js.map +0 -1
  38. package/dist/display/image-crop.d.ts +0 -106
  39. package/dist/display/image-crop.js +0 -117
  40. package/dist/display/image-crop.js.map +0 -1
  41. package/dist/display/image-cropper.d.ts +0 -68
  42. package/dist/display/image-cropper.js +0 -284
  43. package/dist/display/image-cropper.js.map +0 -1
  44. package/dist/display/lozenge.d.ts +0 -30
  45. package/dist/display/lozenge.js +0 -55
  46. package/dist/display/lozenge.js.map +0 -1
  47. package/dist/display/scroll-area.d.ts +0 -29
  48. package/dist/display/scroll-area.js +0 -95
  49. package/dist/display/scroll-area.js.map +0 -1
  50. package/dist/feedback/cooldown.d.ts +0 -17
  51. package/dist/feedback/cooldown.js +0 -59
  52. package/dist/feedback/cooldown.js.map +0 -1
  53. package/dist/feedback/status-dot.d.ts +0 -23
  54. package/dist/feedback/status-dot.js +0 -37
  55. package/dist/feedback/status-dot.js.map +0 -1
  56. package/dist/form/input-otp.d.ts +0 -35
  57. package/dist/form/input-otp.js +0 -83
  58. package/dist/form/input-otp.js.map +0 -1
  59. package/dist/layout/auth-form-layout.d.ts +0 -71
  60. package/dist/layout/auth-form-layout.js +0 -61
  61. package/dist/layout/auth-form-layout.js.map +0 -1
  62. package/dist/layout/auth-layout.d.ts +0 -59
  63. package/dist/layout/auth-layout.js +0 -26
  64. package/dist/layout/auth-layout.js.map +0 -1
  65. package/dist/layout/pressable.d.ts +0 -40
  66. package/dist/layout/pressable.js +0 -65
  67. package/dist/layout/pressable.js.map +0 -1
  68. package/dist/layout/reset-sent-card.d.ts +0 -39
  69. package/dist/layout/reset-sent-card.js +0 -22
  70. package/dist/layout/reset-sent-card.js.map +0 -1
  71. package/dist/navigation/dock.d.ts +0 -27
  72. package/dist/navigation/dock.js +0 -47
  73. package/dist/navigation/dock.js.map +0 -1
  74. package/dist/navigation/footer.d.ts +0 -43
  75. package/dist/navigation/footer.js +0 -43
  76. package/dist/navigation/footer.js.map +0 -1
  77. package/dist/navigation/language-names.d.ts +0 -19
  78. package/dist/navigation/language-names.js +0 -79
  79. package/dist/navigation/language-names.js.map +0 -1
  80. package/dist/navigation/language-switcher.d.ts +0 -55
  81. package/dist/navigation/language-switcher.js +0 -53
  82. package/dist/navigation/language-switcher.js.map +0 -1
  83. package/dist/navigation/panel-header.d.ts +0 -37
  84. package/dist/navigation/panel-header.js +0 -50
  85. package/dist/navigation/panel-header.js.map +0 -1
  86. package/dist/navigation/toolbar.d.ts +0 -37
  87. package/dist/navigation/toolbar.js +0 -334
  88. package/dist/navigation/toolbar.js.map +0 -1
  89. package/dist/overlay/command-palette.d.ts +0 -53
  90. package/dist/overlay/command-palette.js +0 -130
  91. package/dist/overlay/command-palette.js.map +0 -1
  92. package/dist/overlay/overlay.d.ts +0 -299
  93. package/dist/overlay/overlay.js +0 -558
  94. package/dist/overlay/overlay.js.map +0 -1
  95. package/dist/selection/radio-card.d.ts +0 -31
  96. package/dist/selection/radio-card.js +0 -29
  97. package/dist/selection/radio-card.js.map +0 -1
@@ -1,59 +0,0 @@
1
- import * as React from "react";
2
- export interface AuthLayoutProps {
3
- /** Top of the brand pane — the logo lockup. */
4
- brandLogo?: React.ReactNode;
5
- /** Middle of the brand pane — kicker / headline / copy / stats. */
6
- brandContent?: React.ReactNode;
7
- /** Bottom of the brand pane — a low-key footer line. */
8
- brandFooter?: React.ReactNode;
9
- /**
10
- * What rides at the start of the footer row, before `brandFooter` — a rule, a
11
- * mark, a motif. Nothing paints when it is absent: this layout carries no
12
- * signature of its own, so an app that wants one passes it.
13
- */
14
- brandFooterLead?: React.ReactNode;
15
- /**
16
- * Decoration behind the brand pane's content. A slot rather than a choice —
17
- * the layout knows the geometry, the app knows what it wants to look like.
18
- *
19
- * The pane is the positioning context and clips its overflow, so what goes
20
- * here should be `absolute inset-0 pointer-events-none` (and `aria-hidden`,
21
- * being decoration). It is rendered first and the pane's own rows carry
22
- * `relative`, so a backdrop that follows that shape sits behind them.
23
- */
24
- brandBackdrop?: React.ReactNode;
25
- /**
26
- * The brand pane's own ground: its background and the text color its
27
- * contents inherit. The layout has no opinion, because the surface is where
28
- * two apps sharing this skeleton most need to differ.
29
- */
30
- brandClassName?: string;
31
- /** The credentials pane's corner control (top, inline end). */
32
- topRightSlot?: React.ReactNode;
33
- /** The credentials content — typically an `AuthFormLayout`. */
34
- children: React.ReactNode;
35
- /**
36
- * The credentials pane's element: `main` (default) when the layout is the page, `div` when the app's shell already
37
- * renders the page's one `<main>`.
38
- */
39
- credentialsElement?: "main" | "div";
40
- className?: string;
41
- }
42
- /**
43
- * The split-screen skeleton an auth screen is built on: a desktop-only brand
44
- * pane beside a centered credentials pane (the auth pattern).
45
- *
46
- * Only the geometry lives here — the column ratio, the pane's top / middle /
47
- * bottom rhythm, the clipping, the full-height centring, the corner control.
48
- * Every surface is a slot: the ground arrives as `brandClassName`, the
49
- * decoration as `brandBackdrop`, the footer motif as `brandFooterLead`, so two
50
- * apps that want to look unrelated still share one skeleton.
51
- *
52
- * The split follows the layout's own width (a container query, 64rem and up), not the viewport's, so it also holds
53
- * inside a dialog, a preview frame or a shell with a sidebar.
54
- *
55
- * The brand pane is wide-only; on a narrow layout the credentials pane is the screen,
56
- * so a compact brand header belongs to the form (`AuthFormLayout`'s `logoSlot`).
57
- * The corner control sits at the inline end, so it mirrors in right-to-left.
58
- */
59
- export declare function AuthLayout({ brandLogo, brandContent, brandFooter, brandFooterLead, brandBackdrop, brandClassName, topRightSlot, children, credentialsElement: Credentials, className, }: AuthLayoutProps): React.JSX.Element;
@@ -1,26 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import * as React from "react";
3
- import { cn } from "../utils.js";
4
- /**
5
- * The split-screen skeleton an auth screen is built on: a desktop-only brand
6
- * pane beside a centered credentials pane (the auth pattern).
7
- *
8
- * Only the geometry lives here — the column ratio, the pane's top / middle /
9
- * bottom rhythm, the clipping, the full-height centring, the corner control.
10
- * Every surface is a slot: the ground arrives as `brandClassName`, the
11
- * decoration as `brandBackdrop`, the footer motif as `brandFooterLead`, so two
12
- * apps that want to look unrelated still share one skeleton.
13
- *
14
- * The split follows the layout's own width (a container query, 64rem and up), not the viewport's, so it also holds
15
- * inside a dialog, a preview frame or a shell with a sidebar.
16
- *
17
- * The brand pane is wide-only; on a narrow layout the credentials pane is the screen,
18
- * so a compact brand header belongs to the form (`AuthFormLayout`'s `logoSlot`).
19
- * The corner control sits at the inline end, so it mirrors in right-to-left.
20
- */
21
- export function AuthLayout({ brandLogo, brandContent, brandFooter, brandFooterLead, brandBackdrop, brandClassName, topRightSlot, children, credentialsElement: Credentials = "main", className, }) {
22
- return (
23
- // The container is the outer box: an element cannot query its own width, so the grid is one level in.
24
- _jsx("div", { "data-slot": "auth-layout", className: cn("@container min-h-svh", className), children: _jsxs("div", { "data-slot": "auth-layout-grid", className: "grid min-h-svh @5xl:grid-cols-[1.05fr_1fr]", children: [_jsxs("aside", { "data-slot": "auth-brand", className: cn("relative hidden overflow-hidden @5xl:flex @5xl:flex-col @5xl:justify-between @5xl:p-ds-600 @7xl:p-ds-800", brandClassName), children: [brandBackdrop, brandLogo && _jsx("div", { className: "relative", children: brandLogo }), brandContent && _jsx("div", { className: "relative", children: brandContent }), _jsxs("div", { "data-slot": "auth-brand-footer", className: "relative flex items-center gap-ds-200", children: [brandFooterLead, brandFooter && _jsx("div", { className: "min-w-0", children: brandFooter })] })] }), _jsxs(Credentials, { "data-slot": "auth-credentials", className: "relative flex h-full min-h-0 flex-col items-center justify-center bg-ds-surface px-ds-250 py-ds-600 text-ds-text", children: [topRightSlot && (_jsx("div", { "data-slot": "auth-corner", className: "absolute top-ds-200 end-ds-200 z-10", children: topRightSlot })), children] })] }) }));
25
- }
26
- //# sourceMappingURL=auth-layout.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth-layout.js","sourceRoot":"","sources":["../../src/layout/auth-layout.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AA2C9B;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,UAAU,CAAC,EACzB,SAAS,EACT,YAAY,EACZ,WAAW,EACX,eAAe,EACf,aAAa,EACb,cAAc,EACd,YAAY,EACZ,QAAQ,EACR,kBAAkB,EAAE,WAAW,GAAG,MAAM,EACxC,SAAS,GACO;IAChB,OAAO;IACL,sGAAsG;IACtG,2BAAe,aAAa,EAAC,SAAS,EAAE,EAAE,CAAC,sBAAsB,EAAE,SAAS,CAAC,YAC3E,4BAAe,kBAAkB,EAAC,SAAS,EAAC,4CAA4C,aACtF,8BACY,YAAY,EACtB,SAAS,EAAE,EAAE,CACX,0GAA0G,EAC1G,cAAc,CACf,aAEA,aAAa,EAEb,SAAS,IAAI,cAAK,SAAS,EAAC,UAAU,YAAE,SAAS,GAAO,EAExD,YAAY,IAAI,cAAK,SAAS,EAAC,UAAU,YAAE,YAAY,GAAO,EAK/D,4BAAe,mBAAmB,EAAC,SAAS,EAAC,uCAAuC,aACjF,eAAe,EACf,WAAW,IAAI,cAAK,SAAS,EAAC,SAAS,YAAE,WAAW,GAAO,IACxD,IACA,EAER,MAAC,WAAW,iBACA,kBAAkB,EAC5B,SAAS,EAAC,kHAAkH,aAE3H,YAAY,IAAI,CACf,2BAAe,aAAa,EAAC,SAAS,EAAC,qCAAqC,YACzE,YAAY,GACT,CACP,EACA,QAAQ,IACG,IACV,GACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["import * as React from \"react\";\n\nimport { cn } from \"../utils\";\n\nexport interface AuthLayoutProps {\n /** Top of the brand pane — the logo lockup. */\n brandLogo?: React.ReactNode;\n /** Middle of the brand pane — kicker / headline / copy / stats. */\n brandContent?: React.ReactNode;\n /** Bottom of the brand pane — a low-key footer line. */\n brandFooter?: React.ReactNode;\n /**\n * What rides at the start of the footer row, before `brandFooter` — a rule, a\n * mark, a motif. Nothing paints when it is absent: this layout carries no\n * signature of its own, so an app that wants one passes it.\n */\n brandFooterLead?: React.ReactNode;\n /**\n * Decoration behind the brand pane's content. A slot rather than a choice —\n * the layout knows the geometry, the app knows what it wants to look like.\n *\n * The pane is the positioning context and clips its overflow, so what goes\n * here should be `absolute inset-0 pointer-events-none` (and `aria-hidden`,\n * being decoration). It is rendered first and the pane's own rows carry\n * `relative`, so a backdrop that follows that shape sits behind them.\n */\n brandBackdrop?: React.ReactNode;\n /**\n * The brand pane's own ground: its background and the text color its\n * contents inherit. The layout has no opinion, because the surface is where\n * two apps sharing this skeleton most need to differ.\n */\n brandClassName?: string;\n /** The credentials pane's corner control (top, inline end). */\n topRightSlot?: React.ReactNode;\n /** The credentials content — typically an `AuthFormLayout`. */\n children: React.ReactNode;\n /**\n * The credentials pane's element: `main` (default) when the layout is the page, `div` when the app's shell already\n * renders the page's one `<main>`.\n */\n credentialsElement?: \"main\" | \"div\";\n className?: string;\n}\n\n/**\n * The split-screen skeleton an auth screen is built on: a desktop-only brand\n * pane beside a centered credentials pane (the auth pattern).\n *\n * Only the geometry lives here — the column ratio, the pane's top / middle /\n * bottom rhythm, the clipping, the full-height centring, the corner control.\n * Every surface is a slot: the ground arrives as `brandClassName`, the\n * decoration as `brandBackdrop`, the footer motif as `brandFooterLead`, so two\n * apps that want to look unrelated still share one skeleton.\n *\n * The split follows the layout's own width (a container query, 64rem and up), not the viewport's, so it also holds\n * inside a dialog, a preview frame or a shell with a sidebar.\n *\n * The brand pane is wide-only; on a narrow layout the credentials pane is the screen,\n * so a compact brand header belongs to the form (`AuthFormLayout`'s `logoSlot`).\n * The corner control sits at the inline end, so it mirrors in right-to-left.\n */\nexport function AuthLayout({\n brandLogo,\n brandContent,\n brandFooter,\n brandFooterLead,\n brandBackdrop,\n brandClassName,\n topRightSlot,\n children,\n credentialsElement: Credentials = \"main\",\n className,\n}: AuthLayoutProps) {\n return (\n // The container is the outer box: an element cannot query its own width, so the grid is one level in.\n <div data-slot=\"auth-layout\" className={cn(\"@container min-h-svh\", className)}>\n <div data-slot=\"auth-layout-grid\" className=\"grid min-h-svh @5xl:grid-cols-[1.05fr_1fr]\">\n <aside\n data-slot=\"auth-brand\"\n className={cn(\n \"relative hidden overflow-hidden @5xl:flex @5xl:flex-col @5xl:justify-between @5xl:p-ds-600 @7xl:p-ds-800\",\n brandClassName,\n )}\n >\n {brandBackdrop}\n\n {brandLogo && <div className=\"relative\">{brandLogo}</div>}\n\n {brandContent && <div className=\"relative\">{brandContent}</div>}\n\n {/* Always rendered, even when it holds nothing. The pane is a `justify-between` column, so\n dropping this row slams the narrative against the bottom edge; a zero-height\n spacer holds the top / middle / bottom rhythm whatever the consumer supplies. */}\n <div data-slot=\"auth-brand-footer\" className=\"relative flex items-center gap-ds-200\">\n {brandFooterLead}\n {brandFooter && <div className=\"min-w-0\">{brandFooter}</div>}\n </div>\n </aside>\n\n <Credentials\n data-slot=\"auth-credentials\"\n className=\"relative flex h-full min-h-0 flex-col items-center justify-center bg-ds-surface px-ds-250 py-ds-600 text-ds-text\"\n >\n {topRightSlot && (\n <div data-slot=\"auth-corner\" className=\"absolute top-ds-200 end-ds-200 z-10\">\n {topRightSlot}\n </div>\n )}\n {children}\n </Credentials>\n </div>\n </div>\n );\n}\n"]}
@@ -1,40 +0,0 @@
1
- import * as React from "react";
2
- import { type ButtonProps, type LinkProps, type PressEvent } from "react-aria-components";
3
- import { type BoxStyleProps } from "./box.js";
4
- /**
5
- * Shared look for every Pressable: no native chrome, a 24px minimum hit
6
- * area, a 2px inner `ds-border-focused` border on keyboard focus only, and hover / pressed
7
- * feedback from tokens. A surface with a shadow lifts to the overlay shadow
8
- * on hover and settles back to the raised one while pressed (the interactive
9
- * Card rule); every Pressable also takes the hover / pressed fill of its ground.
10
- */
11
- export declare function pressableClasses(style: BoxStyleProps & {
12
- fullWidth?: boolean;
13
- }): string;
14
- type PressableBase = BoxStyleProps & {
15
- /** As wide as its container (default `true`), as a button or a link; `false` hugs what it holds. */
16
- fullWidth?: boolean;
17
- children?: React.ReactNode;
18
- isDisabled?: boolean;
19
- /** Required when the content has no text that names the action. */
20
- "aria-label"?: string;
21
- id?: string;
22
- };
23
- export type PressableProps = PressableBase & (({
24
- href?: undefined;
25
- onPress?: (event: PressEvent) => void;
26
- } & Pick<ButtonProps, "type" | "form" | "aria-describedby" | "aria-pressed" | "aria-expanded">) | ({
27
- href: string;
28
- onPress?: (event: PressEvent) => void;
29
- } & Pick<LinkProps, "target" | "rel" | "routerOptions" | "aria-describedby">));
30
- /**
31
- * Makes a custom surface clickable with React Aria's press handling: mouse,
32
- * touch, keyboard (Enter / Space) and screen readers, with consistent
33
- * hover, pressed and focus-visible states. With `href` it is a link that
34
- * goes through the host router (`DesignSystemProvider`); otherwise a button.
35
- *
36
- * Content is phrasing content only (a `<button>` or `<a>` may not hold block
37
- * elements): lay it out with `Stack` / `Inline` / `Box` `as="span"`.
38
- */
39
- export declare const Pressable: React.ForwardRefExoticComponent<PressableProps & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
40
- export {};
@@ -1,65 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import * as React from "react";
4
- import { Button, Link } from "react-aria-components";
5
- import { cn } from "../utils.js";
6
- import { boxClasses } from "./box.js";
7
- /**
8
- * Hover and pressed fills follow the ground the Pressable starts from, so a
9
- * selected or neutral surface keeps its meaning while it reacts. Status
10
- * grounds (information, success…) keep their fill; their feedback is the
11
- * shadow or the focus ring.
12
- */
13
- const HOVER_FILL = {
14
- none: "data-[hovered]:bg-ds-surface-hovered",
15
- surface: "data-[hovered]:bg-ds-surface-hovered",
16
- "surface-raised": "data-[hovered]:bg-ds-surface-hovered",
17
- "surface-overlay": "data-[hovered]:bg-ds-surface-hovered",
18
- "surface-sunken": "data-[hovered]:bg-ds-background-neutral-hovered",
19
- neutral: "data-[hovered]:bg-ds-background-neutral-hovered",
20
- selected: "data-[hovered]:bg-ds-background-selected-hovered",
21
- "brand-subtle": "data-[hovered]:bg-ds-background-selected-hovered",
22
- };
23
- const PRESSED_FILL = {
24
- none: "data-[pressed]:bg-ds-background-neutral-hovered",
25
- surface: "data-[pressed]:bg-ds-background-neutral-hovered",
26
- "surface-raised": "data-[pressed]:bg-ds-background-neutral-hovered",
27
- "surface-overlay": "data-[pressed]:bg-ds-background-neutral-hovered",
28
- "surface-sunken": "data-[pressed]:bg-ds-background-neutral-pressed",
29
- neutral: "data-[pressed]:bg-ds-background-neutral-pressed",
30
- selected: "data-[pressed]:bg-ds-background-selected-pressed",
31
- "brand-subtle": "data-[pressed]:bg-ds-background-selected-hovered",
32
- };
33
- /**
34
- * Shared look for every Pressable: no native chrome, a 24px minimum hit
35
- * area, a 2px inner `ds-border-focused` border on keyboard focus only, and hover / pressed
36
- * feedback from tokens. A surface with a shadow lifts to the overlay shadow
37
- * on hover and settles back to the raised one while pressed (the interactive
38
- * Card rule); every Pressable also takes the hover / pressed fill of its ground.
39
- */
40
- export function pressableClasses(style) {
41
- const ground = style.background ?? "none";
42
- return cn(
43
- // A <button> sizes to its content even as a block; `w-full` makes it fill like the link form does.
44
- style.fullWidth === false ? "w-fit" : "w-full", "relative block min-h-6 min-w-6 cursor-pointer appearance-none text-start text-inherit [font:inherit] outline-hidden select-none", "transition-[background-color,box-shadow] duration-(--ds-duration-instant) ease-ds-standard",
45
- // Keyboard focus: a 2px inner border (no outer ring); pointer focus shows nothing.
46
- "data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused", style.shadow && "data-[hovered]:shadow-ds-overlay data-[pressed]:shadow-ds-raised", HOVER_FILL[ground], PRESSED_FILL[ground], "data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50", boxClasses(style));
47
- }
48
- /**
49
- * Makes a custom surface clickable with React Aria's press handling: mouse,
50
- * touch, keyboard (Enter / Space) and screen readers, with consistent
51
- * hover, pressed and focus-visible states. With `href` it is a link that
52
- * goes through the host router (`DesignSystemProvider`); otherwise a button.
53
- *
54
- * Content is phrasing content only (a `<button>` or `<a>` may not hold block
55
- * elements): lay it out with `Stack` / `Inline` / `Box` `as="span"`.
56
- */
57
- export const Pressable = React.forwardRef(function Pressable({ padding, paddingInline, paddingBlock, background, radius, shadow, border, fullWidth = true, children, ...rest }, ref) {
58
- const className = pressableClasses({ padding, paddingInline, paddingBlock, background, radius, shadow, border, fullWidth });
59
- if (rest.href !== undefined) {
60
- return (_jsx(Link, { ...rest, ref: ref, "data-slot": "pressable", className: className, children: children }));
61
- }
62
- const { href: _href, ...buttonProps } = rest;
63
- return (_jsx(Button, { type: "button", ...buttonProps, ref: ref, "data-slot": "pressable", className: className, children: children }));
64
- });
65
- //# sourceMappingURL=pressable.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pressable.js","sourceRoot":"","sources":["../../src/layout/pressable.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,IAAI,EAAqD,MAAM,uBAAuB,CAAC;AAExG,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAsB,MAAM,OAAO,CAAC;AAGvD;;;;;GAKG;AACH,MAAM,UAAU,GAAiD;IAC/D,IAAI,EAAE,sCAAsC;IAC5C,OAAO,EAAE,sCAAsC;IAC/C,gBAAgB,EAAE,sCAAsC;IACxD,iBAAiB,EAAE,sCAAsC;IACzD,gBAAgB,EAAE,iDAAiD;IACnE,OAAO,EAAE,iDAAiD;IAC1D,QAAQ,EAAE,kDAAkD;IAC5D,cAAc,EAAE,kDAAkD;CACnE,CAAC;AACF,MAAM,YAAY,GAAiD;IACjE,IAAI,EAAE,iDAAiD;IACvD,OAAO,EAAE,iDAAiD;IAC1D,gBAAgB,EAAE,iDAAiD;IACnE,iBAAiB,EAAE,iDAAiD;IACpE,gBAAgB,EAAE,iDAAiD;IACnE,OAAO,EAAE,iDAAiD;IAC1D,QAAQ,EAAE,kDAAkD;IAC5D,cAAc,EAAE,kDAAkD;CACnE,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAA8C;IAC7E,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,IAAI,MAAM,CAAC;IAC1C,OAAO,EAAE;IACP,mGAAmG;IACnG,KAAK,CAAC,SAAS,KAAK,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,EAC9C,iIAAiI,EACjI,4FAA4F;IAC5F,mFAAmF;IACnF,qFAAqF,EACrF,KAAK,CAAC,MAAM,IAAI,kEAAkE,EAClF,UAAU,CAAC,MAAM,CAAC,EAClB,YAAY,CAAC,MAAM,CAAC,EACpB,+DAA+D,EAC/D,UAAU,CAAC,KAAK,CAAC,CAClB,CAAC;AACJ,CAAC;AAkBD;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,KAAK,CAAC,UAAU,CAAwD,SAAS,SAAS,CACjH,EAAE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,GAAG,IAAI,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EACjH,GAAG;IAEH,MAAM,SAAS,GAAG,gBAAgB,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;IAC5H,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAC5B,OAAO,CACL,KAAC,IAAI,OAAK,IAAI,EAAE,GAAG,EAAE,GAAmC,eAAY,WAAW,EAAC,SAAS,EAAE,SAAS,YACjG,QAAQ,GACJ,CACR,CAAC;IACJ,CAAC;IACD,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,WAAW,EAAE,GAAG,IAAI,CAAC;IAC7C,OAAO,CACL,KAAC,MAAM,IAAC,IAAI,EAAC,QAAQ,KAAK,WAAW,EAAE,GAAG,EAAE,GAAmC,eAAY,WAAW,EAAC,SAAS,EAAE,SAAS,YACxH,QAAQ,GACF,CACV,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Button, Link, type ButtonProps, type LinkProps, type PressEvent } from \"react-aria-components\";\n\nimport { cn } from \"../utils\";\nimport { boxClasses, type BoxStyleProps } from \"./box\";\nimport type { Background } from \"./tokens\";\n\n/**\n * Hover and pressed fills follow the ground the Pressable starts from, so a\n * selected or neutral surface keeps its meaning while it reacts. Status\n * grounds (information, success…) keep their fill; their feedback is the\n * shadow or the focus ring.\n */\nconst HOVER_FILL: Partial<Record<Background | \"none\", string>> = {\n none: \"data-[hovered]:bg-ds-surface-hovered\",\n surface: \"data-[hovered]:bg-ds-surface-hovered\",\n \"surface-raised\": \"data-[hovered]:bg-ds-surface-hovered\",\n \"surface-overlay\": \"data-[hovered]:bg-ds-surface-hovered\",\n \"surface-sunken\": \"data-[hovered]:bg-ds-background-neutral-hovered\",\n neutral: \"data-[hovered]:bg-ds-background-neutral-hovered\",\n selected: \"data-[hovered]:bg-ds-background-selected-hovered\",\n \"brand-subtle\": \"data-[hovered]:bg-ds-background-selected-hovered\",\n};\nconst PRESSED_FILL: Partial<Record<Background | \"none\", string>> = {\n none: \"data-[pressed]:bg-ds-background-neutral-hovered\",\n surface: \"data-[pressed]:bg-ds-background-neutral-hovered\",\n \"surface-raised\": \"data-[pressed]:bg-ds-background-neutral-hovered\",\n \"surface-overlay\": \"data-[pressed]:bg-ds-background-neutral-hovered\",\n \"surface-sunken\": \"data-[pressed]:bg-ds-background-neutral-pressed\",\n neutral: \"data-[pressed]:bg-ds-background-neutral-pressed\",\n selected: \"data-[pressed]:bg-ds-background-selected-pressed\",\n \"brand-subtle\": \"data-[pressed]:bg-ds-background-selected-hovered\",\n};\n\n/**\n * Shared look for every Pressable: no native chrome, a 24px minimum hit\n * area, a 2px inner `ds-border-focused` border on keyboard focus only, and hover / pressed\n * feedback from tokens. A surface with a shadow lifts to the overlay shadow\n * on hover and settles back to the raised one while pressed (the interactive\n * Card rule); every Pressable also takes the hover / pressed fill of its ground.\n */\nexport function pressableClasses(style: BoxStyleProps & { fullWidth?: boolean }) {\n const ground = style.background ?? \"none\";\n return cn(\n // A <button> sizes to its content even as a block; `w-full` makes it fill like the link form does.\n style.fullWidth === false ? \"w-fit\" : \"w-full\",\n \"relative block min-h-6 min-w-6 cursor-pointer appearance-none text-start text-inherit [font:inherit] outline-hidden select-none\",\n \"transition-[background-color,box-shadow] duration-(--ds-duration-instant) ease-ds-standard\",\n // Keyboard focus: a 2px inner border (no outer ring); pointer focus shows nothing.\n \"data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused\",\n style.shadow && \"data-[hovered]:shadow-ds-overlay data-[pressed]:shadow-ds-raised\",\n HOVER_FILL[ground],\n PRESSED_FILL[ground],\n \"data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50\",\n boxClasses(style),\n );\n}\n\ntype PressableBase = BoxStyleProps & {\n /** As wide as its container (default `true`), as a button or a link; `false` hugs what it holds. */\n fullWidth?: boolean;\n children?: React.ReactNode;\n isDisabled?: boolean;\n /** Required when the content has no text that names the action. */\n \"aria-label\"?: string;\n id?: string;\n};\n\nexport type PressableProps = PressableBase &\n (\n | ({ href?: undefined; onPress?: (event: PressEvent) => void } & Pick<ButtonProps, \"type\" | \"form\" | \"aria-describedby\" | \"aria-pressed\" | \"aria-expanded\">)\n | ({ href: string; onPress?: (event: PressEvent) => void } & Pick<LinkProps, \"target\" | \"rel\" | \"routerOptions\" | \"aria-describedby\">)\n );\n\n/**\n * Makes a custom surface clickable with React Aria's press handling: mouse,\n * touch, keyboard (Enter / Space) and screen readers, with consistent\n * hover, pressed and focus-visible states. With `href` it is a link that\n * goes through the host router (`DesignSystemProvider`); otherwise a button.\n *\n * Content is phrasing content only (a `<button>` or `<a>` may not hold block\n * elements): lay it out with `Stack` / `Inline` / `Box` `as=\"span\"`.\n */\nexport const Pressable = React.forwardRef<HTMLButtonElement | HTMLAnchorElement, PressableProps>(function Pressable(\n { padding, paddingInline, paddingBlock, background, radius, shadow, border, fullWidth = true, children, ...rest },\n ref,\n) {\n const className = pressableClasses({ padding, paddingInline, paddingBlock, background, radius, shadow, border, fullWidth });\n if (rest.href !== undefined) {\n return (\n <Link {...rest} ref={ref as React.Ref<HTMLAnchorElement>} data-slot=\"pressable\" className={className}>\n {children}\n </Link>\n );\n }\n const { href: _href, ...buttonProps } = rest;\n return (\n <Button type=\"button\" {...buttonProps} ref={ref as React.Ref<HTMLButtonElement>} data-slot=\"pressable\" className={className}>\n {children}\n </Button>\n );\n});\n"]}
@@ -1,39 +0,0 @@
1
- import * as React from "react";
2
- export interface ResetSentLabels {
3
- title: React.ReactNode;
4
- /** Enumeration-safe body, e.g. "If an account exists we've sent a reset link." */
5
- description: React.ReactNode;
6
- resend: React.ReactNode;
7
- /** Resend-button label during the cooldown, e.g. `(s) => `Resend in ${s}s``. */
8
- resendIn?: (seconds: number) => React.ReactNode;
9
- /** Shown when a resend fails (the button is usable again at once), e.g. "Couldn't resend. Try again." */
10
- resendFailed?: React.ReactNode;
11
- }
12
- export interface ResetSentCardProps {
13
- labels: ResetSentLabels;
14
- /** Sends the link again. A rejected promise (or a throw) starts no wait and shows `labels.resendFailed`. */
15
- onResend: () => void | Promise<void>;
16
- /** Seconds to disable "Resend" for after each successful send. Default 60. */
17
- cooldownSeconds?: number;
18
- /**
19
- * The wait already running when the card appears. Default `cooldownSeconds`: the link was just sent. Pass 0 when the
20
- * card shows long after the send, or the server's "retry after"; a new value restarts the wait.
21
- */
22
- initialCooldown?: number;
23
- resending?: boolean;
24
- /** Optional icon in place of the default check. */
25
- icon?: React.ReactNode;
26
- /** "Back to sign in" affordance under the actions. */
27
- backSlot?: React.ReactNode;
28
- className?: string;
29
- /** The title's heading level: 1 by default, or 2 when the page has its own h1. */
30
- headingLevel?: 1 | 2 | 3;
31
- }
32
- /**
33
- * "Check your inbox" confirmation shown after a reset link is requested
34
- * (the auth pattern). The message is deliberately
35
- * enumeration-safe, and "Resend" is rate-limited by a local cooldown so it
36
- * can't be hammered: one send at a time, and a wait after each one that succeeds. The button shows the pending
37
- * state while the send runs (or while `resending`).
38
- */
39
- export declare function ResetSentCard({ labels, onResend, cooldownSeconds, initialCooldown, resending, icon, backSlot, className, headingLevel, }: ResetSentCardProps): React.JSX.Element;
@@ -1,22 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import * as React from "react";
4
- import { Button } from "../action/button.js";
5
- import { IconGlyph } from "../display/icon.js";
6
- import { useCooldownAction } from "../feedback/cooldown.js";
7
- import { cn } from "../utils.js";
8
- import { TitleTag } from "./auth-form-layout.js";
9
- /**
10
- * "Check your inbox" confirmation shown after a reset link is requested
11
- * (the auth pattern). The message is deliberately
12
- * enumeration-safe, and "Resend" is rate-limited by a local cooldown so it
13
- * can't be hammered: one send at a time, and a wait after each one that succeeds. The button shows the pending
14
- * state while the send runs (or while `resending`).
15
- */
16
- export function ResetSentCard({ labels, onResend, cooldownSeconds = 60, initialCooldown, resending = false, icon, backSlot, className, headingLevel = 1, }) {
17
- const resend = useCooldownAction(onResend, cooldownSeconds, initialCooldown ?? cooldownSeconds);
18
- const cooling = resend.remaining > 0;
19
- const pending = resending || resend.isPending;
20
- return (_jsxs("div", { "data-slot": "auth-card", className: cn("w-full max-w-sm", className), children: [_jsx("div", { "data-slot": "reset-sent-icon", className: "flex size-11 items-center justify-center rounded-ds-full bg-ds-background-success text-ds-text-success", children: icon ?? _jsx(IconGlyph, { name: "circle-check", size: "large" }) }), _jsxs("div", { className: "mt-ds-300 space-y-1.5", children: [_jsx(TitleTag, { level: headingLevel, className: "text-heading-large text-ds-text", children: labels.title }), _jsx("p", { className: "text-body text-ds-text-subtle", children: labels.description })] }), _jsxs("div", { className: "mt-8 grid gap-ds-200", children: [_jsx(Button, { size: "large", isDisabled: cooling && !pending, isPending: pending, onPress: () => void resend.run(), children: !pending && cooling && labels.resendIn ? labels.resendIn(resend.remaining) : labels.resend }), resend.failed && labels.resendFailed && (_jsx("p", { role: "alert", className: "text-center text-body text-ds-text-danger", children: labels.resendFailed })), backSlot && _jsx("div", { className: "flex justify-center", children: backSlot })] })] }));
21
- }
22
- //# sourceMappingURL=reset-sent-card.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reset-sent-card.js","sourceRoot":"","sources":["../../src/layout/reset-sent-card.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAkC9C;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAAC,EAC5B,MAAM,EACN,QAAQ,EACR,eAAe,GAAG,EAAE,EACpB,eAAe,EACf,SAAS,GAAG,KAAK,EACjB,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,YAAY,GAAG,CAAC,GACG;IACnB,MAAM,MAAM,GAAG,iBAAiB,CAAC,QAAQ,EAAE,eAAe,EAAE,eAAe,IAAI,eAAe,CAAC,CAAC;IAChG,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS,GAAG,CAAC,CAAC;IACrC,MAAM,OAAO,GAAG,SAAS,IAAI,MAAM,CAAC,SAAS,CAAC;IAE9C,OAAO,CACL,4BAAe,WAAW,EAAC,SAAS,EAAE,EAAE,CAAC,iBAAiB,EAAE,SAAS,CAAC,aACpE,2BACY,iBAAiB,EAC3B,SAAS,EAAC,wGAAwG,YAEjH,IAAI,IAAI,KAAC,SAAS,IAAC,IAAI,EAAC,cAAc,EAAC,IAAI,EAAC,OAAO,GAAG,GACnD,EAEN,eAAK,SAAS,EAAC,uBAAuB,aACpC,KAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,EAAE,SAAS,EAAC,iCAAiC,YAAE,MAAM,CAAC,KAAK,GAAY,EACpG,YAAG,SAAS,EAAC,+BAA+B,YAAE,MAAM,CAAC,WAAW,GAAK,IACjE,EAGN,eAAK,SAAS,EAAC,sBAAsB,aACnC,KAAC,MAAM,IACL,IAAI,EAAC,OAAO,EACZ,UAAU,EAAE,OAAO,IAAI,CAAC,OAAO,EAC/B,SAAS,EAAE,OAAO,EAClB,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,MAAM,CAAC,GAAG,EAAE,YAE/B,CAAC,OAAO,IAAI,OAAO,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,GACpF,EAER,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,YAAY,IAAI,CACvC,YAAG,IAAI,EAAC,OAAO,EAAC,SAAS,EAAC,2CAA2C,YAClE,MAAM,CAAC,YAAY,GAClB,CACL,EAEA,QAAQ,IAAI,cAAK,SAAS,EAAC,qBAAqB,YAAE,QAAQ,GAAO,IAC9D,IACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\n\nimport { Button } from \"../action/button\";\nimport { IconGlyph } from \"../display/icon\";\nimport { useCooldownAction } from \"../feedback/cooldown\";\nimport { cn } from \"../utils\";\nimport { TitleTag } from \"./auth-form-layout\";\n\nexport interface ResetSentLabels {\n title: React.ReactNode;\n /** Enumeration-safe body, e.g. \"If an account exists we've sent a reset link.\" */\n description: React.ReactNode;\n resend: React.ReactNode;\n /** Resend-button label during the cooldown, e.g. `(s) => `Resend in ${s}s``. */\n resendIn?: (seconds: number) => React.ReactNode;\n /** Shown when a resend fails (the button is usable again at once), e.g. \"Couldn't resend. Try again.\" */\n resendFailed?: React.ReactNode;\n}\n\nexport interface ResetSentCardProps {\n labels: ResetSentLabels;\n /** Sends the link again. A rejected promise (or a throw) starts no wait and shows `labels.resendFailed`. */\n onResend: () => void | Promise<void>;\n /** Seconds to disable \"Resend\" for after each successful send. Default 60. */\n cooldownSeconds?: number;\n /**\n * The wait already running when the card appears. Default `cooldownSeconds`: the link was just sent. Pass 0 when the\n * card shows long after the send, or the server's \"retry after\"; a new value restarts the wait.\n */\n initialCooldown?: number;\n resending?: boolean;\n /** Optional icon in place of the default check. */\n icon?: React.ReactNode;\n /** \"Back to sign in\" affordance under the actions. */\n backSlot?: React.ReactNode;\n className?: string;\n /** The title's heading level: 1 by default, or 2 when the page has its own h1. */\n headingLevel?: 1 | 2 | 3;\n}\n\n/**\n * \"Check your inbox\" confirmation shown after a reset link is requested\n * (the auth pattern). The message is deliberately\n * enumeration-safe, and \"Resend\" is rate-limited by a local cooldown so it\n * can't be hammered: one send at a time, and a wait after each one that succeeds. The button shows the pending\n * state while the send runs (or while `resending`).\n */\nexport function ResetSentCard({\n labels,\n onResend,\n cooldownSeconds = 60,\n initialCooldown,\n resending = false,\n icon,\n backSlot,\n className,\n headingLevel = 1,\n}: ResetSentCardProps) {\n const resend = useCooldownAction(onResend, cooldownSeconds, initialCooldown ?? cooldownSeconds);\n const cooling = resend.remaining > 0;\n const pending = resending || resend.isPending;\n\n return (\n <div data-slot=\"auth-card\" className={cn(\"w-full max-w-sm\", className)}>\n <div\n data-slot=\"reset-sent-icon\"\n className=\"flex size-11 items-center justify-center rounded-ds-full bg-ds-background-success text-ds-text-success\"\n >\n {icon ?? <IconGlyph name=\"circle-check\" size=\"large\" />}\n </div>\n\n <div className=\"mt-ds-300 space-y-1.5\">\n <TitleTag level={headingLevel} className=\"text-heading-large text-ds-text\">{labels.title}</TitleTag>\n <p className=\"text-body text-ds-text-subtle\">{labels.description}</p>\n </div>\n\n {/* A grid stretches the button to the full width, as the old `w-full` did. */}\n <div className=\"mt-8 grid gap-ds-200\">\n <Button\n size=\"large\"\n isDisabled={cooling && !pending}\n isPending={pending}\n onPress={() => void resend.run()}\n >\n {!pending && cooling && labels.resendIn ? labels.resendIn(resend.remaining) : labels.resend}\n </Button>\n\n {resend.failed && labels.resendFailed && (\n <p role=\"alert\" className=\"text-center text-body text-ds-text-danger\">\n {labels.resendFailed}\n </p>\n )}\n\n {backSlot && <div className=\"flex justify-center\">{backSlot}</div>}\n </div>\n </div>\n );\n}\n"]}
@@ -1,27 +0,0 @@
1
- import * as React from "react";
2
- import { type BadgeTone } from "../display/badge.js";
3
- import { type IconName } from "../display/icon.js";
4
- export type DockItem = {
5
- key: string;
6
- /** Always shown under the icon ("Orders"); the last item is "More" when the app has more. */
7
- label: string;
8
- icon: IconName;
9
- href: string;
10
- badge?: {
11
- value: number;
12
- tone?: BadgeTone;
13
- };
14
- };
15
- export type DockProps = {
16
- /** Four or five top destinations. */
17
- items: readonly DockItem[];
18
- currentKey?: string;
19
- /** Names the navigation landmark; "Main menu" by default. */
20
- "aria-label"?: string;
21
- };
22
- /**
23
- * The bottom tab bar on phones: four or five destinations, icon over label, padded for the home
24
- * indicator. Hidden from 768px up and while the on-screen keyboard is open; leave it out of
25
- * full-screen flows (checkout).
26
- */
27
- export declare function Dock({ items, currentKey, "aria-label": label }: DockProps): React.JSX.Element;
@@ -1,47 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import * as React from "react";
4
- import { Link as AriaLink, useLocale } from "react-aria-components";
5
- import { cn } from "../utils.js";
6
- import { Badge } from "../display/badge.js";
7
- import { IconGlyph } from "../display/icon.js";
8
- import { mainNavigationLabel } from "../i18n.js";
9
- import { LAYER } from "../layers.js";
10
- /** True while the on-screen keyboard covers part of the layout viewport (a field has focus). */
11
- function useKeyboardOpen() {
12
- const [open, setOpen] = React.useState(false);
13
- React.useEffect(() => {
14
- const viewport = window.visualViewport;
15
- if (!viewport)
16
- return;
17
- const update = () => {
18
- const editing = document.activeElement instanceof HTMLElement && document.activeElement.matches("input, textarea, select, [contenteditable]:not([contenteditable='false'])");
19
- // The keyboard takes a quarter of the height or more; a URL bar collapsing takes far less.
20
- setOpen(editing && viewport.height < window.innerHeight * 0.75);
21
- };
22
- viewport.addEventListener("resize", update);
23
- window.addEventListener("focusin", update);
24
- window.addEventListener("focusout", update);
25
- return () => {
26
- viewport.removeEventListener("resize", update);
27
- window.removeEventListener("focusin", update);
28
- window.removeEventListener("focusout", update);
29
- };
30
- }, []);
31
- return open;
32
- }
33
- /**
34
- * The bottom tab bar on phones: four or five destinations, icon over label, padded for the home
35
- * indicator. Hidden from 768px up and while the on-screen keyboard is open; leave it out of
36
- * full-screen flows (checkout).
37
- */
38
- export function Dock({ items, currentKey, "aria-label": label }) {
39
- const { locale } = useLocale();
40
- const keyboard = useKeyboardOpen();
41
- return (_jsx("nav", { "aria-label": label ?? mainNavigationLabel(locale), "data-slot": "dock", hidden: keyboard || undefined, className: cn("fixed inset-x-0 bottom-0 border-t border-ds-border bg-ds-surface-overlay shadow-ds-overflow md:hidden",
42
- // Safe-area insets are physical edges, so they pair with physical padding.
43
- "[padding-left:max(var(--ds-space-100),env(safe-area-inset-left,0px))] [padding-right:max(var(--ds-space-100),env(safe-area-inset-right,0px))] pt-ds-075 pb-[max(var(--ds-space-150),env(safe-area-inset-bottom,0px))]", LAYER.stickyBar), children: _jsx("ul", { className: "mx-auto grid max-w-[24.375rem] auto-cols-fr grid-flow-col", children: items.map((item) => (_jsx("li", { className: "flex", children: _jsxs(AriaLink, { href: item.href, "data-slot": "dock-item", "aria-current": item.key === currentKey ? "page" : undefined, className: cn("group/dock flex min-h-11 flex-1 flex-col items-center justify-center gap-0.5 rounded-ds-medium py-ds-050 text-[11px] leading-[14px] font-[500] text-ds-text-subtle outline-hidden", "data-[pressed]:bg-ds-background-neutral-pressed data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused aria-[current=page]:text-ds-text"), children: [_jsxs("span", { className: "relative", children: [_jsx(IconGlyph, { name: item.icon, "data-slot": "dock-item-icon", className: "size-[22px] group-aria-[current=page]/dock:text-ds-icon-brand" }), item.badge && item.badge.value > 0 && (
44
- // Drawn on the icon; read after the label ("Mesajlar, 2").
45
- _jsx("span", { "data-slot": "dock-item-badge", "aria-hidden": true, className: "absolute -top-1 -end-2.5", children: _jsx(Badge, { value: item.badge.value, tone: item.badge.tone, isOnIcon: true }) }))] }), _jsx("span", { "data-slot": "dock-item-label", className: "max-w-full truncate px-ds-025", children: item.label }), item.badge && item.badge.value > 0 && _jsx("span", { className: "sr-only", children: `, ${item.badge.value}` })] }) }, item.key))) }) }));
46
- }
47
- //# sourceMappingURL=dock.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dock.js","sourceRoot":"","sources":["../../src/navigation/dock.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEpE,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAkB,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAiB,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAmBlC,gGAAgG;AAChG,SAAS,eAAe;IACtB,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9C,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,MAAM,QAAQ,GAAG,MAAM,CAAC,cAAc,CAAC;QACvC,IAAI,CAAC,QAAQ;YAAE,OAAO;QACtB,MAAM,MAAM,GAAG,GAAG,EAAE;YAClB,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,YAAY,WAAW,IAAI,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,2EAA2E,CAAC,CAAC;YAC7K,2FAA2F;YAC3F,OAAO,CAAC,OAAO,IAAI,QAAQ,CAAC,MAAM,GAAG,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;QAClE,CAAC,CAAC;QACF,QAAQ,CAAC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAC5C,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QAC3C,MAAM,CAAC,gBAAgB,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QAC5C,OAAO,GAAG,EAAE;YACV,QAAQ,CAAC,mBAAmB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;YAC/C,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;YAC9C,MAAM,CAAC,mBAAmB,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QACjD,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,IAAI,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,KAAK,EAAa;IACxE,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,CAAC;IAC/B,MAAM,QAAQ,GAAG,eAAe,EAAE,CAAC;IACnC,OAAO,CACL,4BACc,KAAK,IAAI,mBAAmB,CAAC,MAAM,CAAC,eACtC,MAAM,EAChB,MAAM,EAAE,QAAQ,IAAI,SAAS,EAC7B,SAAS,EAAE,EAAE,CACX,uGAAuG;QACvG,2EAA2E;QAC3E,uNAAuN,EACvN,KAAK,CAAC,SAAS,CAChB,YAED,aAAI,SAAS,EAAC,2DAA2D,YACtE,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACnB,aAAmB,SAAS,EAAC,MAAM,YACjC,MAAC,QAAQ,IACP,IAAI,EAAE,IAAI,CAAC,IAAI,eACL,WAAW,kBACP,IAAI,CAAC,GAAG,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAC1D,SAAS,EAAE,EAAE,CACX,mLAAmL,EACnL,sKAAsK,CACvK,aAED,gBAAM,SAAS,EAAC,UAAU,aACxB,KAAC,SAAS,IAAC,IAAI,EAAE,IAAI,CAAC,IAAI,eAAY,gBAAgB,EAAC,SAAS,EAAC,+DAA+D,GAAG,EAClI,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,IAAI;gCACrC,2DAA2D;gCAC3D,4BAAgB,iBAAiB,uBAAa,SAAS,EAAC,0BAA0B,YAChF,KAAC,KAAK,IAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,QAAQ,SAAG,GAC7D,CACR,IACI,EACP,4BAAgB,iBAAiB,EAAC,SAAS,EAAC,+BAA+B,YAAE,IAAI,CAAC,KAAK,GAAQ,EAC9F,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,IAAI,eAAM,SAAS,EAAC,SAAS,YAAE,KAAK,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,GAAQ,IACxF,IArBJ,IAAI,CAAC,GAAG,CAsBZ,CACN,CAAC,GACC,GACD,CACP,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Link as AriaLink, useLocale } from \"react-aria-components\";\n\nimport { cn } from \"../utils\";\nimport { Badge, type BadgeTone } from \"../display/badge\";\nimport { IconGlyph, type IconName } from \"../display/icon\";\nimport { mainNavigationLabel } from \"../i18n\";\nimport { LAYER } from \"../layers\";\n\nexport type DockItem = {\n key: string;\n /** Always shown under the icon (\"Orders\"); the last item is \"More\" when the app has more. */\n label: string;\n icon: IconName;\n href: string;\n badge?: { value: number; tone?: BadgeTone };\n};\n\nexport type DockProps = {\n /** Four or five top destinations. */\n items: readonly DockItem[];\n currentKey?: string;\n /** Names the navigation landmark; \"Main menu\" by default. */\n \"aria-label\"?: string;\n};\n\n/** True while the on-screen keyboard covers part of the layout viewport (a field has focus). */\nfunction useKeyboardOpen() {\n const [open, setOpen] = React.useState(false);\n React.useEffect(() => {\n const viewport = window.visualViewport;\n if (!viewport) return;\n const update = () => {\n const editing = document.activeElement instanceof HTMLElement && document.activeElement.matches(\"input, textarea, select, [contenteditable]:not([contenteditable='false'])\");\n // The keyboard takes a quarter of the height or more; a URL bar collapsing takes far less.\n setOpen(editing && viewport.height < window.innerHeight * 0.75);\n };\n viewport.addEventListener(\"resize\", update);\n window.addEventListener(\"focusin\", update);\n window.addEventListener(\"focusout\", update);\n return () => {\n viewport.removeEventListener(\"resize\", update);\n window.removeEventListener(\"focusin\", update);\n window.removeEventListener(\"focusout\", update);\n };\n }, []);\n return open;\n}\n\n/**\n * The bottom tab bar on phones: four or five destinations, icon over label, padded for the home\n * indicator. Hidden from 768px up and while the on-screen keyboard is open; leave it out of\n * full-screen flows (checkout).\n */\nexport function Dock({ items, currentKey, \"aria-label\": label }: DockProps) {\n const { locale } = useLocale();\n const keyboard = useKeyboardOpen();\n return (\n <nav\n aria-label={label ?? mainNavigationLabel(locale)}\n data-slot=\"dock\"\n hidden={keyboard || undefined}\n className={cn(\n \"fixed inset-x-0 bottom-0 border-t border-ds-border bg-ds-surface-overlay shadow-ds-overflow md:hidden\",\n // Safe-area insets are physical edges, so they pair with physical padding.\n \"[padding-left:max(var(--ds-space-100),env(safe-area-inset-left,0px))] [padding-right:max(var(--ds-space-100),env(safe-area-inset-right,0px))] pt-ds-075 pb-[max(var(--ds-space-150),env(safe-area-inset-bottom,0px))]\",\n LAYER.stickyBar,\n )}\n >\n <ul className=\"mx-auto grid max-w-[24.375rem] auto-cols-fr grid-flow-col\">\n {items.map((item) => (\n <li key={item.key} className=\"flex\">\n <AriaLink\n href={item.href}\n data-slot=\"dock-item\"\n aria-current={item.key === currentKey ? \"page\" : undefined}\n className={cn(\n \"group/dock flex min-h-11 flex-1 flex-col items-center justify-center gap-0.5 rounded-ds-medium py-ds-050 text-[11px] leading-[14px] font-[500] text-ds-text-subtle outline-hidden\",\n \"data-[pressed]:bg-ds-background-neutral-pressed data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused aria-[current=page]:text-ds-text\",\n )}\n >\n <span className=\"relative\">\n <IconGlyph name={item.icon} data-slot=\"dock-item-icon\" className=\"size-[22px] group-aria-[current=page]/dock:text-ds-icon-brand\" />\n {item.badge && item.badge.value > 0 && (\n // Drawn on the icon; read after the label (\"Mesajlar, 2\").\n <span data-slot=\"dock-item-badge\" aria-hidden className=\"absolute -top-1 -end-2.5\">\n <Badge value={item.badge.value} tone={item.badge.tone} isOnIcon />\n </span>\n )}\n </span>\n <span data-slot=\"dock-item-label\" className=\"max-w-full truncate px-ds-025\">{item.label}</span>\n {item.badge && item.badge.value > 0 && <span className=\"sr-only\">{`, ${item.badge.value}`}</span>}\n </AriaLink>\n </li>\n ))}\n </ul>\n </nav>\n );\n}\n"]}
@@ -1,43 +0,0 @@
1
- import * as React from "react";
2
- export type FooterLink = {
3
- /** Names the destination ("Privacy policy"), never "Click here". */
4
- label: string;
5
- href: string;
6
- /** Another site: opens in a new tab with the 12px `arrow-up-right`. */
7
- isExternal?: boolean;
8
- };
9
- export type FooterColumn = {
10
- /** The column's title ("Product"); it also names the column's navigation. */
11
- title: string;
12
- /** At most six. */
13
- links: readonly FooterLink[];
14
- };
15
- export type FooterProps = {
16
- /** The logo and wordmark (the site's logo and name). It links to `brandHref`. */
17
- brand: React.ReactNode;
18
- /** Where the brand goes: the home page. */
19
- brandHref?: string;
20
- /** The brand link's name when the brand alone does not say where it goes ("Acme home"). */
21
- brandLabel?: string;
22
- /** One line about the product, under the brand. */
23
- about?: React.ReactNode;
24
- /** A contact link under the about line (a subtle `Link` to the support address). */
25
- contact?: React.ReactNode;
26
- /** Two to four columns of links. */
27
- columns: readonly FooterColumn[];
28
- /** The copyright line ("© 2026 Acme"); a platform credit can go here too. */
29
- legal: React.ReactNode;
30
- /** The language switch at the end of the legal row (a subtle compact Button or Menu). */
31
- languageSwitch?: React.ReactNode;
32
- /** The column titles' heading level: 2 by default, a level below the page's h1. */
33
- headingLevel?: 2 | 3 | 4;
34
- };
35
- /**
36
- * Closes every public page: the brand block, two to four
37
- * columns of subtle links, and the legal row with the copyright and the language switch. It holds no
38
- * primary action; the page's one primary action lives in the Navbar and the CTA band. Narrower than
39
- * 48rem (a phone) everything stacks in one column; it measures its own width, not the viewport's.
40
- * Render it at the page root, outside `main`, `section` and `article`: only there is it the page's
41
- * `contentinfo` landmark.
42
- */
43
- export declare function Footer({ brand, brandHref, brandLabel, about, contact, columns, legal, languageSwitch, headingLevel }: FooterProps): React.JSX.Element;
@@ -1,43 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import * as React from "react";
4
- import { Link as AriaLink } from "react-aria-components";
5
- import { cn } from "../utils.js";
6
- import { BrandLinkContext } from "./brand-link-context.js";
7
- import { Link } from "../action/link.js";
8
- const MAX_COLUMNS = 4;
9
- const MAX_LINKS = 6;
10
- /** From 48rem: the brand block, then one track per column (static classes: no inline style to strip). */
11
- const GRID = {
12
- 0: "",
13
- 1: "@min-[48rem]:grid-cols-[minmax(0,1.5fr)_minmax(0,1fr)]",
14
- 2: "@min-[48rem]:grid-cols-[minmax(0,1.5fr)_repeat(2,minmax(0,1fr))]",
15
- 3: "@min-[48rem]:grid-cols-[minmax(0,1.5fr)_repeat(3,minmax(0,1fr))]",
16
- 4: "@min-[48rem]:grid-cols-[minmax(0,1.5fr)_repeat(4,minmax(0,1fr))]",
17
- };
18
- /**
19
- * Closes every public page: the brand block, two to four
20
- * columns of subtle links, and the legal row with the copyright and the language switch. It holds no
21
- * primary action; the page's one primary action lives in the Navbar and the CTA band. Narrower than
22
- * 48rem (a phone) everything stacks in one column; it measures its own width, not the viewport's.
23
- * Render it at the page root, outside `main`, `section` and `article`: only there is it the page's
24
- * `contentinfo` landmark.
25
- */
26
- export function Footer({ brand, brandHref = "/", brandLabel, about, contact, columns, legal, languageSwitch, headingLevel = 2 }) {
27
- const Title = `h${headingLevel}`;
28
- const id = React.useId();
29
- const tooMany = columns.length > MAX_COLUMNS || columns.some((column) => column.links.length > MAX_LINKS);
30
- // Once, not on every render, nor twice under StrictMode's re-run of effects.
31
- const warned = React.useRef(false);
32
- React.useEffect(() => {
33
- if (!tooMany || warned.current)
34
- return;
35
- warned.current = true;
36
- console.warn(`Footer: at most ${MAX_COLUMNS} columns of at most ${MAX_LINKS} links each.`);
37
- }, [tooMany]);
38
- return (_jsx("footer", { "data-slot": "footer", className: "@container border-t border-ds-border bg-ds-surface-sunken text-ds-text", children: _jsxs("div", { className: "mx-auto flex max-w-[1200px] flex-col gap-ds-500 px-ds-200 pt-ds-500 pb-ds-200 @min-[48rem]:px-ds-300 @min-[48rem]:pt-ds-600 @min-[48rem]:pb-ds-300", children: [_jsxs("div", { "data-slot": "footer-top", className: cn("grid grid-cols-1 gap-ds-400 @min-[48rem]:gap-ds-300", GRID[Math.min(columns.length, MAX_COLUMNS)]), children: [_jsxs("div", { "data-slot": "footer-brand", className: "flex flex-col items-start gap-ds-100", children: [_jsx(AriaLink, { href: brandHref, "aria-label": brandLabel, "data-slot": "footer-brand-link", className: "flex min-w-0 items-center gap-ds-100 rounded-ds-medium text-body-strong text-ds-text outline-hidden data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused", children: _jsx(BrandLinkContext.Provider, { value: true, children: brand }) }), about && _jsx("p", { className: "m-0 max-w-[36ch] text-body text-ds-text-subtle", children: about }), contact && _jsx("div", { "data-slot": "footer-contact", className: "text-body", children: contact })] }), columns.map((column, index) => {
39
- const titleId = `${id}-column-${index}`;
40
- return (_jsxs("nav", { "aria-labelledby": titleId, "data-slot": "footer-column", className: "flex flex-col gap-ds-150", children: [_jsx(Title, { id: titleId, className: "m-0 heading-xxsmall text-ds-text", children: column.title }), _jsx("ul", { className: "m-0 flex list-none flex-col gap-ds-100 p-0", children: column.links.map((link, linkIndex) => (_jsx("li", { className: "text-body", children: _jsx(Link, { href: link.href, variant: "subtle", isExternal: link.isExternal, children: link.label }) }, `${linkIndex}-${link.href}`))) })] }, `${index}-${column.title}`));
41
- })] }), _jsxs("div", { "data-slot": "footer-legal", className: "flex flex-wrap items-center justify-between gap-x-ds-300 gap-y-ds-100 border-t border-ds-border pt-ds-200", children: [_jsx("div", { className: "text-body-small text-ds-text-subtlest", children: legal }), languageSwitch && _jsx("div", { "data-slot": "footer-language", className: "ms-auto", children: languageSwitch })] })] }) }));
42
- }
43
- //# sourceMappingURL=footer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"footer.js","sourceRoot":"","sources":["../../src/navigation/footer.tsx"],"names":[],"mappings":"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","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Link as AriaLink } from \"react-aria-components\";\n\nimport { cn } from \"../utils\";\nimport { BrandLinkContext } from \"./brand-link-context\";\nimport { Link } from \"../action/link\";\n\nexport type FooterLink = {\n /** Names the destination (\"Privacy policy\"), never \"Click here\". */\n label: string;\n href: string;\n /** Another site: opens in a new tab with the 12px `arrow-up-right`. */\n isExternal?: boolean;\n};\n\nexport type FooterColumn = {\n /** The column's title (\"Product\"); it also names the column's navigation. */\n title: string;\n /** At most six. */\n links: readonly FooterLink[];\n};\n\nexport type FooterProps = {\n /** The logo and wordmark (the site's logo and name). It links to `brandHref`. */\n brand: React.ReactNode;\n /** Where the brand goes: the home page. */\n brandHref?: string;\n /** The brand link's name when the brand alone does not say where it goes (\"Acme home\"). */\n brandLabel?: string;\n /** One line about the product, under the brand. */\n about?: React.ReactNode;\n /** A contact link under the about line (a subtle `Link` to the support address). */\n contact?: React.ReactNode;\n /** Two to four columns of links. */\n columns: readonly FooterColumn[];\n /** The copyright line (\"© 2026 Acme\"); a platform credit can go here too. */\n legal: React.ReactNode;\n /** The language switch at the end of the legal row (a subtle compact Button or Menu). */\n languageSwitch?: React.ReactNode;\n /** The column titles' heading level: 2 by default, a level below the page's h1. */\n headingLevel?: 2 | 3 | 4;\n};\n\nconst MAX_COLUMNS = 4;\nconst MAX_LINKS = 6;\n\n/** From 48rem: the brand block, then one track per column (static classes: no inline style to strip). */\nconst GRID: Record<number, string> = {\n 0: \"\",\n 1: \"@min-[48rem]:grid-cols-[minmax(0,1.5fr)_minmax(0,1fr)]\",\n 2: \"@min-[48rem]:grid-cols-[minmax(0,1.5fr)_repeat(2,minmax(0,1fr))]\",\n 3: \"@min-[48rem]:grid-cols-[minmax(0,1.5fr)_repeat(3,minmax(0,1fr))]\",\n 4: \"@min-[48rem]:grid-cols-[minmax(0,1.5fr)_repeat(4,minmax(0,1fr))]\",\n};\n\n/**\n * Closes every public page: the brand block, two to four\n * columns of subtle links, and the legal row with the copyright and the language switch. It holds no\n * primary action; the page's one primary action lives in the Navbar and the CTA band. Narrower than\n * 48rem (a phone) everything stacks in one column; it measures its own width, not the viewport's.\n * Render it at the page root, outside `main`, `section` and `article`: only there is it the page's\n * `contentinfo` landmark.\n */\nexport function Footer({ brand, brandHref = \"/\", brandLabel, about, contact, columns, legal, languageSwitch, headingLevel = 2 }: FooterProps) {\n const Title = `h${headingLevel}` as const;\n const id = React.useId();\n const tooMany = columns.length > MAX_COLUMNS || columns.some((column) => column.links.length > MAX_LINKS);\n // Once, not on every render, nor twice under StrictMode's re-run of effects.\n const warned = React.useRef(false);\n React.useEffect(() => {\n if (!tooMany || warned.current) return;\n warned.current = true;\n console.warn(`Footer: at most ${MAX_COLUMNS} columns of at most ${MAX_LINKS} links each.`);\n }, [tooMany]);\n return (\n <footer data-slot=\"footer\" className=\"@container border-t border-ds-border bg-ds-surface-sunken text-ds-text\">\n <div className=\"mx-auto flex max-w-[1200px] flex-col gap-ds-500 px-ds-200 pt-ds-500 pb-ds-200 @min-[48rem]:px-ds-300 @min-[48rem]:pt-ds-600 @min-[48rem]:pb-ds-300\">\n <div\n data-slot=\"footer-top\"\n className={cn(\"grid grid-cols-1 gap-ds-400 @min-[48rem]:gap-ds-300\", GRID[Math.min(columns.length, MAX_COLUMNS)])}\n >\n <div data-slot=\"footer-brand\" className=\"flex flex-col items-start gap-ds-100\">\n <AriaLink\n href={brandHref}\n aria-label={brandLabel}\n data-slot=\"footer-brand-link\"\n className=\"flex min-w-0 items-center gap-ds-100 rounded-ds-medium text-body-strong text-ds-text outline-hidden data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused\"\n >\n <BrandLinkContext.Provider value>{brand}</BrandLinkContext.Provider>\n </AriaLink>\n {about && <p className=\"m-0 max-w-[36ch] text-body text-ds-text-subtle\">{about}</p>}\n {contact && <div data-slot=\"footer-contact\" className=\"text-body\">{contact}</div>}\n </div>\n {columns.map((column, index) => {\n const titleId = `${id}-column-${index}`;\n return (\n <nav key={`${index}-${column.title}`} aria-labelledby={titleId} data-slot=\"footer-column\" className=\"flex flex-col gap-ds-150\">\n <Title id={titleId} className=\"m-0 heading-xxsmall text-ds-text\">\n {column.title}\n </Title>\n <ul className=\"m-0 flex list-none flex-col gap-ds-100 p-0\">\n {column.links.map((link, linkIndex) => (\n <li key={`${linkIndex}-${link.href}`} className=\"text-body\">\n <Link href={link.href} variant=\"subtle\" isExternal={link.isExternal}>\n {link.label}\n </Link>\n </li>\n ))}\n </ul>\n </nav>\n );\n })}\n </div>\n <div\n data-slot=\"footer-legal\"\n className=\"flex flex-wrap items-center justify-between gap-x-ds-300 gap-y-ds-100 border-t border-ds-border pt-ds-200\"\n >\n <div className=\"text-body-small text-ds-text-subtlest\">{legal}</div>\n {languageSwitch && <div data-slot=\"footer-language\" className=\"ms-auto\">{languageSwitch}</div>}\n </div>\n </div>\n </footer>\n );\n}\n"]}
@@ -1,19 +0,0 @@
1
- /**
2
- * Names for languages the runtime names wrongly or not at all, as the reader of `uiLocale` should see them:
3
- * Montenegrin, which Intl calls Serbian (`registerLanguageNames("en", { me: "Montenegrin" })`), or every
4
- * language in a UI language whose display names browsers do not ship (Albanian, Macedonian). `uiLocale` is a
5
- * language ("sq") or a full tag ("pt-BR"); the full tag wins.
6
- */
7
- export declare function registerLanguageNames(uiLocale: string, names: Readonly<Record<string, string>>): void;
8
- /** Uppercase the first code point only, in the UI language ("İngilizce" in Turkish), leaving the rest as given. */
9
- export declare function capitalizeLanguageName(name: string, uiLocale: string): string;
10
- /**
11
- * A language's name in the UI language: the app's registered name, else Intl's (through `registerLocaleAliases`),
12
- * else the language's own name (its endonym), never the host's language, else the tag itself.
13
- */
14
- export declare function languageName(locale: string, uiLocale: string): string;
15
- /** The locales with their names in the UI language, sorted by that name the way the UI language sorts. */
16
- export declare function languageOptions<Locale extends string>(locales: readonly Locale[], uiLocale: string): Array<{
17
- locale: Locale;
18
- label: string;
19
- }>;