@datatechsolutions/tympan 0.3.1 → 0.4.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.
- package/README.md +33 -7
- package/THIRD_PARTY_NOTICES.md +7 -0
- package/dist/{Avatar-P14MVkK1.js → Avatar-CU7B1WsX.js} +61 -1
- package/dist/{Avatar-P14MVkK1.js.map → Avatar-CU7B1WsX.js.map} +1 -1
- package/dist/avatars.js +1 -1
- package/dist/flow.d.ts +1 -1
- package/dist/flow.js +2 -2
- package/dist/{index-6wR5ThnX.d.ts → index-DEdcEFrl.d.ts} +179 -10
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/dist/{src-C9whlpC7.js → src-uCyIE-Te.js} +909 -379
- package/dist/{src-C9whlpC7.js.map → src-uCyIE-Te.js.map} +1 -1
- package/dist/styles.css +482 -7
- package/package.json +2 -2
- package/src/components/calendar/Calendar.css +260 -0
- package/src/components/calendar/Calendar.test.tsx +178 -0
- package/src/components/calendar/Calendar.tsx +341 -0
- package/src/components/date-range-field/DateRangeField.css +140 -0
- package/src/components/date-range-field/DateRangeField.test.tsx +187 -0
- package/src/components/date-range-field/DateRangeField.tsx +231 -0
- package/src/components/locale-picker/LocalePicker.css +5 -7
- package/src/components/tooltip/Tooltip.css +70 -0
- package/src/components/tooltip/Tooltip.test.tsx +209 -0
- package/src/components/tooltip/Tooltip.tsx +102 -0
- package/src/index.ts +3 -0
- package/src/internal/messages/core-es.ts +17 -0
- package/src/internal/messages.ts +51 -0
- package/src/internal/theme.tsx +8 -5
- package/src/styles.css +3 -0
|
@@ -22,6 +22,23 @@ export const coreEs: CoreMessages = {
|
|
|
22
22
|
`${es.n(n)} de ${es.n(max)} ${es.word(max, { one: 'carácter', other: 'caracteres' })}, ${es.n(n - max)} por encima del límite`,
|
|
23
23
|
},
|
|
24
24
|
select: { placeholder: 'Seleccione…', done: 'Listo' },
|
|
25
|
+
calendar: {
|
|
26
|
+
previousMonth: (target) => `Mes anterior, ${target}`,
|
|
27
|
+
nextMonth: (target) => `Mes siguiente, ${target}`,
|
|
28
|
+
monthPicker: 'Mes',
|
|
29
|
+
yearPicker: 'Año',
|
|
30
|
+
},
|
|
31
|
+
dateRangeField: {
|
|
32
|
+
start: 'Fecha inicial',
|
|
33
|
+
end: 'Fecha final',
|
|
34
|
+
presets: 'Períodos rápidos',
|
|
35
|
+
apply: 'Aplicar',
|
|
36
|
+
cancel: 'Cancelar',
|
|
37
|
+
endBeforeStart: 'La fecha final es anterior a la fecha inicial.',
|
|
38
|
+
tooManyDays: (max) => `El período es más largo que ${es.n(max)} ${es.word(max, { one: 'día', other: 'días' })}.`,
|
|
39
|
+
unavailableDay: 'El período incluye un día que no se puede elegir.',
|
|
40
|
+
outOfBounds: 'El período incluye un día fuera de las fechas permitidas.',
|
|
41
|
+
},
|
|
25
42
|
notice: { toneWord: { danger: 'Error:', warning: 'Atención:', info: 'Información:', success: 'Éxito:' } },
|
|
26
43
|
empty: {
|
|
27
44
|
'no-data': { title: 'Todavía no hay nada aquí', description: 'Los elementos aparecen aquí cuando se agregan.' },
|
package/src/internal/messages.ts
CHANGED
|
@@ -44,6 +44,23 @@ export interface Messages
|
|
|
44
44
|
overLimit: (count: number, max: number) => string
|
|
45
45
|
}
|
|
46
46
|
select: { placeholder: string; done: string }
|
|
47
|
+
calendar: {
|
|
48
|
+
previousMonth: (target: string) => string
|
|
49
|
+
nextMonth: (target: string) => string
|
|
50
|
+
monthPicker: string
|
|
51
|
+
yearPicker: string
|
|
52
|
+
}
|
|
53
|
+
dateRangeField: {
|
|
54
|
+
start: string
|
|
55
|
+
end: string
|
|
56
|
+
presets: string
|
|
57
|
+
apply: string
|
|
58
|
+
cancel: string
|
|
59
|
+
endBeforeStart: string
|
|
60
|
+
tooManyDays: (max: number) => string
|
|
61
|
+
unavailableDay: string
|
|
62
|
+
outOfBounds: string
|
|
63
|
+
}
|
|
47
64
|
notice: { toneWord: Record<'danger' | 'warning' | 'info' | 'success', string> }
|
|
48
65
|
empty: Record<EmptyReason, { title: string; description: string }> & { clearFilters: string; retry: string }
|
|
49
66
|
error: Record<ErrorKind, { title: string; message: string }> & {
|
|
@@ -117,6 +134,23 @@ export const defaultMessages: Messages = {
|
|
|
117
134
|
`${en.n(n)} of ${en.n(max)} ${en.word(max, { one: 'character', other: 'characters' })}, ${en.n(n - max)} over the limit`,
|
|
118
135
|
},
|
|
119
136
|
select: { placeholder: 'Select…', done: 'Done' },
|
|
137
|
+
calendar: {
|
|
138
|
+
previousMonth: (target) => `Previous month, ${target}`,
|
|
139
|
+
nextMonth: (target) => `Next month, ${target}`,
|
|
140
|
+
monthPicker: 'Month',
|
|
141
|
+
yearPicker: 'Year',
|
|
142
|
+
},
|
|
143
|
+
dateRangeField: {
|
|
144
|
+
start: 'Start date',
|
|
145
|
+
end: 'End date',
|
|
146
|
+
presets: 'Presets',
|
|
147
|
+
apply: 'Apply',
|
|
148
|
+
cancel: 'Cancel',
|
|
149
|
+
endBeforeStart: 'The end date is before the start date.',
|
|
150
|
+
tooManyDays: (max) => `The range is longer than ${en.n(max)} ${en.word(max, { one: 'day', other: 'days' })}.`,
|
|
151
|
+
unavailableDay: 'The range includes a day that cannot be chosen.',
|
|
152
|
+
outOfBounds: 'The range includes a day outside the allowed dates.',
|
|
153
|
+
},
|
|
120
154
|
notice: { toneWord: { danger: 'Error:', warning: 'Warning:', info: 'Information:', success: 'Success:' } },
|
|
121
155
|
empty: {
|
|
122
156
|
'no-data': { title: 'Nothing here yet', description: 'Items appear here once they are added.' },
|
|
@@ -217,6 +251,23 @@ export const messagesPtBR: Messages = {
|
|
|
217
251
|
`${pt.n(n)} de ${pt.n(max)} ${pt.word(max, { one: 'caractere', other: 'caracteres' })}, ${pt.n(n - max)} acima do limite`,
|
|
218
252
|
},
|
|
219
253
|
select: { placeholder: 'Selecione…', done: 'Concluir' },
|
|
254
|
+
calendar: {
|
|
255
|
+
previousMonth: (target) => `Mês anterior, ${target}`,
|
|
256
|
+
nextMonth: (target) => `Próximo mês, ${target}`,
|
|
257
|
+
monthPicker: 'Mês',
|
|
258
|
+
yearPicker: 'Ano',
|
|
259
|
+
},
|
|
260
|
+
dateRangeField: {
|
|
261
|
+
start: 'Data inicial',
|
|
262
|
+
end: 'Data final',
|
|
263
|
+
presets: 'Períodos rápidos',
|
|
264
|
+
apply: 'Aplicar',
|
|
265
|
+
cancel: 'Cancelar',
|
|
266
|
+
endBeforeStart: 'A data final é anterior à data inicial.',
|
|
267
|
+
tooManyDays: (max) => `O período é maior que ${pt.n(max)} ${pt.word(max, { one: 'dia', other: 'dias' })}.`,
|
|
268
|
+
unavailableDay: 'O período inclui um dia que não pode ser escolhido.',
|
|
269
|
+
outOfBounds: 'O período inclui um dia fora das datas permitidas.',
|
|
270
|
+
},
|
|
220
271
|
notice: { toneWord: { danger: 'Erro:', warning: 'Atenção:', info: 'Informação:', success: 'Sucesso:' } },
|
|
221
272
|
empty: {
|
|
222
273
|
'no-data': { title: 'Ainda não há nada aqui', description: 'Os itens aparecem aqui quando forem adicionados.' },
|
package/src/internal/theme.tsx
CHANGED
|
@@ -42,10 +42,13 @@ export interface ThemeProviderProps {
|
|
|
42
42
|
*/
|
|
43
43
|
storageKey?: string
|
|
44
44
|
/**
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
45
|
+
* Extra font stylesheet per theme name, for the host's own themes. The
|
|
46
|
+
* fonts of every built-in and print theme are bundled with
|
|
47
|
+
* `@font-face` in the token sheets, so this is optional and empty by
|
|
48
|
+
* default (nothing is fetched from a third party). The URL of the current
|
|
49
|
+
* theme is added as a `<link rel="stylesheet">` (in `<head>` for
|
|
50
|
+
* `document`, inside the wrapper for `scope`); themes without an entry
|
|
51
|
+
* load nothing.
|
|
49
52
|
*/
|
|
50
53
|
fonts?: Readonly<Record<string, string>>
|
|
51
54
|
className?: string
|
|
@@ -171,7 +174,7 @@ export function useTheme(): ThemeState {
|
|
|
171
174
|
*/
|
|
172
175
|
export function themeInitScript(storageKey = 'ty-theme', defaults: Stored = {}, options: { fonts?: Readonly<Record<string, string>> } = {}): string {
|
|
173
176
|
const d = JSON.stringify({ theme: defaults.theme ?? 'tympan', mode: defaults.mode ?? 'system', density: defaults.density ?? 'default' })
|
|
174
|
-
// Optional:
|
|
177
|
+
// Optional: a host font stylesheet for the stored theme, added before first paint (same link ThemeProvider `fonts` manages). Built-in and print theme fonts are bundled and need none.
|
|
175
178
|
const fonts = options.fonts && Object.keys(options.fonts).length
|
|
176
179
|
? `var f=${JSON.stringify(options.fonts).replace(/</g, '\\u003c')}[t];if(f){var l=document.createElement('link');l.rel='stylesheet';l.href=f;l.setAttribute('data-ty-theme-fonts','');document.head.appendChild(l);}`
|
|
177
180
|
: ''
|
package/src/styles.css
CHANGED
|
@@ -11,7 +11,9 @@
|
|
|
11
11
|
@import './components/breadcrumbs/Breadcrumbs.css';
|
|
12
12
|
@import './components/button/Button.css';
|
|
13
13
|
@import './components/checkbox/Checkbox.css';
|
|
14
|
+
@import './components/calendar/Calendar.css';
|
|
14
15
|
@import './components/data-table/DataTable.css';
|
|
16
|
+
@import './components/date-range-field/DateRangeField.css';
|
|
15
17
|
@import './components/drawer/Drawer.css';
|
|
16
18
|
@import './components/empty-state/EmptyState.css';
|
|
17
19
|
@import './components/error-state/ErrorState.css';
|
|
@@ -42,6 +44,7 @@
|
|
|
42
44
|
@import './components/text-field/TextField.css';
|
|
43
45
|
@import './components/text/Text.css';
|
|
44
46
|
@import './components/toast/Toast.css';
|
|
47
|
+
@import './components/tooltip/Tooltip.css';
|
|
45
48
|
@import './groups/forms-a.css';
|
|
46
49
|
@import './groups/forms-b.css';
|
|
47
50
|
@import './groups/overlays-nav.css';
|