@x-plat/design-system 0.1.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 (165) hide show
  1. package/README.md +123 -0
  2. package/dist/attributes-DJIWir_0.d.cts +7 -0
  3. package/dist/attributes-DJIWir_0.d.ts +7 -0
  4. package/dist/breakpoints-DsXkJgdl.d.cts +35 -0
  5. package/dist/breakpoints-DsXkJgdl.d.ts +35 -0
  6. package/dist/colors-BG91q_uV.d.cts +133 -0
  7. package/dist/colors-BG91q_uV.d.ts +133 -0
  8. package/dist/components/Button/index.cjs +203 -0
  9. package/dist/components/Button/index.css +1231 -0
  10. package/dist/components/Button/index.d.cts +132 -0
  11. package/dist/components/Button/index.d.ts +132 -0
  12. package/dist/components/Button/index.js +176 -0
  13. package/dist/components/Card/index.cjs +56 -0
  14. package/dist/components/Card/index.css +27 -0
  15. package/dist/components/Card/index.d.cts +13 -0
  16. package/dist/components/Card/index.d.ts +13 -0
  17. package/dist/components/Card/index.js +29 -0
  18. package/dist/components/Chart/index.cjs +393 -0
  19. package/dist/components/Chart/index.css +4 -0
  20. package/dist/components/Chart/index.d.cts +10 -0
  21. package/dist/components/Chart/index.d.ts +10 -0
  22. package/dist/components/Chart/index.js +367 -0
  23. package/dist/components/CheckBox/index.cjs +1116 -0
  24. package/dist/components/CheckBox/index.css +598 -0
  25. package/dist/components/CheckBox/index.d.cts +132 -0
  26. package/dist/components/CheckBox/index.d.ts +132 -0
  27. package/dist/components/CheckBox/index.js +1089 -0
  28. package/dist/components/Chip/index.cjs +193 -0
  29. package/dist/components/Chip/index.css +1227 -0
  30. package/dist/components/Chip/index.d.cts +132 -0
  31. package/dist/components/Chip/index.d.ts +132 -0
  32. package/dist/components/Chip/index.js +166 -0
  33. package/dist/components/DatePicker/index.cjs +1653 -0
  34. package/dist/components/DatePicker/index.css +1417 -0
  35. package/dist/components/DatePicker/index.d.cts +56 -0
  36. package/dist/components/DatePicker/index.d.ts +56 -0
  37. package/dist/components/DatePicker/index.js +1613 -0
  38. package/dist/components/HtmlTypeWriter/index.cjs +172 -0
  39. package/dist/components/HtmlTypeWriter/index.css +23 -0
  40. package/dist/components/HtmlTypeWriter/index.d.cts +14 -0
  41. package/dist/components/HtmlTypeWriter/index.d.ts +14 -0
  42. package/dist/components/HtmlTypeWriter/index.js +135 -0
  43. package/dist/components/ImageSelector/index.cjs +1063 -0
  44. package/dist/components/ImageSelector/index.css +85 -0
  45. package/dist/components/ImageSelector/index.d.cts +10 -0
  46. package/dist/components/ImageSelector/index.d.ts +10 -0
  47. package/dist/components/ImageSelector/index.js +1026 -0
  48. package/dist/components/Input/index.cjs +410 -0
  49. package/dist/components/Input/index.css +74 -0
  50. package/dist/components/Input/index.d.cts +23 -0
  51. package/dist/components/Input/index.d.ts +23 -0
  52. package/dist/components/Input/index.js +372 -0
  53. package/dist/components/Modal/index.cjs +101 -0
  54. package/dist/components/Modal/index.css +39 -0
  55. package/dist/components/Modal/index.d.cts +16 -0
  56. package/dist/components/Modal/index.d.ts +16 -0
  57. package/dist/components/Modal/index.js +64 -0
  58. package/dist/components/PopOver/index.cjs +176 -0
  59. package/dist/components/PopOver/index.css +27 -0
  60. package/dist/components/PopOver/index.d.cts +15 -0
  61. package/dist/components/PopOver/index.d.ts +15 -0
  62. package/dist/components/PopOver/index.js +139 -0
  63. package/dist/components/Radio/index.cjs +257 -0
  64. package/dist/components/Radio/index.css +777 -0
  65. package/dist/components/Radio/index.d.cts +154 -0
  66. package/dist/components/Radio/index.d.ts +154 -0
  67. package/dist/components/Radio/index.js +219 -0
  68. package/dist/components/Select/index.cjs +1203 -0
  69. package/dist/components/Select/index.css +136 -0
  70. package/dist/components/Select/index.d.cts +44 -0
  71. package/dist/components/Select/index.d.ts +44 -0
  72. package/dist/components/Select/index.js +1165 -0
  73. package/dist/components/Swiper/index.cjs +144 -0
  74. package/dist/components/Swiper/index.d.cts +24 -0
  75. package/dist/components/Swiper/index.d.ts +24 -0
  76. package/dist/components/Swiper/index.js +128 -0
  77. package/dist/components/Switch/index.cjs +240 -0
  78. package/dist/components/Switch/index.css +780 -0
  79. package/dist/components/Switch/index.d.cts +131 -0
  80. package/dist/components/Switch/index.d.ts +131 -0
  81. package/dist/components/Switch/index.js +203 -0
  82. package/dist/components/Tab/index.cjs +122 -0
  83. package/dist/components/Tab/index.css +59 -0
  84. package/dist/components/Tab/index.d.cts +18 -0
  85. package/dist/components/Tab/index.d.ts +18 -0
  86. package/dist/components/Tab/index.js +85 -0
  87. package/dist/components/Table/index.cjs +384 -0
  88. package/dist/components/Table/index.css +4093 -0
  89. package/dist/components/Table/index.d.cts +174 -0
  90. package/dist/components/Table/index.d.ts +174 -0
  91. package/dist/components/Table/index.js +343 -0
  92. package/dist/components/TextArea/index.cjs +114 -0
  93. package/dist/components/TextArea/index.css +34 -0
  94. package/dist/components/TextArea/index.d.cts +6 -0
  95. package/dist/components/TextArea/index.d.ts +6 -0
  96. package/dist/components/TextArea/index.js +77 -0
  97. package/dist/components/Tooltip/index.cjs +210 -0
  98. package/dist/components/Tooltip/index.css +599 -0
  99. package/dist/components/Tooltip/index.d.cts +134 -0
  100. package/dist/components/Tooltip/index.d.ts +134 -0
  101. package/dist/components/Tooltip/index.js +173 -0
  102. package/dist/components/Video/index.cjs +269 -0
  103. package/dist/components/Video/index.css +71 -0
  104. package/dist/components/Video/index.d.cts +15 -0
  105. package/dist/components/Video/index.d.ts +15 -0
  106. package/dist/components/Video/index.js +232 -0
  107. package/dist/components/index.cjs +3221 -0
  108. package/dist/components/index.css +9972 -0
  109. package/dist/components/index.d.cts +23 -0
  110. package/dist/components/index.d.ts +23 -0
  111. package/dist/components/index.js +3167 -0
  112. package/dist/index.cjs +8216 -0
  113. package/dist/index.css +10087 -0
  114. package/dist/index.d.cts +31 -0
  115. package/dist/index.d.ts +31 -0
  116. package/dist/index.js +7855 -0
  117. package/dist/layout/Grid/FullGrid/index.cjs +54 -0
  118. package/dist/layout/Grid/FullGrid/index.css +21 -0
  119. package/dist/layout/Grid/FullGrid/index.d.cts +9 -0
  120. package/dist/layout/Grid/FullGrid/index.d.ts +9 -0
  121. package/dist/layout/Grid/FullGrid/index.js +27 -0
  122. package/dist/layout/Grid/FullScreen/index.cjs +54 -0
  123. package/dist/layout/Grid/FullScreen/index.css +23 -0
  124. package/dist/layout/Grid/FullScreen/index.d.cts +9 -0
  125. package/dist/layout/Grid/FullScreen/index.d.ts +9 -0
  126. package/dist/layout/Grid/FullScreen/index.js +27 -0
  127. package/dist/layout/Grid/GapGrid/index.cjs +32 -0
  128. package/dist/layout/Grid/GapGrid/index.d.cts +12 -0
  129. package/dist/layout/Grid/GapGrid/index.d.ts +12 -0
  130. package/dist/layout/Grid/GapGrid/index.js +11 -0
  131. package/dist/layout/Grid/Item/index.cjs +71 -0
  132. package/dist/layout/Grid/Item/index.css +19 -0
  133. package/dist/layout/Grid/Item/index.d.cts +20 -0
  134. package/dist/layout/Grid/Item/index.d.ts +20 -0
  135. package/dist/layout/Grid/Item/index.js +44 -0
  136. package/dist/layout/Grid/index.cjs +95 -0
  137. package/dist/layout/Grid/index.css +65 -0
  138. package/dist/layout/Grid/index.d.cts +5 -0
  139. package/dist/layout/Grid/index.d.ts +5 -0
  140. package/dist/layout/Grid/index.js +65 -0
  141. package/dist/layout/Header/index.cjs +45 -0
  142. package/dist/layout/Header/index.css +11 -0
  143. package/dist/layout/Header/index.d.cts +10 -0
  144. package/dist/layout/Header/index.d.ts +10 -0
  145. package/dist/layout/Header/index.js +18 -0
  146. package/dist/layout/Layout/index.cjs +44 -0
  147. package/dist/layout/Layout/index.css +23 -0
  148. package/dist/layout/Layout/index.d.cts +15 -0
  149. package/dist/layout/Layout/index.d.ts +15 -0
  150. package/dist/layout/Layout/index.js +17 -0
  151. package/dist/layout/SideBar/index.cjs +101 -0
  152. package/dist/layout/SideBar/index.css +10 -0
  153. package/dist/layout/SideBar/index.d.cts +16 -0
  154. package/dist/layout/SideBar/index.d.ts +16 -0
  155. package/dist/layout/SideBar/index.js +62 -0
  156. package/dist/layout/index.cjs +188 -0
  157. package/dist/layout/index.css +112 -0
  158. package/dist/layout/index.d.cts +8 -0
  159. package/dist/layout/index.d.ts +8 -0
  160. package/dist/layout/index.js +143 -0
  161. package/dist/tokens/index.cjs +6225 -0
  162. package/dist/tokens/index.d.cts +593 -0
  163. package/dist/tokens/index.d.ts +593 -0
  164. package/dist/tokens/index.js +5900 -0
  165. package/package.json +86 -0
