@tedi-design-system/react 19.1.0-rc.2 → 19.1.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 (184) hide show
  1. package/DESIGN.md +308 -0
  2. package/README.md +28 -0
  3. package/_virtual/index.es13.js +2 -2
  4. package/_virtual/index.es14.js +2 -2
  5. package/bundle-stats.html +1 -1
  6. package/community.cjs.js +1 -1
  7. package/community.es.js +215 -223
  8. package/component.manifest.json +1234 -0
  9. package/external/@floating-ui/core/dist/floating-ui.core.es.js +1 -1
  10. package/external/@floating-ui/dom/dist/floating-ui.dom.es.js +2 -2
  11. package/external/@floating-ui/react-dom/dist/floating-ui.react-dom.es.js +5 -5
  12. package/external/@mui/x-date-pickers/DatePicker/shared.es.js +1 -1
  13. package/external/@mui/x-date-pickers/DateTimePicker/shared.es.js +1 -1
  14. package/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.cjs.js +1 -1
  15. package/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.es.js +1 -1
  16. package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
  17. package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.es.js +1 -1
  18. package/external/hoist-non-react-statics/external/react-is/index.cjs.js +1 -1
  19. package/external/hoist-non-react-statics/external/react-is/index.es.js +1 -1
  20. package/external/prop-types/external/react-is/cjs/react-is.development.cjs.js +1 -1
  21. package/external/prop-types/external/react-is/cjs/react-is.development.es.js +1 -1
  22. package/external/prop-types/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
  23. package/external/prop-types/external/react-is/cjs/react-is.production.min.es.js +1 -1
  24. package/external/prop-types/external/react-is/index.cjs.js +1 -1
  25. package/external/prop-types/external/react-is/index.es.js +1 -1
  26. package/external/react-is/index.cjs.js +1 -1
  27. package/external/react-is/index.es.js +1 -1
  28. package/external/toposort/index.cjs.js +1 -1
  29. package/external/toposort/index.es.js +1 -1
  30. package/index.css +1 -1
  31. package/package.json +3 -3
  32. package/src/community/components/accordion/accordion.cjs.js +1 -1
  33. package/src/community/components/accordion/accordion.es.js +14 -9
  34. package/src/community/components/card/card-notification/card-notification.cjs.js +1 -1
  35. package/src/community/components/card/card-notification/card-notification.es.js +10 -8
  36. package/src/community/components/dock-panel/dock-panel.cjs.js +2 -0
  37. package/src/community/components/dock-panel/dock-panel.d.ts +110 -0
  38. package/src/community/components/dock-panel/dock-panel.es.js +138 -0
  39. package/src/community/components/dock-panel/dock-panel.module.scss.cjs.js +1 -0
  40. package/src/community/components/dock-panel/dock-panel.module.scss.es.js +18 -0
  41. package/src/community/components/dropdown/dropdown.cjs.js +1 -1
  42. package/src/community/components/dropdown/dropdown.es.js +34 -32
  43. package/src/community/components/form/category-search/category-search.cjs.js +1 -0
  44. package/src/community/components/form/category-search/category-search.d.ts +9 -0
  45. package/src/community/components/form/category-search/category-search.es.js +297 -0
  46. package/src/community/components/form/category-search/category-search.module.scss.cjs.js +1 -0
  47. package/src/community/components/form/category-search/category-search.module.scss.es.js +21 -0
  48. package/src/community/components/form/category-search/category-search.types.d.ts +162 -0
  49. package/src/community/components/form/category-search/define-category-search-category.cjs.js +1 -0
  50. package/src/community/components/form/category-search/define-category-search-category.d.ts +7 -0
  51. package/src/community/components/form/category-search/define-category-search-category.es.js +25 -0
  52. package/src/community/components/form/category-search/index.d.ts +3 -0
  53. package/src/community/components/form/category-search/use-category-search.cjs.js +1 -0
  54. package/src/community/components/form/category-search/use-category-search.d.ts +17 -0
  55. package/src/community/components/form/category-search/use-category-search.es.js +64 -0
  56. package/src/community/components/form/file-upload/file-upload.cjs.js +1 -1
  57. package/src/community/components/form/file-upload/file-upload.es.js +43 -41
  58. package/src/community/components/form/pickers/calendar/calendar.cjs.js +1 -1
  59. package/src/community/components/form/pickers/calendar/calendar.es.js +41 -39
  60. package/src/community/components/form/pickers/timepicker/timepicker.cjs.js +1 -1
  61. package/src/community/components/form/pickers/timepicker/timepicker.es.js +33 -31
  62. package/src/community/components/form/toggle/toggle.cjs.js +1 -1
  63. package/src/community/components/form/toggle/toggle.es.js +30 -28
  64. package/src/community/components/map-components/base-map-selection/base-map-option.cjs.js +1 -1
  65. package/src/community/components/map-components/base-map-selection/base-map-option.d.ts +8 -5
  66. package/src/community/components/map-components/base-map-selection/base-map-option.es.js +63 -65
  67. package/src/community/components/map-components/base-map-selection/base-map-selection.cjs.js +1 -1
  68. package/src/community/components/map-components/base-map-selection/base-map-selection.d.ts +1 -4
  69. package/src/community/components/map-components/base-map-selection/base-map-selection.es.js +55 -55
  70. package/src/community/components/map-components/carousel/carousel.cjs.js +1 -1
  71. package/src/community/components/map-components/carousel/carousel.es.js +19 -17
  72. package/src/community/components/map-components/map-button/map-button.cjs.js +1 -1
  73. package/src/community/components/map-components/map-button/map-button.d.ts +12 -4
  74. package/src/community/components/map-components/map-button/map-button.es.js +43 -40
  75. package/src/community/components/map-components/map-dropdown/map-dropdown.cjs.js +1 -1
  76. package/src/community/components/map-components/map-dropdown/map-dropdown.es.js +51 -49
  77. package/src/community/components/status/status.cjs.js +1 -1
  78. package/src/community/components/status/status.es.js +14 -12
  79. package/src/community/components/stepper/stepper.cjs.js +1 -1
  80. package/src/community/components/stepper/stepper.es.js +33 -31
  81. package/src/community/components/table/table.cjs.js +1 -1
  82. package/src/community/components/table/table.es.js +9 -9
  83. package/src/community/components/table-of-contents/table-of-contents.cjs.js +1 -1
  84. package/src/community/components/table-of-contents/table-of-contents.es.js +21 -19
  85. package/src/community/components/tabs/tabs/tabs.cjs.js +1 -1
  86. package/src/community/components/tabs/tabs/tabs.es.js +29 -27
  87. package/src/community/components/vertical-stepper/vertical-stepper.cjs.js +1 -1
  88. package/src/community/components/vertical-stepper/vertical-stepper.es.js +8 -6
  89. package/src/community/deprecated-exports.cjs.js +1 -0
  90. package/src/community/deprecated-exports.d.ts +19 -0
  91. package/src/community/deprecated-exports.es.js +112 -0
  92. package/src/community/index.d.ts +3 -0
  93. package/src/tedi/components/content/card/card.d.ts +4 -0
  94. package/src/tedi/components/content/card/card.module.scss.cjs.js +1 -1
  95. package/src/tedi/components/content/card/card.module.scss.es.js +3 -2
  96. package/src/tedi/components/content/carousel/carousel.cjs.js +1 -1
  97. package/src/tedi/components/content/carousel/carousel.d.ts +5 -0
  98. package/src/tedi/components/content/carousel/carousel.es.js +20 -20
  99. package/src/tedi/components/content/carousel/use-carousel.cjs.js +1 -1
  100. package/src/tedi/components/content/carousel/use-carousel.d.ts +1 -1
  101. package/src/tedi/components/content/carousel/use-carousel.es.js +127 -127
  102. package/src/tedi/components/content/table-card/index.d.ts +1 -0
  103. package/src/tedi/components/content/table-card/table-card.cjs.js +1 -0
  104. package/src/tedi/components/content/table-card/table-card.d.ts +131 -0
  105. package/src/tedi/components/content/table-card/table-card.es.js +206 -0
  106. package/src/tedi/components/content/table-card/table-card.module.scss.cjs.js +1 -0
  107. package/src/tedi/components/content/table-card/table-card.module.scss.es.js +18 -0
  108. package/src/tedi/components/content/text-group/text-group-list/text-group-list.cjs.js +1 -1
  109. package/src/tedi/components/content/text-group/text-group-list/text-group-list.d.ts +42 -0
  110. package/src/tedi/components/content/text-group/text-group-list/text-group-list.es.js +41 -23
  111. package/src/tedi/components/content/text-group/text-group.cjs.js +1 -1
  112. package/src/tedi/components/content/text-group/text-group.d.ts +10 -0
  113. package/src/tedi/components/content/text-group/text-group.es.js +14 -13
  114. package/src/tedi/components/content/text-group/text-group.module.scss.cjs.js +1 -1
  115. package/src/tedi/components/content/text-group/text-group.module.scss.es.js +5 -1
  116. package/src/tedi/components/filter/filter/filter.cjs.js +1 -1
  117. package/src/tedi/components/filter/filter/filter.d.ts +5 -0
  118. package/src/tedi/components/filter/filter/filter.es.js +154 -144
  119. package/src/tedi/components/filter/filter/filter.module.scss.cjs.js +1 -1
  120. package/src/tedi/components/filter/filter/filter.module.scss.es.js +2 -1
  121. package/src/tedi/components/form/date-field/date-field-helpers.cjs.js +1 -1
  122. package/src/tedi/components/form/date-field/date-field-helpers.d.ts +12 -19
  123. package/src/tedi/components/form/date-field/date-field-helpers.es.js +27 -21
  124. package/src/tedi/components/form/date-field/date-field.cjs.js +1 -1
  125. package/src/tedi/components/form/date-field/date-field.d.ts +1 -1
  126. package/src/tedi/components/form/date-field/date-field.es.js +169 -164
  127. package/src/tedi/components/form/date-time-field/date-time-field.cjs.js +1 -1
  128. package/src/tedi/components/form/date-time-field/date-time-field.es.js +181 -176
  129. package/src/tedi/components/form/search/index.d.ts +1 -0
  130. package/src/tedi/components/form/search/search.cjs.js +1 -1
  131. package/src/tedi/components/form/search/search.d.ts +92 -1
  132. package/src/tedi/components/form/search/search.es.js +265 -69
  133. package/src/tedi/components/form/search/search.module.scss.cjs.js +1 -1
  134. package/src/tedi/components/form/search/search.module.scss.es.js +9 -1
  135. package/src/tedi/components/form/slider/slider.cjs.js +1 -1
  136. package/src/tedi/components/form/slider/slider.es.js +38 -38
  137. package/src/tedi/components/form/slider/slider.module.scss.cjs.js +1 -1
  138. package/src/tedi/components/form/slider/slider.module.scss.es.js +0 -1
  139. package/src/tedi/components/form/textfield/textfield.cjs.js +1 -1
  140. package/src/tedi/components/form/textfield/textfield.es.js +21 -21
  141. package/src/tedi/components/form/time-field/time-field.cjs.js +1 -1
  142. package/src/tedi/components/form/time-field/time-field.es.js +126 -124
  143. package/src/tedi/components/layout/mobile-nav/components/mobile-nav-toggle/mobile-nav-toggle.cjs.js +1 -1
  144. package/src/tedi/components/layout/mobile-nav/components/mobile-nav-toggle/mobile-nav-toggle.d.ts +1 -1
  145. package/src/tedi/components/layout/mobile-nav/components/mobile-nav-toggle/mobile-nav-toggle.es.js +28 -27
  146. package/src/tedi/components/layout/mobile-nav/mobile-nav.cjs.js +1 -1
  147. package/src/tedi/components/layout/mobile-nav/mobile-nav.d.ts +1 -1
  148. package/src/tedi/components/layout/mobile-nav/mobile-nav.es.js +124 -92
  149. package/src/tedi/components/layout/sidenav/sidenav.module.scss.cjs.js +1 -1
  150. package/src/tedi/components/layout/sidenav/sidenav.module.scss.es.js +1 -0
  151. package/src/tedi/components/misc/affix/affix.cjs.js +1 -1
  152. package/src/tedi/components/misc/affix/affix.es.js +20 -8
  153. package/src/tedi/components/navigation/table-of-contents/components/table-of-contents-collapsible/table-of-contents-collapsible.cjs.js +1 -1
  154. package/src/tedi/components/navigation/table-of-contents/components/table-of-contents-collapsible/table-of-contents-collapsible.d.ts +9 -1
  155. package/src/tedi/components/navigation/table-of-contents/components/table-of-contents-collapsible/table-of-contents-collapsible.es.js +78 -39
  156. package/src/tedi/components/navigation/table-of-contents/components/table-of-contents-item/table-of-contents-item.d.ts +6 -0
  157. package/src/tedi/components/navigation/table-of-contents/components/table-of-contents-row/table-of-contents-row.cjs.js +1 -1
  158. package/src/tedi/components/navigation/table-of-contents/components/table-of-contents-row/table-of-contents-row.es.js +23 -28
  159. package/src/tedi/components/navigation/table-of-contents/table-of-contents.cjs.js +1 -1
  160. package/src/tedi/components/navigation/table-of-contents/table-of-contents.d.ts +32 -21
  161. package/src/tedi/components/navigation/table-of-contents/table-of-contents.es.js +58 -55
  162. package/src/tedi/components/navigation/table-of-contents/table-of-contents.module.scss.cjs.js +1 -1
  163. package/src/tedi/components/navigation/table-of-contents/table-of-contents.module.scss.es.js +4 -1
  164. package/src/tedi/components/navigation/tabs/tabs-helpers.cjs.js +1 -1
  165. package/src/tedi/components/navigation/tabs/tabs-helpers.d.ts +5 -0
  166. package/src/tedi/components/navigation/tabs/tabs-helpers.es.js +7 -4
  167. package/src/tedi/components/navigation/tabs/tabs-trigger/tabs-trigger.cjs.js +1 -1
  168. package/src/tedi/components/navigation/tabs/tabs-trigger/tabs-trigger.es.js +17 -17
  169. package/src/tedi/components/overlays/dropdown/dropdown.cjs.js +1 -1
  170. package/src/tedi/components/overlays/dropdown/dropdown.d.ts +8 -0
  171. package/src/tedi/components/overlays/dropdown/dropdown.es.js +82 -72
  172. package/src/tedi/components/overlays/dropdown/dropdown.module.scss.cjs.js +1 -1
  173. package/src/tedi/components/overlays/dropdown/dropdown.module.scss.es.js +1 -0
  174. package/src/tedi/components/overlays/overlay/overlay-trigger.cjs.js +1 -1
  175. package/src/tedi/components/overlays/overlay/overlay-trigger.es.js +22 -21
  176. package/src/tedi/helpers/warn-deprecated/warn-deprecated.cjs.js +1 -0
  177. package/src/tedi/helpers/warn-deprecated/warn-deprecated.d.ts +12 -0
  178. package/src/tedi/helpers/warn-deprecated/warn-deprecated.es.js +11 -0
  179. package/src/tedi/index.d.ts +2 -1
  180. package/src/tedi/providers/label-provider/labels-map.cjs.js +1 -1
  181. package/src/tedi/providers/label-provider/labels-map.d.ts +44 -2
  182. package/src/tedi/providers/label-provider/labels-map.es.js +43 -1
  183. package/tedi.cjs.js +1 -1
  184. package/tedi.es.js +326 -324
