@kumix/ui 0.3.0 → 0.3.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 (242) hide show
  1. package/README.md +14 -1
  2. package/dist/components/custom/confirm-dialog.d.ts +16 -0
  3. package/dist/components/custom/confirm-dialog.d.ts.map +1 -0
  4. package/dist/components/custom/confirm-dialog.js +93 -0
  5. package/dist/components/custom/confirm-dialog.js.map +1 -0
  6. package/dist/components/custom/toast.d.ts +20 -0
  7. package/dist/components/custom/toast.d.ts.map +1 -0
  8. package/dist/components/custom/toast.js +73 -0
  9. package/dist/components/custom/toast.js.map +1 -0
  10. package/dist/components/motion/action-swap.js +1 -1
  11. package/dist/components/motion/animated-badge.js +2 -2
  12. package/dist/components/motion/animated-number.js +1 -1
  13. package/dist/components/motion/animated-sidebar.js +2 -2
  14. package/dist/components/motion/animated-toast-stack.js +4 -4
  15. package/dist/components/motion/animated-toast-stack.js.map +1 -1
  16. package/dist/components/motion/attachment-upload.d.ts +47 -0
  17. package/dist/components/motion/attachment-upload.d.ts.map +1 -0
  18. package/dist/components/motion/attachment-upload.js +737 -0
  19. package/dist/components/motion/attachment-upload.js.map +1 -0
  20. package/dist/components/motion/availability-scheduler/copy-menu.d.ts +10 -0
  21. package/dist/components/motion/availability-scheduler/copy-menu.d.ts.map +1 -0
  22. package/dist/components/motion/availability-scheduler/copy-menu.js +3 -0
  23. package/dist/components/motion/availability-scheduler/day-row.d.ts +15 -0
  24. package/dist/components/motion/availability-scheduler/day-row.d.ts.map +1 -0
  25. package/dist/components/motion/availability-scheduler/day-row.js +181 -0
  26. package/dist/components/motion/availability-scheduler/day-row.js.map +1 -0
  27. package/dist/components/motion/availability-scheduler/icon-button.d.ts +15 -0
  28. package/dist/components/motion/availability-scheduler/icon-button.d.ts.map +1 -0
  29. package/dist/components/motion/availability-scheduler/icon-button.js +24 -0
  30. package/dist/components/motion/availability-scheduler/icon-button.js.map +1 -0
  31. package/dist/components/motion/availability-scheduler/index.d.ts +14 -0
  32. package/dist/components/motion/availability-scheduler/index.d.ts.map +1 -0
  33. package/dist/components/motion/availability-scheduler/index.js +59 -0
  34. package/dist/components/motion/availability-scheduler/index.js.map +1 -0
  35. package/dist/components/motion/availability-scheduler/time-select.d.ts +10 -0
  36. package/dist/components/motion/availability-scheduler/time-select.d.ts.map +1 -0
  37. package/dist/components/motion/availability-scheduler/time-select.js +26 -0
  38. package/dist/components/motion/availability-scheduler/time-select.js.map +1 -0
  39. package/dist/components/motion/bloom-menu.d.ts +17 -0
  40. package/dist/components/motion/bloom-menu.d.ts.map +1 -0
  41. package/dist/components/motion/bloom-menu.js +170 -0
  42. package/dist/components/motion/bloom-menu.js.map +1 -0
  43. package/dist/components/motion/bottom-sheet.js +1 -1
  44. package/dist/components/motion/bounce-sidebar.js +1 -1
  45. package/dist/components/motion/bouncy-accordion.js +2 -2
  46. package/dist/components/motion/button/base.js +1 -1
  47. package/dist/components/motion/button/index.d.ts +4 -0
  48. package/dist/components/motion/button/index.js +5 -0
  49. package/dist/components/motion/button/magnetic.js +1 -1
  50. package/dist/components/motion/button/stateful.js +2 -2
  51. package/dist/components/motion/center-morph-modal.js +2 -2
  52. package/dist/components/motion/checkbox.js +1 -1
  53. package/dist/components/motion/chromatic-text-reveal.js +1 -1
  54. package/dist/components/motion/command-palette.d.ts +26 -0
  55. package/dist/components/motion/command-palette.d.ts.map +1 -0
  56. package/dist/components/motion/command-palette.js +246 -0
  57. package/dist/components/motion/command-palette.js.map +1 -0
  58. package/dist/components/motion/context-menu.js +2 -2
  59. package/dist/components/motion/cylinder-carousel.js +1 -1
  60. package/dist/components/motion/dock.js +1 -1
  61. package/dist/components/motion/drawer.js +1 -1
  62. package/dist/components/motion/dynamic-island.d.ts +22 -0
  63. package/dist/components/motion/dynamic-island.d.ts.map +1 -0
  64. package/dist/components/motion/dynamic-island.js +143 -0
  65. package/dist/components/motion/dynamic-island.js.map +1 -0
  66. package/dist/components/motion/expandable-action-bar.d.ts +52 -0
  67. package/dist/components/motion/expandable-action-bar.d.ts.map +1 -0
  68. package/dist/components/motion/expandable-action-bar.js +191 -0
  69. package/dist/components/motion/expandable-action-bar.js.map +1 -0
  70. package/dist/components/motion/expandable-tabs.d.ts +33 -0
  71. package/dist/components/motion/expandable-tabs.d.ts.map +1 -0
  72. package/dist/components/motion/expandable-tabs.js +291 -0
  73. package/dist/components/motion/expandable-tabs.js.map +1 -0
  74. package/dist/components/motion/feedback-widget.d.ts +18 -0
  75. package/dist/components/motion/feedback-widget.d.ts.map +1 -0
  76. package/dist/components/motion/feedback-widget.js +413 -0
  77. package/dist/components/motion/feedback-widget.js.map +1 -0
  78. package/dist/components/motion/file-upload.d.ts +48 -0
  79. package/dist/components/motion/file-upload.d.ts.map +1 -0
  80. package/dist/components/motion/file-upload.js +382 -0
  81. package/dist/components/motion/file-upload.js.map +1 -0
  82. package/dist/components/motion/hold-action-button.js +1 -1
  83. package/dist/components/motion/infinite-masonry.d.ts +31 -0
  84. package/dist/components/motion/infinite-masonry.d.ts.map +1 -0
  85. package/dist/components/motion/infinite-masonry.js +223 -0
  86. package/dist/components/motion/infinite-masonry.js.map +1 -0
  87. package/dist/components/motion/input.js +1 -1
  88. package/dist/components/motion/loader.js +1 -1
  89. package/dist/components/motion/magnetic.js +1 -1
  90. package/dist/components/motion/morphing-modal.js +1 -1
  91. package/dist/components/motion/not-found/glitch.d.ts +6 -0
  92. package/dist/components/motion/not-found/glitch.d.ts.map +1 -0
  93. package/dist/components/motion/not-found/glitch.js +90 -0
  94. package/dist/components/motion/not-found/glitch.js.map +1 -0
  95. package/dist/components/motion/not-found/magnetic.d.ts +6 -0
  96. package/dist/components/motion/not-found/magnetic.d.ts.map +1 -0
  97. package/dist/components/motion/not-found/magnetic.js +47 -0
  98. package/dist/components/motion/not-found/magnetic.js.map +1 -0
  99. package/dist/components/motion/not-found/shared.d.ts +32 -0
  100. package/dist/components/motion/not-found/shared.d.ts.map +1 -0
  101. package/dist/components/motion/not-found/shared.js +52 -0
  102. package/dist/components/motion/not-found/shared.js.map +1 -0
  103. package/dist/components/motion/not-found/spotlight.d.ts +6 -0
  104. package/dist/components/motion/not-found/spotlight.d.ts.map +1 -0
  105. package/dist/components/motion/not-found/spotlight.js +70 -0
  106. package/dist/components/motion/not-found/spotlight.js.map +1 -0
  107. package/dist/components/motion/not-found/stacked.d.ts +6 -0
  108. package/dist/components/motion/not-found/stacked.d.ts.map +1 -0
  109. package/dist/components/motion/not-found/stacked.js +95 -0
  110. package/dist/components/motion/not-found/stacked.js.map +1 -0
  111. package/dist/components/motion/not-found/terminal.d.ts +6 -0
  112. package/dist/components/motion/not-found/terminal.d.ts.map +1 -0
  113. package/dist/components/motion/not-found/terminal.js +90 -0
  114. package/dist/components/motion/not-found/terminal.js.map +1 -0
  115. package/dist/components/motion/notification-stack.d.ts +35 -0
  116. package/dist/components/motion/notification-stack.d.ts.map +1 -0
  117. package/dist/components/motion/notification-stack.js +187 -0
  118. package/dist/components/motion/notification-stack.js.map +1 -0
  119. package/dist/components/motion/number-ticker.js +1 -1
  120. package/dist/components/motion/otp-input.d.ts +32 -0
  121. package/dist/components/motion/otp-input.d.ts.map +1 -0
  122. package/dist/components/motion/otp-input.js +272 -0
  123. package/dist/components/motion/otp-input.js.map +1 -0
  124. package/dist/components/motion/overflow-actions.d.ts +39 -0
  125. package/dist/components/motion/overflow-actions.d.ts.map +1 -0
  126. package/dist/components/motion/overflow-actions.js +220 -0
  127. package/dist/components/motion/overflow-actions.js.map +1 -0
  128. package/dist/components/motion/parallax.js +1 -1
  129. package/dist/components/motion/popover-morph.js +2 -2
  130. package/dist/components/motion/popover-morph.js.map +1 -1
  131. package/dist/components/motion/popover.js +1 -1
  132. package/dist/components/motion/preview-rail.js +1 -1
  133. package/dist/components/motion/pull-to-refresh.js +2 -2
  134. package/dist/components/motion/pull-to-refresh.js.map +1 -1
  135. package/dist/components/motion/radio.js +1 -1
  136. package/dist/components/motion/range-slider-bubble.js +1 -1
  137. package/dist/components/motion/range-slider-fluid.js +1 -1
  138. package/dist/components/motion/range-slider-ruler.js +2 -2
  139. package/dist/components/motion/range-slider-ruler.js.map +1 -1
  140. package/dist/components/motion/range-slider-wave.js +1 -1
  141. package/dist/components/motion/range-slider.js +1 -1
  142. package/dist/components/motion/scroll-progress.js +1 -1
  143. package/dist/components/motion/scroll-reveal.js +1 -1
  144. package/dist/components/motion/select-morph.js +2 -2
  145. package/dist/components/motion/select.js +2 -2
  146. package/dist/components/motion/shader-background.js +1 -1
  147. package/dist/components/motion/shared-layout-bg.js +2 -2
  148. package/dist/components/motion/shared-layout-bg.js.map +1 -1
  149. package/dist/components/motion/slide-action-button.js +1 -1
  150. package/dist/components/motion/smooth-scroll.js +1 -1
  151. package/dist/components/motion/swipeable-list.d.ts +60 -0
  152. package/dist/components/motion/swipeable-list.d.ts.map +1 -0
  153. package/dist/components/motion/swipeable-list.js +254 -0
  154. package/dist/components/motion/swipeable-list.js.map +1 -0
  155. package/dist/components/motion/switch.js +1 -1
  156. package/dist/components/motion/table/index.js +1 -1
  157. package/dist/components/motion/table/row-handle.js +1 -1
  158. package/dist/components/motion/table/table-header.js +2 -2
  159. package/dist/components/motion/table/table-menu.js +1 -1
  160. package/dist/components/motion/tabs.js +1 -1
  161. package/dist/components/motion/text-reveal.js +1 -1
  162. package/dist/components/motion/text-shimmer.js +1 -1
  163. package/dist/components/motion/text-shimmer.js.map +1 -1
  164. package/dist/components/motion/theme-toggle.js +2 -2
  165. package/dist/components/motion/tilt-card.js +1 -1
  166. package/dist/components/motion/tooltip.js +1 -1
  167. package/dist/components/motion/wheel-picker.js +1 -1
  168. package/dist/components/reui/alert.d.ts +1 -1
  169. package/dist/components/reui/alert.js +1 -1
  170. package/dist/components/reui/autocomplete.js +1 -1
  171. package/dist/components/reui/badge.d.ts +1 -1
  172. package/dist/components/reui/data-grid/data-grid-column-filter.js +2 -2
  173. package/dist/components/reui/data-grid/data-grid-column-header.js +1 -1
  174. package/dist/components/reui/data-grid/data-grid-pagination.js +1 -1
  175. package/dist/components/reui/data-grid/data-grid-table-dnd-rows.js +1 -1
  176. package/dist/components/reui/data-grid/data-grid-table-dnd.js +1 -1
  177. package/dist/components/reui/data-grid/data-grid-table.js +1 -1
  178. package/dist/components/reui/date-selector.js +2 -2
  179. package/dist/components/reui/event-calendar/event-calendar-agenda-view.js +1 -1
  180. package/dist/components/reui/event-calendar/event-calendar-event.js +1 -1
  181. package/dist/components/reui/event-calendar/event-calendar-month-view.js +1 -1
  182. package/dist/components/reui/event-calendar/event-calendar-nav.js +1 -1
  183. package/dist/components/reui/filters.js +2 -2
  184. package/dist/components/reui/frame.d.ts +1 -1
  185. package/dist/components/reui/frame.js +1 -1
  186. package/dist/components/reui/gantt/gantt-bar.js +1 -1
  187. package/dist/components/reui/gantt/gantt-nav.js +1 -1
  188. package/dist/components/reui/gantt/gantt-view.js +2 -2
  189. package/dist/components/reui/number-field.js +1 -1
  190. package/dist/components/reui/phone-input.js +2 -2
  191. package/dist/components/reui/rating.js +1 -1
  192. package/dist/components/reui/tree.js +1 -1
  193. package/dist/components/ui/accordion.js +1 -1
  194. package/dist/components/ui/alert-dialog.js +1 -1
  195. package/dist/components/ui/alert.js +1 -1
  196. package/dist/components/ui/attachment.d.ts +1 -1
  197. package/dist/components/ui/attachment.js +1 -1
  198. package/dist/components/ui/badge.d.ts +1 -1
  199. package/dist/components/ui/breadcrumb.js +1 -1
  200. package/dist/components/ui/bubble.d.ts +1 -1
  201. package/dist/components/ui/bubble.js +1 -1
  202. package/dist/components/ui/button-group.d.ts +1 -1
  203. package/dist/components/ui/button-group.js +1 -1
  204. package/dist/components/ui/button.d.ts +2 -2
  205. package/dist/components/ui/button.js +2 -2
  206. package/dist/components/ui/calendar.js +1 -1
  207. package/dist/components/ui/carousel.js +1 -1
  208. package/dist/components/ui/checkbox.js +1 -1
  209. package/dist/components/ui/combobox.js +1 -1
  210. package/dist/components/ui/command.js +1 -1
  211. package/dist/components/ui/context-menu.js +1 -1
  212. package/dist/components/ui/dialog.js +1 -1
  213. package/dist/components/ui/dropdown-menu.js +1 -1
  214. package/dist/components/ui/empty.js +1 -1
  215. package/dist/components/ui/field.d.ts +1 -1
  216. package/dist/components/ui/field.js +1 -1
  217. package/dist/components/ui/input-group.js +1 -1
  218. package/dist/components/ui/input-otp.js +1 -1
  219. package/dist/components/ui/item.d.ts +2 -2
  220. package/dist/components/ui/item.js +1 -1
  221. package/dist/components/ui/marker.d.ts +1 -1
  222. package/dist/components/ui/marker.js +1 -1
  223. package/dist/components/ui/menubar.js +1 -1
  224. package/dist/components/ui/message-scroller.js +1 -1
  225. package/dist/components/ui/native-select.js +1 -1
  226. package/dist/components/ui/navigation-menu.js +1 -1
  227. package/dist/components/ui/pagination.js +1 -1
  228. package/dist/components/ui/select.js +1 -1
  229. package/dist/components/ui/sheet.js +1 -1
  230. package/dist/components/ui/sidebar.d.ts +1 -1
  231. package/dist/components/ui/sidebar.js +1 -1
  232. package/dist/components/ui/sonner.js +1 -1
  233. package/dist/components/ui/spinner.js +1 -1
  234. package/dist/components/ui/tabs.js +1 -1
  235. package/dist/components/ui/toast.js +1 -1
  236. package/dist/components/ui/toggle.d.ts +1 -1
  237. package/dist/components/ui/toggle.js +1 -1
  238. package/dist/copy-menu-BJ-MXnkN.js +201 -0
  239. package/dist/copy-menu-BJ-MXnkN.js.map +1 -0
  240. package/dist/types-smkWN_7x.d.ts +20 -0
  241. package/dist/types-smkWN_7x.d.ts.map +1 -0
  242. package/package.json +2 -2
