@kumix/ui 0.3.6 → 0.3.7

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 (152) hide show
  1. package/dist/components/agents/ai-sidebar.d.ts +17 -1
  2. package/dist/components/agents/ai-sidebar.d.ts.map +1 -1
  3. package/dist/components/agents/ai-sidebar.js +90 -14
  4. package/dist/components/agents/ai-sidebar.js.map +1 -1
  5. package/dist/components/agents/chat-app.d.ts +10 -5
  6. package/dist/components/agents/chat-app.d.ts.map +1 -1
  7. package/dist/components/agents/chat-app.js +54 -5
  8. package/dist/components/agents/chat-app.js.map +1 -1
  9. package/dist/components/agents/citations.d.ts.map +1 -1
  10. package/dist/components/agents/citations.js +5 -6
  11. package/dist/components/agents/citations.js.map +1 -1
  12. package/dist/components/agents/tool-approval.d.ts.map +1 -1
  13. package/dist/components/agents/tool-approval.js +1 -1
  14. package/dist/components/agents/tool-approval.js.map +1 -1
  15. package/dist/components/motion/action-swap.d.ts.map +1 -1
  16. package/dist/components/motion/action-swap.js +2 -2
  17. package/dist/components/motion/action-swap.js.map +1 -1
  18. package/dist/components/motion/animated-sidebar.js +1 -0
  19. package/dist/components/motion/animated-sidebar.js.map +1 -1
  20. package/dist/components/motion/availability-scheduler/copy-menu.js +1 -1
  21. package/dist/components/motion/availability-scheduler/day-row.d.ts +5 -2
  22. package/dist/components/motion/availability-scheduler/day-row.d.ts.map +1 -1
  23. package/dist/components/motion/availability-scheduler/day-row.js +18 -8
  24. package/dist/components/motion/availability-scheduler/day-row.js.map +1 -1
  25. package/dist/components/motion/availability-scheduler/index.d.ts.map +1 -1
  26. package/dist/components/motion/availability-scheduler/index.js +27 -5
  27. package/dist/components/motion/availability-scheduler/index.js.map +1 -1
  28. package/dist/components/motion/availability-scheduler/time-select.d.ts +3 -1
  29. package/dist/components/motion/availability-scheduler/time-select.d.ts.map +1 -1
  30. package/dist/components/motion/availability-scheduler/time-select.js +3 -1
  31. package/dist/components/motion/availability-scheduler/time-select.js.map +1 -1
  32. package/dist/components/motion/bottom-sheet.d.ts.map +1 -1
  33. package/dist/components/motion/bottom-sheet.js +2 -1
  34. package/dist/components/motion/bottom-sheet.js.map +1 -1
  35. package/dist/components/motion/command-palette.d.ts.map +1 -1
  36. package/dist/components/motion/command-palette.js +3 -1
  37. package/dist/components/motion/command-palette.js.map +1 -1
  38. package/dist/components/motion/context-menu.d.ts.map +1 -1
  39. package/dist/components/motion/context-menu.js +16 -6
  40. package/dist/components/motion/context-menu.js.map +1 -1
  41. package/dist/components/motion/cylinder-carousel.d.ts.map +1 -1
  42. package/dist/components/motion/cylinder-carousel.js +4 -3
  43. package/dist/components/motion/cylinder-carousel.js.map +1 -1
  44. package/dist/components/motion/expandable-action-bar.d.ts +6 -0
  45. package/dist/components/motion/expandable-action-bar.d.ts.map +1 -1
  46. package/dist/components/motion/expandable-action-bar.js +38 -9
  47. package/dist/components/motion/expandable-action-bar.js.map +1 -1
  48. package/dist/components/motion/hold-action-button.d.ts +1 -1
  49. package/dist/components/motion/hold-action-button.d.ts.map +1 -1
  50. package/dist/components/motion/hold-action-button.js +64 -50
  51. package/dist/components/motion/hold-action-button.js.map +1 -1
  52. package/dist/components/motion/morphing-tabs.d.ts.map +1 -1
  53. package/dist/components/motion/morphing-tabs.js +59 -18
  54. package/dist/components/motion/morphing-tabs.js.map +1 -1
  55. package/dist/components/motion/notification-stack.d.ts.map +1 -1
  56. package/dist/components/motion/notification-stack.js +28 -11
  57. package/dist/components/motion/notification-stack.js.map +1 -1
  58. package/dist/components/motion/popover-morph.d.ts.map +1 -1
  59. package/dist/components/motion/popover-morph.js +26 -11
  60. package/dist/components/motion/popover-morph.js.map +1 -1
  61. package/dist/components/motion/popover.d.ts.map +1 -1
  62. package/dist/components/motion/popover.js +39 -28
  63. package/dist/components/motion/popover.js.map +1 -1
  64. package/dist/components/motion/preview-rail.d.ts.map +1 -1
  65. package/dist/components/motion/preview-rail.js +42 -13
  66. package/dist/components/motion/preview-rail.js.map +1 -1
  67. package/dist/components/motion/pull-to-refresh.d.ts.map +1 -1
  68. package/dist/components/motion/pull-to-refresh.js +8 -7
  69. package/dist/components/motion/pull-to-refresh.js.map +1 -1
  70. package/dist/components/motion/range-slider-bubble.d.ts.map +1 -1
  71. package/dist/components/motion/range-slider-bubble.js +2 -1
  72. package/dist/components/motion/range-slider-bubble.js.map +1 -1
  73. package/dist/components/motion/range-slider-fluid.d.ts.map +1 -1
  74. package/dist/components/motion/range-slider-fluid.js +2 -1
  75. package/dist/components/motion/range-slider-fluid.js.map +1 -1
  76. package/dist/components/motion/range-slider-ruler.d.ts.map +1 -1
  77. package/dist/components/motion/range-slider-ruler.js +2 -1
  78. package/dist/components/motion/range-slider-ruler.js.map +1 -1
  79. package/dist/components/motion/range-slider-wave.d.ts.map +1 -1
  80. package/dist/components/motion/range-slider-wave.js +2 -1
  81. package/dist/components/motion/range-slider-wave.js.map +1 -1
  82. package/dist/components/motion/range-slider.d.ts.map +1 -1
  83. package/dist/components/motion/range-slider.js +2 -1
  84. package/dist/components/motion/range-slider.js.map +1 -1
  85. package/dist/components/motion/select.d.ts +15 -1
  86. package/dist/components/motion/select.d.ts.map +1 -1
  87. package/dist/components/motion/select.js +15 -4
  88. package/dist/components/motion/select.js.map +1 -1
  89. package/dist/components/motion/slide-action-button.d.ts.map +1 -1
  90. package/dist/components/motion/slide-action-button.js +3 -2
  91. package/dist/components/motion/slide-action-button.js.map +1 -1
  92. package/dist/components/motion/swipeable-list.d.ts.map +1 -1
  93. package/dist/components/motion/swipeable-list.js +2 -1
  94. package/dist/components/motion/swipeable-list.js.map +1 -1
  95. package/dist/components/motion/table/index.d.ts.map +1 -1
  96. package/dist/components/motion/table/index.js +64 -6
  97. package/dist/components/motion/table/index.js.map +1 -1
  98. package/dist/components/motion/table/table-header.d.ts.map +1 -1
  99. package/dist/components/motion/table/table-header.js +3 -2
  100. package/dist/components/motion/table/table-header.js.map +1 -1
  101. package/dist/components/motion/text-reveal.d.ts.map +1 -1
  102. package/dist/components/motion/text-reveal.js +72 -48
  103. package/dist/components/motion/text-reveal.js.map +1 -1
  104. package/dist/components/motion/tooltip.d.ts.map +1 -1
  105. package/dist/components/motion/tooltip.js +35 -15
  106. package/dist/components/motion/tooltip.js.map +1 -1
  107. package/dist/components/motion/wheel-picker.d.ts.map +1 -1
  108. package/dist/components/motion/wheel-picker.js +4 -3
  109. package/dist/components/motion/wheel-picker.js.map +1 -1
  110. package/dist/components/reui/badge.d.ts +1 -1
  111. package/dist/components/reui/icon-tile.d.ts +1 -1
  112. package/dist/components/ui/attachment.d.ts +1 -1
  113. package/dist/components/ui/badge.d.ts +1 -1
  114. package/dist/components/ui/bubble.d.ts +1 -1
  115. package/dist/components/ui/button-group.d.ts +1 -1
  116. package/dist/components/ui/button.d.ts +2 -2
  117. package/dist/components/ui/field.d.ts +1 -1
  118. package/dist/components/ui/item.d.ts +1 -1
  119. package/dist/components/ui/marker.d.ts +1 -1
  120. package/dist/components/ui/tabs.d.ts +1 -1
  121. package/dist/{copy-menu-Bk5GP9Gp.js → copy-menu-1FKoMc9o.js} +9 -2
  122. package/dist/copy-menu-1FKoMc9o.js.map +1 -0
  123. package/dist/hooks/use-dismiss.d.ts +34 -0
  124. package/dist/hooks/use-dismiss.d.ts.map +1 -0
  125. package/dist/hooks/use-dismiss.js +78 -0
  126. package/dist/hooks/use-dismiss.js.map +1 -0
  127. package/dist/hooks/use-favicon.d.ts +17 -0
  128. package/dist/hooks/use-favicon.d.ts.map +1 -0
  129. package/dist/hooks/use-favicon.js +35 -0
  130. package/dist/hooks/use-favicon.js.map +1 -0
  131. package/dist/hooks/use-hover-gesture.d.ts +38 -0
  132. package/dist/hooks/use-hover-gesture.d.ts.map +1 -0
  133. package/dist/hooks/use-hover-gesture.js +46 -0
  134. package/dist/hooks/use-hover-gesture.js.map +1 -0
  135. package/dist/hooks/use-slider.d.ts.map +1 -1
  136. package/dist/hooks/use-slider.js +3 -2
  137. package/dist/hooks/use-slider.js.map +1 -1
  138. package/dist/hooks/use-tap-gesture.d.ts +47 -0
  139. package/dist/hooks/use-tap-gesture.d.ts.map +1 -0
  140. package/dist/hooks/use-tap-gesture.js +51 -0
  141. package/dist/hooks/use-tap-gesture.js.map +1 -0
  142. package/dist/hooks/use-touch-capable.d.ts +15 -0
  143. package/dist/hooks/use-touch-capable.d.ts.map +1 -0
  144. package/dist/hooks/use-touch-capable.js +29 -0
  145. package/dist/hooks/use-touch-capable.js.map +1 -0
  146. package/dist/lib/touch.d.ts +66 -0
  147. package/dist/lib/touch.d.ts.map +1 -0
  148. package/dist/lib/touch.js +79 -0
  149. package/dist/lib/touch.js.map +1 -0
  150. package/dist/types-smkWN_7x.d.ts.map +1 -1
  151. package/package.json +1 -1
  152. package/dist/copy-menu-Bk5GP9Gp.js.map +0 -1
