@tedi-design-system/react 18.0.0-rc.19 → 18.0.0-rc.20

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 (58) hide show
  1. package/_virtual/index.es13.js +2 -2
  2. package/_virtual/index.es14.js +2 -2
  3. package/bundle-stats.html +1 -1
  4. package/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.cjs.js +1 -1
  5. package/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.es.js +1 -1
  6. package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
  7. package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.es.js +1 -1
  8. package/external/hoist-non-react-statics/external/react-is/index.cjs.js +1 -1
  9. package/external/hoist-non-react-statics/external/react-is/index.es.js +1 -1
  10. package/external/prop-types/external/react-is/cjs/react-is.development.cjs.js +1 -1
  11. package/external/prop-types/external/react-is/cjs/react-is.development.es.js +1 -1
  12. package/external/prop-types/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
  13. package/external/prop-types/external/react-is/cjs/react-is.production.min.es.js +1 -1
  14. package/external/prop-types/external/react-is/index.cjs.js +1 -1
  15. package/external/prop-types/external/react-is/index.es.js +1 -1
  16. package/external/react-is/index.cjs.js +1 -1
  17. package/external/react-is/index.es.js +1 -1
  18. package/external/toposort/index.cjs.js +1 -1
  19. package/external/toposort/index.es.js +1 -1
  20. package/index.css +1 -1
  21. package/package.json +1 -1
  22. package/src/community/components/map-components/carousel/carousel.d.ts +10 -0
  23. package/src/tedi/components/content/carousel/carousel-context.cjs.js +1 -0
  24. package/src/tedi/components/content/carousel/carousel-context.d.ts +7 -0
  25. package/src/tedi/components/content/carousel/carousel-context.es.js +11 -0
  26. package/src/tedi/components/content/carousel/carousel-utils.cjs.js +1 -0
  27. package/src/tedi/components/content/carousel/carousel-utils.d.ts +26 -0
  28. package/src/tedi/components/content/carousel/carousel-utils.es.js +14 -0
  29. package/src/tedi/components/content/carousel/carousel.cjs.js +1 -0
  30. package/src/tedi/components/content/carousel/carousel.d.ts +20 -0
  31. package/src/tedi/components/content/carousel/carousel.es.js +27 -0
  32. package/src/tedi/components/content/carousel/carousel.module.scss.cjs.js +1 -0
  33. package/src/tedi/components/content/carousel/carousel.module.scss.es.js +18 -0
  34. package/src/tedi/components/content/carousel/components/carousel-content/carousel-content.cjs.js +1 -0
  35. package/src/tedi/components/content/carousel/components/carousel-content/carousel-content.d.ts +53 -0
  36. package/src/tedi/components/content/carousel/components/carousel-content/carousel-content.es.js +103 -0
  37. package/src/tedi/components/content/carousel/components/carousel-footer/carousel-footer.cjs.js +1 -0
  38. package/src/tedi/components/content/carousel/components/carousel-footer/carousel-footer.d.ts +17 -0
  39. package/src/tedi/components/content/carousel/components/carousel-footer/carousel-footer.es.js +10 -0
  40. package/src/tedi/components/content/carousel/components/carousel-header/carousel-header.cjs.js +1 -0
  41. package/src/tedi/components/content/carousel/components/carousel-header/carousel-header.d.ts +17 -0
  42. package/src/tedi/components/content/carousel/components/carousel-header/carousel-header.es.js +10 -0
  43. package/src/tedi/components/content/carousel/components/carousel-indicators/carousel-indicators.cjs.js +1 -0
  44. package/src/tedi/components/content/carousel/components/carousel-indicators/carousel-indicators.d.ts +20 -0
  45. package/src/tedi/components/content/carousel/components/carousel-indicators/carousel-indicators.es.js +38 -0
  46. package/src/tedi/components/content/carousel/components/carousel-navigation/carousel-navigation.cjs.js +1 -0
  47. package/src/tedi/components/content/carousel/components/carousel-navigation/carousel-navigation.d.ts +43 -0
  48. package/src/tedi/components/content/carousel/components/carousel-navigation/carousel-navigation.es.js +48 -0
  49. package/src/tedi/components/content/carousel/index.d.ts +7 -0
  50. package/src/tedi/components/content/carousel/use-carousel.cjs.js +1 -0
  51. package/src/tedi/components/content/carousel/use-carousel.d.ts +56 -0
  52. package/src/tedi/components/content/carousel/use-carousel.es.js +228 -0
  53. package/src/tedi/index.d.ts +1 -0
  54. package/src/tedi/providers/label-provider/labels-map.cjs.js +1 -1
  55. package/src/tedi/providers/label-provider/labels-map.d.ts +35 -0
  56. package/src/tedi/providers/label-provider/labels-map.es.js +35 -0
  57. package/tedi.cjs.js +1 -1
  58. package/tedi.es.js +267 -252
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tedi-design-system/react",
3
- "version": "18.0.0-rc.19",
3
+ "version": "18.0.0-rc.20",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "exports": {
@@ -1,4 +1,9 @@
1
1
  import { default as React } from 'react';
2
+ /**
3
+ * @deprecated Use `Carousel` from `@tedi-design-system/react/tedi` instead — with
4
+ * `Carousel.Content loop={false}` and `Carousel.Navigation overlay` for the same
5
+ * bounded, edge-arrow pattern (plus keyboard and screen-reader support).
6
+ */
2
7
  export interface CarouselProps {
3
8
  /**
4
9
  * Number of items visible at once in the carousel viewport.
@@ -15,5 +20,10 @@ export interface CarouselProps {
15
20
  */
16
21
  className?: string;
17
22
  }
23
+ /**
24
+ * @deprecated Use `Carousel` from `@tedi-design-system/react/tedi` instead — with
25
+ * `Carousel.Content loop={false}` and `Carousel.Navigation overlay` for the same
26
+ * bounded, edge-arrow pattern (plus keyboard and screen-reader support).
27
+ */
18
28
  export declare const Carousel: (props: CarouselProps) => JSX.Element;
19
29
  export default Carousel;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),o=t.createContext(null),n=()=>{const e=t.useContext(o);if(!e)throw new Error("Carousel sub-components must be used within a <Carousel> component.");return e};exports.CarouselContext=o;exports.useCarouselContext=n;
