@pibit.ai/cure-design-system 0.3.17 → 0.3.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/dist/applications/schedule-calendar/index.d.ts +4 -0
  2. package/dist/applications/schedule-calendar/index.d.ts.map +1 -0
  3. package/dist/applications/schedule-calendar/schedule-calendar.d.ts +3 -0
  4. package/dist/applications/schedule-calendar/schedule-calendar.d.ts.map +1 -0
  5. package/dist/applications/schedule-calendar/schedule-calendar.js +202 -0
  6. package/dist/applications/schedule-calendar/types.d.ts +56 -0
  7. package/dist/applications/schedule-calendar/types.d.ts.map +1 -0
  8. package/dist/applications/schedule-calendar/types.js +40 -0
  9. package/dist/applications/schedule-calendar/utils.d.ts +21 -0
  10. package/dist/applications/schedule-calendar/utils.d.ts.map +1 -0
  11. package/dist/applications/schedule-calendar/utils.js +152 -0
  12. package/dist/applications/schedule-calendar/utils.test.d.ts +2 -0
  13. package/dist/applications/schedule-calendar/utils.test.d.ts.map +1 -0
  14. package/dist/assets/icons/group-by.svg.js +4 -0
  15. package/dist/assets/icons/reorder-dots-new.svg.js +4 -0
  16. package/dist/assets/icons/reorder-dots.svg.js +4 -0
  17. package/dist/assets/icons/resize-1.svg.js +4 -0
  18. package/dist/assets/icons/resize-2.svg.js +4 -0
  19. package/dist/assets/icons/resize-4.svg.js +4 -0
  20. package/dist/assets/icons/resize-5.svg.js +4 -0
  21. package/dist/assets/icons/show-summary.svg.js +4 -0
  22. package/dist/index.d.ts +5 -1
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js +132 -59
  25. package/dist/node_modules/framer-motion/dist/es/components/Reorder/Group.js +46 -0
  26. package/dist/node_modules/framer-motion/dist/es/components/Reorder/Item.js +34 -0
  27. package/dist/node_modules/framer-motion/dist/es/components/Reorder/utils/auto-scroll.js +65 -0
  28. package/dist/node_modules/framer-motion/dist/es/components/Reorder/utils/check-reorder.js +17 -0
  29. package/dist/node_modules/framer-motion/dist/es/context/ReorderContext.js +5 -0
  30. package/dist/node_modules/framer-motion/dist/es/gestures/drag/use-drag-controls.js +70 -0
  31. package/dist/node_modules/framer-motion/dist/es/value/use-combine-values.js +15 -0
  32. package/dist/node_modules/framer-motion/dist/es/value/use-computed.js +10 -0
  33. package/dist/node_modules/framer-motion/dist/es/value/use-motion-value.js +15 -0
  34. package/dist/node_modules/framer-motion/dist/es/value/use-transform.js +23 -0
  35. package/dist/node_modules/motion-dom/dist/es/projection/node/create-projection-node.js +1 -1
  36. package/dist/node_modules/motion-dom/dist/es/utils/transform.js +8 -0
  37. package/dist/node_modules/motion-dom/dist/es/value/index.js +21 -18
  38. package/dist/node_modules/motion-utils/dist/es/array.js +15 -6
  39. package/dist/patterns/table/TablePagination.d.ts +23 -0
  40. package/dist/patterns/table/TablePagination.d.ts.map +1 -0
  41. package/dist/patterns/table/TablePagination.js +60 -0
  42. package/dist/patterns/table/TableWrapper.d.ts +2 -72
  43. package/dist/patterns/table/TableWrapper.d.ts.map +1 -1
  44. package/dist/patterns/table/TableWrapper.js +730 -75
  45. package/dist/patterns/table/index.d.ts +11 -1
  46. package/dist/patterns/table/index.d.ts.map +1 -1
  47. package/dist/patterns/table/pagination-base.d.ts +78 -0
  48. package/dist/patterns/table/pagination-base.d.ts.map +1 -0
  49. package/dist/patterns/table/pagination-base.js +127 -0
  50. package/dist/patterns/table/pagination-card.d.ts +9 -0
  51. package/dist/patterns/table/pagination-card.d.ts.map +1 -0
  52. package/dist/patterns/table/pagination-card.js +65 -0
  53. package/dist/patterns/table/row-height-icons.d.ts +9 -0
  54. package/dist/patterns/table/row-height-icons.d.ts.map +1 -0
  55. package/dist/patterns/table/row-height-icons.js +13 -0
  56. package/dist/patterns/table/storyHelpers/mockToolbarSlots.d.ts +7 -0
  57. package/dist/patterns/table/storyHelpers/mockToolbarSlots.d.ts.map +1 -0
  58. package/dist/patterns/table/storyHelpers/useMockTableState.d.ts +31 -0
  59. package/dist/patterns/table/storyHelpers/useMockTableState.d.ts.map +1 -0
  60. package/dist/patterns/table/storyHelpers/useMockTableToolbar.d.ts +3 -0
  61. package/dist/patterns/table/storyHelpers/useMockTableToolbar.d.ts.map +1 -0
  62. package/dist/patterns/table/table.d.ts +10 -13
  63. package/dist/patterns/table/table.d.ts.map +1 -1
  64. package/dist/patterns/table/table.js +235 -312
  65. package/dist/patterns/table/toolbar/AlignDropdown.d.ts +11 -0
  66. package/dist/patterns/table/toolbar/AlignDropdown.d.ts.map +1 -0
  67. package/dist/patterns/table/toolbar/AlignDropdown.js +77 -0
  68. package/dist/patterns/table/toolbar/BasicSortPanel.d.ts +6 -0
  69. package/dist/patterns/table/toolbar/BasicSortPanel.d.ts.map +1 -0
  70. package/dist/patterns/table/toolbar/BulkActionBar.d.ts +12 -0
  71. package/dist/patterns/table/toolbar/BulkActionBar.d.ts.map +1 -0
  72. package/dist/patterns/table/toolbar/BulkActionBar.js +62 -0
  73. package/dist/patterns/table/toolbar/ColumnHeaderMenu.d.ts +41 -0
  74. package/dist/patterns/table/toolbar/ColumnHeaderMenu.d.ts.map +1 -0
  75. package/dist/patterns/table/toolbar/ColumnHeaderMenu.js +171 -0
  76. package/dist/patterns/table/toolbar/GroupByDropdown.d.ts +11 -0
  77. package/dist/patterns/table/toolbar/GroupByDropdown.d.ts.map +1 -0
  78. package/dist/patterns/table/toolbar/GroupByDropdown.js +80 -0
  79. package/dist/patterns/table/toolbar/HideFieldsDropdown.d.ts +13 -0
  80. package/dist/patterns/table/toolbar/HideFieldsDropdown.d.ts.map +1 -0
  81. package/dist/patterns/table/toolbar/HideFieldsDropdown.js +180 -0
  82. package/dist/patterns/table/toolbar/LegacySortFilterTools.d.ts +9 -0
  83. package/dist/patterns/table/toolbar/LegacySortFilterTools.d.ts.map +1 -0
  84. package/dist/patterns/table/toolbar/RowActionsMenu.d.ts +19 -0
  85. package/dist/patterns/table/toolbar/RowActionsMenu.d.ts.map +1 -0
  86. package/dist/patterns/table/toolbar/RowActionsMenu.js +84 -0
  87. package/dist/patterns/table/toolbar/RowHeightDropdown.d.ts +9 -0
  88. package/dist/patterns/table/toolbar/RowHeightDropdown.d.ts.map +1 -0
  89. package/dist/patterns/table/toolbar/RowHeightDropdown.js +60 -0
  90. package/dist/patterns/table/toolbar/ShowSummaryDropdown.d.ts +8 -0
  91. package/dist/patterns/table/toolbar/ShowSummaryDropdown.d.ts.map +1 -0
  92. package/dist/patterns/table/toolbar/ShowSummaryDropdown.js +22 -0
  93. package/dist/patterns/table/toolbar/SummaryFooter.d.ts +16 -0
  94. package/dist/patterns/table/toolbar/SummaryFooter.d.ts.map +1 -0
  95. package/dist/patterns/table/toolbar/SummaryFooter.js +83 -0
  96. package/dist/patterns/table/toolbar/TableToolbar.d.ts +55 -0
  97. package/dist/patterns/table/toolbar/TableToolbar.d.ts.map +1 -0
  98. package/dist/patterns/table/toolbar/TableToolbar.js +234 -0
  99. package/dist/patterns/table/toolbar/ToolbarRadio.d.ts +18 -0
  100. package/dist/patterns/table/toolbar/ToolbarRadio.d.ts.map +1 -0
  101. package/dist/patterns/table/toolbar/ToolbarRadio.js +63 -0
  102. package/dist/patterns/table/toolbar/index.d.ts +24 -0
  103. package/dist/patterns/table/toolbar/index.d.ts.map +1 -0
  104. package/dist/patterns/table/toolbar/legacyToolbarTypes.d.ts +69 -0
  105. package/dist/patterns/table/toolbar/legacyToolbarTypes.d.ts.map +1 -0
  106. package/dist/patterns/table/toolbar/tableToolbarHelpers.d.ts +35 -0
  107. package/dist/patterns/table/toolbar/tableToolbarHelpers.d.ts.map +1 -0
  108. package/dist/patterns/table/toolbar/tableToolbarHelpers.js +259 -0
  109. package/dist/patterns/table/toolbar/tableToolbarHelpers.test.d.ts +2 -0
  110. package/dist/patterns/table/toolbar/tableToolbarHelpers.test.d.ts.map +1 -0
  111. package/dist/patterns/table/toolbar/toolbarExtensions.d.ts +12 -0
  112. package/dist/patterns/table/toolbar/toolbarExtensions.d.ts.map +1 -0
  113. package/dist/patterns/table/toolbar/toolbarExtensions.js +18 -0
  114. package/dist/patterns/table/toolbar-icons.d.ts +8 -0
  115. package/dist/patterns/table/toolbar-icons.d.ts.map +1 -0
  116. package/dist/patterns/table/toolbar-icons.js +13 -0
  117. package/dist/patterns/table/types.d.ts +141 -0
  118. package/dist/patterns/table/types.d.ts.map +1 -0
  119. package/dist/patterns/table/useGridKeyboardNavigation.d.ts +38 -0
  120. package/dist/patterns/table/useGridKeyboardNavigation.d.ts.map +1 -0
  121. package/dist/patterns/table/useGridKeyboardNavigation.js +65 -0
  122. package/dist/primitives/checkbox/checkbox.d.ts +2 -2
  123. package/dist/primitives/checkbox/checkbox.d.ts.map +1 -1
  124. package/dist/primitives/dropdown/dropdown.d.ts +32 -0
  125. package/dist/primitives/dropdown/dropdown.d.ts.map +1 -0
  126. package/dist/primitives/dropdown/dropdown.js +118 -0
  127. package/dist/primitives/dropdown/index.d.ts +2 -0
  128. package/dist/primitives/dropdown/index.d.ts.map +1 -0
  129. package/dist/primitives/select/ExpandableSearchInput.d.ts +5 -1
  130. package/dist/primitives/select/ExpandableSearchInput.d.ts.map +1 -1
  131. package/dist/primitives/select/ExpandableSearchInput.js +80 -77
  132. package/dist/primitives/shimmer/index.d.ts +2 -0
  133. package/dist/primitives/shimmer/index.d.ts.map +1 -0
  134. package/dist/primitives/shimmer/shimmer.d.ts +24 -0
  135. package/dist/primitives/shimmer/shimmer.d.ts.map +1 -0
  136. package/dist/primitives/shimmer/shimmer.js +37 -0
  137. package/dist/primitives/snackbar/index.d.ts +2 -0
  138. package/dist/primitives/snackbar/index.d.ts.map +1 -0
  139. package/dist/primitives/snackbar/snackbar.d.ts +27 -0
  140. package/dist/primitives/snackbar/snackbar.d.ts.map +1 -0
  141. package/dist/primitives/snackbar/snackbar.js +107 -0
  142. package/dist/styles/components.css +1 -1
  143. package/dist/styles/theme.css +1 -1
  144. package/package.json +4 -1
