tekivex-ui 2.0.2 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/dist/index.cjs +12 -12
  2. package/dist/index.d.ts +7 -2
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +2839 -2538
  5. package/dist/src/components/TkxAppBar.d.ts +12 -0
  6. package/dist/src/components/TkxAppBar.d.ts.map +1 -0
  7. package/dist/src/components/TkxAutocomplete.d.ts +25 -0
  8. package/dist/src/components/TkxAutocomplete.d.ts.map +1 -0
  9. package/dist/src/components/TkxBottomNav.d.ts +15 -0
  10. package/dist/src/components/TkxBottomNav.d.ts.map +1 -0
  11. package/dist/src/components/TkxBreadcrumb.d.ts +17 -0
  12. package/dist/src/components/TkxBreadcrumb.d.ts.map +1 -0
  13. package/dist/src/components/TkxCard.d.ts.map +1 -1
  14. package/dist/src/components/TkxConfigProvider.d.ts +100 -0
  15. package/dist/src/components/TkxConfigProvider.d.ts.map +1 -0
  16. package/dist/src/components/TkxDataGrid.d.ts +33 -0
  17. package/dist/src/components/TkxDataGrid.d.ts.map +1 -0
  18. package/dist/src/components/TkxEmpty.d.ts +870 -0
  19. package/dist/src/components/TkxEmpty.d.ts.map +1 -0
  20. package/dist/src/components/TkxForm.d.ts +54 -0
  21. package/dist/src/components/TkxForm.d.ts.map +1 -0
  22. package/dist/src/components/TkxLayout.d.ts +87 -0
  23. package/dist/src/components/TkxLayout.d.ts.map +1 -0
  24. package/dist/src/components/TkxMasonry.d.ts +12 -0
  25. package/dist/src/components/TkxMasonry.d.ts.map +1 -0
  26. package/dist/src/components/TkxModal.d.ts.map +1 -1
  27. package/dist/src/components/TkxPopover.d.ts +15 -0
  28. package/dist/src/components/TkxPopover.d.ts.map +1 -0
  29. package/dist/src/components/TkxRichTextDisplay.d.ts +19 -0
  30. package/dist/src/components/TkxRichTextDisplay.d.ts.map +1 -0
  31. package/dist/src/components/TkxSelect.d.ts.map +1 -1
  32. package/dist/src/components/TkxSlider.d.ts.map +1 -1
  33. package/dist/src/components/TkxSnackbar.d.ts +16 -0
  34. package/dist/src/components/TkxSnackbar.d.ts.map +1 -0
  35. package/dist/src/components/TkxSpeedDial.d.ts +18 -0
  36. package/dist/src/components/TkxSpeedDial.d.ts.map +1 -0
  37. package/dist/src/components/TkxSpin.d.ts +15 -0
  38. package/dist/src/components/TkxSpin.d.ts.map +1 -0
  39. package/dist/src/components/TkxStatistic.d.ts +1746 -0
  40. package/dist/src/components/TkxStatistic.d.ts.map +1 -0
  41. package/dist/src/components/TkxToolbar.d.ts +22 -0
  42. package/dist/src/components/TkxToolbar.d.ts.map +1 -0
  43. package/dist/src/components/TkxTooltip.d.ts.map +1 -1
  44. package/dist/src/components/TkxTransferList.d.ts +20 -0
  45. package/dist/src/components/TkxTransferList.d.ts.map +1 -0
  46. package/dist/src/components/TkxTreeView.d.ts +23 -0
  47. package/dist/src/components/TkxTreeView.d.ts.map +1 -0
  48. package/dist/src/components/TkxTypography.d.ts +2614 -0
  49. package/dist/src/components/TkxTypography.d.ts.map +1 -0
  50. package/dist/src/components/index.d.ts +20 -0
  51. package/dist/src/components/index.d.ts.map +1 -1
  52. package/dist/src/i18n/I18nProvider.d.ts +10 -0
  53. package/dist/src/i18n/I18nProvider.d.ts.map +1 -0
  54. package/dist/src/i18n/index.d.ts +50 -0
  55. package/dist/src/i18n/index.d.ts.map +1 -0
  56. package/dist/src/themes/index.d.ts +108 -0
  57. package/dist/src/themes/index.d.ts.map +1 -1
  58. package/package.json +2 -2
  59. package/src/components/TkxAppBar.tsx +260 -0
  60. package/src/components/TkxAutocomplete.tsx +453 -0
  61. package/src/components/TkxBottomNav.tsx +239 -0
  62. package/src/components/TkxBreadcrumb.tsx +322 -0
  63. package/src/components/TkxCard.tsx +3 -1
  64. package/src/components/TkxConfigProvider.tsx +458 -0
  65. package/src/components/TkxDataGrid.tsx +540 -0
  66. package/src/components/TkxEmpty.tsx +219 -0
  67. package/src/components/TkxForm.tsx +607 -0
  68. package/src/components/TkxLayout.tsx +647 -0
  69. package/src/components/TkxMasonry.tsx +176 -0
  70. package/src/components/TkxModal.tsx +4 -3
  71. package/src/components/TkxPopover.tsx +295 -0
  72. package/src/components/TkxRichTextDisplay.tsx +394 -0
  73. package/src/components/TkxSelect.tsx +2 -0
  74. package/src/components/TkxSlider.tsx +1 -0
  75. package/src/components/TkxSnackbar.tsx +314 -0
  76. package/src/components/TkxSpeedDial.tsx +395 -0
  77. package/src/components/TkxSpin.tsx +261 -0
  78. package/src/components/TkxStatistic.tsx +261 -0
  79. package/src/components/TkxToolbar.tsx +260 -0
  80. package/src/components/TkxTooltip.tsx +3 -2
  81. package/src/components/TkxTransferList.tsx +487 -0
  82. package/src/components/TkxTreeView.tsx +421 -0
  83. package/src/components/TkxTypography.tsx +263 -0
  84. package/src/components/index.ts +20 -0
  85. package/src/hooks/index.ts +1 -1
  86. package/src/i18n/I18nProvider.tsx +36 -0
  87. package/src/i18n/index.ts +237 -0
  88. package/src/themes/index.ts +149 -0
  89. package/dist/tests/TkxButton.test.d.ts +0 -2
  90. package/dist/tests/TkxButton.test.d.ts.map +0 -1
  91. package/dist/tests/a11y/components.test.d.ts +0 -2
  92. package/dist/tests/a11y/components.test.d.ts.map +0 -1
  93. package/dist/tests/quantum.test.d.ts +0 -2
  94. package/dist/tests/quantum.test.d.ts.map +0 -1
  95. package/dist/tests/security.test.d.ts +0 -2
  96. package/dist/tests/security.test.d.ts.map +0 -1
  97. package/dist/tests/setup.d.ts +0 -2
  98. package/dist/tests/setup.d.ts.map +0 -1
  99. package/dist/tests/tkx.test.d.ts +0 -2
  100. package/dist/tests/tkx.test.d.ts.map +0 -1
  101. package/dist/tests/wcag.test.d.ts +0 -2
  102. package/dist/tests/wcag.test.d.ts.map +0 -1
