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.
- package/dist/index.cjs +12 -12
- package/dist/index.d.ts +7 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2839 -2538
- package/dist/src/components/TkxAppBar.d.ts +12 -0
- package/dist/src/components/TkxAppBar.d.ts.map +1 -0
- package/dist/src/components/TkxAutocomplete.d.ts +25 -0
- package/dist/src/components/TkxAutocomplete.d.ts.map +1 -0
- package/dist/src/components/TkxBottomNav.d.ts +15 -0
- package/dist/src/components/TkxBottomNav.d.ts.map +1 -0
- package/dist/src/components/TkxBreadcrumb.d.ts +17 -0
- package/dist/src/components/TkxBreadcrumb.d.ts.map +1 -0
- package/dist/src/components/TkxCard.d.ts.map +1 -1
- package/dist/src/components/TkxConfigProvider.d.ts +100 -0
- package/dist/src/components/TkxConfigProvider.d.ts.map +1 -0
- package/dist/src/components/TkxDataGrid.d.ts +33 -0
- package/dist/src/components/TkxDataGrid.d.ts.map +1 -0
- package/dist/src/components/TkxEmpty.d.ts +870 -0
- package/dist/src/components/TkxEmpty.d.ts.map +1 -0
- package/dist/src/components/TkxForm.d.ts +54 -0
- package/dist/src/components/TkxForm.d.ts.map +1 -0
- package/dist/src/components/TkxLayout.d.ts +87 -0
- package/dist/src/components/TkxLayout.d.ts.map +1 -0
- package/dist/src/components/TkxMasonry.d.ts +12 -0
- package/dist/src/components/TkxMasonry.d.ts.map +1 -0
- package/dist/src/components/TkxModal.d.ts.map +1 -1
- package/dist/src/components/TkxPopover.d.ts +15 -0
- package/dist/src/components/TkxPopover.d.ts.map +1 -0
- package/dist/src/components/TkxRichTextDisplay.d.ts +19 -0
- package/dist/src/components/TkxRichTextDisplay.d.ts.map +1 -0
- package/dist/src/components/TkxSelect.d.ts.map +1 -1
- package/dist/src/components/TkxSlider.d.ts.map +1 -1
- package/dist/src/components/TkxSnackbar.d.ts +16 -0
- package/dist/src/components/TkxSnackbar.d.ts.map +1 -0
- package/dist/src/components/TkxSpeedDial.d.ts +18 -0
- package/dist/src/components/TkxSpeedDial.d.ts.map +1 -0
- package/dist/src/components/TkxSpin.d.ts +15 -0
- package/dist/src/components/TkxSpin.d.ts.map +1 -0
- package/dist/src/components/TkxStatistic.d.ts +1746 -0
- package/dist/src/components/TkxStatistic.d.ts.map +1 -0
- package/dist/src/components/TkxToolbar.d.ts +22 -0
- package/dist/src/components/TkxToolbar.d.ts.map +1 -0
- package/dist/src/components/TkxTooltip.d.ts.map +1 -1
- package/dist/src/components/TkxTransferList.d.ts +20 -0
- package/dist/src/components/TkxTransferList.d.ts.map +1 -0
- package/dist/src/components/TkxTreeView.d.ts +23 -0
- package/dist/src/components/TkxTreeView.d.ts.map +1 -0
- package/dist/src/components/TkxTypography.d.ts +2614 -0
- package/dist/src/components/TkxTypography.d.ts.map +1 -0
- package/dist/src/components/index.d.ts +20 -0
- package/dist/src/components/index.d.ts.map +1 -1
- package/dist/src/i18n/I18nProvider.d.ts +10 -0
- package/dist/src/i18n/I18nProvider.d.ts.map +1 -0
- package/dist/src/i18n/index.d.ts +50 -0
- package/dist/src/i18n/index.d.ts.map +1 -0
- package/dist/src/themes/index.d.ts +108 -0
- package/dist/src/themes/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/components/TkxAppBar.tsx +260 -0
- package/src/components/TkxAutocomplete.tsx +453 -0
- package/src/components/TkxBottomNav.tsx +239 -0
- package/src/components/TkxBreadcrumb.tsx +322 -0
- package/src/components/TkxCard.tsx +3 -1
- package/src/components/TkxConfigProvider.tsx +458 -0
- package/src/components/TkxDataGrid.tsx +540 -0
- package/src/components/TkxEmpty.tsx +219 -0
- package/src/components/TkxForm.tsx +607 -0
- package/src/components/TkxLayout.tsx +647 -0
- package/src/components/TkxMasonry.tsx +176 -0
- package/src/components/TkxModal.tsx +4 -3
- package/src/components/TkxPopover.tsx +295 -0
- package/src/components/TkxRichTextDisplay.tsx +394 -0
- package/src/components/TkxSelect.tsx +2 -0
- package/src/components/TkxSlider.tsx +1 -0
- package/src/components/TkxSnackbar.tsx +314 -0
- package/src/components/TkxSpeedDial.tsx +395 -0
- package/src/components/TkxSpin.tsx +261 -0
- package/src/components/TkxStatistic.tsx +261 -0
- package/src/components/TkxToolbar.tsx +260 -0
- package/src/components/TkxTooltip.tsx +3 -2
- package/src/components/TkxTransferList.tsx +487 -0
- package/src/components/TkxTreeView.tsx +421 -0
- package/src/components/TkxTypography.tsx +263 -0
- package/src/components/index.ts +20 -0
- package/src/hooks/index.ts +1 -1
- package/src/i18n/I18nProvider.tsx +36 -0
- package/src/i18n/index.ts +237 -0
- package/src/themes/index.ts +149 -0
- package/dist/tests/TkxButton.test.d.ts +0 -2
- package/dist/tests/TkxButton.test.d.ts.map +0 -1
- package/dist/tests/a11y/components.test.d.ts +0 -2
- package/dist/tests/a11y/components.test.d.ts.map +0 -1
- package/dist/tests/quantum.test.d.ts +0 -2
- package/dist/tests/quantum.test.d.ts.map +0 -1
- package/dist/tests/security.test.d.ts +0 -2
- package/dist/tests/security.test.d.ts.map +0 -1
- package/dist/tests/setup.d.ts +0 -2
- package/dist/tests/setup.d.ts.map +0 -1
- package/dist/tests/tkx.test.d.ts +0 -2
- package/dist/tests/tkx.test.d.ts.map +0 -1
- package/dist/tests/wcag.test.d.ts +0 -2
- package/dist/tests/wcag.test.d.ts.map +0 -1
package/src/hooks/index.ts
CHANGED
|
@@ -91,7 +91,7 @@ export function useEscapeKey(handler: () => void, active = true): void {
|
|
|
91
91
|
handlerRef.current = handler;
|
|
92
92
|
|
|
93
93
|
useEffect(() => {
|
|
94
|
-
if (!active) return;
|
|
94
|
+
if (!active || typeof document === 'undefined') return;
|
|
95
95
|
const listener = (e: KeyboardEvent) => {
|
|
96
96
|
if (e.key === 'Escape') handlerRef.current();
|
|
97
97
|
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { useMemo, type ReactNode } from 'react';
|
|
2
|
+
import { I18nContext, LOCALES, isRTL, enUS, type LocaleCode, type LocaleStrings, type Direction } from './index';
|
|
3
|
+
|
|
4
|
+
export interface I18nProviderProps {
|
|
5
|
+
locale?: LocaleCode;
|
|
6
|
+
direction?: Direction;
|
|
7
|
+
strings?: Partial<LocaleStrings>;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function I18nProvider({
|
|
12
|
+
locale = 'en-US',
|
|
13
|
+
direction,
|
|
14
|
+
strings: overrides,
|
|
15
|
+
children,
|
|
16
|
+
}: I18nProviderProps) {
|
|
17
|
+
const value = useMemo(() => {
|
|
18
|
+
const base = LOCALES[locale] ?? enUS;
|
|
19
|
+
const merged = overrides ? { ...base, ...overrides } : base;
|
|
20
|
+
const dir = direction ?? (isRTL(locale) ? 'rtl' : 'ltr');
|
|
21
|
+
|
|
22
|
+
return {
|
|
23
|
+
locale,
|
|
24
|
+
direction: dir,
|
|
25
|
+
strings: merged,
|
|
26
|
+
};
|
|
27
|
+
}, [locale, direction, overrides]);
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<I18nContext.Provider value={value}>
|
|
31
|
+
<div dir={value.direction} style={{ direction: value.direction }}>
|
|
32
|
+
{children}
|
|
33
|
+
</div>
|
|
34
|
+
</I18nContext.Provider>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
2
|
+
|
|
3
|
+
// ── Direction ───────────────────────────────────────────────────────────────
|
|
4
|
+
|
|
5
|
+
export type Direction = 'ltr' | 'rtl';
|
|
6
|
+
|
|
7
|
+
// ── Locale strings ──────────────────────────────────────────────────────────
|
|
8
|
+
|
|
9
|
+
export interface LocaleStrings {
|
|
10
|
+
// Common
|
|
11
|
+
close: string;
|
|
12
|
+
cancel: string;
|
|
13
|
+
confirm: string;
|
|
14
|
+
save: string;
|
|
15
|
+
delete: string;
|
|
16
|
+
search: string;
|
|
17
|
+
loading: string;
|
|
18
|
+
noResults: string;
|
|
19
|
+
required: string;
|
|
20
|
+
|
|
21
|
+
// Pagination
|
|
22
|
+
previous: string;
|
|
23
|
+
next: string;
|
|
24
|
+
pageOf: (page: number, total: number) => string;
|
|
25
|
+
|
|
26
|
+
// Select
|
|
27
|
+
selectPlaceholder: string;
|
|
28
|
+
clearSelection: string;
|
|
29
|
+
|
|
30
|
+
// DatePicker
|
|
31
|
+
selectDate: string;
|
|
32
|
+
today: string;
|
|
33
|
+
|
|
34
|
+
// FileUpload
|
|
35
|
+
dropFiles: string;
|
|
36
|
+
browse: string;
|
|
37
|
+
|
|
38
|
+
// Table
|
|
39
|
+
noData: string;
|
|
40
|
+
sortAscending: string;
|
|
41
|
+
sortDescending: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// ── Default English locale ──────────────────────────────────────────────────
|
|
45
|
+
|
|
46
|
+
export const enUS: LocaleStrings = {
|
|
47
|
+
close: 'Close',
|
|
48
|
+
cancel: 'Cancel',
|
|
49
|
+
confirm: 'Confirm',
|
|
50
|
+
save: 'Save',
|
|
51
|
+
delete: 'Delete',
|
|
52
|
+
search: 'Search',
|
|
53
|
+
loading: 'Loading...',
|
|
54
|
+
noResults: 'No results found',
|
|
55
|
+
required: 'Required',
|
|
56
|
+
previous: 'Previous',
|
|
57
|
+
next: 'Next',
|
|
58
|
+
pageOf: (page, total) => `Page ${page} of ${total}`,
|
|
59
|
+
selectPlaceholder: 'Select...',
|
|
60
|
+
clearSelection: 'Clear selection',
|
|
61
|
+
selectDate: 'Select a date',
|
|
62
|
+
today: 'Today',
|
|
63
|
+
dropFiles: 'Drop files here or',
|
|
64
|
+
browse: 'Browse',
|
|
65
|
+
noData: 'No data available',
|
|
66
|
+
sortAscending: 'Sort ascending',
|
|
67
|
+
sortDescending: 'Sort descending',
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
// ── Additional locales ──────────────────────────────────────────────────────
|
|
71
|
+
|
|
72
|
+
export const esES: LocaleStrings = {
|
|
73
|
+
close: 'Cerrar',
|
|
74
|
+
cancel: 'Cancelar',
|
|
75
|
+
confirm: 'Confirmar',
|
|
76
|
+
save: 'Guardar',
|
|
77
|
+
delete: 'Eliminar',
|
|
78
|
+
search: 'Buscar',
|
|
79
|
+
loading: 'Cargando...',
|
|
80
|
+
noResults: 'No se encontraron resultados',
|
|
81
|
+
required: 'Requerido',
|
|
82
|
+
previous: 'Anterior',
|
|
83
|
+
next: 'Siguiente',
|
|
84
|
+
pageOf: (page, total) => `Página ${page} de ${total}`,
|
|
85
|
+
selectPlaceholder: 'Seleccionar...',
|
|
86
|
+
clearSelection: 'Limpiar selección',
|
|
87
|
+
selectDate: 'Seleccionar fecha',
|
|
88
|
+
today: 'Hoy',
|
|
89
|
+
dropFiles: 'Suelte archivos aquí o',
|
|
90
|
+
browse: 'Explorar',
|
|
91
|
+
noData: 'No hay datos disponibles',
|
|
92
|
+
sortAscending: 'Orden ascendente',
|
|
93
|
+
sortDescending: 'Orden descendente',
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export const arSA: LocaleStrings = {
|
|
97
|
+
close: 'إغلاق',
|
|
98
|
+
cancel: 'إلغاء',
|
|
99
|
+
confirm: 'تأكيد',
|
|
100
|
+
save: 'حفظ',
|
|
101
|
+
delete: 'حذف',
|
|
102
|
+
search: 'بحث',
|
|
103
|
+
loading: '...جارٍ التحميل',
|
|
104
|
+
noResults: 'لم يتم العثور على نتائج',
|
|
105
|
+
required: 'مطلوب',
|
|
106
|
+
previous: 'السابق',
|
|
107
|
+
next: 'التالي',
|
|
108
|
+
pageOf: (page, total) => `صفحة ${page} من ${total}`,
|
|
109
|
+
selectPlaceholder: '...اختر',
|
|
110
|
+
clearSelection: 'مسح الاختيار',
|
|
111
|
+
selectDate: 'اختر تاريخ',
|
|
112
|
+
today: 'اليوم',
|
|
113
|
+
dropFiles: 'أفلت الملفات هنا أو',
|
|
114
|
+
browse: 'تصفح',
|
|
115
|
+
noData: 'لا توجد بيانات',
|
|
116
|
+
sortAscending: 'ترتيب تصاعدي',
|
|
117
|
+
sortDescending: 'ترتيب تنازلي',
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
export const frFR: LocaleStrings = {
|
|
121
|
+
close: 'Fermer',
|
|
122
|
+
cancel: 'Annuler',
|
|
123
|
+
confirm: 'Confirmer',
|
|
124
|
+
save: 'Enregistrer',
|
|
125
|
+
delete: 'Supprimer',
|
|
126
|
+
search: 'Rechercher',
|
|
127
|
+
loading: 'Chargement...',
|
|
128
|
+
noResults: 'Aucun résultat trouvé',
|
|
129
|
+
required: 'Obligatoire',
|
|
130
|
+
previous: 'Précédent',
|
|
131
|
+
next: 'Suivant',
|
|
132
|
+
pageOf: (page, total) => `Page ${page} sur ${total}`,
|
|
133
|
+
selectPlaceholder: 'Sélectionner...',
|
|
134
|
+
clearSelection: 'Effacer la sélection',
|
|
135
|
+
selectDate: 'Sélectionner une date',
|
|
136
|
+
today: "Aujourd'hui",
|
|
137
|
+
dropFiles: 'Déposez les fichiers ici ou',
|
|
138
|
+
browse: 'Parcourir',
|
|
139
|
+
noData: 'Aucune donnée disponible',
|
|
140
|
+
sortAscending: 'Tri croissant',
|
|
141
|
+
sortDescending: 'Tri décroissant',
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
export const deDE: LocaleStrings = {
|
|
145
|
+
close: 'Schließen',
|
|
146
|
+
cancel: 'Abbrechen',
|
|
147
|
+
confirm: 'Bestätigen',
|
|
148
|
+
save: 'Speichern',
|
|
149
|
+
delete: 'Löschen',
|
|
150
|
+
search: 'Suchen',
|
|
151
|
+
loading: 'Wird geladen...',
|
|
152
|
+
noResults: 'Keine Ergebnisse gefunden',
|
|
153
|
+
required: 'Erforderlich',
|
|
154
|
+
previous: 'Zurück',
|
|
155
|
+
next: 'Weiter',
|
|
156
|
+
pageOf: (page, total) => `Seite ${page} von ${total}`,
|
|
157
|
+
selectPlaceholder: 'Auswählen...',
|
|
158
|
+
clearSelection: 'Auswahl löschen',
|
|
159
|
+
selectDate: 'Datum auswählen',
|
|
160
|
+
today: 'Heute',
|
|
161
|
+
dropFiles: 'Dateien hier ablegen oder',
|
|
162
|
+
browse: 'Durchsuchen',
|
|
163
|
+
noData: 'Keine Daten verfügbar',
|
|
164
|
+
sortAscending: 'Aufsteigend sortieren',
|
|
165
|
+
sortDescending: 'Absteigend sortieren',
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
export const jaJP: LocaleStrings = {
|
|
169
|
+
close: '閉じる',
|
|
170
|
+
cancel: 'キャンセル',
|
|
171
|
+
confirm: '確認',
|
|
172
|
+
save: '保存',
|
|
173
|
+
delete: '削除',
|
|
174
|
+
search: '検索',
|
|
175
|
+
loading: '読み込み中...',
|
|
176
|
+
noResults: '結果が見つかりません',
|
|
177
|
+
required: '必須',
|
|
178
|
+
previous: '前へ',
|
|
179
|
+
next: '次へ',
|
|
180
|
+
pageOf: (page, total) => `${total}ページ中${page}ページ`,
|
|
181
|
+
selectPlaceholder: '選択...',
|
|
182
|
+
clearSelection: '選択解除',
|
|
183
|
+
selectDate: '日付を選択',
|
|
184
|
+
today: '今日',
|
|
185
|
+
dropFiles: 'ファイルをドロップまたは',
|
|
186
|
+
browse: '参照',
|
|
187
|
+
noData: 'データなし',
|
|
188
|
+
sortAscending: '昇順',
|
|
189
|
+
sortDescending: '降順',
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
// ── Locale map ──────────────────────────────────────────────────────────────
|
|
193
|
+
|
|
194
|
+
export const LOCALES = {
|
|
195
|
+
'en-US': enUS,
|
|
196
|
+
'es-ES': esES,
|
|
197
|
+
'ar-SA': arSA,
|
|
198
|
+
'fr-FR': frFR,
|
|
199
|
+
'de-DE': deDE,
|
|
200
|
+
'ja-JP': jaJP,
|
|
201
|
+
} as const;
|
|
202
|
+
|
|
203
|
+
export type LocaleCode = keyof typeof LOCALES;
|
|
204
|
+
|
|
205
|
+
// ── RTL languages ───────────────────────────────────────────────────────────
|
|
206
|
+
|
|
207
|
+
const RTL_LOCALES = new Set<string>(['ar-SA', 'he-IL', 'fa-IR', 'ur-PK']);
|
|
208
|
+
|
|
209
|
+
export function isRTL(locale: string): boolean {
|
|
210
|
+
return RTL_LOCALES.has(locale);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// ── Context ─────────────────────────────────────────────────────────────────
|
|
214
|
+
|
|
215
|
+
export interface I18nContextValue {
|
|
216
|
+
locale: LocaleCode;
|
|
217
|
+
direction: Direction;
|
|
218
|
+
strings: LocaleStrings;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
export const I18nContext = createContext<I18nContextValue>({
|
|
222
|
+
locale: 'en-US',
|
|
223
|
+
direction: 'ltr',
|
|
224
|
+
strings: enUS,
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
export function useI18n(): I18nContextValue {
|
|
228
|
+
return useContext(I18nContext);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export function useLocale(): LocaleStrings {
|
|
232
|
+
return useContext(I18nContext).strings;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
export function useDirection(): Direction {
|
|
236
|
+
return useContext(I18nContext).direction;
|
|
237
|
+
}
|
package/src/themes/index.ts
CHANGED
|
@@ -109,3 +109,152 @@ export function ThemeProvider({ theme = quantumDark, children }: ThemeProviderPr
|
|
|
109
109
|
export function useTheme(): ThemeTokens {
|
|
110
110
|
return useContext(ThemeContext);
|
|
111
111
|
}
|
|
112
|
+
|
|
113
|
+
// ── Color Palette Generator ─────────────────────────────────────────────────
|
|
114
|
+
// Generates 50-900 shades from a single hex color
|
|
115
|
+
|
|
116
|
+
function hexToHSL(hex: string): [number, number, number] {
|
|
117
|
+
const clean = hex.replace('#', '');
|
|
118
|
+
const r = parseInt(clean.slice(0, 2), 16) / 255;
|
|
119
|
+
const g = parseInt(clean.slice(2, 4), 16) / 255;
|
|
120
|
+
const b = parseInt(clean.slice(4, 6), 16) / 255;
|
|
121
|
+
const max = Math.max(r, g, b), min = Math.min(r, g, b);
|
|
122
|
+
let h = 0, s = 0;
|
|
123
|
+
const l = (max + min) / 2;
|
|
124
|
+
if (max !== min) {
|
|
125
|
+
const d = max - min;
|
|
126
|
+
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
|
|
127
|
+
switch (max) {
|
|
128
|
+
case r: h = ((g - b) / d + (g < b ? 6 : 0)) / 6; break;
|
|
129
|
+
case g: h = ((b - r) / d + 2) / 6; break;
|
|
130
|
+
case b: h = ((r - g) / d + 4) / 6; break;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return [Math.round(h * 360), Math.round(s * 100), Math.round(l * 100)];
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function hslToHex(h: number, s: number, l: number): string {
|
|
137
|
+
s /= 100; l /= 100;
|
|
138
|
+
const a = s * Math.min(l, 1 - l);
|
|
139
|
+
const f = (n: number) => {
|
|
140
|
+
const k = (n + h / 30) % 12;
|
|
141
|
+
const color = l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);
|
|
142
|
+
return Math.round(255 * color).toString(16).padStart(2, '0');
|
|
143
|
+
};
|
|
144
|
+
return `#${f(0)}${f(8)}${f(4)}`;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export interface ColorPalette {
|
|
148
|
+
50: string;
|
|
149
|
+
100: string;
|
|
150
|
+
200: string;
|
|
151
|
+
300: string;
|
|
152
|
+
400: string;
|
|
153
|
+
500: string;
|
|
154
|
+
600: string;
|
|
155
|
+
700: string;
|
|
156
|
+
800: string;
|
|
157
|
+
900: string;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export function generatePalette(hex: string): ColorPalette {
|
|
161
|
+
const [h, s] = hexToHSL(hex);
|
|
162
|
+
return {
|
|
163
|
+
50: hslToHex(h, Math.min(s, 30), 96),
|
|
164
|
+
100: hslToHex(h, Math.min(s, 40), 90),
|
|
165
|
+
200: hslToHex(h, Math.min(s, 50), 80),
|
|
166
|
+
300: hslToHex(h, s, 70),
|
|
167
|
+
400: hslToHex(h, s, 60),
|
|
168
|
+
500: hex,
|
|
169
|
+
600: hslToHex(h, s, 45),
|
|
170
|
+
700: hslToHex(h, s, 35),
|
|
171
|
+
800: hslToHex(h, s, 25),
|
|
172
|
+
900: hslToHex(h, s, 15),
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// ── Typography Scale ────────────────────────────────────────────────────────
|
|
177
|
+
|
|
178
|
+
export const typography = {
|
|
179
|
+
xs: { fontSize: '0.75rem', lineHeight: '1rem' },
|
|
180
|
+
sm: { fontSize: '0.875rem', lineHeight: '1.25rem' },
|
|
181
|
+
base: { fontSize: '1rem', lineHeight: '1.5rem' },
|
|
182
|
+
lg: { fontSize: '1.125rem', lineHeight: '1.75rem' },
|
|
183
|
+
xl: { fontSize: '1.25rem', lineHeight: '1.75rem' },
|
|
184
|
+
'2xl': { fontSize: '1.5rem', lineHeight: '2rem' },
|
|
185
|
+
'3xl': { fontSize: '1.875rem', lineHeight: '2.25rem' },
|
|
186
|
+
'4xl': { fontSize: '2.25rem', lineHeight: '2.5rem' },
|
|
187
|
+
'5xl': { fontSize: '3rem', lineHeight: '1.15' },
|
|
188
|
+
} as const;
|
|
189
|
+
|
|
190
|
+
// ── Spacing Scale ───────────────────────────────────────────────────────────
|
|
191
|
+
|
|
192
|
+
export const spacing = {
|
|
193
|
+
0: '0px',
|
|
194
|
+
0.5: '2px',
|
|
195
|
+
1: '4px',
|
|
196
|
+
1.5: '6px',
|
|
197
|
+
2: '8px',
|
|
198
|
+
2.5: '10px',
|
|
199
|
+
3: '12px',
|
|
200
|
+
4: '16px',
|
|
201
|
+
5: '20px',
|
|
202
|
+
6: '24px',
|
|
203
|
+
8: '32px',
|
|
204
|
+
10: '40px',
|
|
205
|
+
12: '48px',
|
|
206
|
+
16: '64px',
|
|
207
|
+
20: '80px',
|
|
208
|
+
24: '96px',
|
|
209
|
+
} as const;
|
|
210
|
+
|
|
211
|
+
// ── Breakpoints ─────────────────────────────────────────────────────────────
|
|
212
|
+
|
|
213
|
+
export const breakpoints = {
|
|
214
|
+
sm: 640,
|
|
215
|
+
md: 768,
|
|
216
|
+
lg: 1024,
|
|
217
|
+
xl: 1280,
|
|
218
|
+
'2xl': 1536,
|
|
219
|
+
} as const;
|
|
220
|
+
|
|
221
|
+
// ── Shadows ─────────────────────────────────────────────────────────────────
|
|
222
|
+
|
|
223
|
+
export const shadows = {
|
|
224
|
+
none: 'none',
|
|
225
|
+
xs: '0 1px 2px 0 rgba(0,0,0,0.05)',
|
|
226
|
+
sm: '0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1)',
|
|
227
|
+
md: '0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)',
|
|
228
|
+
lg: '0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)',
|
|
229
|
+
xl: '0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)',
|
|
230
|
+
'2xl': '0 25px 50px -12px rgba(0,0,0,0.25)',
|
|
231
|
+
inner: 'inset 0 2px 4px 0 rgba(0,0,0,0.06)',
|
|
232
|
+
} as const;
|
|
233
|
+
|
|
234
|
+
// ── Z-Index Scale ───────────────────────────────────────────────────────────
|
|
235
|
+
|
|
236
|
+
export const zIndex = {
|
|
237
|
+
hide: -1,
|
|
238
|
+
base: 0,
|
|
239
|
+
dropdown: 1000,
|
|
240
|
+
sticky: 1100,
|
|
241
|
+
fixed: 1200,
|
|
242
|
+
overlay: 1300,
|
|
243
|
+
modal: 1400,
|
|
244
|
+
popover: 1500,
|
|
245
|
+
tooltip: 1600,
|
|
246
|
+
toast: 1700,
|
|
247
|
+
max: 9999,
|
|
248
|
+
} as const;
|
|
249
|
+
|
|
250
|
+
// ── Radius ──────────────────────────────────────────────────────────────────
|
|
251
|
+
|
|
252
|
+
export const radii = {
|
|
253
|
+
none: '0',
|
|
254
|
+
sm: '4px',
|
|
255
|
+
md: '6px',
|
|
256
|
+
lg: '8px',
|
|
257
|
+
xl: '12px',
|
|
258
|
+
'2xl': '16px',
|
|
259
|
+
full: '9999px',
|
|
260
|
+
} as const;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TkxButton.test.d.ts","sourceRoot":"","sources":["../../tests/TkxButton.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"components.test.d.ts","sourceRoot":"","sources":["../../../tests/a11y/components.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"quantum.test.d.ts","sourceRoot":"","sources":["../../tests/quantum.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"security.test.d.ts","sourceRoot":"","sources":["../../tests/security.test.ts"],"names":[],"mappings":""}
|
package/dist/tests/setup.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../tests/setup.ts"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAC"}
|
package/dist/tests/tkx.test.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tkx.test.d.ts","sourceRoot":"","sources":["../../tests/tkx.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"wcag.test.d.ts","sourceRoot":"","sources":["../../tests/wcag.test.ts"],"names":[],"mappings":""}
|