package/dist/index.js CHANGED
@@ -1,70 +1,143 @@
1
1
  import "./styles/theme.css";
2
2
  /* empty css */
3
3
  import { cn as p, cx as m, sortCx as i } from "./utils/cn.js";
4
- import { isClassComponent as x, isForwardRefComponent as a, isFunctionComponent as n, isReactComponent as f } from "./utils/is-react-component.js";
5
- import { Button as c, styles as d } from "./primitives/button/button.js";
6
- import { ButtonUtility as C } from "./primitives/button/button-utility.js";
7
- import { Input as u } from "./primitives/input/input.js";
8
- import { Checkbox as b } from "./primitives/checkbox/checkbox.js";
9
- import { Toggle as I } from "./primitives/toggle/toggle.js";
10
- import { Badge as W, BadgeIcon as w, BadgeWithButton as y, BadgeWithDot as E, BadgeWithFlag as F, BadgeWithIcon as v, BadgeWithImage as N, filledColors as R } from "./primitives/badge/badge.js";
11
- import { Avatar as k } from "./primitives/avatar/avatar.js";
12
- import { Icon as D } from "./primitives/icon/icon.js";
13
- import { Text as M } from "./primitives/text/text.js";
14
- import { Heading as P } from "./primitives/heading/heading.js";
4
+ import { isClassComponent as n, isForwardRefComponent as l, isFunctionComponent as f, isReactComponent as x } from "./utils/is-react-component.js";
5
+ import { default as s, ShimmerBox as g, ShimmerCircle as u, ShimmerLine as T } from "./primitives/shimmer/shimmer.js";
6
+ import { Button as C, styles as S } from "./primitives/button/button.js";
7
+ import { ButtonUtility as h } from "./primitives/button/button-utility.js";
8
+ import { Input as A } from "./primitives/input/input.js";
9
+ import { Checkbox as E } from "./primitives/checkbox/checkbox.js";
10
+ import { Toggle as G } from "./primitives/toggle/toggle.js";
11
+ import { Badge as R, BadgeIcon as W, BadgeWithButton as D, BadgeWithDot as y, BadgeWithFlag as N, BadgeWithIcon as O, BadgeWithImage as v, filledColors as F } from "./primitives/badge/badge.js";
12
+ import { Avatar as P } from "./primitives/avatar/avatar.js";
13
+ import { Icon as k } from "./primitives/icon/icon.js";
14
+ import { Text as K } from "./primitives/text/text.js";
15
+ import { Heading as U } from "./primitives/heading/heading.js";
15
16
  import { Select as j } from "./primitives/select/select.js";
