@expcat/tigercat-core 1.5.0 → 2.0.0-preview.2

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 (125) hide show
  1. package/dist/{datepicker-gSOJN_pQ.d.cts → datepicker-ZdzYUqm5.d.ts} +77 -11
  2. package/dist/datepicker-locales/ar-SA.d.ts +1 -1
  3. package/dist/datepicker-locales/de-DE.d.ts +1 -1
  4. package/dist/datepicker-locales/en-US.d.ts +1 -1
  5. package/dist/datepicker-locales/es-ES.d.ts +1 -1
  6. package/dist/datepicker-locales/fr-FR.d.ts +1 -1
  7. package/dist/datepicker-locales/id-ID.d.ts +1 -1
  8. package/dist/datepicker-locales/ja-JP.d.ts +1 -1
  9. package/dist/datepicker-locales/ko-KR.d.ts +1 -1
  10. package/dist/datepicker-locales/pt-BR.d.ts +1 -1
  11. package/dist/datepicker-locales/registry.d.ts +7 -0
  12. package/dist/datepicker-locales/registry.js +224 -0
  13. package/dist/datepicker-locales/th-TH.d.ts +1 -1
  14. package/dist/datepicker-locales/vi-VN.d.ts +1 -1
  15. package/dist/datepicker-locales/zh-CN.d.ts +1 -1
  16. package/dist/datepicker-locales/zh-TW.d.ts +1 -1
  17. package/dist/icons/picker.d.ts +1 -13
  18. package/dist/icons/picker.js +0 -12
  19. package/dist/index.d.ts +11652 -11938
  20. package/dist/index.js +227 -375
  21. package/dist/{locale-hhhI2kH6.d.ts → locale-BH-hERmR.d.ts} +9 -7
  22. package/dist/locales/ar-SA.d.ts +2 -2
  23. package/dist/locales/ar-SA.js +22 -189
  24. package/dist/locales/de-DE.d.ts +2 -2
  25. package/dist/locales/de-DE.js +22 -189
  26. package/dist/locales/en-US.d.ts +2 -2
  27. package/dist/locales/en-US.js +3 -0
  28. package/dist/locales/es-ES.d.ts +2 -2
  29. package/dist/locales/es-ES.js +22 -189
  30. package/dist/locales/fr-FR.d.ts +2 -2
  31. package/dist/locales/fr-FR.js +22 -189
  32. package/dist/locales/id-ID.d.ts +2 -2
  33. package/dist/locales/id-ID.js +22 -189
  34. package/dist/locales/ja-JP.d.ts +2 -2
  35. package/dist/locales/ja-JP.js +22 -189
  36. package/dist/locales/ko-KR.d.ts +2 -2
  37. package/dist/locales/ko-KR.js +22 -189
  38. package/dist/locales/pt-BR.d.ts +2 -2
  39. package/dist/locales/pt-BR.js +22 -189
  40. package/dist/locales/th-TH.d.ts +2 -2
  41. package/dist/locales/th-TH.js +22 -189
  42. package/dist/locales/vi-VN.d.ts +2 -2
  43. package/dist/locales/vi-VN.js +22 -189
  44. package/dist/locales/zh-CN.d.ts +2 -2
  45. package/dist/locales/zh-CN.js +3 -0
  46. package/dist/locales/zh-TW.d.ts +2 -2
  47. package/dist/locales/zh-TW.js +22 -189
  48. package/dist/{table-export-CfdzU6Y5.d.ts → table-export-PkfTtGdp.d.ts} +3 -9
  49. package/dist/utils/table-export.d.ts +3 -3
  50. package/package.json +40 -71
  51. package/tokens/tokens.css +0 -329
  52. package/dist/datepicker-gSOJN_pQ.d.ts +0 -130
  53. package/dist/datepicker-locales/ar-SA.cjs +0 -46
  54. package/dist/datepicker-locales/ar-SA.d.cts +0 -6
  55. package/dist/datepicker-locales/de-DE.cjs +0 -46
  56. package/dist/datepicker-locales/de-DE.d.cts +0 -6
  57. package/dist/datepicker-locales/en-US.cjs +0 -46
  58. package/dist/datepicker-locales/en-US.d.cts +0 -6
  59. package/dist/datepicker-locales/es-ES.cjs +0 -46
  60. package/dist/datepicker-locales/es-ES.d.cts +0 -6
  61. package/dist/datepicker-locales/fr-FR.cjs +0 -46
  62. package/dist/datepicker-locales/fr-FR.d.cts +0 -6
  63. package/dist/datepicker-locales/id-ID.cjs +0 -46
  64. package/dist/datepicker-locales/id-ID.d.cts +0 -6
  65. package/dist/datepicker-locales/ja-JP.cjs +0 -46
  66. package/dist/datepicker-locales/ja-JP.d.cts +0 -6
  67. package/dist/datepicker-locales/ko-KR.cjs +0 -46
  68. package/dist/datepicker-locales/ko-KR.d.cts +0 -6
  69. package/dist/datepicker-locales/pt-BR.cjs +0 -46
  70. package/dist/datepicker-locales/pt-BR.d.cts +0 -6
  71. package/dist/datepicker-locales/th-TH.cjs +0 -46
  72. package/dist/datepicker-locales/th-TH.d.cts +0 -6
  73. package/dist/datepicker-locales/vi-VN.cjs +0 -46
  74. package/dist/datepicker-locales/vi-VN.d.cts +0 -6
  75. package/dist/datepicker-locales/zh-CN.cjs +0 -46
  76. package/dist/datepicker-locales/zh-CN.d.cts +0 -6
  77. package/dist/datepicker-locales/zh-TW.cjs +0 -46
  78. package/dist/datepicker-locales/zh-TW.d.cts +0 -6
  79. package/dist/icons/common.cjs +0 -54
  80. package/dist/icons/common.d.cts +0 -20
  81. package/dist/icons/picker.cjs +0 -75
  82. package/dist/icons/picker.d.cts +0 -53
  83. package/dist/icons/registry.cjs +0 -172
  84. package/dist/icons/registry.d.cts +0 -102
  85. package/dist/icons/status.cjs +0 -47
  86. package/dist/icons/status.d.cts +0 -13
  87. package/dist/icons/table.cjs +0 -48
  88. package/dist/icons/table.d.cts +0 -25
  89. package/dist/index.cjs +0 -22311
  90. package/dist/index.d.cts +0 -20523
  91. package/dist/locale-BTAo7XO1.d.cts +0 -392
  92. package/dist/locales/ar-SA.cjs +0 -548
  93. package/dist/locales/ar-SA.d.cts +0 -10
  94. package/dist/locales/de-DE.cjs +0 -548
  95. package/dist/locales/de-DE.d.cts +0 -10
  96. package/dist/locales/en-US.cjs +0 -246
  97. package/dist/locales/en-US.d.cts +0 -10
  98. package/dist/locales/es-ES.cjs +0 -548
  99. package/dist/locales/es-ES.d.cts +0 -10
  100. package/dist/locales/fr-FR.cjs +0 -548
  101. package/dist/locales/fr-FR.d.cts +0 -10
  102. package/dist/locales/id-ID.cjs +0 -531
  103. package/dist/locales/id-ID.d.cts +0 -10
  104. package/dist/locales/ja-JP.cjs +0 -531
  105. package/dist/locales/ja-JP.d.cts +0 -10
  106. package/dist/locales/ko-KR.cjs +0 -531
  107. package/dist/locales/ko-KR.d.cts +0 -10
  108. package/dist/locales/pt-BR.cjs +0 -548
  109. package/dist/locales/pt-BR.d.cts +0 -10
  110. package/dist/locales/th-TH.cjs +0 -531
  111. package/dist/locales/th-TH.d.cts +0 -10
  112. package/dist/locales/vi-VN.cjs +0 -531
  113. package/dist/locales/vi-VN.d.cts +0 -10
  114. package/dist/locales/zh-CN.cjs +0 -246
  115. package/dist/locales/zh-CN.d.cts +0 -10
  116. package/dist/locales/zh-TW.cjs +0 -531
  117. package/dist/locales/zh-TW.d.cts +0 -10
  118. package/dist/table-export-vfyBzKui.d.cts +0 -882
  119. package/dist/tailwind/modern.cjs +0 -363
  120. package/dist/tailwind/modern.d.cts +0 -5
  121. package/dist/tailwind-entry-CNBAH7iv.d.cts +0 -184
  122. package/dist/tailwind.cjs +0 -274
  123. package/dist/tailwind.d.cts +0 -2
  124. package/dist/utils/table-export.cjs +0 -119
  125. package/dist/utils/table-export.d.cts +0 -3
