@tonyarbor/components 0.1.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/dist/Banner.d.mts +59 -0
  2. package/dist/Banner.d.ts +59 -0
  3. package/dist/Banner.js +222 -0
  4. package/dist/Banner.js.map +1 -0
  5. package/dist/Banner.mjs +7 -0
  6. package/dist/Banner.mjs.map +1 -0
  7. package/dist/Checkbox.d.mts +52 -0
  8. package/dist/Checkbox.d.ts +52 -0
  9. package/dist/Checkbox.js +194 -0
  10. package/dist/Checkbox.js.map +1 -0
  11. package/dist/Checkbox.mjs +7 -0
  12. package/dist/Checkbox.mjs.map +1 -0
  13. package/dist/Combobox.d.mts +67 -0
  14. package/dist/Combobox.d.ts +67 -0
  15. package/dist/Combobox.js +329 -0
  16. package/dist/Combobox.js.map +1 -0
  17. package/dist/Combobox.mjs +7 -0
  18. package/dist/Combobox.mjs.map +1 -0
  19. package/dist/DatePicker.d.mts +68 -0
  20. package/dist/DatePicker.d.ts +68 -0
  21. package/dist/DatePicker.js +490 -0
  22. package/dist/DatePicker.js.map +1 -0
  23. package/dist/DatePicker.mjs +7 -0
  24. package/dist/DatePicker.mjs.map +1 -0
  25. package/dist/NumericInput.d.mts +68 -0
  26. package/dist/NumericInput.d.ts +68 -0
  27. package/dist/NumericInput.js +319 -0
  28. package/dist/NumericInput.js.map +1 -0
  29. package/dist/NumericInput.mjs +7 -0
  30. package/dist/NumericInput.mjs.map +1 -0
  31. package/dist/Pagination.d.mts +36 -0
  32. package/dist/Pagination.d.ts +36 -0
  33. package/dist/Pagination.js +301 -0
  34. package/dist/Pagination.js.map +1 -0
  35. package/dist/Pagination.mjs +7 -0
  36. package/dist/Pagination.mjs.map +1 -0
  37. package/dist/Radio.d.mts +48 -0
  38. package/dist/Radio.d.ts +48 -0
  39. package/dist/Radio.js +194 -0
  40. package/dist/Radio.js.map +1 -0
  41. package/dist/Radio.mjs +7 -0
  42. package/dist/Radio.mjs.map +1 -0
  43. package/dist/Table.d.mts +80 -0
  44. package/dist/Table.d.ts +80 -0
  45. package/dist/Table.js +347 -0
  46. package/dist/Table.js.map +1 -0
  47. package/dist/Table.mjs +8 -0
  48. package/dist/Table.mjs.map +1 -0
  49. package/dist/TableControls.d.mts +76 -0
  50. package/dist/TableControls.d.ts +76 -0
  51. package/dist/TableControls.js +461 -0
  52. package/dist/TableControls.js.map +1 -0
  53. package/dist/TableControls.mjs +7 -0
  54. package/dist/TableControls.mjs.map +1 -0
  55. package/dist/TableFooterPagination.d.mts +56 -0
  56. package/dist/TableFooterPagination.d.ts +56 -0
  57. package/dist/TableFooterPagination.js +499 -0
  58. package/dist/TableFooterPagination.js.map +1 -0
  59. package/dist/TableFooterPagination.mjs +7 -0
  60. package/dist/TableFooterPagination.mjs.map +1 -0
  61. package/dist/Tabs.d.mts +50 -0
  62. package/dist/Tabs.d.ts +50 -0
  63. package/dist/Tabs.js +187 -0
  64. package/dist/Tabs.js.map +1 -0
  65. package/dist/Tabs.mjs +7 -0
  66. package/dist/Tabs.mjs.map +1 -0
  67. package/dist/TextArea.d.mts +64 -0
  68. package/dist/TextArea.d.ts +64 -0
  69. package/dist/TextArea.js +171 -0
  70. package/dist/TextArea.js.map +1 -0
  71. package/dist/TextArea.mjs +7 -0
  72. package/dist/TextArea.mjs.map +1 -0
  73. package/dist/Toast.d.mts +48 -0
  74. package/dist/Toast.d.ts +48 -0
  75. package/dist/Toast.js +169 -0
  76. package/dist/Toast.js.map +1 -0
  77. package/dist/Toast.mjs +7 -0
  78. package/dist/Toast.mjs.map +1 -0
  79. package/dist/Toggle.d.mts +48 -0
  80. package/dist/Toggle.d.ts +48 -0
  81. package/dist/Toggle.js +291 -0
  82. package/dist/Toggle.js.map +1 -0
  83. package/dist/Toggle.mjs +7 -0
  84. package/dist/Toggle.mjs.map +1 -0
  85. package/dist/Tooltip.d.mts +32 -0
  86. package/dist/Tooltip.d.ts +32 -0
  87. package/dist/Tooltip.js +109 -0
  88. package/dist/Tooltip.js.map +1 -0
  89. package/dist/Tooltip.mjs +7 -0
  90. package/dist/Tooltip.mjs.map +1 -0
  91. package/dist/chunk-52TG3BFX.mjs +463 -0
  92. package/dist/chunk-52TG3BFX.mjs.map +1 -0
  93. package/dist/chunk-5BUXFTPW.mjs +283 -0
  94. package/dist/chunk-5BUXFTPW.mjs.map +1 -0
  95. package/dist/chunk-7OWLBYNM.mjs +293 -0
  96. package/dist/chunk-7OWLBYNM.mjs.map +1 -0
  97. package/dist/chunk-AI2U34CF.mjs +159 -0
  98. package/dist/chunk-AI2U34CF.mjs.map +1 -0
  99. package/dist/chunk-C25FFMRQ.mjs +255 -0
  100. package/dist/chunk-C25FFMRQ.mjs.map +1 -0
  101. package/dist/chunk-CUTYEIFE.mjs +158 -0
  102. package/dist/chunk-CUTYEIFE.mjs.map +1 -0
  103. package/dist/chunk-DULH2KRW.mjs +133 -0
  104. package/dist/chunk-DULH2KRW.mjs.map +1 -0
  105. package/dist/chunk-G5NVKF2G.mjs +434 -0
  106. package/dist/chunk-G5NVKF2G.mjs.map +1 -0
  107. package/dist/chunk-M6DVBEEL.mjs +158 -0
  108. package/dist/chunk-M6DVBEEL.mjs.map +1 -0
  109. package/dist/chunk-MBUMR2XJ.mjs +135 -0
  110. package/dist/chunk-MBUMR2XJ.mjs.map +1 -0
  111. package/dist/chunk-MNH2TGUX.mjs +73 -0
  112. package/dist/chunk-MNH2TGUX.mjs.map +1 -0
  113. package/dist/chunk-RRMG2SSZ.mjs +265 -0
  114. package/dist/chunk-RRMG2SSZ.mjs.map +1 -0
  115. package/dist/chunk-U4JXKZZG.mjs +186 -0
  116. package/dist/chunk-U4JXKZZG.mjs.map +1 -0
  117. package/dist/chunk-W55QJIAN.mjs +467 -0
  118. package/dist/chunk-W55QJIAN.mjs.map +1 -0
  119. package/dist/chunk-YV4OXFIM.mjs +151 -0
  120. package/dist/chunk-YV4OXFIM.mjs.map +1 -0
  121. package/dist/index.d.mts +22 -1
  122. package/dist/index.d.ts +22 -1
  123. package/dist/index.js +3559 -2
  124. package/dist/index.js.map +1 -1
  125. package/dist/index.mjs +61 -1
  126. package/package.json +81 -3