16
17
  import { SearchableSelect as z } from "./primitives/select/searchable-select.js";
17
- import { MultiSelect as J } from "./primitives/select/multi-select.js";
18
- import { Popover as L } from "./primitives/select/popover.js";
19
- import { ExpandableSearchInput as X } from "./primitives/select/ExpandableSearchInput.js";
20
- import { Tooltip as Z, TooltipTrigger as _ } from "./primitives/tooltip/tooltip.js";
21
- import { EllipsisContentWithTooltip as oo, createEllipsisContent as eo } from "./primitives/tooltip/ellipsis-content.js";
22
- import { CustomIcon as ro } from "./primitives/custom-icon/custom-icon.js";
23
- import { ICONS as mo } from "./primitives/custom-icon/registry.js";
24
- import { Table as lo, TableCard as xo, TableCell as ao } from "./patterns/table/table.js";
25
- import { TableWrapper as fo } from "./patterns/table/TableWrapper.js";
26
- import { TreeView as co, buildTreeViewNodes as go } from "./patterns/tree-view/tree-view.js";
18
+ import { MultiSelect as Q } from "./primitives/select/multi-select.js";
19
+ import { Popover as Z } from "./primitives/select/popover.js";
20
+ import { ExpandableSearchInput as oo } from "./primitives/select/ExpandableSearchInput.js";
21
+ import { Tooltip as eo, TooltipTrigger as to } from "./primitives/tooltip/tooltip.js";
22
+ import { EllipsisContentWithTooltip as mo, createEllipsisContent as io } from "./primitives/tooltip/ellipsis-content.js";
23
+ import { CustomIcon as no } from "./primitives/custom-icon/custom-icon.js";
24
+ import { ICONS as fo } from "./primitives/custom-icon/registry.js";
25
+ import { Dropdown as so } from "./primitives/dropdown/dropdown.js";
26
+ import { Snackbar as uo } from "./primitives/snackbar/snackbar.js";
27
+ import { ScheduleCalendar as co } from "./applications/schedule-calendar/schedule-calendar.js";
28
+ import { WEEKDAYS as So } from "./applications/schedule-calendar/types.js";
29
+ import { cellSetToSchedules as ho, formatHour as wo, formatHourLabel as Ao, mergeHoursToWindows as Bo, schedulesToCellSet as Eo } from "./applications/schedule-calendar/utils.js";
30
+ import { Table as Go, TableCard as Ho, TableCell as Ro, TableRowActionsDropdown as Wo } from "./patterns/table/table.js";
31
+ import { TableWrapper as yo } from "./patterns/table/TableWrapper.js";
32
+ import { TablePagination as Oo } from "./patterns/table/TablePagination.js";
33
+ import { PaginationCardDefault as Fo } from "./patterns/table/pagination-card.js";
34
+ import { Pagination as Po } from "./patterns/table/pagination-base.js";
35
+ import { ROW_HEIGHT_ICONS as ko } from "./patterns/table/row-height-icons.js";
36
+ import { TOOLBAR_ICONS as Ko } from "./patterns/table/toolbar-icons.js";
37
+ import { TableToolbar as Uo, pickCoreToolbarProps as Yo } from "./patterns/table/toolbar/TableToolbar.js";
38
+ import { getToolbarExtensions as qo, registerToolbarExtensions as zo } from "./patterns/table/toolbar/toolbarExtensions.js";
39
+ import { RowHeightDropdown as Qo } from "./patterns/table/toolbar/RowHeightDropdown.js";
40
+ import { HideFieldsDropdown as Zo } from "./patterns/table/toolbar/HideFieldsDropdown.js";
41
+ import { AlignDropdown as or } from "./patterns/table/toolbar/AlignDropdown.js";
42
+ import { GroupByDropdown as er } from "./patterns/table/toolbar/GroupByDropdown.js";
43
+ import { ShowSummaryDropdown as pr } from "./patterns/table/toolbar/ShowSummaryDropdown.js";
44
+ import { SummaryFooterRow as ir } from "./patterns/table/toolbar/SummaryFooter.js";
45
+ import { ColumnHeaderMenu as nr } from "./patterns/table/toolbar/ColumnHeaderMenu.js";
46
+ import { RowActionsMenu as fr } from "./patterns/table/toolbar/RowActionsMenu.js";
47
+ import { BulkActionBar as dr } from "./patterns/table/toolbar/BulkActionBar.js";
48
+ import { AGGREGATION_LABELS as gr, ROW_HEIGHT_CLASS as ur, alignmentClass as Tr, applyHideAndReorder as cr, computeAggregation as Cr, getAggregationsForType as Sr, getDefaultAlignmentForType as br, getEffectiveAlignment as hr, groupRows as wr, resolveColumnLabel as Ar } from "./patterns/table/toolbar/tableToolbarHelpers.js";
49
+ import { GridNavProvider as Er, findGridCell as Ir, focusGridCell as Gr, getGridNeighbor as Hr, getGridTabNeighbor as Rr, isWithinCellEditor as Wr, useGridKeyboardNavigation as Dr } from "./patterns/table/useGridKeyboardNavigation.js";
50
+ import { TreeView as Nr, buildTreeViewNodes as Or } from "./patterns/tree-view/tree-view.js";
27
51
  export {
28
- k as Avatar,
29
- W as Badge,
30
- w as BadgeIcon,
31
- y as BadgeWithButton,
32
- E as BadgeWithDot,
33
- F as BadgeWithFlag,
34
- v as BadgeWithIcon,
35
- N as BadgeWithImage,
36
- c as Button,
37
- C as ButtonUtility,
38
- b as Checkbox,
39
- ro as CustomIcon,
40
- oo as EllipsisContentWithTooltip,
41
- X as ExpandableSearchInput,
42
- P as Heading,
43
- mo as ICONS,
44
- D as Icon,
45
- u as Input,
46
- J as MultiSelect,
47
- L as Popover,
52
+ gr as AGGREGATION_LABELS,
53
+ or as AlignDropdown,
54
+ P as Avatar,
55
+ R as Badge,
56
+ W as BadgeIcon,
57
+ D as BadgeWithButton,
58
+ y as BadgeWithDot,
59
+ N as BadgeWithFlag,
60
+ O as BadgeWithIcon,
61
+ v as BadgeWithImage,
62
+ dr as BulkActionBar,
63
+ C as Button,
64
+ h as ButtonUtility,
65
+ E as Checkbox,
66
+ nr as ColumnHeaderMenu,
67
+ no as CustomIcon,
68
+ so as Dropdown,
69
+ mo as EllipsisContentWithTooltip,
70
+ oo as ExpandableSearchInput,
71
+ Er as GridNavProvider,
72
+ er as GroupByDropdown,
73
+ U as Heading,
74
+ Zo as HideFieldsDropdown,
75
+ fo as ICONS,
76
+ k as Icon,
77
+ A as Input,
78
+ Q as MultiSelect,
79
+ Po as Pagination,
80
+ Fo as PaginationCardDefault,
81
+ Z as Popover,
82
+ ur as ROW_HEIGHT_CLASS,
83
+ ko as ROW_HEIGHT_ICONS,
84
+ fr as RowActionsMenu,
85
+ Qo as RowHeightDropdown,
86
+ co as ScheduleCalendar,
48
87
  z as SearchableSelect,
49
88
  j as Select,
50
- lo as Table,
51
- xo as TableCard,
52
- ao as TableCell,
53
- fo as TableWrapper,
54
- M as Text,
55
- I as Toggle,
56
- Z as Tooltip,
57
- _ as TooltipTrigger,
58
- co as TreeView,
59
- go as buildTreeViewNodes,
60
- d as buttonStyles,
89
+ s as Shimmer,
90
+ g as ShimmerBox,
91
+ u as ShimmerCircle,
92
+ T as ShimmerLine,
93
+ pr as ShowSummaryDropdown,
94
+ uo as Snackbar,
95
+ ir as SummaryFooterRow,
96
+ Ko as TOOLBAR_ICONS,
97
+ Go as Table,
98
+ Ho as TableCard,
99
+ Ro as TableCell,
100
+ Oo as TablePagination,
101
+ Wo as TableRowActionsDropdown,
102
+ Uo as TableToolbar,
103
+ yo as TableWrapper,
104
+ K as Text,
105
+ G as Toggle,
106
+ eo as Tooltip,
107
+ to as TooltipTrigger,
108
+ Nr as TreeView,
109
+ So as WEEKDAYS,
110
+ Tr as alignmentClass,
111
+ cr as applyHideAndReorder,
112
+ Or as buildTreeViewNodes,
113
+ S as buttonStyles,
114
+ ho as cellSetToSchedules,
61
115
  p as cn,
62
- eo as createEllipsisContent,
116
+ Cr as computeAggregation,
117
+ io as createEllipsisContent,
63
118
  m as cx,
64
- R as filledColors,
65
- x as isClassComponent,
66
- a as isForwardRefComponent,
67
- n as isFunctionComponent,
68
- f as isReactComponent,
69
- i as sortCx
119
+ F as filledColors,
120
+ Ir as findGridCell,
121
+ Gr as focusGridCell,
122
+ wo as formatHour,
123
+ Ao as formatHourLabel,
124
+ Sr as getAggregationsForType,
125
+ br as getDefaultAlignmentForType,
126
+ hr as getEffectiveAlignment,
127
+ Hr as getGridNeighbor,
128
+ Rr as getGridTabNeighbor,
129
+ qo as getToolbarExtensions,
130
+ wr as groupRows,
131
+ n as isClassComponent,
132
+ l as isForwardRefComponent,
133
+ f as isFunctionComponent,
134
+ x as isReactComponent,
135
+ Wr as isWithinCellEditor,
136
+ Bo as mergeHoursToWindows,
137
+ Yo as pickCoreToolbarProps,
138
+ zo as registerToolbarExtensions,
139
+ Ar as resolveColumnLabel,
140
+ Eo as schedulesToCellSet,
141
+ i as sortCx,
142
+ Dr as useGridKeyboardNavigation
70
143
  };
