@rttui/skin-anocca 1.0.35 → 1.0.37

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 (78) hide show
  1. package/README.md +62 -1
  2. package/dist/cjs/cell.cjs +102 -0
  3. package/dist/cjs/cell.cjs.map +10 -0
  4. package/dist/cjs/cell_avatar.cjs +62 -0
  5. package/dist/cjs/cell_avatar.cjs.map +10 -0
  6. package/dist/cjs/cell_avatar_with_text.cjs +80 -0
  7. package/dist/cjs/cell_avatar_with_text.cjs.map +10 -0
  8. package/dist/cjs/cell_badge.cjs +66 -0
  9. package/dist/cjs/cell_badge.cjs.map +10 -0
  10. package/dist/cjs/cell_currency.cjs +57 -0
  11. package/dist/cjs/cell_currency.cjs.map +10 -0
  12. package/dist/cjs/cell_link.cjs +78 -0
  13. package/dist/cjs/cell_link.cjs.map +10 -0
  14. package/dist/cjs/cell_number.cjs +48 -0
  15. package/dist/cjs/cell_number.cjs.map +10 -0
  16. package/dist/cjs/cell_percent.cjs +56 -0
  17. package/dist/cjs/cell_percent.cjs.map +10 -0
  18. package/dist/cjs/cell_tag.cjs +53 -0
  19. package/dist/cjs/cell_tag.cjs.map +10 -0
  20. package/dist/cjs/cell_text.cjs +47 -0
  21. package/dist/cjs/cell_text.cjs.map +10 -0
  22. package/dist/cjs/cell_text_bold.cjs +51 -0
  23. package/dist/cjs/cell_text_bold.cjs.map +10 -0
  24. package/dist/cjs/checkbox.cjs +80 -0
  25. package/dist/cjs/checkbox.cjs.map +10 -0
  26. package/dist/cjs/expand_button.cjs +84 -0
  27. package/dist/cjs/expand_button.cjs.map +10 -0
  28. package/dist/cjs/index.cjs +27 -1
  29. package/dist/cjs/index.cjs.map +3 -3
  30. package/dist/cjs/package.json +1 -1
  31. package/dist/cjs/resizer.cjs +8 -1
  32. package/dist/cjs/resizer.cjs.map +3 -3
  33. package/dist/mjs/cell.mjs +72 -0
  34. package/dist/mjs/cell.mjs.map +10 -0
  35. package/dist/mjs/cell_avatar.mjs +32 -0
  36. package/dist/mjs/cell_avatar.mjs.map +10 -0
  37. package/dist/mjs/cell_avatar_with_text.mjs +50 -0
  38. package/dist/mjs/cell_avatar_with_text.mjs.map +10 -0
  39. package/dist/mjs/cell_badge.mjs +36 -0
  40. package/dist/mjs/cell_badge.mjs.map +10 -0
  41. package/dist/mjs/cell_currency.mjs +27 -0
  42. package/dist/mjs/cell_currency.mjs.map +10 -0
  43. package/dist/mjs/cell_link.mjs +48 -0
  44. package/dist/mjs/cell_link.mjs.map +10 -0
  45. package/dist/mjs/cell_number.mjs +18 -0
  46. package/dist/mjs/cell_number.mjs.map +10 -0
  47. package/dist/mjs/cell_percent.mjs +26 -0
  48. package/dist/mjs/cell_percent.mjs.map +10 -0
  49. package/dist/mjs/cell_tag.mjs +23 -0
  50. package/dist/mjs/cell_tag.mjs.map +10 -0
  51. package/dist/mjs/cell_text.mjs +17 -0
  52. package/dist/mjs/cell_text.mjs.map +10 -0
  53. package/dist/mjs/cell_text_bold.mjs +21 -0
  54. package/dist/mjs/cell_text_bold.mjs.map +10 -0
  55. package/dist/mjs/checkbox.mjs +50 -0
  56. package/dist/mjs/checkbox.mjs.map +10 -0
  57. package/dist/mjs/expand_button.mjs +54 -0
  58. package/dist/mjs/expand_button.mjs.map +10 -0
  59. package/dist/mjs/index.mjs +27 -1
  60. package/dist/mjs/index.mjs.map +3 -3
  61. package/dist/mjs/package.json +1 -1
  62. package/dist/mjs/resizer.mjs +8 -1
  63. package/dist/mjs/resizer.mjs.map +3 -3
  64. package/dist/types/cell.d.ts +3 -0
  65. package/dist/types/cell_avatar.d.ts +3 -0
  66. package/dist/types/cell_avatar_with_text.d.ts +3 -0
  67. package/dist/types/cell_badge.d.ts +3 -0
  68. package/dist/types/cell_currency.d.ts +3 -0
  69. package/dist/types/cell_link.d.ts +8 -0
  70. package/dist/types/cell_number.d.ts +6 -0
  71. package/dist/types/cell_percent.d.ts +7 -0
  72. package/dist/types/cell_tag.d.ts +6 -0
  73. package/dist/types/cell_text.d.ts +6 -0
  74. package/dist/types/cell_text_bold.d.ts +7 -0
  75. package/dist/types/checkbox.d.ts +3 -0
  76. package/dist/types/expand_button.d.ts +2 -0
  77. package/dist/types/index.d.ts +13 -0
  78. package/package.json +2 -2
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/cell.tsx"],
4
+ "sourcesContent": [
5
+ "import React from \"react\";\nimport { CellProps, shallowEqual, useRowProps, useRowRef } from \"@rttui/core\";\nimport { CellText } from \"./cell_text.mjs\";\nimport { CellTextBold } from \"./cell_text_bold.mjs\";\nimport { Checkbox } from \"./checkbox.mjs\";\nimport { ExpandButton } from \"./expand_button.mjs\";\n\nexport const Cell: React.FC<CellProps> = ({\n children,\n checkbox = false,\n expandButton = false,\n pinButtons = false,\n highlightSelected = false,\n}) => {\n const { depth, isSelected } = useRowProps({\n callback: (vrow) => {\n const row = vrow.row;\n return {\n depth: row.depth,\n isSelected: row.getIsSelected(),\n };\n },\n areCallbackOutputEqual: shallowEqual,\n dependencies: [{ type: \"tanstack_table\" }],\n });\n\n const rowRef = useRowRef();\n\n const containerStyle: React.CSSProperties = {\n display: \"flex\",\n alignItems: \"center\",\n gap: \"8px\",\n paddingLeft: `${depth * 20}px`,\n };\n\n const useBold = highlightSelected && isSelected;\n\n return (\n <div style={containerStyle}>\n {checkbox && (\n <Checkbox\n getProps={() => {\n const row = rowRef()?.row;\n if (!row) return {};\n return {\n checked: row.getIsSelected(),\n disabled: !row.getCanSelect(),\n indeterminate: row.getIsSomeSelected(),\n };\n }}\n onChange={() => {\n // Return the actual handler function\n return (event: React.ChangeEvent<HTMLInputElement>) => {\n rowRef()?.row.toggleSelected(event.target.checked);\n };\n }}\n />\n )}\n {expandButton && <ExpandButton />}\n {pinButtons && (\n <span style={{ fontStyle: \"italic\", fontSize: \"0.8em\" }}>(Pin)</span>\n )}\n {useBold ? (\n <CellTextBold className=\"anocca-selected-cell-text\">\n {children}\n </CellTextBold>\n ) : (\n <CellText>{children}</CellText>\n )}\n </div>\n );\n};\n"
6
+ ],
7
+ "mappings": ";AACA;AACA;AACA;AACA;AACA;AAAA;AAEO,IAAM,OAA4B;AAAA,EACvC;AAAA,EACA,WAAW;AAAA,EACX,eAAe;AAAA,EACf,aAAa;AAAA,EACb,oBAAoB;AAAA,MAChB;AAAA,EACJ,QAAQ,OAAO,eAAe,YAAY;AAAA,IACxC,UAAU,CAAC,SAAS;AAAA,MAClB,MAAM,MAAM,KAAK;AAAA,MACjB,OAAO;AAAA,QACL,OAAO,IAAI;AAAA,QACX,YAAY,IAAI,cAAc;AAAA,MAChC;AAAA;AAAA,IAEF,wBAAwB;AAAA,IACxB,cAAc,CAAC,EAAE,MAAM,iBAAiB,CAAC;AAAA,EAC3C,CAAC;AAAA,EAED,MAAM,SAAS,UAAU;AAAA,EAEzB,MAAM,iBAAsC;AAAA,IAC1C,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,KAAK;AAAA,IACL,aAAa,GAAG,QAAQ;AAAA,EAC1B;AAAA,EAEA,MAAM,UAAU,qBAAqB;AAAA,EAErC,uBACE,KA+BE,OA/BF;AAAA,IAAK,OAAO;AAAA,IAAZ,UA+BE;AAAA,MA9BC,4BACC,IAAC,UAAD;AAAA,QACE,UAAU,MAAM;AAAA,UACd,MAAM,MAAM,OAAO,GAAG;AAAA,UACtB,KAAK;AAAA,YAAK,OAAO,CAAC;AAAA,UAClB,OAAO;AAAA,YACL,SAAS,IAAI,cAAc;AAAA,YAC3B,WAAW,IAAI,aAAa;AAAA,YAC5B,eAAe,IAAI,kBAAkB;AAAA,UACvC;AAAA;AAAA,QAEF,UAAU,MAAM;AAAA,UAEd,OAAO,CAAC,UAA+C;AAAA,YACrD,OAAO,GAAG,IAAI,eAAe,MAAM,OAAO,OAAO;AAAA;AAAA;AAAA,OAGvD;AAAA,MAED,gCAAgB,IAAC,cAAD,EAAc;AAAA,MAC9B,8BACC,IAAgE,QAAhE;AAAA,QAAM,OAAO,EAAE,WAAW,UAAU,UAAU,QAAQ;AAAA,QAAtD;AAAA,OAAgE;AAAA,MAEjE,0BACC,IAEE,cAFF;AAAA,QAAc,WAAU;AAAA,QAAxB;AAAA,OAEE,oBAEF,IAAsB,UAAtB;AAAA;AAAA,OAAsB;AAAA;AAAA,GAExB;AAAA;",
8
+ "debugId": "C16936508E08347F64756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,32 @@
1
+ // packages/skin-anocca/src/cell_avatar.tsx
2
+ import { jsx } from "react/jsx-runtime";
3
+ var sizeMap = {
4
+ sm: 24,
5
+ md: 32,
6
+ lg: 40
7
+ };
8
+ var CellAvatar = ({
9
+ src,
10
+ alt = "",
11
+ size = "md"
12
+ }) => {
13
+ const dimension = sizeMap[size];
14
+ const style = {
15
+ width: `${dimension}px`,
16
+ height: `${dimension}px`,
17
+ borderRadius: "50%",
18
+ objectFit: "cover",
19
+ backgroundColor: "#f9fafb"
20
+ };
21
+ const effectiveAlt = alt || `Avatar image`;
22
+ return /* @__PURE__ */ jsx("img", {
23
+ src,
24
+ alt: effectiveAlt,
25
+ style
26
+ });
27
+ };
28
+ export {
29
+ CellAvatar
30
+ };
31
+
32
+ //# debugId=B79E0743C3FB396164756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/cell_avatar.tsx"],
4
+ "sourcesContent": [
5
+ "import { CellAvatarProps } from \"@rttui/core\";\nimport React from \"react\";\n\n// Define the size mapping for styling\nconst sizeMap = {\n sm: 24, // Corresponds to Tailwind's size-6 (6 * 4px = 24px)\n md: 32, // Corresponds to Tailwind's size-8 (8 * 4px = 32px)\n lg: 40, // Corresponds to Tailwind's size-10 (10 * 4px = 40px)\n};\n\n// Implement the CellAvatar component for the Anocca skin\nexport const CellAvatar: React.FC<CellAvatarProps> = ({\n src,\n alt = \"\",\n size = \"md\",\n}) => {\n const dimension = sizeMap[size];\n\n // Basic styling for the avatar image\n const style: React.CSSProperties = {\n width: `${dimension}px`,\n height: `${dimension}px`,\n borderRadius: \"50%\", // Equivalent to rounded-full\n objectFit: \"cover\", // Ensures the image covers the area nicely\n // Placeholder background - Anocca skin might provide specific colors\n backgroundColor: \"#f9fafb\", // Equivalent to bg-gray-50\n };\n\n // It's generally good practice to provide an alt attribute for accessibility\n const effectiveAlt = alt || `Avatar image`;\n\n return <img src={src} alt={effectiveAlt} style={style} />;\n};\n"
6
+ ],
7
+ "mappings": ";;AAIA,IAAM,UAAU;AAAA,EACd,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAGO,IAAM,aAAwC;AAAA,EACnD;AAAA,EACA,MAAM;AAAA,EACN,OAAO;AAAA,MACH;AAAA,EACJ,MAAM,YAAY,QAAQ;AAAA,EAG1B,MAAM,QAA6B;AAAA,IACjC,OAAO,GAAG;AAAA,IACV,QAAQ,GAAG;AAAA,IACX,cAAc;AAAA,IACd,WAAW;AAAA,IAEX,iBAAiB;AAAA,EACnB;AAAA,EAGA,MAAM,eAAe,OAAO;AAAA,EAE5B,uBAAO,IAAC,OAAD;AAAA,IAAK;AAAA,IAAU,KAAK;AAAA,IAAc;AAAA,GAAc;AAAA;",
8
+ "debugId": "B79E0743C3FB396164756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,50 @@
1
+ // packages/skin-anocca/src/cell_avatar_with_text.tsx
2
+ import { CellAvatar } from "./cell_avatar.mjs";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ var CellAvatarWithText = ({
5
+ src,
6
+ alt,
7
+ size = "md",
8
+ primary,
9
+ secondary,
10
+ fallback
11
+ }) => {
12
+ const containerStyle = {
13
+ display: "flex",
14
+ alignItems: "center",
15
+ gap: "16px"
16
+ };
17
+ const textStyle = {
18
+ fontSize: "0.875rem",
19
+ fontWeight: 500,
20
+ color: "#111827",
21
+ overflow: "hidden",
22
+ textOverflow: "ellipsis",
23
+ whiteSpace: "nowrap"
24
+ };
25
+ const effectiveAlt = alt;
26
+ return /* @__PURE__ */ jsxs("div", {
27
+ style: containerStyle,
28
+ children: [
29
+ /* @__PURE__ */ jsx(CellAvatar, {
30
+ src,
31
+ alt: effectiveAlt,
32
+ size,
33
+ fallback
34
+ }),
35
+ /* @__PURE__ */ jsx("div", {
36
+ style: textStyle,
37
+ children: primary
38
+ }),
39
+ secondary && /* @__PURE__ */ jsx("div", {
40
+ style: textStyle,
41
+ children: secondary
42
+ })
43
+ ]
44
+ });
45
+ };
46
+ export {
47
+ CellAvatarWithText
48
+ };
49
+
50
+ //# debugId=54257BFFC38D1DF264756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/cell_avatar_with_text.tsx"],
4
+ "sourcesContent": [
5
+ "import React from \"react\";\nimport { CellAvatar } from \"./cell_avatar.mjs\"; // Import the existing CellAvatar and its props\nimport { CellAvatarWithTextProps } from \"@rttui/core\";\n\n// Implement the CellAvatarWithText component for the Anocca skin\nexport const CellAvatarWithText: React.FC<CellAvatarWithTextProps> = ({\n src,\n alt,\n size = \"md\", // Default size consistent with CellAvatar\n primary,\n secondary,\n fallback,\n}) => {\n // Basic styles for the container div\n const containerStyle: React.CSSProperties = {\n display: \"flex\",\n alignItems: \"center\",\n gap: \"16px\", // Equivalent to Tailwind's gap-x-4 (4 * 4px = 16px)\n };\n\n // Basic styles for the text div\n const textStyle: React.CSSProperties = {\n fontSize: \"0.875rem\", // Equivalent to text-sm (14px)\n fontWeight: 500, // Equivalent to font-medium\n color: \"#111827\", // Equivalent to text-gray-900 (Placeholder, Anocca might have specific colors)\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\", // Equivalent to truncate\n };\n\n // Generate a meaningful alt text if none provided\n const effectiveAlt = alt;\n\n return (\n <div style={containerStyle}>\n <CellAvatar\n src={src}\n alt={effectiveAlt}\n size={size}\n fallback={fallback}\n />\n <div style={textStyle}>{primary}</div>\n {secondary && <div style={textStyle}>{secondary}</div>}\n </div>\n );\n};\n"
6
+ ],
7
+ "mappings": ";AACA;AAAA;AAIO,IAAM,qBAAwD;AAAA,EACnE;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,MACI;AAAA,EAEJ,MAAM,iBAAsC;AAAA,IAC1C,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,KAAK;AAAA,EACP;AAAA,EAGA,MAAM,YAAiC;AAAA,IACrC,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,OAAO;AAAA,IACP,UAAU;AAAA,IACV,cAAc;AAAA,IACd,YAAY;AAAA,EACd;AAAA,EAGA,MAAM,eAAe;AAAA,EAErB,uBACE,KASE,OATF;AAAA,IAAK,OAAO;AAAA,IAAZ,UASE;AAAA,sBARA,IAAC,YAAD;AAAA,QACE;AAAA,QACA,KAAK;AAAA,QACL;AAAA,QACA;AAAA,OACF;AAAA,sBACA,IAAkC,OAAlC;AAAA,QAAK,OAAO;AAAA,QAAZ,UAAwB;AAAA,OAAU;AAAA,MACjC,6BAAa,IAAoC,OAApC;AAAA,QAAK,OAAO;AAAA,QAAZ,UAAwB;AAAA,OAAY;AAAA;AAAA,GAClD;AAAA;",
8
+ "debugId": "54257BFFC38D1DF264756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,36 @@
1
+ // packages/skin-anocca/src/cell_badge.tsx
2
+ import { jsx } from "react/jsx-runtime";
3
+ var colorStyles = {
4
+ gray: { backgroundColor: "#f3f4f6", color: "#1f2937" },
5
+ red: { backgroundColor: "#fee2e2", color: "#991b1b" },
6
+ yellow: { backgroundColor: "#fef9c3", color: "#854d0e" },
7
+ green: { backgroundColor: "#dcfce7", color: "#166534" },
8
+ blue: { backgroundColor: "#dbeafe", color: "#1e40af" },
9
+ indigo: { backgroundColor: "#e0e7ff", color: "#3730a3" },
10
+ purple: { backgroundColor: "#f3e8ff", color: "#581c87" },
11
+ pink: { backgroundColor: "#fce7f3", color: "#831843" }
12
+ };
13
+ var CellBadge = ({
14
+ children,
15
+ color = "gray"
16
+ }) => {
17
+ const baseStyle = {
18
+ display: "inline-flex",
19
+ alignItems: "center",
20
+ borderRadius: "9999px",
21
+ padding: "0.125rem 0.625rem",
22
+ fontSize: "0.75rem",
23
+ fontWeight: 500,
24
+ whiteSpace: "nowrap"
25
+ };
26
+ const finalStyle = { ...baseStyle, ...colorStyles[color] };
27
+ return /* @__PURE__ */ jsx("span", {
28
+ style: finalStyle,
29
+ children
30
+ });
31
+ };
32
+ export {
33
+ CellBadge
34
+ };
35
+
36
+ //# debugId=5463548CE0BE0A9F64756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/cell_badge.tsx"],
4
+ "sourcesContent": [
5
+ "import React from \"react\";\nimport { CellBadgeProps, BadgeColor } from \"@rttui/core\";\n// Map badge colors to basic CSS style objects (placeholders)\nconst colorStyles: Record<BadgeColor, React.CSSProperties> = {\n gray: { backgroundColor: \"#f3f4f6\", color: \"#1f2937\" }, // bg-gray-100, text-gray-800\n red: { backgroundColor: \"#fee2e2\", color: \"#991b1b\" }, // bg-red-100, text-red-800\n yellow: { backgroundColor: \"#fef9c3\", color: \"#854d0e\" }, // bg-yellow-100, text-yellow-800\n green: { backgroundColor: \"#dcfce7\", color: \"#166534\" }, // bg-green-100, text-green-800\n blue: { backgroundColor: \"#dbeafe\", color: \"#1e40af\" }, // bg-blue-100, text-blue-800\n indigo: { backgroundColor: \"#e0e7ff\", color: \"#3730a3\" }, // bg-indigo-100, text-indigo-800\n purple: { backgroundColor: \"#f3e8ff\", color: \"#581c87\" }, // bg-purple-100, text-purple-800\n pink: { backgroundColor: \"#fce7f3\", color: \"#831843\" }, // bg-pink-100, text-pink-800\n};\n\n// Implement the CellBadge component for the Anocca skin\nexport const CellBadge: React.FC<CellBadgeProps> = ({\n children,\n color = \"gray\", // Default to gray if no color is provided\n}) => {\n // Base styles for the badge\n const baseStyle: React.CSSProperties = {\n display: \"inline-flex\",\n alignItems: \"center\",\n borderRadius: \"9999px\", // Equivalent to rounded-full\n padding: \"0.125rem 0.625rem\", // Equivalent to py-0.5 px-2.5\n fontSize: \"0.75rem\", // Equivalent to text-xs\n fontWeight: 500, // Equivalent to font-medium\n whiteSpace: \"nowrap\", // Prevent wrapping\n };\n\n // Merge base styles with color-specific styles\n const finalStyle = { ...baseStyle, ...colorStyles[color] };\n\n return <span style={finalStyle}>{children}</span>;\n};\n"
6
+ ],
7
+ "mappings": ";;AAGA,IAAM,cAAuD;AAAA,EAC3D,MAAM,EAAE,iBAAiB,WAAW,OAAO,UAAU;AAAA,EACrD,KAAK,EAAE,iBAAiB,WAAW,OAAO,UAAU;AAAA,EACpD,QAAQ,EAAE,iBAAiB,WAAW,OAAO,UAAU;AAAA,EACvD,OAAO,EAAE,iBAAiB,WAAW,OAAO,UAAU;AAAA,EACtD,MAAM,EAAE,iBAAiB,WAAW,OAAO,UAAU;AAAA,EACrD,QAAQ,EAAE,iBAAiB,WAAW,OAAO,UAAU;AAAA,EACvD,QAAQ,EAAE,iBAAiB,WAAW,OAAO,UAAU;AAAA,EACvD,MAAM,EAAE,iBAAiB,WAAW,OAAO,UAAU;AACvD;AAGO,IAAM,YAAsC;AAAA,EACjD;AAAA,EACA,QAAQ;AAAA,MACJ;AAAA,EAEJ,MAAM,YAAiC;AAAA,IACrC,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,SAAS;AAAA,IACT,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,YAAY;AAAA,EACd;AAAA,EAGA,MAAM,aAAa,KAAK,cAAc,YAAY,OAAO;AAAA,EAEzD,uBAAO,IAAqC,QAArC;AAAA,IAAM,OAAO;AAAA,IAAb;AAAA,GAAqC;AAAA;",
8
+ "debugId": "5463548CE0BE0A9F64756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,27 @@
1
+ // packages/skin-anocca/src/cell_currency.tsx
2
+ import { jsx } from "react/jsx-runtime";
3
+ var CellCurrency = ({
4
+ value,
5
+ currency = "USD"
6
+ }) => {
7
+ const formatter = new Intl.NumberFormat("en-US", {
8
+ style: "currency",
9
+ currency,
10
+ minimumFractionDigits: 2,
11
+ maximumFractionDigits: 2
12
+ });
13
+ const style = {
14
+ fontSize: "0.875rem",
15
+ color: "#6b7280",
16
+ fontVariantNumeric: "tabular-nums"
17
+ };
18
+ return /* @__PURE__ */ jsx("span", {
19
+ style,
20
+ children: formatter.format(value)
21
+ });
22
+ };
23
+ export {
24
+ CellCurrency
25
+ };
26
+
27
+ //# debugId=386D35370A08688C64756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/cell_currency.tsx"],
4
+ "sourcesContent": [
5
+ "import { CellCurrencyProps } from \"@rttui/core\";\nimport React from \"react\";\n\n// Implement the CellCurrency component for the Anocca skin\nexport const CellCurrency: React.FC<CellCurrencyProps> = ({\n value,\n currency = \"USD\", // Default to USD if no currency is provided\n}) => {\n // Use Intl.NumberFormat for robust currency formatting\n // The locale ('en-US') can be adjusted if needed, or made dynamic\n const formatter = new Intl.NumberFormat(\"en-US\", {\n style: \"currency\",\n currency: currency,\n minimumFractionDigits: 2, // Standard practice for currency\n maximumFractionDigits: 2,\n });\n\n // Apply styling similar to CellNumber for consistency\n const style: React.CSSProperties = {\n fontSize: \"0.875rem\", // Equivalent to text-sm\n color: \"#6b7280\", // Equivalent to text-gray-500 (Placeholder)\n fontVariantNumeric: \"tabular-nums\", // Align numbers\n // Anocca skin might specify different colors, alignment, etc.\n };\n\n return <span style={style}>{formatter.format(value)}</span>;\n}; "
6
+ ],
7
+ "mappings": ";;AAIO,IAAM,eAA4C;AAAA,EACvD;AAAA,EACA,WAAW;AAAA,MACP;AAAA,EAGJ,MAAM,YAAY,IAAI,KAAK,aAAa,SAAS;AAAA,IAC/C,OAAO;AAAA,IACP;AAAA,IACA,uBAAuB;AAAA,IACvB,uBAAuB;AAAA,EACzB,CAAC;AAAA,EAGD,MAAM,QAA6B;AAAA,IACjC,UAAU;AAAA,IACV,OAAO;AAAA,IACP,oBAAoB;AAAA,EAEtB;AAAA,EAEA,uBAAO,IAA+C,QAA/C;AAAA,IAAM;AAAA,IAAN,UAAqB,UAAU,OAAO,KAAK;AAAA,GAAI;AAAA;",
8
+ "debugId": "386D35370A08688C64756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,48 @@
1
+ // packages/skin-anocca/src/cell_link.tsx
2
+ import { jsxs } from "react/jsx-runtime";
3
+ var CellLink = ({
4
+ href,
5
+ children,
6
+ srText,
7
+ style,
8
+ ...props
9
+ }) => {
10
+ const baseStyle = {
11
+ fontSize: "0.875rem",
12
+ fontWeight: 500,
13
+ color: "#4f46e5",
14
+ textDecoration: "none",
15
+ cursor: "pointer"
16
+ };
17
+ const srOnlyStyle = {
18
+ position: "absolute",
19
+ width: "1px",
20
+ height: "1px",
21
+ padding: 0,
22
+ margin: "-1px",
23
+ overflow: "hidden",
24
+ clip: "rect(0, 0, 0, 0)",
25
+ whiteSpace: "nowrap",
26
+ borderWidth: 0
27
+ };
28
+ return /* @__PURE__ */ jsxs("a", {
29
+ href,
30
+ style: { ...baseStyle, ...style },
31
+ ...props,
32
+ children: [
33
+ children,
34
+ srText && /* @__PURE__ */ jsxs("span", {
35
+ style: srOnlyStyle,
36
+ children: [
37
+ ", ",
38
+ srText
39
+ ]
40
+ })
41
+ ]
42
+ });
43
+ };
44
+ export {
45
+ CellLink
46
+ };
47
+
48
+ //# debugId=AABA539C7C35BAFB64756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/cell_link.tsx"],
4
+ "sourcesContent": [
5
+ "import React from \"react\";\n\n// Define the props for CellLink, extending standard Anchor attributes\ninterface CellLinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {\n href: string; // The URL the link points to (required)\n children: React.ReactNode; // The visible content of the link (required)\n srText?: string; // Additional text for screen readers\n}\n\n// Implement the CellLink component for the Anocca skin\nexport const CellLink: React.FC<CellLinkProps> = ({\n href,\n children,\n srText,\n style, // Allow consuming style prop\n ...props // Pass through other anchor attributes (target, rel, etc.)\n}) => {\n // Basic link styling - Anocca will likely provide specific link styles\n const baseStyle: React.CSSProperties = {\n fontSize: \"0.875rem\", // Equivalent to text-sm\n fontWeight: 500, // Equivalent to font-medium\n color: \"#4f46e5\", // Equivalent to text-indigo-600 (Placeholder)\n textDecoration: \"none\", // Common practice, hover effect can add underline\n cursor: \"pointer\",\n // Add hover effect (though direct inline hover isn't possible)\n // Anocca would likely use CSS classes for this\n };\n\n // Style for screen reader only text\n const srOnlyStyle: React.CSSProperties = {\n position: \"absolute\",\n width: \"1px\",\n height: \"1px\",\n padding: 0,\n margin: \"-1px\",\n overflow: \"hidden\",\n clip: \"rect(0, 0, 0, 0)\",\n whiteSpace: \"nowrap\",\n borderWidth: 0,\n };\n\n return (\n <a href={href} style={{ ...baseStyle, ...style }} {...props}>\n {children}\n {srText && <span style={srOnlyStyle}>, {srText}</span>}\n </a>\n );\n};\n"
6
+ ],
7
+ "mappings": ";;AAUO,IAAM,WAAoC;AAAA,EAC/C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,KACG;AAAA,MACC;AAAA,EAEJ,MAAM,YAAiC;AAAA,IACrC,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,OAAO;AAAA,IACP,gBAAgB;AAAA,IAChB,QAAQ;AAAA,EAGV;AAAA,EAGA,MAAM,cAAmC;AAAA,IACvC,UAAU;AAAA,IACV,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,MAAM;AAAA,IACN,YAAY;AAAA,IACZ,aAAa;AAAA,EACf;AAAA,EAEA,uBACE,KAGE,KAHF;AAAA,IAAG;AAAA,IAAY,OAAO,KAAK,cAAc,MAAM;AAAA,OAAO;AAAA,IAAtD,UAGE;AAAA,MAFC;AAAA,MACA,0BAAU,KAAsC,QAAtC;AAAA,QAAM,OAAO;AAAA,QAAb,UAAsC;AAAA,UAAtC;AAAA,UAA6B;AAAA;AAAA,OAAS;AAAA;AAAA,GACjD;AAAA;",
8
+ "debugId": "AABA539C7C35BAFB64756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,18 @@
1
+ // packages/skin-anocca/src/cell_number.tsx
2
+ import { jsx } from "react/jsx-runtime";
3
+ var CellNumber = ({ children }) => {
4
+ const style = {
5
+ fontSize: "0.875rem",
6
+ color: "#6b7280",
7
+ fontVariantNumeric: "tabular-nums"
8
+ };
9
+ return /* @__PURE__ */ jsx("span", {
10
+ style,
11
+ children
12
+ });
13
+ };
14
+ export {
15
+ CellNumber
16
+ };
17
+
18
+ //# debugId=E95F26CD7D8F090364756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/cell_number.tsx"],
4
+ "sourcesContent": [
5
+ "import React from \"react\";\n\ntype CellNumberProps = {\n children: React.ReactNode;\n};\n\nexport const CellNumber: React.FC<CellNumberProps> = ({ children }) => {\n const style: React.CSSProperties = {\n fontSize: \"0.875rem\",\n color: \"#6b7280\",\n fontVariantNumeric: \"tabular-nums\",\n };\n\n return <span style={style}>{children}</span>;\n};\n"
6
+ ],
7
+ "mappings": ";;AAMO,IAAM,aAAwC,GAAG,eAAe;AAAA,EACrE,MAAM,QAA6B;AAAA,IACjC,UAAU;AAAA,IACV,OAAO;AAAA,IACP,oBAAoB;AAAA,EACtB;AAAA,EAEA,uBAAO,IAAgC,QAAhC;AAAA,IAAM;AAAA,IAAN;AAAA,GAAgC;AAAA;",
8
+ "debugId": "E95F26CD7D8F090364756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,26 @@
1
+ // packages/skin-anocca/src/cell_percent.tsx
2
+ import { jsx } from "react/jsx-runtime";
3
+ var CellPercent = ({
4
+ value,
5
+ fractionDigits = 2
6
+ }) => {
7
+ const formatter = new Intl.NumberFormat("en-US", {
8
+ style: "percent",
9
+ minimumFractionDigits: fractionDigits,
10
+ maximumFractionDigits: fractionDigits
11
+ });
12
+ const defaultStyle = {
13
+ fontSize: "0.875rem",
14
+ color: "rgb(107 114 128)",
15
+ fontVariantNumeric: "tabular-nums"
16
+ };
17
+ return /* @__PURE__ */ jsx("span", {
18
+ style: { ...defaultStyle },
19
+ children: formatter.format(value)
20
+ });
21
+ };
22
+ export {
23
+ CellPercent
24
+ };
25
+
26
+ //# debugId=BBBE443B3E833AB764756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/cell_percent.tsx"],
4
+ "sourcesContent": [
5
+ "import { CellPercentProps } from \"@rttui/core\";\nimport React from \"react\";\n\n/**\n * CellPercent component for the Anocca skin.\n * Formats a number as a percentage.\n */\nexport const CellPercent: React.FC<CellPercentProps> = ({\n value,\n fractionDigits = 2,\n}) => {\n const formatter = new Intl.NumberFormat(\"en-US\", {\n style: \"percent\",\n minimumFractionDigits: fractionDigits,\n maximumFractionDigits: fractionDigits,\n });\n\n const defaultStyle: React.CSSProperties = {\n fontSize: \"0.875rem\", // text-sm\n color: \"rgb(107 114 128)\", // text-gray-500\n fontVariantNumeric: \"tabular-nums\",\n // Anocca doesn't have dark mode built-in like Tailwind,\n // so we only define the light mode color here.\n };\n\n return <span style={{ ...defaultStyle }}>{formatter.format(value)}</span>;\n};\n"
6
+ ],
7
+ "mappings": ";;AAOO,IAAM,cAA0C;AAAA,EACrD;AAAA,EACA,iBAAiB;AAAA,MACb;AAAA,EACJ,MAAM,YAAY,IAAI,KAAK,aAAa,SAAS;AAAA,IAC/C,OAAO;AAAA,IACP,uBAAuB;AAAA,IACvB,uBAAuB;AAAA,EACzB,CAAC;AAAA,EAED,MAAM,eAAoC;AAAA,IACxC,UAAU;AAAA,IACV,OAAO;AAAA,IACP,oBAAoB;AAAA,EAGtB;AAAA,EAEA,uBAAO,IAA6D,QAA7D;AAAA,IAAM,OAAO,KAAK,aAAa;AAAA,IAA/B,UAAmC,UAAU,OAAO,KAAK;AAAA,GAAI;AAAA;",
8
+ "debugId": "BBBE443B3E833AB764756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,23 @@
1
+ // packages/skin-anocca/src/cell_tag.tsx
2
+ import { jsx } from "react/jsx-runtime";
3
+ var CellTag = ({ children }) => {
4
+ const style = {
5
+ display: "inline-block",
6
+ padding: "0.25rem 0.5rem",
7
+ fontSize: "0.75rem",
8
+ fontWeight: 500,
9
+ color: "#4b5563",
10
+ backgroundColor: "#f3f4f6",
11
+ borderRadius: "0.375rem",
12
+ border: "1px solid rgba(209, 213, 219, 0.2)"
13
+ };
14
+ return /* @__PURE__ */ jsx("div", {
15
+ style,
16
+ children
17
+ });
18
+ };
19
+ export {
20
+ CellTag
21
+ };
22
+
23
+ //# debugId=A8ECAA29DE35B92464756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/cell_tag.tsx"],
4
+ "sourcesContent": [
5
+ "import React from \"react\";\n\ntype CellTagProps = {\n children: React.ReactNode;\n};\n\nexport const CellTag: React.FC<CellTagProps> = ({ children }) => {\n const style: React.CSSProperties = {\n display: \"inline-block\",\n padding: \"0.25rem 0.5rem\",\n fontSize: \"0.75rem\",\n fontWeight: 500,\n color: \"#4b5563\",\n backgroundColor: \"#f3f4f6\",\n borderRadius: \"0.375rem\",\n border: \"1px solid rgba(209, 213, 219, 0.2)\",\n };\n\n return <div style={style}>{children}</div>;\n};\n"
6
+ ],
7
+ "mappings": ";;AAMO,IAAM,UAAkC,GAAG,eAAe;AAAA,EAC/D,MAAM,QAA6B;AAAA,IACjC,SAAS;AAAA,IACT,SAAS;AAAA,IACT,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,OAAO;AAAA,IACP,iBAAiB;AAAA,IACjB,cAAc;AAAA,IACd,QAAQ;AAAA,EACV;AAAA,EAEA,uBAAO,IAA+B,OAA/B;AAAA,IAAK;AAAA,IAAL;AAAA,GAA+B;AAAA;",
8
+ "debugId": "A8ECAA29DE35B92464756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,17 @@
1
+ // packages/skin-anocca/src/cell_text.tsx
2
+ import { jsx } from "react/jsx-runtime";
3
+ var CellText = ({ children }) => {
4
+ const style = {
5
+ fontSize: "0.875rem",
6
+ color: "#6b7280"
7
+ };
8
+ return /* @__PURE__ */ jsx("span", {
9
+ style,
10
+ children
11
+ });
12
+ };
13
+ export {
14
+ CellText
15
+ };
16
+
17
+ //# debugId=DDAB45001553FC6464756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/cell_text.tsx"],
4
+ "sourcesContent": [
5
+ "import React from \"react\";\n\ntype CellTextProps = {\n children: React.ReactNode;\n};\n\nexport const CellText: React.FC<CellTextProps> = ({ children }) => {\n const style: React.CSSProperties = {\n fontSize: \"0.875rem\",\n color: \"#6b7280\",\n };\n\n return <span style={style}>{children}</span>;\n};\n"
6
+ ],
7
+ "mappings": ";;AAMO,IAAM,WAAoC,GAAG,eAAe;AAAA,EACjE,MAAM,QAA6B;AAAA,IACjC,UAAU;AAAA,IACV,OAAO;AAAA,EACT;AAAA,EAEA,uBAAO,IAAgC,QAAhC;AAAA,IAAM;AAAA,IAAN;AAAA,GAAgC;AAAA;",
8
+ "debugId": "DDAB45001553FC6464756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,21 @@
1
+ // packages/skin-anocca/src/cell_text_bold.tsx
2
+ import { jsx } from "react/jsx-runtime";
3
+ var CellTextBold = ({
4
+ children,
5
+ className
6
+ }) => {
7
+ const style = {
8
+ fontSize: "0.875rem",
9
+ fontWeight: 500
10
+ };
11
+ return /* @__PURE__ */ jsx("span", {
12
+ style,
13
+ className,
14
+ children
15
+ });
16
+ };
17
+ export {
18
+ CellTextBold
19
+ };
20
+
21
+ //# debugId=149357C8F757307864756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/cell_text_bold.tsx"],
4
+ "sourcesContent": [
5
+ "import React from \"react\";\n\ntype CellTextBoldProps = {\n children: React.ReactNode;\n className?: string;\n};\n\nexport const CellTextBold: React.FC<CellTextBoldProps> = ({\n children,\n className,\n}) => {\n const style: React.CSSProperties = {\n fontSize: \"0.875rem\",\n fontWeight: 500,\n };\n\n return (\n <span style={style} className={className}>\n {children}\n </span>\n );\n};\n"
6
+ ],
7
+ "mappings": ";;AAOO,IAAM,eAA4C;AAAA,EACvD;AAAA,EACA;AAAA,MACI;AAAA,EACJ,MAAM,QAA6B;AAAA,IACjC,UAAU;AAAA,IACV,YAAY;AAAA,EACd;AAAA,EAEA,uBACE,IAEE,QAFF;AAAA,IAAM;AAAA,IAAc;AAAA,IAApB;AAAA,GAEE;AAAA;",
8
+ "debugId": "149357C8F757307864756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,50 @@
1
+ // packages/skin-anocca/src/checkbox.tsx
2
+ import { useLayoutEffect, useRef } from "react";
3
+ import { shallowEqual, useTableProps } from "@rttui/core";
4
+ import { jsx } from "react/jsx-runtime";
5
+ var Checkbox = ({ getProps, onChange }) => {
6
+ const resolvedRef = useRef(null);
7
+ const { checked, indeterminate, disabled, value } = useTableProps({
8
+ callback: () => {
9
+ return getProps();
10
+ },
11
+ dependencies: [{ type: "tanstack_table" }],
12
+ areCallbackOutputEqual: shallowEqual,
13
+ shouldUnmount: () => {
14
+ try {
15
+ getProps();
16
+ return false;
17
+ } catch (e) {
18
+ return true;
19
+ }
20
+ }
21
+ });
22
+ useLayoutEffect(() => {
23
+ if (resolvedRef.current) {
24
+ resolvedRef.current.indeterminate = !!indeterminate;
25
+ }
26
+ }, [resolvedRef, indeterminate]);
27
+ const style = {
28
+ width: "16px",
29
+ height: "16px",
30
+ cursor: disabled ? "not-allowed" : "pointer",
31
+ margin: "auto"
32
+ };
33
+ return /* @__PURE__ */ jsx("input", {
34
+ type: "checkbox",
35
+ ref: resolvedRef,
36
+ style,
37
+ checked: !!checked,
38
+ onChange: onChange ? (ev) => {
39
+ onChange()(ev);
40
+ } : undefined,
41
+ disabled,
42
+ value,
43
+ "aria-checked": indeterminate ? "mixed" : checked ? "true" : "false"
44
+ });
45
+ };
46
+ export {
47
+ Checkbox
48
+ };
49
+
50
+ //# debugId=288C9878F1053C1364756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/checkbox.tsx"],
4
+ "sourcesContent": [
5
+ "import React, { useLayoutEffect, useRef } from \"react\";\nimport { CheckboxProps, shallowEqual, useTableProps } from \"@rttui/core\";\n\n// Implement the Checkbox component for the Anocca skin\nexport const Checkbox: React.FC<CheckboxProps> = ({ getProps, onChange }) => {\n const resolvedRef = useRef<HTMLInputElement>(null);\n\n // Use the core hook to get checkbox state based on table context\n const { checked, indeterminate, disabled, value } = useTableProps({\n callback: () => {\n // getProps is expected to return the state { checked, indeterminate, disabled, value }\n // This allows the checkbox to reflect header/row/cell specific selection states\n return getProps();\n },\n dependencies: [{ type: \"tanstack_table\" }], // Re-evaluate when table state changes\n areCallbackOutputEqual: shallowEqual, // Optimize re-renders\n shouldUnmount: () => {\n // Attempt to call getProps to see if the context is still valid\n // If it throws (e.g., row is removed), the component should unmount\n try {\n getProps();\n return false;\n } catch (e) {\n return true;\n }\n },\n });\n\n // Apply indeterminate state imperatively\n useLayoutEffect(() => {\n if (resolvedRef.current) {\n resolvedRef.current.indeterminate = !!indeterminate;\n }\n }, [resolvedRef, indeterminate]);\n\n // Basic styling for the checkbox - Anocca skin might provide custom styling\n const style: React.CSSProperties = {\n width: \"16px\", // Equivalent to size-4\n height: \"16px\",\n cursor: disabled ? \"not-allowed\" : \"pointer\",\n // Add some margin for spacing if needed\n margin: \"auto\", // Center it if used within a flex/grid container\n };\n\n return (\n <input\n type=\"checkbox\"\n ref={resolvedRef}\n style={style}\n checked={!!checked} // Ensure checked is boolean\n onChange={\n onChange\n ? (ev) => {\n // The onChange from props returns the actual handler function\n onChange()(ev);\n }\n : undefined\n }\n disabled={disabled}\n value={value}\n aria-checked={indeterminate ? \"mixed\" : checked ? \"true\" : \"false\"}\n />\n );\n}; "
6
+ ],
7
+ "mappings": ";AAAA;AACA;AAAA;AAGO,IAAM,WAAoC,GAAG,UAAU,eAAe;AAAA,EAC3E,MAAM,cAAc,OAAyB,IAAI;AAAA,EAGjD,QAAQ,SAAS,eAAe,UAAU,UAAU,cAAc;AAAA,IAChE,UAAU,MAAM;AAAA,MAGd,OAAO,SAAS;AAAA;AAAA,IAElB,cAAc,CAAC,EAAE,MAAM,iBAAiB,CAAC;AAAA,IACzC,wBAAwB;AAAA,IACxB,eAAe,MAAM;AAAA,MAGnB,IAAI;AAAA,QACF,SAAS;AAAA,QACT,OAAO;AAAA,QACP,OAAO,GAAG;AAAA,QACV,OAAO;AAAA;AAAA;AAAA,EAGb,CAAC;AAAA,EAGD,gBAAgB,MAAM;AAAA,IACpB,IAAI,YAAY,SAAS;AAAA,MACvB,YAAY,QAAQ,kBAAkB;AAAA,IACxC;AAAA,KACC,CAAC,aAAa,aAAa,CAAC;AAAA,EAG/B,MAAM,QAA6B;AAAA,IACjC,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,QAAQ,WAAW,gBAAgB;AAAA,IAEnC,QAAQ;AAAA,EACV;AAAA,EAEA,uBACE,IAAC,SAAD;AAAA,IACE,MAAK;AAAA,IACL,KAAK;AAAA,IACL;AAAA,IACA,WAAW;AAAA,IACX,UACE,WACI,CAAC,OAAO;AAAA,MAEN,SAAS,EAAE,EAAE;AAAA,QAEf;AAAA,IAEN;AAAA,IACA;AAAA,IACA,gBAAc,gBAAgB,UAAU,UAAU,SAAS;AAAA,GAC7D;AAAA;",
8
+ "debugId": "288C9878F1053C1364756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,54 @@
1
+ // packages/skin-anocca/src/expand_button.tsx
2
+ import { useRowProps, useRowRef, shallowEqual } from "@rttui/core";
3
+ import { FiChevronDown, FiChevronRight } from "react-icons/fi";
4
+ import { jsx } from "react/jsx-runtime";
5
+ var ExpandButton = () => {
6
+ const { canExpand, isExpanded } = useRowProps({
7
+ callback: (vrow) => {
8
+ const row = vrow.row;
9
+ return {
10
+ canExpand: row.getCanExpand(),
11
+ isExpanded: row.getIsExpanded()
12
+ };
13
+ },
14
+ areCallbackOutputEqual: shallowEqual,
15
+ dependencies: [{ type: "tanstack_table" }]
16
+ });
17
+ const rowRef = useRowRef();
18
+ if (!canExpand) {
19
+ return null;
20
+ }
21
+ const buttonStyle = {
22
+ display: "flex",
23
+ alignItems: "center",
24
+ justifyContent: "center",
25
+ width: "24px",
26
+ height: "24px",
27
+ border: "none",
28
+ background: "transparent",
29
+ cursor: "pointer",
30
+ borderRadius: "50%"
31
+ };
32
+ const iconStyle = {
33
+ width: "16px",
34
+ height: "16px",
35
+ color: "#4b5563"
36
+ };
37
+ const IconComponent = isExpanded ? FiChevronDown : FiChevronRight;
38
+ return /* @__PURE__ */ jsx("button", {
39
+ onClick: (e) => {
40
+ e.stopPropagation();
41
+ rowRef()?.row.toggleExpanded();
42
+ },
43
+ style: buttonStyle,
44
+ "aria-label": isExpanded ? "Collapse row" : "Expand row",
45
+ children: /* @__PURE__ */ jsx(IconComponent, {
46
+ style: iconStyle
47
+ })
48
+ });
49
+ };
50
+ export {
51
+ ExpandButton
52
+ };
53
+
54
+ //# debugId=946A5F8E5AE1817D64756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/expand_button.tsx"],
4
+ "sourcesContent": [
5
+ "import React from \"react\";\nimport { useRowProps, useRowRef, shallowEqual } from \"@rttui/core\";\nimport { FiChevronDown, FiChevronRight } from \"react-icons/fi\"; // Using react-icons as per guidelines\n\n// No specific props needed for ExpandButton itself as it uses context hooks\n\n// Implement the ExpandButton component for the Anocca skin\nexport const ExpandButton: React.FC = () => {\n // Use core hooks to get row expansion state\n const { canExpand, isExpanded } = useRowProps({\n callback: (vrow) => {\n const row = vrow.row;\n return {\n canExpand: row.getCanExpand(),\n isExpanded: row.getIsExpanded(),\n };\n },\n areCallbackOutputEqual: shallowEqual,\n dependencies: [{ type: \"tanstack_table\" }], // Dependency on table state changes\n });\n\n const rowRef = useRowRef(); // Get a ref to the row API\n\n // If the row cannot be expanded, render nothing\n if (!canExpand) {\n return null;\n }\n\n // Basic button styling - Anocca skin will likely provide more specific styles\n const buttonStyle: React.CSSProperties = {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: \"24px\", // Equivalent to w-6\n height: \"24px\", // Equivalent to h-6\n border: \"none\",\n background: \"transparent\",\n cursor: \"pointer\",\n borderRadius: \"50%\", // Equivalent to rounded-full\n // Placeholder hover effect - Anocca might use different colors or effects\n // ':hover': { backgroundColor: '#f3f4f6' }\n // Hover pseudo-class cannot be applied via inline styles directly\n };\n\n // Basic icon styling - Anocca might have specific icon colors/sizes\n const iconStyle: React.CSSProperties = {\n width: \"16px\", // Equivalent to w-4\n height: \"16px\", // Equivalent to h-4\n color: \"#4b5563\", // Placeholder color (text-gray-600)\n };\n\n const IconComponent = isExpanded ? FiChevronDown : FiChevronRight;\n\n return (\n <button\n onClick={(e) => {\n e.stopPropagation(); // Prevent row click event if needed\n rowRef()?.row.toggleExpanded();\n }}\n style={buttonStyle}\n aria-label={isExpanded ? \"Collapse row\" : \"Expand row\"}\n >\n <IconComponent style={iconStyle} />\n </button>\n );\n}; "
6
+ ],
7
+ "mappings": ";AACA;AACA;AAAA;AAKO,IAAM,eAAyB,MAAM;AAAA,EAE1C,QAAQ,WAAW,eAAe,YAAY;AAAA,IAC5C,UAAU,CAAC,SAAS;AAAA,MAClB,MAAM,MAAM,KAAK;AAAA,MACjB,OAAO;AAAA,QACL,WAAW,IAAI,aAAa;AAAA,QAC5B,YAAY,IAAI,cAAc;AAAA,MAChC;AAAA;AAAA,IAEF,wBAAwB;AAAA,IACxB,cAAc,CAAC,EAAE,MAAM,iBAAiB,CAAC;AAAA,EAC3C,CAAC;AAAA,EAED,MAAM,SAAS,UAAU;AAAA,EAGzB,KAAK,WAAW;AAAA,IACd,OAAO;AAAA,EACT;AAAA,EAGA,MAAM,cAAmC;AAAA,IACvC,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,cAAc;AAAA,EAIhB;AAAA,EAGA,MAAM,YAAiC;AAAA,IACrC,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,OAAO;AAAA,EACT;AAAA,EAEA,MAAM,gBAAgB,aAAa,gBAAgB;AAAA,EAEnD,uBACE,IASE,UATF;AAAA,IACE,SAAS,CAAC,MAAM;AAAA,MACd,EAAE,gBAAgB;AAAA,MAClB,OAAO,GAAG,IAAI,eAAe;AAAA;AAAA,IAE/B,OAAO;AAAA,IACP,cAAY,aAAa,iBAAiB;AAAA,IAN5C,0BAQE,IAAC,eAAD;AAAA,MAAe,OAAO;AAAA,KAAW;AAAA,GACjC;AAAA;",
8
+ "debugId": "946A5F8E5AE1817D64756E2164756E21",
9
+ "names": []
10
+ }
@@ -4,12 +4,38 @@ import { TableHeaderRow } from "./table_header_row.mjs";
4
4
  import { HeaderPinButtons } from "./header_pin_buttons.mjs";