@@ -2,7 +2,7 @@ import { VariantProps } from "class-variance-authority";
2
2
  import { Toggle as Toggle$1 } from "@base-ui/react/toggle";
3
3
  //#region src/components/ui/toggle.d.ts
4
4
  declare const toggleVariants: (props?: ({
5
- variant?: "default" | "outline" | null | undefined;
5
+ variant?: "outline" | "default" | null | undefined;
6
6
  size?: "default" | "sm" | "lg" | null | undefined;
7
7
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
8
  declare function Toggle({ className, variant, size, ...props }: Toggle$1.Props & VariantProps<typeof toggleVariants>): import("react").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { cn } from "@kumix/utils";
3
- import { jsx } from "react/jsx-runtime";
4
3
  import { cva } from "class-variance-authority";
4
+ import { jsx } from "react/jsx-runtime";
5
5
  import { Toggle as Toggle$1 } from "@base-ui/react/toggle";
6
6
  //#region src/components/ui/toggle.tsx
7
7
  const toggleVariants = cva("group/toggle inline-flex items-center justify-center gap-1 whitespace-nowrap rounded-lg font-medium text-sm outline-none transition-all hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-pressed:bg-muted aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=on]:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", {
@@ -0,0 +1,201 @@
1
+ import { SPRING_PRESS } from "./lib/ease.js";
2
+ import { Tooltip } from "./components/motion/tooltip.js";
3
+ import { Checkbox } from "./components/motion/checkbox.js";
4
+ import { MorphPopover, MorphPopoverContent } from "./components/motion/popover-morph.js";
5
+ import { IconButton } from "./components/motion/availability-scheduler/icon-button.js";
6
+ import { useState } from "react";
7
+ import { Check, Copy } from "lucide-react";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
+ import { AnimatePresence, motion } from "motion/react";
10
+ //#region src/components/motion/availability-scheduler/types.ts
11
+ const WEEKDAYS = [
12
+ {
13
+ key: "mon",
14
+ label: "Monday"
15
+ },
16
+ {
17
+ key: "tue",
18
+ label: "Tuesday"
19
+ },
20
+ {
21
+ key: "wed",
22
+ label: "Wednesday"
23
+ },
24
+ {
25
+ key: "thu",
26
+ label: "Thursday"
27
+ },
28
+ {
29
+ key: "fri",
30
+ label: "Friday"
31
+ },
32
+ {
33
+ key: "sat",
34
+ label: "Saturday"
35
+ },
36
+ {
37
+ key: "sun",
38
+ label: "Sunday"
39
+ }
40
+ ];
41
+ const toMinutes = (v) => {
42
+ const [h, m] = v.split(":").map(Number);
43
+ return h * 60 + m;
44
+ };
45
+ const toValue = (mins) => {
46
+ const clamped = Math.max(0, Math.min(1439, mins));
47
+ const h = Math.floor(clamped / 60);
48
+ const m = clamped % 60;
49
+ return `${String(h).padStart(2, "0")}:${String(m).padStart(2, "0")}`;
50
+ };
51
+ const label12 = (v) => {
52
+ const [h, m] = v.split(":").map(Number);
53
+ const ap = h < 12 ? "AM" : "PM";
54
+ return `${h % 12 === 0 ? 12 : h % 12}:${String(m).padStart(2, "0")} ${ap}`;
55
+ };
56
+ function buildOptions(step) {
57
+ const out = [];
58
+ for (let m = 0; m < 1440; m += step) {
59
+ const value = toValue(m);
60
+ out.push({
61
+ value,
62
+ label: label12(value)
63
+ });
64
+ }
65
+ return out;
66
+ }
67
+ function defaultWeek() {
68
+ const workday = (day) => ({
69
+ enabled: true,
70
+ ranges: [{
71
+ id: `${day}-0`,
72
+ start: "09:00",
73
+ end: "17:00"
74
+ }]
75
+ });
76
+ const off = (day) => ({
77
+ enabled: false,
78
+ ranges: [{
79
+ id: `${day}-0`,
80
+ start: "09:00",
81
+ end: "17:00"
82
+ }]
83
+ });
84
+ return {
85
+ mon: workday("mon"),
86
+ tue: workday("tue"),
87
+ wed: workday("wed"),
88
+ thu: workday("thu"),
89
+ fri: workday("fri"),
90
+ sat: off("sat"),
91
+ sun: off("sun")
92
+ };
93
+ }
94
+ //#endregion
95
+ //#region src/components/motion/availability-scheduler/copy-menu.tsx
96
+ function CopyMenu({ fromLabel, reduce, onApply }) {
97
+ const [open, setOpen] = useState(false);
98
+ const [copied, setCopied] = useState(false);
99
+ const [picked, setPicked] = useState(/* @__PURE__ */ new Set());
100
+ const others = WEEKDAYS.filter((d) => d.label !== fromLabel);
101
+ const toggle = (k) => setPicked((prev) => {
102
+ const next = new Set(prev);
103
+ if (next.has(k)) next.delete(k);
104
+ else next.add(k);
105
+ return next;
106
+ });
107
+ const apply = (targets) => {
108
+ if (!targets.length) return;
109
+ onApply(targets);
110
+ setOpen(false);
111
+ setPicked(/* @__PURE__ */ new Set());
112
+ setCopied(true);
113
+ window.setTimeout(() => setCopied(false), 1200);
114
+ };
115
+ return /* @__PURE__ */ jsxs(MorphPopover, {
116
+ open,
117
+ onOpenChange: setOpen,
118
+ children: [/* @__PURE__ */ jsx(Tooltip, {
119
+ content: "Copy times",
120
+ children: /* @__PURE__ */ jsx(IconButton, {
121
+ label: `Copy ${fromLabel} hours to other days`,
122
+ reduce,
123
+ expanded: open,
124
+ onClick: () => setOpen(!open),
125
+ children: /* @__PURE__ */ jsx(AnimatePresence, {
126
+ mode: "popLayout",
127
+ initial: false,
128
+ children: copied ? /* @__PURE__ */ jsx(motion.span, {
129
+ initial: reduce ? { opacity: 0 } : {
130
+ opacity: 0,
131
+ scale: .5
132
+ },
133
+ animate: {
134
+ opacity: 1,
135
+ scale: 1
136
+ },
137
+ exit: reduce ? { opacity: 0 } : {
138
+ opacity: 0,
139
+ scale: .5
140
+ },
141
+ transition: SPRING_PRESS,
142
+ className: "text-foreground",
143
+ children: /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" })
144
+ }, "done") : /* @__PURE__ */ jsx(motion.span, {
145
+ initial: reduce ? { opacity: 0 } : {
146
+ opacity: 0,
147
+ scale: .5
148
+ },
149
+ animate: {
150
+ opacity: 1,
151
+ scale: 1
152
+ },
153
+ exit: reduce ? { opacity: 0 } : {
154
+ opacity: 0,
155
+ scale: .5
156
+ },
157
+ transition: SPRING_PRESS,
158
+ children: /* @__PURE__ */ jsx(Copy, { className: "h-4 w-4" })
159
+ }, "copy")
160
+ })
161
+ })
162
+ }), /* @__PURE__ */ jsxs(MorphPopoverContent, {
163
+ align: "end",
164
+ className: "w-52 p-2",
165
+ children: [
166
+ /* @__PURE__ */ jsx("p", {
167
+ className: "px-2 py-1.5 font-medium text-muted-foreground text-xs",
168
+ children: "Copy times to"
169
+ }),
170
+ /* @__PURE__ */ jsx("div", {
171
+ className: "flex flex-col",
172
+ children: others.map((d) => /* @__PURE__ */ jsx(Checkbox, {
173
+ checked: picked.has(d.key),
174
+ onCheckedChange: () => toggle(d.key),
175
+ label: d.label,
176
+ 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"
177
+ }, d.key))
178
+ }),
179
+ /* @__PURE__ */ jsxs("div", {
180
+ className: "mt-1 flex items-center gap-2 border-border border-t px-1 pt-2",
181
+ children: [/* @__PURE__ */ jsx("button", {
182
+ type: "button",
183
+ onClick: () => apply(others.map((d) => d.key)),
184
+ 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",
185
+ children: "Every day"
186
+ }), /* @__PURE__ */ jsx("button", {
187
+ type: "button",
188
+ onClick: () => apply([...picked]),
189
+ disabled: picked.size === 0,
190
+ 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",
191
+ children: "Apply"
192
+ })]
193
+ })
194
+ ]
195
+ })]
196
+ });
197
+ }
198
+ //#endregion
199
+ export { toMinutes as a, defaultWeek as i, WEEKDAYS as n, toValue as o, buildOptions as r, CopyMenu as t };
200
+
201
+ //# sourceMappingURL=copy-menu-BJ-MXnkN.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copy-menu-BJ-MXnkN.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,MA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;MAEE,SAAS,SAAS,EAAE,SAAS,EAAE,IAAI;OAAE,SAAS;OAAG,OAAO;MAAI;MAC5D,SAAS;OAAE,SAAS;OAAG,OAAO;MAAE;MAChC,MAAM,SAAS,EAAE,SAAS,EAAE,IAAI;OAAE,SAAS;OAAG,OAAO;MAAI;MACzD,YAAY;MAEZ,UAAA,oBAAC,MAAD,EAAM,WAAU,UAAW,CAAA;KAChB,GAPP,MAOO;IAEA,CAAA;GACP,CAAA;EACL,CAAA,GAET,qBAAC,qBAAD;GAAqB,OAAM;GAAM,WAAU;GAA3C,UAAA;IACE,oBAAC,KAAD;KAAG,WAAU;KAAwD,UAAA;IAAgB,CAAA;IACrF,oBAAC,OAAD;KAAK,WAAU;KACZ,UAAA,OAAO,KAAK,MACX,oBAAC,UAAD;MAEE,SAAS,OAAO,IAAI,EAAE,GAAG;MACzB,uBAAuB,OAAO,EAAE,GAAG;MACnC,OAAO,EAAE;MACT,WAAU;KACX,GALM,EAAE,GAKR,CACF;IACE,CAAA;IACL,qBAAC,OAAD;KAAK,WAAU;KAAf,UAAA,CACE,oBAAC,UAAD;MACE,MAAK;MACL,eAAe,MAAM,OAAO,KAAK,MAAM,EAAE,GAAG,CAAC;MAC7C,WAAU;MACX,UAAA;KAEO,CAAA,GACR,oBAAC,UAAD;MACE,MAAK;MACL,eAAe,MAAM,CAAC,GAAG,MAAM,CAAC;MAChC,UAAU,OAAO,SAAS;MAC1B,WAAU;MACX,UAAA;KAEO,CAAA,CACL;;GACc;EACT,CAAA,CAAA;;AAElB"}
@@ -0,0 +1,20 @@
1
+ //#region src/components/motion/availability-scheduler/types.d.ts
2
+ type DayKey = "mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun";
3
+ type TimeRange = {
4
+ id: string;
5
+ start: string;
6
+ end: string;
7
+ };
8
+ type DayAvailability = {
9
+ enabled: boolean;
10
+ ranges: TimeRange[];
11
+ };
12
+ type WeekAvailability = Record<DayKey, DayAvailability>;
13
+ type TimeOption = {
14
+ value: string;
15
+ label: string;
16
+ };
17
+ declare function defaultWeek(): WeekAvailability;
18
+ //#endregion
19
+ export { WeekAvailability as a, TimeRange as i, DayKey as n, defaultWeek as o, TimeOption as r, DayAvailability as t };
20
+ //# sourceMappingURL=types-smkWN_7x.d.ts.map
@@ -0,0 +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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kumix/ui",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
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",
@@ -39,7 +39,7 @@
39
39
  "types:check": "tsc --noEmit",
40
40
  "add:shadcn": "shadcn add --all --overwrite",
41
41
  "add:reui": "shadcn add @reui/alert @reui/autocomplete @reui/badge @reui/data-grid @reui/date-selector @reui/event-calendar @reui/use-file-upload @reui/filters @reui/frame @reui/gantt @reui/icon-stack @reui/icon-tile @reui/kanban @reui/number-field @reui/phone-input @reui/rating @reui/scrollspy @reui/sortable @reui/stepper @reui/timeline @reui/tree --overwrite",
42
- "add:beui": "shadcn add @beui/marquee @beui/tabs @beui/switch @beui/input @beui/select @beui/select-morph @beui/checkbox @beui/radio @beui/bottom-sheet @beui/pull-to-refresh @beui/shared-layout-bg @beui/bounce-sidebar @beui/animated-sidebar @beui/preview-rail @beui/dock @beui/tooltip @beui/context-menu @beui/popover @beui/popover-morph @beui/morphing-modal @beui/center-morph-modal @beui/chromatic-text-reveal @beui/text-reveal @beui/text-shimmer @beui/text-cascade @beui/number-ticker @beui/animated-number @beui/animated-badge @beui/action-swap-cascade @beui/action-swap-blur @beui/action-swap-roll @beui/animated-toast-stack @beui/theme-toggle @beui/bouncy-accordion @beui/drawer @beui/smooth-scroll @beui/scroll-progress @beui/parallax @beui/scroll-to @beui/scroll-reveal @beui/range-slider @beui/range-slider-fluid @beui/range-slider-wave @beui/range-slider-bubble @beui/range-slider-ruler @beui/wheel-picker @beui/table @beui/table-editable @beui/table-async @beui/shader-background @beui/cylinder-carousel @beui/loader @beui/tilt-card @beui/button-base @beui/button-stateful @beui/button-magnetic @beui/hold-action-button @beui/slide-action-button --overwrite"
42
+ "add:beui": "shadcn add @beui/marquee @beui/tabs @beui/switch @beui/input @beui/select @beui/select-morph @beui/checkbox @beui/radio @beui/bottom-sheet @beui/pull-to-refresh @beui/shared-layout-bg @beui/bounce-sidebar @beui/animated-sidebar @beui/preview-rail @beui/dock @beui/tooltip @beui/context-menu @beui/popover @beui/popover-morph @beui/morphing-modal @beui/center-morph-modal @beui/chromatic-text-reveal @beui/text-reveal @beui/text-shimmer @beui/text-cascade @beui/number-ticker @beui/animated-number @beui/animated-badge @beui/action-swap-cascade @beui/action-swap-blur @beui/action-swap-roll @beui/animated-toast-stack @beui/theme-toggle @beui/bouncy-accordion @beui/drawer @beui/smooth-scroll @beui/scroll-progress @beui/parallax @beui/scroll-to @beui/scroll-reveal @beui/range-slider @beui/range-slider-fluid @beui/range-slider-wave @beui/range-slider-bubble @beui/range-slider-ruler @beui/wheel-picker @beui/table @beui/table-editable @beui/table-async @beui/shader-background @beui/cylinder-carousel @beui/loader @beui/tilt-card @beui/button-base @beui/button-stateful @beui/button-magnetic @beui/hold-action-button @beui/slide-action-button @beui/availability-scheduler @beui/dynamic-island @beui/command-palette @beui/expandable-action-bar @beui/overflow-actions @beui/expandable-tabs @beui/swipeable-list @beui/attachment-upload @beui/file-upload @beui/otp-input @beui/bloom-menu @beui/feedback-widget @beui/not-found-glitch @beui/not-found-magnetic @beui/not-found-spotlight @beui/not-found-stacked @beui/not-found-terminal @beui/infinite-masonry @beui/notification-stack --overwrite"
43
43
  },
44
44
  "homepage": "https://github.com/kumixlabs/ui",
45
45
  "repository": {