@tipp/ui 1.1.3 → 1.1.4

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.
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  FieldErrorWrapper
3
- } from "../chunk-CHHLIPDN.js";
4
- import "../chunk-25HMMI7R.js";
3
+ } from "../chunk-CNQ7RNNY.js";
5
4
  import "../chunk-O3XTRD7R.js";
5
+ import "../chunk-25HMMI7R.js";
6
6
  import "../chunk-N552FDTV.js";
7
7
  export {
8
8
  FieldErrorWrapper
@@ -1,4 +1,16 @@
1
1
  import "../chunk-2ANGYYEV.js";
2
+ import {
3
+ TextField
4
+ } from "../chunk-JPIZP2PZ.js";
5
+ import {
6
+ Separator
7
+ } from "../chunk-HYITAA4J.js";
8
+ import {
9
+ Skeleton
10
+ } from "../chunk-5H3YPCZK.js";
11
+ import {
12
+ Spinner
13
+ } from "../chunk-FR2GDOU2.js";
2
14
  import {
3
15
  Strong
4
16
  } from "../chunk-74DX4CU7.js";
@@ -15,8 +27,14 @@ import {
15
27
  TextArea
16
28
  } from "../chunk-ILRUXI2E.js";
17
29
  import {
18
- TextField
19
- } from "../chunk-JPIZP2PZ.js";
30
+ Quote
31
+ } from "../chunk-YO3BQW6S.js";
32
+ import {
33
+ RadioCards
34
+ } from "../chunk-6IVCARWS.js";
35
+ import {
36
+ RadioGroup
37
+ } from "../chunk-6DJOIRMF.js";
20
38
  import {
21
39
  Radio
22
40
  } from "../chunk-FPD73OHW.js";
@@ -33,14 +51,8 @@ import {
33
51
  Select
34
52
  } from "../chunk-3JRNKBMN.js";
35
53
  import {
36
- Separator
37
- } from "../chunk-HYITAA4J.js";
38
- import {
39
- Skeleton
40
- } from "../chunk-5H3YPCZK.js";
41
- import {
42
- Spinner
43
- } from "../chunk-FR2GDOU2.js";
54
+ Inset
55
+ } from "../chunk-XQOL7UBI.js";
44
56
  import {
45
57
  Kbd
46
58
  } from "../chunk-TULWX7D6.js";
@@ -49,7 +61,7 @@ import {
49
61
  } from "../chunk-XQOZWYUA.js";
50
62
  import {
51
63
  Pagination
52
- } from "../chunk-FQYPUIFX.js";
64
+ } from "../chunk-HXJPG3ZO.js";
53
65
  import {
54
66
  Popover
55
67
  } from "../chunk-5AVBYDPB.js";
@@ -57,14 +69,23 @@ import {
57
69
  Progress
58
70
  } from "../chunk-365QMK4D.js";
59
71
  import {
60
- Quote
61
- } from "../chunk-YO3BQW6S.js";
72
+ EllipsisTooltip
73
+ } from "../chunk-4IKPNQV5.js";
62
74
  import {
63
- RadioCards
64
- } from "../chunk-6IVCARWS.js";
75
+ Tooltip
76
+ } from "../chunk-ACVANQJ4.js";
65
77
  import {
66
- RadioGroup
67
- } from "../chunk-6DJOIRMF.js";
78
+ Em
79
+ } from "../chunk-2DZ2Y3JI.js";
80
+ import {
81
+ FieldErrorWrapper
82
+ } from "../chunk-CNQ7RNNY.js";
83
+ import {
84
+ Typo
85
+ } from "../chunk-O3XTRD7R.js";
86
+ import {
87
+ Flex
88
+ } from "../chunk-25HMMI7R.js";
68
89
  import {
69
90
  Form
70
91
  } from "../chunk-2CVXGGI5.js";
@@ -78,8 +99,14 @@ import {
78
99
  HoverCard
79
100
  } from "../chunk-O3T3TM3V.js";
80
101
  import {
81
- Inset
82
- } from "../chunk-XQOL7UBI.js";
102
+ Checkbox
103
+ } from "../chunk-JEHDCZQU.js";
104
+ import {
105
+ Code
106
+ } from "../chunk-OHMOP5PV.js";
107
+ import {
108
+ Collapse
109
+ } from "../chunk-KGLIAFTI.js";
83
110
  import {
84
111
  Container
85
112
  } from "../chunk-Q37G2GS6.js";