5
5
  import { RowPinButtons } from "./row_pin_buttons.mjs";
6
6
  import { Resizer } from "./resizer.mjs";
7
+ import { CellAvatar } from "./cell_avatar.mjs";
8
+ import { CellAvatarWithText } from "./cell_avatar_with_text.mjs";
9
+ import { CellNumber } from "./cell_number.mjs";
10
+ import { CellTag } from "./cell_tag.mjs";
11
+ import { CellText } from "./cell_text.mjs";
12
+ import { ExpandButton } from "./expand_button.mjs";
13
+ import { Checkbox } from "./checkbox.mjs";
14
+ import { CellTextBold } from "./cell_text_bold.mjs";
15
+ import { CellCurrency } from "./cell_currency.mjs";
16
+ import { CellBadge } from "./cell_badge.mjs";
17
+ import { Cell } from "./cell.mjs";
18
+ import { CellLink } from "./cell_link.mjs";
19
+ import { CellPercent } from "./cell_percent.mjs";
7
20
  export {
8
21
  TableHeaderRow,
9
22
  RowPinButtons,
10
23
  Resizer,
11
24
  HeaderPinButtons,
25
+ ExpandButton,
26
+ Checkbox,
27
+ CellTextBold,
28
+ CellText,
29
+ CellTag,
30
+ CellPercent,
31
+ CellNumber,
32
+ CellLink,
33
+ CellCurrency,
34
+ CellBadge,
35
+ CellAvatarWithText,
36
+ CellAvatar,
37
+ Cell,
12
38
  AnoccaSkin
13
39
  };
14
40
 
15
- //# debugId=A2F2CCD887D32E2E64756E2164756E21
41
+ //# debugId=9A5B3FA97F18B91964756E2164756E21