@invergent/ui-sdk 2.19.0 → 2.19.1

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 (68) hide show
  1. package/README.md +8 -0
  2. package/dist/button-group.cjs +80 -0
  3. package/dist/button-group.cjs.map +1 -0
  4. package/dist/button-group.d.cts +17 -0
  5. package/dist/button-group.d.ts +17 -0
  6. package/dist/button-group.js +75 -0
  7. package/dist/button-group.js.map +1 -0
  8. package/dist/chunk-NSK344BJ.js +80 -0
  9. package/dist/chunk-NSK344BJ.js.map +1 -0
  10. package/dist/chunk-PH733KDD.js +141 -0
  11. package/dist/chunk-PH733KDD.js.map +1 -0
  12. package/dist/chunk-QEBQ5NUN.cjs +148 -0
  13. package/dist/chunk-QEBQ5NUN.cjs.map +1 -0
  14. package/dist/chunk-UXSDDJXM.cjs +88 -0
  15. package/dist/chunk-UXSDDJXM.cjs.map +1 -0
  16. package/dist/command.cjs +177 -0
  17. package/dist/command.cjs.map +1 -0
  18. package/dist/command.d.cts +22 -0
  19. package/dist/command.d.ts +22 -0
  20. package/dist/command.js +167 -0
  21. package/dist/command.js.map +1 -0
  22. package/dist/field.cjs +1 -1
  23. package/dist/field.js +1 -1
  24. package/dist/hover-card.cjs +43 -0
  25. package/dist/hover-card.cjs.map +1 -0
  26. package/dist/hover-card.d.cts +9 -0
  27. package/dist/hover-card.d.ts +9 -0
  28. package/dist/hover-card.js +39 -0
  29. package/dist/hover-card.js.map +1 -0
  30. package/dist/input-group.cjs +30 -142
  31. package/dist/input-group.cjs.map +1 -1
  32. package/dist/input-group.js +5 -139
  33. package/dist/input-group.js.map +1 -1
  34. package/dist/item.cjs +196 -0
  35. package/dist/item.cjs.map +1 -0
  36. package/dist/item.d.cts +28 -0
  37. package/dist/item.d.ts +28 -0
  38. package/dist/item.js +185 -0
  39. package/dist/item.js.map +1 -0
  40. package/dist/popover.cjs +31 -82
  41. package/dist/popover.cjs.map +1 -1
  42. package/dist/popover.js +2 -78
  43. package/dist/popover.js.map +1 -1
  44. package/dist/progress-bar.cjs +22 -10
  45. package/dist/progress-bar.cjs.map +1 -1
  46. package/dist/progress-bar.d.cts +2 -1
  47. package/dist/progress-bar.d.ts +2 -1
  48. package/dist/progress-bar.js +22 -10
  49. package/dist/progress-bar.js.map +1 -1
  50. package/dist/rabbit-mark.cjs +30 -0
  51. package/dist/rabbit-mark.cjs.map +1 -0
  52. package/dist/rabbit-mark.d.cts +16 -0
  53. package/dist/rabbit-mark.d.ts +16 -0
  54. package/dist/rabbit-mark.js +26 -0
  55. package/dist/rabbit-mark.js.map +1 -0
  56. package/dist/responsive-panel.cjs +85 -0
  57. package/dist/responsive-panel.cjs.map +1 -0
  58. package/dist/responsive-panel.d.cts +33 -0
  59. package/dist/responsive-panel.d.ts +33 -0
  60. package/dist/responsive-panel.js +83 -0
  61. package/dist/responsive-panel.js.map +1 -0
  62. package/dist/timeline.cjs +171 -0
  63. package/dist/timeline.cjs.map +1 -0
  64. package/dist/timeline.d.cts +28 -0
  65. package/dist/timeline.d.ts +28 -0
  66. package/dist/timeline.js +162 -0
  67. package/dist/timeline.js.map +1 -0
  68. package/package.json +2 -1