@@ -0,0 +1,46 @@
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import { forwardRef as w, useRef as a, useEffect as G } from "react";
3
+ import { ReorderContext as O } from "../../context/ReorderContext.js";
4
+ import { motion as x } from "../../render/components/motion/proxy.js";
5
+ import { useConstant as I } from "../../utils/use-constant.js";
6
+ import { checkReorder as S } from "./utils/check-reorder.js";
7
+ import { invariant as b } from "../../../../../motion-utils/dist/es/errors.js";
8
+ function j({ children: e, as: c = "ul", axis: f = "y", onReorder: v, values: d, ...m }, t) {
9
+ const y = I(() => x[c]), o = [], s = a(!1), p = a(null);
10
+ b(!!d, "Reorder.Group must be provided a values prop", "reorder-values");
11
+ const R = {
12
+ axis: f,
13
+ groupRef: p,
14
+ registerItem: (r, n) => {
15
+ const u = o.findIndex((i) => r === i.value);
16
+ u !== -1 ? o[u].layout = n[f] : o.push({ value: r, layout: n[f] }), o.sort(A);
17
+ },
18
+ updateOrder: (r, n, u) => {
19
+ if (s.current)
20
+ return;
21
+ const i = S(o, r, n, u);
22
+ o !== i && (s.current = !0, v(i.map(k).filter((C) => d.indexOf(C) !== -1)));
23
+ }
24
+ };
25
+ G(() => {
26
+ s.current = !1;
27
+ });
28
+ const g = (r) => {
29
+ p.current = r, typeof t == "function" ? t(r) : t && (t.current = r);
30
+ }, h = {
31
+ overflowAnchor: "none",
32
+ ...m.style
33
+ };
34
+ return l(y, { ...m, style: h, ref: g, ignoreStrict: !0, children: l(O.Provider, { value: R, children: e }) });
35
+ }
36
+ const D = /* @__PURE__ */ w(j);
37
+ function k(e) {
38
+ return e.value;
39
+ }
40
+ function A(e, c) {
41
+ return e.layout.min - c.layout.min;
42
+ }
43
+ export {
44
+ D as ReorderGroup,
45
+ j as ReorderGroupComponent
46
+ };
@@ -0,0 +1,34 @@
1
+ import { jsx as h } from "react/jsx-runtime";
2
+ import { forwardRef as V, useContext as O } from "react";
3
+ import { ReorderContext as T } from "../../context/ReorderContext.js";
4
+ import { motion as b } from "../../render/components/motion/proxy.js";
5
+ import { useConstant as j } from "../../utils/use-constant.js";
6
+ import { useMotionValue as w } from "../../value/use-motion-value.js";
7
+ import { useTransform as z } from "../../value/use-transform.js";
8
+ import { autoScrollIfNeeded as A, resetAutoScrollState as B } from "./utils/auto-scroll.js";
9
+ import { isMotionValue as D } from "../../../../../motion-dom/dist/es/value/utils/is-motion-value.js";
10
+ import { invariant as G } from "../../../../../motion-utils/dist/es/errors.js";
11
+ function a(i, e = 0) {
12
+ return D(i) ? i : w(e);
13
+ }
14
+ function L({ children: i, style: e = {}, value: m, as: c = "li", onDrag: u, onDragEnd: f, layout: d = !0, ...l }, x) {
15
+ const y = j(() => b[c]), s = O(T), n = {
16
+ x: a(e.x),
17
+ y: a(e.y)
18
+ }, R = z([n.x, n.y], ([o, t]) => o || t ? 1 : "unset");
19
+ G(!!s, "Reorder.Item must be a child of Reorder.Group", "reorder-item-child");
20
+ const { axis: r, registerItem: g, updateOrder: I, groupRef: C } = s;
21
+ return h(y, { drag: r, ...l, dragSnapToOrigin: !0, style: { ...e, x: n.x, y: n.y, zIndex: R }, layout: d, onDrag: (o, t) => {
22
+ const { velocity: p, point: S } = t, M = n[r].get();
23
+ I(m, M, p[r]), A(C.current, S[r], r, p[r]), u && u(o, t);
24
+ }, onDragEnd: (o, t) => {
25
+ B(), f && f(o, t);
26
+ }, onLayoutMeasure: (o) => {
27
+ g(m, o);
28
+ }, ref: x, ignoreStrict: !0, children: i });
29
+ }
30
+ const Q = /* @__PURE__ */ V(L);
31
+ export {
32
+ Q as ReorderItem,
33
+ L as ReorderItemComponent
34
+ };
@@ -0,0 +1,65 @@
1
+ const S = /* @__PURE__ */ new Set(["auto", "scroll"]), u = /* @__PURE__ */ new WeakMap(), a = /* @__PURE__ */ new WeakMap();
2
+ let d = null;
3
+ function x() {
4
+ if (d) {
5
+ const e = w(d, "y");
6
+ e && (a.delete(e), u.delete(e));
7
+ const n = w(d, "x");
8
+ n && n !== e && (a.delete(n), u.delete(n)), d = null;
9
+ }
10
+ }
11
+ function g(e, n) {
12
+ const o = getComputedStyle(e), l = n === "x" ? o.overflowX : o.overflowY, t = e === document.body || e === document.documentElement;
13
+ return S.has(l) || t;
14
+ }
15
+ function w(e, n) {
16
+ let o = e == null ? void 0 : e.parentElement;
17
+ for (; o; ) {
18
+ if (g(o, n))
19
+ return o;
20
+ o = o.parentElement;
21
+ }
22
+ return null;
23
+ }
24
+ function p(e, n, o) {
25
+ const l = n.getBoundingClientRect(), t = o === "x" ? Math.max(0, l.left) : Math.max(0, l.top), f = o === "x" ? Math.min(window.innerWidth, l.right) : Math.min(window.innerHeight, l.bottom), r = e - t, c = f - e;
26
+ if (r < 50) {
27
+ const s = 1 - r / 50;
28
+ return { amount: -25 * s * s, edge: "start" };
29
+ } else if (c < 50) {
30
+ const s = 1 - c / 50;
31
+ return { amount: 25 * s * s, edge: "end" };
32
+ }
33
+ return { amount: 0, edge: null };
34
+ }
35
+ function y(e, n, o, l) {
36
+ if (!e)
37
+ return;
38
+ d = e;
39
+ const t = w(e, o);
40
+ if (!t)
41
+ return;
42
+ const f = n - (o === "x" ? window.scrollX : window.scrollY), { amount: r, edge: c } = p(f, t, o);
43
+ if (c === null) {
44
+ a.delete(t), u.delete(t);
45
+ return;
46
+ }
47
+ const s = a.get(t), i = t === document.body || t === document.documentElement;
48
+ if (s !== c) {
49
+ if (!(c === "start" && l < 0 || c === "end" && l > 0))
50
+ return;
51
+ a.set(t, c);
52
+ const m = o === "x" ? t.scrollWidth - (i ? window.innerWidth : t.clientWidth) : t.scrollHeight - (i ? window.innerHeight : t.clientHeight);
53
+ u.set(t, m);
54
+ }
55
+ if (r > 0) {
56
+ const h = u.get(t);
57
+ if ((o === "x" ? i ? window.scrollX : t.scrollLeft : i ? window.scrollY : t.scrollTop) >= h)
58
+ return;
59
+ }
60
+ o === "x" ? i ? window.scrollBy({ left: r }) : t.scrollLeft += r : i ? window.scrollBy({ top: r }) : t.scrollTop += r;
61
+ }
62
+ export {
63
+ y as autoScrollIfNeeded,
64
+ x as resetAutoScrollState
65
+ };
@@ -0,0 +1,17 @@
1
+ import { mixNumber as s } from "../../../../../../motion-dom/dist/es/utils/mix/number.js";
2
+ import { moveItem as r } from "../../../../../../motion-utils/dist/es/array.js";
3
+ function p(t, f, m, i) {
4
+ if (!i)
5
+ return t;
6
+ const n = t.findIndex((a) => a.value === f);
7
+ if (n === -1)
8
+ return t;
9
+ const e = i > 0 ? 1 : -1, u = t[n + e];
10
+ if (!u)
11
+ return t;
12
+ const x = t[n], o = u.layout, c = s(o.min, o.max, 0.5);
13
+ return e === 1 && x.layout.max + m > c || e === -1 && x.layout.min + m < c ? r(t, n, n + e) : t;
14
+ }
15
+ export {
16
+ p as checkReorder
17
+ };
@@ -0,0 +1,5 @@
1
+ import { createContext as t } from "react";
2
+ const o = t(null);
3
+ export {
4
+ o as ReorderContext
5
+ };
@@ -0,0 +1,70 @@
1
+ import { useConstant as r } from "../../utils/use-constant.js";
2
+ class s {
3
+ constructor() {
4
+ this.componentControls = /* @__PURE__ */ new Set();
5
+ }
6
+ /**
7
+ * Subscribe a component's internal `VisualElementDragControls` to the user-facing API.
8
+ *
9
+ * @internal
10
+ */
11
+ subscribe(o) {
12
+ return this.componentControls.add(o), () => this.componentControls.delete(o);
13
+ }
14
+ /**
15
+ * Start a drag gesture on every `motion` component that has this set of drag controls
16
+ * passed into it via the `dragControls` prop.
17
+ *
18
+ * ```jsx
19
+ * dragControls.start(e, {
20
+ * snapToCursor: true
21
+ * })
22
+ * ```
23
+ *
24
+ * @param event - PointerEvent
25
+ * @param options - Options
26
+ *
27
+ * @public
28
+ */
29
+ start(o, t) {
30
+ this.componentControls.forEach((n) => {
31
+ n.start(o.nativeEvent || o, t);
32
+ });
33
+ }
34
+ /**
35
+ * Cancels a drag gesture.
36
+ *
37
+ * ```jsx
38
+ * dragControls.cancel()
39
+ * ```
40
+ *
41
+ * @public
42
+ */
43
+ cancel() {
44
+ this.componentControls.forEach((o) => {
45
+ o.cancel();
46
+ });
47
+ }
48
+ /**
49
+ * Stops a drag gesture.
50
+ *
51
+ * ```jsx
52
+ * dragControls.stop()
53
+ * ```
54
+ *
55
+ * @public
56
+ */
57
+ stop() {
58
+ this.componentControls.forEach((o) => {
59
+ o.stop();
60
+ });
61
+ }
62
+ }
63
+ const e = () => new s();
64
+ function l() {
65
+ return r(e);
66
+ }
67
+ export {
68
+ s as DragControls,
69
+ l as useDragControls
70
+ };
@@ -0,0 +1,15 @@
1
+ import { useIsomorphicLayoutEffect as a } from "../utils/use-isomorphic-effect.js";
2
+ import { useMotionValue as c } from "./use-motion-value.js";
3
+ import { frame as m, cancelFrame as p } from "../../../../motion-dom/dist/es/frameloop/frame.js";
4
+ function d(n, t) {
5
+ const r = c(t()), e = () => r.set(t());
6
+ return e(), a(() => {
7
+ const s = () => m.preRender(e, !1, !0), u = n.map((o) => o.on("change", s));
8
+ return () => {
9
+ u.forEach((o) => o()), p(e);
10
+ };
11
+ }), r;
12
+ }
13
+ export {
14
+ d as useCombineMotionValues
15
+ };
@@ -0,0 +1,10 @@
1
+ import { useCombineMotionValues as n } from "./use-combine-values.js";
2
+ import { collectMotionValues as e } from "../../../../motion-dom/dist/es/value/index.js";
3
+ function i(o) {
4
+ e.current = [], o();
5
+ const r = n(e.current, o);
6
+ return e.current = void 0, r;
7
+ }
8
+ export {
9
+ i as useComputed
10
+ };
@@ -0,0 +1,15 @@
1
+ import { useContext as s, useState as r, useEffect as u } from "react";
2
+ import { MotionConfigContext as f } from "../context/MotionConfigContext.js";
3
+ import { useConstant as i } from "../utils/use-constant.js";
4
+ import { motionValue as m } from "../../../../motion-dom/dist/es/value/index.js";
5
+ function x(t) {
6
+ const o = i(() => m(t)), { isStatic: e } = s(f);
7
+ if (e) {
8
+ const [, n] = r(t);
9
+ u(() => o.on("change", n), []);
10
+ }
11
+ return o;
12
+ }
13
+ export {
14
+ x as useMotionValue
15
+ };
@@ -0,0 +1,23 @@
1
+ import { useConstant as u } from "../utils/use-constant.js";
2
+ import { useCombineMotionValues as c } from "./use-combine-values.js";
3
+ import { useComputed as i } from "./use-computed.js";
4
+ import { transform as a } from "../../../../motion-dom/dist/es/utils/transform.js";
5
+ function C(t, o, r, e) {
6
+ if (typeof t == "function")
7
+ return i(t);
8
+ const s = typeof o == "function" ? o : a(o, r, e);
9
+ return Array.isArray(t) ? f(t, s) : f([t], ([m]) => s(m));
10
+ }
11
+ function f(t, o) {
12
+ const r = u(() => []);
13
+ return c(t, () => {
14
+ r.length = 0;
15
+ const e = t.length;
16
+ for (let n = 0; n < e; n++)
17
+ r[n] = t[n].get();
18
+ return o(r);
19
+ });
20
+ }
21
+ export {
22
+ C as useTransform
23
+ };
@@ -23,7 +23,7 @@ import { eachAxis as G } from "../utils/each-axis.js";
23
23
  import { FlatTree as St } from "../utils/flat-tree.js";
