impact-nova 0.1.13 → 1.1.0

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 (120) hide show
  1. package/dist/components/layout/dashboard-layout.d.ts +21 -6
  2. package/dist/components/ui/accordion-nested-list/accordion-nested-list.js +32 -33
  3. package/dist/components/ui/accordion.js +25 -23
  4. package/dist/components/ui/ag-grid-react/cell-renderers/date-display-renderer.js +32 -21
  5. package/dist/components/ui/ag-grid-react/cell-renderers/editors/date-cell-editor.d.ts +3 -5
  6. package/dist/components/ui/ag-grid-react/cell-renderers/editors/date-cell-editor.js +57 -55
  7. package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.d.ts +5 -0
  8. package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.js +50 -52
  9. package/dist/components/ui/ag-grid-react/cell-renderers/input-display-renderer.d.ts +1 -1
  10. package/dist/components/ui/ag-grid-react/cell-renderers/split-cell-renderer.js +34 -34
  11. package/dist/components/ui/ag-grid-react/headers/advanced-filter/column-filter-section.js +8 -11
  12. package/dist/components/ui/ag-grid-react/headers/column-menu/column-settings-menu.js +17 -17
  13. package/dist/components/ui/ag-grid-react/headers/header-search-input.js +3 -3
  14. package/dist/components/ui/alert-dialog.js +45 -40
  15. package/dist/components/ui/alert.d.ts +21 -4
  16. package/dist/components/ui/alert.js +45 -25
  17. package/dist/components/ui/avatar.js +19 -16
  18. package/dist/components/ui/badge.js +8 -1
  19. package/dist/components/ui/breadcrumb.js +1 -0
  20. package/dist/components/ui/button-group.d.ts +1 -1
  21. package/dist/components/ui/button-group.js +27 -32
  22. package/dist/components/ui/button-variants.d.ts +1 -1
  23. package/dist/components/ui/button.d.ts +11 -0
  24. package/dist/components/ui/button.js +11 -9
  25. package/dist/components/ui/calendar.d.ts +14 -2
  26. package/dist/components/ui/calendar.js +443 -376
  27. package/dist/components/ui/card.js +7 -6
  28. package/dist/components/ui/checkbox.js +64 -48
  29. package/dist/components/ui/chips.d.ts +1 -0
  30. package/dist/components/ui/chips.js +27 -19
  31. package/dist/components/ui/data-table/data-table-column-list.d.ts +4 -1
  32. package/dist/components/ui/data-table/data-table-column-list.js +58 -54
  33. package/dist/components/ui/data-table/data-table-sheet.d.ts +1 -1
  34. package/dist/components/ui/data-table/data-table-sheet.js +43 -40
  35. package/dist/components/ui/data-table/data-table-view-options.js +17 -17
  36. package/dist/components/ui/data-table/data-table.js +21 -20
  37. package/dist/components/ui/date-picker/date-picker.js +93 -93
  38. package/dist/components/ui/date-picker/date-range-picker.js +142 -133
  39. package/dist/components/ui/date-picker/month-picker.js +96 -93
  40. package/dist/components/ui/date-picker/month-range-picker.js +144 -134
  41. package/dist/components/ui/date-picker/multi-date-picker.js +43 -45
  42. package/dist/components/ui/date-picker/multi-month-picker.js +37 -39
  43. package/dist/components/ui/date-picker/multi-week-picker.js +56 -46
  44. package/dist/components/ui/date-picker/week-picker.js +119 -109
  45. package/dist/components/ui/date-picker/week-range-picker.js +170 -147
  46. package/dist/components/ui/dialog.js +15 -6
  47. package/dist/components/ui/drawer.js +16 -13
  48. package/dist/components/ui/dropdown-menu.js +4 -2
  49. package/dist/components/ui/dynamic-layout.d.ts +2 -2
  50. package/dist/components/ui/dynamic-layout.js +18 -15
  51. package/dist/components/ui/empty-container.js +69 -64
  52. package/dist/components/ui/file-upload.js +113 -106
  53. package/dist/components/ui/filter-panel/filter-panel.js +49 -46
  54. package/dist/components/ui/filter-strip/filter-strip.js +41 -37
  55. package/dist/components/ui/header.js +26 -25
  56. package/dist/components/ui/horizontal-scroller/horizontal-scroller.js +43 -40
  57. package/dist/components/ui/hover-card.js +6 -5
  58. package/dist/components/ui/input.d.ts +1 -1
  59. package/dist/components/ui/input.js +79 -68
  60. package/dist/components/ui/loader.d.ts +1 -0
  61. package/dist/components/ui/loader.js +23 -13
  62. package/dist/components/ui/nested-list/components/NestedListContent.d.ts +1 -3
  63. package/dist/components/ui/nested-list/components/NestedListContent.js +16 -15
  64. package/dist/components/ui/nested-list/components/SortableItem.js +116 -80
  65. package/dist/components/ui/nested-list/hooks/useNestedListDragDrop.d.ts +13 -1
  66. package/dist/components/ui/nested-list/hooks/useNestedListDragDrop.js +162 -112
  67. package/dist/components/ui/nested-list/nested-list.js +182 -189
  68. package/dist/components/ui/notification-panel/notification-item.js +19 -17
  69. package/dist/components/ui/notification-panel/notification-list.js +21 -21
  70. package/dist/components/ui/notification-panel/notification-panel.js +25 -25
  71. package/dist/components/ui/popover.js +37 -34
  72. package/dist/components/ui/progress.js +12 -10
  73. package/dist/components/ui/prompt.js +29 -27
  74. package/dist/components/ui/radio-group.js +55 -46
  75. package/dist/components/ui/select/components/Submenu.d.ts +1 -2
  76. package/dist/components/ui/select/components/Submenu.js +52 -48
  77. package/dist/components/ui/select/select.js +321 -324
  78. package/dist/components/ui/sheet.js +18 -15
  79. package/dist/components/ui/sidebar.d.ts +2 -2
  80. package/dist/components/ui/sidebar.js +3 -3
  81. package/dist/components/ui/skeleton.d.ts +2 -1
  82. package/dist/components/ui/skeleton.js +12 -11
  83. package/dist/components/ui/slider.js +39 -12
  84. package/dist/components/ui/smart-input.js +44 -39
  85. package/dist/components/ui/stepper.js +33 -29
  86. package/dist/components/ui/switch.js +6 -4
  87. package/dist/components/ui/tabs.js +50 -45
  88. package/dist/components/ui/tag-group.d.ts +2 -1
  89. package/dist/components/ui/tag-group.js +29 -25
  90. package/dist/components/ui/tag.d.ts +1 -0
  91. package/dist/components/ui/tag.js +26 -20
  92. package/dist/components/ui/textarea.js +18 -17
  93. package/dist/components/ui/toast.d.ts +1 -1
  94. package/dist/components/ui/toast.js +47 -41
  95. package/dist/components/ui/toaster.js +42 -42
  96. package/dist/components/ui/tooltip.js +18 -16
  97. package/dist/components/ui/types/date-picker.types.d.ts +33 -0
  98. package/dist/components/ui/types/empty-container.types.d.ts +5 -0
  99. package/dist/components/ui/types/nested-list.types.d.ts +1 -0
  100. package/dist/components/ui/types/select.types.d.ts +0 -1
  101. package/dist/icons/assets/bookmark.svg.js +4 -0
  102. package/dist/icons/assets/bookmark.svg2.js +5 -0
  103. package/dist/icons/assets/bookmarkFilled.svg.js +4 -0
  104. package/dist/icons/assets/bookmarkFilled.svg2.js +5 -0
  105. package/dist/icons/assets/download.svg.js +4 -0
  106. package/dist/icons/assets/download.svg2.js +5 -0
  107. package/dist/icons/index.d.ts +20 -6
  108. package/dist/icons/index.js +398 -370
  109. package/dist/impact-nova.css +1 -1
  110. package/dist/index.d.ts +1 -0
  111. package/dist/index.js +318 -314
  112. package/dist/lib/fiscal-calendar.d.ts +62 -0
  113. package/dist/lib/fiscal-calendar.js +99 -0
  114. package/dist/lib/utils.d.ts +2 -1
  115. package/dist/lib/utils.js +29 -13
  116. package/package.json +5 -5
  117. package/dist/components/ui/select/hooks/useClickOutside.d.ts +0 -15
  118. package/dist/components/ui/select/hooks/useClickOutside.js +0 -43
  119. package/dist/components/ui/select/hooks/useMenuPosition.d.ts +0 -2
  120. package/dist/components/ui/select/hooks/useMenuPosition.js +0 -89
