@alfadocs/ui-kit 0.9.1 → 0.11.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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "packageVersion": "0.9.1",
3
+ "packageVersion": "0.11.0",
4
4
  "components": [
5
5
  {
6
6
  "kind": "component",
@@ -2445,6 +2445,20 @@
2445
2445
  }
2446
2446
  }
2447
2447
  },
2448
+ {
2449
+ "kind": "component",
2450
+ "id": "rating",
2451
+ "capabilities": [],
2452
+ "state": [],
2453
+ "actions": [],
2454
+ "domHooks": {
2455
+ "root": {
2456
+ "attr": "data-component",
2457
+ "value": "rating",
2458
+ "description": "Marks the element as a kit Rating."
2459
+ }
2460
+ }
2461
+ },
2448
2462
  {
2449
2463
  "kind": "component",
2450
2464
  "id": "recaptcha-widget",
@@ -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 './rating';
50
51
  export * from './skeleton';
51
52
  export * from './sparkline';
52
53
  export * from './stat';
@@ -1,4 +1,4 @@
1
- import { P as p, p as a } from "../../_chunks/pdf-viewer-CNETPubN.js";
1
+ import { P as p, p as a } from "../../_chunks/pdf-viewer-CnEJvmXC.js";
2
2
  export {
3
3
  p as PDFViewer,
4
4
  a as pdfViewerAgent
@@ -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,3 @@
1
+ export { Rating } from './rating';
2
+ export type { RatingProps } from './rating';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,5 @@
1
+ import { R as r } from "../../_chunks/rating-BRD7O74e.js";
2
+ export {
3
+ r as Rating
4
+ };
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,29 @@
1
+ import { type HTMLAttributes } from 'react';
2
+ import { type VariantProps } from 'class-variance-authority';
3
+ declare const ratingVariants: (props?: ({
4
+ size?: "sm" | "md" | "lg" | null | undefined;
5
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
+ interface RatingProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'aria-label'>, VariantProps<typeof ratingVariants> {
7
+ /** Average score, 0..max. Fractional values render as half-step fills. */
8
+ value: number;
9
+ /** Total number of stars. Defaults to 5. */
10
+ max?: number;
11
+ /** Optional inline review-count summary. Plural-aware via i18next. */
12
+ reviews?: {
13
+ count: number;
14
+ label?: string;
15
+ };
16
+ /** Underline the reviews summary text — useful when it's a link. */
17
+ underlined?: boolean;
18
+ /**
19
+ * When `true`, the rating is decorative — `aria-hidden`, no role, no
20
+ * computed label. Use when the surrounding context already announces
21
+ * the score (e.g. a card whose accessible name includes the value).
22
+ */
23
+ decorative?: boolean;
24
+ /** Override the default i18n-derived `aria-label`. */
25
+ 'aria-label'?: string;
26
+ }
27
+ export declare const Rating: import("react").ForwardRefExoticComponent<RatingProps & import("react").RefAttributes<HTMLSpanElement>>;
28
+ export type { RatingProps };
29
+ //# sourceMappingURL=rating.d.ts.map
@@ -1,4 +1,4 @@
1
- import { S as r, a as i, b as s, c as d, d as S, e as b, f as t, g as o, h as m, i as n, j as l, k as c, l as I, m as g, n as p, o as u, p as P, s as f, u as B, q as F } from "../../_chunks/sidebar-CoLHtVrP.js";
1
+ import { S as r, a as i, b as s, c as d, d as S, e as b, f as t, g as o, h as m, i as n, j as l, k as c, l as I, m as g, n as p, o as u, p as P, s as f, u as B, q as F } from "../../_chunks/sidebar-D8Lq065m.js";
2
2
  export {
3
3
  r as Sidebar,
4
4
  i as SidebarBody,
@@ -349,6 +349,14 @@ const a = {
349
349
  secondaryCta: "Contact support"
350
350
  }
351
351
  },
352
+ rating: {
353
+ // Default aria-label for a non-decorative Rating, plus the inline
354
+ // summary used when `reviews` is provided. `_one` / `_other` plurals
355
+ // make the i18next CLDR pluralizer pick the right form per locale.
356
+ label: "{{value}} out of {{max}} stars",
357
+ reviews_one: "{{value}} stars · 1 review",
358
+ reviews_other: "{{value}} stars · {{count}} reviews"
359
+ },
352
360
  sparkline: {
353
361
  summary: "{{label}}: min {{min}}, max {{max}}, current {{current}}, {{direction}}",
354
362
  summaryNoLabel: "min {{min}}, max {{max}}, current {{current}}, {{direction}}",
@@ -819,7 +827,8 @@ const a = {
819
827
  print: "Print",
820
828
  download: "Download",
821
829
  loading: "Loading PDF…",
822
- error: "Failed to load PDF"
830
+ error: "Failed to load PDF",
831
+ pageOverlay: "Page {{page}} overlay"
823
832
  },
824
833
  paywall: {
825
834
  title: "Upgrade to keep going",
@@ -1321,6 +1330,11 @@ const a = {
1321
1330
  secondaryCta: "Contatta il supporto"
1322
1331
  }
1323
1332
  },
1333
+ rating: {
1334
+ label: "{{value}} stelle su {{max}}",
1335
+ reviews_one: "{{value}} stelle · 1 opinione",
1336
+ reviews_other: "{{value}} stelle · {{count}} opinioni"
1337
+ },
1324
1338
  sparkline: {
1325
1339
  summary: "{{label}}: min {{min}}, max {{max}}, attuale {{current}}, {{direction}}",
1326
1340
  summaryNoLabel: "min {{min}}, max {{max}}, attuale {{current}}, {{direction}}",
@@ -1764,7 +1778,8 @@ const a = {
1764
1778
  print: "Stampa",
1765
1779
  download: "Scarica",
1766
1780
  loading: "Caricamento PDF…",
1767
- error: "Impossibile caricare il PDF"
1781
+ error: "Impossibile caricare il PDF",
1782
+ pageOverlay: "Overlay pagina {{page}}"
1768
1783
  },
1769
1784
  paywall: {
1770
1785
  title: "Esegui l'upgrade per continuare",
@@ -2266,6 +2281,11 @@ const a = {
2266
2281
  secondaryCta: "Support kontaktieren"
2267
2282
  }
2268
2283
  },
2284
+ rating: {
2285
+ label: "{{value}} von {{max}} Sternen",
2286
+ reviews_one: "{{value}} Sterne · 1 Bewertung",
2287
+ reviews_other: "{{value}} Sterne · {{count}} Bewertungen"
2288
+ },
2269
2289
  sparkline: {
2270
2290
  summary: "{{label}}: Min. {{min}}, Max. {{max}}, aktuell {{current}}, {{direction}}",
2271
2291
  summaryNoLabel: "Min. {{min}}, Max. {{max}}, aktuell {{current}}, {{direction}}",
@@ -2709,7 +2729,8 @@ const a = {
2709
2729
  print: "Drucken",
2710
2730
  download: "Herunterladen",
2711
2731
  loading: "PDF wird geladen …",
2712
- error: "PDF konnte nicht geladen werden"
2732
+ error: "PDF konnte nicht geladen werden",
2733
+ pageOverlay: "Seitenoverlay {{page}}"
2713
2734
  },
2714
2735
  paywall: {
2715
2736
  title: "Upgraden, um fortzufahren",
@@ -2870,13 +2891,13 @@ const a = {
2870
2891
  label: "{{state}} {{amount}}"
2871
2892
  }
2872
2893
  }
2873
- }, o = {}, p = ["en", "it", "de", "ar"], m = {
2894
+ }, o = {}, p = ["en", "it", "de", "ar"], g = {
2874
2895
  en: a,
2875
2896
  it: n,
2876
2897
  de: i,
2877
2898
  ar: o
2878
2899
  };
2879
- function g(r, s) {
2900
+ function m(r, s) {
2880
2901
  t.addResourceBundle(
2881
2902
  r,
2882
2903
  "ui",
@@ -2923,7 +2944,7 @@ export {
2923
2944
  b as default,
2924
2945
  a as enUi,
2925
2946
  n as itUi,
2926
- g as registerUiBundle,
2927
- m as uiResources
2947
+ m as registerUiBundle,
2948
+ g as uiResources
2928
2949
  };
2929
2950
  //# sourceMappingURL=config.js.map
@@ -367,6 +367,11 @@ export declare const enUi: {
367
367
  readonly secondaryCta: "Contact support";
368
368
  };
369
369
  };
370
+ readonly rating: {
371
+ readonly label: "{{value}} out of {{max}} stars";
372
+ readonly reviews_one: "{{value}} stars · 1 review";
373
+ readonly reviews_other: "{{value}} stars · {{count}} reviews";
374
+ };
370
375
  readonly sparkline: {
371
376
  readonly summary: "{{label}}: min {{min}}, max {{max}}, current {{current}}, {{direction}}";
372
377
  readonly summaryNoLabel: "min {{min}}, max {{max}}, current {{current}}, {{direction}}";
@@ -835,6 +840,7 @@ export declare const enUi: {
835
840
  readonly download: "Download";
836
841
  readonly loading: "Loading PDF…";
837
842
  readonly error: "Failed to load PDF";
843
+ readonly pageOverlay: "Page {{page}} overlay";
838
844
  };
839
845
  readonly paywall: {
840
846
  readonly title: "Upgrade to keep going";
@@ -1358,6 +1364,11 @@ export declare const itUi: {
1358
1364
  readonly secondaryCta: "Contatta il supporto";
1359
1365
  };
1360
1366
  };
1367
+ readonly rating: {
1368
+ readonly label: "{{value}} stelle su {{max}}";
1369
+ readonly reviews_one: "{{value}} stelle · 1 opinione";
1370
+ readonly reviews_other: "{{value}} stelle · {{count}} opinioni";
1371
+ };
1361
1372
  readonly sparkline: {
1362
1373
  readonly summary: "{{label}}: min {{min}}, max {{max}}, attuale {{current}}, {{direction}}";
1363
1374
  readonly summaryNoLabel: "min {{min}}, max {{max}}, attuale {{current}}, {{direction}}";
@@ -1802,6 +1813,7 @@ export declare const itUi: {
1802
1813
  readonly download: "Scarica";
1803
1814
  readonly loading: "Caricamento PDF…";
1804
1815
  readonly error: "Impossibile caricare il PDF";
1816
+ readonly pageOverlay: "Overlay pagina {{page}}";
1805
1817
  };
1806
1818
  readonly paywall: {
1807
1819
  readonly title: "Esegui l'upgrade per continuare";
@@ -2328,6 +2340,11 @@ export declare const deUi: {
2328
2340
  readonly secondaryCta: "Support kontaktieren";
2329
2341
  };
2330
2342
  };
2343
+ readonly rating: {
2344
+ readonly label: "{{value}} von {{max}} Sternen";
2345
+ readonly reviews_one: "{{value}} Sterne · 1 Bewertung";
2346
+ readonly reviews_other: "{{value}} Sterne · {{count}} Bewertungen";
2347
+ };
2331
2348
  readonly sparkline: {
2332
2349
  readonly summary: "{{label}}: Min. {{min}}, Max. {{max}}, aktuell {{current}}, {{direction}}";
2333
2350
  readonly summaryNoLabel: "Min. {{min}}, Max. {{max}}, aktuell {{current}}, {{direction}}";
@@ -2772,6 +2789,7 @@ export declare const deUi: {
2772
2789
  readonly download: "Herunterladen";
2773
2790
  readonly loading: "PDF wird geladen …";
2774
2791
  readonly error: "PDF konnte nicht geladen werden";
2792
+ readonly pageOverlay: "Seitenoverlay {{page}}";
2775
2793
  };
2776
2794
  readonly paywall: {
2777
2795
  readonly title: "Upgraden, um fortzufahren";