24
24
  import { hasTransform as S, hasScale as q, has2DTranslate as Pt } from "../utils/has-transform.js";
25
25
  import { globalProjectionState as F } from "./state.js";
26
- import { frame as V, cancelFrame as X, frameSteps as O, frameData as y } from "../../frameloop/frame.js";
26
+ import { frame as V, cancelFrame as X, frameData as y, frameSteps as O } from "../../frameloop/frame.js";
27
27
  import { SubscriptionManager as Bt } from "../../../../../motion-utils/dist/es/subscription-manager.js";
28
28
  import { clamp as Rt } from "../../../../../motion-utils/dist/es/clamp.js";
29
29
  import { noop as jt } from "../../../../../motion-utils/dist/es/noop.js";
@@ -0,0 +1,8 @@
1
+ import { interpolate as s } from "./interpolate.js";
2
+ function a(...t) {
3
+ const o = !Array.isArray(t[0]), n = o ? 0 : -1, r = t[0 + n], i = t[1 + n], c = t[2 + n], p = t[3 + n], e = s(i, c, p);
4
+ return o ? e(r) : e;
5
+ }
6
+ export {
7
+ a as transform
8
+ };
@@ -1,10 +1,12 @@
1
1
  import { time as n } from "../frameloop/sync-time.js";
