danielgm-ui 0.4.6 → 0.4.7
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/ATKINSON-LICENSE.txt +93 -0
- package/README.md +49 -3
- package/dist/code-block.d.ts +36 -0
- package/dist/code-block.js +87 -0
- package/dist/fonts/atkinson-hyperlegible-next-latin-ext-wght-italic.woff2 +0 -0
- package/dist/fonts/atkinson-hyperlegible-next-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/atkinson-hyperlegible-next-latin-wght-italic.woff2 +0 -0
- package/dist/fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2 +0 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/styles.css +182 -1
- package/package.json +3 -1
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Copyright 2020-2024 The Atkinson Hyperlegible Next Project Authors (https://github.com/googlefonts/atkinson-hyperlegible-next) AtkinsonHyperlegibleNext-Italic[wght].ttf: Copyright 2020-2024 The Atkinson Hyperlegible Next Project Authors (https://github.com/googlefonts/atkinson-hyperlegible-next)
|
|
2
|
+
|
|
3
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
4
|
+
This license is copied below, and is also available with a FAQ at:
|
|
5
|
+
http://scripts.sil.org/OFL
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
-----------------------------------------------------------
|
|
9
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
10
|
+
-----------------------------------------------------------
|
|
11
|
+
|
|
12
|
+
PREAMBLE
|
|
13
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
14
|
+
development of collaborative font projects, to support the font creation
|
|
15
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
16
|
+
open framework in which fonts may be shared and improved in partnership
|
|
17
|
+
with others.
|
|
18
|
+
|
|
19
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
20
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
21
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
22
|
+
redistributed and/or sold with any software provided that any reserved
|
|
23
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
24
|
+
however, cannot be released under any other type of license. The
|
|
25
|
+
requirement for fonts to remain under this license does not apply
|
|
26
|
+
to any document created using the fonts or their derivatives.
|
|
27
|
+
|
|
28
|
+
DEFINITIONS
|
|
29
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
30
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
31
|
+
include source files, build scripts and documentation.
|
|
32
|
+
|
|
33
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
34
|
+
copyright statement(s).
|
|
35
|
+
|
|
36
|
+
"Original Version" refers to the collection of Font Software components as
|
|
37
|
+
distributed by the Copyright Holder(s).
|
|
38
|
+
|
|
39
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
40
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
41
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
42
|
+
new environment.
|
|
43
|
+
|
|
44
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
45
|
+
writer or other person who contributed to the Font Software.
|
|
46
|
+
|
|
47
|
+
PERMISSION & CONDITIONS
|
|
48
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
49
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
50
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
51
|
+
Software, subject to the following conditions:
|
|
52
|
+
|
|
53
|
+
1) Neither the Font Software nor any of its individual components,
|
|
54
|
+
in Original or Modified Versions, may be sold by itself.
|
|
55
|
+
|
|
56
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
57
|
+
redistributed and/or sold with any software, provided that each copy
|
|
58
|
+
contains the above copyright notice and this license. These can be
|
|
59
|
+
included either as stand-alone text files, human-readable headers or
|
|
60
|
+
in the appropriate machine-readable metadata fields within text or
|
|
61
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
62
|
+
|
|
63
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
64
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
65
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
66
|
+
presented to the users.
|
|
67
|
+
|
|
68
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
69
|
+
Software shall not be used to promote, endorse or advertise any
|
|
70
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
71
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
72
|
+
permission.
|
|
73
|
+
|
|
74
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
75
|
+
must be distributed entirely under this license, and must not be
|
|
76
|
+
distributed under any other license. The requirement for fonts to
|
|
77
|
+
remain under this license does not apply to any document created
|
|
78
|
+
using the Font Software.
|
|
79
|
+
|
|
80
|
+
TERMINATION
|
|
81
|
+
This license becomes null and void if any of the above conditions are
|
|
82
|
+
not met.
|
|
83
|
+
|
|
84
|
+
DISCLAIMER
|
|
85
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
86
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
87
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
88
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
89
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
90
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
91
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
92
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
93
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Componentes React con estilos y APIs propios. Parte de sus interacciones y compo
|
|
|
4
4
|
|
|
5
5
|
Componentes React con TypeScript y CSS independiente, publicados con licencia MIT.
|
|
6
6
|
|
|
7
|
-
**Componentes:** Button, Badge, Typography, Input, Textarea, Checkbox, Switch, Select, CustomSelect, Modal, Tooltip, Tabs, Accordion, Card, Container, Header, Alert, Separator, Transition, DropdownMenu, ContextMenu, RadioGroup, Toast, Skeleton y Loader. Card incluye CardHeader, CardContent y CardFooter; Header incluye HeaderBrand, HeaderNav y HeaderActions.
|
|
7
|
+
**Componentes:** Button, Badge, Typography, CodeBlock, Input, Textarea, Checkbox, Switch, Select, CustomSelect, Modal, Tooltip, Tabs, Accordion, Card, Container, Header, Alert, Separator, Transition, DropdownMenu, ContextMenu, RadioGroup, Toast, Skeleton y Loader. Card incluye CardHeader, CardContent y CardFooter; Header incluye HeaderBrand, HeaderNav y HeaderActions.
|
|
8
8
|
|
|
9
9
|
## Instalación
|
|
10
10
|
|
|
@@ -379,9 +379,9 @@ import { Typography } from 'danielgm-ui';
|
|
|
379
379
|
<Typography variant="caption" tone="muted">Actualizado hoy</Typography>
|
|
380
380
|
```
|
|
381
381
|
|
|
382
|
-
Conserva `className`, `style`, atributos HTML y ARIA; no expone `ref
|
|
382
|
+
Conserva `className`, `style`, atributos HTML y ARIA; no expone `ref` ni añade márgenes. El contenedor controla la separación y los textos largos pueden ajustarse. Typography usa la fuente predeterminada del paquete; la fuente especial del título de la web de documentación pertenece únicamente a esa landing.
|
|
383
383
|
|
|
384
|
-
La fuente
|
|
384
|
+
La fuente predeterminada es Atkinson Hyperlegible Next, incluida localmente en `danielgm-ui/styles.css` y los archivos WOFF2 del paquete. Los componentes no requieren una conexión a un servidor de fuentes. Configura `--dgm-font` para usar otra familia; los controles internos, incluidos menús, TreeView, ToggleGroup y NavigationMenu, siguen ese token. `--dgm-font-mono` configura la familia de texto monoespaciado. La licencia de la fuente se incluye en `ATKINSON-LICENSE.txt`.
|
|
385
385
|
|
|
386
386
|
Los tamaños tienen roles compartidos: `--dgm-text-body` y `--dgm-text-control` (1rem), `--dgm-text-label` y `--dgm-text-action` (0.9375rem), `--dgm-text-help` (0.875rem), `--dgm-text-caption` (0.75rem) y `--dgm-text-title` (1.25rem). Los valores de campos y selectores son regulares; etiquetas y acciones usan semibold. `--dgm-font-weight-*`, `--dgm-leading-*` y `--dgm-tracking-*` completan la escala. Las variantes `sm` y `lg` conservan sus tamaños propios dentro de ella.
|
|
387
387
|
|
|
@@ -427,3 +427,49 @@ Para extender este estilo a toda tu página, añade `className="dgm-scrollbars"`
|
|
|
427
427
|
```tsx
|
|
428
428
|
<Loader variant="dots" size="lg" locale="es" showLabel />
|
|
429
429
|
```
|
|
430
|
+
|
|
431
|
+
### CodeBlock
|
|
432
|
+
|
|
433
|
+
`CodeBlock` muestra texto de solo lectura, con paleta oscura, copia del original,
|
|
434
|
+
scroll de teclado y números decorativos opcionales. `language` es una etiqueta
|
|
435
|
+
obligatoria; no carga un motor. `tokens?: readonly CodeBlockToken[]` permite preparar
|
|
436
|
+
el resaltado en servidor (por ejemplo con Shiki) o importar solo los lenguajes que
|
|
437
|
+
necesites. Adapta sus categorías a `plain`, `keyword`, `string`, `comment`, `number`,
|
|
438
|
+
`type`, `function` y `operator`. Cada token contiene `content` literal y `kind`
|
|
439
|
+
opcional; nunca HTML. Deben concatenar exactamente `code`; de lo contrario se
|
|
440
|
+
muestra el original sin colores. Sirve para TypeScript, JavaScript, JSON, shell o
|
|
441
|
+
cualquier lenguaje que prepare el consumidor, sin dependencias de resaltado cliente.
|
|
442
|
+
|
|
443
|
+
```tsx
|
|
444
|
+
import { CodeBlock } from 'danielgm-ui';
|
|
445
|
+
|
|
446
|
+
<CodeBlock
|
|
447
|
+
code={'const answer = 42;\n'}
|
|
448
|
+
language="typescript"
|
|
449
|
+
filename="answer.ts"
|
|
450
|
+
showLineNumbers
|
|
451
|
+
maxHeight="20rem"
|
|
452
|
+
labels={{
|
|
453
|
+
copy: 'Copiar',
|
|
454
|
+
copied: 'Copiado',
|
|
455
|
+
copyHelp: 'Copiar archivo completo',
|
|
456
|
+
copyError: 'No se pudo copiar; selecciona el texto.',
|
|
457
|
+
}}
|
|
458
|
+
tokens={[
|
|
459
|
+
{ content: 'const', kind: 'keyword' },
|
|
460
|
+
{ content: ' answer = ' },
|
|
461
|
+
{ content: '42', kind: 'number' },
|
|
462
|
+
{ content: ';\n' },
|
|
463
|
+
]}
|
|
464
|
+
/>;
|
|
465
|
+
```
|
|
466
|
+
|
|
467
|
+
`wrapLines` permite ajustar líneas largas; por defecto se desplazan horizontalmente.
|
|
468
|
+
Tab enfoca la región y las flechas la desplazan. La copia requiere Clipboard API en
|
|
469
|
+
un contexto seguro y anuncia los errores para permitir selección manual. El botón
|
|
470
|
+
copia espacios, tabulaciones y finales de línea originales sin números. `className`,
|
|
471
|
+
`style`, atributos nativos y `ref` corresponden al div exterior. Se puede colocar
|
|
472
|
+
como contenido de Modal y Tabs, sin diálogos adicionales ni ejecución de código.
|
|
473
|
+
Los tokens `--dgm-code-background`, `--dgm-code-foreground`, `--dgm-code-muted`,
|
|
474
|
+
`--dgm-code-keyword`, `--dgm-code-string`, `--dgm-code-number`, `--dgm-code-type` y
|
|
475
|
+
`--dgm-code-function` permiten adaptar los colores conservando contraste.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type CSSProperties, type HTMLAttributes } from 'react';
|
|
2
|
+
/** Categorías semánticas independientes del motor y de su tema. */
|
|
3
|
+
export type CodeBlockTokenKind = 'plain' | 'keyword' | 'string' | 'comment' | 'number' | 'type' | 'function' | 'operator';
|
|
4
|
+
/** Texto literal, nunca HTML. La concatenación de todos los tokens debe ser code. */
|
|
5
|
+
export interface CodeBlockToken {
|
|
6
|
+
content: string;
|
|
7
|
+
kind?: CodeBlockTokenKind;
|
|
8
|
+
}
|
|
9
|
+
/** Textos localizables de la acción y los anuncios de resultado. */
|
|
10
|
+
export interface CodeBlockLabels {
|
|
11
|
+
copy: string;
|
|
12
|
+
copied: string;
|
|
13
|
+
copyError: string;
|
|
14
|
+
copyHelp: string;
|
|
15
|
+
}
|
|
16
|
+
/** Atributos del contenedor exterior; la ref apunta a ese div. */
|
|
17
|
+
export interface CodeBlockProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'dangerouslySetInnerHTML'> {
|
|
18
|
+
/** Fuente original; conserva espacios, tabulaciones y finales de línea al copiar. */
|
|
19
|
+
code: string;
|
|
20
|
+
/** Lenguaje explícito y visible. No carga ni ejecuta un motor de resaltado. */
|
|
21
|
+
language: string;
|
|
22
|
+
/** Nombre visible del archivo y nombre de la región desplazable. */
|
|
23
|
+
filename?: string;
|
|
24
|
+
/** Tokens preparados por el consumidor, por ejemplo en servidor con Shiki. Si no reconstruyen code, se muestra texto plano. */
|
|
25
|
+
tokens?: readonly CodeBlockToken[];
|
|
26
|
+
/** Numeración decorativa, excluida de selección y accesibilidad. @defaultValue false */
|
|
27
|
+
showLineNumbers?: boolean;
|
|
28
|
+
/** Ajusta líneas largas al ancho disponible. @defaultValue false */
|
|
29
|
+
wrapLines?: boolean;
|
|
30
|
+
/** Altura máxima del área de código, en píxeles si es un número. @defaultValue '24rem' */
|
|
31
|
+
maxHeight?: CSSProperties['maxHeight'];
|
|
32
|
+
/** Traducciones parciales de los textos ingleses predeterminados. */
|
|
33
|
+
labels?: Partial<CodeBlockLabels>;
|
|
34
|
+
}
|
|
35
|
+
/** Visor seguro de solo lectura, con paleta oscura y desplazamiento nativo de teclado. No evalúa código ni acepta marcado HTML. */
|
|
36
|
+
export declare const CodeBlock: import("react").ForwardRefExoticComponent<CodeBlockProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef, useEffect, useId, useRef, useState, } from 'react';
|
|
4
|
+
import { Button } from './button.js';
|
|
5
|
+
import { cx } from './utils.js';
|
|
6
|
+
const defaultLabels = {
|
|
7
|
+
copy: 'Copy code',
|
|
8
|
+
copied: 'Code copied',
|
|
9
|
+
copyError: 'Could not copy code. Select and copy the text manually.',
|
|
10
|
+
copyHelp: 'Copy the complete original source',
|
|
11
|
+
};
|
|
12
|
+
const kinds = new Set([
|
|
13
|
+
'plain',
|
|
14
|
+
'keyword',
|
|
15
|
+
'string',
|
|
16
|
+
'comment',
|
|
17
|
+
'number',
|
|
18
|
+
'type',
|
|
19
|
+
'function',
|
|
20
|
+
'operator',
|
|
21
|
+
]);
|
|
22
|
+
/** Visor seguro de solo lectura, con paleta oscura y desplazamiento nativo de teclado. No evalúa código ni acepta marcado HTML. */
|
|
23
|
+
export const CodeBlock = forwardRef(function CodeBlock({ code, language, filename, tokens, showLineNumbers = false, wrapLines = false, maxHeight = '24rem', labels, className, ...props }, ref) {
|
|
24
|
+
const text = { ...defaultLabels, ...labels };
|
|
25
|
+
const helpId = useId();
|
|
26
|
+
const [status, setStatus] = useState('');
|
|
27
|
+
const [copying, setCopying] = useState(false);
|
|
28
|
+
const request = useRef(0);
|
|
29
|
+
// Invalida resultados pendientes al cambiar de archivo o desmontar el visor.
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
setStatus('');
|
|
32
|
+
setCopying(false);
|
|
33
|
+
return () => {
|
|
34
|
+
request.current += 1;
|
|
35
|
+
};
|
|
36
|
+
}, [code]);
|
|
37
|
+
async function copy() {
|
|
38
|
+
if (copying)
|
|
39
|
+
return;
|
|
40
|
+
const current = ++request.current;
|
|
41
|
+
setStatus('');
|
|
42
|
+
setCopying(true);
|
|
43
|
+
try {
|
|
44
|
+
await navigator.clipboard.writeText(code);
|
|
45
|
+
if (request.current === current)
|
|
46
|
+
setStatus(text.copied);
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
if (request.current === current)
|
|
50
|
+
setStatus(text.copyError);
|
|
51
|
+
}
|
|
52
|
+
finally {
|
|
53
|
+
if (request.current === current)
|
|
54
|
+
setCopying(false);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
const validTokens = tokens?.every((token) => typeof token.content === 'string') &&
|
|
58
|
+
tokens.map((token) => token.content).join('') === code;
|
|
59
|
+
// Los saltos permanecen dentro del texto; cada fila comparte la misma geometría
|
|
60
|
+
// con su número, incluso al ajustar líneas. No se normaliza la fuente original.
|
|
61
|
+
const lines = [[]];
|
|
62
|
+
let previousWasCR = false;
|
|
63
|
+
for (const token of validTokens ? tokens : [{ content: code }]) {
|
|
64
|
+
const parts = token.content.split(/(\r\n|\r|\n)/);
|
|
65
|
+
parts.forEach((part, index) => {
|
|
66
|
+
if (!part)
|
|
67
|
+
return;
|
|
68
|
+
if (index % 2) {
|
|
69
|
+
// Un resaltador puede separar CR y LF en tokens consecutivos.
|
|
70
|
+
if (part === '\n' && previousWasCR) {
|
|
71
|
+
const previousLine = lines[lines.length - 2];
|
|
72
|
+
previousLine[previousLine.length - 1].content += part;
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
lines[lines.length - 1].push({ content: part });
|
|
76
|
+
lines.push([]);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
else
|
|
80
|
+
lines[lines.length - 1].push({ content: part, kind: token.kind });
|
|
81
|
+
previousWasCR = part.endsWith('\r');
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
return (_jsxs("div", { ...props, ref: ref, className: cx('dgm-code-block', wrapLines && 'dgm-code-block--wrap', className), children: [_jsxs("div", { className: "dgm-code-block-header", children: [_jsx("span", { className: "dgm-code-block-filename", children: filename ?? language }), filename && _jsx("span", { className: "dgm-code-block-language", children: language }), _jsx(Button, { size: "sm", variant: "secondary", "aria-disabled": copying || undefined, "aria-busy": copying || undefined, "aria-describedby": helpId, title: text.copyHelp, onClick: copy, children: text.copy })] }), _jsx("span", { id: helpId, className: "dgm-code-block-sr", children: text.copyHelp }), _jsx("div", { role: "status", className: "dgm-code-block-status", children: status }), _jsx("pre", { className: "dgm-code-block-viewport", tabIndex: 0, role: "region", "aria-label": filename ? `${filename} (${language})` : language, style: { maxHeight }, children: _jsx("code", { children: lines.map((line, index) => (_jsxs("span", { className: "dgm-code-block-line", children: [showLineNumbers && (_jsx("span", { className: "dgm-code-block-number", "aria-hidden": "true", "data-line": index + 1 })), _jsx("span", { className: "dgm-code-block-source", children: line.map((token, tokenIndex) => (_jsx("span", { className: token.kind && kinds.has(token.kind)
|
|
85
|
+
? `dgm-code-token--${token.kind}`
|
|
86
|
+
: undefined, children: token.content }, tokenIndex))) })] }, index))) }) })] }));
|
|
87
|
+
});
|
|
Binary file
|
|
Binary file
|
package/dist/index.d.ts
CHANGED
|
@@ -49,3 +49,4 @@ export { Accordion, type AccordionProps, type AccordionItem, type AccordionSingl
|
|
|
49
49
|
export { Input, Textarea, Select, type InputProps, type TextareaProps, type SelectProps, } from './fields.js';
|
|
50
50
|
export { Checkbox, Switch, type CheckboxProps, type SwitchProps } from './toggles.js';
|
|
51
51
|
export { Badge, Card, CardHeader, CardContent, CardFooter, Alert, Separator, type BadgeProps, type CardProps, type AlertProps, type SeparatorProps, type Tone, } from './display.js';
|
|
52
|
+
export { CodeBlock, type CodeBlockProps, type CodeBlockToken, type CodeBlockTokenKind, type CodeBlockLabels, } from './code-block.js';
|
package/dist/index.js
CHANGED
|
@@ -49,3 +49,4 @@ export { Accordion, } from './accordion.js';
|
|
|
49
49
|
export { Input, Textarea, Select, } from './fields.js';
|
|
50
50
|
export { Checkbox, Switch } from './toggles.js';
|
|
51
51
|
export { Badge, Card, CardHeader, CardContent, CardFooter, Alert, Separator, } from './display.js';
|
|
52
|
+
export { CodeBlock, } from './code-block.js';
|
package/dist/styles.css
CHANGED
|
@@ -1,4 +1,47 @@
|
|
|
1
1
|
/* Estilos públicos de danielgm-ui. Importar una sola vez en el layout o entrada de la aplicación. */
|
|
2
|
+
/* Fuente propia del paquete: los archivos se distribuyen junto a esta hoja. */
|
|
3
|
+
@font-face {
|
|
4
|
+
font-family: 'Atkinson Hyperlegible Next Variable';
|
|
5
|
+
font-style: normal;
|
|
6
|
+
font-display: swap;
|
|
7
|
+
font-weight: 200 800;
|
|
8
|
+
src: url('./fonts/atkinson-hyperlegible-next-latin-ext-wght-normal.woff2') format('woff2');
|
|
9
|
+
unicode-range:
|
|
10
|
+
U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
|
|
11
|
+
U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
|
|
12
|
+
U+A720-A7FF;
|
|
13
|
+
}
|
|
14
|
+
@font-face {
|
|
15
|
+
font-family: 'Atkinson Hyperlegible Next Variable';
|
|
16
|
+
font-style: normal;
|
|
17
|
+
font-display: swap;
|
|
18
|
+
font-weight: 200 800;
|
|
19
|
+
src: url('./fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2') format('woff2');
|
|
20
|
+
unicode-range:
|
|
21
|
+
U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
|
|
22
|
+
U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
|
23
|
+
}
|
|
24
|
+
@font-face {
|
|
25
|
+
font-family: 'Atkinson Hyperlegible Next Variable';
|
|
26
|
+
font-style: italic;
|
|
27
|
+
font-display: swap;
|
|
28
|
+
font-weight: 200 800;
|
|
29
|
+
src: url('./fonts/atkinson-hyperlegible-next-latin-ext-wght-italic.woff2') format('woff2');
|
|
30
|
+
unicode-range:
|
|
31
|
+
U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
|
|
32
|
+
U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
|
|
33
|
+
U+A720-A7FF;
|
|
34
|
+
}
|
|
35
|
+
@font-face {
|
|
36
|
+
font-family: 'Atkinson Hyperlegible Next Variable';
|
|
37
|
+
font-style: italic;
|
|
38
|
+
font-display: swap;
|
|
39
|
+
font-weight: 200 800;
|
|
40
|
+
src: url('./fonts/atkinson-hyperlegible-next-latin-wght-italic.woff2') format('woff2');
|
|
41
|
+
unicode-range:
|
|
42
|
+
U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
|
|
43
|
+
U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
|
44
|
+
}
|
|
2
45
|
/* Las secciones finales incorporan menús, radios, notificaciones y marcadores de carga. */
|
|
3
46
|
/* Los componentes compuestos usan los mismos tokens, foco y áreas táctiles que los controles básicos. */
|
|
4
47
|
/* 1. Tokens públicos. Se pueden sobrescribir en :root o heredar desde un contenedor. */
|
|
@@ -30,7 +73,7 @@
|
|
|
30
73
|
--dgm-header-shadow: rgb(0 0 0 / 18%);
|
|
31
74
|
--dgm-header-highlight: rgb(255 255 255 / 8%);
|
|
32
75
|
/* Escala pública y roles: la aplicación puede adaptar toda la tipografía desde la raíz. */
|
|
33
|
-
--dgm-font:
|
|
76
|
+
--dgm-font: 'Atkinson Hyperlegible Next Variable', system-ui, sans-serif;
|
|
34
77
|
--dgm-font-mono: 'Cascadia Code', 'SFMono-Regular', Consolas, monospace;
|
|
35
78
|
--dgm-font-size-xs: 0.75rem;
|
|
36
79
|
--dgm-font-size-sm: 0.875rem;
|
|
@@ -3718,3 +3761,141 @@ button.dgm-step:disabled {
|
|
|
3718
3761
|
display: inline-flex;
|
|
3719
3762
|
flex-shrink: 0;
|
|
3720
3763
|
}
|
|
3764
|
+
|
|
3765
|
+
/* El visor conserva una paleta oscura independiente del tema de la aplicación.
|
|
3766
|
+
Las categorías semánticas evitan estilos arbitrarios procedentes del resaltador. */
|
|
3767
|
+
.dgm-code-block {
|
|
3768
|
+
--dgm-code-background: #111827;
|
|
3769
|
+
--dgm-code-foreground: #e5e7eb;
|
|
3770
|
+
--dgm-code-muted: #a8b3c7;
|
|
3771
|
+
--dgm-code-keyword: #c4b5fd;
|
|
3772
|
+
--dgm-code-string: #86efac;
|
|
3773
|
+
--dgm-code-number: #fdba74;
|
|
3774
|
+
--dgm-code-type: #67e8f9;
|
|
3775
|
+
--dgm-code-function: #fde68a;
|
|
3776
|
+
--dgm-surface: var(--dgm-code-background);
|
|
3777
|
+
--dgm-text: var(--dgm-code-foreground);
|
|
3778
|
+
--dgm-subtle: #253047;
|
|
3779
|
+
--dgm-hover: #37455f;
|
|
3780
|
+
--dgm-on-hover: var(--dgm-code-foreground);
|
|
3781
|
+
--dgm-border: #64748b;
|
|
3782
|
+
--dgm-ring: #a5b4fc;
|
|
3783
|
+
--dgm-primary: var(--dgm-ring);
|
|
3784
|
+
box-sizing: border-box;
|
|
3785
|
+
min-width: 0;
|
|
3786
|
+
max-width: 100%;
|
|
3787
|
+
overflow: hidden;
|
|
3788
|
+
border: 1px solid var(--dgm-border);
|
|
3789
|
+
border-radius: var(--dgm-radius);
|
|
3790
|
+
background: var(--dgm-code-background);
|
|
3791
|
+
color: var(--dgm-code-foreground);
|
|
3792
|
+
font-family: var(--dgm-font);
|
|
3793
|
+
}
|
|
3794
|
+
.dgm-code-block-header {
|
|
3795
|
+
display: flex;
|
|
3796
|
+
align-items: center;
|
|
3797
|
+
flex-wrap: wrap;
|
|
3798
|
+
gap: 0.75rem;
|
|
3799
|
+
padding: 0.75rem;
|
|
3800
|
+
border-bottom: 1px solid var(--dgm-border);
|
|
3801
|
+
font-size: var(--dgm-text-help);
|
|
3802
|
+
}
|
|
3803
|
+
.dgm-code-block-filename {
|
|
3804
|
+
flex: 1;
|
|
3805
|
+
min-width: 0;
|
|
3806
|
+
overflow-wrap: anywhere;
|
|
3807
|
+
}
|
|
3808
|
+
.dgm-code-block-language {
|
|
3809
|
+
min-width: 0;
|
|
3810
|
+
overflow-wrap: anywhere;
|
|
3811
|
+
color: var(--dgm-code-muted);
|
|
3812
|
+
}
|
|
3813
|
+
.dgm-code-block-viewport {
|
|
3814
|
+
box-sizing: border-box;
|
|
3815
|
+
overflow: auto;
|
|
3816
|
+
margin: 0;
|
|
3817
|
+
padding: 1rem;
|
|
3818
|
+
font-family: var(--dgm-font-mono);
|
|
3819
|
+
font-size: var(--dgm-text-help);
|
|
3820
|
+
font-weight: var(--dgm-font-weight-regular);
|
|
3821
|
+
line-height: var(--dgm-leading-normal);
|
|
3822
|
+
white-space: pre;
|
|
3823
|
+
tab-size: 4;
|
|
3824
|
+
direction: ltr;
|
|
3825
|
+
text-align: left;
|
|
3826
|
+
}
|
|
3827
|
+
.dgm-code-block-viewport:focus-visible {
|
|
3828
|
+
outline: 2px solid var(--dgm-ring);
|
|
3829
|
+
outline-offset: -3px;
|
|
3830
|
+
}
|
|
3831
|
+
.dgm-code-block-viewport code {
|
|
3832
|
+
display: grid;
|
|
3833
|
+
width: max-content;
|
|
3834
|
+
min-width: 100%;
|
|
3835
|
+
font: inherit;
|
|
3836
|
+
color: inherit;
|
|
3837
|
+
}
|
|
3838
|
+
.dgm-code-block-line {
|
|
3839
|
+
display: flex;
|
|
3840
|
+
min-height: 1lh;
|
|
3841
|
+
}
|
|
3842
|
+
.dgm-code-block-source {
|
|
3843
|
+
flex: 1;
|
|
3844
|
+
min-width: 0;
|
|
3845
|
+
}
|
|
3846
|
+
.dgm-code-block-number {
|
|
3847
|
+
flex: none;
|
|
3848
|
+
width: 4ch;
|
|
3849
|
+
padding-right: 2ch;
|
|
3850
|
+
color: var(--dgm-code-muted);
|
|
3851
|
+
user-select: none;
|
|
3852
|
+
}
|
|
3853
|
+
.dgm-code-block-number::before {
|
|
3854
|
+
content: attr(data-line);
|
|
3855
|
+
}
|
|
3856
|
+
.dgm-code-block--wrap code {
|
|
3857
|
+
width: 100%;
|
|
3858
|
+
}
|
|
3859
|
+
.dgm-code-block--wrap .dgm-code-block-source {
|
|
3860
|
+
white-space: pre-wrap;
|
|
3861
|
+
overflow-wrap: anywhere;
|
|
3862
|
+
}
|
|
3863
|
+
.dgm-code-block-status {
|
|
3864
|
+
padding-inline: 0.75rem;
|
|
3865
|
+
font-size: var(--dgm-text-help);
|
|
3866
|
+
overflow-wrap: anywhere;
|
|
3867
|
+
}
|
|
3868
|
+
.dgm-code-block-status:empty {
|
|
3869
|
+
padding: 0;
|
|
3870
|
+
}
|
|
3871
|
+
.dgm-code-block-sr {
|
|
3872
|
+
position: absolute;
|
|
3873
|
+
width: 1px;
|
|
3874
|
+
height: 1px;
|
|
3875
|
+
padding: 0;
|
|
3876
|
+
overflow: hidden;
|
|
3877
|
+
clip-path: inset(50%);
|
|
3878
|
+
white-space: nowrap;
|
|
3879
|
+
}
|
|
3880
|
+
.dgm-code-block-source ::selection {
|
|
3881
|
+
background: #c7d2fe;
|
|
3882
|
+
color: #111827;
|
|
3883
|
+
}
|
|
3884
|
+
.dgm-code-token--keyword {
|
|
3885
|
+
color: var(--dgm-code-keyword);
|
|
3886
|
+
}
|
|
3887
|
+
.dgm-code-token--string {
|
|
3888
|
+
color: var(--dgm-code-string);
|
|
3889
|
+
}
|
|
3890
|
+
.dgm-code-token--comment {
|
|
3891
|
+
color: var(--dgm-code-muted);
|
|
3892
|
+
}
|
|
3893
|
+
.dgm-code-token--number {
|
|
3894
|
+
color: var(--dgm-code-number);
|
|
3895
|
+
}
|
|
3896
|
+
.dgm-code-token--type {
|
|
3897
|
+
color: var(--dgm-code-type);
|
|
3898
|
+
}
|
|
3899
|
+
.dgm-code-token--function {
|
|
3900
|
+
color: var(--dgm-code-function);
|
|
3901
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "danielgm-ui",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.7",
|
|
4
4
|
"description": "Accessible React components for Next.js and the web.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"dist",
|
|
25
25
|
"README.md",
|
|
26
26
|
"LICENSE",
|
|
27
|
+
"ATKINSON-LICENSE.txt",
|
|
27
28
|
"TABLER-LICENSE.txt"
|
|
28
29
|
],
|
|
29
30
|
"sideEffects": [
|
|
@@ -39,6 +40,7 @@
|
|
|
39
40
|
"react-dom": "^18.2.0 || ^19.0.0"
|
|
40
41
|
},
|
|
41
42
|
"devDependencies": {
|
|
43
|
+
"@fontsource-variable/atkinson-hyperlegible-next": "5.3.0",
|
|
42
44
|
"react": "^19.2.0",
|
|
43
45
|
"react-dom": "^19.2.0"
|
|
44
46
|
},
|