@@ -107,23 +134,14 @@ import {
107
134
  DropdownMenu
108
135
  } from "../chunk-4WFMOFN2.js";
109
136
  import {
110
- EllipsisTooltip
111
- } from "../chunk-4IKPNQV5.js";
112
- import {
113
- Tooltip
114
- } from "../chunk-ACVANQJ4.js";
115
- import {
116
- Em
117
- } from "../chunk-2DZ2Y3JI.js";
118
- import {
119
- FieldErrorWrapper
120
- } from "../chunk-CHHLIPDN.js";
137
+ Badge
138
+ } from "../chunk-5JJ3GWKF.js";
121
139
  import {
122
- Flex
123
- } from "../chunk-25HMMI7R.js";
140
+ Blockquote
141
+ } from "../chunk-YGL6SWKN.js";
124
142
  import {
125
- Typo
126
- } from "../chunk-O3XTRD7R.js";
143
+ Box
144
+ } from "../chunk-4Y5BEXVN.js";
127
145
  import {
128
146
  Button
129
147
  } from "../chunk-AQX7DQLI.js";
@@ -139,15 +157,6 @@ import {
139
157
  import {
140
158
  CheckboxGroup
141
159
  } from "../chunk-IQEEPHOY.js";
142
- import {
143
- Checkbox
144
- } from "../chunk-JEHDCZQU.js";
145
- import {
146
- Code
147
- } from "../chunk-OHMOP5PV.js";
148
- import {
149
- Collapse
150
- } from "../chunk-KGLIAFTI.js";
151
160
  import "../chunk-TSVWEPRP.js";
152
161
  import {
153
162
  AlertDialog
@@ -158,15 +167,6 @@ import {
158
167
  import {
159
168
  Avatar
160
169
  } from "../chunk-CZEGRZBK.js";
161
- import {
162
- Badge
163
- } from "../chunk-5JJ3GWKF.js";
164
- import {
165
- Blockquote
166
- } from "../chunk-YGL6SWKN.js";
167
- import {
168
- Box
169
- } from "../chunk-4Y5BEXVN.js";
170
170
  import "../chunk-N552FDTV.js";
171
171
  export {
172
172
  AlertDialog,
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  Pagination
3
- } from "../chunk-FQYPUIFX.js";
4
- import "../chunk-O3DNDMV3.js";
5
- import "../chunk-25HMMI7R.js";
3
+ } from "../chunk-HXJPG3ZO.js";
6
4
  import "../chunk-O3XTRD7R.js";
5
+ import "../chunk-25HMMI7R.js";
6
+ import "../chunk-O3DNDMV3.js";
7
7
  import "../chunk-TSVWEPRP.js";
8
8
  import "../chunk-N552FDTV.js";
9
9
  export {
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=chunk-DRBRT57F.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,31 @@
1
+ // src/utils/scroll-to.ts
2
+ function scrollTo(element, targetPosition, duration) {
3
+ const startPosition = element.scrollTop;
4
+ const distance = targetPosition - startPosition;
5
+ let startTime = null;
6
+ function animation(currentTime) {
7
+ if (startTime === null)
8
+ startTime = currentTime;
9
+ const timeElapsed = currentTime - startTime;
10
+ const run = ease(timeElapsed, startPosition, distance, duration);
11
+ element.scrollTop = run;
12
+ if (timeElapsed < duration) {
13
+ requestAnimationFrame(animation);
14
+ }
15
+ }
16
+ function ease(t, b, c, d) {
17
+ let [t2] = [t];
18
+ const [b2, c2, d2] = [b, c, d];
19
+ t2 /= d2 / 2;
20
+ if (t2 < 1)
21
+ return c2 / 2 * t2 * t2 + b2;
22
+ t2--;
23
+ return -c2 / 2 * (t2 * (t2 - 2) - 1) + b2;
24
+ }
25
+ requestAnimationFrame(animation);
26
+ }
27
+
28
+ export {
29
+ scrollTo
30
+ };
31
+ //# sourceMappingURL=chunk-ZXQZRIRS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utils/scroll-to.ts"],"sourcesContent":["export function scrollTo(\n element: HTMLDivElement,\n targetPosition: number,\n duration: number\n): void {\n const startPosition = element.scrollTop;\n const distance = targetPosition - startPosition;\n let startTime: number | null = null;\n\n function animation(currentTime: number): void {\n if (startTime === null) startTime = currentTime;\n const timeElapsed = currentTime - startTime;\n const run = ease(timeElapsed, startPosition, distance, duration);\n element.scrollTop = run;\n if (timeElapsed < duration) {\n requestAnimationFrame(animation);\n }\n }\n\n function ease(t: number, b: number, c: number, d: number): number {\n let [t2] = [t];\n const [b2, c2, d2] = [b, c, d];\n t2 /= d2 / 2;\n if (t2 < 1) return (c2 / 2) * t2 * t2 + b2;\n t2--;\n return (-c2 / 2) * (t2 * (t2 - 2) - 1) + b2;\n }\n\n requestAnimationFrame(animation);\n}\n"],"mappings":";AAAO,SAAS,SACd,SACA,gBACA,UACM;AACN,QAAM,gBAAgB,QAAQ;AAC9B,QAAM,WAAW,iBAAiB;AAClC,MAAI,YAA2B;AAE/B,WAAS,UAAU,aAA2B;AAC5C,QAAI,cAAc;AAAM,kBAAY;AACpC,UAAM,cAAc,cAAc;AAClC,UAAM,MAAM,KAAK,aAAa,eAAe,UAAU,QAAQ;AAC/D,YAAQ,YAAY;AACpB,QAAI,cAAc,UAAU;AAC1B,4BAAsB,SAAS;AAAA,IACjC;AAAA,EACF;AAEA,WAAS,KAAK,GAAW,GAAW,GAAW,GAAmB;AAChE,QAAI,CAAC,EAAE,IAAI,CAAC,CAAC;AACb,UAAM,CAAC,IAAI,IAAI,EAAE,IAAI,CAAC,GAAG,GAAG,CAAC;AAC7B,UAAM,KAAK;AACX,QAAI,KAAK;AAAG,aAAQ,KAAK,IAAK,KAAK,KAAK;AACxC;AACA,WAAQ,CAAC,KAAK,KAAM,MAAM,KAAK,KAAK,KAAK;AAAA,EAC3C;AAEA,wBAAsB,SAAS;AACjC;","names":[]}
package/dist/index.cjs CHANGED
@@ -150,6 +150,7 @@ __export(src_exports, {
150
150
  Typo: () => Typo,
151
151
  createColumnHelper: () => import_react_table2.createColumnHelper,
152
152
  getCellAlign: () => getCellAlign,
153
+ scrollTo: () => scrollTo,
153
154
  toast: () => import_react_toastify2.toast,
154
155
  uiProps: () => uiProps,
155
156
  useThemeContext: () => import_themes51.useThemeContext
@@ -1403,6 +1404,33 @@ var getCellAlign = (arg) => {
1403
1404
  return "left";
1404
1405
  }
1405
1406
  };
1407
+
1408
+ // src/utils/scroll-to.ts
1409
+ function scrollTo(element, targetPosition, duration) {
1410
+ const startPosition = element.scrollTop;
1411
+ const distance = targetPosition - startPosition;
1412
+ let startTime = null;
1413
+ function animation(currentTime) {
1414
+ if (startTime === null)
1415
+ startTime = currentTime;
1416
+ const timeElapsed = currentTime - startTime;
1417
+ const run = ease(timeElapsed, startPosition, distance, duration);
1418
+ element.scrollTop = run;
1419
+ if (timeElapsed < duration) {
1420
+ requestAnimationFrame(animation);
1421
+ }
1422
+ }
1423
+ function ease(t, b, c, d) {
1424
+ let [t2] = [t];
1425
+ const [b2, c2, d2] = [b, c, d];
1426
+ t2 /= d2 / 2;
1427
+ if (t2 < 1)
1428
+ return c2 / 2 * t2 * t2 + b2;
1429
+ t2--;
1430
+ return -c2 / 2 * (t2 * (t2 - 2) - 1) + b2;
1431
+ }
1432
+ requestAnimationFrame(animation);
1433
+ }
1406
1434
  // Annotate the CommonJS export names for ESM import in node:
1407
1435
  0 && (module.exports = {
1408
1436
  AlertDialog,
@@ -1496,6 +1524,7 @@ var getCellAlign = (arg) => {
1496
1524
  Typo,
1497
1525
  createColumnHelper,
1498
1526
  getCellAlign,
1527
+ scrollTo,
1499
1528
  toast,
1500
1529
  uiProps,
1501
1530
  useThemeContext