package/dist/tailwind.cjs DELETED
@@ -1,274 +0,0 @@
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/tailwind-entry.ts
31
- var tailwind_entry_exports = {};
32
- __export(tailwind_entry_exports, {
33
- default: () => tigercatPlugin
34
- });
35
- module.exports = __toCommonJS(tailwind_entry_exports);
36
-
37
- // src/tailwind-plugin.ts
38
- var import_plugin = __toESM(require("tailwindcss/plugin"), 1);
39
-
40
- // src/theme-runtime/index.ts
41
- var THEME_CSS_VARS = {
42
- // Primary colors
43
- primary: "--tiger-primary",
44
- primaryHover: "--tiger-primary-hover",
45
- primaryActive: "--tiger-primary-active",
46
- primaryDisabled: "--tiger-primary-disabled",
47
- // Secondary colors
48
- secondary: "--tiger-secondary",
49
- secondaryHover: "--tiger-secondary-hover",
50
- secondaryActive: "--tiger-secondary-active",
51
- secondaryDisabled: "--tiger-secondary-disabled",
52
- // Background hover states
53
- outlineBgHover: "--tiger-outline-bg-hover",
54
- ghostBgHover: "--tiger-ghost-bg-hover",
55
- // Interaction states
56
- focusRing: "--tiger-focus-ring",
57
- // Surface & background
58
- surface: "--tiger-surface",
59
- surfaceMuted: "--tiger-surface-muted",
60
- surfaceRaised: "--tiger-surface-raised",
61
- // Text
62
- text: "--tiger-text",
63
- textSecondary: "--tiger-text-secondary",
64
- textDisabled: "--tiger-text-disabled",
65
- // Border
66
- border: "--tiger-border",
67
- borderStrong: "--tiger-border-strong",
68
- // Status colors
69
- success: "--tiger-success",
70
- warning: "--tiger-warning",
71
- error: "--tiger-error",
72
- info: "--tiger-info",
73
- // Chart palette
74
- chart1: "--tiger-chart-1",
75
- chart2: "--tiger-chart-2",
76
- chart3: "--tiger-chart-3",
77
- chart4: "--tiger-chart-4",
78
- chart5: "--tiger-chart-5",
79
- chart6: "--tiger-chart-6",
80
- // Breakpoints
81
- breakpointXs: "--tiger-breakpoint-xs",
82
- breakpointSm: "--tiger-breakpoint-sm",
83
- breakpointMd: "--tiger-breakpoint-md",
84
- breakpointLg: "--tiger-breakpoint-lg",
85
- breakpointXl: "--tiger-breakpoint-xl"
86
- };
87
-
88
- // src/themes/modern/tokens.ts
89
- var MODERN_BASE_TOKENS_LIGHT = {
90
- // Radius (matches existing rounded-md/lg/xl)
91
- "--tiger-radius-sm": "0.375rem",
92
- "--tiger-radius-md": "0.5rem",
93
- "--tiger-radius-lg": "0.75rem",
94
- "--tiger-radius-xl": "1rem",
95
- "--tiger-radius-pill": "9999px",
96
- // Shadows (Tailwind defaults)
97
- "--tiger-shadow-sm": "0 1px 2px 0 rgb(0 0 0 / 0.05)",
98
- "--tiger-shadow-md": "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",
99
- "--tiger-shadow-lg": "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",
100
- "--tiger-shadow-xl": "0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)",
101
- // Glass — inset highlights stay disabled by default (kept flat), but a
102
- // sensible backdrop blur is enabled out of the box so opt-in surfaces like
103
- // `Header variant="translucent"/"blur"` render glass without the consumer
104
- // having to set these tokens. Override to `0px` to fully disable blur.
105
- "--tiger-shadow-glass": "0 1px 2px 0 rgb(0 0 0 / 0.05)",
106
- "--tiger-shadow-glass-strong": "0 4px 6px -1px rgb(0 0 0 / 0.1)",
107
- "--tiger-blur-glass": "16px",
108
- "--tiger-blur-glass-strong": "24px",
109
- // Header variant tuning — all overridable without `!important`. `saturate`
110
- // enriches the blurred backdrop; `--tiger-header-shadow` lets consumers
111
- // swap the `blur` variant's shadow; `--tiger-header-border` scopes the
112
- // header's border color (falls back to the global `--tiger-border`) so the
113
- // glass header border can be tuned without touching every other border.
114
- "--tiger-header-saturate": "1.8",
115
- "--tiger-header-shadow": "0 1px 2px 0 rgb(0 0 0 / 0.05)",
116
- "--tiger-header-border": "var(--tiger-border, #e5e7eb)",
117
- // Gradients — fall back to solid color via a no-op linear-gradient
118
- "--tiger-gradient-primary": "linear-gradient(180deg, var(--tiger-primary), var(--tiger-primary))",
119
- "--tiger-gradient-surface": "linear-gradient(180deg, var(--tiger-surface), var(--tiger-surface))",
120
- "--tiger-gradient-danger": "linear-gradient(180deg, var(--tiger-error), var(--tiger-error))",
121
- // Motion — current durations / easings
122
- "--tiger-motion-duration-instant": "80ms",
123
- "--tiger-motion-duration-quick": "150ms",
124
- "--tiger-motion-duration-base": "200ms",
125
- "--tiger-motion-duration-relaxed": "300ms",
126
- "--tiger-motion-duration-slow": "450ms",
127
- "--tiger-motion-ease-standard": "cubic-bezier(0.4, 0, 0.2, 1)",
128
- "--tiger-motion-ease-decelerate": "cubic-bezier(0, 0, 0.2, 1)",
129
- "--tiger-motion-ease-accelerate": "cubic-bezier(0.4, 0, 1, 1)",
130
- "--tiger-motion-ease-emphasized": "cubic-bezier(0.4, 0, 0.2, 1)",
131
- "--tiger-motion-ease-spring": "cubic-bezier(0.4, 0, 0.2, 1)",
132
- "--tiger-transition-base": "all 200ms cubic-bezier(0.4, 0, 0.2, 1)",
133
- "--tiger-transition-quick": "all 150ms cubic-bezier(0.4, 0, 0.2, 1)",
134
- "--tiger-transition-emphasized": "transform 300ms cubic-bezier(0.4, 0, 0.2, 1)"
135
- };
136
- var MODERN_BASE_TOKENS_DARK = {
137
- // Shadows tinted slightly to handle dark backgrounds
138
- "--tiger-shadow-sm": "0 1px 2px 0 rgb(0 0 0 / 0.2)",
139
- "--tiger-shadow-md": "0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.25)",
140
- "--tiger-shadow-lg": "0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.25)",
141
- "--tiger-shadow-xl": "0 20px 25px -5px rgb(0 0 0 / 0.3), 0 8px 10px -6px rgb(0 0 0 / 0.25)",
142
- "--tiger-shadow-glass": "0 1px 2px 0 rgb(0 0 0 / 0.2)",
143
- "--tiger-shadow-glass-strong": "0 4px 6px -1px rgb(0 0 0 / 0.3)",
144
- // Header `blur` variant shadow — slightly deeper for dark surfaces.
145
- "--tiger-header-shadow": "0 1px 2px 0 rgb(0 0 0 / 0.3)",
146
- // Header border tracks the dark-mode global border by default.
147
- "--tiger-header-border": "var(--tiger-border)"
148
- };
149
- var MODERN_REDUCED_MOTION_TOKENS = {
150
- "--tiger-motion-duration-instant": "0ms",
151
- "--tiger-motion-duration-quick": "0ms",
152
- "--tiger-motion-duration-base": "0ms",
153
- "--tiger-motion-duration-relaxed": "0ms",
154
- "--tiger-motion-duration-slow": "0ms",
155
- "--tiger-transition-base": "all 0ms linear",
156
- "--tiger-transition-quick": "all 0ms linear",
157
- "--tiger-transition-emphasized": "transform 0ms linear"
158
- };
159
-
160
- // src/themes/default/theme.ts
161
- var defaultThemeLightColors = {
162
- primary: "#2563eb",
163
- primaryHover: "#1d4ed8",
164
- primaryActive: "#1e40af",
165
- primaryDisabled: "#93c5fd",
166
- secondary: "#4b5563",
167
- secondaryHover: "#374151",
168
- secondaryActive: "#1f2937",
169
- secondaryDisabled: "#9ca3af",
170
- outlineBgHover: "#eff6ff",
171
- ghostBgHover: "#eff6ff",
172
- focusRing: "#2563eb",
173
- surface: "#ffffff",
174
- surfaceMuted: "#f9fafb",
175
- surfaceRaised: "#ffffff",
176
- text: "#111827",
177
- textSecondary: "#6b7280",
178
- textDisabled: "#d1d5db",
179
- border: "#e5e7eb",
180
- borderStrong: "#9ca3af",
181
- success: "#16a34a",
182
- warning: "#d97706",
183
- error: "#dc2626",
184
- info: "#3b82f6",
185
- chart1: "#2563eb",
186
- chart2: "#16a34a",
187
- chart3: "#d97706",
188
- chart4: "#a855f7",
189
- chart5: "#0ea5e9",
190
- chart6: "#ef4444"
191
- };
192
- var defaultThemeDarkColors = {
193
- primary: "#60a5fa",
194
- primaryHover: "#93c5fd",
195
- primaryActive: "#bfdbfe",
196
- primaryDisabled: "#1e40af",
197
- secondary: "#9ca3af",
198
- secondaryHover: "#d1d5db",
199
- secondaryActive: "#e5e7eb",
200
- secondaryDisabled: "#4b5563",
201
- outlineBgHover: "#1e3a5f",
202
- ghostBgHover: "#1e3a5f",
203
- focusRing: "#60a5fa",
204
- surface: "#111827",
205
- surfaceMuted: "#1f2937",
206
- surfaceRaised: "#1f2937",
207
- text: "#f9fafb",
208
- textSecondary: "#d1d5db",
209
- textDisabled: "#4b5563",
210
- border: "#374151",
211
- borderStrong: "#6b7280",
212
- success: "#4ade80",
213
- warning: "#fbbf24",
214
- error: "#f87171",
215
- info: "#60a5fa",
216
- chart1: "#60a5fa",
217
- chart2: "#4ade80",
218
- chart3: "#fbbf24",
219
- chart4: "#c084fc",
220
- chart5: "#38bdf8",
221
- chart6: "#f87171"
222
- };
223
-
224
- // src/tailwind-plugin.ts
225
- function presetToVars(colors) {
226
- const vars = {};
227
- for (const [key, value] of Object.entries(colors)) {
228
- const varName = THEME_CSS_VARS[key];
229
- if (varName && value) {
230
- vars[varName] = value;
231
- }
232
- }
233
- return vars;
234
- }
235
- var tigercatTheme = presetToVars(defaultThemeLightColors);
236
- var tigercatDarkTheme = presetToVars(defaultThemeDarkColors);
237
- var tigercatDirectionBase = {
238
- '[dir="rtl"] .tiger-rtl-mirror, [data-tiger-dir="rtl"] .tiger-rtl-mirror': {
239
- transform: "scaleX(-1)"
240
- },
241
- '[dir="rtl"] .tiger-text-start, [data-tiger-dir="rtl"] .tiger-text-start': {
242
- textAlign: "right"
243
- },
244
- '[dir="rtl"] .tiger-text-end, [data-tiger-dir="rtl"] .tiger-text-end': {
245
- textAlign: "left"
246
- },
247
- '[dir="rtl"] .tiger-flex-row, [data-tiger-dir="rtl"] .tiger-flex-row': {
248
- flexDirection: "row-reverse"
249
- }
250
- };
251
- var tigercatReducedMotionBase = {
252
- "@media (prefers-reduced-motion: reduce)": {
253
- ':root, [data-tiger-style="modern"]': MODERN_REDUCED_MOTION_TOKENS,
254
- ".tiger-motion-aware, .tiger-motion-aware::before, .tiger-motion-aware::after, [data-tiger-motion]": {
255
- animationDuration: "0ms",
256
- animationDelay: "0ms",
257
- transitionDuration: "0ms",
258
- transitionDelay: "0ms",
259
- scrollBehavior: "auto"
260
- }
261
- }
262
- };
263
- var tigercatPlugin = (0, import_plugin.default)(function({ addBase }) {
264
- addBase({
265
- ":root": { ...tigercatTheme, ...MODERN_BASE_TOKENS_LIGHT },
266
- ".dark": { ...tigercatDarkTheme, ...MODERN_BASE_TOKENS_DARK },
267
- // Remove browser default focus outline on interactive SVG elements
268
- 'svg [tabindex], svg [role="button"]': {
269
- outline: "none"
270
- },
271
- ...tigercatDirectionBase,
272
- ...tigercatReducedMotionBase
273
- });
274
- });
@@ -1,2 +0,0 @@
1
- export { l as default } from './tailwind-entry-CNBAH7iv.cjs';
2
- import 'tailwindcss/plugin';
@@ -1,119 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/utils/table-export.ts
21
- var table_export_exports = {};
22
- __export(table_export_exports, {
23
- downloadCsv: () => downloadCsv,
24
- downloadExcel: () => downloadExcel,
25
- downloadTableExport: () => downloadTableExport,
26
- exportTableData: () => exportTableData,
27
- exportTableToCsv: () => exportTableToCsv,
28
- exportTableToExcel: () => exportTableToExcel,
29
- tableExportButtonClasses: () => tableExportButtonClasses
30
- });
31
- module.exports = __toCommonJS(table_export_exports);
32
-
33
- // src/utils/env.ts
34
- function isBrowser() {
35
- return typeof window !== "undefined" && typeof document !== "undefined";
36
- }
37
-
38
- // src/utils/table-export-utils.ts
39
- function escapeCsvValue(value) {
40
- const str = value === null || value === void 0 ? "" : String(value);
41
- if (str.includes(",") || str.includes('"') || str.includes("\n")) {
42
- return `"${str.replace(/"/g, '""')}"`;
43
- }
44
- return str;
45
- }
46
- function exportTableToCsv(columns, data, _filename) {
47
- const headers = columns.map((col) => escapeCsvValue(col.title));
48
- const rows = data.map(
49
- (record) => columns.map((col) => {
50
- const key = col.dataKey || col.key;
51
- const value = record[key];
52
- return escapeCsvValue(value);
53
- }).join(",")
54
- );
55
- return [headers.join(","), ...rows].join("\n");
56
- }
57
- function escapeHtmlValue(value) {
58
- const str = value === null || value === void 0 ? "" : String(value);
59
- return str.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
60
- }
61
- function exportTableToExcel(columns, data) {
62
- const headerCells = columns.map((column) => `<th>${escapeHtmlValue(column.title)}</th>`).join("");
63
- const bodyRows = data.map((record) => {
64
- const cells = columns.map((column) => {
65
- const key = column.dataKey || column.key;
66
- const value = record[key];
67
- return `<td>${escapeHtmlValue(value)}</td>`;
68
- }).join("");
69
- return `<tr>${cells}</tr>`;
70
- }).join("");
71
- return `<!doctype html><html><head><meta charset="utf-8"></head><body><table><thead><tr>${headerCells}</tr></thead><tbody>${bodyRows}</tbody></table></body></html>`;
72
- }
73
- function downloadCsv(csvContent, filename = "export") {
74
- if (!isBrowser()) return;
75
- const blob = new Blob([csvContent], { type: "text/csv;charset=utf-8;" });
76
- const url = URL.createObjectURL(blob);
77
- const link = document.createElement("a");
78
- link.href = url;
79
- link.download = `${filename}.csv`;
80
- link.style.display = "none";
81
- document.body.appendChild(link);
82
- link.click();
83
- document.body.removeChild(link);
84
- URL.revokeObjectURL(url);
85
- }
86
- function downloadExcel(excelContent, filename = "export") {
87
- if (!isBrowser()) return;
88
- const blob = new Blob([excelContent], { type: "application/vnd.ms-excel;charset=utf-8;" });
89
- const url = URL.createObjectURL(blob);
90
- const link = document.createElement("a");
91
- link.href = url;
92
- link.download = `${filename}.xls`;
93
- link.style.display = "none";
94
- document.body.appendChild(link);
95
- link.click();
96
- document.body.removeChild(link);
97
- URL.revokeObjectURL(url);
98
- }
99
- function exportTableData(columns, data, format = "csv") {
100
- return format === "excel" ? exportTableToExcel(columns, data) : exportTableToCsv(columns, data);
101
- }
102
- function downloadTableExport(content, filename = "export", format = "csv") {
103
- if (format === "excel") {
104
- downloadExcel(content, filename);
105
- return;
106
- }
107
- downloadCsv(content, filename);
108
- }
109
- var tableExportButtonClasses = "inline-flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium rounded-[var(--tiger-radius-md,0.5rem)] border border-[var(--tiger-border,#e5e7eb)] text-[var(--tiger-text,#111827)] bg-[var(--tiger-surface,#ffffff)] hover:bg-[var(--tiger-surface-muted,#f9fafb)] transition-colors";
110
- // Annotate the CommonJS export names for ESM import in node:
111
- 0 && (module.exports = {
112
- downloadCsv,
113
- downloadExcel,
114
- downloadTableExport,
115
- exportTableData,
116
- exportTableToCsv,
117
- exportTableToExcel,
118
- tableExportButtonClasses
119
- });
@@ -1,3 +0,0 @@
1
- export { D as downloadCsv, G as downloadExcel, H as downloadTableExport, I as exportTableData, J as exportTableToCsv, K as exportTableToExcel, L as tableExportButtonClasses } from '../table-export-vfyBzKui.cjs';
2
- import '../locale-BTAo7XO1.cjs';
3
- import '../datepicker-gSOJN_pQ.cjs';