@@ -0,0 +1,66 @@
1
+ //#region src/lib/touch.d.ts
2
+ declare const TOUCH_GESTURE_CLASS = "select-none [-webkit-touch-callout:none]";
3
+ /**
4
+ * The same opt-out for a gesture surface that wraps content the consumer owns:
5
+ * a scroller, a context-menu trigger, a sheet header, a list row. Selection is
6
+ * suppressed only where the platform runs its own press gestures — a coarse
7
+ * pointer — so a mouse user can still select and copy that content. If the
8
+ * gesture itself would paint a selection under the cursor, add `select-none`
9
+ * for the duration of the gesture rather than reaching for
10
+ * `TOUCH_GESTURE_CLASS`.
11
+ *
12
+ * `pointer: coarse` describes the *primary* pointer and nothing else, so a
13
+ * hybrid machine reads it wrong in both directions: a tablet with a mouse
14
+ * plugged in keeps touch as primary and loses mouse selection, and a laptop
15
+ * with a touchscreen keeps the mouse as primary and leaves selection live
16
+ * under a finger. No media query can answer per interaction — the query is
17
+ * about the device, and the question is about the gesture in progress. The
18
+ * default stays here because it is right on the machines that are one thing or
19
+ * the other, and losing a selection is a nuisance; where the miss costs a
20
+ * *gesture* instead, the surface pairs it with `holdSelection` on the press.
21
+ */
22
+ declare const TOUCH_GESTURE_CONTENT_CLASS = "[-webkit-touch-callout:none] pointer-coarse:select-none";
23
+ /**
24
+ * Suppress selection on `element` for as long as a gesture is running on it,
25
+ * whatever the primary pointer of the machine happens to be. Returns the
26
+ * release. Inline, so it wins over the class above and is gone again the
27
+ * moment the gesture ends.
28
+ *
29
+ * For the press gestures a native selection would otherwise steal — a
30
+ * long-press that opens a menu. Elsewhere prefer the classes: a surface that
31
+ * takes selection away for the whole session is a surface whose text nobody
32
+ * can copy.
33
+ */
34
+ declare function holdSelection(element: HTMLElement): () => void;
35
+ /**
36
+ * Pointer capture, best effort. WebKit throws `NotFoundError` when the pointer
37
+ * is already gone by the time the handler runs — routine on iOS, where the
38
+ * system can claim the touch first — and an uncaught throw takes the rest of
39
+ * the handler, the gesture included, down with it. Touch pointers carry
40
+ * implicit capture anyway, so losing it is never fatal.
41
+ */
42
+ declare function capturePointer(element: Element, pointerId: number): void;
43
+ /** Release a capture taken with `capturePointer`, ignoring a stale pointer. */
44
+ declare function releasePointer(element: Element, pointerId: number): void;
45
+ /**
46
+ * Whether this event came from a pointer that is *hovering*: not a touch, and
47
+ * not currently pressed. Which input the user is holding right now is not
48
+ * something a device capability can answer — a touchscreen laptop hovers and
49
+ * taps, and iPadOS reports a fine hovering pointer for a finger — so both
50
+ * paths stay live and each handler branches on the event it was given.
51
+ *
52
+ * A pen resting on the glass is making contact, not hovering: `buttons` is the
53
+ * tell, and it sends a pen tap down the same route a finger takes.
54
+ *
55
+ * This answers what an *enter* asks. A leave is the other half of a pair and
56
+ * has to be read against the enter that started it — `useHoverGesture` in
57
+ * `lib/hooks/use-hover-gesture` does that, and hover surfaces should use it
58
+ * rather than asking this question twice.
59
+ */
60
+ declare const isHoveringPointer: (event: {
61
+ pointerType: string;
62
+ buttons: number;
63
+ }) => boolean;
64
+ //#endregion
65
+ export { TOUCH_GESTURE_CLASS, TOUCH_GESTURE_CONTENT_CLASS, capturePointer, holdSelection, isHoveringPointer, releasePointer };
66
+ //# sourceMappingURL=touch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"touch.d.ts","names":[],"sources":["../../src/lib/touch.ts"],"mappings":";cAAa;;;;;;;;;;;;;;;;;;;;cAqBA;;;;;;;;;;;;iBAcG,cAAc,SAAS;;;;;;;;iBAgBvB,eAAe,SAAS,SAAS;;iBASjC,eAAe,SAAS,SAAS;;;;;;;;;;;;;;;;cAyBpC,oBAAqB;EAAS;EAAqB"}
@@ -0,0 +1,79 @@
1
+ //#region src/lib/touch.ts
2
+ const TOUCH_GESTURE_CLASS = "select-none [-webkit-touch-callout:none]";
3
+ /**
4
+ * The same opt-out for a gesture surface that wraps content the consumer owns:
5
+ * a scroller, a context-menu trigger, a sheet header, a list row. Selection is
6
+ * suppressed only where the platform runs its own press gestures — a coarse
7
+ * pointer — so a mouse user can still select and copy that content. If the
8
+ * gesture itself would paint a selection under the cursor, add `select-none`
9
+ * for the duration of the gesture rather than reaching for
10
+ * `TOUCH_GESTURE_CLASS`.
11
+ *
12
+ * `pointer: coarse` describes the *primary* pointer and nothing else, so a
13
+ * hybrid machine reads it wrong in both directions: a tablet with a mouse
14
+ * plugged in keeps touch as primary and loses mouse selection, and a laptop
15
+ * with a touchscreen keeps the mouse as primary and leaves selection live
16
+ * under a finger. No media query can answer per interaction — the query is
17
+ * about the device, and the question is about the gesture in progress. The
18
+ * default stays here because it is right on the machines that are one thing or
19
+ * the other, and losing a selection is a nuisance; where the miss costs a
20
+ * *gesture* instead, the surface pairs it with `holdSelection` on the press.
21
+ */
22
+ const TOUCH_GESTURE_CONTENT_CLASS = "[-webkit-touch-callout:none] pointer-coarse:select-none";
23
+ /**
24
+ * Suppress selection on `element` for as long as a gesture is running on it,
25
+ * whatever the primary pointer of the machine happens to be. Returns the
26
+ * release. Inline, so it wins over the class above and is gone again the
27
+ * moment the gesture ends.
28
+ *
29
+ * For the press gestures a native selection would otherwise steal — a
30
+ * long-press that opens a menu. Elsewhere prefer the classes: a surface that
31
+ * takes selection away for the whole session is a surface whose text nobody
32
+ * can copy.
33
+ */
34
+ function holdSelection(element) {
35
+ element.style.setProperty("user-select", "none");
36
+ element.style.setProperty("-webkit-user-select", "none");
37
+ return () => {
38
+ element.style.removeProperty("user-select");
39
+ element.style.removeProperty("-webkit-user-select");
40
+ };
41
+ }
42
+ /**
43
+ * Pointer capture, best effort. WebKit throws `NotFoundError` when the pointer
44
+ * is already gone by the time the handler runs — routine on iOS, where the
45
+ * system can claim the touch first — and an uncaught throw takes the rest of
46
+ * the handler, the gesture included, down with it. Touch pointers carry
47
+ * implicit capture anyway, so losing it is never fatal.
48
+ */
49
+ function capturePointer(element, pointerId) {
50
+ try {
51
+ element.setPointerCapture(pointerId);
52
+ } catch {}
53
+ }
54
+ /** Release a capture taken with `capturePointer`, ignoring a stale pointer. */
55
+ function releasePointer(element, pointerId) {
56
+ try {
57
+ if (element.hasPointerCapture(pointerId)) element.releasePointerCapture(pointerId);
58
+ } catch {}
59
+ }
60
+ /**
61
+ * Whether this event came from a pointer that is *hovering*: not a touch, and
62
+ * not currently pressed. Which input the user is holding right now is not
63
+ * something a device capability can answer — a touchscreen laptop hovers and
64
+ * taps, and iPadOS reports a fine hovering pointer for a finger — so both
65
+ * paths stay live and each handler branches on the event it was given.
66
+ *
67
+ * A pen resting on the glass is making contact, not hovering: `buttons` is the
68
+ * tell, and it sends a pen tap down the same route a finger takes.
69
+ *
70
+ * This answers what an *enter* asks. A leave is the other half of a pair and
71
+ * has to be read against the enter that started it — `useHoverGesture` in
72
+ * `lib/hooks/use-hover-gesture` does that, and hover surfaces should use it
73
+ * rather than asking this question twice.
74
+ */
75
+ const isHoveringPointer = (event) => event.pointerType !== "touch" && event.buttons === 0;
76
+ //#endregion
77
+ export { TOUCH_GESTURE_CLASS, TOUCH_GESTURE_CONTENT_CLASS, capturePointer, holdSelection, isHoveringPointer, releasePointer };
78
+
79
+ //# sourceMappingURL=touch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"touch.js","names":[],"sources":["../../src/lib/touch.ts"],"sourcesContent":["export const TOUCH_GESTURE_CLASS = \"select-none [-webkit-touch-callout:none]\";\n\n/**\n * The same opt-out for a gesture surface that wraps content the consumer owns:\n * a scroller, a context-menu trigger, a sheet header, a list row. Selection is\n * suppressed only where the platform runs its own press gestures — a coarse\n * pointer — so a mouse user can still select and copy that content. If the\n * gesture itself would paint a selection under the cursor, add `select-none`\n * for the duration of the gesture rather than reaching for\n * `TOUCH_GESTURE_CLASS`.\n *\n * `pointer: coarse` describes the *primary* pointer and nothing else, so a\n * hybrid machine reads it wrong in both directions: a tablet with a mouse\n * plugged in keeps touch as primary and loses mouse selection, and a laptop\n * with a touchscreen keeps the mouse as primary and leaves selection live\n * under a finger. No media query can answer per interaction — the query is\n * about the device, and the question is about the gesture in progress. The\n * default stays here because it is right on the machines that are one thing or\n * the other, and losing a selection is a nuisance; where the miss costs a\n * *gesture* instead, the surface pairs it with `holdSelection` on the press.\n */\nexport const TOUCH_GESTURE_CONTENT_CLASS =\n \"[-webkit-touch-callout:none] pointer-coarse:select-none\";\n\n/**\n * Suppress selection on `element` for as long as a gesture is running on it,\n * whatever the primary pointer of the machine happens to be. Returns the\n * release. Inline, so it wins over the class above and is gone again the\n * moment the gesture ends.\n *\n * For the press gestures a native selection would otherwise steal — a\n * long-press that opens a menu. Elsewhere prefer the classes: a surface that\n * takes selection away for the whole session is a surface whose text nobody\n * can copy.\n */\nexport function holdSelection(element: HTMLElement) {\n element.style.setProperty(\"user-select\", \"none\");\n element.style.setProperty(\"-webkit-user-select\", \"none\");\n return () => {\n element.style.removeProperty(\"user-select\");\n element.style.removeProperty(\"-webkit-user-select\");\n };\n}\n\n/**\n * Pointer capture, best effort. WebKit throws `NotFoundError` when the pointer\n * is already gone by the time the handler runs — routine on iOS, where the\n * system can claim the touch first — and an uncaught throw takes the rest of\n * the handler, the gesture included, down with it. Touch pointers carry\n * implicit capture anyway, so losing it is never fatal.\n */\nexport function capturePointer(element: Element, pointerId: number) {\n try {\n element.setPointerCapture(pointerId);\n } catch {\n // Pointer is no longer active — implicit capture still applies on touch.\n }\n}\n\n/** Release a capture taken with `capturePointer`, ignoring a stale pointer. */\nexport function releasePointer(element: Element, pointerId: number) {\n try {\n if (element.hasPointerCapture(pointerId)) {\n element.releasePointerCapture(pointerId);\n }\n } catch {\n // Capture was already dropped by the browser.\n }\n}\n\n/**\n * Whether this event came from a pointer that is *hovering*: not a touch, and\n * not currently pressed. Which input the user is holding right now is not\n * something a device capability can answer — a touchscreen laptop hovers and\n * taps, and iPadOS reports a fine hovering pointer for a finger — so both\n * paths stay live and each handler branches on the event it was given.\n *\n * A pen resting on the glass is making contact, not hovering: `buttons` is the\n * tell, and it sends a pen tap down the same route a finger takes.\n *\n * This answers what an *enter* asks. A leave is the other half of a pair and\n * has to be read against the enter that started it — `useHoverGesture` in\n * `lib/hooks/use-hover-gesture` does that, and hover surfaces should use it\n * rather than asking this question twice.\n */\nexport const isHoveringPointer = (event: { pointerType: string; buttons: number }) =>\n event.pointerType !== \"touch\" && event.buttons === 0;\n"],"mappings":";AAAA,MAAa,sBAAsB;;;;;;;;;;;;;;;;;;;;AAqBnC,MAAa,8BACX;;;;;;;;;;;;AAaF,SAAgB,cAAc,SAAsB;CAClD,QAAQ,MAAM,YAAY,eAAe,MAAM;CAC/C,QAAQ,MAAM,YAAY,uBAAuB,MAAM;CACvD,aAAa;EACX,QAAQ,MAAM,eAAe,aAAa;EAC1C,QAAQ,MAAM,eAAe,qBAAqB;CACpD;AACF;;;;;;;;AASA,SAAgB,eAAe,SAAkB,WAAmB;CAClE,IAAI;EACF,QAAQ,kBAAkB,SAAS;CACrC,QAAQ,CAER;AACF;;AAGA,SAAgB,eAAe,SAAkB,WAAmB;CAClE,IAAI;EACF,IAAI,QAAQ,kBAAkB,SAAS,GACrC,QAAQ,sBAAsB,SAAS;CAE3C,QAAQ,CAER;AACF;;;;;;;;;;;;;;;;AAiBA,MAAa,qBAAqB,UAChC,MAAM,gBAAgB,WAAW,MAAM,YAAY"}
@@ -1 +1 @@
1
- {"version":3,"file":"types-smkWN_7x.d.ts","names":[],"sources":["../src/components/motion/availability-scheduler/types.ts"],"mappings":";KAAY;KAEA;EAAc;EAAY;EAAe;;KACzC;EAAoB;EAAkB,QAAQ;;KAC9C,mBAAmB,OAAO,QAAQ;KAClC;EAAe;EAAe;;iBA4C1B,eAAe"}
1
+ {"version":3,"file":"types-smkWN_7x.d.ts","names":[],"sources":["../src/components/motion/availability-scheduler/types.ts"],"mappings":";KAAY;KAEA;EAAc;EAAY;EAAe;;KACzC;EAAoB;EAAkB,QAAQ;;KAC9C,mBAAmB,OAAO,QAAQ;KAClC;EAAe;EAAe;;iBAuD1B,eAAe"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kumix/ui",
3
- "version": "0.3.6",
3
+ "version": "0.3.7",
4
4
  "description": "Kumix React UI kit: shadcn/ui (Base UI, base-nova) + ReUI components, Tailwind tokens, and hooks. Per-file ESM exports.",
5
5
  "author": "Kumix Labs <hai@kumix.io>",
6
6
  "license": "MIT",
@@ -1 +0,0 @@
1
- {"version":3,"file":"copy-menu-Bk5GP9Gp.js","names":[],"sources":["../src/components/motion/availability-scheduler/types.ts","../src/components/motion/availability-scheduler/copy-menu.tsx"],"sourcesContent":["export type DayKey = \"mon\" | \"tue\" | \"wed\" | \"thu\" | \"fri\" | \"sat\" | \"sun\";\n\nexport type TimeRange = { id: string; start: string; end: string };\nexport type DayAvailability = { enabled: boolean; ranges: TimeRange[] };\nexport type WeekAvailability = Record<DayKey, DayAvailability>;\nexport type TimeOption = { value: string; label: string };\n\nexport const WEEKDAYS: { key: DayKey; label: string }[] = [\n { key: \"mon\", label: \"Monday\" },\n { key: \"tue\", label: \"Tuesday\" },\n { key: \"wed\", label: \"Wednesday\" },\n { key: \"thu\", label: \"Thursday\" },\n { key: \"fri\", label: \"Friday\" },\n { key: \"sat\", label: \"Saturday\" },\n { key: \"sun\", label: \"Sunday\" },\n];\n\n// ─── time helpers ────────────────────────────────────────────────────────────\n\nexport const toMinutes = (v: string) => {\n const [h, m] = v.split(\":\").map(Number);\n return h * 60 + m;\n};\n\nexport const toValue = (mins: number) => {\n const clamped = Math.max(0, Math.min(24 * 60 - 1, mins));\n const h = Math.floor(clamped / 60);\n const m = clamped % 60;\n return `${String(h).padStart(2, \"0\")}:${String(m).padStart(2, \"0\")}`;\n};\n\nexport const label12 = (v: string) => {\n const [h, m] = v.split(\":\").map(Number);\n const ap = h < 12 ? \"AM\" : \"PM\";\n const h12 = h % 12 === 0 ? 12 : h % 12;\n return `${h12}:${String(m).padStart(2, \"0\")} ${ap}`;\n};\n\nexport function buildOptions(step: number): TimeOption[] {\n const out: TimeOption[] = [];\n for (let m = 0; m < 24 * 60; m += step) {\n const value = toValue(m);\n out.push({ value, label: label12(value) });\n }\n return out;\n}\n\n// Default: Mon–Fri 9–5, weekend off. Fixed ids so SSR and first client render\n// agree (new ranges get counter ids afterwards).\nexport function defaultWeek(): WeekAvailability {\n const workday = (day: DayKey): DayAvailability => ({\n enabled: true,\n ranges: [{ id: `${day}-0`, start: \"09:00\", end: \"17:00\" }],\n });\n const off = (day: DayKey): DayAvailability => ({\n enabled: false,\n ranges: [{ id: `${day}-0`, start: \"09:00\", end: \"17:00\" }],\n });\n return {\n mon: workday(\"mon\"),\n tue: workday(\"tue\"),\n wed: workday(\"wed\"),\n thu: workday(\"thu\"),\n fri: workday(\"fri\"),\n sat: off(\"sat\"),\n sun: off(\"sun\"),\n };\n}\n","\"use client\";\n\nimport { useState } from \"react\";\nimport { Check, Copy } from \"lucide-react\";\nimport { AnimatePresence, motion } from \"motion/react\";\n\nimport { SPRING_PRESS } from \"../../../lib/ease\";\nimport { Checkbox } from \"../checkbox\";\nimport { MorphPopover, MorphPopoverContent } from \"../popover-morph\";\nimport { Tooltip } from \"../tooltip\";\nimport { IconButton } from \"./icon-button\";\nimport { type DayKey, WEEKDAYS } from \"./types\";\n\n// Copy this day's hours to other days: a morph popover with a day picker.\nexport function CopyMenu({\n fromLabel,\n reduce,\n onApply,\n}: {\n fromLabel: string;\n reduce: boolean;\n onApply: (targets: DayKey[]) => void;\n}) {\n const [open, setOpen] = useState(false);\n const [copied, setCopied] = useState(false);\n const [picked, setPicked] = useState<Set<DayKey>>(new Set());\n const others = WEEKDAYS.filter((d) => d.label !== fromLabel);\n\n const toggle = (k: DayKey) =>\n setPicked((prev) => {\n const next = new Set(prev);\n if (next.has(k)) next.delete(k);\n else next.add(k);\n return next;\n });\n\n const apply = (targets: DayKey[]) => {\n if (!targets.length) return;\n onApply(targets);\n setOpen(false);\n setPicked(new Set());\n setCopied(true);\n window.setTimeout(() => setCopied(false), 1200);\n };\n\n return (\n <MorphPopover open={open} onOpenChange={setOpen}>\n <Tooltip content=\"Copy times\">\n <IconButton\n label={`Copy ${fromLabel} hours to other days`}\n reduce={reduce}\n expanded={open}\n onClick={() => setOpen(!open)}\n >\n <AnimatePresence mode=\"popLayout\" initial={false}>\n {copied ? (\n <motion.span\n key=\"done\"\n initial={reduce ? { opacity: 0 } : { opacity: 0, scale: 0.5 }}\n animate={{ opacity: 1, scale: 1 }}\n exit={reduce ? { opacity: 0 } : { opacity: 0, scale: 0.5 }}\n transition={SPRING_PRESS}\n className=\"text-foreground\"\n >\n <Check className=\"h-4 w-4\" />\n </motion.span>\n ) : (\n <motion.span\n key=\"copy\"\n initial={reduce ? { opacity: 0 } : { opacity: 0, scale: 0.5 }}\n animate={{ opacity: 1, scale: 1 }}\n exit={reduce ? { opacity: 0 } : { opacity: 0, scale: 0.5 }}\n transition={SPRING_PRESS}\n >\n <Copy className=\"h-4 w-4\" />\n </motion.span>\n )}\n </AnimatePresence>\n </IconButton>\n </Tooltip>\n\n <MorphPopoverContent align=\"end\" className=\"w-52 p-2\">\n <p className=\"px-2 py-1.5 font-medium text-muted-foreground text-xs\">Copy times to</p>\n <div className=\"flex flex-col\">\n {others.map((d) => (\n <Checkbox\n key={d.key}\n checked={picked.has(d.key)}\n onCheckedChange={() => toggle(d.key)}\n label={d.label}\n className=\"w-full flex-row-reverse justify-between rounded-lg px-2 py-1.5 transition-colors hover:bg-muted [&_button[data-state=unchecked]]:border-border-strong [&_button]:size-4 [&_button]:rounded-[5px] [&_button]:border\"\n />\n ))}\n </div>\n <div className=\"mt-1 flex items-center gap-2 border-border border-t px-1 pt-2\">\n <button\n type=\"button\"\n onClick={() => apply(others.map((d) => d.key))}\n className=\"flex-1 rounded-lg px-2 py-1.5 font-medium text-muted-foreground text-xs outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:bg-muted\"\n >\n Every day\n </button>\n <button\n type=\"button\"\n onClick={() => apply([...picked])}\n disabled={picked.size === 0}\n className=\"flex-1 rounded-lg bg-primary px-2 py-1.5 font-semibold text-primary-foreground text-xs outline-none transition-opacity hover:opacity-90 focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-40\"\n >\n Apply\n </button>\n </div>\n </MorphPopoverContent>\n </MorphPopover>\n );\n}\n"],"mappings":";;;;;;;;;;AAOA,MAAa,WAA6C;CACxD;EAAE,KAAK;EAAO,OAAO;CAAS;CAC9B;EAAE,KAAK;EAAO,OAAO;CAAU;CAC/B;EAAE,KAAK;EAAO,OAAO;CAAY;CACjC;EAAE,KAAK;EAAO,OAAO;CAAW;CAChC;EAAE,KAAK;EAAO,OAAO;CAAS;CAC9B;EAAE,KAAK;EAAO,OAAO;CAAW;CAChC;EAAE,KAAK;EAAO,OAAO;CAAS;AAChC;AAIA,MAAa,aAAa,MAAc;CACtC,MAAM,CAAC,GAAG,KAAK,EAAE,MAAM,GAAG,CAAC,CAAC,IAAI,MAAM;CACtC,OAAO,IAAI,KAAK;AAClB;AAEA,MAAa,WAAW,SAAiB;CACvC,MAAM,UAAU,KAAK,IAAI,GAAG,KAAK,IAAI,MAAa,IAAI,CAAC;CACvD,MAAM,IAAI,KAAK,MAAM,UAAU,EAAE;CACjC,MAAM,IAAI,UAAU;CACpB,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,SAAS,GAAG,GAAG,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC,SAAS,GAA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