@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.
- package/dist/applications/schedule-calendar/index.d.ts +4 -0
- package/dist/applications/schedule-calendar/index.d.ts.map +1 -0
- package/dist/applications/schedule-calendar/schedule-calendar.d.ts +3 -0
- package/dist/applications/schedule-calendar/schedule-calendar.d.ts.map +1 -0
- package/dist/applications/schedule-calendar/schedule-calendar.js +202 -0
- package/dist/applications/schedule-calendar/types.d.ts +56 -0
- package/dist/applications/schedule-calendar/types.d.ts.map +1 -0
- package/dist/applications/schedule-calendar/types.js +40 -0
- package/dist/applications/schedule-calendar/utils.d.ts +21 -0
- package/dist/applications/schedule-calendar/utils.d.ts.map +1 -0
- package/dist/applications/schedule-calendar/utils.js +152 -0
- package/dist/applications/schedule-calendar/utils.test.d.ts +2 -0
- package/dist/applications/schedule-calendar/utils.test.d.ts.map +1 -0
- package/dist/assets/icons/group-by.svg.js +4 -0
- package/dist/assets/icons/reorder-dots-new.svg.js +4 -0
- package/dist/assets/icons/reorder-dots.svg.js +4 -0
- package/dist/assets/icons/resize-1.svg.js +4 -0
- package/dist/assets/icons/resize-2.svg.js +4 -0
- package/dist/assets/icons/resize-4.svg.js +4 -0
- package/dist/assets/icons/resize-5.svg.js +4 -0
- package/dist/assets/icons/show-summary.svg.js +4 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +132 -59
- package/dist/node_modules/framer-motion/dist/es/components/Reorder/Group.js +46 -0
- package/dist/node_modules/framer-motion/dist/es/components/Reorder/Item.js +34 -0
- package/dist/node_modules/framer-motion/dist/es/components/Reorder/utils/auto-scroll.js +65 -0
- package/dist/node_modules/framer-motion/dist/es/components/Reorder/utils/check-reorder.js +17 -0
- package/dist/node_modules/framer-motion/dist/es/context/ReorderContext.js +5 -0
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/use-drag-controls.js +70 -0
- package/dist/node_modules/framer-motion/dist/es/value/use-combine-values.js +15 -0
- package/dist/node_modules/framer-motion/dist/es/value/use-computed.js +10 -0
- package/dist/node_modules/framer-motion/dist/es/value/use-motion-value.js +15 -0
- package/dist/node_modules/framer-motion/dist/es/value/use-transform.js +23 -0
- package/dist/node_modules/motion-dom/dist/es/projection/node/create-projection-node.js +1 -1
- package/dist/node_modules/motion-dom/dist/es/utils/transform.js +8 -0
- package/dist/node_modules/motion-dom/dist/es/value/index.js +21 -18
- package/dist/node_modules/motion-utils/dist/es/array.js +15 -6
- package/dist/patterns/table/TablePagination.d.ts +23 -0
- package/dist/patterns/table/TablePagination.d.ts.map +1 -0
- package/dist/patterns/table/TablePagination.js +60 -0
- package/dist/patterns/table/TableWrapper.d.ts +2 -72
- package/dist/patterns/table/TableWrapper.d.ts.map +1 -1
- package/dist/patterns/table/TableWrapper.js +730 -75
- package/dist/patterns/table/index.d.ts +11 -1
- package/dist/patterns/table/index.d.ts.map +1 -1
- package/dist/patterns/table/pagination-base.d.ts +78 -0
- package/dist/patterns/table/pagination-base.d.ts.map +1 -0
- package/dist/patterns/table/pagination-base.js +127 -0
- package/dist/patterns/table/pagination-card.d.ts +9 -0
- package/dist/patterns/table/pagination-card.d.ts.map +1 -0
- package/dist/patterns/table/pagination-card.js +65 -0
- package/dist/patterns/table/row-height-icons.d.ts +9 -0
- package/dist/patterns/table/row-height-icons.d.ts.map +1 -0
- package/dist/patterns/table/row-height-icons.js +13 -0
- package/dist/patterns/table/storyHelpers/mockToolbarSlots.d.ts +7 -0
- package/dist/patterns/table/storyHelpers/mockToolbarSlots.d.ts.map +1 -0
- package/dist/patterns/table/storyHelpers/useMockTableState.d.ts +31 -0
- package/dist/patterns/table/storyHelpers/useMockTableState.d.ts.map +1 -0
- package/dist/patterns/table/storyHelpers/useMockTableToolbar.d.ts +3 -0
- package/dist/patterns/table/storyHelpers/useMockTableToolbar.d.ts.map +1 -0
- package/dist/patterns/table/table.d.ts +10 -13
- package/dist/patterns/table/table.d.ts.map +1 -1
- package/dist/patterns/table/table.js +235 -312
- package/dist/patterns/table/toolbar/AlignDropdown.d.ts +11 -0
- package/dist/patterns/table/toolbar/AlignDropdown.d.ts.map +1 -0
- package/dist/patterns/table/toolbar/AlignDropdown.js +77 -0
- package/dist/patterns/table/toolbar/BasicSortPanel.d.ts +6 -0
- package/dist/patterns/table/toolbar/BasicSortPanel.d.ts.map +1 -0
- package/dist/patterns/table/toolbar/BulkActionBar.d.ts +12 -0
- package/dist/patterns/table/toolbar/BulkActionBar.d.ts.map +1 -0
- package/dist/patterns/table/toolbar/BulkActionBar.js +62 -0
- package/dist/patterns/table/toolbar/ColumnHeaderMenu.d.ts +41 -0
- package/dist/patterns/table/toolbar/ColumnHeaderMenu.d.ts.map +1 -0
- package/dist/patterns/table/toolbar/ColumnHeaderMenu.js +171 -0
- package/dist/patterns/table/toolbar/GroupByDropdown.d.ts +11 -0
- package/dist/patterns/table/toolbar/GroupByDropdown.d.ts.map +1 -0
- package/dist/patterns/table/toolbar/GroupByDropdown.js +80 -0
- package/dist/patterns/table/toolbar/HideFieldsDropdown.d.ts +13 -0
- package/dist/patterns/table/toolbar/HideFieldsDropdown.d.ts.map +1 -0
- package/dist/patterns/table/toolbar/HideFieldsDropdown.js +180 -0
- package/dist/patterns/table/toolbar/LegacySortFilterTools.d.ts +9 -0
- package/dist/patterns/table/toolbar/LegacySortFilterTools.d.ts.map +1 -0
- package/dist/patterns/table/toolbar/RowActionsMenu.d.ts +19 -0
- package/dist/patterns/table/toolbar/RowActionsMenu.d.ts.map +1 -0
- package/dist/patterns/table/toolbar/RowActionsMenu.js +84 -0
- package/dist/patterns/table/toolbar/RowHeightDropdown.d.ts +9 -0
- package/dist/patterns/table/toolbar/RowHeightDropdown.d.ts.map +1 -0
- package/dist/patterns/table/toolbar/RowHeightDropdown.js +60 -0
- package/dist/patterns/table/toolbar/ShowSummaryDropdown.d.ts +8 -0
- package/dist/patterns/table/toolbar/ShowSummaryDropdown.d.ts.map +1 -0
- package/dist/patterns/table/toolbar/ShowSummaryDropdown.js +22 -0
- package/dist/patterns/table/toolbar/SummaryFooter.d.ts +16 -0
- package/dist/patterns/table/toolbar/SummaryFooter.d.ts.map +1 -0
- package/dist/patterns/table/toolbar/SummaryFooter.js +83 -0
- package/dist/patterns/table/toolbar/TableToolbar.d.ts +55 -0
- package/dist/patterns/table/toolbar/TableToolbar.d.ts.map +1 -0
- package/dist/patterns/table/toolbar/TableToolbar.js +234 -0
- package/dist/patterns/table/toolbar/ToolbarRadio.d.ts +18 -0
- package/dist/patterns/table/toolbar/ToolbarRadio.d.ts.map +1 -0
- package/dist/patterns/table/toolbar/ToolbarRadio.js +63 -0
- package/dist/patterns/table/toolbar/index.d.ts +24 -0
- package/dist/patterns/table/toolbar/index.d.ts.map +1 -0
- package/dist/patterns/table/toolbar/legacyToolbarTypes.d.ts +69 -0
- package/dist/patterns/table/toolbar/legacyToolbarTypes.d.ts.map +1 -0
- package/dist/patterns/table/toolbar/tableToolbarHelpers.d.ts +35 -0
- package/dist/patterns/table/toolbar/tableToolbarHelpers.d.ts.map +1 -0
- package/dist/patterns/table/toolbar/tableToolbarHelpers.js +259 -0
- package/dist/patterns/table/toolbar/tableToolbarHelpers.test.d.ts +2 -0
- package/dist/patterns/table/toolbar/tableToolbarHelpers.test.d.ts.map +1 -0
- package/dist/patterns/table/toolbar/toolbarExtensions.d.ts +12 -0
- package/dist/patterns/table/toolbar/toolbarExtensions.d.ts.map +1 -0
- package/dist/patterns/table/toolbar/toolbarExtensions.js +18 -0
- package/dist/patterns/table/toolbar-icons.d.ts +8 -0
- package/dist/patterns/table/toolbar-icons.d.ts.map +1 -0
- package/dist/patterns/table/toolbar-icons.js +13 -0
- package/dist/patterns/table/types.d.ts +141 -0
- package/dist/patterns/table/types.d.ts.map +1 -0
- package/dist/patterns/table/useGridKeyboardNavigation.d.ts +38 -0
- package/dist/patterns/table/useGridKeyboardNavigation.d.ts.map +1 -0
- package/dist/patterns/table/useGridKeyboardNavigation.js +65 -0
- package/dist/primitives/checkbox/checkbox.d.ts +2 -2
- package/dist/primitives/checkbox/checkbox.d.ts.map +1 -1
- package/dist/primitives/dropdown/dropdown.d.ts +32 -0
- package/dist/primitives/dropdown/dropdown.d.ts.map +1 -0
- package/dist/primitives/dropdown/dropdown.js +118 -0
- package/dist/primitives/dropdown/index.d.ts +2 -0
- package/dist/primitives/dropdown/index.d.ts.map +1 -0
- package/dist/primitives/select/ExpandableSearchInput.d.ts +5 -1
- package/dist/primitives/select/ExpandableSearchInput.d.ts.map +1 -1
- package/dist/primitives/select/ExpandableSearchInput.js +80 -77
- package/dist/primitives/shimmer/index.d.ts +2 -0
- package/dist/primitives/shimmer/index.d.ts.map +1 -0
- package/dist/primitives/shimmer/shimmer.d.ts +24 -0
- package/dist/primitives/shimmer/shimmer.d.ts.map +1 -0
- package/dist/primitives/shimmer/shimmer.js +37 -0
- package/dist/primitives/snackbar/index.d.ts +2 -0
- package/dist/primitives/snackbar/index.d.ts.map +1 -0
- package/dist/primitives/snackbar/snackbar.d.ts +27 -0
- package/dist/primitives/snackbar/snackbar.d.ts.map +1 -0
- package/dist/primitives/snackbar/snackbar.js +107 -0
- package/dist/styles/components.css +1 -1
- package/dist/styles/theme.css +1 -1
- 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
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
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
|
|
18
|
-
import { Popover as
|
|
19
|
-
import { ExpandableSearchInput as
|
|
20
|
-
import { Tooltip as
|
|
21
|
-
import { EllipsisContentWithTooltip as
|
|
22
|
-
import { CustomIcon as
|
|
23
|
-
import { ICONS as
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
N as
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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
|
-
|
|
116
|
+
Cr as computeAggregation,
|
|
117
|
+
io as createEllipsisContent,
|
|
63
118
|
m as cx,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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,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,
|
|
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";
|
|
@@ -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
|
|
4
|
-
import { SubscriptionManager as
|
|
5
|
-
import { velocityPerSecond as
|
|
6
|
-
const a = 30,
|
|
7
|
-
|
|
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
|
|
18
|
-
if (this.updatedAt !==
|
|
19
|
-
for (const
|
|
20
|
-
|
|
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 =
|
|
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" &&
|
|
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
|
|
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
|
|
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
|
|
210
|
-
return new
|
|
211
|
+
function E(s, t) {
|
|
212
|
+
return new m(s, t);
|
|
211
213
|
}
|
|
212
214
|
export {
|
|
213
|
-
|
|
214
|
-
|
|
215
|
+
m as MotionValue,
|
|
216
|
+
h as collectMotionValues,
|
|
217
|
+
E as motionValue
|
|
215
218
|
};
|
|
@@ -1,11 +1,20 @@
|
|
|
1
|
-
function
|
|
1
|
+
function l(e, n) {
|
|
2
2
|
e.indexOf(n) === -1 && e.push(n);
|
|
3
3
|
}
|
|
4
|
-
function
|
|
5
|
-
const
|
|
6
|
-
|
|
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
|
-
|
|
10
|
-
|
|
17
|
+
l as addUniqueItem,
|
|
18
|
+
f as moveItem,
|
|
19
|
+
u as removeItem
|
|
11
20
|
};
|