@@ -1,66 +1,66 @@
1
- import { useState as R, useRef as i, useEffect as G, useMemo as S, useCallback as s } from "react";
2
- import At from "../../../helpers/hooks/use-breakpoint.es.js";
3
- import { resolveBreakpointValue as ct } from "./carousel-utils.es.js";
4
- import { useLabels as Ft } from "../../../providers/label-provider/use-labels.es.js";
5
- const Xt = {
1
+ import { useState as S, useRef as i, useEffect as K, useMemo as I, useCallback as s } from "react";
2
+ import Xt from "../../../helpers/hooks/use-breakpoint.es.js";
3
+ import { resolveBreakpointValue as at } from "./carousel-utils.es.js";
4
+ import { useLabels as Nt } from "../../../providers/label-provider/use-labels.es.js";
5
+ const Wt = {
6
6
  slidesPerView: { xs: 1 },
7
7
  gap: { xs: 1 },
8
8
  fade: !1,
9
9
  transitionMs: 400,
10
10
  loop: !0,
11
11
  centered: !1
12
- }, X = (T, x) => (T % x + x) % x, $t = () => {
13
- const { getLabel: T } = Ft(), x = At(), [u, at] = R(Xt), [e, it] = R(0), [l, w] = R(0), [h, J] = R(0), [Q, g] = R(!1), [C, ut] = R(0), [Z, lt] = R(16), [ft, dt] = R(""), N = i(null), tt = i(null), et = i([]), V = i(!1), y = i(!1), K = i(!1), O = i(0), A = i(0), rt = i(0), Y = i(0), U = i(0), j = i(), W = i(0), nt = i(!0), f = i(l), ot = i(h);
14
- G(() => {
12
+ }, N = (V, x) => (V % x + x) % x, vt = (V) => {
13
+ const { getLabel: x } = Nt(), W = Xt(), [u, it] = S(Wt), [e, ut] = S(0), [l, w] = S(0), [h, Q] = S(0), [Z, g] = S(!1), [T, lt] = S(0), [tt, ft] = S(16), [dt, mt] = S(""), E = i(null), et = i(null), rt = i([]), y = i(!1), A = i(!1), O = i(!1), Y = i(0), F = i(0), nt = i(0), U = i(0), j = i(0), H = i(), L = i(0), ot = i(!0), f = i(l), st = i(h);
14
+ K(() => {
15
15
  f.current = l;
16
- }, [l]), G(() => {
17
- ot.current = h;
16
+ }, [l]), K(() => {
17
+ st.current = h;
18
18
  }, [h]);
19
- const c = S(
20
- () => ct(u.slidesPerView, x),
21
- [u.slidesPerView, x]
22
- ), I = S(() => ct(u.gap, x), [u.gap, x]), P = S(() => I * Z, [I, Z]), n = u.loop, M = S(
19
+ const c = I(
20
+ () => at(u.slidesPerView, W),
21
+ [u.slidesPerView, W]
22
+ ), b = I(() => at(u.gap, W), [u.gap, W]), C = I(() => b * tt, [b, tt]), n = u.loop, M = I(
23
23
  () => Math.max(0, e - Math.ceil(c)),
24
24
  [e, c]
25
- ), b = s(
25
+ ), R = s(
26
26
  (t) => n ? t : Math.min(Math.max(t, 0), M),
27
27
  [n, M]
28
- ), m = n ? e : 0, mt = S(() => e === 0 ? 0 : n ? X(Math.floor(l), e) : Math.min(Math.max(Math.round(l), 0), e - 1), [l, e, n]), E = n ? l - h + m : l, ht = n || l > 1e-3, pt = n || l < M - 1e-3, Mt = S(() => {
28
+ ), m = n ? e : 0, ht = I(() => e === 0 ? 0 : n ? N(Math.floor(l), e) : Math.min(Math.max(Math.round(l), 0), e - 1), [l, e, n]), z = n ? l - h + m : l, pt = n || l > 1e-3, Mt = n || l < M - 1e-3, xt = I(() => {
29
29
  if (!e) return [];
30
30
  if (!n) return Array.from({ length: e }, (o, a) => a);
31
31
  const t = 2 * m + Math.ceil(c), r = h - m;
32
- return Array.from({ length: t }, (o, a) => X(r + a, e));
33
- }, [e, m, c, h, n]), xt = S(
34
- () => `0 0 calc((100% - ${(c - 1) * I}rem) / ${c})`,
35
- [c, I]
36
- ), wt = S(() => {
37
- if (!C)
38
- return { gap: `${I}rem`, transform: "translate3d(0,0,0)", transition: "none" };
39
- const t = P * (c - 1), r = (C - t) / c, o = n ? l - h + m : l, a = u.centered ? (C - r) / 2 : 0, d = -o * (r + P) + a;
32
+ return Array.from({ length: t }, (o, a) => N(r + a, e));
33
+ }, [e, m, c, h, n]), wt = I(
34
+ () => `0 0 calc((100% - ${(c - 1) * b}rem) / ${c})`,
35
+ [c, b]
36
+ ), gt = I(() => {
37
+ if (!T)
38
+ return { gap: `${b}rem`, transform: "translate3d(0,0,0)", transition: "none" };
39
+ const t = C * (c - 1), r = (T - t) / c, o = n ? l - h + m : l, a = u.centered ? (T - r) / 2 : 0, d = -o * (r + C) + a;
40
40
  return {
41
- gap: `${I}rem`,
41
+ gap: `${b}rem`,
42
42
  transform: `translate3d(${d}px, 0, 0)`,
43
- transition: Q ? `transform ${u.transitionMs}ms ease` : "none"
43
+ transition: Z ? `transform ${u.transitionMs}ms ease` : "none"
44
44
  };
45
45
  }, [
46
+ T,
47
+ b,
46
48
  C,
47
- I,
48
- P,
49
49
  c,
50
50
  l,
51
51
  h,
52
52
  m,
53
- Q,
53
+ Z,
54
54
  u.transitionMs,
55
55
  u.centered,
56
56
  n
57
- ]), gt = s(
57
+ ]), Rt = s(
58
58
  (t) => {
59
59
  const r = Math.ceil(c);
60
- return t >= E && t < E + r;
60
+ return t >= z && t < z + r;
61
61
  },
62
- [c, E]
63
- ), bt = s(
62
+ [c, z]
63
+ ), St = s(
64
64
  (t, r, o) => {
65
65
  const a = [t];
66
66
  if (u.fade) {
@@ -70,159 +70,159 @@ const Xt = {
70
70
  return a.join(" ");
71
71
  },
72
72
  [u.fade, c]
73
- ), Rt = s((t, r) => {
74
- et.current[t] = r;
75
- }, []), D = s(() => {
73
+ ), It = s((t, r) => {
74
+ rt.current[t] = r;
75
+ }, []), P = s(() => {
76
76
  setTimeout(() => {
77
- if (!nt.current || !e) return;
78
- const t = n ? X(Math.floor(f.current), e) : Math.min(Math.max(Math.round(f.current), 0), e - 1);
79
- dt(T("carousel.slide", t + 1, e));
77
+ if (!ot.current || !e) return;
78
+ const t = n ? N(Math.floor(f.current), e) : Math.min(Math.max(Math.round(f.current), 0), e - 1);
79
+ mt(x("carousel.slide", t + 1, e));
80
80
  }, 100);
81
- }, [T, e, n]), z = s(() => {
82
- V.current = !0, setTimeout(() => {
83
- V.current = !1;
81
+ }, [x, e, n]), $ = s(() => {
82
+ y.current = !0, setTimeout(() => {
83
+ y.current = !1;
84
84
  }, u.transitionMs);
85
- }, [u.transitionMs]), st = s(() => {
85
+ }, [u.transitionMs]), ct = s(() => {
86
86
  setTimeout(() => {
87
87
  var r;
88
- const t = f.current - ot.current + m;
89
- (r = et.current[t]) == null || r.focus({ preventScroll: !0 });
88
+ const t = f.current - st.current + m;
89
+ (r = rt.current[t]) == null || r.focus({ preventScroll: !0 });
90
90
  });
91
- }, [m]), H = s(() => {
92
- !e || V.current || !n && f.current >= M - 1e-3 || (g(!0), w((t) => b(t + 1)), z(), D());
93
- }, [e, n, M, b, z, D]), q = s(() => {
94
- !e || V.current || !n && f.current <= 1e-3 || (g(!0), w((t) => b(t - 1)), z(), D());
95
- }, [e, n, b, z, D]), $ = s(
91
+ }, [m]), q = s(() => {
92
+ !e || y.current || !n && f.current >= M - 1e-3 || (g(!0), w((t) => R(t + 1)), $(), P());
93
+ }, [e, n, M, R, $, P]), J = s(() => {
94
+ !e || y.current || !n && f.current <= 1e-3 || (g(!0), w((t) => R(t - 1)), $(), P());
95
+ }, [e, n, R, $, P]), v = s(
96
96
  (t, r) => {
97
- if (!(!e || V.current)) {
97
+ if (!(!e || y.current)) {
98
98
  if (g(!0), n) {
99
- const o = X(Math.floor(f.current), e), d = X(t, e) - o;
99
+ const o = N(Math.floor(f.current), e), d = N(t, e) - o;
100
100
  w((p) => p + d);
101
101
  } else
102
- w(b(t));
103
- r != null && r.focusSlide ? K.current = !0 : D();
102
+ w(R(t));
103
+ r != null && r.focusSlide ? O.current = !0 : P();
104
104
  }
105
105
  },
106
- [e, n, b, D]
107
- ), St = s(
106
+ [e, n, R, P]
107
+ ), bt = s(
108
108
  (t) => {
109
- t.target !== tt.current || t.propertyName !== "transform" || y.current || (g(!1), J(Math.floor(f.current)), K.current && (K.current = !1, st()));
109
+ t.target !== et.current || t.propertyName !== "transform" || A.current || (g(!1), Q(Math.floor(f.current)), O.current && (O.current = !1, ct()));
110
110
  },
111
- [st]
112
- ), It = s(() => {
113
- const t = N.current;
111
+ [ct]
112
+ ), kt = s(() => {
113
+ const t = E.current;
114
114
  t && (t.scrollLeft = 0, t.scrollTop = 0);
115
- }, []), L = s(() => (C - P * (c - 1)) / c + P, [C, P, c]), kt = s(
115
+ }, []), D = s(() => (T - C * (c - 1)) / c + C, [T, C, c]), Tt = s(
116
116
  (t) => {
117
117
  if (!e) return;
118
118
  const r = Math.abs(t.deltaX) > Math.abs(t.deltaY) ? t.deltaX : t.shiftKey ? t.deltaY : 0;
119
119
  if (!r) return;
120
- const o = L();
120
+ const o = D();
121
121
  if (!o) return;
122
122
  const a = r / o;
123
- W.current += a;
124
- const d = m * 0.9, p = n ? h - d : 0, k = n ? h + d : M, v = f.current + a, B = Math.min(Math.max(v, p), k), Lt = B !== v;
125
- g(!1), w(B), clearTimeout(j.current), j.current = setTimeout(() => {
123
+ L.current += a;
124
+ const d = m * 0.9, p = n ? h - d : 0, k = n ? h + d : M, B = f.current + a, _ = Math.min(Math.max(B, p), k), yt = _ !== B;
125
+ g(!1), w(_), clearTimeout(H.current), H.current = setTimeout(() => {
126
126
  g(!0);
127
- const Vt = Math.sign(W.current), F = f.current;
128
- let _ = Math.round(F);
129
- Math.abs(W.current) > 0.3 && (_ = Vt > 0 ? Math.ceil(F) : Math.floor(F)), Lt && (F <= p && (_ = Math.ceil(p)), F >= k && (_ = Math.floor(k)));
130
- const yt = Math.min(Math.max(_, p), k);
131
- w(yt), W.current = 0;
127
+ const At = Math.sign(L.current), X = f.current;
128
+ let G = Math.round(X);
129
+ Math.abs(L.current) > 0.3 && (G = At > 0 ? Math.ceil(X) : Math.floor(X)), yt && (X <= p && (G = Math.ceil(p)), X >= k && (G = Math.floor(k)));
130
+ const Ft = Math.min(Math.max(G, p), k);
131
+ w(Ft), L.current = 0;
132
132
  }, 120);
133
133
  },
134
- [e, L, m, h, n, M]
135
- ), Tt = s(
134
+ [e, D, m, h, n, M]
135
+ ), Ct = s(
136
136
  (t) => {
137
137
  switch (t.key) {
138
138
  case "ArrowRight":
139
139
  case "PageDown":
140
- t.preventDefault(), H();
140
+ t.preventDefault(), q();
141
141
  break;
142
142
  case "ArrowLeft":
143
143
  case "PageUp":
144
- t.preventDefault(), q();
144
+ t.preventDefault(), J();
145
145
  break;
146
146
  case "Home":
147
- t.preventDefault(), $(0);
147
+ t.preventDefault(), v(0);
148
148
  break;
149
149
  case "End":
150
- t.preventDefault(), $(e - 1);
150
+ t.preventDefault(), v(e - 1);
151
151
  break;
152
152
  }
153
153
  },
154
- [H, q, $, e]
155
- ), Ct = s(
154
+ [q, J, v, e]
155
+ ), Pt = s(
156
156
  (t) => {
157
157
  var r;
158
- e && ((r = N.current) == null || r.setPointerCapture(t.pointerId), y.current = !0, g(!1), O.current = t.clientX, A.current = f.current, rt.current = t.timeStamp, Y.current = t.clientX, U.current = t.timeStamp, n && J(Math.floor(f.current)));
158
+ e && ((r = E.current) == null || r.setPointerCapture(t.pointerId), A.current = !0, g(!1), Y.current = t.clientX, F.current = f.current, nt.current = t.timeStamp, U.current = t.clientX, j.current = t.timeStamp, n && Q(Math.floor(f.current)));
159
159
  },
160
160
  [e, n]
161
- ), Pt = s(
161
+ ), Dt = s(
162
162
  (t) => {
163
- if (!y.current) return;
164
- const r = L();
163
+ if (!A.current) return;
164
+ const r = D();
165
165
  if (!r) return;
166
- const o = t.clientX - O.current;
166
+ const o = t.clientX - Y.current;
167
167
  if (Number.isNaN(o)) return;
168
- Y.current = t.clientX, U.current = t.timeStamp;
169
- const a = o / r, d = A.current - a, p = m * 0.9, k = Math.floor(A.current), v = n ? k - p : 0, B = n ? k + p : M;
170
- w(Math.min(Math.max(d, v), B));
168
+ U.current = t.clientX, j.current = t.timeStamp;
169
+ const a = o / r, d = F.current - a, p = m * 0.9, k = Math.floor(F.current), B = n ? k - p : 0, _ = n ? k + p : M;
170
+ w(Math.min(Math.max(d, B), _));
171
171
  },
172
- [L, m, n, M]
173
- ), Dt = s(() => {
174
- if (!y.current) return;
175
- y.current = !1, g(!0);
176
- const t = L(), r = Math.round(f.current);
172
+ [D, m, n, M]
173
+ ), Vt = s(() => {
174
+ if (!A.current) return;
175
+ A.current = !1, g(!0);
176
+ const t = D(), r = Math.round(f.current);
177
177
  let o = r;
178
- const a = U.current - rt.current, d = a > 0 && t ? -(Y.current - O.current) / t / a : 0;
179
- Math.abs(d) > 15e-4 && r === Math.round(A.current) && (o = Math.round(A.current) + (d > 0 ? 1 : -1)), w(b(o));
180
- }, [L, b]);
181
- return G(() => {
182
- const t = N.current;
178
+ const a = j.current - nt.current, d = a > 0 && t ? -(U.current - Y.current) / t / a : 0;
179
+ Math.abs(d) > 15e-4 && r === Math.round(F.current) && (o = Math.round(F.current) + (d > 0 ? 1 : -1)), w(R(o));
180
+ }, [D, R]);
181
+ return K(() => {
182
+ const t = E.current;
183
183
  if (!t) return;
184
184
  const r = () => {
185
- ut(t.clientWidth), lt(parseFloat(getComputedStyle(document.documentElement).fontSize) || 16);
185
+ lt(t.clientWidth), ft(parseFloat(getComputedStyle(document.documentElement).fontSize) || 16);
186
186
  };
187
187
  r();
188
188
  const o = new ResizeObserver(r);
189
189
  return o.observe(t), () => o.disconnect();
190
- }, []), G(
190
+ }, []), K(
191
191
  () => () => {
192
- nt.current = !1, clearTimeout(j.current);
192
+ ot.current = !1, clearTimeout(H.current);
193
193
  },
194
194
  []
195
195
  ), {
196
- viewportRef: N,
197
- trackRef: tt,
198
- setSlideRef: Rt,
199
- setConfig: at,
200
- setSlidesCount: it,
196
+ viewportRef: E,
197
+ trackRef: et,
198
+ setSlideRef: It,
199
+ setConfig: it,
200
+ setSlidesCount: ut,
201
201
  slidesCount: e,
202
- slideIndex: mt,
203
- canPrev: ht,
204
- canNext: pt,
205
- renderedIndices: Mt,
206
- renderedActiveIndex: E,
207
- slideFlex: xt,
208
- trackStyle: wt,
209
- contentClassName: bt,
210
- isSlideVisible: gt,
211
- announcement: ft,
212
- regionLabel: T("carousel"),
213
- slideLabel: (t) => T("carousel.slide", t, e),
214
- next: H,
215
- prev: q,
216
- goToIndex: $,
217
- onTransitionEnd: St,
218
- onScroll: It,
219
- onWheel: kt,
220
- onKeyDown: Tt,
221
- onPointerDown: Ct,
222
- onPointerMove: Pt,
223
- onPointerUp: Dt
202
+ slideIndex: ht,
203
+ canPrev: pt,
204
+ canNext: Mt,
205
+ renderedIndices: xt,
206
+ renderedActiveIndex: z,
207
+ slideFlex: wt,
208
+ trackStyle: gt,
209
+ contentClassName: St,
210
+ isSlideVisible: Rt,
211
+ announcement: dt,
212
+ regionLabel: (V == null ? void 0 : V.trim()) || x("carousel"),
213
+ slideLabel: (t) => x("carousel.slide", t, e),
214
+ next: q,
215
+ prev: J,
216
+ goToIndex: v,
217
+ onTransitionEnd: bt,
218
+ onScroll: kt,
219
+ onWheel: Tt,
220
+ onKeyDown: Ct,
221
+ onPointerDown: Pt,
222
+ onPointerMove: Dt,
223
+ onPointerUp: Vt
224
224
  };
225
225
  };
226
226
  export {
227
- $t as useCarousel
227
+ vt as useCarousel
228
228
  };
@@ -0,0 +1 @@
1
+ export * from './table-card';
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("../../../../../external/classnames/index.cjs.js"),C=require("react"),ve=require("../../base/icon/icon.cjs.js"),c=require("../../base/typography/text/text.cjs.js"),je=require("../../form/checkbox/checkbox.cjs.js"),f=require("../card/card.cjs.js"),Se=require("../label/label.cjs.js"),R=require("../text-group/text-group-list/text-group-list.cjs.js"),t=require("./table-card.module.scss.cjs.js"),ye=require("../../../helpers/hooks/use-breakpoint-props.cjs.js"),Ce=require("../../../providers/label-provider/use-labels.cjs.js"),Ae={horizontal:{labelAlign:"right",valueAlign:"right",labelWidth:"var(--text-group-label-width-sm)",rowGap:"0"},vertical:{labelAlign:"left",valueAlign:"left",labelWidth:"auto",rowGap:"var(--layout-grid-gutters-16)"}},Te=l=>l.bold?e.jsx(c.Text,{element:"span",modifiers:"bold",children:l.value}):l.value,Le=(l,_)=>typeof l=="string"?e.jsx(Se.Label,{isSmall:_,children:l}):l,D=l=>{const{getCurrentBreakpointProps:_}=ye.useBreakpointProps(l.defaultServerBreakpoint),{getLabel:A}=Ce.useLabels(),{rows:E,title:s,subtitle:n,endSlot:b,titleElement:T="h3",titleModifiers:u,collapsible:d=!1,defaultOpen:F=!0,open:L,onOpenChange:v,actions:N,summary:i,selectable:m=!1,selected:q,defaultSelected:M=!1,onSelectedChange:j,labelSize:U="default",selectionLabel:V=A("table-card.select-row"),ariaLabel:S,id:$,children:k,layout:z="horizontal",columns:Y=1,labelWidth:J,labelAlign:K,valueAlign:Q,rowAlign:X="start",padding:Z=1,rowGap:y,className:ee}=_(l),te=z==="horizontal",g=Ae[z],ae=K??g.labelAlign,le=Q??g.valueAlign,B=J??g.labelWidth,se=typeof y=="number"?`${y}rem`:y??g.rowGap,ne=C.useId(),x=$??ne,G=`${x}-body`,[de,ie]=C.useState(F),w=L!==void 0,r=d?w?L:de:!0,re=()=>{const a=!r;w||ie(a),v==null||v(a)},[oe,ce]=C.useState(M),H=q!==void 0,ue=H?q:oe,be=a=>{H||ce(a),j==null||j(a)},W=T;d&&!s&&!S&&console.warn("TableCard: a `collapsible` card needs a `title` or `ariaLabel` so its toggle has an accessible name.");const he=!!(m||s||n||b||d),h=!!N,I=!!i,pe=!!k,O=d?r||h:m,fe=r&&!O,me=I||h||pe,ge=h,p=m&&!d&&!!s&&!n,xe=E.map(a=>({label:Le(a.label,U==="small"),value:Te(a),...a.colSpan?{colSpan:a.colSpan}:{}})),P=m?e.jsx(je.Checkbox,{id:`${x}-select`,name:`${x}-select`,value:"selected",label:p?e.jsx(c.Text,{element:"span",color:"primary",modifiers:u,className:o.default(t.default["tedi-table-card__title"],{[t.default["tedi-table-card__title--body"]]:!u}),children:s}):V,hideLabel:!p,checked:ue,onChange:(a,_e)=>be(_e)}):null;return e.jsxs(f.Card,{padding:0,className:o.default(t.default["tedi-table-card"],ee),"aria-label":S,id:x,children:[he&&e.jsxs(f.Card.Content,{padding:fe?{top:1,right:1,bottom:0,left:1}:1,hasSeparator:O,className:o.default(t.default["tedi-table-card__header"],{[t.default["tedi-table-card__header--select-title"]]:p}),children:[p?e.jsx(W,{className:t.default["tedi-table-card__heading"],children:P}):P,d?e.jsx(W,{className:t.default["tedi-table-card__heading"],children:e.jsxs("button",{type:"button",className:t.default["tedi-table-card__toggle"],"aria-expanded":r,"aria-controls":G,"aria-label":s?void 0:S??A(r?"close":"open"),onClick:re,children:[e.jsxs("span",{className:t.default["tedi-table-card__title-group"],children:[s&&e.jsx(c.Text,{element:"span",modifiers:u,className:o.default(t.default["tedi-table-card__title"],{[t.default["tedi-table-card__title--body"]]:!u}),children:s}),n&&e.jsx(c.Text,{element:"span",color:"secondary",modifiers:"small",children:n})]}),b&&e.jsx("span",{className:t.default["tedi-table-card__end-slot"],children:b}),e.jsx("span",{className:o.default(t.default["tedi-table-card__chevron"],{[t.default["tedi-table-card__chevron--open"]]:r}),children:e.jsx(ve.Icon,{name:"expand_more",size:24,color:"inherit"})})]})}):e.jsxs(e.Fragment,{children:[(s||n)&&!p&&e.jsxs("span",{className:t.default["tedi-table-card__title-group"],children:[s&&e.jsx(c.Text,{element:T,modifiers:u,className:o.default(t.default["tedi-table-card__title"],{[t.default["tedi-table-card__title--body"]]:!u}),children:s}),n&&e.jsx(c.Text,{element:"span",color:"secondary",modifiers:"small",children:n})]}),b&&e.jsx("div",{className:t.default["tedi-table-card__end-slot"],children:b})]})]}),e.jsxs("div",{id:G,hidden:d&&!r,className:o.default({[t.default["tedi-table-card__body--has-footer"]]:h}),children:[e.jsx(f.Card.Content,{padding:Z,hasSeparator:me,children:e.jsx(R.TextGroupList,{columns:Y,items:xe,rowGap:se,...te?{type:"horizontal",labelAlign:ae,valueAlign:le,labelWidth:B,rowAlign:X}:{type:"vertical",labelAlign:"left",labelWidth:B}})}),k,I&&e.jsx(f.Card.Content,{padding:1,background:"tertiary",hasSeparator:ge,children:e.jsx(R.TextGroupList,{type:"horizontal",labelAlign:"left",valueAlign:"right",items:[{label:i==null?void 0:i.label,value:e.jsx(c.Text,{element:"span",modifiers:"bold",children:i==null?void 0:i.value})}]})})]}),h&&e.jsx(f.Card.Content,{padding:{vertical:.5,horizontal:1},className:t.default["tedi-table-card__actions"],children:N})]})};D.displayName="TableCard";exports.TableCard=D;
@@ -0,0 +1,131 @@
1
+ import { default as React } from 'react';
2
+ import { BreakpointSupport } from '../../../helpers';
3
+ import { TextModifiers } from '../../base/typography/text/text';
4
+ import { CardContentPadding } from '../card/card';
5
+ type TableCardAlign = 'left' | 'right';
6
+ export interface TableCardRow {
7
+ /** Row label (usually the column header). Strings are wrapped in a `<Label>`; nodes render as-is. */
8
+ label: React.ReactNode;
9
+ /** Row value — text, a `StatusBadge`, a link, etc. */
10
+ value: React.ReactNode;
11
+ /**
12
+ * Show the value in bold.
13
+ * @default false
14
+ */
15
+ bold?: boolean;
16
+ /** In a multi-column body, span this row across N columns. Ignored when `columns` is 1. */
17
+ colSpan?: number;
18
+ }
19
+ type TableCardBreakpointProps = {
20
+ /**
21
+ * Row layout: `horizontal` (label beside value) or `vertical` (label above value).
22
+ * @default horizontal
23
+ */
24
+ layout?: 'horizontal' | 'vertical';
25
+ /**
26
+ * Number of equal-width columns. Best with `layout="vertical"`.
27
+ * @default 1
28
+ */
29
+ columns?: number;
30
+ /**
31
+ * Label column width (horizontal layout); a `number` is pixels.
32
+ * @default 8.25rem horizontal, auto vertical
33
+ */
34
+ labelWidth?: string | number;
35
+ /** Label text alignment. Defaults to `right` in horizontal layout, `left` otherwise. */
36
+ labelAlign?: TableCardAlign;
37
+ /** Value text alignment. Defaults to `right` in horizontal layout, `left` otherwise. */
38
+ valueAlign?: TableCardAlign;
39
+ /**
40
+ * Vertical alignment of each label against its value (horizontal layout only).
41
+ * `'center'` keeps the label centred when a value is taller, e.g. a `StatusBadge`.
42
+ * @default start
43
+ */
44
+ rowAlign?: 'start' | 'center';
45
+ /**
46
+ * Padding of the card body (the rows section). Accepts the same values as `Card.Content`:
47
+ * a number in rems, `{ vertical, horizontal }`, or `{ top, right, bottom, left }`.
48
+ * @default 1
49
+ */
50
+ padding?: CardContentPadding;
51
+ /**
52
+ * Vertical gap between rows in the body. A `number` is rems (matching `padding`); pass a
53
+ * string for any other CSS length.
54
+ * Defaults to the layout gutter in `vertical` layout and the list's compact spacing otherwise.
55
+ */
56
+ rowGap?: string | number;
57
+ /** Class name for the root element. */
58
+ className?: string;
59
+ };
60
+ export interface TableCardProps extends BreakpointSupport<TableCardBreakpointProps> {
61
+ /** Label / value pairs (one per column) rendered as the card body - a single `<dl>`. */
62
+ rows: TableCardRow[];
63
+ /** Header title. Required for `collapsible`. */
64
+ title?: React.ReactNode;
65
+ /** Secondary line under the title. */
66
+ subtitle?: React.ReactNode;
67
+ /** Content rendered at the end of the header — a `StatusBadge`, a link, etc. */
68
+ endSlot?: React.ReactNode;
69
+ /**
70
+ * Heading tag for `title` (for the document outline). The title stays body-sized unless
71
+ * `titleModifiers` is set.
72
+ * @default h3
73
+ */
74
+ titleElement?: 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
75
+ /** Visual size / weight of the title (`Text` modifiers), independent of `titleElement`. */
76
+ titleModifiers?: TextModifiers;
77
+ /**
78
+ * Make the header a toggle that shows / hides the body. Provide a `title` (or, failing that,
79
+ * `ariaLabel`) so the toggle has an accessible name.
80
+ * @default false
81
+ */
82
+ collapsible?: boolean;
83
+ /**
84
+ * Initial open state (uncontrolled). Ignored when `open` is set.
85
+ * @default true
86
+ */
87
+ defaultOpen?: boolean;
88
+ /** Controlled open state. Pair with `onOpenChange`. */
89
+ open?: boolean;
90
+ /** Called with the next open state when the header toggles. */
91
+ onOpenChange?: (open: boolean) => void;
92
+ /** Footer content (e.g. `Button`s), divided from the body. */
93
+ actions?: React.ReactNode;
94
+ /** Emphasised summary / total row after the body, on a muted background. */
95
+ summary?: {
96
+ label: React.ReactNode;
97
+ value: React.ReactNode;
98
+ };
99
+ /**
100
+ * Show a leading checkbox to select the row.
101
+ * @default false
102
+ */
103
+ selectable?: boolean;
104
+ /** Controlled selected state. Pair with `onSelectedChange`. */
105
+ selected?: boolean;
106
+ /**
107
+ * Initial selected state in uncontrolled mode. Ignored when `selected` is provided.
108
+ * @default false
109
+ */
110
+ defaultSelected?: boolean;
111
+ /** Called with the next selected state when the checkbox toggles. */
112
+ onSelectedChange?: (selected: boolean) => void;
113
+ /**
114
+ * Label text size — `small` uses the 14px label style, `default` the 16px body style.
115
+ * @default default
116
+ */
117
+ labelSize?: 'small' | 'default';
118
+ /** Accessible name for the selection checkbox. Defaults to the `table-card.select-row` label. */
119
+ selectionLabel?: string;
120
+ /** Accessible name for the card region. */
121
+ ariaLabel?: string;
122
+ /** Root element id (also wires the collapsible ARIA). Auto-generated when omitted. */
123
+ id?: string;
124
+ /** Extra full-width body content after `rows` (e.g. child row-groups). Collapses with the body. */
125
+ children?: React.ReactNode;
126
+ }
127
+ export declare const TableCard: {
128
+ (props: TableCardProps): JSX.Element;
129
+ displayName: string;
130
+ };
131
+ export default TableCard;