@@ -0,0 +1,32 @@
1
+ import * as React from 'react';
2
+
3
+ interface TooltipProps {
4
+ /**
5
+ * The content to display in the tooltip
6
+ */
7
+ content: string;
8
+ /**
9
+ * The trigger element that shows the tooltip on hover
10
+ */
11
+ children: React.ReactNode;
12
+ /**
13
+ * Custom className
14
+ */
15
+ className?: string;
16
+ /**
17
+ * Custom style
18
+ */
19
+ style?: React.CSSProperties;
20
+ /**
21
+ * Test ID for testing
22
+ */
23
+ 'data-testid'?: string;
24
+ }
25
+ /**
26
+ * Tooltip component - Arbor Design System
27
+ *
28
+ * A tooltip that appears on hover over a trigger element.
29
+ */
30
+ declare const Tooltip: React.ForwardRefExoticComponent<TooltipProps & React.RefAttributes<HTMLDivElement>>;
31
+
32
+ export { Tooltip, type TooltipProps };
@@ -0,0 +1,32 @@
1
+ import * as React from 'react';
2
+
3
+ interface TooltipProps {
4
+ /**
5
+ * The content to display in the tooltip
6
+ */
7
+ content: string;
8
+ /**
9
+ * The trigger element that shows the tooltip on hover
10
+ */
11
+ children: React.ReactNode;
12
+ /**
13
+ * Custom className
14
+ */
15
+ className?: string;
16
+ /**
17
+ * Custom style
18
+ */
19
+ style?: React.CSSProperties;
20
+ /**
21
+ * Test ID for testing
22
+ */
23
+ 'data-testid'?: string;
24
+ }
25
+ /**
26
+ * Tooltip component - Arbor Design System
27
+ *
28
+ * A tooltip that appears on hover over a trigger element.
29
+ */
30
+ declare const Tooltip: React.ForwardRefExoticComponent<TooltipProps & React.RefAttributes<HTMLDivElement>>;
31
+
32
+ export { Tooltip, type TooltipProps };
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/Tooltip/index.ts
31
+ var Tooltip_exports = {};
32
+ __export(Tooltip_exports, {
33
+ Tooltip: () => Tooltip
34
+ });
35
+ module.exports = __toCommonJS(Tooltip_exports);
36
+
37
+ // src/Tooltip/Tooltip.tsx
38
+ var React = __toESM(require("react"));
39
+ var import_clsx = require("clsx");
40
+ var import_jsx_runtime = require("react/jsx-runtime");
41
+ var tooltipStyles = {
42
+ position: "absolute",
43
+ bottom: "calc(100% + 8px)",
44
+ left: "50%",
45
+ transform: "translateX(-50%)",
46
+ backgroundColor: "#2f2f2f",
47
+ color: "#ffffff",
48
+ padding: "12px",
49
+ borderRadius: "8px",
50
+ boxShadow: "0px 4px 12px 0px rgba(32, 32, 32, 0.08)",
51
+ fontSize: "13px",
52
+ fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",
53
+ fontWeight: 400,
54
+ lineHeight: 1.5,
55
+ whiteSpace: "nowrap",
56
+ pointerEvents: "none",
57
+ zIndex: 1e3,
58
+ opacity: 0,
59
+ transition: "opacity 0.2s ease-in-out"
60
+ };
61
+ var wrapperStyles = {
62
+ position: "relative",
63
+ display: "inline-block"
64
+ };
65
+ var Tooltip = React.forwardRef(
66
+ ({
67
+ content,
68
+ children,
69
+ className,
70
+ style,
71
+ "data-testid": dataTestId
72
+ }, ref) => {
73
+ const [isVisible, setIsVisible] = React.useState(false);
74
+ const visibleTooltipStyles = {
75
+ ...tooltipStyles,
76
+ opacity: isVisible ? 1 : 0,
77
+ ...style
78
+ };
79
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
80
+ "div",
81
+ {
82
+ ref,
83
+ style: wrapperStyles,
84
+ onMouseEnter: () => setIsVisible(true),
85
+ onMouseLeave: () => setIsVisible(false),
86
+ "data-testid": dataTestId,
87
+ children: [
88
+ children,
89
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
90
+ "div",
91
+ {
92
+ className: (0, import_clsx.clsx)("arbor-tooltip", className),
93
+ style: visibleTooltipStyles,
94
+ role: "tooltip",
95
+ "aria-hidden": !isVisible,
96
+ children: content
97
+ }
98
+ )
99
+ ]
100
+ }
101
+ );
102
+ }
103
+ );
104
+ Tooltip.displayName = "Tooltip";
105
+ // Annotate the CommonJS export names for ESM import in node:
106
+ 0 && (module.exports = {
107
+ Tooltip
108
+ });
109
+ //# sourceMappingURL=Tooltip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/Tooltip/index.ts","../src/Tooltip/Tooltip.tsx"],"sourcesContent":["export { Tooltip } from './Tooltip';\nexport type { TooltipProps } from './Tooltip';\n","import * as React from 'react';\nimport { clsx } from 'clsx';\n\nexport interface TooltipProps {\n /**\n * The content to display in the tooltip\n */\n content: string;\n /**\n * The trigger element that shows the tooltip on hover\n */\n children: React.ReactNode;\n /**\n * Custom className\n */\n className?: string;\n /**\n * Custom style\n */\n style?: React.CSSProperties;\n /**\n * Test ID for testing\n */\n 'data-testid'?: string;\n}\n\nconst tooltipStyles: React.CSSProperties = {\n position: 'absolute',\n bottom: 'calc(100% + 8px)',\n left: '50%',\n transform: 'translateX(-50%)',\n backgroundColor: '#2f2f2f',\n color: '#ffffff',\n padding: '12px',\n borderRadius: '8px',\n boxShadow: '0px 4px 12px 0px rgba(32, 32, 32, 0.08)',\n fontSize: '13px',\n fontFamily: \"'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\",\n fontWeight: 400,\n lineHeight: 1.5,\n whiteSpace: 'nowrap',\n pointerEvents: 'none',\n zIndex: 1000,\n opacity: 0,\n transition: 'opacity 0.2s ease-in-out',\n};\n\nconst wrapperStyles: React.CSSProperties = {\n position: 'relative',\n display: 'inline-block',\n};\n\n/**\n * Tooltip component - Arbor Design System\n *\n * A tooltip that appears on hover over a trigger element.\n */\nexport const Tooltip = React.forwardRef<HTMLDivElement, TooltipProps>(\n (\n {\n content,\n children,\n className,\n style,\n 'data-testid': dataTestId,\n },\n ref\n ) => {\n const [isVisible, setIsVisible] = React.useState(false);\n\n const visibleTooltipStyles: React.CSSProperties = {\n ...tooltipStyles,\n opacity: isVisible ? 1 : 0,\n ...style,\n };\n\n return (\n <div\n ref={ref}\n style={wrapperStyles}\n onMouseEnter={() => setIsVisible(true)}\n onMouseLeave={() => setIsVisible(false)}\n data-testid={dataTestId}\n >\n {children}\n <div\n className={clsx('arbor-tooltip', className)}\n style={visibleTooltipStyles}\n role=\"tooltip\"\n aria-hidden={!isVisible}\n >\n {content}\n </div>\n </div>\n );\n }\n);\n\nTooltip.displayName = 'Tooltip';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,kBAAqB;AA4Ef;AAnDN,IAAM,gBAAqC;AAAA,EACzC,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,OAAO;AAAA,EACP,SAAS;AAAA,EACT,cAAc;AAAA,EACd,WAAW;AAAA,EACX,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,YAAY;AACd;AAEA,IAAM,gBAAqC;AAAA,EACzC,UAAU;AAAA,EACV,SAAS;AACX;AAOO,IAAM,UAAgB;AAAA,EAC3B,CACE;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,eAAe;AAAA,EACjB,GACA,QACG;AACH,UAAM,CAAC,WAAW,YAAY,IAAU,eAAS,KAAK;AAEtD,UAAM,uBAA4C;AAAA,MAChD,GAAG;AAAA,MACH,SAAS,YAAY,IAAI;AAAA,MACzB,GAAG;AAAA,IACL;AAEA,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,OAAO;AAAA,QACP,cAAc,MAAM,aAAa,IAAI;AAAA,QACrC,cAAc,MAAM,aAAa,KAAK;AAAA,QACtC,eAAa;AAAA,QAEZ;AAAA;AAAA,UACD;AAAA,YAAC;AAAA;AAAA,cACC,eAAW,kBAAK,iBAAiB,SAAS;AAAA,cAC1C,OAAO;AAAA,cACP,MAAK;AAAA,cACL,eAAa,CAAC;AAAA,cAEb;AAAA;AAAA,UACH;AAAA;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,QAAQ,cAAc;","names":[]}
@@ -0,0 +1,7 @@
1
+ import {
2
+ Tooltip
3
+ } from "./chunk-MNH2TGUX.mjs";
4
+ export {
5
+ Tooltip
6
+ };
7
+ //# sourceMappingURL=Tooltip.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,463 @@
1
+ // src/TableFooterPagination/TableFooterPagination.tsx
2
+ import * as React from "react";
3
+ import { clsx } from "clsx";
4
+ import { ChevronDown } from "lucide-react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ var containerStyles = {
7
+ display: "flex",
8
+ alignItems: "center",
9
+ justifyContent: "space-between",
10
+ backgroundColor: "white",
11
+ paddingTop: "4px",
12
+ paddingBottom: 0,
13
+ paddingLeft: 0,
14
+ paddingRight: 0,
15
+ fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"
16
+ };
17
+ var textStyles = {
18
+ fontSize: "13px",
19
+ fontWeight: 400,
20
+ lineHeight: "1.5",
21
+ color: "#2f2f2f",
22
+ minWidth: "165px"
23
+ };
24
+ var paginationWrapperStyles = {
25
+ display: "flex",
26
+ alignItems: "center",
27
+ justifyContent: "center",
28
+ gap: "8px",
29
+ minWidth: "165px",
30
+ flexWrap: "wrap"
31
+ };
32
+ var paginationButtonStyles = {
33
+ width: "32px",
34
+ height: "32px",
35
+ minWidth: "32px",
36
+ minHeight: "32px",
37
+ maxWidth: "32px",
38
+ maxHeight: "32px",
39
+ borderRadius: "99px",
40
+ border: "none",
41
+ background: "white",
42
+ cursor: "pointer",
43
+ display: "flex",
44
+ alignItems: "center",
45
+ justifyContent: "center",
46
+ padding: 0,
47
+ transition: "background-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out",
48
+ flexShrink: 0,
49
+ WebkitTapHighlightColor: "transparent",
50
+ outline: "none"
51
+ };
52
+ var paginationButtonDisabledStyles = {
53
+ cursor: "not-allowed",
54
+ opacity: 0.5
55
+ };
56
+ var paginationLabelStyles = {
57
+ fontSize: "13px",
58
+ fontWeight: 400,
59
+ lineHeight: "1.5",
60
+ color: "#2f2f2f"
61
+ };
62
+ var paginationInputWrapperStyles = {
63
+ display: "flex",
64
+ alignItems: "center",
65
+ gap: "8px"
66
+ };
67
+ var paginationInputStyles = {
68
+ width: "60px",
69
+ paddingTop: "12px",
70
+ paddingBottom: "12px",
71
+ paddingLeft: "16px",
72
+ paddingRight: "16px",
73
+ fontSize: "13px",
74
+ fontWeight: 400,
75
+ lineHeight: "1.5",
76
+ color: "#2f2f2f",
77
+ backgroundColor: "white",
78
+ border: "1px solid #dfdfdf",
79
+ borderRadius: "8px",
80
+ fontFamily: "inherit",
81
+ textAlign: "center",
82
+ outline: "none"
83
+ };
84
+ var paginationInputFocusStyles = {
85
+ boxShadow: "0px 0px 0px 3px #3cad51"
86
+ };
87
+ var rightAlignedStyles = {
88
+ display: "flex",
89
+ gap: "16px",
90
+ alignItems: "center",
91
+ justifyContent: "flex-end",
92
+ minWidth: "165px"
93
+ };
94
+ var perPageButtonStyles = {
95
+ height: "32px",
96
+ backgroundColor: "white",
97
+ border: "1px solid #d1d1d1",
98
+ borderRadius: "8px",
99
+ display: "flex",
100
+ alignItems: "center",
101
+ gap: "8px",
102
+ paddingLeft: "12px",
103
+ paddingRight: "8px",
104
+ paddingTop: "8px",
105
+ paddingBottom: "8px",
106
+ cursor: "pointer",
107
+ transition: "background-color 0.2s ease-in-out",
108
+ outline: "none"
109
+ };
110
+ var perPageTextStyles = {
111
+ fontSize: "13px",
112
+ fontWeight: 600,
113
+ lineHeight: "1.5",
114
+ color: "#2f2f2f",
115
+ textAlign: "center"
116
+ };
117
+ var expandButtonStyles = {
118
+ height: "32px",
119
+ minHeight: "32px",
120
+ backgroundColor: "#efefef",
121
+ border: "none",
122
+ borderRadius: "99px",
123
+ display: "flex",
124
+ alignItems: "center",
125
+ justifyContent: "center",
126
+ paddingLeft: "16px",
127
+ paddingRight: "16px",
128
+ paddingTop: 0,
129
+ paddingBottom: 0,
130
+ gap: 0,
131
+ cursor: "pointer",
132
+ transition: "background-color 0.2s ease-in-out",
133
+ outline: "none"
134
+ };
135
+ var expandButtonTextStyles = {
136
+ fontSize: "13px",
137
+ fontWeight: 600,
138
+ lineHeight: "1.5",
139
+ color: "#2f2f2f",
140
+ textAlign: "center"
141
+ };
142
+ var TableFooterPagination = React.forwardRef(
143
+ ({
144
+ currentPage,
145
+ totalPages,
146
+ onPageChange,
147
+ totalResults,
148
+ currentResults,
149
+ itemsPerPage,
150
+ onItemsPerPageChange,
151
+ onExpandTable,
152
+ className,
153
+ style,
154
+ "data-testid": dataTestId
155
+ }, ref) => {
156
+ const [inputValue, setInputValue] = React.useState(currentPage.toString());
157
+ const [focusedButton, setFocusedButton] = React.useState(null);
158
+ const [hoveredButton, setHoveredButton] = React.useState(null);
159
+ const [activeButton, setActiveButton] = React.useState(null);
160
+ const [inputFocused, setInputFocused] = React.useState(false);
161
+ const [perPageHovered, setPerPageHovered] = React.useState(false);
162
+ const [expandHovered, setExpandHovered] = React.useState(false);
163
+ React.useEffect(() => {
164
+ setInputValue(currentPage.toString());
165
+ }, [currentPage]);
166
+ const handleFirstPage = () => {
167
+ if (currentPage !== 1) {
168
+ onPageChange(1);
169
+ }
170
+ };
171
+ const handlePreviousPage = () => {
172
+ if (currentPage > 1) {
173
+ onPageChange(currentPage - 1);
174
+ }
175
+ };
176
+ const handleNextPage = () => {
177
+ if (currentPage < totalPages) {
178
+ onPageChange(currentPage + 1);
179
+ }
180
+ };
181
+ const handleLastPage = () => {
182
+ if (currentPage !== totalPages) {
183
+ onPageChange(totalPages);
184
+ }
185
+ };
186
+ const handleInputChange = (e) => {
187
+ const value = e.target.value;
188
+ if (value === "" || /^\d+$/.test(value)) {
189
+ setInputValue(value);
190
+ }
191
+ };
192
+ const handleInputBlur = () => {
193
+ setInputFocused(false);
194
+ const pageNumber = parseInt(inputValue, 10);
195
+ if (isNaN(pageNumber) || pageNumber < 1) {
196
+ setInputValue(currentPage.toString());
197
+ } else if (pageNumber > totalPages) {
198
+ setInputValue(totalPages.toString());
199
+ onPageChange(totalPages);
200
+ } else if (pageNumber !== currentPage) {
201
+ onPageChange(pageNumber);
202
+ }
203
+ };
204
+ const handleInputKeyDown = (e) => {
205
+ if (e.key === "Enter") {
206
+ handleInputBlur();
207
+ e.target.blur();
208
+ }
209
+ };
210
+ const getButtonStyle = (buttonName, disabled) => {
211
+ if (disabled) {
212
+ return { ...paginationButtonStyles, ...paginationButtonDisabledStyles };
213
+ }
214
+ const isHovered = hoveredButton === buttonName;
215
+ const isFocused = focusedButton === buttonName;
216
+ const isActive = activeButton === buttonName;
217
+ const style2 = {
218
+ ...paginationButtonStyles
219
+ };
220
+ if (isHovered && !isFocused && !isActive) {
221
+ style2.backgroundColor = "#efefef";
222
+ }
223
+ if (isActive && !isFocused) {
224
+ style2.backgroundColor = "transparent";
225
+ }
226
+ if (isFocused) {
227
+ style2.boxShadow = "0px 0px 0px 3px #3cad51";
228
+ style2.backgroundColor = "rgba(255, 255, 255, 0.01)";
229
+ }
230
+ return style2;
231
+ };
232
+ const isFirstDisabled = currentPage === 1;
233
+ const isPreviousDisabled = currentPage === 1;
234
+ const isNextDisabled = currentPage === totalPages;
235
+ const isLastDisabled = currentPage === totalPages;
236
+ const resultText = currentResults === totalResults ? `Showing ${totalResults} results` : `Showing ${currentResults} of ${totalResults} results`;
237
+ return /* @__PURE__ */ jsxs(
238
+ "div",
239
+ {
240
+ ref,
241
+ className: clsx("arbor-table-footer-pagination", className),
242
+ style: { ...containerStyles, ...style },
243
+ "data-testid": dataTestId,
244
+ children: [
245
+ /* @__PURE__ */ jsx("div", { style: textStyles, children: resultText }),
246
+ /* @__PURE__ */ jsxs("div", { style: paginationWrapperStyles, children: [
247
+ /* @__PURE__ */ jsx(
248
+ "button",
249
+ {
250
+ type: "button",
251
+ onClick: handleFirstPage,
252
+ disabled: isFirstDisabled,
253
+ onMouseEnter: () => setHoveredButton("first"),
254
+ onMouseLeave: () => setHoveredButton(null),
255
+ onMouseDown: () => setActiveButton("first"),
256
+ onMouseUp: () => setActiveButton(null),
257
+ onFocus: () => setFocusedButton("first"),
258
+ onBlur: () => setFocusedButton(null),
259
+ style: getButtonStyle("first", isFirstDisabled),
260
+ "aria-label": "Go to first page",
261
+ children: /* @__PURE__ */ jsx(
262
+ "svg",
263
+ {
264
+ width: "16",
265
+ height: "16",
266
+ viewBox: "0 0 16 16",
267
+ fill: "none",
268
+ xmlns: "http://www.w3.org/2000/svg",
269
+ children: /* @__PURE__ */ jsx(
270
+ "path",
271
+ {
272
+ d: "M7 12L3 8L7 4M11 12L7 8L11 4",
273
+ stroke: "#2f2f2f",
274
+ strokeWidth: "1.5",
275
+ strokeLinecap: "round",
276
+ strokeLinejoin: "round"
277
+ }
278
+ )
279
+ }
280
+ )
281
+ }
282
+ ),
283
+ /* @__PURE__ */ jsx(
284
+ "button",
285
+ {
286
+ type: "button",
287
+ onClick: handlePreviousPage,
288
+ disabled: isPreviousDisabled,
289
+ onMouseEnter: () => setHoveredButton("previous"),
290
+ onMouseLeave: () => setHoveredButton(null),
291
+ onMouseDown: () => setActiveButton("previous"),
292
+ onMouseUp: () => setActiveButton(null),
293
+ onFocus: () => setFocusedButton("previous"),
294
+ onBlur: () => setFocusedButton(null),
295
+ style: getButtonStyle("previous", isPreviousDisabled),
296
+ "aria-label": "Go to previous page",
297
+ children: /* @__PURE__ */ jsx(
298
+ "svg",
299
+ {
300
+ width: "16",
301
+ height: "16",
302
+ viewBox: "0 0 16 16",
303
+ fill: "none",
304
+ xmlns: "http://www.w3.org/2000/svg",
305
+ children: /* @__PURE__ */ jsx(
306
+ "path",
307
+ {
308
+ d: "M10 12L6 8L10 4",
309
+ stroke: "#2f2f2f",
310
+ strokeWidth: "1.5",
311
+ strokeLinecap: "round",
312
+ strokeLinejoin: "round"
313
+ }
314
+ )
315
+ }
316
+ )
317
+ }
318
+ ),
319
+ /* @__PURE__ */ jsxs("div", { style: paginationInputWrapperStyles, children: [
320
+ /* @__PURE__ */ jsx("span", { style: paginationLabelStyles, children: "Page" }),
321
+ /* @__PURE__ */ jsx(
322
+ "input",
323
+ {
324
+ type: "text",
325
+ value: inputValue,
326
+ onChange: handleInputChange,
327
+ onBlur: handleInputBlur,
328
+ onFocus: () => setInputFocused(true),
329
+ onKeyDown: handleInputKeyDown,
330
+ style: {
331
+ ...paginationInputStyles,
332
+ ...inputFocused && paginationInputFocusStyles
333
+ },
334
+ "aria-label": `Page ${currentPage} of ${totalPages}`
335
+ }
336
+ ),
337
+ /* @__PURE__ */ jsxs("span", { style: paginationLabelStyles, children: [
338
+ "of ",
339
+ totalPages
340
+ ] })
341
+ ] }),
342
+ /* @__PURE__ */ jsx(
343
+ "button",
344
+ {
345
+ type: "button",
346
+ onClick: handleNextPage,
347
+ disabled: isNextDisabled,
348
+ onMouseEnter: () => setHoveredButton("next"),
349
+ onMouseLeave: () => setHoveredButton(null),
350
+ onMouseDown: () => setActiveButton("next"),
351
+ onMouseUp: () => setActiveButton(null),
352
+ onFocus: () => setFocusedButton("next"),
353
+ onBlur: () => setFocusedButton(null),
354
+ style: getButtonStyle("next", isNextDisabled),
355
+ "aria-label": "Go to next page",
356
+ children: /* @__PURE__ */ jsx(
357
+ "svg",
358
+ {
359
+ width: "16",
360
+ height: "16",
361
+ viewBox: "0 0 16 16",
362
+ fill: "none",
363
+ xmlns: "http://www.w3.org/2000/svg",
364
+ children: /* @__PURE__ */ jsx(
365
+ "path",
366
+ {
367
+ d: "M6 4L10 8L6 12",
368
+ stroke: "#2f2f2f",
369
+ strokeWidth: "1.5",
370
+ strokeLinecap: "round",
371
+ strokeLinejoin: "round"
372
+ }
373
+ )
374
+ }
375
+ )
376
+ }
377
+ ),
378
+ /* @__PURE__ */ jsx(
379
+ "button",
380
+ {
381
+ type: "button",
382
+ onClick: handleLastPage,
383
+ disabled: isLastDisabled,
384
+ onMouseEnter: () => setHoveredButton("last"),
385
+ onMouseLeave: () => setHoveredButton(null),
386
+ onMouseDown: () => setActiveButton("last"),
387
+ onMouseUp: () => setActiveButton(null),
388
+ onFocus: () => setFocusedButton("last"),
389
+ onBlur: () => setFocusedButton(null),
390
+ style: getButtonStyle("last", isLastDisabled),
391
+ "aria-label": "Go to last page",
392
+ children: /* @__PURE__ */ jsx(
393
+ "svg",
394
+ {
395
+ width: "16",
396
+ height: "16",
397
+ viewBox: "0 0 16 16",
398
+ fill: "none",
399
+ xmlns: "http://www.w3.org/2000/svg",
400
+ children: /* @__PURE__ */ jsx(
401
+ "path",
402
+ {
403
+ d: "M9 4L13 8L9 12M5 4L9 8L5 12",
404
+ stroke: "#2f2f2f",
405
+ strokeWidth: "1.5",
406
+ strokeLinecap: "round",
407
+ strokeLinejoin: "round"
408
+ }
409
+ )
410
+ }
411
+ )
412
+ }
413
+ )
414
+ ] }),
415
+ /* @__PURE__ */ jsxs("div", { style: rightAlignedStyles, children: [
416
+ onItemsPerPageChange && /* @__PURE__ */ jsxs(
417
+ "button",
418
+ {
419
+ type: "button",
420
+ onClick: () => onItemsPerPageChange(itemsPerPage),
421
+ onMouseEnter: () => setPerPageHovered(true),
422
+ onMouseLeave: () => setPerPageHovered(false),
423
+ style: {
424
+ ...perPageButtonStyles,
425
+ backgroundColor: perPageHovered ? "#f5f5f5" : "white"
426
+ },
427
+ "aria-label": "Items per page",
428
+ children: [
429
+ /* @__PURE__ */ jsxs("span", { style: perPageTextStyles, children: [
430
+ itemsPerPage,
431
+ " per page"
432
+ ] }),
433
+ /* @__PURE__ */ jsx(ChevronDown, { size: 16, color: "#2f2f2f" })
434
+ ]
435
+ }
436
+ ),
437
+ onExpandTable && /* @__PURE__ */ jsx(
438
+ "button",
439
+ {
440
+ type: "button",
441
+ onClick: onExpandTable,
442
+ onMouseEnter: () => setExpandHovered(true),
443
+ onMouseLeave: () => setExpandHovered(false),
444
+ style: {
445
+ ...expandButtonStyles,
446
+ backgroundColor: expandHovered ? "#e5e5e5" : "#efefef"
447
+ },
448
+ "aria-label": "Expand table",
449
+ children: /* @__PURE__ */ jsx("span", { style: expandButtonTextStyles, children: "Expand table" })
450
+ }
451
+ )
452
+ ] })
453
+ ]
454
+ }
455
+ );
456
+ }
457
+ );
458
+ TableFooterPagination.displayName = "TableFooterPagination";
459
+
460
+ export {
461
+ TableFooterPagination
462
+ };
463
+ //# sourceMappingURL=chunk-52TG3BFX.mjs.map