@@ -1,168 +1,218 @@
1
- import { useCallback as s } from "react";
2
- import { useSensors as O, useSensor as k, MouseSensor as V, TouchSensor as j } from "@dnd-kit/core";
3
- import { arrayMove as S } from "@dnd-kit/sortable";
4
- const B = ({
5
- items: L,
6
- onDragEnd: f
1
+ import { useCallback as a } from "react";
2
+ import { useSensors as W, useSensor as F, MouseSensor as X, TouchSensor as j, closestCorners as q } from "@dnd-kit/core";
3
+ import { arrayMove as M } from "@dnd-kit/sortable";
4
+ const Y = "droppable-", L = /* @__PURE__ */ new Set(["root-frozen", "root-scrollable"]);
5
+ function g(f) {
6
+ if (f.startsWith(Y)) {
7
+ const c = f.slice(Y.length);
8
+ if (L.has(c)) return c;
9
+ }
10
+ return null;
11
+ }
12
+ const Q = (f) => {
13
+ const c = q(f), x = c.filter(
14
+ (s) => !L.has(s.id)
15
+ );
16
+ return x.length > 0 ? x : c;
17
+ };
18
+ function b(f, c) {
19
+ for (const x of f) {
20
+ if (x.id === c) return x;
21
+ if (x.children) {
22
+ const s = b(x.children, c);
23
+ if (s) return s;
24
+ }
25
+ }
26
+ }
27
+ const U = ({
28
+ items: f,
29
+ onDragEnd: c
7
30
  }) => {
8
- const w = O(
9
- k(V),
10
- k(j)
11
- ), h = s(
12
- (l, e, i = 0) => {
13
- for (const n of l) {
14
- if (n.id === e) return i;
31
+ const x = W(
32
+ F(X),
33
+ F(j)
34
+ ), s = a(
35
+ (t, r, o = 0) => {
36
+ for (const n of t) {
37
+ if (n.id === r) return o;
15
38
  if (n.children) {
16
- const r = h(n.children, e, i + 1);
17
- if (r !== null) return r;
39
+ const e = s(n.children, r, o + 1);
40
+ if (e !== null) return e;
18
41
  }
19
42
  }
20
43
  return null;
21
44
  },
22
45
  []
23
- ), c = s(
24
- (l, e, i = null) => {
25
- for (const n of l) {
26
- if (n.id === e) return i;
46
+ ), h = a(
47
+ (t, r, o = null) => {
48
+ for (const n of t) {
49
+ if (n.id === r) return o;
27
50
  if (n.children) {
28
- const r = c(n.children, e, n.id);
29
- if (r !== null) return r;
51
+ const e = h(n.children, r, n.id);
52
+ if (e !== null) return e;
30
53
  }
31
54
  }
32
55
  return null;
33
56
  },
34
57
  []
35
- ), C = s(
36
- (l, e, i) => l.map((n) => {
58
+ ), T = a(
59
+ (t, r, o) => t.map((n) => {
37
60
  if (n.children && n.children.length > 0) {
38
- const r = n.children.findIndex(
39
- (t) => t.id === e
40
- ), o = n.children.findIndex(
41
- (t) => t.id === i
61
+ const e = n.children.findIndex(
62
+ (l) => l.id === r
63
+ ), i = n.children.findIndex(
64
+ (l) => l.id === o
42
65
  );
43
- if (r !== -1 && o !== -1) {
44
- const t = S(n.children, r, o);
66
+ if (e !== -1 && i !== -1) {
67
+ const l = M(n.children, e, i);
45
68
  return {
46
69
  ...n,
47
- children: t
70
+ children: l
48
71
  };
49
72
  }
50
73
  return {
51
74
  ...n,
52
- children: C(n.children, e, i)
75
+ children: T(n.children, r, o)
53
76
  };
54
77
  }
55
78
  return n;
56
79
  }),
57
80
  []
58
- ), R = s(
59
- (l, e, i) => {
60
- const n = c(l, i);
81
+ ), N = a(
82
+ (t, r, o) => {
83
+ const n = h(t, o);
61
84
  if (!n) return null;
62
- const r = l.findIndex(
63
- (t) => t.id === n
64
- ), o = l.findIndex(
65
- (t) => t.id === e
85
+ const e = t.findIndex(
86
+ (l) => l.id === n
87
+ ), i = t.findIndex(
88
+ (l) => l.id === r
66
89
  );
67
- if (r !== -1 && o !== -1) {
68
- const t = S(
69
- l,
70
- o,
71
- r
90
+ if (e !== -1 && i !== -1) {
91
+ const l = M(
92
+ t,
93
+ i,
94
+ e
72
95
  );
73
- return f?.(e, n), t;
96
+ return c?.(r, n), l;
74
97
  }
75
98
  return null;
76
99
  },
77
- [c, f]
78
- ), M = s(
79
- (l, e, i) => {
80
- const n = l.findIndex((o) => o.id === e), r = l.findIndex((o) => o.id === i);
81
- if (n !== -1 && r !== -1) {
82
- const o = S(l, n, r);
83
- return f?.(e, i), o;
100
+ [h, c]
101
+ ), _ = a(
102
+ (t, r, o) => {
103
+ const n = t.findIndex((i) => i.id === r), e = t.findIndex((i) => i.id === o);
104
+ if (n !== -1 && e !== -1) {
105
+ const i = M(t, n, e);
106
+ return c?.(r, o), i;
84
107
  }
85
108
  return null;
86
109
  },
87
- [f]
88
- ), T = s(
89
- (l, e, i) => {
90
- const n = C(l, e, i);
91
- return f?.(e, i), n;
110
+ [c]
111
+ ), y = a(
112
+ (t, r, o) => {
113
+ const n = T(t, r, o);
114
+ return c?.(r, o), n;
92
115
  },
93
- [C, f]
94
- ), b = s(
95
- (l, e, i) => {
96
- const n = c(l, e), r = c(l, i);
97
- if (!n || !r) return null;
98
- let o;
99
- const t = (d) => {
100
- for (const u of d) {
101
- if (u.id === e) return u;
102
- if (u.children) {
103
- const x = t(u.children);
104
- if (x) return x;
105
- }
106
- }
107
- };
108
- if (o = t(l), !o) return null;
109
- const a = l.map((d) => {
110
- if (d.id === n)
116
+ [T, c]
117
+ ), A = a(
118
+ (t, r, o, n = !1) => {
119
+ const e = h(t, r), i = h(t, o);
120
+ if (!e || !i) return null;
121
+ const l = b(t, r);
122
+ if (!l) return null;
123
+ const P = t.map((u) => {
124
+ if (u.id === e)
111
125
  return {
112
- ...d,
113
- children: d.children ? d.children.filter((u) => u.id !== e) : []
126
+ ...u,
127
+ children: u.children ? u.children.filter((d) => d.id !== r) : []
114
128
  };
115
- if (d.id === r) {
116
- const u = d.children ? [...d.children] : [], x = u.findIndex(
117
- (P) => P.id === i
129
+ if (u.id === i) {
130
+ const d = u.children ? [...u.children] : [], C = d.findIndex(
131
+ (S) => S.id === o
118
132
  );
119
- return x !== -1 ? u.splice(x, 0, o) : u.push(o), {
120
- ...d,
121
- children: u
133
+ if (C !== -1) {
134
+ const S = n ? C + 1 : C;
135
+ d.splice(S, 0, l);
136
+ } else
137
+ d.push(l);
138
+ return {
139
+ ...u,
140
+ children: d
122
141
  };
123
142
  }
124
- return d;
143
+ return u;
125
144
  });
126
- return f?.(e, i), a;
145
+ return c?.(r, o), P;
127
146
  },
128
- [c, f]
129
- ), y = s(
130
- (l, e) => {
131
- const { active: i, over: n } = l;
132
- !n || i.id === n.id || e((r) => {
133
- const o = i.id, t = n.id, a = h(r, o), d = h(r, t), u = c(r, o), x = c(r, t);
134
- return a === 0 && d !== null && d > 0 ? R(
135
- r,
136
- o,
137
- t
138
- ) || r : a === null || d === null || a !== d ? r : a > 0 && u !== x ? b(r, o, t) || r : a === 0 ? M(r, o, t) || r : T(r, o, t);
147
+ [h, c]
148
+ ), O = a(
149
+ (t, r, o) => {
150
+ const n = b(t, r);
151
+ if (!n) return t;
152
+ const e = t.map((i) => {
153
+ let l = i.children ? i.children.filter((P) => P.id !== r) : [];
154
+ return i.id === o && (l = [n, ...l]), { ...i, children: l };
155
+ });
156
+ return c?.(r, o), e;
157
+ },
158
+ [c]
159
+ ), k = a(
160
+ (t, r) => {
161
+ const { active: o, over: n } = t;
162
+ !n || o.id === n.id || r((e) => {
163
+ const i = o.id, l = n.id, P = g(l);
164
+ if (P)
165
+ return O(e, i, P);
166
+ const u = s(e, i), d = s(e, l), C = h(e, i), S = h(e, l);
167
+ if (L.has(l) && u !== null && u > 0)
168
+ return O(e, i, l);
169
+ if (u === 0 && d !== null && d > 0)
170
+ return N(
171
+ e,
172
+ i,
173
+ l
174
+ ) || e;
175
+ if (u === null || d === null || u !== d)
176
+ return e;
177
+ if (u > 0 && C !== S) {
178
+ const R = o.rect.current.translated, w = n.rect;
179
+ let B = !1;
180
+ if (R && w) {
181
+ const H = R.top + R.height / 2, V = w.top + w.height / 2;
182
+ B = H > V;
183
+ }
184
+ return A(e, i, l, B) || e;
185
+ }
186
+ return u === 0 ? _(e, i, l) || e : y(e, i, l);
139
187
  });
140
188
  },
141
189
  [
190
+ s,
142
191
  h,
143
- c,
144
- R,
145
- M,
146
- T,
147
- b
192
+ N,
193
+ _,
194
+ y,
195
+ A,
196
+ O
148
197
  ]
149
- ), N = s(
150
- (l, e) => {
151
- if (!l || !e || l === e)
198
+ ), z = a(
199
+ (t, r) => {
200
+ if (!t || !r || t === r)
152
201
  return !1;
153
- const i = l ? h(L, l) : null, n = e ? h(L, e) : null;
154
- return i === null || n === null ? !1 : i === 0 && n > 0 || i === n;
202
+ const o = t ? s(f, t) : null, n = r ? s(f, r) : null;
203
+ return g(r) !== null || L.has(r) ? !0 : o === null || n === null ? !1 : o === 0 && n > 0 || o === n;
155
204
  },
156
- [L, h]
205
+ [f, s]
157
206
  );
158
207
  return {
159
- sensors: w,
160
- handleDragEnd: y,
161
- isValidDrop: N,
162
- findItemLevel: h,
163
- findParentId: c
208
+ sensors: x,
209
+ handleDragEnd: k,
210
+ isValidDrop: z,
211
+ findItemLevel: s,
212
+ findParentId: h
164
213
  };
165
214
  };
166
215
  export {
167
- B as useNestedListDragDrop
216
+ Q as customCollisionDetection,
217
+ U as useNestedListDragDrop
168
218
  };