2
2
  import { frame as d } from "../frameloop/frame.js";
3
- import { warnOnce as c } from "../../../../motion-utils/dist/es/warn-once.js";
4
- import { SubscriptionManager as p } from "../../../../motion-utils/dist/es/subscription-manager.js";
5
- import { velocityPerSecond as u } from "../../../../motion-utils/dist/es/velocity-per-second.js";
6
- const a = 30, f = (s) => !isNaN(parseFloat(s));
7
- class l {
3
+ import { warnOnce as p } from "../../../../motion-utils/dist/es/warn-once.js";
4
+ import { SubscriptionManager as u } from "../../../../motion-utils/dist/es/subscription-manager.js";
5
+ import { velocityPerSecond as f } from "../../../../motion-utils/dist/es/velocity-per-second.js";
6
+ const a = 30, l = (s) => !isNaN(parseFloat(s)), h = {
7
+ current: void 0
8
+ };
9
+ class m {
8
10
  /**
9
11
  * @param init - The initiating value
10
12
  * @param config - Optional configuration options
@@ -14,14 +16,14 @@ class l {
14
16
  constructor(t, e = {}) {
15
17
  this.canTrackVelocity = null, this.events = {}, this.updateAndNotify = (i) => {
16
18
  var r;
17
- const h = n.now();
18
- if (this.updatedAt !== h && this.setPrevFrameValue(), this.prev = this.current, this.setCurrent(i), this.current !== this.prev && ((r = this.events.change) == null || r.notify(this.current), this.dependents))
19
- for (const o of this.dependents)
20
- o.dirty();
19
+ const o = n.now();
20
+ if (this.updatedAt !== o && this.setPrevFrameValue(), this.prev = this.current, this.setCurrent(i), this.current !== this.prev && ((r = this.events.change) == null || r.notify(this.current), this.dependents))
21
+ for (const c of this.dependents)
22
+ c.dirty();
21
23
  }, this.hasAnimated = !1, this.setCurrent(t), this.owner = e.owner;
22
24
  }
23
25
  setCurrent(t) {
24
- this.current = t, this.updatedAt = n.now(), this.canTrackVelocity === null && t !== void 0 && (this.canTrackVelocity = f(this.current));
26
+ this.current = t, this.updatedAt = n.now(), this.canTrackVelocity === null && t !== void 0 && (this.canTrackVelocity = l(this.current));
25
27
  }
26
28
  setPrevFrameValue(t = this.current) {
27
29
  this.prevFrameValue = t, this.prevUpdatedAt = this.updatedAt;
@@ -67,10 +69,10 @@ class l {
67
69
  * @deprecated
68
70
  */
69
71
  onChange(t) {
70
- return process.env.NODE_ENV !== "production" && c(!1, 'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'), this.on("change", t);
72
+ return process.env.NODE_ENV !== "production" && p(!1, 'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'), this.on("change", t);
71
73
  }
72
74
  on(t, e) {
73
- this.events[t] || (this.events[t] = new p());
75
+ this.events[t] || (this.events[t] = new u());
74
76
  const i = this.events[t].add(e);
75
77
  return t === "change" ? () => {
76
78
  i(), d.read(() => {
@@ -134,7 +136,7 @@ class l {
134
136
  * @public
135
137
  */
136
138
  get() {
137
- return this.current;
139
+ return h.current && h.current.push(this), this.current;
138
140
  }
139
141
  /**
140
142
  * @public
@@ -154,7 +156,7 @@ class l {
154
156
  if (!this.canTrackVelocity || this.prevFrameValue === void 0 || t - this.updatedAt > a)
155
157
  return 0;
156
158
  const e = Math.min(this.updatedAt - this.prevUpdatedAt, a);
157
- return u(parseFloat(this.current) - parseFloat(this.prevFrameValue), e);
159
+ return f(parseFloat(this.current) - parseFloat(this.prevFrameValue), e);
158
160
  }
159
161
  /**
160
162
  * Registers a new animation to control this `MotionValue`. Only one
@@ -206,10 +208,11 @@ class l {
206
208
  (t = this.dependents) == null || t.clear(), (e = this.events.destroy) == null || e.notify(), this.clearListeners(), this.stop(), this.stopPassiveEffect && this.stopPassiveEffect();
207
209
  }
208
210
  }
209
- function g(s, t) {
210
- return new l(s, t);
211
+ function E(s, t) {
212
+ return new m(s, t);
211
213
  }
212
214
  export {
213
- l as MotionValue,
214
- g as motionValue
215
+ m as MotionValue,
216
+ h as collectMotionValues,
217
+ E as motionValue
215
218
  };
@@ -1,11 +1,20 @@
1
- function f(e, n) {
1
+ function l(e, n) {
2
2
  e.indexOf(n) === -1 && e.push(n);
3
3
  }
4
- function d(e, n) {
5
- const i = e.indexOf(n);
6
- i > -1 && e.splice(i, 1);
4
+ function u(e, n) {
5
+ const t = e.indexOf(n);
6
+ t > -1 && e.splice(t, 1);
7
+ }
8
+ function f([...e], n, t) {
9
+ const i = n < 0 ? e.length + n : n;
10
+ if (i >= 0 && i < e.length) {
11
+ const c = t < 0 ? e.length + t : t, [s] = e.splice(n, 1);
12
+ e.splice(c, 0, s);
13
+ }
14
+ return e;
7
15
  }
8
16
  export {
9
- f as addUniqueItem,
10
- d as removeItem
17
+ l as addUniqueItem,
18
+ f as moveItem,
19
+ u as removeItem
11
20
  };