orn-ui 0.2.7 → 0.2.9
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/AGENTS.md +25 -3
- package/README.md +9 -8
- package/lib/commonjs/atoms/Gradient.js +111 -0
- package/lib/commonjs/atoms/Gradient.js.map +1 -0
- package/lib/commonjs/atoms/ShinyText.js +188 -0
- package/lib/commonjs/atoms/ShinyText.js.map +1 -0
- package/lib/commonjs/atoms/index.js +14 -0
- package/lib/commonjs/atoms/index.js.map +1 -1
- package/lib/commonjs/organisms/Chart.js +947 -0
- package/lib/commonjs/organisms/Chart.js.map +1 -0
- package/lib/commonjs/organisms/OptionWheel.js +408 -0
- package/lib/commonjs/organisms/OptionWheel.js.map +1 -0
- package/lib/commonjs/organisms/Slides.js +406 -0
- package/lib/commonjs/organisms/Slides.js.map +1 -0
- package/lib/commonjs/organisms/Timeline.js +420 -0
- package/lib/commonjs/organisms/Timeline.js.map +1 -0
- package/lib/commonjs/organisms/chart/frame.js +373 -0
- package/lib/commonjs/organisms/chart/frame.js.map +1 -0
- package/lib/commonjs/organisms/chart/marks.js +316 -0
- package/lib/commonjs/organisms/chart/marks.js.map +1 -0
- package/lib/commonjs/organisms/chart/math.js +468 -0
- package/lib/commonjs/organisms/chart/math.js.map +1 -0
- package/lib/commonjs/organisms/chart/palette.js +120 -0
- package/lib/commonjs/organisms/chart/palette.js.map +1 -0
- package/lib/commonjs/organisms/index.js +28 -0
- package/lib/commonjs/organisms/index.js.map +1 -1
- package/lib/commonjs/organisms/useSlides.js +186 -0
- package/lib/commonjs/organisms/useSlides.js.map +1 -0
- package/lib/module/atoms/Gradient.js +106 -0
- package/lib/module/atoms/Gradient.js.map +1 -0
- package/lib/module/atoms/ShinyText.js +183 -0
- package/lib/module/atoms/ShinyText.js.map +1 -0
- package/lib/module/atoms/index.js +2 -0
- package/lib/module/atoms/index.js.map +1 -1
- package/lib/module/organisms/Chart.js +942 -0
- package/lib/module/organisms/Chart.js.map +1 -0
- package/lib/module/organisms/OptionWheel.js +403 -0
- package/lib/module/organisms/OptionWheel.js.map +1 -0
- package/lib/module/organisms/Slides.js +401 -0
- package/lib/module/organisms/Slides.js.map +1 -0
- package/lib/module/organisms/Timeline.js +415 -0
- package/lib/module/organisms/Timeline.js.map +1 -0
- package/lib/module/organisms/chart/frame.js +367 -0
- package/lib/module/organisms/chart/frame.js.map +1 -0
- package/lib/module/organisms/chart/marks.js +310 -0
- package/lib/module/organisms/chart/marks.js.map +1 -0
- package/lib/module/organisms/chart/math.js +445 -0
- package/lib/module/organisms/chart/math.js.map +1 -0
- package/lib/module/organisms/chart/palette.js +114 -0
- package/lib/module/organisms/chart/palette.js.map +1 -0
- package/lib/module/organisms/index.js +4 -0
- package/lib/module/organisms/index.js.map +1 -1
- package/lib/module/organisms/useSlides.js +182 -0
- package/lib/module/organisms/useSlides.js.map +1 -0
- package/lib/typescript/atoms/Gradient.d.ts +37 -0
- package/lib/typescript/atoms/Gradient.d.ts.map +1 -0
- package/lib/typescript/atoms/ShinyText.d.ts +48 -0
- package/lib/typescript/atoms/ShinyText.d.ts.map +1 -0
- package/lib/typescript/atoms/index.d.ts +4 -0
- package/lib/typescript/atoms/index.d.ts.map +1 -1
- package/lib/typescript/organisms/Chart.d.ts +208 -0
- package/lib/typescript/organisms/Chart.d.ts.map +1 -0
- package/lib/typescript/organisms/OptionWheel.d.ts +78 -0
- package/lib/typescript/organisms/OptionWheel.d.ts.map +1 -0
- package/lib/typescript/organisms/Slides.d.ts +69 -0
- package/lib/typescript/organisms/Slides.d.ts.map +1 -0
- package/lib/typescript/organisms/Timeline.d.ts +61 -0
- package/lib/typescript/organisms/Timeline.d.ts.map +1 -0
- package/lib/typescript/organisms/chart/frame.d.ts +85 -0
- package/lib/typescript/organisms/chart/frame.d.ts.map +1 -0
- package/lib/typescript/organisms/chart/marks.d.ts +88 -0
- package/lib/typescript/organisms/chart/marks.d.ts.map +1 -0
- package/lib/typescript/organisms/chart/math.d.ts +161 -0
- package/lib/typescript/organisms/chart/math.d.ts.map +1 -0
- package/lib/typescript/organisms/chart/palette.d.ts +6 -0
- package/lib/typescript/organisms/chart/palette.d.ts.map +1 -0
- package/lib/typescript/organisms/index.d.ts +8 -0
- package/lib/typescript/organisms/index.d.ts.map +1 -1
- package/lib/typescript/organisms/useSlides.d.ts +52 -0
- package/lib/typescript/organisms/useSlides.d.ts.map +1 -0
- package/llms.txt +6 -5
- package/package.json +33 -2
- package/registry/chart.json +35 -0
- package/registry/gradient.json +18 -0
- package/registry/index.json +79 -0
- package/registry/manifest.json +42 -0
- package/registry/option-wheel.json +19 -0
- package/registry/shiny-text.json +19 -0
- package/registry/slides.json +24 -0
- package/registry/timeline.json +20 -0
- package/src/atoms/Gradient.tsx +99 -0
- package/src/atoms/ShinyText.tsx +226 -0
- package/src/atoms/index.ts +4 -0
- package/src/organisms/Chart.tsx +1223 -0
- package/src/organisms/OptionWheel.tsx +476 -0
- package/src/organisms/Slides.tsx +413 -0
- package/src/organisms/Timeline.tsx +467 -0
- package/src/organisms/chart/frame.tsx +349 -0
- package/src/organisms/chart/marks.tsx +295 -0
- package/src/organisms/chart/math.ts +475 -0
- package/src/organisms/chart/palette.ts +112 -0
- package/src/organisms/index.ts +22 -0
- package/src/organisms/useSlides.ts +220 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
import { type GradientDirection } from '../atoms/Gradient';
|
|
4
|
+
import { type SlidesOrientation } from './useSlides';
|
|
5
|
+
export type { SlidesOrientation } from './useSlides';
|
|
6
|
+
export type SlidesIndicators = 'dots' | 'numbers' | 'none';
|
|
7
|
+
export type SlidesIndicatorPlacement = 'overlay' | 'outside';
|
|
8
|
+
/** Un color sólido, o dos o más para un degradado (ver `Gradient`). */
|
|
9
|
+
export type SlideBackground = string | string[];
|
|
10
|
+
export interface SlidesProps<T> {
|
|
11
|
+
data: T[];
|
|
12
|
+
keyExtractor: (item: T, index: number) => string;
|
|
13
|
+
/** Contenido de la slide: imágenes, botones, lo que sea. Se dibuja sobre `background`. */
|
|
14
|
+
renderItem: (item: T, index: number) => React.ReactNode;
|
|
15
|
+
/** Fondo por slide: `'#101014'` pinta plano, `['#004cef', '#00cae1']` degrada. */
|
|
16
|
+
background?: (item: T, index: number) => SlideBackground | undefined;
|
|
17
|
+
/** Dirección del degradado cuando `background` devuelve varios colores. @default 'vertical' */
|
|
18
|
+
gradientDirection?: GradientDirection;
|
|
19
|
+
/** @default 'horizontal' */
|
|
20
|
+
orientation?: SlidesOrientation;
|
|
21
|
+
/** Círculos, círculos numerados, o ninguno. @default 'dots' */
|
|
22
|
+
indicators?: SlidesIndicators;
|
|
23
|
+
/**
|
|
24
|
+
* 'overlay' los apoya sobre la slide, en blanco; 'outside' los saca fuera
|
|
25
|
+
* del área deslizable, con los colores del tema.
|
|
26
|
+
* @default 'overlay'
|
|
27
|
+
*/
|
|
28
|
+
indicatorPlacement?: SlidesIndicatorPlacement;
|
|
29
|
+
/** Después de la última vuelve a la primera (y al revés). @default false */
|
|
30
|
+
loop?: boolean;
|
|
31
|
+
/** Avanza solo. Se pausa mientras el dedo arrastra. @default false */
|
|
32
|
+
autoPlay?: boolean;
|
|
33
|
+
/** ms entre avances de `autoPlay`. @default 4000 */
|
|
34
|
+
interval?: number;
|
|
35
|
+
/**
|
|
36
|
+
* Botón para frenar el avance automático. Sólo aparece con `autoPlay`, y va
|
|
37
|
+
* en `true` porque contenido que se mueve solo necesita una forma de
|
|
38
|
+
* pausarlo (WCAG 2.2.2).
|
|
39
|
+
* @default true
|
|
40
|
+
*/
|
|
41
|
+
showAutoPlayToggle?: boolean;
|
|
42
|
+
/** Hueco entre slides, en px. En 0 quedan pegadas. @default 0 */
|
|
43
|
+
spacing?: number;
|
|
44
|
+
/** Índice controlado. Sin él, el componente maneja el suyo desde `defaultIndex`. */
|
|
45
|
+
index?: number;
|
|
46
|
+
/** @default 0 */
|
|
47
|
+
defaultIndex?: number;
|
|
48
|
+
onIndexChange?: (index: number) => void;
|
|
49
|
+
/** Alto del área deslizable. @default 240 */
|
|
50
|
+
height?: number;
|
|
51
|
+
/** @default true */
|
|
52
|
+
swipeEnabled?: boolean;
|
|
53
|
+
/** Estilos de la caja visible de cada slide — padding, alineación, radio. */
|
|
54
|
+
slideStyle?: StyleProp<ViewStyle>;
|
|
55
|
+
style?: StyleProp<ViewStyle>;
|
|
56
|
+
testID?: string;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Slides
|
|
60
|
+
* Carrusel con fondo propio (color plano o degradado) y contenido libre:
|
|
61
|
+
* `renderItem` decide si adentro va una imagen, texto o botones. El estado
|
|
62
|
+
* vive en `useSlides`; acá sólo está el árbol.
|
|
63
|
+
*
|
|
64
|
+
* El deslizamiento es un `ScrollView` con `pagingEnabled` en vez de gestos a
|
|
65
|
+
* mano: es lo único que da snap nativo en iOS y Android sin
|
|
66
|
+
* `react-native-gesture-handler`, en todo el rango soportado (Expo SDK 54–57).
|
|
67
|
+
*/
|
|
68
|
+
export declare function Slides<T>({ data, keyExtractor, renderItem, background, gradientDirection, orientation, indicators, indicatorPlacement, loop, autoPlay, interval, showAutoPlayToggle, spacing, index, defaultIndex, onIndexChange, height, swipeEnabled, slideStyle, style, testID, }: SlidesProps<T>): React.JSX.Element;
|
|
69
|
+
//# sourceMappingURL=Slides.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Slides.d.ts","sourceRoot":"","sources":["../../../src/organisms/Slides.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkC,MAAM,OAAO,CAAC;AACvD,OAAO,EAQL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAItB,OAAO,EAAY,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAa,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhE,YAAY,EAAE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C,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,6CAA6C;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oBAAoB;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,6EAA6E;IAC7E,UAAU,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAClC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAuHD;;;;;;;;;GASG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,EACxB,IAAI,EACJ,YAAY,EACZ,UAAU,EACV,UAAU,EACV,iBAA8B,EAC9B,WAA0B,EAC1B,UAAmB,EACnB,kBAA8B,EAC9B,IAAY,EACZ,QAAgB,EAChB,QAA2B,EAC3B,kBAAyB,EACzB,OAAW,EACX,KAAK,EACL,YAAgB,EAChB,aAAa,EACb,MAAuB,EACvB,YAAmB,EACnB,UAAU,EACV,KAAK,EACL,MAAM,GACP,EAAE,WAAW,CAAC,CAAC,CAAC,qBA6LhB"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
import type { IconName } from '../icons/types';
|
|
4
|
+
export type TimelineStatus = 'done' | 'pending';
|
|
5
|
+
/**
|
|
6
|
+
* Qué puede hacer un toque.
|
|
7
|
+
* - 'free': cualquier hito responde y la línea sigue a `items` para donde
|
|
8
|
+
* vaya, adelante o atrás. Es el que sirve cuando el recorrido no es un
|
|
9
|
+
* progreso, o cuando lo maneja otra cosa.
|
|
10
|
+
* - 'sequential': sólo responde el que sigue al alcanzado, y la línea no
|
|
11
|
+
* retrocede nunca. Avance estricto.
|
|
12
|
+
* - 'revisit': responden el que sigue y todos los ya alcanzados, y la línea
|
|
13
|
+
* tampoco retrocede. Es el caso de "puedo volver a mirar lo anterior sin
|
|
14
|
+
* perder lo que llevo".
|
|
15
|
+
*/
|
|
16
|
+
export type TimelineAdvance = 'free' | 'sequential' | 'revisit';
|
|
17
|
+
export interface TimelineItem {
|
|
18
|
+
label: string;
|
|
19
|
+
/** Glyph from the library's set, to the left of the label. */
|
|
20
|
+
iconName?: IconName;
|
|
21
|
+
/** Emoji to the left of the label. Wins over `iconName`. */
|
|
22
|
+
emoji?: string;
|
|
23
|
+
/** @default 'done' */
|
|
24
|
+
status?: TimelineStatus;
|
|
25
|
+
}
|
|
26
|
+
export interface TimelineProps {
|
|
27
|
+
items: TimelineItem[];
|
|
28
|
+
/** Pixels the line bows away from the straight path. 0 draws it straight. @default 28 */
|
|
29
|
+
curve?: number;
|
|
30
|
+
/** Vertical distance between one node and the next. @default 84 */
|
|
31
|
+
spacing?: number;
|
|
32
|
+
/** Side the first pill goes to; the rest alternate. @default 'right' */
|
|
33
|
+
startSide?: 'left' | 'right';
|
|
34
|
+
/** Halo behind each pill. @default true */
|
|
35
|
+
glow?: boolean;
|
|
36
|
+
/** Makes each pill tappable and reports its index. */
|
|
37
|
+
onItemPress?: (index: number) => void;
|
|
38
|
+
/**
|
|
39
|
+
* Which taps are allowed, and whether the line may go back. @default 'free'
|
|
40
|
+
*
|
|
41
|
+
* In 'sequential' and 'revisit' the line keeps the furthest point it has
|
|
42
|
+
* been asked to draw, so a parent that hands back a shorter `items` does not
|
|
43
|
+
* undo the progress. Swapping in a different list keeps it too — reset it by
|
|
44
|
+
* remounting (a `key`).
|
|
45
|
+
*/
|
|
46
|
+
advance?: TimelineAdvance;
|
|
47
|
+
/**
|
|
48
|
+
* The milestone being looked at right now, highlighted. It is not the
|
|
49
|
+
* progress: it can sit behind the line without pulling it back.
|
|
50
|
+
*/
|
|
51
|
+
selectedIndex?: number;
|
|
52
|
+
/**
|
|
53
|
+
* Milliseconds the line takes to travel one gap when a milestone is
|
|
54
|
+
* reached. @default 420
|
|
55
|
+
*/
|
|
56
|
+
duration?: number;
|
|
57
|
+
style?: StyleProp<ViewStyle>;
|
|
58
|
+
testID?: string;
|
|
59
|
+
}
|
|
60
|
+
export declare const Timeline: React.MemoExoticComponent<({ items, curve, spacing, startSide, glow, onItemPress, advance, selectedIndex, duration, style, testID, }: TimelineProps) => React.JSX.Element | null>;
|
|
61
|
+
//# sourceMappingURL=Timeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Timeline.d.ts","sourceRoot":"","sources":["../../../src/organisms/Timeline.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAChE,OAAO,EAAgC,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAM5F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,SAAS,CAAC;AAEhD;;;;;;;;;;GAUG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,YAAY,GAAG,SAAS,CAAC;AAEhE,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,4DAA4D;IAC5D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sBAAsB;IACtB,MAAM,CAAC,EAAE,cAAc,CAAC;CACzB;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,yFAAyF;IACzF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mEAAmE;IACnE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wEAAwE;IACxE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC7B,2CAA2C;IAC3C,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,sDAAsD;IACtD,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AA+FD,eAAO,MAAM,QAAQ,wIAahB,aAAa,8BAkSjB,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* El marco de Chart: todo lo que rodea a las marcas — grilla, ejes, leyenda y
|
|
3
|
+
* tooltip. Nada de acá conoce el tipo de chart; recibe números y textos ya
|
|
4
|
+
* resueltos.
|
|
5
|
+
*
|
|
6
|
+
* Gestalt: la grilla usa `border`, dos escalones por debajo del color de las
|
|
7
|
+
* series, para que el dato quede como figura y la referencia como fondo. La
|
|
8
|
+
* leyenda repite el color exacto de cada serie (similitud) y por eso puede
|
|
9
|
+
* hacer de control de filtro sin explicar qué apaga: se apaga lo que tiene ese
|
|
10
|
+
* color.
|
|
11
|
+
*/
|
|
12
|
+
import React from 'react';
|
|
13
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
14
|
+
import { type Point } from './math';
|
|
15
|
+
export interface CartesianGridProps {
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
/** Posición en píxeles de cada línea, sobre el eje perpendicular a ella. */
|
|
19
|
+
lines: number[];
|
|
20
|
+
/** 'horizontal' dibuja líneas que cruzan a lo ancho (eje y con ticks). */
|
|
21
|
+
orientation: 'horizontal' | 'vertical';
|
|
22
|
+
/** Índice de la línea del cero, más marcada que el resto. */
|
|
23
|
+
zeroIndex?: number;
|
|
24
|
+
testID?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare const CartesianGrid: React.MemoExoticComponent<({ width, height, lines, orientation, zeroIndex, testID }: CartesianGridProps) => React.JSX.Element>;
|
|
27
|
+
export interface AxisLabelsProps {
|
|
28
|
+
labels: {
|
|
29
|
+
text: string;
|
|
30
|
+
position: number;
|
|
31
|
+
}[];
|
|
32
|
+
/** 'x' las reparte a lo ancho debajo del plot; 'y' las apila a la izquierda. */
|
|
33
|
+
axis: 'x' | 'y';
|
|
34
|
+
/** Ancho del canal reservado para las etiquetas. */
|
|
35
|
+
gutter: number;
|
|
36
|
+
/** Tamaño del plot sobre el eje de las etiquetas. */
|
|
37
|
+
span: number;
|
|
38
|
+
testID?: string;
|
|
39
|
+
}
|
|
40
|
+
export declare const AxisLabels: React.MemoExoticComponent<({ labels, axis, gutter, span, testID }: AxisLabelsProps) => React.JSX.Element>;
|
|
41
|
+
export interface RadarGridProps {
|
|
42
|
+
center: Point;
|
|
43
|
+
radius: number;
|
|
44
|
+
angles: number[];
|
|
45
|
+
/** Anillos concéntricos, incluido el borde. */
|
|
46
|
+
levels: number;
|
|
47
|
+
testID?: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Anillos y radios del radar. Los anillos son polígonos, no círculos: un
|
|
51
|
+
* círculo sugiere que entre eje y eje hay valores, y no los hay — sólo hay
|
|
52
|
+
* los ejes que se pasaron.
|
|
53
|
+
*/
|
|
54
|
+
export declare const RadarGrid: React.MemoExoticComponent<({ center, radius, angles, levels, testID }: RadarGridProps) => React.JSX.Element | null>;
|
|
55
|
+
export interface LegendItem {
|
|
56
|
+
key: string;
|
|
57
|
+
label: string;
|
|
58
|
+
color: string;
|
|
59
|
+
}
|
|
60
|
+
export interface LegendProps {
|
|
61
|
+
items: LegendItem[];
|
|
62
|
+
hidden: string[];
|
|
63
|
+
/** Sin esto la leyenda es sólo referencia; con esto es el filtro. */
|
|
64
|
+
onToggle?: (key: string) => void;
|
|
65
|
+
testID?: string;
|
|
66
|
+
}
|
|
67
|
+
export declare const Legend: React.MemoExoticComponent<({ items, hidden, onToggle, testID }: LegendProps) => React.JSX.Element>;
|
|
68
|
+
export interface TooltipRow {
|
|
69
|
+
key: string;
|
|
70
|
+
label: string;
|
|
71
|
+
value: string;
|
|
72
|
+
color: string;
|
|
73
|
+
}
|
|
74
|
+
export interface TooltipProps {
|
|
75
|
+
title: string;
|
|
76
|
+
rows: TooltipRow[];
|
|
77
|
+
/** Punto que describe, en coordenadas del contenedor. */
|
|
78
|
+
anchor: Point;
|
|
79
|
+
/** Ancho disponible: el globo se corre para no salirse. */
|
|
80
|
+
containerWidth: number;
|
|
81
|
+
style?: StyleProp<ViewStyle>;
|
|
82
|
+
testID?: string;
|
|
83
|
+
}
|
|
84
|
+
export declare const Tooltip: React.MemoExoticComponent<({ title, rows, anchor, containerWidth, style, testID }: TooltipProps) => React.JSX.Element>;
|
|
85
|
+
//# sourceMappingURL=frame.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frame.d.ts","sourceRoot":"","sources":["../../../../src/organisms/chart/frame.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAe,MAAM,OAAO,CAAC;AACpC,OAAO,EAAgC,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAG5F,OAAO,EAAS,KAAK,KAAK,EAAE,MAAM,QAAQ,CAAC;AAyD3C,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,0EAA0E;IAC1E,WAAW,EAAE,YAAY,GAAG,UAAU,CAAC;IACvC,6DAA6D;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,aAAa,uFAAmE,kBAAkB,uBAyB7G,CAAC;AAGH,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC7C,gFAAgF;IAChF,IAAI,EAAE,GAA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,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AASD,eAAO,MAAM,OAAO,qFAAiE,YAAY,uBAmC/F,CAAC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Las marcas de Chart: lo único que sabe dibujar el componente.
|
|
3
|
+
*
|
|
4
|
+
* React Native no trae un lienzo vectorial y la librería no puede agregar uno
|
|
5
|
+
* (cero dependencias), así que las tres primitivas de acá se componen con
|
|
6
|
+
* `View` y bastan para los seis tipos de chart:
|
|
7
|
+
*
|
|
8
|
+
* | primitiva | la usan |
|
|
9
|
+
* |------------|-----------------------------------------------------|
|
|
10
|
+
* | `Bar` | barras verticales y horizontales, agrupadas o apiladas |
|
|
11
|
+
* | `Polyline` | línea, contorno del radar, grilla del radar, ejes |
|
|
12
|
+
* | `Wedge` | torta, dona y el relleno del radar |
|
|
13
|
+
*
|
|
14
|
+
* Son puras: no escuchan toques ni conocen la escala. Quien toca es la capa de
|
|
15
|
+
* hit-test de Chart.tsx, que cubre columnas enteras en vez de la marca —
|
|
16
|
+
* una línea de 2px no es un blanco táctil.
|
|
17
|
+
*/
|
|
18
|
+
import React from 'react';
|
|
19
|
+
import { Animated } from 'react-native';
|
|
20
|
+
import { type Point } from './math';
|
|
21
|
+
/**
|
|
22
|
+
* Valor que persigue a `target` en vez de saltar. Un filtro que cambia los
|
|
23
|
+
* datos mueve la barra desde donde estaba, y ese movimiento es lo que dice
|
|
24
|
+
* "es la misma barra con otro número" en lugar de "es otro chart".
|
|
25
|
+
*/
|
|
26
|
+
export declare function useAnimatedNumber(target: number, animate: boolean, duration: number): Animated.Value;
|
|
27
|
+
export interface BarProps {
|
|
28
|
+
/** Caja final de la barra dentro del plot, ya en píxeles. */
|
|
29
|
+
x: number;
|
|
30
|
+
y: number;
|
|
31
|
+
width: number;
|
|
32
|
+
height: number;
|
|
33
|
+
color: string;
|
|
34
|
+
/** Lado por donde nace: la barra crece desde su base, no desde el centro. */
|
|
35
|
+
from: 'bottom' | 'top' | 'left' | 'right';
|
|
36
|
+
/** Radio de las dos esquinas del extremo libre. */
|
|
37
|
+
radius?: number;
|
|
38
|
+
/** Atenúa las barras que no son la seleccionada. */
|
|
39
|
+
dim?: boolean;
|
|
40
|
+
animate?: boolean;
|
|
41
|
+
duration?: number;
|
|
42
|
+
testID?: string;
|
|
43
|
+
}
|
|
44
|
+
export declare const Bar: React.MemoExoticComponent<({ x, y, width, height, color, from, radius, dim, animate, duration, testID }: BarProps) => React.JSX.Element>;
|
|
45
|
+
export interface PolylineProps {
|
|
46
|
+
points: Point[];
|
|
47
|
+
color: string;
|
|
48
|
+
thickness?: number;
|
|
49
|
+
/** Une el último punto con el primero (radar, grilla poligonal). */
|
|
50
|
+
closed?: boolean;
|
|
51
|
+
opacity?: number;
|
|
52
|
+
testID?: string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Una línea es un rectángulo fino rotado sobre su centro, uno por tramo. Con
|
|
56
|
+
* `smoothPoints` los tramos son tantos que la poligonal se lee como curva.
|
|
57
|
+
*
|
|
58
|
+
* Los extremos quedan a tope, no redondeados: un `borderRadius` por tramo
|
|
59
|
+
* multiplicaría las vistas y a 2px de grosor nadie ve la diferencia.
|
|
60
|
+
*/
|
|
61
|
+
export declare const Polyline: React.MemoExoticComponent<({ points, color, thickness, closed, opacity, testID }: PolylineProps) => React.JSX.Element | null>;
|
|
62
|
+
export interface DotProps {
|
|
63
|
+
point: Point;
|
|
64
|
+
color: string;
|
|
65
|
+
size?: number;
|
|
66
|
+
/** Aro del color del fondo: despega el punto de la línea que lo cruza. */
|
|
67
|
+
ringColor?: string;
|
|
68
|
+
ringWidth?: number;
|
|
69
|
+
testID?: string;
|
|
70
|
+
}
|
|
71
|
+
export declare const Dot: React.MemoExoticComponent<({ point, color, size, ringColor, ringWidth, testID }: DotProps) => React.JSX.Element>;
|
|
72
|
+
export interface WedgeProps {
|
|
73
|
+
/** Diámetro: la porción se dibuja centrada en una caja `size` × `size`. */
|
|
74
|
+
size: number;
|
|
75
|
+
/** Ángulo donde empieza, 0° arriba y creciendo en horario. */
|
|
76
|
+
start: number;
|
|
77
|
+
/** Apertura, 0–360. */
|
|
78
|
+
sweep: number;
|
|
79
|
+
color: string;
|
|
80
|
+
opacity?: number;
|
|
81
|
+
/** Desplaza la porción hacia afuera por su bisectriz (la seleccionada). */
|
|
82
|
+
explode?: number;
|
|
83
|
+
/** Centro dentro del contenedor. Sin él la porción se apoya en (0, 0). */
|
|
84
|
+
center?: Point;
|
|
85
|
+
testID?: string;
|
|
86
|
+
}
|
|
87
|
+
export declare const Wedge: React.MemoExoticComponent<({ size, start, sweep, color, opacity, explode, center, testID }: WedgeProps) => React.JSX.Element | null>;
|
|
88
|
+
//# sourceMappingURL=marks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marks.d.ts","sourceRoot":"","sources":["../../../../src/organisms/chart/marks.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAkC,MAAM,OAAO,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAgC,MAAM,cAAc,CAAC;AACtE,OAAO,EAAc,KAAK,KAAK,EAAE,MAAM,QAAQ,CAAC;AAEhD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAC,KAAK,CAsBpG;AAID,MAAM,WAAW,QAAQ;IACvB,6DAA6D;IAC7D,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,6EAA6E;IAC7E,IAAI,EAAE,QAAQ,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,CAAC;IAC1C,mDAAmD;IACnD,MAAM,CAAC,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AAID,eAAO,MAAM,KAAK,8FAAkF,UAAU,8BAmC5G,CAAC"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Geometría y escalas de Chart: todo lo que se puede probar sin montar un
|
|
3
|
+
* árbol vive acá, sin React y sin dependencias. marks.tsx sólo traduce estos
|
|
4
|
+
* números a estilos, y Chart.tsx sólo decide qué marca dibujar.
|
|
5
|
+
*
|
|
6
|
+
* Convenciones:
|
|
7
|
+
* - Coordenadas de React Native: origen arriba-izquierda, `y` crece hacia abajo.
|
|
8
|
+
* - Ángulos en grados, 0° a las 12 en punto, creciendo en sentido horario —
|
|
9
|
+
* que es como se lee una torta y como gira `transform: rotate` en RN.
|
|
10
|
+
*/
|
|
11
|
+
export interface Point {
|
|
12
|
+
x: number;
|
|
13
|
+
y: number;
|
|
14
|
+
}
|
|
15
|
+
/** Fila de datos: una categoría del eje x y un número por serie. */
|
|
16
|
+
export type ChartRow = Record<string, string | number | null | undefined>;
|
|
17
|
+
/** Lee una celda como número, o null si no lo es (hueco en la serie). */
|
|
18
|
+
export declare function toNumber(value: unknown): number | null;
|
|
19
|
+
export declare function clamp(value: number, min: number, max: number): number;
|
|
20
|
+
/**
|
|
21
|
+
* El 1, 2, 5 o 10 (por su potencia de diez) más cercano por encima de `rough`.
|
|
22
|
+
* Es lo que hace que los ticks caigan en números que alguien diría en voz
|
|
23
|
+
* alta — 0, 250, 500 — y no en 0, 237, 474.
|
|
24
|
+
*/
|
|
25
|
+
export declare function niceStep(rough: number): number;
|
|
26
|
+
export interface Ticks {
|
|
27
|
+
/** Extremo inferior redondeado hacia afuera. */
|
|
28
|
+
min: number;
|
|
29
|
+
/** Extremo superior redondeado hacia afuera. */
|
|
30
|
+
max: number;
|
|
31
|
+
step: number;
|
|
32
|
+
values: number[];
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Dominio redondeado a valores legibles más la lista de ticks. `count` es una
|
|
36
|
+
* intención, no una promesa: redondear hacia afuera puede dar uno más o uno
|
|
37
|
+
* menos, y eso es preferible a un eje con números arbitrarios.
|
|
38
|
+
*/
|
|
39
|
+
export declare function niceScale(min: number, max: number, count?: number): Ticks;
|
|
40
|
+
/**
|
|
41
|
+
* Ticks de un dominio que el consumidor fijó a mano. No redondea nada: si
|
|
42
|
+
* alguien pide 0–100, el eje dice 0–100. Es lo contrario de `niceScale`, y es
|
|
43
|
+
* lo que necesita un chart en vivo — un eje que se reacomoda en cada tick hace
|
|
44
|
+
* saltar la línea aunque el dato no se haya movido.
|
|
45
|
+
*/
|
|
46
|
+
export declare function exactTicks(min: number, max: number, count?: number): Ticks;
|
|
47
|
+
/**
|
|
48
|
+
* Une dos dominios quedándose con el más ancho. Es el modo 'sticky': el eje
|
|
49
|
+
* crece cuando llega un valor que no entraba y no se vuelve a achicar, así
|
|
50
|
+
* que lo que se ve moverse es el dato y no la escala.
|
|
51
|
+
*/
|
|
52
|
+
export declare function growExtent(previous: [number, number] | null, next: [number, number]): [number, number];
|
|
53
|
+
/** Interpolador lineal dominio → rango. Dominio degenerado cae al medio del rango. */
|
|
54
|
+
export declare function linearScale(domain: [number, number], range: [number, number]): (value: number) => number;
|
|
55
|
+
export interface ExtentOptions {
|
|
56
|
+
/** Las series se suman en vez de compararse (barras/áreas apiladas). */
|
|
57
|
+
stacked?: boolean;
|
|
58
|
+
/** Fuerza el 0 adentro del dominio: sin él, una barra corta miente. */
|
|
59
|
+
includeZero?: boolean;
|
|
60
|
+
}
|
|
61
|
+
/** Mínimo y máximo de las series pedidas. Sin datos devuelve [0, 1]. */
|
|
62
|
+
export declare function extent(rows: ChartRow[], keys: string[], options?: ExtentOptions): [number, number];
|
|
63
|
+
export interface StackBand {
|
|
64
|
+
key: string;
|
|
65
|
+
/** Borde de la banda más cerca del cero. */
|
|
66
|
+
from: number;
|
|
67
|
+
/** Borde más lejos del cero. */
|
|
68
|
+
to: number;
|
|
69
|
+
value: number;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Bandas apiladas de una fila. Los positivos crecen desde 0 hacia arriba y
|
|
73
|
+
* los negativos desde 0 hacia abajo: una serie negativa no le come el alto a
|
|
74
|
+
* las positivas, que es lo que pasa si se apila todo en un solo acumulador.
|
|
75
|
+
*/
|
|
76
|
+
export declare function stackRow(row: ChartRow, keys: string[]): StackBand[];
|
|
77
|
+
/** Punto a `radius` del centro en el ángulo dado (0° arriba, horario). */
|
|
78
|
+
export declare function polar(center: Point, radius: number, angle: number): Point;
|
|
79
|
+
/** Ángulo de un punto respecto del centro, normalizado a [0, 360). */
|
|
80
|
+
export declare function angleOf(center: Point, point: Point): number;
|
|
81
|
+
export interface Arc {
|
|
82
|
+
/** Índice de la fila que representa. */
|
|
83
|
+
index: number;
|
|
84
|
+
start: number;
|
|
85
|
+
sweep: number;
|
|
86
|
+
value: number;
|
|
87
|
+
/** Proporción sobre el total, 0–1. */
|
|
88
|
+
ratio: number;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Arcos de una torta. Los negativos no existen en una torta (no hay "menos
|
|
92
|
+
* porción"): se descartan en vez de invertirse. Total 0 ⇒ nada que dibujar.
|
|
93
|
+
*/
|
|
94
|
+
export declare function arcsFor(values: number[]): Arc[];
|
|
95
|
+
/** El arco que contiene ese ángulo, o -1. */
|
|
96
|
+
export declare function arcAt(arcs: Arc[], angle: number): number;
|
|
97
|
+
/** Ángulos de los ejes de un radar: el primero arriba, el resto en reparto parejo. */
|
|
98
|
+
export declare function radarAngles(count: number): number[];
|
|
99
|
+
export interface SegmentBox {
|
|
100
|
+
left: number;
|
|
101
|
+
top: number;
|
|
102
|
+
width: number;
|
|
103
|
+
height: number;
|
|
104
|
+
/** Grados para `transform: [{ rotate }]`. */
|
|
105
|
+
rotate: number;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Caja de un segmento a→b: sin SVG, una línea es un rectángulo fino rotado
|
|
109
|
+
* sobre su centro. Ancho = distancia, alto = grosor, rotación = la pendiente.
|
|
110
|
+
*/
|
|
111
|
+
export declare function segmentBox(a: Point, b: Point, thickness: number): SegmentBox;
|
|
112
|
+
/**
|
|
113
|
+
* Suaviza una polilínea con Catmull-Rom muestreada en `steps` tramos por vano.
|
|
114
|
+
* La curva pasa por todos los puntos originales (a diferencia de un Bézier de
|
|
115
|
+
* control libre), así que el dato sigue siendo el dato; sólo se agrega camino
|
|
116
|
+
* entre medio, y el resultado se dibuja con los mismos segmentos rectos.
|
|
117
|
+
*/
|
|
118
|
+
export declare function smoothPoints(points: Point[], steps?: number): Point[];
|
|
119
|
+
/**
|
|
120
|
+
* `y` de la polilínea en esa `x`, o null si cae fuera. Es lo que convierte una
|
|
121
|
+
* línea en área: cada tira vertical pregunta su alto acá.
|
|
122
|
+
*/
|
|
123
|
+
export declare function sampleY(points: Point[], x: number): number | null;
|
|
124
|
+
/**
|
|
125
|
+
* Formato por defecto de ejes y tooltip: compacto, porque un eje de un chart
|
|
126
|
+
* de 320px no tiene lugar para "1250000". El consumidor lo reemplaza entero
|
|
127
|
+
* con `formatValue`.
|
|
128
|
+
*/
|
|
129
|
+
export declare function formatNumber(value: number): string;
|
|
130
|
+
export interface FanStrip {
|
|
131
|
+
start: number;
|
|
132
|
+
sweep: number;
|
|
133
|
+
radius: number;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Descompone un polígono alrededor de un centro en porciones angulares: es lo
|
|
137
|
+
* que permite rellenar un radar con la misma primitiva que dibuja una torta.
|
|
138
|
+
*
|
|
139
|
+
* El corte va por el lado del polígono (parámetro `t`), no por el ángulo: el
|
|
140
|
+
* radio de una cuerda no es lineal en el ángulo, y cortando por ángulo los
|
|
141
|
+
* vértices quedarían redondeados justo donde el dato manda que haya una punta.
|
|
142
|
+
*/
|
|
143
|
+
export declare function fanStrips(center: Point, points: Point[], steps?: number): FanStrip[];
|
|
144
|
+
/**
|
|
145
|
+
* LTTB (Largest-Triangle-Three-Buckets): elige `threshold` puntos de `values`
|
|
146
|
+
* quedándose con la forma de la curva. Devuelve índices, no puntos, para que
|
|
147
|
+
* quien llama pueda conservar la fila entera —todas sus series— y no sólo la
|
|
148
|
+
* que se usó para decidir.
|
|
149
|
+
*
|
|
150
|
+
* Por qué no un muestreo cada N: cada N se come los picos, que son justo lo
|
|
151
|
+
* que alguien mira en una serie temporal. LTTB parte el recorrido en baldes y
|
|
152
|
+
* de cada uno se queda con el punto que forma el triángulo más grande con el
|
|
153
|
+
* ya elegido y con el promedio del balde siguiente — o sea, con el que más
|
|
154
|
+
* cambia la silueta. Primero y último se conservan siempre.
|
|
155
|
+
*
|
|
156
|
+
* `x` es el índice: las categorías de un chart están repartidas parejo sobre
|
|
157
|
+
* el eje, así que la distancia horizontal entre dos puntos es su distancia de
|
|
158
|
+
* índice.
|
|
159
|
+
*/
|
|
160
|
+
export declare function lttbIndices(values: (number | null)[], threshold: number): number[];
|
|
161
|
+
//# sourceMappingURL=math.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"math.d.ts","sourceRoot":"","sources":["../../../../src/organisms/chart/math.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,WAAW,KAAK;IACpB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,oEAAoE;AACpE,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;AAE1E,yEAAyE;AACzE,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAEtD;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAErE;AASD;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAM9C;AAED,MAAM,WAAW,KAAK;IACpB,gDAAgD;IACh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AqBhE;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAYjE;AAMD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAWlD;AAED,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,KAAK,SAAI,GAAG,QAAQ,EAAE,CA6B/E;AAID;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CA+ClF"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Theme } from '../../theme/types';
|
|
2
|
+
/** Contraste mínimo de un objeto gráfico contra su fondo (WCAG 1.4.11). */
|
|
3
|
+
export declare const GRAPHIC_CONTRAST = 3;
|
|
4
|
+
/** `count` colores estables para las series: el mismo índice da siempre el mismo color. */
|
|
5
|
+
export declare function seriesPalette(theme: Theme, count: number): string[];
|
|
6
|
+
//# sourceMappingURL=palette.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"palette.d.ts","sourceRoot":"","sources":["../../../../src/organisms/chart/palette.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE/C,2EAA2E;AAC3E,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAqFlC,2FAA2F;AAC3F,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAMnE"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
export { Timeline } from './Timeline';
|
|
2
|
+
export type { TimelineProps, TimelineItem, TimelineStatus, TimelineAdvance } from './Timeline';
|
|
1
3
|
export { Modal } from './Modal';
|
|
2
4
|
export type { ModalProps, ModalVariant } from './Modal';
|
|
3
5
|
export { BottomSheet } from './BottomSheet';
|
|
4
6
|
export type { BottomSheetProps, FooterPlacement } from './BottomSheet';
|
|
7
|
+
export { OptionWheel } from './OptionWheel';
|
|
8
|
+
export type { OptionWheelProps, OptionWheelOption, OptionWheelVariant } from './OptionWheel';
|
|
5
9
|
export { Select } from './Select';
|
|
6
10
|
export type { SelectProps, SelectOption } from './Select';
|
|
7
11
|
export { Alert } from './Alert';
|
|
@@ -30,4 +34,8 @@ export { NavigationBar } from './NavigationBar';
|
|
|
30
34
|
export type { NavigationBarProps, NavigationBarItem } from './NavigationBar';
|
|
31
35
|
export { ReorderableList } from './ReorderableList';
|
|
32
36
|
export type { ReorderableListProps } from './ReorderableList';
|
|
37
|
+
export { Slides } from './Slides';
|
|
38
|
+
export type { SlidesProps, SlidesOrientation, SlidesIndicators, SlidesIndicatorPlacement, SlideBackground, } from './Slides';
|
|
39
|
+
export { Chart } from './Chart';
|
|
40
|
+
export type { ChartProps, ChartType, ChartSeries, ChartRow, ChartFilter, ChartFilterOption, ChartSelection, } from './Chart';
|
|
33
41
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organisms/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,MAAM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kB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EACV,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,wBAAwB,EACxB,eAAe,GAChB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,YAAY,EACV,UAAU,EACV,SAAS,EACT,WAAW,EACX,QAAQ,EACR,WAAW,EACX,iBAAiB,EACjB,cAAc,GACf,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { LayoutChangeEvent, NativeScrollEvent, NativeSyntheticEvent, ScrollView } from 'react-native';
|
|
2
|
+
export type SlidesOrientation = 'horizontal' | 'vertical';
|
|
3
|
+
export interface UseSlidesOptions {
|
|
4
|
+
total: number;
|
|
5
|
+
orientation: SlidesOrientation;
|
|
6
|
+
loop: boolean;
|
|
7
|
+
autoPlay: boolean;
|
|
8
|
+
interval: number;
|
|
9
|
+
/** Índice controlado; sin él manda el estado interno. */
|
|
10
|
+
index?: number;
|
|
11
|
+
defaultIndex: number;
|
|
12
|
+
onIndexChange?: (index: number) => void;
|
|
13
|
+
}
|
|
14
|
+
/** Una página del scroll. Los clones del modo infinito repiten el `real` de un vecino. */
|
|
15
|
+
export interface SlidesPage {
|
|
16
|
+
real: number;
|
|
17
|
+
clone: 'head' | 'tail' | null;
|
|
18
|
+
}
|
|
19
|
+
export interface UseSlidesResult {
|
|
20
|
+
active: number;
|
|
21
|
+
pages: SlidesPage[];
|
|
22
|
+
isHorizontal: boolean;
|
|
23
|
+
isLoop: boolean;
|
|
24
|
+
size: {
|
|
25
|
+
width: number;
|
|
26
|
+
height: number;
|
|
27
|
+
};
|
|
28
|
+
/** Largo de una página sobre el eje del scroll. En 0 todavía no se midió. */
|
|
29
|
+
pageSize: number;
|
|
30
|
+
scrollRef: React.RefObject<ScrollView | null>;
|
|
31
|
+
autoPlayPaused: boolean;
|
|
32
|
+
/** El sistema pidió reducir movimiento: no hay autoPlay ni transiciones. */
|
|
33
|
+
motionReduced: boolean;
|
|
34
|
+
goTo: (index: number) => void;
|
|
35
|
+
toggleAutoPlay: () => void;
|
|
36
|
+
onLayout: (event: LayoutChangeEvent) => void;
|
|
37
|
+
onMomentumScrollEnd: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
|
|
38
|
+
onScrollBeginDrag: () => void;
|
|
39
|
+
onScrollEndDrag: () => void;
|
|
40
|
+
}
|
|
41
|
+
export declare function clampIndex(value: number, total: number): number;
|
|
42
|
+
/**
|
|
43
|
+
* useSlides
|
|
44
|
+
* Todo lo que en `Slides` no se ve: qué página está encuadrada, cuándo mover el
|
|
45
|
+
* scroll, cómo se mapean los clones del modo infinito a índices reales, y el
|
|
46
|
+
* reloj del avance automático.
|
|
47
|
+
*
|
|
48
|
+
* Trabaja sólo con índices, nunca con los ítems: así no necesita el genérico
|
|
49
|
+
* `T` del componente, y el UI resuelve `pages[i].real` contra su propio `data`.
|
|
50
|
+
*/
|
|
51
|
+
export declare function useSlides({ total, orientation, loop, autoPlay, interval, index, defaultIndex, onIndexChange, }: UseSlidesOptions): UseSlidesResult;
|
|
52
|
+
//# sourceMappingURL=useSlides.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSlides.d.ts","sourceRoot":"","sources":["../../../src/organisms/useSlides.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG3G,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG,UAAU,CAAC;AAE1D,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,W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M,GAAG,MAAM,CAK/D;AAED;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,WAAW,EACX,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,YAAY,EACZ,aAAa,GACd,EAAE,gBAAgB,GAAG,eAAe,CAsJpC"}
|
package/llms.txt
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
# orn-ui
|
|
2
2
|
|
|
3
|
-
> React Native / Expo component library:
|
|
4
|
-
> organisms), light/dark theming, zero runtime dependencies (
|
|
5
|
-
> `react-native`
|
|
3
|
+
> React Native / Expo component library: 50 typed components (atoms, molecules,
|
|
4
|
+
> organisms), light/dark theming, zero runtime dependencies (`react`,
|
|
5
|
+
> `react-native` and `react-native-safe-area-context` are the only peers).
|
|
6
|
+
> Verified in CI against Expo SDK 54, 55, 56 and 57.
|
|
6
7
|
> Built to be used by AI coding agents: one component replaces dozens of lines
|
|
7
8
|
> of hand-written `View`/`Text`/`StyleSheet`, so a screen costs a fraction of
|
|
8
9
|
> the tokens and ships production-ready instead of prototype-only.
|
|
@@ -27,7 +28,7 @@ Wrap the app once: `<SafeAreaUIProvider defaultMode="system">` from `orn-ui/safe
|
|
|
27
28
|
|
|
28
29
|
## Components
|
|
29
30
|
|
|
30
|
-
- Atoms: Title, Subtitle, Body, Caption, Button, IconButton, Input, Checkbox, Badge, Card, Divider, Avatar, Image, Spinner, Skeleton, Transition, EmptyState, KeyValueRow, Fab, PressableScale
|
|
31
|
+
- Atoms: Title, Subtitle, Body, Caption, Button, IconButton, Input, Checkbox, Badge, Card, Divider, Gradient, Avatar, Image, Spinner, Skeleton, Transition, ShinyText, EmptyState, KeyValueRow, Fab, PressableScale
|
|
31
32
|
- Molecules: Stepper, OptionCard, InfoRow, FormActions, AvatarHeader, SegmentedControl, Steps, SymmetricGrid
|
|
32
|
-
- Organisms: Screen, Modal, BottomSheet, Select, List, SearchList, ReorderableList, Alert, AlertProvider, Toast, ToastProvider, DatePicker, DateField, Wizard, ThemeToggle, NavigationBar
|
|
33
|
+
- Organisms: Screen, Modal, BottomSheet, Select, OptionWheel, Timeline, List, SearchList, ReorderableList, Slides, Chart, Alert, AlertProvider, Toast, ToastProvider, DatePicker, DateField, Wizard, ThemeToggle, NavigationBar
|
|
33
34
|
- Theme: UIProvider, SafeAreaUIProvider, createTheme, createStyles, useTheme, useColors, useThemeMode, useIcons, useInsets, useLabels
|