@@ -0,0 +1,219 @@
1
+ import { type ReactNode, type CSSProperties, createElement } from 'react';
2
+ import { useTheme } from '../themes';
3
+ import { sanitizeString } from '../engine/security';
4
+
5
+ // ── Interface ───────────────────────────────────────────────────────────────
6
+
7
+ export interface TkxEmptyProps {
8
+ image?: ReactNode | 'default' | 'simple';
9
+ description?: ReactNode;
10
+ children?: ReactNode;
11
+ style?: CSSProperties;
12
+ }
13
+
14
+ // ── Default SVG Illustration (empty box) ────────────────────────────────────
15
+
16
+ function DefaultImage({ color, mutedColor }: { color: string; mutedColor: string }) {
17
+ return createElement(
18
+ 'svg',
19
+ {
20
+ width: 120,
21
+ height: 100,
22
+ viewBox: '0 0 120 100',
23
+ fill: 'none',
24
+ 'aria-hidden': 'true',
25
+ },
26
+ // Box base
27
+ createElement('path', {
28
+ d: 'M20 40 L60 20 L100 40 L60 60 Z',
29
+ fill: `${mutedColor}18`,
30
+ stroke: mutedColor,
31
+ strokeWidth: 1.5,
32
+ strokeLinejoin: 'round',
33
+ }),
34
+ // Box left side
35
+ createElement('path', {
36
+ d: 'M20 40 L20 65 L60 85 L60 60 Z',
37
+ fill: `${mutedColor}10`,
38
+ stroke: mutedColor,
39
+ strokeWidth: 1.5,
40
+ strokeLinejoin: 'round',
41
+ }),
42
+ // Box right side
43
+ createElement('path', {
44
+ d: 'M100 40 L100 65 L60 85 L60 60 Z',
45
+ fill: `${mutedColor}0d`,
46
+ stroke: mutedColor,
47
+ strokeWidth: 1.5,
48
+ strokeLinejoin: 'round',
49
+ }),
50
+ // Box opening flap left
51
+ createElement('path', {
52
+ d: 'M20 40 L40 28 L60 40 L40 52 Z',
53
+ fill: `${color}15`,
54
+ stroke: color,
55
+ strokeWidth: 1,
56
+ strokeLinejoin: 'round',
57
+ strokeDasharray: '3 2',
58
+ }),
59
+ // Box opening flap right
60
+ createElement('path', {
61
+ d: 'M60 40 L80 28 L100 40 L80 52 Z',
62
+ fill: `${color}15`,
63
+ stroke: color,
64
+ strokeWidth: 1,
65
+ strokeLinejoin: 'round',
66
+ strokeDasharray: '3 2',
67
+ }),
68
+ );
69
+ }
70
+
71
+ // ── Simple SVG Icon (minimal) ───────────────────────────────────────────────
72
+
73
+ function SimpleImage({ mutedColor }: { mutedColor: string }) {
74
+ return createElement(
75
+ 'svg',
76
+ {
77
+ width: 64,
78
+ height: 64,
79
+ viewBox: '0 0 64 64',
80
+ fill: 'none',
81
+ 'aria-hidden': 'true',
82
+ },
83
+ // Page outline
84
+ createElement('rect', {
85
+ x: 16,
86
+ y: 8,
87
+ width: 32,
88
+ height: 40,
89
+ rx: 3,
90
+ fill: `${mutedColor}12`,
91
+ stroke: mutedColor,
92
+ strokeWidth: 1.5,
93
+ }),
94
+ // Lines on page
95
+ createElement('line', {
96
+ x1: 24,
97
+ y1: 20,
98
+ x2: 40,
99
+ y2: 20,
100
+ stroke: mutedColor,
101
+ strokeWidth: 1.5,
102
+ strokeLinecap: 'round',
103
+ }),
104
+ createElement('line', {
105
+ x1: 24,
106
+ y1: 28,
107
+ x2: 36,
108
+ y2: 28,
109
+ stroke: mutedColor,
110
+ strokeWidth: 1.5,
111
+ strokeLinecap: 'round',
112
+ }),
113
+ createElement('line', {
114
+ x1: 24,
115
+ y1: 36,
116
+ x2: 32,
117
+ y2: 36,
118
+ stroke: mutedColor,
119
+ strokeWidth: 1.5,
120
+ strokeLinecap: 'round',
121
+ }),
122
+ // Circle with dash (empty indicator)
123
+ createElement('circle', {
124
+ cx: 32,
125
+ cy: 54,
126
+ r: 6,
127
+ stroke: mutedColor,
128
+ strokeWidth: 1.2,
129
+ fill: 'none',
130
+ }),
131
+ createElement('line', {
132
+ x1: 28,
133
+ y1: 54,
134
+ x2: 36,
135
+ y2: 54,
136
+ stroke: mutedColor,
137
+ strokeWidth: 1.2,
138
+ strokeLinecap: 'round',
139
+ }),
140
+ );
141
+ }
142
+
143
+ // ── TkxEmpty ────────────────────────────────────────────────────────────────
144
+
145
+ export function TkxEmpty({
146
+ image = 'default',
147
+ description = 'No data',
148
+ children,
149
+ style,
150
+ }: TkxEmptyProps) {
151
+ const theme = useTheme();
152
+
153
+ const safeDescription =
154
+ typeof description === 'string' ? sanitizeString(description) : description;
155
+
156
+ let imageContent: ReactNode;
157
+ if (image === 'default') {
158
+ imageContent = createElement(DefaultImage, {
159
+ color: theme.primary,
160
+ mutedColor: theme.textMuted,
161
+ });
162
+ } else if (image === 'simple') {
163
+ imageContent = createElement(SimpleImage, { mutedColor: theme.textMuted });
164
+ } else {
165
+ imageContent = image;
166
+ }
167
+
168
+ return createElement(
169
+ 'div',
170
+ {
171
+ role: 'status',
172
+ style: {
173
+ display: 'flex',
174
+ flexDirection: 'column' as const,
175
+ alignItems: 'center',
176
+ justifyContent: 'center',
177
+ padding: '32px 16px',
178
+ textAlign: 'center' as const,
179
+ ...style,
180
+ },
181
+ },
182
+ // Image area
183
+ createElement(
184
+ 'div',
185
+ {
186
+ style: {
187
+ marginBottom: '12px',
188
+ opacity: 0.85,
189
+ },
190
+ },
191
+ imageContent,
192
+ ),
193
+ // Description
194
+ safeDescription &&
195
+ createElement(
196
+ 'div',
197
+ {
198
+ style: {
199
+ color: theme.textMuted,
200
+ fontSize: '0.875rem',
201
+ lineHeight: '1.5',
202
+ maxWidth: '320px',
203
+ },
204
+ },
205
+ safeDescription,
206
+ ),
207
+ // Action area (children)
208
+ children &&
209
+ createElement(
210
+ 'div',
211
+ {
212
+ style: {
213
+ marginTop: '16px',
214
+ },
215
+ },
216
+ children,
217
+ ),
218
+ );
219
+ }