@@ -0,0 +1,16 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ /** The rabbit silhouette, in the coordinate space of {@link RABBIT_MARK_BOX}. */
4
+ declare const RABBIT_MARK_PATH = "M49.71,46.83c0,.23.02.45.07.67,2.1.49,4.16,1.07,6.18,1.74.58-.64.94-1.48.94-2.42,0-1.98-1.61-3.59-3.59-3.59s-3.59,1.61-3.59,3.59M33.95,78.3c3.1-5.1,6.72-8.89,11.64-12.21.61-.42,1.24-.8,1.88-1.17.44-.25.61-.66.58-1.05,0-.53-.49-.91-.93-1.12-1.34-.62-2.72-1.5-4.06-2.54-1.57-1.22-3.01-2.59-4.36-4.06-.95-1.04-2.02-2.38-3-3.81-.81-1.18-.63-2.77.43-3.73,1.1-1,2.26-1.92,3.48-2.76.36-.25.72-.49,1.1-.73,2.43-1.55,5.05-2.79,7.79-3.7,3.23-1.07,6.62-1.66,10.03-1.74.59-.35,1.19-.69,1.8-1.01,1.66-.88,3.38-1.62,5.17-2.21,1.58-.54,3.2-.95,4.85-1.24,3.28-.59,6.64-.7,9.95-.32,1.23.14,2.45.34,3.68.62,2.87.64,5.59,1.62,8.09,2.9.54.27.71.95.36,1.45-1.58,2.22-3.46,4.25-5.5,6.05-3.01,2.65-6.51,4.75-10.26,6.17-2.32.88-4.75,1.53-7.22,1.91-.62.1-.78.9-.24,1.22,0,0,.01,0,.02.01,6.97,4.05,13.1,9.22,18.36,15.32.72.83,1.42,1.68,2.1,2.53,3.36,4.22,6.23,8.82,8.56,13.68,1.8,3.73,3.27,7.63,4.39,11.62.73,2.6,1.34,5.24,1.76,7.91.11.76-.87,1.16-1.3.53-1.15-1.69-2.31-3.35-3.61-4.93-1.2-1.46-2.46-2.86-3.75-4.24-5.44-5.8-11.84-10.7-18.84-14.48-7.32-3.94-15.09-6.38-23.44-6.53-2.23-.04-4.46.08-6.68.3-4.05.43-8.02,1.28-11.93,2.4-.03,0-.05.01-.08.02,0,0-.01,0-.02,0-.07.02-.14.03-.21.03-.53,0-.91-.6-.61-1.09M50.95,12.97c-1.31,1.16-2.2,2.71-2.9,4.29-1.66,3.74-2.85,7.74-3.52,11.77-.32,1.92-.56,3.87-1.28,5.69-.17.44-.37.87-.6,1.28-1.18,2.1-3.37,3.19-5.6,3.86-4.96,1.47-10.14,1.97-15.25,2.65-2.37.31-8.03,1.12-7.34,4.69.46,2.36,2.26,4.16,4.08,5.6,2.66,2.11,5.44,4.09,8.33,5.88,1.87,1.15,3.85,2.11,5.6,3.44,1.74,1.33,3.15,3.05,3.58,5.25.22,1.16-.18,2.35-1,3.2-1.57,1.63-3,3.41-4.25,5.29-1.32,2.1-2.38,4.35-3.25,6.65-.59,1.44.97,2.98,2.41,2.37.53-.21,1.07-.41,1.61-.61,2.26-.82,4.68.73,4.93,3.12.17,1.61.38,3.17.63,4.57.46,2.57,3.14,3.63,5.32,1.41,2.84-2.88,4.66-6.31,7.84-8.86,2.53-2.03,6.26-4.17,9.71-3.59,3.17.56,6.27,1.52,9.23,2.85,5.32,2.32,10.36,5.29,14.95,8.86,9.17,7.1,16.56,16.51,21.27,27.1.93,2.07,4.03,1.44,4.1-.83.55-17.71-5.72-35.46-17.11-49.01-2.87-3.42-6.07-6.65-9.59-9.44-.88-.8-1.54-1.7-1.38-2.93.38-2.97,2-4.32,4.04-5.85,2.51-1.89,5.02-3.85,7.16-6.21.03-.03.06-.06.09-.1,1.24-1.37,2.38-2.83,3.4-4.37,1.2-1.81.6-4.26-1.3-5.31,0,0-.96-.52-1.45-.76-2.72-1.34-5.61-2.36-8.6-3.03-2.76-.62-5.58-.93-8.38-.93-2.38,0-4.76.22-7.09.67-1.96.37-3.97-.31-5.25-1.84-.28-.34-.54-.69-.79-1.04-.58-.84-1.09-1.71-1.63-2.58-1.29-2.06-1.87-3.63-2.89-5.84-1.06-2.29-1.85-4.73-3.26-6.86-.73-1.11-1.53-1.54-2.32-1.54s-1.54.41-2.24,1.02";
5
+ /** The path's bounding box: what to scale against when painting it. */
6
+ declare const RABBIT_MARK_BOX: {
7
+ readonly x: 14.4021;
8
+ readonly y: 11.93;
9
+ readonly w: 95.1813;
10
+ readonly h: 109.058;
11
+ };
12
+ declare function RabbitMark({ className }: {
13
+ className?: string;
14
+ }): react_jsx_runtime.JSX.Element;
15
+
16
+ export { RABBIT_MARK_BOX, RABBIT_MARK_PATH, RabbitMark };
@@ -0,0 +1,16 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ /** The rabbit silhouette, in the coordinate space of {@link RABBIT_MARK_BOX}. */
4
+ declare const RABBIT_MARK_PATH = "M49.71,46.83c0,.23.02.45.07.67,2.1.49,4.16,1.07,6.18,1.74.58-.64.94-1.48.94-2.42,0-1.98-1.61-3.59-3.59-3.59s-3.59,1.61-3.59,3.59M33.95,78.3c3.1-5.1,6.72-8.89,11.64-12.21.61-.42,1.24-.8,1.88-1.17.44-.25.61-.66.58-1.05,0-.53-.49-.91-.93-1.12-1.34-.62-2.72-1.5-4.06-2.54-1.57-1.22-3.01-2.59-4.36-4.06-.95-1.04-2.02-2.38-3-3.81-.81-1.18-.63-2.77.43-3.73,1.1-1,2.26-1.92,3.48-2.76.36-.25.72-.49,1.1-.73,2.43-1.55,5.05-2.79,7.79-3.7,3.23-1.07,6.62-1.66,10.03-1.74.59-.35,1.19-.69,1.8-1.01,1.66-.88,3.38-1.62,5.17-2.21,1.58-.54,3.2-.95,4.85-1.24,3.28-.59,6.64-.7,9.95-.32,1.23.14,2.45.34,3.68.62,2.87.64,5.59,1.62,8.09,2.9.54.27.71.95.36,1.45-1.58,2.22-3.46,4.25-5.5,6.05-3.01,2.65-6.51,4.75-10.26,6.17-2.32.88-4.75,1.53-7.22,1.91-.62.1-.78.9-.24,1.22,0,0,.01,0,.02.01,6.97,4.05,13.1,9.22,18.36,15.32.72.83,1.42,1.68,2.1,2.53,3.36,4.22,6.23,8.82,8.56,13.68,1.8,3.73,3.27,7.63,4.39,11.62.73,2.6,1.34,5.24,1.76,7.91.11.76-.87,1.16-1.3.53-1.15-1.69-2.31-3.35-3.61-4.93-1.2-1.46-2.46-2.86-3.75-4.24-5.44-5.8-11.84-10.7-18.84-14.48-7.32-3.94-15.09-6.38-23.44-6.53-2.23-.04-4.46.08-6.68.3-4.05.43-8.02,1.28-11.93,2.4-.03,0-.05.01-.08.02,0,0-.01,0-.02,0-.07.02-.14.03-.21.03-.53,0-.91-.6-.61-1.09M50.95,12.97c-1.31,1.16-2.2,2.71-2.9,4.29-1.66,3.74-2.85,7.74-3.52,11.77-.32,1.92-.56,3.87-1.28,5.69-.17.44-.37.87-.6,1.28-1.18,2.1-3.37,3.19-5.6,3.86-4.96,1.47-10.14,1.97-15.25,2.65-2.37.31-8.03,1.12-7.34,4.69.46,2.36,2.26,4.16,4.08,5.6,2.66,2.11,5.44,4.09,8.33,5.88,1.87,1.15,3.85,2.11,5.6,3.44,1.74,1.33,3.15,3.05,3.58,5.25.22,1.16-.18,2.35-1,3.2-1.57,1.63-3,3.41-4.25,5.29-1.32,2.1-2.38,4.35-3.25,6.65-.59,1.44.97,2.98,2.41,2.37.53-.21,1.07-.41,1.61-.61,2.26-.82,4.68.73,4.93,3.12.17,1.61.38,3.17.63,4.57.46,2.57,3.14,3.63,5.32,1.41,2.84-2.88,4.66-6.31,7.84-8.86,2.53-2.03,6.26-4.17,9.71-3.59,3.17.56,6.27,1.52,9.23,2.85,5.32,2.32,10.36,5.29,14.95,8.86,9.17,7.1,16.56,16.51,21.27,27.1.93,2.07,4.03,1.44,4.1-.83.55-17.71-5.72-35.46-17.11-49.01-2.87-3.42-6.07-6.65-9.59-9.44-.88-.8-1.54-1.7-1.38-2.93.38-2.97,2-4.32,4.04-5.85,2.51-1.89,5.02-3.85,7.16-6.21.03-.03.06-.06.09-.1,1.24-1.37,2.38-2.83,3.4-4.37,1.2-1.81.6-4.26-1.3-5.31,0,0-.96-.52-1.45-.76-2.72-1.34-5.61-2.36-8.6-3.03-2.76-.62-5.58-.93-8.38-.93-2.38,0-4.76.22-7.09.67-1.96.37-3.97-.31-5.25-1.84-.28-.34-.54-.69-.79-1.04-.58-.84-1.09-1.71-1.63-2.58-1.29-2.06-1.87-3.63-2.89-5.84-1.06-2.29-1.85-4.73-3.26-6.86-.73-1.11-1.53-1.54-2.32-1.54s-1.54.41-2.24,1.02";
5
+ /** The path's bounding box: what to scale against when painting it. */
6
+ declare const RABBIT_MARK_BOX: {
7
+ readonly x: 14.4021;
8
+ readonly y: 11.93;
9
+ readonly w: 95.1813;
10
+ readonly h: 109.058;
11
+ };
12
+ declare function RabbitMark({ className }: {
13
+ className?: string;
14
+ }): react_jsx_runtime.JSX.Element;
15
+
16
+ export { RABBIT_MARK_BOX, RABBIT_MARK_PATH, RabbitMark };
@@ -0,0 +1,26 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+
3
+ // src/rabbit-mark.tsx
4
+ var RABBIT_MARK_PATH = "M49.71,46.83c0,.23.02.45.07.67,2.1.49,4.16,1.07,6.18,1.74.58-.64.94-1.48.94-2.42,0-1.98-1.61-3.59-3.59-3.59s-3.59,1.61-3.59,3.59M33.95,78.3c3.1-5.1,6.72-8.89,11.64-12.21.61-.42,1.24-.8,1.88-1.17.44-.25.61-.66.58-1.05,0-.53-.49-.91-.93-1.12-1.34-.62-2.72-1.5-4.06-2.54-1.57-1.22-3.01-2.59-4.36-4.06-.95-1.04-2.02-2.38-3-3.81-.81-1.18-.63-2.77.43-3.73,1.1-1,2.26-1.92,3.48-2.76.36-.25.72-.49,1.1-.73,2.43-1.55,5.05-2.79,7.79-3.7,3.23-1.07,6.62-1.66,10.03-1.74.59-.35,1.19-.69,1.8-1.01,1.66-.88,3.38-1.62,5.17-2.21,1.58-.54,3.2-.95,4.85-1.24,3.28-.59,6.64-.7,9.95-.32,1.23.14,2.45.34,3.68.62,2.87.64,5.59,1.62,8.09,2.9.54.27.71.95.36,1.45-1.58,2.22-3.46,4.25-5.5,6.05-3.01,2.65-6.51,4.75-10.26,6.17-2.32.88-4.75,1.53-7.22,1.91-.62.1-.78.9-.24,1.22,0,0,.01,0,.02.01,6.97,4.05,13.1,9.22,18.36,15.32.72.83,1.42,1.68,2.1,2.53,3.36,4.22,6.23,8.82,8.56,13.68,1.8,3.73,3.27,7.63,4.39,11.62.73,2.6,1.34,5.24,1.76,7.91.11.76-.87,1.16-1.3.53-1.15-1.69-2.31-3.35-3.61-4.93-1.2-1.46-2.46-2.86-3.75-4.24-5.44-5.8-11.84-10.7-18.84-14.48-7.32-3.94-15.09-6.38-23.44-6.53-2.23-.04-4.46.08-6.68.3-4.05.43-8.02,1.28-11.93,2.4-.03,0-.05.01-.08.02,0,0-.01,0-.02,0-.07.02-.14.03-.21.03-.53,0-.91-.6-.61-1.09M50.95,12.97c-1.31,1.16-2.2,2.71-2.9,4.29-1.66,3.74-2.85,7.74-3.52,11.77-.32,1.92-.56,3.87-1.28,5.69-.17.44-.37.87-.6,1.28-1.18,2.1-3.37,3.19-5.6,3.86-4.96,1.47-10.14,1.97-15.25,2.65-2.37.31-8.03,1.12-7.34,4.69.46,2.36,2.26,4.16,4.08,5.6,2.66,2.11,5.44,4.09,8.33,5.88,1.87,1.15,3.85,2.11,5.6,3.44,1.74,1.33,3.15,3.05,3.58,5.25.22,1.16-.18,2.35-1,3.2-1.57,1.63-3,3.41-4.25,5.29-1.32,2.1-2.38,4.35-3.25,6.65-.59,1.44.97,2.98,2.41,2.37.53-.21,1.07-.41,1.61-.61,2.26-.82,4.68.73,4.93,3.12.17,1.61.38,3.17.63,4.57.46,2.57,3.14,3.63,5.32,1.41,2.84-2.88,4.66-6.31,7.84-8.86,2.53-2.03,6.26-4.17,9.71-3.59,3.17.56,6.27,1.52,9.23,2.85,5.32,2.32,10.36,5.29,14.95,8.86,9.17,7.1,16.56,16.51,21.27,27.1.93,2.07,4.03,1.44,4.1-.83.55-17.71-5.72-35.46-17.11-49.01-2.87-3.42-6.07-6.65-9.59-9.44-.88-.8-1.54-1.7-1.38-2.93.38-2.97,2-4.32,4.04-5.85,2.51-1.89,5.02-3.85,7.16-6.21.03-.03.06-.06.09-.1,1.24-1.37,2.38-2.83,3.4-4.37,1.2-1.81.6-4.26-1.3-5.31,0,0-.96-.52-1.45-.76-2.72-1.34-5.61-2.36-8.6-3.03-2.76-.62-5.58-.93-8.38-.93-2.38,0-4.76.22-7.09.67-1.96.37-3.97-.31-5.25-1.84-.28-.34-.54-.69-.79-1.04-.58-.84-1.09-1.71-1.63-2.58-1.29-2.06-1.87-3.63-2.89-5.84-1.06-2.29-1.85-4.73-3.26-6.86-.73-1.11-1.53-1.54-2.32-1.54s-1.54.41-2.24,1.02";
5
+ var RABBIT_MARK_BOX = {
6
+ x: 14.4021,
7
+ y: 11.93,
8
+ w: 95.1813,
9
+ h: 109.058
10
+ };
11
+ function RabbitMark({ className }) {
12
+ return /* @__PURE__ */ jsx(
13
+ "svg",
14
+ {
15
+ className,
16
+ viewBox: "14.4021 11.93 95.1813 109.058",
17
+ fill: "currentColor",
18
+ "aria-hidden": "true",
19
+ children: /* @__PURE__ */ jsx("path", { d: RABBIT_MARK_PATH })
20
+ }
21
+ );
22
+ }
23
+
24
+ export { RABBIT_MARK_BOX, RABBIT_MARK_PATH, RabbitMark };
25
+ //# sourceMappingURL=rabbit-mark.js.map
26
+ //# sourceMappingURL=rabbit-mark.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/rabbit-mark.tsx"],"names":[],"mappings":";;;AAeO,IAAM,gBAAA,GACX;AAGK,IAAM,eAAA,GAAkB;AAAA,EAC7B,CAAA,EAAG,OAAA;AAAA,EACH,CAAA,EAAG,KAAA;AAAA,EACH,CAAA,EAAG,OAAA;AAAA,EACH,CAAA,EAAG;AACL;AAEO,SAAS,UAAA,CAAW,EAAE,SAAA,EAAU,EAA2B;AAChE,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,SAAA;AAAA,MACA,OAAA,EAAQ,+BAAA;AAAA,MACR,IAAA,EAAK,cAAA;AAAA,MACL,aAAA,EAAY,MAAA;AAAA,MAEZ,QAAA,kBAAA,GAAA,CAAC,MAAA,EAAA,EAAK,CAAA,EAAG,gBAAA,EAAkB;AAAA;AAAA,GAC7B;AAEJ","file":"rabbit-mark.js","sourcesContent":["// Copyright (c) 2026, Invergent SA, developed by Flavius Burca\n// SPDX-License-Identifier: AGPL-3.0-only\n//\n// The Surogate rabbit, as one path.\n//\n// Lifted from the brand favicon and stripped to the silhouette: the\n// circle, the amber ground and the registered mark all belong to the\n// full lockup, not to a 16px glyph. The viewBox is the path's own\n// bounding box, so the mark fills whatever box it is given the way a\n// lucide icon does, and `currentColor` lets it inherit like one too.\n//\n// The path is exported on its own because the whiteboard also paints\n// it onto a canvas, where there is no DOM to render an `<svg>` into.\n\n/** The rabbit silhouette, in the coordinate space of {@link RABBIT_MARK_BOX}. */\nexport const RABBIT_MARK_PATH =\n \"M49.71,46.83c0,.23.02.45.07.67,2.1.49,4.16,1.07,6.18,1.74.58-.64.94-1.48.94-2.42,0-1.98-1.61-3.59-3.59-3.59s-3.59,1.61-3.59,3.59M33.95,78.3c3.1-5.1,6.72-8.89,11.64-12.21.61-.42,1.24-.8,1.88-1.17.44-.25.61-.66.58-1.05,0-.53-.49-.91-.93-1.12-1.34-.62-2.72-1.5-4.06-2.54-1.57-1.22-3.01-2.59-4.36-4.06-.95-1.04-2.02-2.38-3-3.81-.81-1.18-.63-2.77.43-3.73,1.1-1,2.26-1.92,3.48-2.76.36-.25.72-.49,1.1-.73,2.43-1.55,5.05-2.79,7.79-3.7,3.23-1.07,6.62-1.66,10.03-1.74.59-.35,1.19-.69,1.8-1.01,1.66-.88,3.38-1.62,5.17-2.21,1.58-.54,3.2-.95,4.85-1.24,3.28-.59,6.64-.7,9.95-.32,1.23.14,2.45.34,3.68.62,2.87.64,5.59,1.62,8.09,2.9.54.27.71.95.36,1.45-1.58,2.22-3.46,4.25-5.5,6.05-3.01,2.65-6.51,4.75-10.26,6.17-2.32.88-4.75,1.53-7.22,1.91-.62.1-.78.9-.24,1.22,0,0,.01,0,.02.01,6.97,4.05,13.1,9.22,18.36,15.32.72.83,1.42,1.68,2.1,2.53,3.36,4.22,6.23,8.82,8.56,13.68,1.8,3.73,3.27,7.63,4.39,11.62.73,2.6,1.34,5.24,1.76,7.91.11.76-.87,1.16-1.3.53-1.15-1.69-2.31-3.35-3.61-4.93-1.2-1.46-2.46-2.86-3.75-4.24-5.44-5.8-11.84-10.7-18.84-14.48-7.32-3.94-15.09-6.38-23.44-6.53-2.23-.04-4.46.08-6.68.3-4.05.43-8.02,1.28-11.93,2.4-.03,0-.05.01-.08.02,0,0-.01,0-.02,0-.07.02-.14.03-.21.03-.53,0-.91-.6-.61-1.09M50.95,12.97c-1.31,1.16-2.2,2.71-2.9,4.29-1.66,3.74-2.85,7.74-3.52,11.77-.32,1.92-.56,3.87-1.28,5.69-.17.44-.37.87-.6,1.28-1.18,2.1-3.37,3.19-5.6,3.86-4.96,1.47-10.14,1.97-15.25,2.65-2.37.31-8.03,1.12-7.34,4.69.46,2.36,2.26,4.16,4.08,5.6,2.66,2.11,5.44,4.09,8.33,5.88,1.87,1.15,3.85,2.11,5.6,3.44,1.74,1.33,3.15,3.05,3.58,5.25.22,1.16-.18,2.35-1,3.2-1.57,1.63-3,3.41-4.25,5.29-1.32,2.1-2.38,4.35-3.25,6.65-.59,1.44.97,2.98,2.41,2.37.53-.21,1.07-.41,1.61-.61,2.26-.82,4.68.73,4.93,3.12.17,1.61.38,3.17.63,4.57.46,2.57,3.14,3.63,5.32,1.41,2.84-2.88,4.66-6.31,7.84-8.86,2.53-2.03,6.26-4.17,9.71-3.59,3.17.56,6.27,1.52,9.23,2.85,5.32,2.32,10.36,5.29,14.95,8.86,9.17,7.1,16.56,16.51,21.27,27.1.93,2.07,4.03,1.44,4.1-.83.55-17.71-5.72-35.46-17.11-49.01-2.87-3.42-6.07-6.65-9.59-9.44-.88-.8-1.54-1.7-1.38-2.93.38-2.97,2-4.32,4.04-5.85,2.51-1.89,5.02-3.85,7.16-6.21.03-.03.06-.06.09-.1,1.24-1.37,2.38-2.83,3.4-4.37,1.2-1.81.6-4.26-1.3-5.31,0,0-.96-.52-1.45-.76-2.72-1.34-5.61-2.36-8.6-3.03-2.76-.62-5.58-.93-8.38-.93-2.38,0-4.76.22-7.09.67-1.96.37-3.97-.31-5.25-1.84-.28-.34-.54-.69-.79-1.04-.58-.84-1.09-1.71-1.63-2.58-1.29-2.06-1.87-3.63-2.89-5.84-1.06-2.29-1.85-4.73-3.26-6.86-.73-1.11-1.53-1.54-2.32-1.54s-1.54.41-2.24,1.02\";\n\n/** The path's bounding box: what to scale against when painting it. */\nexport const RABBIT_MARK_BOX = {\n x: 14.4021,\n y: 11.93,\n w: 95.1813,\n h: 109.058,\n} as const;\n\nexport function RabbitMark({ className }: { className?: string }) {\n return (\n <svg\n className={className}\n viewBox=\"14.4021 11.93 95.1813 109.058\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path d={RABBIT_MARK_PATH} />\n </svg>\n );\n}\n"]}
@@ -0,0 +1,85 @@
1
+ 'use strict';
2
+
3
+ var chunkUXSDDJXM_cjs = require('./chunk-UXSDDJXM.cjs');
4
+ var chunk6YHDDRIM_cjs = require('./chunk-6YHDDRIM.cjs');
5
+ var radixUi = require('radix-ui');
6
+ var react = require('react');
7
+ var jsxRuntime = require('react/jsx-runtime');
8
+
9
+ var MOBILE_QUERY = "(max-width: 767px)";
10
+ function subscribe(onChange) {
11
+ const mql = window.matchMedia(MOBILE_QUERY);
12
+ mql.addEventListener("change", onChange);
13
+ return () => mql.removeEventListener("change", onChange);
14
+ }
15
+ function useIsMobile() {
16
+ return react.useSyncExternalStore(
17
+ subscribe,
18
+ () => window.matchMedia(MOBILE_QUERY).matches,
19
+ // No viewport when server-rendered; assume desktop, as the components do.
20
+ () => false
21
+ );
22
+ }
23
+ function ResponsivePanel({
24
+ open,
25
+ onOpenChange,
26
+ trigger,
27
+ title,
28
+ children,
29
+ align = "start",
30
+ popoverClassName
31
+ }) {
32
+ const isMobile = useIsMobile();
33
+ if (!isMobile) {
34
+ return /* @__PURE__ */ jsxRuntime.jsxs(chunkUXSDDJXM_cjs.Popover, { open, onOpenChange, children: [
35
+ /* @__PURE__ */ jsxRuntime.jsx(chunkUXSDDJXM_cjs.PopoverTrigger, { asChild: true, children: trigger }),
36
+ /* @__PURE__ */ jsxRuntime.jsx(
37
+ chunkUXSDDJXM_cjs.PopoverContent,
38
+ {
39
+ side: "top",
40
+ align,
41
+ className: chunk6YHDDRIM_cjs.cn("w-64 overflow-hidden rounded-xl p-1", popoverClassName),
42
+ children
43
+ }
44
+ )
45
+ ] });
46
+ }
47
+ return /* @__PURE__ */ jsxRuntime.jsxs(radixUi.Dialog.Root, { open, onOpenChange, children: [
48
+ /* @__PURE__ */ jsxRuntime.jsx(radixUi.Dialog.Trigger, { asChild: true, children: trigger }),
49
+ /* @__PURE__ */ jsxRuntime.jsxs(radixUi.Dialog.Portal, { children: [
50
+ /* @__PURE__ */ jsxRuntime.jsx(
51
+ radixUi.Dialog.Overlay,
52
+ {
53
+ "data-slot": "responsive-panel-overlay",
54
+ className: "fixed inset-0 z-50 bg-black/40 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0"
55
+ }
56
+ ),
57
+ /* @__PURE__ */ jsxRuntime.jsxs(
58
+ radixUi.Dialog.Content,
59
+ {
60
+ "data-slot": "responsive-panel-sheet",
61
+ "aria-describedby": void 0,
62
+ className: chunk6YHDDRIM_cjs.cn(
63
+ "fixed inset-x-0 bottom-0 z-50 flex max-h-[80svh] flex-col overflow-hidden rounded-t-2xl border-t border-border bg-popover pb-[env(safe-area-inset-bottom)] text-popover-foreground shadow-lg",
64
+ "data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom data-[state=open]:animate-in data-[state=open]:slide-in-from-bottom"
65
+ ),
66
+ children: [
67
+ /* @__PURE__ */ jsxRuntime.jsx(radixUi.Dialog.Title, { className: "sr-only", children: title }),
68
+ /* @__PURE__ */ jsxRuntime.jsx(
69
+ "div",
70
+ {
71
+ "aria-hidden": "true",
72
+ className: "mx-auto mt-2.5 mb-1 h-1 w-9 shrink-0 rounded-full bg-muted-foreground/30"
73
+ }
74
+ ),
75
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-h-0 flex-1 overflow-y-auto overscroll-contain p-1", children })
76
+ ]
77
+ }
78
+ )
79
+ ] })
80
+ ] });
81
+ }
82
+
83
+ exports.ResponsivePanel = ResponsivePanel;
84
+ //# sourceMappingURL=responsive-panel.cjs.map
85
+ //# sourceMappingURL=responsive-panel.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/lib/use-is-mobile.ts","../src/responsive-panel.tsx"],"names":["useSyncExternalStore","jsxs","Popover","jsx","PopoverTrigger","PopoverContent","cn","DialogPrimitive"],"mappings":";;;;;;;;AAQA,IAAM,YAAA,GAAe,oBAAA;AAOrB,SAAS,UAAU,QAAA,EAAkC;AACnD,EAAA,MAAM,GAAA,GAAM,MAAA,CAAO,UAAA,CAAW,YAAY,CAAA;AAC1C,EAAA,GAAA,CAAI,gBAAA,CAAiB,UAAU,QAAQ,CAAA;AACvC,EAAA,OAAO,MAAM,GAAA,CAAI,mBAAA,CAAoB,QAAA,EAAU,QAAQ,CAAA;AACzD;AASO,SAAS,WAAA,GAAuB;AACrC,EAAA,OAAOA,0BAAA;AAAA,IACL,SAAA;AAAA,IACA,MAAM,MAAA,CAAO,UAAA,CAAW,YAAY,CAAA,CAAE,OAAA;AAAA;AAAA,IAEtC,MAAM;AAAA,GACR;AACF;ACUO,SAAS,eAAA,CAAgB;AAAA,EAC9B,IAAA;AAAA,EACA,YAAA;AAAA,EACA,OAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EACA,KAAA,GAAQ,OAAA;AAAA,EACR;AACF,CAAA,EAAyB;AACvB,EAAA,MAAM,WAAW,WAAA,EAAY;AAE7B,EAAA,IAAI,CAAC,QAAA,EAAU;AACb,IAAA,uBACEC,eAAA,CAACC,yBAAA,EAAA,EAAQ,IAAA,EAAY,YAAA,EACnB,QAAA,EAAA;AAAA,sBAAAC,cAAA,CAACC,gCAAA,EAAA,EAAe,OAAA,EAAO,IAAA,EAAE,QAAA,EAAA,OAAA,EAAQ,CAAA;AAAA,sBACjCD,cAAA;AAAA,QAACE,gCAAA;AAAA,QAAA;AAAA,UACC,IAAA,EAAK,KAAA;AAAA,UACL,KAAA;AAAA,UACA,SAAA,EAAWC,oBAAA,CAAG,qCAAA,EAAuC,gBAAgB,CAAA;AAAA,UAEpE;AAAA;AAAA;AACH,KAAA,EACF,CAAA;AAAA,EAEJ;AAEA,EAAA,uBACEL,eAAA,CAACM,cAAA,CAAgB,IAAA,EAAhB,EAAqB,MAAY,YAAA,EAChC,QAAA,EAAA;AAAA,oBAAAJ,cAAA,CAACI,cAAA,CAAgB,OAAA,EAAhB,EAAwB,OAAA,EAAO,MAAE,QAAA,EAAA,OAAA,EAAQ,CAAA;AAAA,oBAC1CN,eAAA,CAACM,cAAA,CAAgB,MAAA,EAAhB,EACC,QAAA,EAAA;AAAA,sBAAAJ,cAAA;AAAA,QAACI,cAAA,CAAgB,OAAA;AAAA,QAAhB;AAAA,UACC,WAAA,EAAU,0BAAA;AAAA,UACV,SAAA,EAAU;AAAA;AAAA,OACZ;AAAA,sBACAN,eAAA;AAAA,QAACM,cAAA,CAAgB,OAAA;AAAA,QAAhB;AAAA,UACC,WAAA,EAAU,wBAAA;AAAA,UACV,kBAAA,EAAkB,MAAA;AAAA,UAClB,SAAA,EAAWD,oBAAA;AAAA,YACT,8LAAA;AAAA,YACA;AAAA,WACF;AAAA,UAEA,QAAA,EAAA;AAAA,4BAAAH,cAAA,CAACI,cAAA,CAAgB,KAAA,EAAhB,EAAsB,SAAA,EAAU,WAC9B,QAAA,EAAA,KAAA,EACH,CAAA;AAAA,4BAIAJ,cAAA;AAAA,cAAC,KAAA;AAAA,cAAA;AAAA,gBACC,aAAA,EAAY,MAAA;AAAA,gBACZ,SAAA,EAAU;AAAA;AAAA,aACZ;AAAA,4BACAA,cAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,uDAAA,EACZ,QAAA,EACH;AAAA;AAAA;AAAA;AACF,KAAA,EACF;AAAA,GAAA,EACF,CAAA;AAEJ","file":"responsive-panel.cjs","sourcesContent":["import { useSyncExternalStore } from \"react\";\n\n/**\n * The `md` breakpoint, matching the Tailwind default the components'\n * responsive classes use. Anything that needs to *render* differently on a\n * phone (rather than just restyle) reads this; a media query alone cannot\n * swap a popover for a sheet, because they are different components.\n */\nconst MOBILE_QUERY = \"(max-width: 767px)\";\n\n// Deliberately not caching the MediaQueryList across calls. getSnapshot does\n// run per render, but matchMedia is ~1µs and a module-level cache would pin\n// the first `window.matchMedia` this module ever saw — which makes the hook\n// untestable by stubbing it, and the sheet branch is only reachable in tests\n// that way. Not a trade worth making for a cost that does not register.\nfunction subscribe(onChange: () => void): () => void {\n const mql = window.matchMedia(MOBILE_QUERY);\n mql.addEventListener(\"change\", onChange);\n return () => mql.removeEventListener(\"change\", onChange);\n}\n\n/**\n * True while the viewport is narrower than `md`.\n *\n * Reads synchronously on the first render rather than filling in from an\n * effect: a value that says \"desktop\" for one frame is invisible for a class\n * name and wrong for anything that decides *which component to mount*.\n */\nexport function useIsMobile(): boolean {\n return useSyncExternalStore(\n subscribe,\n () => window.matchMedia(MOBILE_QUERY).matches,\n // No viewport when server-rendered; assume desktop, as the components do.\n () => false,\n );\n}\n","// A panel that is a popover with a cursor and a bottom sheet on a phone.\n//\n// The composer's secondary controls (tools, session context) open panels that\n// are anchored above a ~32px button. That is right on a desktop and wrong on a\n// phone: an anchored popover near the bottom of the screen has nowhere to go,\n// its content is capped by whatever space is left above the composer, and the\n// whole thing sits under the thumb that opened it. A sheet rising from the\n// bottom edge has the full width, as much height as it needs, and lands where\n// the hand already is.\n//\n// The two are different components, not one component with different classes,\n// so the choice is made in JS — see useIsMobile.\n\nimport { Dialog as DialogPrimitive } from \"radix-ui\";\nimport type { ComponentProps, ReactNode } from \"react\";\nimport { useIsMobile } from \"./lib/use-is-mobile\";\nimport { cn } from \"./lib/utils\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"./popover\";\n\nexport interface ResponsivePanelProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n /** The control that opens the panel. Rendered as the trigger in both forms. */\n trigger: ReactNode;\n /**\n * Names the sheet for screen readers. Radix Dialog requires an accessible\n * name; it is visually hidden, since the panel's own contents are labelled.\n */\n title: string;\n children: ReactNode;\n /** Popover-only; the sheet is always full width. */\n align?: ComponentProps<typeof PopoverContent>[\"align\"];\n /**\n * Styling for the popover form only.\n *\n * Deliberately not a shared `className`: `cn` is tailwind-merge, so a class\n * written for the popover silently deletes a conflicting one from the\n * sheet's own base list. `p-0` and `pb-[env(safe-area-inset-bottom)]` are\n * the same conflict group, so passing the popover's `p-0` through dropped\n * the sheet's home-indicator inset — and a `divide-y` meant for the\n * popover's sections drew a rule under the sheet's grab handle instead.\n */\n popoverClassName?: string;\n}\n\nexport function ResponsivePanel({\n open,\n onOpenChange,\n trigger,\n title,\n children,\n align = \"start\",\n popoverClassName,\n}: ResponsivePanelProps) {\n const isMobile = useIsMobile();\n\n if (!isMobile) {\n return (\n <Popover open={open} onOpenChange={onOpenChange}>\n <PopoverTrigger asChild>{trigger}</PopoverTrigger>\n <PopoverContent\n side=\"top\"\n align={align}\n className={cn(\"w-64 overflow-hidden rounded-xl p-1\", popoverClassName)}\n >\n {children}\n </PopoverContent>\n </Popover>\n );\n }\n\n return (\n <DialogPrimitive.Root open={open} onOpenChange={onOpenChange}>\n <DialogPrimitive.Trigger asChild>{trigger}</DialogPrimitive.Trigger>\n <DialogPrimitive.Portal>\n <DialogPrimitive.Overlay\n data-slot=\"responsive-panel-overlay\"\n className=\"fixed inset-0 z-50 bg-black/40 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0\"\n />\n <DialogPrimitive.Content\n data-slot=\"responsive-panel-sheet\"\n aria-describedby={undefined}\n className={cn(\n \"fixed inset-x-0 bottom-0 z-50 flex max-h-[80svh] flex-col overflow-hidden rounded-t-2xl border-t border-border bg-popover pb-[env(safe-area-inset-bottom)] text-popover-foreground shadow-lg\",\n \"data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom data-[state=open]:animate-in data-[state=open]:slide-in-from-bottom\",\n )}\n >\n <DialogPrimitive.Title className=\"sr-only\">\n {title}\n </DialogPrimitive.Title>\n {/* Not draggable — Radix has no drag gesture and the sheet is short\n enough that a grab bar would only promise one. It reads as the\n handle the shape implies while staying purely decorative. */}\n <div\n aria-hidden=\"true\"\n className=\"mx-auto mt-2.5 mb-1 h-1 w-9 shrink-0 rounded-full bg-muted-foreground/30\"\n />\n <div className=\"min-h-0 flex-1 overflow-y-auto overscroll-contain p-1\">\n {children}\n </div>\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n </DialogPrimitive.Root>\n );\n}\n"]}
@@ -0,0 +1,33 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode, ComponentProps } from 'react';
3
+ import { PopoverContent } from './popover.cjs';
4
+ import 'radix-ui';
5
+
6
+ interface ResponsivePanelProps {
7
+ open: boolean;
8
+ onOpenChange: (open: boolean) => void;
9
+ /** The control that opens the panel. Rendered as the trigger in both forms. */
10
+ trigger: ReactNode;
11
+ /**
12
+ * Names the sheet for screen readers. Radix Dialog requires an accessible
13
+ * name; it is visually hidden, since the panel's own contents are labelled.
14
+ */
15
+ title: string;
16
+ children: ReactNode;
17
+ /** Popover-only; the sheet is always full width. */
18
+ align?: ComponentProps<typeof PopoverContent>["align"];
19
+ /**
20
+ * Styling for the popover form only.
21
+ *
22
+ * Deliberately not a shared `className`: `cn` is tailwind-merge, so a class
23
+ * written for the popover silently deletes a conflicting one from the
24
+ * sheet's own base list. `p-0` and `pb-[env(safe-area-inset-bottom)]` are
25
+ * the same conflict group, so passing the popover's `p-0` through dropped
26
+ * the sheet's home-indicator inset — and a `divide-y` meant for the
27
+ * popover's sections drew a rule under the sheet's grab handle instead.
28
+ */
29
+ popoverClassName?: string;
30
+ }
31
+ declare function ResponsivePanel({ open, onOpenChange, trigger, title, children, align, popoverClassName, }: ResponsivePanelProps): react_jsx_runtime.JSX.Element;
32
+
33
+ export { ResponsivePanel, type ResponsivePanelProps };
@@ -0,0 +1,33 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode, ComponentProps } from 'react';
3
+ import { PopoverContent } from './popover.js';
4
+ import 'radix-ui';
5
+
6
+ interface ResponsivePanelProps {
7
+ open: boolean;
8
+ onOpenChange: (open: boolean) => void;
9
+ /** The control that opens the panel. Rendered as the trigger in both forms. */
10
+ trigger: ReactNode;
11
+ /**
12
+ * Names the sheet for screen readers. Radix Dialog requires an accessible
13
+ * name; it is visually hidden, since the panel's own contents are labelled.
14
+ */
15
+ title: string;
16
+ children: ReactNode;
17
+ /** Popover-only; the sheet is always full width. */
18
+ align?: ComponentProps<typeof PopoverContent>["align"];
19
+ /**
20
+ * Styling for the popover form only.
21
+ *
22
+ * Deliberately not a shared `className`: `cn` is tailwind-merge, so a class
23
+ * written for the popover silently deletes a conflicting one from the
24
+ * sheet's own base list. `p-0` and `pb-[env(safe-area-inset-bottom)]` are
25
+ * the same conflict group, so passing the popover's `p-0` through dropped
26
+ * the sheet's home-indicator inset — and a `divide-y` meant for the
27
+ * popover's sections drew a rule under the sheet's grab handle instead.
28
+ */
29
+ popoverClassName?: string;
30
+ }
31
+ declare function ResponsivePanel({ open, onOpenChange, trigger, title, children, align, popoverClassName, }: ResponsivePanelProps): react_jsx_runtime.JSX.Element;
32
+
33
+ export { ResponsivePanel, type ResponsivePanelProps };
@@ -0,0 +1,83 @@
1
+ import { Popover, PopoverTrigger, PopoverContent } from './chunk-NSK344BJ.js';
2
+ import { cn } from './chunk-LZGII7SX.js';
3
+ import { Dialog } from 'radix-ui';
4
+ import { useSyncExternalStore } from 'react';
5
+ import { jsxs, jsx } from 'react/jsx-runtime';
6
+
7
+ var MOBILE_QUERY = "(max-width: 767px)";
8
+ function subscribe(onChange) {
9
+ const mql = window.matchMedia(MOBILE_QUERY);
10
+ mql.addEventListener("change", onChange);
11
+ return () => mql.removeEventListener("change", onChange);
12
+ }
13
+ function useIsMobile() {
14
+ return useSyncExternalStore(
15
+ subscribe,
16
+ () => window.matchMedia(MOBILE_QUERY).matches,
17
+ // No viewport when server-rendered; assume desktop, as the components do.
18
+ () => false
19
+ );
20
+ }
21
+ function ResponsivePanel({
22
+ open,
23
+ onOpenChange,
24
+ trigger,
25
+ title,
26
+ children,
27
+ align = "start",
28
+ popoverClassName
29
+ }) {
30
+ const isMobile = useIsMobile();
31
+ if (!isMobile) {
32
+ return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange, children: [
33
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: trigger }),
34
+ /* @__PURE__ */ jsx(
35
+ PopoverContent,
36
+ {
37
+ side: "top",
38
+ align,
39
+ className: cn("w-64 overflow-hidden rounded-xl p-1", popoverClassName),
40
+ children
41
+ }
42
+ )
43
+ ] });
44
+ }
45
+ return /* @__PURE__ */ jsxs(Dialog.Root, { open, onOpenChange, children: [
46
+ /* @__PURE__ */ jsx(Dialog.Trigger, { asChild: true, children: trigger }),
47
+ /* @__PURE__ */ jsxs(Dialog.Portal, { children: [
48
+ /* @__PURE__ */ jsx(
49
+ Dialog.Overlay,
50
+ {
51
+ "data-slot": "responsive-panel-overlay",
52
+ className: "fixed inset-0 z-50 bg-black/40 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0"
53
+ }
54
+ ),
55
+ /* @__PURE__ */ jsxs(
56
+ Dialog.Content,
57
+ {
58
+ "data-slot": "responsive-panel-sheet",
59
+ "aria-describedby": void 0,
60
+ className: cn(
61
+ "fixed inset-x-0 bottom-0 z-50 flex max-h-[80svh] flex-col overflow-hidden rounded-t-2xl border-t border-border bg-popover pb-[env(safe-area-inset-bottom)] text-popover-foreground shadow-lg",
62
+ "data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom data-[state=open]:animate-in data-[state=open]:slide-in-from-bottom"
63
+ ),
64
+ children: [
65
+ /* @__PURE__ */ jsx(Dialog.Title, { className: "sr-only", children: title }),
66
+ /* @__PURE__ */ jsx(
67
+ "div",
68
+ {
69
+ "aria-hidden": "true",
70
+ className: "mx-auto mt-2.5 mb-1 h-1 w-9 shrink-0 rounded-full bg-muted-foreground/30"
71
+ }
72
+ ),
73
+ /* @__PURE__ */ jsx("div", { className: "min-h-0 flex-1 overflow-y-auto overscroll-contain p-1", children })
74
+ ]
75
+ }
76
+ )
77
+ ] })
78
+ ] });
79
+ }
80
+
81
+ export { ResponsivePanel };
82
+ //# sourceMappingURL=responsive-panel.js.map
83
+ //# sourceMappingURL=responsive-panel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/lib/use-is-mobile.ts","../src/responsive-panel.tsx"],"names":["DialogPrimitive"],"mappings":";;;;;;AAQA,IAAM,YAAA,GAAe,oBAAA;AAOrB,SAAS,UAAU,QAAA,EAAkC;AACnD,EAAA,MAAM,GAAA,GAAM,MAAA,CAAO,UAAA,CAAW,YAAY,CAAA;AAC1C,EAAA,GAAA,CAAI,gBAAA,CAAiB,UAAU,QAAQ,CAAA;AACvC,EAAA,OAAO,MAAM,GAAA,CAAI,mBAAA,CAAoB,QAAA,EAAU,QAAQ,CAAA;AACzD;AASO,SAAS,WAAA,GAAuB;AACrC,EAAA,OAAO,oBAAA;AAAA,IACL,SAAA;AAAA,IACA,MAAM,MAAA,CAAO,UAAA,CAAW,YAAY,CAAA,CAAE,OAAA;AAAA;AAAA,IAEtC,MAAM;AAAA,GACR;AACF;ACUO,SAAS,eAAA,CAAgB;AAAA,EAC9B,IAAA;AAAA,EACA,YAAA;AAAA,EACA,OAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EACA,KAAA,GAAQ,OAAA;AAAA,EACR;AACF,CAAA,EAAyB;AACvB,EAAA,MAAM,WAAW,WAAA,EAAY;AAE7B,EAAA,IAAI,CAAC,QAAA,EAAU;AACb,IAAA,uBACE,IAAA,CAAC,OAAA,EAAA,EAAQ,IAAA,EAAY,YAAA,EACnB,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,cAAA,EAAA,EAAe,OAAA,EAAO,IAAA,EAAE,QAAA,EAAA,OAAA,EAAQ,CAAA;AAAA,sBACjC,GAAA;AAAA,QAAC,cAAA;AAAA,QAAA;AAAA,UACC,IAAA,EAAK,KAAA;AAAA,UACL,KAAA;AAAA,UACA,SAAA,EAAW,EAAA,CAAG,qCAAA,EAAuC,gBAAgB,CAAA;AAAA,UAEpE;AAAA;AAAA;AACH,KAAA,EACF,CAAA;AAAA,EAEJ;AAEA,EAAA,uBACE,IAAA,CAACA,MAAA,CAAgB,IAAA,EAAhB,EAAqB,MAAY,YAAA,EAChC,QAAA,EAAA;AAAA,oBAAA,GAAA,CAACA,MAAA,CAAgB,OAAA,EAAhB,EAAwB,OAAA,EAAO,MAAE,QAAA,EAAA,OAAA,EAAQ,CAAA;AAAA,oBAC1C,IAAA,CAACA,MAAA,CAAgB,MAAA,EAAhB,EACC,QAAA,EAAA;AAAA,sBAAA,GAAA;AAAA,QAACA,MAAA,CAAgB,OAAA;AAAA,QAAhB;AAAA,UACC,WAAA,EAAU,0BAAA;AAAA,UACV,SAAA,EAAU;AAAA;AAAA,OACZ;AAAA,sBACA,IAAA;AAAA,QAACA,MAAA,CAAgB,OAAA;AAAA,QAAhB;AAAA,UACC,WAAA,EAAU,wBAAA;AAAA,UACV,kBAAA,EAAkB,MAAA;AAAA,UAClB,SAAA,EAAW,EAAA;AAAA,YACT,8LAAA;AAAA,YACA;AAAA,WACF;AAAA,UAEA,QAAA,EAAA;AAAA,4BAAA,GAAA,CAACA,MAAA,CAAgB,KAAA,EAAhB,EAAsB,SAAA,EAAU,WAC9B,QAAA,EAAA,KAAA,EACH,CAAA;AAAA,4BAIA,GAAA;AAAA,cAAC,KAAA;AAAA,cAAA;AAAA,gBACC,aAAA,EAAY,MAAA;AAAA,gBACZ,SAAA,EAAU;AAAA;AAAA,aACZ;AAAA,4BACA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,uDAAA,EACZ,QAAA,EACH;AAAA;AAAA;AAAA;AACF,KAAA,EACF;AAAA,GAAA,EACF,CAAA;AAEJ","file":"responsive-panel.js","sourcesContent":["import { useSyncExternalStore } from \"react\";\n\n/**\n * The `md` breakpoint, matching the Tailwind default the components'\n * responsive classes use. Anything that needs to *render* differently on a\n * phone (rather than just restyle) reads this; a media query alone cannot\n * swap a popover for a sheet, because they are different components.\n */\nconst MOBILE_QUERY = \"(max-width: 767px)\";\n\n// Deliberately not caching the MediaQueryList across calls. getSnapshot does\n// run per render, but matchMedia is ~1µs and a module-level cache would pin\n// the first `window.matchMedia` this module ever saw — which makes the hook\n// untestable by stubbing it, and the sheet branch is only reachable in tests\n// that way. Not a trade worth making for a cost that does not register.\nfunction subscribe(onChange: () => void): () => void {\n const mql = window.matchMedia(MOBILE_QUERY);\n mql.addEventListener(\"change\", onChange);\n return () => mql.removeEventListener(\"change\", onChange);\n}\n\n/**\n * True while the viewport is narrower than `md`.\n *\n * Reads synchronously on the first render rather than filling in from an\n * effect: a value that says \"desktop\" for one frame is invisible for a class\n * name and wrong for anything that decides *which component to mount*.\n */\nexport function useIsMobile(): boolean {\n return useSyncExternalStore(\n subscribe,\n () => window.matchMedia(MOBILE_QUERY).matches,\n // No viewport when server-rendered; assume desktop, as the components do.\n () => false,\n );\n}\n","// A panel that is a popover with a cursor and a bottom sheet on a phone.\n//\n// The composer's secondary controls (tools, session context) open panels that\n// are anchored above a ~32px button. That is right on a desktop and wrong on a\n// phone: an anchored popover near the bottom of the screen has nowhere to go,\n// its content is capped by whatever space is left above the composer, and the\n// whole thing sits under the thumb that opened it. A sheet rising from the\n// bottom edge has the full width, as much height as it needs, and lands where\n// the hand already is.\n//\n// The two are different components, not one component with different classes,\n// so the choice is made in JS — see useIsMobile.\n\nimport { Dialog as DialogPrimitive } from \"radix-ui\";\nimport type { ComponentProps, ReactNode } from \"react\";\nimport { useIsMobile } from \"./lib/use-is-mobile\";\nimport { cn } from \"./lib/utils\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"./popover\";\n\nexport interface ResponsivePanelProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n /** The control that opens the panel. Rendered as the trigger in both forms. */\n trigger: ReactNode;\n /**\n * Names the sheet for screen readers. Radix Dialog requires an accessible\n * name; it is visually hidden, since the panel's own contents are labelled.\n */\n title: string;\n children: ReactNode;\n /** Popover-only; the sheet is always full width. */\n align?: ComponentProps<typeof PopoverContent>[\"align\"];\n /**\n * Styling for the popover form only.\n *\n * Deliberately not a shared `className`: `cn` is tailwind-merge, so a class\n * written for the popover silently deletes a conflicting one from the\n * sheet's own base list. `p-0` and `pb-[env(safe-area-inset-bottom)]` are\n * the same conflict group, so passing the popover's `p-0` through dropped\n * the sheet's home-indicator inset — and a `divide-y` meant for the\n * popover's sections drew a rule under the sheet's grab handle instead.\n */\n popoverClassName?: string;\n}\n\nexport function ResponsivePanel({\n open,\n onOpenChange,\n trigger,\n title,\n children,\n align = \"start\",\n popoverClassName,\n}: ResponsivePanelProps) {\n const isMobile = useIsMobile();\n\n if (!isMobile) {\n return (\n <Popover open={open} onOpenChange={onOpenChange}>\n <PopoverTrigger asChild>{trigger}</PopoverTrigger>\n <PopoverContent\n side=\"top\"\n align={align}\n className={cn(\"w-64 overflow-hidden rounded-xl p-1\", popoverClassName)}\n >\n {children}\n </PopoverContent>\n </Popover>\n );\n }\n\n return (\n <DialogPrimitive.Root open={open} onOpenChange={onOpenChange}>\n <DialogPrimitive.Trigger asChild>{trigger}</DialogPrimitive.Trigger>\n <DialogPrimitive.Portal>\n <DialogPrimitive.Overlay\n data-slot=\"responsive-panel-overlay\"\n className=\"fixed inset-0 z-50 bg-black/40 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0\"\n />\n <DialogPrimitive.Content\n data-slot=\"responsive-panel-sheet\"\n aria-describedby={undefined}\n className={cn(\n \"fixed inset-x-0 bottom-0 z-50 flex max-h-[80svh] flex-col overflow-hidden rounded-t-2xl border-t border-border bg-popover pb-[env(safe-area-inset-bottom)] text-popover-foreground shadow-lg\",\n \"data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom data-[state=open]:animate-in data-[state=open]:slide-in-from-bottom\",\n )}\n >\n <DialogPrimitive.Title className=\"sr-only\">\n {title}\n </DialogPrimitive.Title>\n {/* Not draggable — Radix has no drag gesture and the sheet is short\n enough that a grab bar would only promise one. It reads as the\n handle the shape implies while staying purely decorative. */}\n <div\n aria-hidden=\"true\"\n className=\"mx-auto mt-2.5 mb-1 h-1 w-9 shrink-0 rounded-full bg-muted-foreground/30\"\n />\n <div className=\"min-h-0 flex-1 overflow-y-auto overscroll-contain p-1\">\n {children}\n </div>\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n </DialogPrimitive.Root>\n );\n}\n"]}
@@ -0,0 +1,171 @@
1
+ 'use strict';
2
+
3
+ var chunk6YHDDRIM_cjs = require('./chunk-6YHDDRIM.cjs');
4
+ var react = require('react');
5
+ var radixUi = require('radix-ui');
6
+ var jsxRuntime = require('react/jsx-runtime');
7
+
8
+ var TimelineContext = react.createContext(
9
+ void 0
10
+ );
11
+ var useTimeline = () => {
12
+ const context = react.useContext(TimelineContext);
13
+ if (!context) {
14
+ throw new Error("useTimeline must be used within a Timeline");
15
+ }
16
+ return context;
17
+ };
18
+ function Timeline({
19
+ defaultValue = 1,
20
+ value,
21
+ onValueChange,
22
+ orientation = "vertical",
23
+ className,
24
+ children,
25
+ ...props
26
+ }) {
27
+ const [activeStep, setInternalStep] = react.useState(defaultValue);
28
+ const setActiveStep = react.useCallback(
29
+ (step) => {
30
+ if (value === void 0) {
31
+ setInternalStep(step);
32
+ }
33
+ onValueChange?.(step);
34
+ },
35
+ [value, onValueChange]
36
+ );
37
+ const currentStep = value ?? activeStep;
38
+ return /* @__PURE__ */ jsxRuntime.jsx(
39
+ TimelineContext.Provider,
40
+ {
41
+ value: { activeStep: currentStep, setActiveStep },
42
+ children: /* @__PURE__ */ jsxRuntime.jsx(
43
+ "div",
44
+ {
45
+ className: chunk6YHDDRIM_cjs.cn(
46
+ "group/timeline flex flex-col",
47
+ className
48
+ ),
49
+ "data-orientation": orientation,
50
+ "data-slot": "timeline",
51
+ ...props,
52
+ children
53
+ }
54
+ )
55
+ }
56
+ );
57
+ }
58
+ function TimelineContent({
59
+ className,
60
+ ...props
61
+ }) {
62
+ return /* @__PURE__ */ jsxRuntime.jsx(
63
+ "div",
64
+ {
65
+ className: chunk6YHDDRIM_cjs.cn("text-foreground text-sm min-w-0 overflow-hidden", className),
66
+ "data-slot": "timeline-content",
67
+ ...props
68
+ }
69
+ );
70
+ }
71
+ function TimelineDate({
72
+ asChild = false,
73
+ className,
74
+ ...props
75
+ }) {
76
+ const Comp = asChild ? radixUi.Slot.Root : "time";
77
+ return /* @__PURE__ */ jsxRuntime.jsx(
78
+ Comp,
79
+ {
80
+ className: chunk6YHDDRIM_cjs.cn(
81
+ "text-muted-foreground mb-1 block text-xs font-medium max-sm:h-4",
82
+ className
83
+ ),
84
+ "data-slot": "timeline-date",
85
+ ...props
86
+ }
87
+ );
88
+ }
89
+ function TimelineHeader({
90
+ className,
91
+ ...props
92
+ }) {
93
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunk6YHDDRIM_cjs.cn(className), "data-slot": "timeline-header", ...props });
94
+ }
95
+ function TimelineIndicator({
96
+ asChild = false,
97
+ className,
98
+ children,
99
+ ...props
100
+ }) {
101
+ const Comp = asChild ? radixUi.Slot.Root : "div";
102
+ return /* @__PURE__ */ jsxRuntime.jsx(
103
+ Comp,
104
+ {
105
+ "aria-hidden": "true",
106
+ className: chunk6YHDDRIM_cjs.cn(
107
+ "border-primary/20 group-data-completed/timeline-item:border-primary absolute size-4 rounded-full border-2 top-1.25 -left-6 -translate-x-1/2",
108
+ className
109
+ ),
110
+ "data-slot": "timeline-indicator",
111
+ ...props,
112
+ children
113
+ }
114
+ );
115
+ }
116
+ function TimelineItem({ step, className, ...props }) {
117
+ const { activeStep } = useTimeline();
118
+ return /* @__PURE__ */ jsxRuntime.jsx(
119
+ "div",
120
+ {
121
+ className: chunk6YHDDRIM_cjs.cn(
122
+ "group/timeline-item has-[+[data-completed]]:**:data-[slot=timeline-separator]:bg-primary relative flex flex-col gap-0.5 ms-8 not-last:pb-6",
123
+ className
124
+ ),
125
+ "data-completed": step <= activeStep || void 0,
126
+ "data-slot": "timeline-item",
127
+ ...props
128
+ }
129
+ );
130
+ }
131
+ function TimelineSeparator({
132
+ className,
133
+ ...props
134
+ }) {
135
+ return /* @__PURE__ */ jsxRuntime.jsx(
136
+ "div",
137
+ {
138
+ "aria-hidden": "true",
139
+ className: chunk6YHDDRIM_cjs.cn(
140
+ "bg-primary/10 absolute self-start group-last/timeline-item:hidden -left-6 h-[calc(100%-1rem-0.25rem)] w-0.5 -translate-x-1/2 translate-y-4.5",
141
+ className
142
+ ),
143
+ "data-slot": "timeline-separator",
144
+ ...props
145
+ }
146
+ );
147
+ }
148
+ function TimelineTitle({
149
+ className,
150
+ ...props
151
+ }) {
152
+ return /* @__PURE__ */ jsxRuntime.jsx(
153
+ "h3",
154
+ {
155
+ className: chunk6YHDDRIM_cjs.cn("text-sm font-medium", className),
156
+ "data-slot": "timeline-title",
157
+ ...props
158
+ }
159
+ );
160
+ }
161
+
162
+ exports.Timeline = Timeline;
163
+ exports.TimelineContent = TimelineContent;
164
+ exports.TimelineDate = TimelineDate;
165
+ exports.TimelineHeader = TimelineHeader;
166
+ exports.TimelineIndicator = TimelineIndicator;
167
+ exports.TimelineItem = TimelineItem;
168
+ exports.TimelineSeparator = TimelineSeparator;
169
+ exports.TimelineTitle = TimelineTitle;
170
+ //# sourceMappingURL=timeline.cjs.map
171
+ //# sourceMappingURL=timeline.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/timeline.tsx"],"names":["createContext","useContext","useState","useCallback","jsx","cn","Slot"],"mappings":"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","file":"timeline.cjs","sourcesContent":["import {\n createContext,\n type HTMLAttributes,\n useCallback,\n useContext,\n useState,\n} from \"react\"\nimport { Slot } from \"radix-ui\"\n\nimport { cn } from \"./lib/utils\"\n\n// Types\ntype TimelineContextValue = {\n activeStep: number\n setActiveStep: (step: number) => void\n}\n\n// Context\nconst TimelineContext = createContext<TimelineContextValue | undefined>(\n undefined\n)\n\nconst useTimeline = () => {\n const context = useContext(TimelineContext)\n if (!context) {\n throw new Error(\"useTimeline must be used within a Timeline\")\n }\n return context\n}\n\n// Components\ninterface TimelineProps extends HTMLAttributes<HTMLDivElement> {\n defaultValue?: number\n value?: number\n onValueChange?: (value: number) => void\n orientation?: \"horizontal\" | \"vertical\"\n}\n\nfunction Timeline({\n defaultValue = 1,\n value,\n onValueChange,\n orientation = \"vertical\",\n className,\n children,\n ...props\n}: TimelineProps) {\n const [activeStep, setInternalStep] = useState(defaultValue)\n\n const setActiveStep = useCallback(\n (step: number) => {\n if (value === undefined) {\n setInternalStep(step)\n }\n onValueChange?.(step)\n },\n [value, onValueChange]\n )\n\n const currentStep = value ?? activeStep\n\n return (\n <TimelineContext.Provider\n value={{ activeStep: currentStep, setActiveStep }}\n >\n <div\n className={cn(\n \"group/timeline flex flex-col\",\n className\n )}\n data-orientation={orientation}\n data-slot=\"timeline\"\n {...props}\n >\n {children}\n </div>\n </TimelineContext.Provider>\n )\n}\n\n// TimelineContent\nfunction TimelineContent({\n className,\n ...props\n}: HTMLAttributes<HTMLDivElement>) {\n return (\n <div\n className={cn(\"text-foreground text-sm min-w-0 overflow-hidden\", className)}\n data-slot=\"timeline-content\"\n {...props}\n />\n )\n}\n\n// TimelineDate\ninterface TimelineDateProps extends HTMLAttributes<HTMLTimeElement> {\n asChild?: boolean\n}\n\nfunction TimelineDate({\n asChild = false,\n className,\n ...props\n}: TimelineDateProps) {\n const Comp = asChild ? Slot.Root : \"time\"\n\n return (\n <Comp\n className={cn(\n \"text-muted-foreground mb-1 block text-xs font-medium max-sm:h-4\",\n className\n )}\n data-slot=\"timeline-date\"\n {...props}\n />\n )\n}\n\n// TimelineHeader\nfunction TimelineHeader({\n className,\n ...props\n}: HTMLAttributes<HTMLDivElement>) {\n return (\n <div className={cn(className)} data-slot=\"timeline-header\" {...props} />\n )\n}\n\n// TimelineIndicator\ninterface TimelineIndicatorProps extends HTMLAttributes<HTMLDivElement> {\n asChild?: boolean\n}\n\nfunction TimelineIndicator({\n asChild = false,\n className,\n children,\n ...props\n}: TimelineIndicatorProps) {\n const Comp = asChild ? Slot.Root : \"div\"\n\n return (\n <Comp\n aria-hidden=\"true\"\n className={cn(\n \"border-primary/20 group-data-completed/timeline-item:border-primary absolute size-4 rounded-full border-2 top-1.25 -left-6 -translate-x-1/2\",\n className\n )}\n data-slot=\"timeline-indicator\"\n {...props}\n >\n {children}\n </Comp>\n )\n}\n\n// TimelineItem\ninterface TimelineItemProps extends HTMLAttributes<HTMLDivElement> {\n step: number\n}\n\nfunction TimelineItem({ step, className, ...props }: TimelineItemProps) {\n const { activeStep } = useTimeline()\n\n return (\n <div\n className={cn(\n \"group/timeline-item has-[+[data-completed]]:**:data-[slot=timeline-separator]:bg-primary relative flex flex-col gap-0.5 ms-8 not-last:pb-6\",\n className\n )}\n data-completed={step <= activeStep || undefined}\n data-slot=\"timeline-item\"\n {...props}\n />\n )\n}\n\n// TimelineSeparator\nfunction TimelineSeparator({\n className,\n ...props\n}: HTMLAttributes<HTMLDivElement>) {\n return (\n <div\n aria-hidden=\"true\"\n className={cn(\n \"bg-primary/10 absolute self-start group-last/timeline-item:hidden -left-6 h-[calc(100%-1rem-0.25rem)] w-0.5 -translate-x-1/2 translate-y-4.5\",\n className\n )}\n data-slot=\"timeline-separator\"\n {...props}\n />\n )\n}\n\n// TimelineTitle\nfunction TimelineTitle({\n className,\n ...props\n}: HTMLAttributes<HTMLHeadingElement>) {\n return (\n <h3\n className={cn(\"text-sm font-medium\", className)}\n data-slot=\"timeline-title\"\n {...props}\n />\n )\n}\n\nexport {\n Timeline,\n TimelineContent,\n TimelineDate,\n TimelineHeader,\n TimelineIndicator,\n TimelineItem,\n TimelineSeparator,\n TimelineTitle,\n}"]}
@@ -0,0 +1,28 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { HTMLAttributes } from 'react';
3
+
4
+ interface TimelineProps extends HTMLAttributes<HTMLDivElement> {
5
+ defaultValue?: number;
6
+ value?: number;
7
+ onValueChange?: (value: number) => void;
8
+ orientation?: "horizontal" | "vertical";
9
+ }
10
+ declare function Timeline({ defaultValue, value, onValueChange, orientation, className, children, ...props }: TimelineProps): react_jsx_runtime.JSX.Element;
11
+ declare function TimelineContent({ className, ...props }: HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
12
+ interface TimelineDateProps extends HTMLAttributes<HTMLTimeElement> {
13
+ asChild?: boolean;
14
+ }
15
+ declare function TimelineDate({ asChild, className, ...props }: TimelineDateProps): react_jsx_runtime.JSX.Element;
16
+ declare function TimelineHeader({ className, ...props }: HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
17
+ interface TimelineIndicatorProps extends HTMLAttributes<HTMLDivElement> {
18
+ asChild?: boolean;
19
+ }
20
+ declare function TimelineIndicator({ asChild, className, children, ...props }: TimelineIndicatorProps): react_jsx_runtime.JSX.Element;
21
+ interface TimelineItemProps extends HTMLAttributes<HTMLDivElement> {
22
+ step: number;
23
+ }
24
+ declare function TimelineItem({ step, className, ...props }: TimelineItemProps): react_jsx_runtime.JSX.Element;
25
+ declare function TimelineSeparator({ className, ...props }: HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
26
+ declare function TimelineTitle({ className, ...props }: HTMLAttributes<HTMLHeadingElement>): react_jsx_runtime.JSX.Element;
27
+
28
+ export { Timeline, TimelineContent, TimelineDate, TimelineHeader, TimelineIndicator, TimelineItem, TimelineSeparator, TimelineTitle };
@@ -0,0 +1,28 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { HTMLAttributes } from 'react';
3
+
4
+ interface TimelineProps extends HTMLAttributes<HTMLDivElement> {
5
+ defaultValue?: number;
6
+ value?: number;
7
+ onValueChange?: (value: number) => void;
8
+ orientation?: "horizontal" | "vertical";
9
+ }
10
+ declare function Timeline({ defaultValue, value, onValueChange, orientation, className, children, ...props }: TimelineProps): react_jsx_runtime.JSX.Element;
11
+ declare function TimelineContent({ className, ...props }: HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
12
+ interface TimelineDateProps extends HTMLAttributes<HTMLTimeElement> {
13
+ asChild?: boolean;
14
+ }
15
+ declare function TimelineDate({ asChild, className, ...props }: TimelineDateProps): react_jsx_runtime.JSX.Element;
16
+ declare function TimelineHeader({ className, ...props }: HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
17
+ interface TimelineIndicatorProps extends HTMLAttributes<HTMLDivElement> {
18
+ asChild?: boolean;
19
+ }
20
+ declare function TimelineIndicator({ asChild, className, children, ...props }: TimelineIndicatorProps): react_jsx_runtime.JSX.Element;
21
+ interface TimelineItemProps extends HTMLAttributes<HTMLDivElement> {
22
+ step: number;
23
+ }
24
+ declare function TimelineItem({ step, className, ...props }: TimelineItemProps): react_jsx_runtime.JSX.Element;
25
+ declare function TimelineSeparator({ className, ...props }: HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
26
+ declare function TimelineTitle({ className, ...props }: HTMLAttributes<HTMLHeadingElement>): react_jsx_runtime.JSX.Element;
27
+
28
+ export { Timeline, TimelineContent, TimelineDate, TimelineHeader, TimelineIndicator, TimelineItem, TimelineSeparator, TimelineTitle };