@@ -0,0 +1,174 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React from 'react';
3
+ import { C as ColorNamespace, a as ColorName, d as ColorProps } from '../../colors-BG91q_uV.cjs';
4
+
5
+ interface TableProps {
6
+ className?: string;
7
+ children: React.ReactNode;
8
+ rowBorderUse?: boolean;
9
+ colBorderUse?: boolean;
10
+ headerSticky?: boolean;
11
+ stickyShadow?: boolean;
12
+ }
13
+ declare const Table: {
14
+ (props: TableProps): react_jsx_runtime.JSX.Element;
15
+ displayName: string;
16
+ };
17
+
18
+ interface TableBodyProps {
19
+ children: React.ReactNode;
20
+ className?: string;
21
+ }
22
+ declare const TableBody: {
23
+ (props: TableBodyProps): react_jsx_runtime.JSX.Element;
24
+ displayName: string;
25
+ };
26
+
27
+ interface TableCellProps {
28
+ children: React.ReactNode;
29
+ align?: "start" | "center" | "end";
30
+ className?: string;
31
+ isSticky?: boolean;
32
+ onClick?: (e: React.MouseEvent<HTMLTableCellElement>) => void;
33
+ }
34
+ declare const TableCell: React.FC<TableCellProps>;
35
+
36
+ interface TableHeaderProps {
37
+ children: React.ReactNode;
38
+ className?: string;
39
+ cellHover?: boolean;
40
+ }
41
+ declare const TableHead: {
42
+ ({ children, className, cellHover, }: TableHeaderProps): react_jsx_runtime.JSX.Element;
43
+ displayName: string;
44
+ };
45
+
46
+ interface TableRowProps<N extends ColorNamespace, C extends ColorName<N> = ColorName<N>> extends ColorProps<N, C> {
47
+ className?: string;
48
+ children: React.ReactNode;
49
+ type?: "primary" | "secondary";
50
+ isHover?: boolean;
51
+ onClick?: (e: React.MouseEvent<HTMLTableRowElement>) => void;
52
+ }
53
+ declare const TableRow: {
54
+ <N extends ColorNamespace = "xplat", C extends ColorName<N> = keyof {
55
+ readonly xplat: {
56
+ readonly red: {
57
+ readonly 50: "#FFF0F0";
58
+ readonly 100: "#FFDDDE";
59
+ readonly 200: "#FFC1C2";
60
+ readonly 300: "#FF9698";
61
+ readonly 400: "#FF5A5D";
62
+ readonly 500: "#FF272B";
63
+ readonly 600: "#F80409";
64
+ readonly 700: "#D40105";
65
+ readonly 800: "#AE0609";
66
+ readonly 900: "#900C0F";
67
+ };
68
+ readonly green: {
69
+ readonly 50: "#E5F6EA";
70
+ readonly 100: "#C1E7CC";
71
+ readonly 200: "#98D8AC";
72
+ readonly 300: "#6CCA8B";
73
+ readonly 400: "#47BE72";
74
+ readonly 500: "#10B259";
75
+ readonly 600: "#00A34F";
76
+ readonly 700: "#009143";
77
+ readonly 800: "#007F38";
78
+ readonly 900: "#006024";
79
+ };
80
+ readonly orange: {
81
+ readonly 50: "#FFF8EC";
82
+ readonly 100: "#FFF0D3";
83
+ readonly 200: "#FFDDA5";
84
+ readonly 300: "#FFC46D";
85
+ readonly 400: "#FF9F32";
86
+ readonly 500: "#FF820A";
87
+ readonly 600: "#FF6900";
88
+ readonly 700: "#CC4B02";
89
+ readonly 800: "#A13A0B";
90
+ readonly 900: "#82320C";
91
+ };
92
+ readonly yellow: {
93
+ readonly 50: "#FFFDE7";
94
+ readonly 100: "#FFFAC1";
95
+ readonly 200: "#FFF186";
96
+ readonly 300: "#FFE041";
97
+ readonly 400: "#FFCC0D";
98
+ readonly 500: "#F0B100";
99
+ readonly 600: "#D18800";
100
+ readonly 700: "#A66002";
101
+ readonly 800: "#894B0A";
102
+ readonly 900: "#743D0F";
103
+ };
104
+ readonly blue: {
105
+ readonly 50: "#F1F4FD";
106
+ readonly 100: "#DFE7FA";
107
+ readonly 200: "#C5D4F8";
108
+ readonly 300: "#9EB8F2";
109
+ readonly 400: "#7093EA";
110
+ readonly 500: "#4D6DE3";
111
+ readonly 600: "#3950D7";
112
+ readonly 700: "#303EC5";
113
+ readonly 800: "#2D35A0";
114
+ readonly 900: "#29317F";
115
+ };
116
+ readonly lightblue: {
117
+ readonly 50: "#EEFAFF";
118
+ readonly 100: "#D9F4FF";
119
+ readonly 200: "#BBEDFF";
120
+ readonly 300: "#8DE3FF";
121
+ readonly 400: "#57D0FF";
122
+ readonly 500: "#30B6FF";
123
+ readonly 600: "#1999F7";
124
+ readonly 700: "#1280E3";
125
+ readonly 800: "#1566B8";
126
+ readonly 900: "#175791";
127
+ };
128
+ readonly purple: {
129
+ readonly 50: "#FBF6FE";
130
+ readonly 100: "#F5EAFD";
131
+ readonly 200: "#EDD8FC";
132
+ readonly 300: "#E0BAF8";
133
+ readonly 400: "#CD8DF3";
134
+ readonly 500: "#B961EB";
135
+ readonly 600: "#A541DC";
136
+ readonly 700: "#9230C5";
137
+ readonly 800: "#782B9E";
138
+ readonly 900: "#62247F";
139
+ };
140
+ readonly pink: {
141
+ readonly 50: "#FFF4FE";
142
+ readonly 100: "#FFE7FD";
143
+ readonly 200: "#FFCFFA";
144
+ readonly 300: "#FEA9F1";
145
+ readonly 400: "#FD75E7";
146
+ readonly 500: "#F553DA";
147
+ readonly 600: "#D821B6";
148
+ readonly 700: "#B31892";
149
+ readonly 800: "#921676";
150
+ readonly 900: "#781761";
151
+ };
152
+ readonly neutral: {
153
+ readonly 50: "#FAFAFA";
154
+ readonly 100: "#F5F5F5";
155
+ readonly 200: "#E5E5E5";
156
+ readonly 300: "#D4D4D4";
157
+ readonly 400: "#A1A1A1";
158
+ readonly 500: "#737373";
159
+ readonly 600: "#525252";
160
+ readonly 700: "#404040";
161
+ readonly 800: "#262626";
162
+ readonly 900: "#171717";
163
+ };
164
+ readonly black: "#000000";
165
+ readonly white: "#FFFFFF";
166
+ };
167
+ readonly test: {
168
+ readonly default: "#ffffff";
169
+ };
170
+ }[N]>(props: TableRowProps<N, C>): react_jsx_runtime.JSX.Element;
171
+ displayName: string;
172
+ };
173
+
174
+ export { Table, TableBody, TableCell, TableHead, TableRow };
@@ -0,0 +1,174 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React from 'react';
3
+ import { C as ColorNamespace, a as ColorName, d as ColorProps } from '../../colors-BG91q_uV.js';
4
+
5
+ interface TableProps {
6
+ className?: string;
7
+ children: React.ReactNode;
8
+ rowBorderUse?: boolean;
9
+ colBorderUse?: boolean;
10
+ headerSticky?: boolean;
11
+ stickyShadow?: boolean;
12
+ }
13
+ declare const Table: {
14
+ (props: TableProps): react_jsx_runtime.JSX.Element;
15
+ displayName: string;
16
+ };
17
+
18
+ interface TableBodyProps {
19
+ children: React.ReactNode;
20
+ className?: string;
21
+ }
22
+ declare const TableBody: {
23
+ (props: TableBodyProps): react_jsx_runtime.JSX.Element;
24
+ displayName: string;
25
+ };
26
+
27
+ interface TableCellProps {
28
+ children: React.ReactNode;
29
+ align?: "start" | "center" | "end";
30
+ className?: string;
31
+ isSticky?: boolean;
32
+ onClick?: (e: React.MouseEvent<HTMLTableCellElement>) => void;
33
+ }
34
+ declare const TableCell: React.FC<TableCellProps>;
35
+
36
+ interface TableHeaderProps {
37
+ children: React.ReactNode;
38
+ className?: string;
39
+ cellHover?: boolean;
40
+ }
41
+ declare const TableHead: {
42
+ ({ children, className, cellHover, }: TableHeaderProps): react_jsx_runtime.JSX.Element;
43
+ displayName: string;
44
+ };
45
+
46
+ interface TableRowProps<N extends ColorNamespace, C extends ColorName<N> = ColorName<N>> extends ColorProps<N, C> {
47
+ className?: string;
48
+ children: React.ReactNode;
49
+ type?: "primary" | "secondary";
50
+ isHover?: boolean;
51
+ onClick?: (e: React.MouseEvent<HTMLTableRowElement>) => void;
52
+ }
53
+ declare const TableRow: {
54
+ <N extends ColorNamespace = "xplat", C extends ColorName<N> = keyof {
55
+ readonly xplat: {
56
+ readonly red: {
57
+ readonly 50: "#FFF0F0";
58
+ readonly 100: "#FFDDDE";
59
+ readonly 200: "#FFC1C2";
60
+ readonly 300: "#FF9698";
61
+ readonly 400: "#FF5A5D";
62
+ readonly 500: "#FF272B";
63
+ readonly 600: "#F80409";
64
+ readonly 700: "#D40105";
65
+ readonly 800: "#AE0609";
66
+ readonly 900: "#900C0F";
67
+ };
68
+ readonly green: {
69
+ readonly 50: "#E5F6EA";
70
+ readonly 100: "#C1E7CC";
71
+ readonly 200: "#98D8AC";
72
+ readonly 300: "#6CCA8B";
73
+ readonly 400: "#47BE72";
74
+ readonly 500: "#10B259";
75
+ readonly 600: "#00A34F";
76
+ readonly 700: "#009143";
77
+ readonly 800: "#007F38";
78
+ readonly 900: "#006024";
79
+ };
80
+ readonly orange: {
81
+ readonly 50: "#FFF8EC";
82
+ readonly 100: "#FFF0D3";
83
+ readonly 200: "#FFDDA5";
84
+ readonly 300: "#FFC46D";
85
+ readonly 400: "#FF9F32";
86
+ readonly 500: "#FF820A";
87
+ readonly 600: "#FF6900";
88
+ readonly 700: "#CC4B02";
89
+ readonly 800: "#A13A0B";
90
+ readonly 900: "#82320C";
91
+ };
92
+ readonly yellow: {
93
+ readonly 50: "#FFFDE7";
94
+ readonly 100: "#FFFAC1";
95
+ readonly 200: "#FFF186";
96
+ readonly 300: "#FFE041";
97
+ readonly 400: "#FFCC0D";
98
+ readonly 500: "#F0B100";
99
+ readonly 600: "#D18800";
100
+ readonly 700: "#A66002";
101
+ readonly 800: "#894B0A";
102
+ readonly 900: "#743D0F";
103
+ };
104
+ readonly blue: {
105
+ readonly 50: "#F1F4FD";
106
+ readonly 100: "#DFE7FA";
107
+ readonly 200: "#C5D4F8";
108
+ readonly 300: "#9EB8F2";
109
+ readonly 400: "#7093EA";
110
+ readonly 500: "#4D6DE3";
111
+ readonly 600: "#3950D7";
112
+ readonly 700: "#303EC5";
113
+ readonly 800: "#2D35A0";
114
+ readonly 900: "#29317F";
115
+ };
116
+ readonly lightblue: {
117
+ readonly 50: "#EEFAFF";
118
+ readonly 100: "#D9F4FF";
119
+ readonly 200: "#BBEDFF";
120
+ readonly 300: "#8DE3FF";
121
+ readonly 400: "#57D0FF";
122
+ readonly 500: "#30B6FF";
123
+ readonly 600: "#1999F7";
124
+ readonly 700: "#1280E3";
125
+ readonly 800: "#1566B8";
126
+ readonly 900: "#175791";
127
+ };
128
+ readonly purple: {
129
+ readonly 50: "#FBF6FE";
130
+ readonly 100: "#F5EAFD";
131
+ readonly 200: "#EDD8FC";
132
+ readonly 300: "#E0BAF8";
133
+ readonly 400: "#CD8DF3";
134
+ readonly 500: "#B961EB";
135
+ readonly 600: "#A541DC";
136
+ readonly 700: "#9230C5";
137
+ readonly 800: "#782B9E";
138
+ readonly 900: "#62247F";
139
+ };
140
+ readonly pink: {
141
+ readonly 50: "#FFF4FE";
142
+ readonly 100: "#FFE7FD";
143
+ readonly 200: "#FFCFFA";
144
+ readonly 300: "#FEA9F1";
145
+ readonly 400: "#FD75E7";
146
+ readonly 500: "#F553DA";
147
+ readonly 600: "#D821B6";
148
+ readonly 700: "#B31892";
149
+ readonly 800: "#921676";
150
+ readonly 900: "#781761";
151
+ };
152
+ readonly neutral: {
153
+ readonly 50: "#FAFAFA";
154
+ readonly 100: "#F5F5F5";
155
+ readonly 200: "#E5E5E5";
156
+ readonly 300: "#D4D4D4";
157
+ readonly 400: "#A1A1A1";
158
+ readonly 500: "#737373";
159
+ readonly 600: "#525252";
160
+ readonly 700: "#404040";
161
+ readonly 800: "#262626";
162
+ readonly 900: "#171717";
163
+ };
164
+ readonly black: "#000000";
165
+ readonly white: "#FFFFFF";
166
+ };
167
+ readonly test: {
168
+ readonly default: "#ffffff";
169
+ };
170
+ }[N]>(props: TableRowProps<N, C>): react_jsx_runtime.JSX.Element;
171
+ displayName: string;
172
+ };
173
+
174
+ export { Table, TableBody, TableCell, TableHead, TableRow };
@@ -0,0 +1,343 @@
1
+ // node_modules/clsx/dist/clsx.mjs
2
+ function r(e) {
3
+ var t, f, n = "";
4
+ if ("string" == typeof e || "number" == typeof e) n += e;
5
+ else if ("object" == typeof e) if (Array.isArray(e)) {
6
+ var o = e.length;
7
+ for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
8
+ } else for (f in e) e[f] && (n && (n += " "), n += f);
9
+ return n;
10
+ }
11
+ function clsx() {
12
+ for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
13
+ return n;
14
+ }
15
+ var clsx_default = clsx;
16
+
17
+ // src/components/Table/TableContext.tsx
18
+ import React from "react";
19
+ var TableContext = React.createContext(null);
20
+ var useTableContext = () => {
21
+ const ctx = React.useContext(TableContext);
22
+ if (!ctx) throw new Error("Table components must be used inside <Table>");
23
+ return ctx;
24
+ };
25
+ var TableContext_default = TableContext;
26
+
27
+ // src/components/Table/Table.tsx
28
+ import { jsx } from "react/jsx-runtime";
29
+ var Table = (props) => {
30
+ const {
31
+ className,
32
+ children,
33
+ rowBorderUse = true,
34
+ colBorderUse = true,
35
+ headerSticky = false,
36
+ stickyShadow = true
37
+ } = props;
38
+ return /* @__PURE__ */ jsx("div", { className: clsx_default("lib-xplat-table-wrapper", className), children: /* @__PURE__ */ jsx(
39
+ TableContext_default.Provider,
40
+ {
41
+ value: {
42
+ rowBorderUse,
43
+ colBorderUse,
44
+ headerSticky,
45
+ stickyShadow
46
+ },
47
+ children: /* @__PURE__ */ jsx("table", { className: "lib-xplat-table", children })
48
+ }
49
+ ) });
50
+ };
51
+ Table.displayName = "Table";
52
+ var Table_default = Table;
53
+
54
+ // src/components/Table/TableBody.tsx
55
+ import { jsx as jsx2 } from "react/jsx-runtime";
56
+ var TableBody = (props) => {
57
+ const { children, className } = props;
58
+ return /* @__PURE__ */ jsx2("tbody", { className, children });
59
+ };
60
+ TableBody.displayName = "TableBody";
61
+ var TableBody_default = TableBody;
62
+
63
+ // src/components/Table/TableCell.tsx
64
+ import React4 from "react";
65
+
66
+ // src/components/Table/TableHeadContext.tsx
67
+ import React2 from "react";
68
+ var TableHeadContext = React2.createContext(
69
+ null
70
+ );
71
+ var useTableHeadContext = () => {
72
+ const ctx = React2.useContext(TableHeadContext);
73
+ return ctx;
74
+ };
75
+ var TableHeadContext_default = TableHeadContext;
76
+
77
+ // src/components/Table/TableRowContext.tsx
78
+ import React3 from "react";
79
+ var TableRowContext = React3.createContext(null);
80
+ var useTableRowContext = () => {
81
+ const ctx = React3.useContext(TableRowContext);
82
+ if (!ctx) throw new Error("Table components must be used inside <Table>");
83
+ return ctx;
84
+ };
85
+ var TableRowContext_default = TableRowContext;
86
+
87
+ // src/components/Table/TableCell.tsx
88
+ import { jsx as jsx3 } from "react/jsx-runtime";
89
+ var TableCell = (props) => {
90
+ const {
91
+ children,
92
+ align = "center",
93
+ className,
94
+ isSticky = false,
95
+ onClick
96
+ } = props;
97
+ const { registerStickyCell, stickyCells } = useTableRowContext();
98
+ const { stickyShadow } = useTableContext();
99
+ const headContext = useTableHeadContext();
100
+ const [left, setLeft] = React4.useState(0);
101
+ const cellRef = React4.useRef(null);
102
+ const calculateLeft = React4.useCallback(() => {
103
+ if (!cellRef.current) return 0;
104
+ let totalLeft = 0;
105
+ for (const ref of stickyCells) {
106
+ if (ref === cellRef) break;
107
+ if (ref.current) totalLeft += ref.current.offsetWidth;
108
+ }
109
+ return totalLeft;
110
+ }, [stickyCells]);
111
+ React4.useEffect(() => {
112
+ if (!isSticky || !cellRef.current) return;
113
+ registerStickyCell(cellRef);
114
+ setLeft(calculateLeft());
115
+ const observer = new ResizeObserver(() => {
116
+ requestAnimationFrame(() => {
117
+ setLeft(calculateLeft());
118
+ });
119
+ });
120
+ if (cellRef.current) observer.observe(cellRef.current);
121
+ for (const ref of stickyCells) {
122
+ if (ref.current) observer.observe(ref.current);
123
+ }
124
+ return () => observer.disconnect();
125
+ }, [isSticky, registerStickyCell, calculateLeft]);
126
+ const CellTag = cellRef.current?.tagName === "TH" ? "th" : "td";
127
+ const isLastSticky = isSticky && stickyCells[stickyCells.length - 1] === cellRef;
128
+ const enableHover = headContext && headContext.cellHover;
129
+ return /* @__PURE__ */ jsx3(
130
+ CellTag,
131
+ {
132
+ ref: cellRef,
133
+ className: clsx_default(
134
+ `align-${align}`,
135
+ isSticky && "table-sticky",
136
+ isLastSticky && stickyShadow && "right-shadow",
137
+ onClick && "clickable",
138
+ enableHover && "cell-hover",
139
+ className
140
+ ),
141
+ style: isSticky ? { left } : void 0,
142
+ onClick,
143
+ children
144
+ }
145
+ );
146
+ };
147
+ TableCell.displayName = "TableCell";
148
+ var TableCell_default = TableCell;
149
+
150
+ // src/components/Table/TableHead.tsx
151
+ import { jsx as jsx4 } from "react/jsx-runtime";
152
+ var TableHead = ({
153
+ children,
154
+ className = "",
155
+ cellHover = false
156
+ }) => {
157
+ const { headerSticky } = useTableContext();
158
+ return /* @__PURE__ */ jsx4(TableHeadContext_default.Provider, { value: { cellHover }, children: /* @__PURE__ */ jsx4("thead", { className: clsx_default(headerSticky ? "table-sticky" : null, className), children }) });
159
+ };
160
+ TableHead.displayName = "TableHead";
161
+ var TableHead_default = TableHead;
162
+
163
+ // src/components/Table/TableRow.tsx
164
+ import React5 from "react";
165
+
166
+ // src/tokens/colors.ts
167
+ var colors = {
168
+ xplat: {
169
+ red: {
170
+ 50: "#FFF0F0",
171
+ 100: "#FFDDDE",
172
+ 200: "#FFC1C2",
173
+ 300: "#FF9698",
174
+ 400: "#FF5A5D",
175
+ 500: "#FF272B",
176
+ 600: "#F80409",
177
+ 700: "#D40105",
178
+ 800: "#AE0609",
179
+ 900: "#900C0F"
180
+ },
181
+ green: {
182
+ 50: "#E5F6EA",
183
+ 100: "#C1E7CC",
184
+ 200: "#98D8AC",
185
+ 300: "#6CCA8B",
186
+ 400: "#47BE72",
187
+ 500: "#10B259",
188
+ 600: "#00A34F",
189
+ 700: "#009143",
190
+ 800: "#007F38",
191
+ 900: "#006024"
192
+ },
193
+ orange: {
194
+ 50: "#FFF8EC",
195
+ 100: "#FFF0D3",
196
+ 200: "#FFDDA5",
197
+ 300: "#FFC46D",
198
+ 400: "#FF9F32",
199
+ 500: "#FF820A",
200
+ 600: "#FF6900",
201
+ 700: "#CC4B02",
202
+ 800: "#A13A0B",
203
+ 900: "#82320C"
204
+ },
205
+ yellow: {
206
+ 50: "#FFFDE7",
207
+ 100: "#FFFAC1",
208
+ 200: "#FFF186",
209
+ 300: "#FFE041",
210
+ 400: "#FFCC0D",
211
+ 500: "#F0B100",
212
+ 600: "#D18800",
213
+ 700: "#A66002",
214
+ 800: "#894B0A",
215
+ 900: "#743D0F"
216
+ },
217
+ blue: {
218
+ 50: "#F1F4FD",
219
+ 100: "#DFE7FA",
220
+ 200: "#C5D4F8",
221
+ 300: "#9EB8F2",
222
+ 400: "#7093EA",
223
+ 500: "#4D6DE3",
224
+ 600: "#3950D7",
225
+ 700: "#303EC5",
226
+ 800: "#2D35A0",
227
+ 900: "#29317F"
228
+ },
229
+ lightblue: {
230
+ 50: "#EEFAFF",
231
+ 100: "#D9F4FF",
232
+ 200: "#BBEDFF",
233
+ 300: "#8DE3FF",
234
+ 400: "#57D0FF",
235
+ 500: "#30B6FF",
236
+ 600: "#1999F7",
237
+ 700: "#1280E3",
238
+ 800: "#1566B8",
239
+ 900: "#175791"
240
+ },
241
+ purple: {
242
+ 50: "#FBF6FE",
243
+ 100: "#F5EAFD",
244
+ 200: "#EDD8FC",
245
+ 300: "#E0BAF8",
246
+ 400: "#CD8DF3",
247
+ 500: "#B961EB",
248
+ 600: "#A541DC",
249
+ 700: "#9230C5",
250
+ 800: "#782B9E",
251
+ 900: "#62247F"
252
+ },
253
+ pink: {
254
+ 50: "#FFF4FE",
255
+ 100: "#FFE7FD",
256
+ 200: "#FFCFFA",
257
+ 300: "#FEA9F1",
258
+ 400: "#FD75E7",
259
+ 500: "#F553DA",
260
+ 600: "#D821B6",
261
+ 700: "#B31892",
262
+ 800: "#921676",
263
+ 900: "#781761"
264
+ },
265
+ neutral: {
266
+ 50: "#FAFAFA",
267
+ 100: "#F5F5F5",
268
+ 200: "#E5E5E5",
269
+ 300: "#D4D4D4",
270
+ 400: "#A1A1A1",
271
+ 500: "#737373",
272
+ 600: "#525252",
273
+ 700: "#404040",
274
+ 800: "#262626",
275
+ 900: "#171717"
276
+ },
277
+ black: "#000000",
278
+ white: "#FFFFFF"
279
+ },
280
+ test: {
281
+ default: "#ffffff"
282
+ }
283
+ };
284
+
285
+ // src/util/getColor.ts
286
+ var getColorClass = (namespace, palette, shade) => {
287
+ const namespaceMap = colors[namespace];
288
+ const paletteMap = namespaceMap[palette];
289
+ const hasShade = paletteMap && typeof paletteMap === "object" && shade !== void 0 && shade in paletteMap;
290
+ return `${String(namespace)}-${String(palette)}${hasShade ? `-${String(shade)}` : ""}`;
291
+ };
292
+
293
+ // src/components/Table/TableRow.tsx
294
+ import { jsx as jsx5 } from "react/jsx-runtime";
295
+ var TableRow = (props) => {
296
+ const {
297
+ children,
298
+ className,
299
+ colorNamespace = "xplat",
300
+ color = "black",
301
+ colorDepth,
302
+ type = "secondary",
303
+ isHover,
304
+ onClick
305
+ } = props;
306
+ const { rowBorderUse } = useTableContext();
307
+ const [stickyCells, setStickyCells] = React5.useState([]);
308
+ const registerStickyCell = (ref) => {
309
+ setStickyCells((prev) => {
310
+ if (prev.includes(ref)) return prev;
311
+ return [...prev, ref];
312
+ });
313
+ };
314
+ const colorClass = getColorClass(
315
+ colorNamespace,
316
+ color,
317
+ colorDepth ?? 500
318
+ );
319
+ return /* @__PURE__ */ jsx5(TableRowContext_default.Provider, { value: { stickyCells, registerStickyCell }, children: /* @__PURE__ */ jsx5(
320
+ "tr",
321
+ {
322
+ className: clsx_default(
323
+ rowBorderUse ? "table-bottom-border" : null,
324
+ type,
325
+ colorClass,
326
+ isHover && "hover",
327
+ onClick && "clickable",
328
+ className
329
+ ),
330
+ onClick,
331
+ children
332
+ }
333
+ ) });
334
+ };
335
+ TableRow.displayName = "TableRow";
336
+ var TableRow_default = TableRow;
337
+ export {
338
+ Table_default as Table,
339
+ TableBody_default as TableBody,
340
+ TableCell_default as TableCell,
341
+ TableHead_default as TableHead,
342
+ TableRow_default as TableRow
343
+ };