@alfadocs/ui-kit 0.10.0 → 0.12.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/dist/_chunks/_commonjsHelpers-C6fGbg64.js +7 -0
- package/dist/_chunks/{ai-prompt-input-bAJwYu84.js → ai-prompt-input-noh-N3cf.js} +2 -2
- package/dist/_chunks/{contact-card-VJIUqKB2.js → contact-card-DTQUMetD.js} +22 -38
- package/dist/_chunks/external-link-C6F25E6k.js +16 -0
- package/dist/_chunks/{file-upload-DIecAfC-.js → file-upload-nMh-1jDD.js} +2 -2
- package/dist/_chunks/{index-CeY1nNvd.js → index-CFoBa86t.js} +61 -63
- package/dist/_chunks/{link-BGpwaFik.js → link-DmM5IevO.js} +16 -26
- package/dist/_chunks/map-pin-B8STOPMJ.js +21 -0
- package/dist/_chunks/map-view-Dd48BxVB.js +1941 -0
- package/dist/_chunks/{pdf-viewer-CNETPubN.js → pdf-viewer-CnEJvmXC.js} +407 -382
- package/dist/_chunks/whatsapp-button-Bj5FIhpC.js +175 -0
- package/dist/agent-catalog.json +53 -1
- package/dist/components/ai-prompt-input/index.js +1 -1
- package/dist/components/contact-card/index.js +1 -1
- package/dist/components/file-upload/index.js +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/link/index.js +1 -1
- package/dist/components/map-view/index.d.ts +3 -0
- package/dist/components/map-view/index.js +5 -0
- package/dist/components/map-view/map-view.agent.d.ts +4 -0
- package/dist/components/map-view/map-view.d.ts +78 -0
- package/dist/components/pdf-viewer/index.js +1 -1
- package/dist/components/pdf-viewer/pdf-viewer.d.ts +62 -0
- package/dist/components/whatsapp-button/index.d.ts +3 -0
- package/dist/components/whatsapp-button/index.js +5 -0
- package/dist/components/whatsapp-button/whatsapp-button.d.ts +32 -0
- package/dist/i18n/config.js +47 -5
- package/dist/i18n/resources.d.ts +42 -0
- package/dist/index.js +348 -344
- package/dist/locales/de.json +15 -1
- package/dist/locales/en.json +15 -1
- package/dist/locales/it.json +15 -1
- package/dist/tokens/google-maps-theme.d.ts +15 -0
- package/dist/tokens.css +1 -1
- package/package.json +15 -1
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { jsxs as c, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as y, useMemo as A } from "react";
|
|
3
|
+
import { c as m } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as C } from "react-i18next";
|
|
5
|
+
function u({ className: a }) {
|
|
6
|
+
return /* @__PURE__ */ i(
|
|
7
|
+
"svg",
|
|
8
|
+
{
|
|
9
|
+
"aria-hidden": "true",
|
|
10
|
+
viewBox: "0 0 24 24",
|
|
11
|
+
fill: "currentColor",
|
|
12
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
13
|
+
className: a,
|
|
14
|
+
children: /* @__PURE__ */ i("path", { d: "M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.149-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.71.306 1.263.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 0 1-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 0 1-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 0 1 2.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0 0 12.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 0 0 5.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 0 0-3.48-8.413Z" })
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
const _ = m(
|
|
19
|
+
[
|
|
20
|
+
"ds:relative ds:inline-flex ds:items-center ds:justify-center",
|
|
21
|
+
"ds:font-medium ds:whitespace-nowrap",
|
|
22
|
+
"ds:bg-[var(--brand-whatsapp)] ds:text-[var(--brand-whatsapp-foreground)]",
|
|
23
|
+
"ds:hover:bg-[var(--brand-whatsapp-hover)]",
|
|
24
|
+
"ds:active:opacity-90",
|
|
25
|
+
"ds:transition-[background-color,box-shadow,opacity]",
|
|
26
|
+
"ds:duration-[var(--animation-duration)]",
|
|
27
|
+
"ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
|
|
28
|
+
// Focus ring colour is `var(--ring)` (= `--primary` in light, ditto
|
|
29
|
+
// through theme cascade) — NOT `--brand-whatsapp`. Painting the
|
|
30
|
+
// ring brand-green on a brand-green surface makes it invisible.
|
|
31
|
+
"ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
32
|
+
// Under Windows High Contrast Mode the bg + shadow are stripped;
|
|
33
|
+
// repaint a solid border + swap the focus ring to CanvasText so
|
|
34
|
+
// the affordance stays identifiable.
|
|
35
|
+
"ds:forced-colors:border ds:forced-colors:border-[ButtonBorder]",
|
|
36
|
+
"ds:forced-colors:focus-visible:outline-[CanvasText]",
|
|
37
|
+
"ds:disabled:opacity-50 ds:disabled:cursor-not-allowed",
|
|
38
|
+
"ds:motion-reduce:transition-none"
|
|
39
|
+
].join(" "),
|
|
40
|
+
{
|
|
41
|
+
variants: {
|
|
42
|
+
variant: {
|
|
43
|
+
// Pill — inline rounded button. Visible label is the brand
|
|
44
|
+
// affordance text; glyph sits leading.
|
|
45
|
+
pill: "ds:rounded-[var(--radius-full)] ds:gap-[var(--spacing-xs)]",
|
|
46
|
+
// FAB — circular floating action button. Glyph only; the
|
|
47
|
+
// label resolves into `aria-label`.
|
|
48
|
+
fab: [
|
|
49
|
+
"ds:rounded-full ds:shadow-[var(--shadow-lg)]",
|
|
50
|
+
"ds:hover:shadow-[var(--shadow-xl)] ds:active:shadow-[var(--shadow-md)]"
|
|
51
|
+
].join(" ")
|
|
52
|
+
},
|
|
53
|
+
size: {
|
|
54
|
+
sm: "",
|
|
55
|
+
md: "",
|
|
56
|
+
lg: ""
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
compoundVariants: [
|
|
60
|
+
{
|
|
61
|
+
variant: "pill",
|
|
62
|
+
size: "sm",
|
|
63
|
+
class: 'ds:h-9 ds:ps-3 ds:pe-3.5 ds:text-[length:var(--font-size-sm)] ds:[&_svg]:size-4 ds:min-h-[var(--min-target-size)] ds:sm:min-h-0 ds:before:absolute ds:before:inset-x-[calc((var(--min-target-size)-100%)/-2)] ds:before:inset-y-[calc((var(--min-target-size)-100%)/-2)] ds:before:content-[""] ds:sm:before:hidden'
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
variant: "pill",
|
|
67
|
+
size: "md",
|
|
68
|
+
class: "ds:h-10 ds:ps-4 ds:pe-5 ds:text-[length:var(--font-size-base)] ds:[&_svg]:size-5"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
variant: "pill",
|
|
72
|
+
size: "lg",
|
|
73
|
+
class: "ds:h-12 ds:ps-5 ds:pe-6 ds:text-[length:var(--font-size-lg)] ds:[&_svg]:size-6"
|
|
74
|
+
},
|
|
75
|
+
// FAB — fixed square dimensions; the `sm` case mirrors the
|
|
76
|
+
// FloatingActionButton's pseudo-target expansion below the
|
|
77
|
+
// `sm:` breakpoint so a 40px circle still hits 44/48 px on
|
|
78
|
+
// mobile.
|
|
79
|
+
{
|
|
80
|
+
variant: "fab",
|
|
81
|
+
size: "sm",
|
|
82
|
+
class: 'ds:h-10 ds:w-10 ds:[&_svg]:size-5 ds:before:absolute ds:before:inset-x-[calc((var(--min-target-size)-100%)/-2)] ds:before:inset-y-[calc((var(--min-target-size)-100%)/-2)] ds:before:content-[""] ds:sm:before:hidden'
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
variant: "fab",
|
|
86
|
+
size: "md",
|
|
87
|
+
class: "ds:h-14 ds:w-14 ds:[&_svg]:size-7"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
variant: "fab",
|
|
91
|
+
size: "lg",
|
|
92
|
+
class: "ds:h-16 ds:w-16 ds:[&_svg]:size-8"
|
|
93
|
+
}
|
|
94
|
+
],
|
|
95
|
+
defaultVariants: {
|
|
96
|
+
variant: "pill",
|
|
97
|
+
size: "md"
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
), j = m("", {
|
|
101
|
+
variants: {
|
|
102
|
+
position: {
|
|
103
|
+
static: "",
|
|
104
|
+
"bottom-end": "ds:fixed ds:z-[var(--z-fixed)] ds:bottom-[calc(var(--spacing-lg)+env(safe-area-inset-bottom,0px))] ds:end-[var(--spacing-lg)]",
|
|
105
|
+
"bottom-start": "ds:fixed ds:z-[var(--z-fixed)] ds:bottom-[calc(var(--spacing-lg)+env(safe-area-inset-bottom,0px))] ds:start-[var(--spacing-lg)]"
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
defaultVariants: { position: "static" }
|
|
109
|
+
});
|
|
110
|
+
function B(a, o) {
|
|
111
|
+
const s = a.replace(/\D/g, "");
|
|
112
|
+
if (s.length === 0)
|
|
113
|
+
return null;
|
|
114
|
+
const r = `https://wa.me/${s}`;
|
|
115
|
+
return o ? `${r}?text=${encodeURIComponent(o)}` : r;
|
|
116
|
+
}
|
|
117
|
+
const N = y(
|
|
118
|
+
({
|
|
119
|
+
phoneNumber: a,
|
|
120
|
+
message: o,
|
|
121
|
+
variant: s = "pill",
|
|
122
|
+
size: r = "md",
|
|
123
|
+
position: h,
|
|
124
|
+
label: g,
|
|
125
|
+
className: w,
|
|
126
|
+
...n
|
|
127
|
+
}, z) => {
|
|
128
|
+
const { t: p } = C(), f = A(
|
|
129
|
+
() => B(a, o),
|
|
130
|
+
[a, o]
|
|
131
|
+
), e = g ?? p(s === "fab" ? "whatsApp.fabLabel" : "whatsApp.label"), x = [
|
|
132
|
+
_({ variant: s, size: r }),
|
|
133
|
+
j({ position: h }),
|
|
134
|
+
w
|
|
135
|
+
].filter(Boolean).join(" "), d = f === null, v = {
|
|
136
|
+
ref: z,
|
|
137
|
+
...d ? {} : {
|
|
138
|
+
href: f,
|
|
139
|
+
target: "_blank",
|
|
140
|
+
rel: "noopener noreferrer"
|
|
141
|
+
},
|
|
142
|
+
"aria-disabled": d ? !0 : void 0,
|
|
143
|
+
"data-component": "whatsapp-button",
|
|
144
|
+
"data-variant": s,
|
|
145
|
+
onClick: (l) => {
|
|
146
|
+
var b;
|
|
147
|
+
d && l.preventDefault(), (b = n.onClick) == null || b.call(n, l);
|
|
148
|
+
},
|
|
149
|
+
className: x
|
|
150
|
+
}, t = d ? null : p("link.opensInNewTab", "Opens in a new tab");
|
|
151
|
+
if (s === "fab") {
|
|
152
|
+
const l = typeof e == "string" ? t ? `${e} — ${t}` : e : void 0;
|
|
153
|
+
return /* @__PURE__ */ c("a", { ...n, ...v, "aria-label": l, children: [
|
|
154
|
+
/* @__PURE__ */ i(u, {}),
|
|
155
|
+
typeof e != "string" ? /* @__PURE__ */ c("span", { className: "ds:sr-only", children: [
|
|
156
|
+
e,
|
|
157
|
+
t ? ` — ${t}` : null
|
|
158
|
+
] }) : null
|
|
159
|
+
] });
|
|
160
|
+
}
|
|
161
|
+
return /* @__PURE__ */ c("a", { ...n, ...v, children: [
|
|
162
|
+
/* @__PURE__ */ i(u, {}),
|
|
163
|
+
/* @__PURE__ */ i("span", { children: e }),
|
|
164
|
+
t ? /* @__PURE__ */ c("span", { className: "ds:sr-only", children: [
|
|
165
|
+
" — ",
|
|
166
|
+
t
|
|
167
|
+
] }) : null
|
|
168
|
+
] });
|
|
169
|
+
}
|
|
170
|
+
);
|
|
171
|
+
N.displayName = "WhatsAppButton";
|
|
172
|
+
export {
|
|
173
|
+
N as W
|
|
174
|
+
};
|
|
175
|
+
//# sourceMappingURL=whatsapp-button-Bj5FIhpC.js.map
|
package/dist/agent-catalog.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"packageVersion": "0.
|
|
3
|
+
"packageVersion": "0.12.0",
|
|
4
4
|
"components": [
|
|
5
5
|
{
|
|
6
6
|
"kind": "component",
|
|
@@ -1628,6 +1628,44 @@
|
|
|
1628
1628
|
}
|
|
1629
1629
|
}
|
|
1630
1630
|
},
|
|
1631
|
+
{
|
|
1632
|
+
"kind": "component",
|
|
1633
|
+
"id": "map-view",
|
|
1634
|
+
"capabilities": [],
|
|
1635
|
+
"state": [],
|
|
1636
|
+
"actions": [
|
|
1637
|
+
{
|
|
1638
|
+
"name": "pan_to",
|
|
1639
|
+
"safety": "read",
|
|
1640
|
+
"argsType": "{ position: { lat: number; lng: number } }",
|
|
1641
|
+
"description": "Pan the map to a new centre without changing zoom."
|
|
1642
|
+
},
|
|
1643
|
+
{
|
|
1644
|
+
"name": "set_zoom",
|
|
1645
|
+
"safety": "read",
|
|
1646
|
+
"argsType": "{ zoom: number }",
|
|
1647
|
+
"description": "Set the map zoom level (typical range 1–20)."
|
|
1648
|
+
},
|
|
1649
|
+
{
|
|
1650
|
+
"name": "select_marker",
|
|
1651
|
+
"safety": "read",
|
|
1652
|
+
"argsType": "{ id: string | null }",
|
|
1653
|
+
"description": "Select a marker by id, or pass null to clear the selection."
|
|
1654
|
+
}
|
|
1655
|
+
],
|
|
1656
|
+
"domHooks": {
|
|
1657
|
+
"root": {
|
|
1658
|
+
"attr": "data-component",
|
|
1659
|
+
"value": "map-view",
|
|
1660
|
+
"description": "Marks the element as a kit MapView."
|
|
1661
|
+
},
|
|
1662
|
+
"instanceId": {
|
|
1663
|
+
"attr": "data-component-id",
|
|
1664
|
+
"sourceProp": "id",
|
|
1665
|
+
"description": "Sourced from the id prop."
|
|
1666
|
+
}
|
|
1667
|
+
}
|
|
1668
|
+
},
|
|
1631
1669
|
{
|
|
1632
1670
|
"kind": "component",
|
|
1633
1671
|
"id": "matrix-rain",
|
|
@@ -3904,6 +3942,20 @@
|
|
|
3904
3942
|
}
|
|
3905
3943
|
}
|
|
3906
3944
|
},
|
|
3945
|
+
{
|
|
3946
|
+
"kind": "component",
|
|
3947
|
+
"id": "whatsapp-button",
|
|
3948
|
+
"capabilities": [],
|
|
3949
|
+
"state": [],
|
|
3950
|
+
"actions": [],
|
|
3951
|
+
"domHooks": {
|
|
3952
|
+
"root": {
|
|
3953
|
+
"attr": "data-component",
|
|
3954
|
+
"value": "whatsapp-button",
|
|
3955
|
+
"description": "Marks the element as a kit WhatsAppButton."
|
|
3956
|
+
}
|
|
3957
|
+
}
|
|
3958
|
+
},
|
|
3907
3959
|
{
|
|
3908
3960
|
"kind": "component",
|
|
3909
3961
|
"id": "workflow-card",
|
|
@@ -47,6 +47,7 @@ export * from './kbd';
|
|
|
47
47
|
export * from './key-value-pair';
|
|
48
48
|
export * from './list';
|
|
49
49
|
export * from './logo';
|
|
50
|
+
export * from './map-view';
|
|
50
51
|
export * from './rating';
|
|
51
52
|
export * from './skeleton';
|
|
52
53
|
export * from './sparkline';
|
|
@@ -117,6 +118,7 @@ export * from './signature-capture';
|
|
|
117
118
|
export * from './slot-grid';
|
|
118
119
|
export * from './tooth-scheme';
|
|
119
120
|
export * from './transaction-chip';
|
|
121
|
+
export * from './whatsapp-button';
|
|
120
122
|
export * from './workflow';
|
|
121
123
|
export * from '../patterns/leo-assistant';
|
|
122
124
|
export * from '../patterns/patient-shell';
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
+
export interface MapLatLng {
|
|
4
|
+
lat: number;
|
|
5
|
+
lng: number;
|
|
6
|
+
}
|
|
7
|
+
export interface MapMarker {
|
|
8
|
+
/** Stable id — used for keyed re-rendering and `onMarkerClick`. */
|
|
9
|
+
id: string;
|
|
10
|
+
/** Position in lat/lng. */
|
|
11
|
+
position: MapLatLng;
|
|
12
|
+
/** Optional accessible label — falls back to the id. */
|
|
13
|
+
label?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface MapViewHandle {
|
|
16
|
+
/** Pan the map to a new centre without changing zoom. */
|
|
17
|
+
panTo: (position: MapLatLng) => void;
|
|
18
|
+
/** Set zoom (typical range 1–20). */
|
|
19
|
+
setZoom: (zoom: number) => void;
|
|
20
|
+
/** Programmatically select a marker (fires `onMarkerClick`). */
|
|
21
|
+
selectMarker: (id: string | null) => void;
|
|
22
|
+
}
|
|
23
|
+
export interface MapViewProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onClick'>, VariantProps<typeof mapViewVariants> {
|
|
24
|
+
/** Opaque instance id — emitted as `data-component-id`. */
|
|
25
|
+
id?: string;
|
|
26
|
+
/** Google Maps JS API key. Consumer-owned; never cached by the kit. */
|
|
27
|
+
apiKey: string;
|
|
28
|
+
/** Map centre (lat/lng). Required so the consent placeholder can also use it. */
|
|
29
|
+
center: MapLatLng;
|
|
30
|
+
/** Initial zoom. Default 15 (city-block detail, matches booking site). */
|
|
31
|
+
zoom?: number;
|
|
32
|
+
/**
|
|
33
|
+
* Markers to render. The first marker auto-selects when no
|
|
34
|
+
* `selectedMarkerId` is given.
|
|
35
|
+
*/
|
|
36
|
+
markers?: MapMarker[];
|
|
37
|
+
/** Controlled selection — fires `onMarkerClick` with the new id (or null on map click). */
|
|
38
|
+
selectedMarkerId?: string | null;
|
|
39
|
+
/** Fires when a marker is clicked, or `null` when the map background is clicked. */
|
|
40
|
+
onMarkerClick?: (id: string | null) => void;
|
|
41
|
+
/**
|
|
42
|
+
* GDPR consent gate. When `false` (default) the component renders a
|
|
43
|
+
* placeholder with a translated CTA — the Maps JS API is **not**
|
|
44
|
+
* loaded. Flip to `true` once the consumer has captured opt-in.
|
|
45
|
+
*/
|
|
46
|
+
consentGranted?: boolean;
|
|
47
|
+
/** Fires when the consumer clicks the "Load map" CTA in the placeholder. */
|
|
48
|
+
onConsentRequest?: () => void;
|
|
49
|
+
/**
|
|
50
|
+
* Optional address string shown in the consent placeholder so the
|
|
51
|
+
* surface is useful before the map loads. Also used to build the
|
|
52
|
+
* fallback "Open in Google Maps" link target.
|
|
53
|
+
*/
|
|
54
|
+
address?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Cloud-styled-map id. When set, takes precedence over the JSON
|
|
57
|
+
* `styles` array and disables the theme-bridge re-fire. Use when
|
|
58
|
+
* you've provisioned a styled map in Google Cloud Console.
|
|
59
|
+
*/
|
|
60
|
+
mapId?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Override the consent-placeholder description text. The default
|
|
63
|
+
* (`t('mapView.consentDescription')`) is a generic IP-disclosure
|
|
64
|
+
* line. Consumers operating under specific GDPR / ePrivacy
|
|
65
|
+
* disclosures (jurisdiction, named controller, policy link) should
|
|
66
|
+
* supply their own text via this prop. Pass any `ReactNode` — a
|
|
67
|
+
* paragraph, a localised `<Trans>` instance, etc.
|
|
68
|
+
*/
|
|
69
|
+
consentDescription?: ReactNode;
|
|
70
|
+
/** Accessible label for the map region. Falls back to `t('mapView.label')`. */
|
|
71
|
+
ariaLabel?: string;
|
|
72
|
+
}
|
|
73
|
+
declare const mapViewVariants: (props?: ({
|
|
74
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
75
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
76
|
+
export declare const MapView: import("react").ForwardRefExoticComponent<MapViewProps & import("react").RefAttributes<MapViewHandle>>;
|
|
77
|
+
export {};
|
|
78
|
+
//# sourceMappingURL=map-view.d.ts.map
|
|
@@ -1,4 +1,30 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
1
2
|
export type PDFZoomPreset = 'fit-width' | 'fit-page' | 'actual-size' | number;
|
|
3
|
+
export type PDFPageRotation = 0 | 90 | 180 | 270;
|
|
4
|
+
/**
|
|
5
|
+
* Arguments passed to `renderPageOverlay` for each rendered page.
|
|
6
|
+
*
|
|
7
|
+
* `pageWidthCss` and `pageHeightCss` are post-zoom, post-rotation CSS
|
|
8
|
+
* pixel dimensions — exactly the rendered box the consumer is
|
|
9
|
+
* positioning content over. They update on resize, zoom, and rotation
|
|
10
|
+
* changes; the render-prop re-runs on every change so positioned
|
|
11
|
+
* children stay in sync with the page geometry without the consumer
|
|
12
|
+
* touching a `ResizeObserver`.
|
|
13
|
+
*/
|
|
14
|
+
export interface PDFPageOverlayArgs {
|
|
15
|
+
/** 1-based page number. */
|
|
16
|
+
pageNumber: number;
|
|
17
|
+
/** CSS-pixel width of the rendered page (post-zoom, post-rotation). */
|
|
18
|
+
pageWidthCss: number;
|
|
19
|
+
/** CSS-pixel height of the rendered page. */
|
|
20
|
+
pageHeightCss: number;
|
|
21
|
+
/**
|
|
22
|
+
* Effective rotation of the rendered viewport in degrees. Reflects
|
|
23
|
+
* `pageRotation` (if set) overriding the page's intrinsic `/Rotate`,
|
|
24
|
+
* otherwise the intrinsic rotation.
|
|
25
|
+
*/
|
|
26
|
+
rotation: PDFPageRotation;
|
|
27
|
+
}
|
|
2
28
|
export interface PDFViewerProps {
|
|
3
29
|
/** Opaque instance id — emitted as `data-component-id` for the agent registry. */
|
|
4
30
|
id?: string;
|
|
@@ -8,6 +34,42 @@ export interface PDFViewerProps {
|
|
|
8
34
|
initialPage?: number;
|
|
9
35
|
/** Initial zoom preset. Default 'fit-width'. */
|
|
10
36
|
initialZoom?: PDFZoomPreset;
|
|
37
|
+
/**
|
|
38
|
+
* Force every page to render at this rotation, overriding the page's
|
|
39
|
+
* intrinsic `/Rotate` metadata. Useful for scanned PDFs that opened
|
|
40
|
+
* sideways, and for the signing-flow consumer that lets users
|
|
41
|
+
* straighten misrotated pages before placing signature fields.
|
|
42
|
+
* `undefined` (default) honours each page's intrinsic rotation.
|
|
43
|
+
*/
|
|
44
|
+
pageRotation?: PDFPageRotation;
|
|
45
|
+
/**
|
|
46
|
+
* Render a layer of arbitrary React content positioned over each
|
|
47
|
+
* rendered PDF page — signature fields, redaction boxes, annotation
|
|
48
|
+
* pins, anything that needs to live in PDF coordinate space.
|
|
49
|
+
*
|
|
50
|
+
* The render-prop is invoked **only for pages currently inside the
|
|
51
|
+
* IntersectionObserver buffer** (visible ±1), and the returned tree
|
|
52
|
+
* unmounts when the page leaves the buffer. Consumer-held timers /
|
|
53
|
+
* fetches / subscriptions in overlay children therefore tear down
|
|
54
|
+
* automatically with the page. The overlay container is absolutely
|
|
55
|
+
* positioned, sized to the rendered page, and has
|
|
56
|
+
* `pointer-events: auto` so consumer children can be interactive.
|
|
57
|
+
* Consumers position children themselves (typically
|
|
58
|
+
* `position: absolute; inset-inline-start: %; inset-block-start: %`).
|
|
59
|
+
*
|
|
60
|
+
* The render-prop re-runs on resize, zoom, and rotation changes so
|
|
61
|
+
* positioned children stay aligned without the consumer wiring a
|
|
62
|
+
* `ResizeObserver`. Pages already declare `data-page-number` on the
|
|
63
|
+
* `<article>` ancestor; consumer-rendered children should be
|
|
64
|
+
* keyboard-reachable per the kit's a11y contract.
|
|
65
|
+
*
|
|
66
|
+
* Composition note: PDF.js's `AnnotationLayer` (for native form
|
|
67
|
+
* fields and link annotations) is not yet wired in — see the file
|
|
68
|
+
* header TODO. When it lands, `renderPageOverlay` will compose
|
|
69
|
+
* **above** the AnnotationLayer in z-order, since interactive
|
|
70
|
+
* consumer content should sit on top of intrinsic page widgets.
|
|
71
|
+
*/
|
|
72
|
+
renderPageOverlay?: (args: PDFPageOverlayArgs) => ReactNode;
|
|
11
73
|
/** Emits when the currently-most-visible page changes. */
|
|
12
74
|
onPageChange?: (page: number) => void;
|
|
13
75
|
/** Emits once the PDF document has loaded. */
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type AnchorHTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
+
declare const rootVariants: (props?: ({
|
|
4
|
+
variant?: "pill" | "fab" | null | undefined;
|
|
5
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
declare const positionVariants: (props?: ({
|
|
8
|
+
position?: "bottom-end" | "bottom-start" | "static" | null | undefined;
|
|
9
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
|
+
export interface WhatsAppButtonProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'href' | 'children'>, VariantProps<typeof rootVariants>, VariantProps<typeof positionVariants> {
|
|
11
|
+
/**
|
|
12
|
+
* Phone number to chat to. E.164 format is recommended
|
|
13
|
+
* (e.g. `+393331234567`). Any non-digit characters are stripped
|
|
14
|
+
* before the URL is built — `wa.me` requires digits only.
|
|
15
|
+
*/
|
|
16
|
+
phoneNumber: string;
|
|
17
|
+
/**
|
|
18
|
+
* Optional prefilled message. The receiver sees this in their
|
|
19
|
+
* compose box. Keep it short and human — long pasted text is the
|
|
20
|
+
* single most common reason consumers drop the affordance.
|
|
21
|
+
*/
|
|
22
|
+
message?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Override the visible / accessible label. Defaults to
|
|
25
|
+
* `t('whatsApp.label')` for the pill variant and
|
|
26
|
+
* `t('whatsApp.fabLabel')` for the FAB.
|
|
27
|
+
*/
|
|
28
|
+
label?: ReactNode;
|
|
29
|
+
}
|
|
30
|
+
export declare const WhatsAppButton: import("react").ForwardRefExoticComponent<WhatsAppButtonProps & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
31
|
+
export {};
|
|
32
|
+
//# sourceMappingURL=whatsapp-button.d.ts.map
|
package/dist/i18n/config.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import t from "i18next";
|
|
2
|
-
import { default as
|
|
2
|
+
import { default as f } from "i18next";
|
|
3
3
|
import { initReactI18next as l } from "react-i18next";
|
|
4
4
|
const a = {
|
|
5
5
|
common: {
|
|
@@ -827,7 +827,21 @@ const a = {
|
|
|
827
827
|
print: "Print",
|
|
828
828
|
download: "Download",
|
|
829
829
|
loading: "Loading PDF…",
|
|
830
|
-
error: "Failed to load PDF"
|
|
830
|
+
error: "Failed to load PDF",
|
|
831
|
+
pageOverlay: "Page {{page}} overlay"
|
|
832
|
+
},
|
|
833
|
+
mapView: {
|
|
834
|
+
label: "Map",
|
|
835
|
+
markerLabel: "Marker for {{label}}",
|
|
836
|
+
consentTitle: "Show interactive map",
|
|
837
|
+
consentDescription: "Loading the map shares your IP address with Google so it can serve map tiles. Continue?",
|
|
838
|
+
consentCta: "Load map",
|
|
839
|
+
openInGoogleMaps: "Open in Google Maps"
|
|
840
|
+
},
|
|
841
|
+
whatsApp: {
|
|
842
|
+
label: "Chat on WhatsApp",
|
|
843
|
+
fabLabel: "Open WhatsApp chat",
|
|
844
|
+
questionPrompt: "Have questions? Chat on WhatsApp"
|
|
831
845
|
},
|
|
832
846
|
paywall: {
|
|
833
847
|
title: "Upgrade to keep going",
|
|
@@ -1777,7 +1791,21 @@ const a = {
|
|
|
1777
1791
|
print: "Stampa",
|
|
1778
1792
|
download: "Scarica",
|
|
1779
1793
|
loading: "Caricamento PDF…",
|
|
1780
|
-
error: "Impossibile caricare il PDF"
|
|
1794
|
+
error: "Impossibile caricare il PDF",
|
|
1795
|
+
pageOverlay: "Overlay pagina {{page}}"
|
|
1796
|
+
},
|
|
1797
|
+
mapView: {
|
|
1798
|
+
label: "Mappa",
|
|
1799
|
+
markerLabel: "Indicatore per {{label}}",
|
|
1800
|
+
consentTitle: "Mostra mappa interattiva",
|
|
1801
|
+
consentDescription: "Caricando la mappa il tuo indirizzo IP verrà condiviso con Google per ricevere le tile della mappa. Vuoi continuare?",
|
|
1802
|
+
consentCta: "Carica mappa",
|
|
1803
|
+
openInGoogleMaps: "Apri in Google Maps"
|
|
1804
|
+
},
|
|
1805
|
+
whatsApp: {
|
|
1806
|
+
label: "Scrivici su WhatsApp",
|
|
1807
|
+
fabLabel: "Apri chat WhatsApp",
|
|
1808
|
+
questionPrompt: "Hai domande? Scrivici su WhatsApp"
|
|
1781
1809
|
},
|
|
1782
1810
|
paywall: {
|
|
1783
1811
|
title: "Esegui l'upgrade per continuare",
|
|
@@ -2727,7 +2755,21 @@ const a = {
|
|
|
2727
2755
|
print: "Drucken",
|
|
2728
2756
|
download: "Herunterladen",
|
|
2729
2757
|
loading: "PDF wird geladen …",
|
|
2730
|
-
error: "PDF konnte nicht geladen werden"
|
|
2758
|
+
error: "PDF konnte nicht geladen werden",
|
|
2759
|
+
pageOverlay: "Seitenoverlay {{page}}"
|
|
2760
|
+
},
|
|
2761
|
+
mapView: {
|
|
2762
|
+
label: "Karte",
|
|
2763
|
+
markerLabel: "Markierung für {{label}}",
|
|
2764
|
+
consentTitle: "Interaktive Karte anzeigen",
|
|
2765
|
+
consentDescription: "Beim Laden der Karte wird Ihre IP-Adresse an Google übermittelt, um die Kartenkacheln zu laden. Fortfahren?",
|
|
2766
|
+
consentCta: "Karte laden",
|
|
2767
|
+
openInGoogleMaps: "In Google Maps öffnen"
|
|
2768
|
+
},
|
|
2769
|
+
whatsApp: {
|
|
2770
|
+
label: "Auf WhatsApp schreiben",
|
|
2771
|
+
fabLabel: "WhatsApp-Chat öffnen",
|
|
2772
|
+
questionPrompt: "Fragen? Auf WhatsApp schreiben"
|
|
2731
2773
|
},
|
|
2732
2774
|
paywall: {
|
|
2733
2775
|
title: "Upgraden, um fortzufahren",
|
|
@@ -2938,7 +2980,7 @@ export {
|
|
|
2938
2980
|
p as LOCALES_WITH_BUNDLES,
|
|
2939
2981
|
o as arUi,
|
|
2940
2982
|
i as deUi,
|
|
2941
|
-
|
|
2983
|
+
f as default,
|
|
2942
2984
|
a as enUi,
|
|
2943
2985
|
n as itUi,
|
|
2944
2986
|
g as registerUiBundle,
|
package/dist/i18n/resources.d.ts
CHANGED
|
@@ -840,6 +840,20 @@ export declare const enUi: {
|
|
|
840
840
|
readonly download: "Download";
|
|
841
841
|
readonly loading: "Loading PDF…";
|
|
842
842
|
readonly error: "Failed to load PDF";
|
|
843
|
+
readonly pageOverlay: "Page {{page}} overlay";
|
|
844
|
+
};
|
|
845
|
+
readonly mapView: {
|
|
846
|
+
readonly label: "Map";
|
|
847
|
+
readonly markerLabel: "Marker for {{label}}";
|
|
848
|
+
readonly consentTitle: "Show interactive map";
|
|
849
|
+
readonly consentDescription: "Loading the map shares your IP address with Google so it can serve map tiles. Continue?";
|
|
850
|
+
readonly consentCta: "Load map";
|
|
851
|
+
readonly openInGoogleMaps: "Open in Google Maps";
|
|
852
|
+
};
|
|
853
|
+
readonly whatsApp: {
|
|
854
|
+
readonly label: "Chat on WhatsApp";
|
|
855
|
+
readonly fabLabel: "Open WhatsApp chat";
|
|
856
|
+
readonly questionPrompt: "Have questions? Chat on WhatsApp";
|
|
843
857
|
};
|
|
844
858
|
readonly paywall: {
|
|
845
859
|
readonly title: "Upgrade to keep going";
|
|
@@ -1812,6 +1826,20 @@ export declare const itUi: {
|
|
|
1812
1826
|
readonly download: "Scarica";
|
|
1813
1827
|
readonly loading: "Caricamento PDF…";
|
|
1814
1828
|
readonly error: "Impossibile caricare il PDF";
|
|
1829
|
+
readonly pageOverlay: "Overlay pagina {{page}}";
|
|
1830
|
+
};
|
|
1831
|
+
readonly mapView: {
|
|
1832
|
+
readonly label: "Mappa";
|
|
1833
|
+
readonly markerLabel: "Indicatore per {{label}}";
|
|
1834
|
+
readonly consentTitle: "Mostra mappa interattiva";
|
|
1835
|
+
readonly consentDescription: "Caricando la mappa il tuo indirizzo IP verrà condiviso con Google per ricevere le tile della mappa. Vuoi continuare?";
|
|
1836
|
+
readonly consentCta: "Carica mappa";
|
|
1837
|
+
readonly openInGoogleMaps: "Apri in Google Maps";
|
|
1838
|
+
};
|
|
1839
|
+
readonly whatsApp: {
|
|
1840
|
+
readonly label: "Scrivici su WhatsApp";
|
|
1841
|
+
readonly fabLabel: "Apri chat WhatsApp";
|
|
1842
|
+
readonly questionPrompt: "Hai domande? Scrivici su WhatsApp";
|
|
1815
1843
|
};
|
|
1816
1844
|
readonly paywall: {
|
|
1817
1845
|
readonly title: "Esegui l'upgrade per continuare";
|
|
@@ -2787,6 +2815,20 @@ export declare const deUi: {
|
|
|
2787
2815
|
readonly download: "Herunterladen";
|
|
2788
2816
|
readonly loading: "PDF wird geladen …";
|
|
2789
2817
|
readonly error: "PDF konnte nicht geladen werden";
|
|
2818
|
+
readonly pageOverlay: "Seitenoverlay {{page}}";
|
|
2819
|
+
};
|
|
2820
|
+
readonly mapView: {
|
|
2821
|
+
readonly label: "Karte";
|
|
2822
|
+
readonly markerLabel: "Markierung für {{label}}";
|
|
2823
|
+
readonly consentTitle: "Interaktive Karte anzeigen";
|
|
2824
|
+
readonly consentDescription: "Beim Laden der Karte wird Ihre IP-Adresse an Google übermittelt, um die Kartenkacheln zu laden. Fortfahren?";
|
|
2825
|
+
readonly consentCta: "Karte laden";
|
|
2826
|
+
readonly openInGoogleMaps: "In Google Maps öffnen";
|
|
2827
|
+
};
|
|
2828
|
+
readonly whatsApp: {
|
|
2829
|
+
readonly label: "Auf WhatsApp schreiben";
|
|
2830
|
+
readonly fabLabel: "WhatsApp-Chat öffnen";
|
|
2831
|
+
readonly questionPrompt: "Fragen? Auf WhatsApp schreiben";
|
|
2790
2832
|
};
|
|
2791
2833
|
readonly paywall: {
|
|
2792
2834
|
readonly title: "Upgraden, um fortzufahren";
|