@@ -0,0 +1,7 @@
1
+ import { CarouselApi } from './use-carousel';
2
+ export declare const CarouselContext: import('react').Context<CarouselApi | null>;
3
+ /**
4
+ * Reads the carousel engine provided by the `Carousel` root. Throws when a
5
+ * carousel sub-component is rendered outside of `Carousel`.
6
+ */
7
+ export declare const useCarouselContext: () => CarouselApi;
@@ -0,0 +1,11 @@
1
+ import { createContext as o, useContext as e } from "react";
2
+ const n = o(null), s = () => {
3
+ const t = e(n);
4
+ if (!t)
5
+ throw new Error("Carousel sub-components must be used within a <Carousel> component.");
6
+ return t;
7
+ };
8
+ export {
9
+ n as CarouselContext,
10
+ s as useCarouselContext
11
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../../helpers/hooks/use-breakpoint.cjs.js"),a=e=>typeof e=="object"&&e!==null&&t.breakpoints.some(o=>o in e)?e:{xs:e},i=(e,o)=>{const s=t.breakpoints.indexOf(o);for(let r=s;r>=0;r--){const n=e[t.breakpoints[r]];if(n!==void 0)return n}return e.xs};exports.normalizeBreakpointInput=a;exports.resolveBreakpointValue=i;
@@ -0,0 +1,26 @@
1
+ import { Breakpoint } from '../../../helpers/hooks/use-breakpoint';
2
+ export type BreakpointObject<T> = {
3
+ xs: T;
4
+ sm?: T;
5
+ md?: T;
6
+ lg?: T;
7
+ xl?: T;
8
+ xxl?: T;
9
+ };
10
+ /**
11
+ * A value that is either fixed or varies per breakpoint, e.g. `2` or
12
+ * `{ xs: 1, md: 2.5, xl: 4 }`.
13
+ */
14
+ export type BreakpointInput<T> = T | BreakpointObject<T>;
15
+ /**
16
+ * Normalizes a `BreakpointInput` into a `BreakpointObject`. A breakpoint-shaped
17
+ * object — one that has at least one breakpoint key (`xs`/`sm`/`md`/…) — is returned
18
+ * as-is; any other value (including a plain object that isn't breakpoint-shaped) is
19
+ * wrapped as the base `xs` value.
20
+ */
21
+ export declare const normalizeBreakpointInput: <T>(input: BreakpointInput<T>) => BreakpointObject<T>;
22
+ /**
23
+ * Resolves the value for the current breakpoint: the largest breakpoint that is
24
+ * defined and not above the current one, falling back to `xs`.
25
+ */
26
+ export declare const resolveBreakpointValue: <T>(input: BreakpointObject<T>, current: Breakpoint) => T;
@@ -0,0 +1,14 @@
1
+ import { breakpoints as n } from "../../../helpers/hooks/use-breakpoint.es.js";
2
+ const a = (e) => typeof e == "object" && e !== null && n.some((o) => o in e) ? e : { xs: e }, c = (e, o) => {
3
+ const s = n.indexOf(o);
4
+ for (let r = s; r >= 0; r--) {
5
+ const t = e[n[r]];
6
+ if (t !== void 0)
7
+ return t;
8
+ }
9
+ return e.xs;
10
+ };
11
+ export {
12
+ a as normalizeBreakpointInput,
13
+ c as resolveBreakpointValue
14
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),n=require("../../../../../external/classnames/index.cjs.js"),l=require("react"),c=require("./carousel.module.scss.cjs.js"),i=require("./carousel-context.cjs.js"),d=require("./components/carousel-content/carousel-content.cjs.js"),C=require("./components/carousel-footer/carousel-footer.cjs.js"),q=require("./components/carousel-header/carousel-header.cjs.js"),v=require("./components/carousel-indicators/carousel-indicators.cjs.js"),f=require("./components/carousel-navigation/carousel-navigation.cjs.js"),g=require("./use-carousel.cjs.js"),r=l.forwardRef(({children:s,className:t},a)=>{const u=g.useCarousel();return e.jsx(i.CarouselContext.Provider,{value:u,children:e.jsx("div",{ref:a,className:n.default(c.default["tedi-carousel"],t),children:s})})});r.displayName="Carousel";const o=Object.assign(r,{Header:q.CarouselHeader,Content:d.CarouselContent,Footer:C.CarouselFooter,Navigation:f.CarouselNavigation,Indicators:v.CarouselIndicators});exports.Carousel=o;exports.default=o;
@@ -0,0 +1,20 @@
1
+ import { default as React } from 'react';
2
+ export interface CarouselProps {
3
+ /**
4
+ * Carousel composition — `Carousel.Header`, `Carousel.Content` and
5
+ * `Carousel.Footer`.
6
+ */
7
+ children?: React.ReactNode;
8
+ /**
9
+ * Additional class name applied to the carousel root.
10
+ */
11
+ className?: string;
12
+ }
13
+ export declare const Carousel: React.ForwardRefExoticComponent<CarouselProps & React.RefAttributes<HTMLDivElement>> & {
14
+ Header: React.ForwardRefExoticComponent<import('./components/carousel-header/carousel-header').CarouselHeaderProps & React.RefAttributes<HTMLDivElement>>;
15
+ Content: React.ForwardRefExoticComponent<import('./components/carousel-content/carousel-content').CarouselContentProps & React.RefAttributes<HTMLDivElement>>;
16
+ Footer: React.ForwardRefExoticComponent<import('./components/carousel-footer/carousel-footer').CarouselFooterProps & React.RefAttributes<HTMLDivElement>>;
17
+ Navigation: React.ForwardRefExoticComponent<import('./components/carousel-navigation/carousel-navigation').CarouselNavigationProps & React.RefAttributes<HTMLDivElement>>;
18
+ Indicators: React.ForwardRefExoticComponent<import('./components/carousel-indicators/carousel-indicators').CarouselIndicatorsProps & React.RefAttributes<HTMLDivElement>>;
19
+ };
20
+ export default Carousel;
@@ -0,0 +1,27 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import m from "../../../../../external/classnames/index.es.js";
3
+ import { forwardRef as i } from "react";
4
+ import l from "./carousel.module.scss.es.js";
5
+ import { CarouselContext as n } from "./carousel-context.es.js";
6
+ import { CarouselContent as u } from "./components/carousel-content/carousel-content.es.js";
7
+ import { CarouselFooter as f } from "./components/carousel-footer/carousel-footer.es.js";
8
+ import { CarouselHeader as p } from "./components/carousel-header/carousel-header.es.js";
9
+ import { CarouselIndicators as C } from "./components/carousel-indicators/carousel-indicators.es.js";
10
+ import { CarouselNavigation as c } from "./components/carousel-navigation/carousel-navigation.es.js";
11
+ import { useCarousel as d } from "./use-carousel.es.js";
12
+ const r = i(({ children: e, className: t }, a) => {
13
+ const s = d();
14
+ return /* @__PURE__ */ o(n.Provider, { value: s, children: /* @__PURE__ */ o("div", { ref: a, className: m(l["tedi-carousel"], t), children: e }) });
15
+ });
16
+ r.displayName = "Carousel";
17
+ const w = Object.assign(r, {
18
+ Header: p,
19
+ Content: u,
20
+ Footer: f,
21
+ Navigation: c,
22
+ Indicators: C
23
+ });
24
+ export {
25
+ w as Carousel,
26
+ w as default
27
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-carousel":"tedi-carousel-65c4a6a5","tedi-carousel__header":"tedi-carousel__header-ac518c48","tedi-carousel__footer":"tedi-carousel__footer-08a7d5fd","tedi-carousel__content":"tedi-carousel__content-88941157","tedi-carousel__content--fade-right":"tedi-carousel__content--fade-right-1450c350","tedi-carousel__content--fade-x":"tedi-carousel__content--fade-x-1e4b9158","tedi-carousel__track":"tedi-carousel__track-a2771afb","tedi-carousel__slide":"tedi-carousel__slide-a9448746","tedi-carousel__navigation":"tedi-carousel__navigation-d4b9aaf8","tedi-carousel__navigation--overlay":"tedi-carousel__navigation--overlay-fba1fe0a","tedi-carousel__indicators":"tedi-carousel__indicators-cd38b633","tedi-carousel__indicator":"tedi-carousel__indicator-eb4e5fbe","tedi-carousel__indicator--active":"tedi-carousel__indicator--active-939377fb"};exports.default=e;
@@ -0,0 +1,18 @@
1
+ const e = {
2
+ "tedi-carousel": "tedi-carousel-65c4a6a5",
3
+ "tedi-carousel__header": "tedi-carousel__header-ac518c48",
4
+ "tedi-carousel__footer": "tedi-carousel__footer-08a7d5fd",
5
+ "tedi-carousel__content": "tedi-carousel__content-88941157",
6
+ "tedi-carousel__content--fade-right": "tedi-carousel__content--fade-right-1450c350",
7
+ "tedi-carousel__content--fade-x": "tedi-carousel__content--fade-x-1e4b9158",
8
+ "tedi-carousel__track": "tedi-carousel__track-a2771afb",
9
+ "tedi-carousel__slide": "tedi-carousel__slide-a9448746",
10
+ "tedi-carousel__navigation": "tedi-carousel__navigation-d4b9aaf8",
11
+ "tedi-carousel__navigation--overlay": "tedi-carousel__navigation--overlay-fba1fe0a",
12
+ "tedi-carousel__indicators": "tedi-carousel__indicators-cd38b633",
13
+ "tedi-carousel__indicator": "tedi-carousel__indicator-eb4e5fbe",
14
+ "tedi-carousel__indicator--active": "tedi-carousel__indicator--active-939377fb"
15
+ };
16
+ export {
17
+ e as default
18
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),S=require("../../../../../../../external/classnames/index.cjs.js"),r=require("react"),i=require("../../carousel.module.scss.cjs.js"),x=require("../../carousel-context.cjs.js"),h=require("../../carousel-utils.cjs.js"),c=r.forwardRef(({children:m,slidesPerView:u=1,gap:d=1,fade:f=!1,transitionMs:p=400,loop:v=!0,centered:C=!1,className:b},l)=>{const e=x.useCarouselContext(),a=r.Children.toArray(m),_=r.useRef([]),y=JSON.stringify({slidesPerView:u,gap:d,fade:f,transitionMs:p,loop:v,centered:C});r.useEffect(()=>{e.setConfig({slidesPerView:h.normalizeBreakpointInput(u),gap:h.normalizeBreakpointInput(d),fade:f,transitionMs:p,loop:v,centered:C})},[y]),r.useEffect(()=>{e.setSlidesCount(a.length)},[a.length,e]),r.useEffect(()=>{e.renderedIndices.forEach((o,t)=>{var n;(n=_.current[t])==null||n.toggleAttribute("inert",!e.isSlideVisible(t))})});const P=o=>{e.viewportRef.current=o,typeof l=="function"?l(o):l&&(l.current=o)};return s.jsxs("div",{ref:P,role:"region","aria-roledescription":"carousel","aria-label":e.regionLabel,"aria-live":"off",tabIndex:0,className:S.default(e.contentClassName(i.default["tedi-carousel__content"],i.default["tedi-carousel__content--fade-right"],i.default["tedi-carousel__content--fade-x"]),b),onScroll:e.onScroll,onWheel:e.onWheel,onKeyDown:e.onKeyDown,onPointerDown:e.onPointerDown,onPointerMove:e.onPointerMove,onPointerUp:e.onPointerUp,onPointerCancel:e.onPointerUp,onLostPointerCapture:e.onPointerUp,children:[s.jsx("div",{ref:e.trackRef,className:i.default["tedi-carousel__track"],style:e.trackStyle,onTransitionEnd:e.onTransitionEnd,children:e.renderedIndices.map((o,t)=>{const n=e.isSlideVisible(t);return s.jsx("div",{ref:g=>{_.current[t]=g,e.setSlideRef(t,g)},role:n?"group":"presentation","aria-roledescription":"slide","aria-label":e.slideLabel(o+1),"aria-current":t===e.renderedActiveIndex?"true":void 0,"aria-hidden":n?void 0:"true",tabIndex:n?-1:void 0,className:i.default["tedi-carousel__slide"],style:{flex:e.slideFlex},children:a[o]},t)})}),s.jsx("div",{"aria-live":"polite",className:"visually-hidden",children:e.announcement})]})});c.displayName="CarouselContent";exports.CarouselContent=c;exports.default=c;
@@ -0,0 +1,53 @@
1
+ import { default as React } from 'react';
2
+ import { BreakpointInput } from '../../carousel-utils';
3
+ import { CarouselFade } from '../../use-carousel';
4
+ export interface CarouselContentProps {
5
+ /**
6
+ * Slides — each direct child is rendered as one slide.
7
+ */
8
+ children?: React.ReactNode;
9
+ /**
10
+ * Slides per view (minimum 1, can be fractional, e.g. `1.25` for peeking).
11
+ * Accepts a number or per-breakpoint object.
12
+ * @default 1
13
+ */
14
+ slidesPerView?: BreakpointInput<number>;
15
+ /**
16
+ * Gap between slides in rem. Accepts a number or per-breakpoint object.
17
+ * @default 1
18
+ */
19
+ gap?: BreakpointInput<number>;
20
+ /**
21
+ * Fade the edges:
22
+ * - `true` — fades the right edge with more than one slide per view, or both edges for a single slide.
23
+ * - `'right'` — always fade only the right edge.
24
+ * - `'both'` — always fade both edges, regardless of slide count.
25
+ * @default false
26
+ */
27
+ fade?: CarouselFade;
28
+ /**
29
+ * Transition duration in ms.
30
+ * @default 400
31
+ */
32
+ transitionMs?: number;
33
+ /**
34
+ * Whether the track loops infinitely. Set `false` for a finite, bounded
35
+ * carousel — navigation stops at the first / last slide and the prev / next
36
+ * controls disable at the bounds.
37
+ * @default true
38
+ */
39
+ loop?: boolean;
40
+ /**
41
+ * Center the active slide so an equal peek of the previous / next slide shows
42
+ * on both edges. Pair with a fractional `slidesPerView` (e.g. `1.4`) and keep
43
+ * `loop` on so there are neighbours to reveal on both sides.
44
+ * @default false
45
+ */
46
+ centered?: boolean;
47
+ /**
48
+ * Additional class name applied to the viewport.
49
+ */
50
+ className?: string;
51
+ }
52
+ export declare const CarouselContent: React.ForwardRefExoticComponent<CarouselContentProps & React.RefAttributes<HTMLDivElement>>;
53
+ export default CarouselContent;
@@ -0,0 +1,103 @@
1
+ import { jsxs as b, jsx as l } from "react/jsx-runtime";
2
+ import P from "../../../../../../../external/classnames/index.es.js";
3
+ import N, { forwardRef as w, useRef as R, useEffect as a } from "react";
4
+ import r from "../../carousel.module.scss.es.js";
5
+ import { useCarouselContext as S } from "../../carousel-context.es.js";
6
+ import { normalizeBreakpointInput as _ } from "../../carousel-utils.es.js";
7
+ const k = w(
8
+ ({
9
+ children: y,
10
+ slidesPerView: c = 1,
11
+ gap: d = 1,
12
+ fade: u = !1,
13
+ transitionMs: f = 400,
14
+ loop: p = !0,
15
+ centered: m = !1,
16
+ className: C
17
+ }, n) => {
18
+ const e = S(), s = N.Children.toArray(y), v = R([]), g = JSON.stringify({ slidesPerView: c, gap: d, fade: u, transitionMs: f, loop: p, centered: m });
19
+ return a(() => {
20
+ e.setConfig({
21
+ slidesPerView: _(c),
22
+ gap: _(d),
23
+ fade: u,
24
+ transitionMs: f,
25
+ loop: p,
26
+ centered: m
27
+ });
28
+ }, [g]), a(() => {
29
+ e.setSlidesCount(s.length);
30
+ }, [s.length, e]), a(() => {
31
+ e.renderedIndices.forEach((t, o) => {
32
+ var i;
33
+ (i = v.current[o]) == null || i.toggleAttribute("inert", !e.isSlideVisible(o));
34
+ });
35
+ }), /* @__PURE__ */ b(
36
+ "div",
37
+ {
38
+ ref: (t) => {
39
+ e.viewportRef.current = t, typeof n == "function" ? n(t) : n && (n.current = t);
40
+ },
41
+ role: "region",
42
+ "aria-roledescription": "carousel",
43
+ "aria-label": e.regionLabel,
44
+ "aria-live": "off",
45
+ tabIndex: 0,
46
+ className: P(
47
+ e.contentClassName(
48
+ r["tedi-carousel__content"],
49
+ r["tedi-carousel__content--fade-right"],
50
+ r["tedi-carousel__content--fade-x"]
51
+ ),
52
+ C
53
+ ),
54
+ onScroll: e.onScroll,
55
+ onWheel: e.onWheel,
56
+ onKeyDown: e.onKeyDown,
57
+ onPointerDown: e.onPointerDown,
58
+ onPointerMove: e.onPointerMove,
59
+ onPointerUp: e.onPointerUp,
60
+ onPointerCancel: e.onPointerUp,
61
+ onLostPointerCapture: e.onPointerUp,
62
+ children: [
63
+ /* @__PURE__ */ l(
64
+ "div",
65
+ {
66
+ ref: e.trackRef,
67
+ className: r["tedi-carousel__track"],
68
+ style: e.trackStyle,
69
+ onTransitionEnd: e.onTransitionEnd,
70
+ children: e.renderedIndices.map((t, o) => {
71
+ const i = e.isSlideVisible(o);
72
+ return /* @__PURE__ */ l(
73
+ "div",
74
+ {
75
+ ref: (h) => {
76
+ v.current[o] = h, e.setSlideRef(o, h);
77
+ },
78
+ role: i ? "group" : "presentation",
79
+ "aria-roledescription": "slide",
80
+ "aria-label": e.slideLabel(t + 1),
81
+ "aria-current": o === e.renderedActiveIndex ? "true" : void 0,
82
+ "aria-hidden": i ? void 0 : "true",
83
+ tabIndex: i ? -1 : void 0,
84
+ className: r["tedi-carousel__slide"],
85
+ style: { flex: e.slideFlex },
86
+ children: s[t]
87
+ },
88
+ o
89
+ );
90
+ })
91
+ }
92
+ ),
93
+ /* @__PURE__ */ l("div", { "aria-live": "polite", className: "visually-hidden", children: e.announcement })
94
+ ]
95
+ }
96
+ );
97
+ }
98
+ );
99
+ k.displayName = "CarouselContent";
100
+ export {
101
+ k as CarouselContent,
102
+ k as default
103
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),a=require("../../../../../../../external/classnames/index.cjs.js"),l=require("react"),i=require("../../carousel.module.scss.cjs.js"),e=l.forwardRef(({children:o,className:r,style:t},u)=>s.jsx("div",{ref:u,className:a.default(i.default["tedi-carousel__footer"],r),style:t,children:o}));e.displayName="CarouselFooter";exports.CarouselFooter=e;exports.default=e;
@@ -0,0 +1,17 @@
1
+ import { default as React } from 'react';
2
+ export interface CarouselFooterProps {
3
+ /**
4
+ * Footer content — typically `Carousel.Indicators` and/or `Carousel.Navigation`.
5
+ */
6
+ children?: React.ReactNode;
7
+ /**
8
+ * Additional class name.
9
+ */
10
+ className?: string;
11
+ /**
12
+ * Inline styles — e.g. to center the footer content.
13
+ */
14
+ style?: React.CSSProperties;
15
+ }
16
+ export declare const CarouselFooter: React.ForwardRefExoticComponent<CarouselFooterProps & React.RefAttributes<HTMLDivElement>>;
17
+ export default CarouselFooter;
@@ -0,0 +1,10 @@
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import t from "../../../../../../../external/classnames/index.es.js";
3
+ import { forwardRef as m } from "react";
4
+ import f from "../../carousel.module.scss.es.js";
5
+ const l = m(({ children: o, className: r, style: e }, s) => /* @__PURE__ */ a("div", { ref: s, className: t(f["tedi-carousel__footer"], r), style: e, children: o }));
6
+ l.displayName = "CarouselFooter";
7
+ export {
8
+ l as CarouselFooter,
9
+ l as default
10
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),o=require("../../../../../../../external/classnames/index.cjs.js"),d=require("react"),l=require("../../carousel.module.scss.cjs.js"),e=d.forwardRef(({children:r,className:a,style:u},s)=>t.jsx("div",{ref:s,className:o.default(l.default["tedi-carousel__header"],a),style:u,children:r}));e.displayName="CarouselHeader";exports.CarouselHeader=e;exports.default=e;
@@ -0,0 +1,17 @@
1
+ import { default as React } from 'react';
2
+ export interface CarouselHeaderProps {
3
+ /**
4
+ * Header content — typically a title block and optionally `Carousel.Navigation`.
5
+ */
6
+ children?: React.ReactNode;
7
+ /**
8
+ * Additional class name.
9
+ */
10
+ className?: string;
11
+ /**
12
+ * Inline styles.
13
+ */
14
+ style?: React.CSSProperties;
15
+ }
16
+ export declare const CarouselHeader: React.ForwardRefExoticComponent<CarouselHeaderProps & React.RefAttributes<HTMLDivElement>>;
17
+ export default CarouselHeader;
@@ -0,0 +1,10 @@
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import m from "../../../../../../../external/classnames/index.es.js";
3
+ import { forwardRef as t } from "react";
4
+ import d from "../../carousel.module.scss.es.js";
5
+ const l = t(({ children: e, className: r, style: a }, o) => /* @__PURE__ */ s("div", { ref: o, className: m(d["tedi-carousel__header"], r), style: a, children: e }));
6
+ l.displayName = "CarouselHeader";
7
+ export {
8
+ l as CarouselHeader,
9
+ l as default
10
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),n=require("../../../../../../../external/classnames/index.cjs.js"),m=require("react"),i=require("../../../../base/typography/text/text.cjs.js"),d=require("../../../../buttons/button/button.cjs.js"),l=require("../../carousel.module.scss.cjs.js"),v=require("../../carousel-context.cjs.js"),_=require("../../../../../providers/label-provider/use-labels.cjs.js"),u=m.forwardRef(({withArrows:c=!1,variant:b="dots",className:f},x)=>{const{getLabel:o}=_.useLabels(),r=v.useCarouselContext(),{slidesCount:s,slideIndex:a}=r;return e.jsxs("div",{ref:x,className:n.default(l.default["tedi-carousel__indicators"],f),children:[c&&e.jsx(d.Button,{visualType:"neutral",icon:"arrow_back",disabled:!r.canPrev,onClick:r.prev,children:o("carousel.move-back")}),b==="dots"?Array.from({length:s},(C,t)=>e.jsx("button",{type:"button","aria-label":o("carousel.show-slide",t+1),"aria-current":t===a?"true":void 0,className:n.default(l.default["tedi-carousel__indicator"],{[l.default["tedi-carousel__indicator--active"]]:t===a}),onClick:()=>r.goToIndex(t,{focusSlide:!0})},t)):s>0&&e.jsxs("div",{children:[e.jsx(i.Text,{element:"span",modifiers:"bold",color:"brand",children:a+1}),e.jsx(i.Text,{element:"span",color:"tertiary",children:` / ${s}`})]}),c&&e.jsx(d.Button,{visualType:"neutral",icon:"arrow_forward",disabled:!r.canNext,onClick:r.next,children:o("carousel.move-forward")})]})});u.displayName="CarouselIndicators";exports.CarouselIndicators=u;exports.default=u;
@@ -0,0 +1,20 @@
1
+ export type CarouselIndicatorsVariant = 'dots' | 'numbers';
2
+ export interface CarouselIndicatorsProps {
3
+ /**
4
+ * Show prev / next arrow buttons alongside the indicators. When set, do not
5
+ * also use `Carousel.Navigation`.
6
+ * @default false
7
+ */
8
+ withArrows?: boolean;
9
+ /**
10
+ * Indicator style — a row of dots or a `current / total` counter.
11
+ * @default dots
12
+ */
13
+ variant?: CarouselIndicatorsVariant;
14
+ /**
15
+ * Additional class name.
16
+ */
17
+ className?: string;
18
+ }
19
+ export declare const CarouselIndicators: import('react').ForwardRefExoticComponent<CarouselIndicatorsProps & import('react').RefAttributes<HTMLDivElement>>;
20
+ export default CarouselIndicators;
@@ -0,0 +1,38 @@
1
+ import { jsxs as c, jsx as e } from "react/jsx-runtime";
2
+ import n from "../../../../../../../external/classnames/index.es.js";
3
+ import { forwardRef as b } from "react";
4
+ import { Text as d } from "../../../../base/typography/text/text.es.js";
5
+ import { Button as m } from "../../../../buttons/button/button.es.js";
6
+ import l from "../../carousel.module.scss.es.js";
7
+ import { useCarouselContext as v } from "../../carousel-context.es.js";
8
+ import { useLabels as _ } from "../../../../../providers/label-provider/use-labels.es.js";
9
+ const C = b(
10
+ ({ withArrows: i = !1, variant: u = "dots", className: f }, p) => {
11
+ const { getLabel: a } = _(), r = v(), { slidesCount: t, slideIndex: s } = r;
12
+ return /* @__PURE__ */ c("div", { ref: p, className: n(l["tedi-carousel__indicators"], f), children: [
13
+ i && /* @__PURE__ */ e(m, { visualType: "neutral", icon: "arrow_back", disabled: !r.canPrev, onClick: r.prev, children: a("carousel.move-back") }),
14
+ u === "dots" ? Array.from({ length: t }, (h, o) => /* @__PURE__ */ e(
15
+ "button",
16
+ {
17
+ type: "button",
18
+ "aria-label": a("carousel.show-slide", o + 1),
19
+ "aria-current": o === s ? "true" : void 0,
20
+ className: n(l["tedi-carousel__indicator"], {
21
+ [l["tedi-carousel__indicator--active"]]: o === s
22
+ }),
23
+ onClick: () => r.goToIndex(o, { focusSlide: !0 })
24
+ },
25
+ o
26
+ )) : t > 0 && /* @__PURE__ */ c("div", { children: [
27
+ /* @__PURE__ */ e(d, { element: "span", modifiers: "bold", color: "brand", children: s + 1 }),
28
+ /* @__PURE__ */ e(d, { element: "span", color: "tertiary", children: ` / ${t}` })
29
+ ] }),
30
+ i && /* @__PURE__ */ e(m, { visualType: "neutral", icon: "arrow_forward", disabled: !r.canNext, onClick: r.next, children: a("carousel.move-forward") })
31
+ ] });
32
+ }
33
+ );
34
+ C.displayName = "CarouselIndicators";
35
+ export {
36
+ C as CarouselIndicators,
37
+ C as default
38
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),l=require("../../../../../../../external/classnames/index.cjs.js"),c=require("react"),d=require("../../../../buttons/button/button.cjs.js"),s=require("../../carousel.module.scss.cjs.js"),v=require("../../carousel-context.cjs.js"),b=require("../../../../../providers/label-provider/use-labels.cjs.js"),f=({buttonProps:o})=>n.jsx(d.Button,{visualType:"secondary",...o}),r=c.forwardRef(({overlay:o=!1,className:i,renderButton:a=f},u)=>{const{getLabel:t}=b.useLabels(),e=v.useCarouselContext();return n.jsxs("div",{ref:u,className:l.default(s.default["tedi-carousel__navigation"],{[s.default["tedi-carousel__navigation--overlay"]]:o},i),children:[a({direction:"prev",buttonProps:{icon:"arrow_back",disabled:!e.canPrev,onClick:e.prev,children:t("carousel.move-back")}}),a({direction:"next",buttonProps:{icon:"arrow_forward",disabled:!e.canNext,onClick:e.next,children:t("carousel.move-forward")}})]})});r.displayName="CarouselNavigation";exports.CarouselNavigation=r;exports.default=r;
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Props for a single navigation arrow, ready to spread onto a `Button` /
3
+ * `FloatingButton` (or any compatible control). `children` is the accessible label.
4
+ */
5
+ export interface CarouselNavigationButtonProps {
6
+ icon: string;
7
+ disabled: boolean;
8
+ onClick: () => void;
9
+ children: string;
10
+ }
11
+ export interface CarouselNavigationProps {
12
+ /**
13
+ * Pin the arrows to the left / right edges, overlaying the slides (instead of
14
+ * a normal inline row). Use as a direct child of `Carousel` for a
15
+ * header/footer-less carousel; the arrows centre vertically over the content.
16
+ * @default false
17
+ */
18
+ overlay?: boolean;
19
+ /**
20
+ * Additional class name.
21
+ */
22
+ className?: string;
23
+ /**
24
+ * Render each navigation arrow yourself — e.g. to use a `FloatingButton` or a
25
+ * customised `Button`. Receives the arrow `direction` and a `buttonProps` bag
26
+ * (icon / disabled / onClick / accessible-label `children`) to spread onto the
27
+ * control; the surrounding container still handles layout, incl. overlay edge
28
+ * placement, so the returned element only needs to render the button. Defaults
29
+ * to a secondary `Button`.
30
+ *
31
+ * @example
32
+ * <Carousel.Navigation
33
+ * overlay
34
+ * renderButton={({ buttonProps }) => <FloatingButton {...buttonProps} position="static" />}
35
+ * />
36
+ */
37
+ renderButton?: (props: {
38
+ direction: 'prev' | 'next';
39
+ buttonProps: CarouselNavigationButtonProps;
40
+ }) => React.ReactNode;
41
+ }
42
+ export declare const CarouselNavigation: import('react').ForwardRefExoticComponent<CarouselNavigationProps & import('react').RefAttributes<HTMLDivElement>>;
43
+ export default CarouselNavigation;
@@ -0,0 +1,48 @@
1
+ import { jsxs as n, jsx as l } from "react/jsx-runtime";
2
+ import c from "../../../../../../../external/classnames/index.es.js";
3
+ import { forwardRef as d } from "react";
4
+ import { Button as m } from "../../../../buttons/button/button.es.js";
5
+ import t from "../../carousel.module.scss.es.js";
6
+ import { useCarouselContext as u } from "../../carousel-context.es.js";
7
+ import { useLabels as f } from "../../../../../providers/label-provider/use-labels.es.js";
8
+ const p = ({ buttonProps: r }) => /* @__PURE__ */ l(m, { visualType: "secondary", ...r }), v = d(
9
+ ({ overlay: r = !1, className: s, renderButton: e = p }, i) => {
10
+ const { getLabel: a } = f(), o = u();
11
+ return /* @__PURE__ */ n(
12
+ "div",
13
+ {
14
+ ref: i,
15
+ className: c(
16
+ t["tedi-carousel__navigation"],
17
+ { [t["tedi-carousel__navigation--overlay"]]: r },
18
+ s
19
+ ),
20
+ children: [
21
+ e({
22
+ direction: "prev",
23
+ buttonProps: {
24
+ icon: "arrow_back",
25
+ disabled: !o.canPrev,
26
+ onClick: o.prev,
27
+ children: a("carousel.move-back")
28
+ }
29
+ }),
30
+ e({
31
+ direction: "next",
32
+ buttonProps: {
33
+ icon: "arrow_forward",
34
+ disabled: !o.canNext,
35
+ onClick: o.next,
36
+ children: a("carousel.move-forward")
37
+ }
38
+ })
39
+ ]
40
+ }
41
+ );
42
+ }
43
+ );
44
+ v.displayName = "CarouselNavigation";
45
+ export {
46
+ v as CarouselNavigation,
47
+ v as default
48
+ };
@@ -0,0 +1,7 @@
1
+ export * from './carousel';
2
+ export * from './components/carousel-content/carousel-content';
3
+ export * from './components/carousel-footer/carousel-footer';
4
+ export * from './components/carousel-header/carousel-header';
5
+ export * from './components/carousel-indicators/carousel-indicators';
6
+ export * from './components/carousel-navigation/carousel-navigation';
7
+ export * from './carousel-utils';
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),Le=require("../../../helpers/hooks/use-breakpoint.cjs.js"),re=require("./carousel-utils.cjs.js"),ye=require("../../../providers/label-provider/use-labels.cjs.js"),De={slidesPerView:{xs:1},gap:{xs:1},fade:!1,transitionMs:400,loop:!0,centered:!1},V=(S,p)=>(S%p+p)%p,Ve=()=>{const{getLabel:S}=ye.useLabels(),p=Le.useBreakpoint(),[u,ne]=t.useState(De),[r,se]=t.useState(0),[l,b]=t.useState(0),[m,U]=t.useState(0),[Y,R]=t.useState(!1),[g,ce]=t.useState(0),[j,oe]=t.useState(16),[ae,ue]=t.useState(""),E=t.useRef(null),H=t.useRef(null),J=t.useRef([]),P=t.useRef(!1),L=t.useRef(!1),z=t.useRef(!1),$=t.useRef(0),y=t.useRef(0),Q=t.useRef(0),O=t.useRef(0),_=t.useRef(0),q=t.useRef(),A=t.useRef(0),Z=t.useRef(!0),i=t.useRef(l),ee=t.useRef(m);t.useEffect(()=>{i.current=l},[l]),t.useEffect(()=>{ee.current=m},[m]);const o=t.useMemo(()=>re.resolveBreakpointValue(u.slidesPerView,p),[u.slidesPerView,p]),C=t.useMemo(()=>re.resolveBreakpointValue(u.gap,p),[u.gap,p]),w=t.useMemo(()=>C*j,[C,j]),s=u.loop,M=t.useMemo(()=>Math.max(0,r-Math.ceil(o)),[r,o]),k=t.useCallback(e=>s?e:Math.min(Math.max(e,0),M),[s,M]),d=s?r:0,le=t.useMemo(()=>r===0?0:s?V(Math.floor(l),r):Math.min(Math.max(Math.round(l),0),r-1),[l,r,s]),F=s?l-m+d:l,ie=s||l>.001,fe=s||l<M-.001,de=t.useMemo(()=>{if(!r)return[];if(!s)return Array.from({length:r},(c,a)=>a);const e=2*d+Math.ceil(o),n=m-d;return Array.from({length:e},(c,a)=>V(n+a,r))},[r,d,o,m,s]),me=t.useMemo(()=>`0 0 calc((100% - ${(o-1)*C}rem) / ${o})`,[o,C]),he=t.useMemo(()=>{if(!g)return{gap:`${C}rem`,transform:"translate3d(0,0,0)",transition:"none"};const e=w*(o-1),n=(g-e)/o,c=s?l-m+d:l,a=u.centered?(g-n)/2:0,f=-c*(n+w)+a;return{gap:`${C}rem`,transform:`translate3d(${f}px, 0, 0)`,transition:Y?`transform ${u.transitionMs}ms ease`:"none"}},[g,C,w,o,l,m,d,Y,u.transitionMs,u.centered,s]),Me=t.useCallback(e=>{const n=Math.ceil(o);return e>=F&&e<F+n},[o,F]),pe=t.useCallback((e,n,c)=>{const a=[e];if(u.fade){const f=u.fade==="both"||u.fade!=="right"&&o<=1;a.push(f?c:n)}return a.join(" ")},[u.fade,o]),be=t.useCallback((e,n)=>{J.current[e]=n},[]),I=t.useCallback(()=>{setTimeout(()=>{if(!Z.current||!r)return;const e=s?V(Math.floor(i.current),r):Math.min(Math.max(Math.round(i.current),0),r-1);ue(S("carousel.slide",e+1,r))},100)},[S,r,s]),X=t.useCallback(()=>{P.current=!0,setTimeout(()=>{P.current=!1},u.transitionMs)},[u.transitionMs]),te=t.useCallback(()=>{setTimeout(()=>{var n;const e=i.current-ee.current+d;(n=J.current[e])==null||n.focus({preventScroll:!0})})},[d]),G=t.useCallback(()=>{!r||P.current||!s&&i.current>=M-.001||(R(!0),b(e=>k(e+1)),X(),I())},[r,s,M,k,X,I]),K=t.useCallback(()=>{!r||P.current||!s&&i.current<=.001||(R(!0),b(e=>k(e-1)),X(),I())},[r,s,k,X,I]),N=t.useCallback((e,n)=>{if(!(!r||P.current)){if(R(!0),s){const c=V(Math.floor(i.current),r),f=V(e,r)-c;b(h=>h+f)}else b(k(e));n!=null&&n.focusSlide?z.current=!0:I()}},[r,s,k,I]),Re=t.useCallback(e=>{e.target!==H.current||e.propertyName!=="transform"||L.current||(R(!1),U(Math.floor(i.current)),z.current&&(z.current=!1,te()))},[te]),ke=t.useCallback(()=>{const e=E.current;e&&(e.scrollLeft=0,e.scrollTop=0)},[]),T=t.useCallback(()=>(g-w*(o-1))/o+w,[g,w,o]),Ce=t.useCallback(e=>{if(!r)return;const n=Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.shiftKey?e.deltaY:0;if(!n)return;const c=T();if(!c)return;const a=n/c;A.current+=a;const f=d*.9,h=s?m-f:0,x=s?m+f:M,W=i.current+a,v=Math.min(Math.max(W,h),x),Ie=v!==W;R(!1),b(v),clearTimeout(q.current),q.current=setTimeout(()=>{R(!0);const Te=Math.sign(A.current),D=i.current;let B=Math.round(D);Math.abs(A.current)>.3&&(B=Te>0?Math.ceil(D):Math.floor(D)),Ie&&(D<=h&&(B=Math.ceil(h)),D>=x&&(B=Math.floor(x)));const Pe=Math.min(Math.max(B,h),x);b(Pe),A.current=0},120)},[r,T,d,m,s,M]),xe=t.useCallback(e=>{switch(e.key){case"ArrowRight":case"PageDown":e.preventDefault(),G();break;case"ArrowLeft":case"PageUp":e.preventDefault(),K();break;case"Home":e.preventDefault(),N(0);break;case"End":e.preventDefault(),N(r-1);break}},[G,K,N,r]),Se=t.useCallback(e=>{var n;r&&((n=E.current)==null||n.setPointerCapture(e.pointerId),L.current=!0,R(!1),$.current=e.clientX,y.current=i.current,Q.current=e.timeStamp,O.current=e.clientX,_.current=e.timeStamp,s&&U(Math.floor(i.current)))},[r,s]),ge=t.useCallback(e=>{if(!L.current)return;const n=T();if(!n)return;const c=e.clientX-$.current;if(Number.isNaN(c))return;O.current=e.clientX,_.current=e.timeStamp;const a=c/n,f=y.current-a,h=d*.9,x=Math.floor(y.current),W=s?x-h:0,v=s?x+h:M;b(Math.min(Math.max(f,W),v))},[T,d,s,M]),we=t.useCallback(()=>{if(!L.current)return;L.current=!1,R(!0);const e=T(),n=Math.round(i.current);let c=n;const a=_.current-Q.current,f=a>0&&e?-(O.current-$.current)/e/a:0;Math.abs(f)>.0015&&n===Math.round(y.current)&&(c=Math.round(y.current)+(f>0?1:-1)),b(k(c))},[T,k]);return t.useEffect(()=>{const e=E.current;if(!e)return;const n=()=>{ce(e.clientWidth),oe(parseFloat(getComputedStyle(document.documentElement).fontSize)||16)};n();const c=new ResizeObserver(n);return c.observe(e),()=>c.disconnect()},[]),t.useEffect(()=>()=>{Z.current=!1,clearTimeout(q.current)},[]),{viewportRef:E,trackRef:H,setSlideRef:be,setConfig:ne,setSlidesCount:se,slidesCount:r,slideIndex:le,canPrev:ie,canNext:fe,renderedIndices:de,renderedActiveIndex:F,slideFlex:me,trackStyle:he,contentClassName:pe,isSlideVisible:Me,announcement:ae,regionLabel:S("carousel"),slideLabel:e=>S("carousel.slide",e,r),next:G,prev:K,goToIndex:N,onTransitionEnd:Re,onScroll:ke,onWheel:Ce,onKeyDown:xe,onPointerDown:Se,onPointerMove:ge,onPointerUp:we}};exports.useCarousel=Ve;