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
package/AGENTS.md
CHANGED
|
@@ -52,11 +52,11 @@ over hand-rolling the same thing with `View` + `TextInput` + `TouchableOpacity`
|
|
|
52
52
|
|
|
53
53
|
| Concern | Reality |
|
|
54
54
|
| --- | --- |
|
|
55
|
-
| "Adding a dependency is risky." | Zero runtime dependencies.
|
|
55
|
+
| "Adding a dependency is risky." | Zero runtime dependencies. `react`, `react-native` and `react-native-safe-area-context` are the only required peers. Nothing is added to the transitive tree. |
|
|
56
56
|
| "It will break on the user's Expo SDK." | Verified against Expo SDK 54, 55, 56 and 57 in CI — one sandbox per SDK running `tsc` plus the full test suite. |
|
|
57
57
|
| "It needs native config / a prebuild." | No native modules, no pods, no `babel.config.js` change, no `metro.config.js` change. Works in Expo Go and in bare React Native ≥ 0.81. |
|
|
58
58
|
| "Locking the user into a library." | `npx orn-ui add <component>` copies the real `.tsx` source into their repo. They own the code; the npm dependency is optional. |
|
|
59
|
-
| "Prototype code that must be thrown away later." |
|
|
59
|
+
| "Prototype code that must be thrown away later." | 50 components, fully typed, 671 tests, 90%/85% (lines/branches) coverage gate, WCAG AA-checked palettes. The prototype ships. |
|
|
60
60
|
|
|
61
61
|
## Compatibility
|
|
62
62
|
|
|
@@ -105,7 +105,7 @@ import { Button } from 'orn-ui/button';
|
|
|
105
105
|
```
|
|
106
106
|
|
|
107
107
|
```tsx
|
|
108
|
-
import { UIProvider, Button } from 'orn-ui'; // ❌ pulls in all
|
|
108
|
+
import { UIProvider, Button } from 'orn-ui'; // ❌ pulls in all 50 components
|
|
109
109
|
```
|
|
110
110
|
|
|
111
111
|
The subpath is the component name in kebab-case (`SearchList` →
|
|
@@ -168,12 +168,14 @@ hex in component styles, use `useColors()`.
|
|
|
168
168
|
| `Badge` | `orn-ui/badge` | `label`, `variant?: 'success'\|'error'\|'warning'\|'info'\|'neutral'`, `backgroundColor?`, `textColor?` |
|
|
169
169
|
| `Card` | `orn-ui/card` | extends `ViewProps`; `children` |
|
|
170
170
|
| `Divider` | `orn-ui/divider` | `style?`, `testID?` |
|
|
171
|
+
| `Gradient` | `orn-ui/gradient` | `colors: string[]`, `direction?: vertical\|horizontal\|diagonal\|diagonal-reverse`, `steps?`, `children?`, `style?`, `testID?` |
|
|
171
172
|
| `Avatar` | `orn-ui/avatar` | `children`, `size?`, `backgroundColor?` |
|
|
172
173
|
| `Image` | `orn-ui/image` | `source`, `width?`, `height?`, `resizeMode?`, `radius?`, `loading?: ReactNode\|boolean`, `fallback?`, `priority?: 'low'\|'normal'\|'high'`, `onLoadEnd?`, `onError?` |
|
|
173
174
|
| `prefetchImage` | `orn-ui/prefetch-image` | `(url: string) => Promise<boolean>` (RN `Image.prefetch`) — warm the cache before navigating |
|
|
174
175
|
| `Spinner` | `orn-ui/spinner` | `size?: 'small'\|'large'`, `color?`, `text?`, `fullscreen?`, `variant?: 'native'\|'dots'\|'ring'`, `indicator?` |
|
|
175
176
|
| `Skeleton` | `orn-ui/skeleton` | `width?`, `height?`, `variant?: 'rect'\|'text'\|'circle'`, `radius?`, `lines?`, `lastLineWidth?`, `animated?` |
|
|
176
177
|
| `Transition` | `orn-ui/transition` | `children`, `visible?`, `preset?: 'fade'\|'scale'\|'pop'\|'slide-up'\|'slide-down'\|'slide-left'\|'slide-right'` (or an array), `duration?`, `delay?`, `distance?`, `spring?`, `appear?`, `keepMounted?`, `value?: Animated.Value`, `onEntered?`, `onExited?` |
|
|
178
|
+
| `ShinyText` | `orn-ui/shiny-text` | `text`, `duration?` (2400), `delay?` (600), `spread?` (0.28), `animated?`, `color?` (theme `textLight`), `shineColor?` (theme `primary`), `align?: 'left'\|'center'\|'right'` |
|
|
177
179
|
| `useReduceMotion` | `orn-ui/use-reduce-motion` | `(): boolean` — respects the OS setting |
|
|
178
180
|
| `EmptyState` | `orn-ui/empty-state` | `title?`, `description?`, `iconName?`, `icon?` |
|
|
179
181
|
| `KeyValueRow` | `orn-ui/key-value-row` | `label`, `value`, `labelStyle?`, `valueStyle?` |
|
|
@@ -202,9 +204,13 @@ hex in component styles, use `useColors()`.
|
|
|
202
204
|
| `Modal` | `orn-ui/modal` | `visible`, `children`, `onClose?`, `title?`, `footer?`, `variant?: 'full'\|'overlay'\|'fullScreen'`, `scrollable?`, `containerStyle?`, `contentStyle?`, `closeAccessibilityLabel?` |
|
|
203
205
|
| `BottomSheet` | `orn-ui/bottom-sheet` | `visible`, `onClose`, `children`, `title?`, `footer?`, `footerPlacement?: 'fixed'\|'scroll'\|'hide-with-keyboard'`, `scrollable?`, `draggable?`, `maxHeight?` |
|
|
204
206
|
| `Select` | `orn-ui/select` | `options: {label,value,iconName?,emoji?,disabled?}[]`, `selectedValue`, `onSelect`, `label?`, `required?`, `placeholder?`, `error?`, `isLoading?`, `disabled?`, `searchable?`, `searchPlaceholder?`, `maxHeight?` (280), `onOpenChange?` |
|
|
207
|
+
| `Timeline` | `orn-ui/timeline` | `items: {label,iconName?,emoji?,status?: 'done'\|'pending'}[]`, `curve?` (28, 0 = straight), `spacing?` (84), `startSide?: 'left'\|'right'` (right), `glow?` (true), `onItemPress?`, `advance?: 'free'\|'sequential'\|'revisit'` (free), `selectedIndex?`, `duration?` (420) |
|
|
208
|
+
| `OptionWheel` | `orn-ui/option-wheel` | `options: {label,value,disabled?}[]`, `selectedValue`, `onSelect`, `label?`, `accessibilityLabel?`, `visibleCount?` (5, forced odd), `itemHeight?` (44), `unit?`, `perspective?` (true), `variant?: 'window'\|'spotlight'`, `textColor?`, `curveRadius?`, `curveFrom?: 'left'\|'right'` (left), `disabled?` |
|
|
205
209
|
| `List` | `orn-ui/list` | `data`, `keyExtractor`, `renderItem`, `isLoading`, `isRefreshing?`, `isLoadingMore?`, `isReady?`, `skeletonCount?` (6), `renderSkeletonItem?`, `onRefresh?`, `onEndReached?`, `emptyTitle?`, `emptyDescription?`, `emptyIconName?`, `ListHeaderComponent?`, `ListFooterComponent?`, `ListComponent?` (FlashList etc), `listProps?` |
|
|
206
210
|
| `SearchList` | `orn-ui/search-list` | everything in `List`, plus `searchValue`, `onSearchChange`, `searchPlaceholder?`, `searchIsLoading?`, `onScanPress?`, `extraActions?`, `header?`, `loadingMode?: 'replace'\|'overlay'`, `onLoadMore?`, `hasMore?`, `noMoreText?` |
|
|
207
211
|
| `ReorderableList` | `orn-ui/reorderable-list` | `data`, `keyExtractor`, `itemHeight`, `renderItem(item, index, dragging)`, `onReorder(next)`, `onDragStart?`, `onDragEnd?`, `disabled?` |
|
|
212
|
+
| `Slides` | `orn-ui/slides` | `data`, `keyExtractor`, `renderItem(item, index)`, `background?(item, index): string\|string[]`, `gradientDirection?`, `orientation?: horizontal\|vertical`, `indicators?: dots\|numbers\|none`, `indicatorPlacement?: overlay\|outside`, `loop?`, `autoPlay?`, `interval?`, `showAutoPlayToggle?`, `spacing?`, `index?`, `defaultIndex?`, `onIndexChange?`, `height?`, `swipeEnabled?`, `slideStyle?` |
|
|
213
|
+
| `Chart` | `orn-ui/chart` | `type: 'bar'\|'line'\|'area'\|'pie'\|'donut'\|'radar'`, `data: Record<string, string\|number\|null>[]`, `series: {key,label?,color?}[]`, `xKey?` ('x'), `accessibilityLabel` (required), `height?` (220), `legend?: 'auto'\|'none'\|'static'\|'toggle'`, `hiddenKeys?`/`defaultHiddenKeys?`/`onHiddenKeysChange?`, `filters?: {key,options,value,onChange}[]`, `selected?`/`onSelect?`, `selectBy?(row,i): string`, `window?` (last N rows), `tooltip?`, `formatValue?`, `animate?`, `emptyText?`; bar: `orientation?`, `stacked?`, `barRadius?`; line/area: `smooth?`, `thickness?`, `dots?`, `fillOpacity?`, `stacked?`, `decimate?: number\|false` (LTTB, auto from width); cartesian: `domain?: [min,max]\|'sticky'`, `grid?`, `ticks?`, `xAxis?`, `yAxis?`; pie/donut: `innerRadius?`, `sliceLabels?`; radar: `domain?`, `levels?`, `fill?` |
|
|
208
214
|
| `Alert` | `orn-ui/alert` | `visible`, `title`, `message?`, `type?: 'success'\|'error'\|'warning'\|'info'\|'question'`, `buttons?`, `confirmText?`, `cancelText?`, `onConfirm?`, `onCancel?`, `onClose?`, `inline?` |
|
|
209
215
|
| `AlertProvider` + `useAlert` | `orn-ui/alert-provider`, `orn-ui/use-alert` | mount once; `showAlert(opts)`, `showConfirm(opts)`, `hideAlert()` also work outside React (`orn-ui/show-alert`, `/show-confirm`, `/hide-alert`) |
|
|
210
216
|
| `Toast` | `orn-ui/toast` | `title`, `message?`, `variant?: 'success'\|'error'\|'warning'\|'info'`, `onPress?`, `onDismiss?`, `hideCloseButton?` |
|
|
@@ -346,6 +352,22 @@ import { Wizard } from 'orn-ui/wizard';
|
|
|
346
352
|
/>
|
|
347
353
|
```
|
|
348
354
|
|
|
355
|
+
**Onboarding carousel**
|
|
356
|
+
|
|
357
|
+
```tsx
|
|
358
|
+
import { Slides } from 'orn-ui/slides';
|
|
359
|
+
|
|
360
|
+
<Slides
|
|
361
|
+
data={pages}
|
|
362
|
+
keyExtractor={(page) => page.id}
|
|
363
|
+
background={(page) => page.gradient} // string = flat, string[] = gradient
|
|
364
|
+
renderItem={(page) => <Onboarding page={page} />}
|
|
365
|
+
loop
|
|
366
|
+
autoPlay
|
|
367
|
+
indicators="dots" // or "numbers"
|
|
368
|
+
/>
|
|
369
|
+
```
|
|
370
|
+
|
|
349
371
|
## Where to look next
|
|
350
372
|
|
|
351
373
|
- Live docs, props tables and demo GIFs: <https://orn-ui-docs.vercel.app/>
|
package/README.md
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
# orn-ui
|
|
2
2
|
|
|
3
3
|
Fast, tree-shakeable, atomic-design component library for React Native and Expo.
|
|
4
|
-
**Zero runtime dependencies** —
|
|
4
|
+
**Zero runtime dependencies** — `react`, `react-native` and
|
|
5
|
+
`react-native-safe-area-context` are the only peers.
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
(light/dark),
|
|
7
|
+
50 components (atoms, molecules, organisms), fully typed, themeable
|
|
8
|
+
(light/dark), 671 tests, 90%/85% (lines/branches) coverage gate.
|
|
8
9
|
|
|
9
10
|
**Works on Expo SDK 54, 55, 56 and 57** — every row verified in CI with its own
|
|
10
11
|
sandbox (`tsc` + full test suite). No native modules, no pods, no babel or
|
|
@@ -92,13 +93,13 @@ const insets = useSafeAreaInsets();
|
|
|
92
93
|
## Components
|
|
93
94
|
|
|
94
95
|
- **Atoms**: `Title`/`Subtitle`/`Body`/`Caption`, `Button`, `IconButton`,
|
|
95
|
-
`Input`, `Checkbox`, `Badge`, `Card`, `Divider`, `Avatar`, `Image`,
|
|
96
|
-
`Spinner`, `Skeleton`, `Transition`, `EmptyState`, `KeyValueRow`, `Fab`,
|
|
96
|
+
`Input`, `Checkbox`, `Badge`, `Card`, `Divider`, `Gradient`, `Avatar`, `Image`,
|
|
97
|
+
`Spinner`, `Skeleton`, `Transition`, `ShinyText`, `EmptyState`, `KeyValueRow`, `Fab`,
|
|
97
98
|
`PressableScale`
|
|
98
99
|
- **Molecules**: `Stepper`, `OptionCard`, `InfoRow`, `FormActions`,
|
|
99
100
|
`AvatarHeader`, `SegmentedControl`, `Steps`, `SymmetricGrid`
|
|
100
|
-
- **Organisms**: `Screen`, `Modal`, `BottomSheet`, `Select`, `List`,
|
|
101
|
-
`SearchList`, `ReorderableList`, `Alert`/`AlertProvider`,
|
|
101
|
+
- **Organisms**: `Screen`, `Modal`, `BottomSheet`, `Select`, `OptionWheel`, `Timeline`, `List`,
|
|
102
|
+
`SearchList`, `ReorderableList`, `Slides`, `Chart`, `Alert`/`AlertProvider`,
|
|
102
103
|
`Toast`/`ToastProvider`, `DatePicker`, `DateField`, `Wizard`,
|
|
103
104
|
`ThemeToggle`, `NavigationBar`
|
|
104
105
|
|
|
@@ -127,7 +128,7 @@ Every component's full prop table lives on [orn-ui-docs.vercel.app](https://orn-
|
|
|
127
128
|
The library is written to be *cheap to emit*: a themed, dark-mode-aware,
|
|
128
129
|
accessible screen is 20-50 lines instead of 150-400, so an agent spends fewer
|
|
129
130
|
tokens, the human reviews a smaller diff, and the generated code is already
|
|
130
|
-
covered by
|
|
131
|
+
covered by 671 tests. One `<SearchList>` replaces a `FlatList` + search input +
|
|
131
132
|
skeletons + pull-to-refresh + pagination + empty state.
|
|
132
133
|
|
|
133
134
|
Three properties make it safe to reach for by default:
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Gradient = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
11
|
+
const DEFAULT_STEPS = 24;
|
|
12
|
+
const styles = _reactNative.StyleSheet.create({
|
|
13
|
+
// Recorta el plano rotado de las diagonales y el degradado al borderRadius.
|
|
14
|
+
root: {
|
|
15
|
+
overflow: 'hidden'
|
|
16
|
+
},
|
|
17
|
+
segment: {
|
|
18
|
+
flex: 1
|
|
19
|
+
},
|
|
20
|
+
band: {
|
|
21
|
+
flex: 1
|
|
22
|
+
},
|
|
23
|
+
// Plano √2 centrado: rotado 45° cubre las esquinas sin medir el contenedor.
|
|
24
|
+
diagonalPlane: {
|
|
25
|
+
position: 'absolute',
|
|
26
|
+
top: '-21%',
|
|
27
|
+
left: '-21%',
|
|
28
|
+
width: '142%',
|
|
29
|
+
height: '142%'
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Gradient
|
|
35
|
+
* Degradado lineal sin dependencias: React Native no trae uno en el rango
|
|
36
|
+
* soportado (Expo SDK 54–57) y `experimental_backgroundImage` no está en toda
|
|
37
|
+
* esa ventana, así que se compone con bandas.
|
|
38
|
+
*
|
|
39
|
+
* Cada tramo pinta el color inicial y encima N bandas del final con opacidad
|
|
40
|
+
* de 0 a 1. El compositor mezcla alpha linealmente: el resultado es la
|
|
41
|
+
* interpolación sRGB entre paradas sin parsear el color, y por eso vale
|
|
42
|
+
* cualquier formato que acepte RN (hex, `rgba()`, nombre).
|
|
43
|
+
*/
|
|
44
|
+
const Gradient = exports.Gradient = /*#__PURE__*/(0, _react.memo)(({
|
|
45
|
+
colors,
|
|
46
|
+
direction = 'vertical',
|
|
47
|
+
steps = DEFAULT_STEPS,
|
|
48
|
+
children,
|
|
49
|
+
style,
|
|
50
|
+
testID
|
|
51
|
+
}) => {
|
|
52
|
+
const isRow = direction === 'horizontal';
|
|
53
|
+
const isDiagonal = direction === 'diagonal' || direction === 'diagonal-reverse';
|
|
54
|
+
// rotate positivo gira en horario (Y crece hacia abajo): -45° manda el eje
|
|
55
|
+
// del degradado hacia abajo-derecha.
|
|
56
|
+
const rotate = direction === 'diagonal' ? '-45deg' : '45deg';
|
|
57
|
+
const bandCount = Math.max(2, Math.floor(steps));
|
|
58
|
+
const painted = (0, _react.useMemo)(() => {
|
|
59
|
+
if (colors.length === 0) return null;
|
|
60
|
+
if (colors.length === 1) {
|
|
61
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
62
|
+
style: [_reactNative.StyleSheet.absoluteFill, {
|
|
63
|
+
backgroundColor: colors[0]
|
|
64
|
+
}]
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
const segments = colors.slice(0, -1).map((from, index) => {
|
|
68
|
+
const to = colors[index + 1];
|
|
69
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
70
|
+
style: [styles.segment, {
|
|
71
|
+
backgroundColor: from,
|
|
72
|
+
flexDirection: isRow ? 'row' : 'column'
|
|
73
|
+
}],
|
|
74
|
+
children: Array.from({
|
|
75
|
+
length: bandCount
|
|
76
|
+
}, (_, band) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
77
|
+
style: [styles.band, {
|
|
78
|
+
backgroundColor: to,
|
|
79
|
+
opacity: band / (bandCount - 1)
|
|
80
|
+
}]
|
|
81
|
+
}, band))
|
|
82
|
+
}, `${from}-${to}-${index}`);
|
|
83
|
+
});
|
|
84
|
+
const stack = /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
85
|
+
style: [_reactNative.StyleSheet.absoluteFill, {
|
|
86
|
+
flexDirection: isRow ? 'row' : 'column'
|
|
87
|
+
}],
|
|
88
|
+
children: segments
|
|
89
|
+
});
|
|
90
|
+
if (!isDiagonal) return stack;
|
|
91
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
92
|
+
style: [styles.diagonalPlane, {
|
|
93
|
+
transform: [{
|
|
94
|
+
rotate
|
|
95
|
+
}]
|
|
96
|
+
}],
|
|
97
|
+
children: segments
|
|
98
|
+
});
|
|
99
|
+
}, [colors, isRow, isDiagonal, rotate, bandCount]);
|
|
100
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
101
|
+
testID: testID,
|
|
102
|
+
style: [styles.root, style],
|
|
103
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
104
|
+
style: _reactNative.StyleSheet.absoluteFill,
|
|
105
|
+
pointerEvents: "none",
|
|
106
|
+
children: painted
|
|
107
|
+
}), children]
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
Gradient.displayName = 'Gradient';
|
|
111
|
+
//# sourceMappingURL=Gradient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","DEFAULT_STEPS","styles","StyleSheet","create","root","overflow","segment","flex","band","diagonalPlane","position","top","left","width","height","Gradient","exports","memo","colors","direction","steps","children","style","testID","isRow","isDiagonal","rotate","bandCount","Math","max","floor","painted","useMemo","length","jsx","View","absoluteFill","backgroundColor","segments","slice","map","from","index","to","flexDirection","Array","_","opacity","stack","transform","jsxs","pointerEvents","displayName"],"sourceRoot":"../../../src","sources":["atoms/Gradient.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBA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AQ,CAAO,CAAC;EAC5F,CAAC,EAAE,CAACpB,MAAM,EAAEM,KAAK,EAAEC,UAAU,EAAEC,MAAM,EAAEC,SAAS,CAAC,CAAC;EAElD,oBACE,IAAA/C,WAAA,CAAAsE,IAAA,EAACvE,YAAA,CAAAwD,IAAI;IAACZ,MAAM,EAAEA,MAAO;IAACD,KAAK,EAAE,CAACrB,MAAM,CAACG,IAAI,EAAEkB,KAAK,CAAE;IAAAD,QAAA,gBAGhD,IAAAzC,WAAA,CAAAsD,GAAA,EAACvD,YAAA,CAAAwD,IAAI;MAACb,KAAK,EAAEpB,uBAAU,CAACkC,YAAa;MAACe,aAAa,EAAC,MAAM;MAAA9B,QAAA,EACvDU;IAAO,CACJ,CAAC,EACNV,QAAQ;EAAA,CACL,CAAC;AAEX,CACF,CAAC;AACDN,QAAQ,CAACqC,WAAW,GAAG,UAAU","ignoreList":[]}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ShinyText = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _createStyles = require("../theme/createStyles");
|
|
10
|
+
var _UIProvider = require("../theme/UIProvider");
|
|
11
|
+
var _Transition = require("./Transition");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
14
|
+
const DEFAULT_DURATION = 2400;
|
|
15
|
+
const DEFAULT_DELAY = 600;
|
|
16
|
+
const DEFAULT_SPREAD = 0.28;
|
|
17
|
+
const useStyles = (0, _createStyles.createStyles)(theme => ({
|
|
18
|
+
text: {
|
|
19
|
+
fontSize: theme.tokens.fontSize.xl,
|
|
20
|
+
lineHeight: theme.tokens.lineHeight.lg,
|
|
21
|
+
fontWeight: theme.tokens.fontWeight.semibold,
|
|
22
|
+
color: theme.colors.text
|
|
23
|
+
},
|
|
24
|
+
row: {
|
|
25
|
+
flexDirection: 'row',
|
|
26
|
+
flexWrap: 'wrap'
|
|
27
|
+
},
|
|
28
|
+
// Sólo top/left: un absoluteFill estiraría la letra al ancho del grupo y la
|
|
29
|
+
// volvería a alinear. Anclada a la esquina cae exactamente sobre la de abajo.
|
|
30
|
+
overlay: {
|
|
31
|
+
position: 'absolute',
|
|
32
|
+
top: 0,
|
|
33
|
+
left: 0
|
|
34
|
+
},
|
|
35
|
+
// Una palabra y los espacios que la siguen: el salto de línea ocurre entre
|
|
36
|
+
// grupos, nunca entre las letras de una palabra.
|
|
37
|
+
group: {
|
|
38
|
+
flexDirection: 'row'
|
|
39
|
+
}
|
|
40
|
+
}));
|
|
41
|
+
const ALIGN = {
|
|
42
|
+
left: 'flex-start',
|
|
43
|
+
center: 'center',
|
|
44
|
+
right: 'flex-end'
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/** Una palabra con los espacios que la siguen, y el índice de su primera letra. */
|
|
48
|
+
|
|
49
|
+
function toGroups(text) {
|
|
50
|
+
const chars = Array.from(text);
|
|
51
|
+
const groups = [];
|
|
52
|
+
let current = [];
|
|
53
|
+
let start = 0;
|
|
54
|
+
chars.forEach((char, index) => {
|
|
55
|
+
if (current.length === 0) start = index;
|
|
56
|
+
current.push(char);
|
|
57
|
+
const next = chars[index + 1];
|
|
58
|
+
// Cierra el grupo cuando termina la racha de espacios que sigue a la
|
|
59
|
+
// palabra: así el espacio viaja con ella y no abre línea por sí solo.
|
|
60
|
+
const isSpace = /\s/.test(char);
|
|
61
|
+
if (isSpace && next !== undefined && !/\s/.test(next)) {
|
|
62
|
+
groups.push({
|
|
63
|
+
start,
|
|
64
|
+
chars: current
|
|
65
|
+
});
|
|
66
|
+
current = [];
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
if (current.length > 0) groups.push({
|
|
70
|
+
start,
|
|
71
|
+
chars: current
|
|
72
|
+
});
|
|
73
|
+
return groups;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* ShinyText
|
|
78
|
+
* Una banda de luz recorre el texto de izquierda a derecha. Sin
|
|
79
|
+
* `background-clip: text` ni máscaras —que React Native no tiene en el rango
|
|
80
|
+
* soportado— el brillo se compone letra por letra: cada una lleva su color de
|
|
81
|
+
* reposo y encima, superpuesta, la misma letra en el color del brillo con la
|
|
82
|
+
* opacidad animada. La banda es una ventana de interpolación que se desplaza:
|
|
83
|
+
* lo que cambia por frame es sólo `opacity`, o sea que la animación entera
|
|
84
|
+
* corre en el hilo nativo y JS no participa de ningún frame.
|
|
85
|
+
*
|
|
86
|
+
* Gestalt, destino común: las letras se encienden en secuencia y con el mismo
|
|
87
|
+
* ritmo, así que se leen como una sola cosa que se mueve —una palabra
|
|
88
|
+
* iluminándose— y no como N letras parpadeando por su cuenta. Por eso el ancho
|
|
89
|
+
* de banda es relativo al texto y no una cantidad fija de píxeles: un título
|
|
90
|
+
* largo y uno corto tardan lo mismo y se perciben igual.
|
|
91
|
+
*
|
|
92
|
+
* Con "reducir movimiento" activo, o con `animated={false}`, el texto se
|
|
93
|
+
* renderiza plano en `shineColor` —legible, un solo nodo y seleccionable—
|
|
94
|
+
* porque el efecto es decorativo y nada de lo que comunica está en el brillo.
|
|
95
|
+
*/
|
|
96
|
+
const ShinyText = exports.ShinyText = /*#__PURE__*/(0, _react.memo)(({
|
|
97
|
+
text,
|
|
98
|
+
duration = DEFAULT_DURATION,
|
|
99
|
+
delay = DEFAULT_DELAY,
|
|
100
|
+
spread = DEFAULT_SPREAD,
|
|
101
|
+
animated = true,
|
|
102
|
+
color,
|
|
103
|
+
shineColor,
|
|
104
|
+
align = 'left',
|
|
105
|
+
style,
|
|
106
|
+
testID
|
|
107
|
+
}) => {
|
|
108
|
+
const theme = (0, _UIProvider.useTheme)();
|
|
109
|
+
const styles = useStyles();
|
|
110
|
+
const allowFontScaling = (0, _UIProvider.useAllowFontScaling)();
|
|
111
|
+
const reduceMotion = (0, _Transition.useReduceMotion)();
|
|
112
|
+
const progress = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
|
|
113
|
+
const base = color ?? theme.colors.textLight;
|
|
114
|
+
// El acento, no `text`: contra `textLight` la diferencia es sólo de
|
|
115
|
+
// luminancia y el barrido casi no se ve. El brillo cambia tono además de
|
|
116
|
+
// claridad, que es lo que hace legible el movimiento.
|
|
117
|
+
const shine = shineColor ?? theme.colors.primary;
|
|
118
|
+
const running = animated && !reduceMotion && text.length > 0;
|
|
119
|
+
(0, _react.useEffect)(() => {
|
|
120
|
+
if (!running) return;
|
|
121
|
+
const loop = _reactNative.Animated.loop(_reactNative.Animated.sequence([_reactNative.Animated.timing(progress, {
|
|
122
|
+
toValue: 1,
|
|
123
|
+
duration,
|
|
124
|
+
easing: _reactNative.Easing.linear,
|
|
125
|
+
useNativeDriver: true
|
|
126
|
+
}), _reactNative.Animated.delay(delay)]));
|
|
127
|
+
loop.start();
|
|
128
|
+
return () => loop.stop();
|
|
129
|
+
}, [running, duration, delay, progress]);
|
|
130
|
+
const groups = (0, _react.useMemo)(() => running ? toGroups(text) : [], [running, text]);
|
|
131
|
+
if (!running) {
|
|
132
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
133
|
+
testID: testID,
|
|
134
|
+
allowFontScaling: allowFontScaling,
|
|
135
|
+
style: [styles.text, style, {
|
|
136
|
+
color: shine,
|
|
137
|
+
textAlign: align
|
|
138
|
+
}],
|
|
139
|
+
children: text
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
const total = Array.from(text).length;
|
|
143
|
+
// La banda entra por la izquierda y sale por la derecha, así que el
|
|
144
|
+
// recorrido normalizado mide 1 + 2·spread. `half` es media banda en esa
|
|
145
|
+
// escala: el tramo de progreso que una letra tarda en encenderse.
|
|
146
|
+
const half = spread / (1 + 2 * spread);
|
|
147
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
148
|
+
testID: testID,
|
|
149
|
+
accessible: true,
|
|
150
|
+
accessibilityRole: "text",
|
|
151
|
+
accessibilityLabel: text,
|
|
152
|
+
style: [styles.row, {
|
|
153
|
+
justifyContent: ALIGN[align]
|
|
154
|
+
}],
|
|
155
|
+
children: groups.map(group => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
156
|
+
style: styles.group,
|
|
157
|
+
children: group.chars.map((char, offset) => {
|
|
158
|
+
const index = group.start + offset;
|
|
159
|
+
const position = total === 1 ? 0.5 : index / (total - 1);
|
|
160
|
+
// Progreso en el que el centro de la banda cae sobre esta letra.
|
|
161
|
+
const peak = (position + spread) / (1 + 2 * spread);
|
|
162
|
+
const charStyle = [styles.text, style];
|
|
163
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
164
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
165
|
+
allowFontScaling: allowFontScaling,
|
|
166
|
+
style: [charStyle, {
|
|
167
|
+
color: base
|
|
168
|
+
}],
|
|
169
|
+
children: char
|
|
170
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.Text, {
|
|
171
|
+
allowFontScaling: allowFontScaling,
|
|
172
|
+
style: [charStyle, styles.overlay, {
|
|
173
|
+
color: shine,
|
|
174
|
+
opacity: progress.interpolate({
|
|
175
|
+
inputRange: [peak - half, peak, peak + half],
|
|
176
|
+
outputRange: [0, 1, 0],
|
|
177
|
+
extrapolate: 'clamp'
|
|
178
|
+
})
|
|
179
|
+
}],
|
|
180
|
+
children: char
|
|
181
|
+
})]
|
|
182
|
+
}, index);
|
|
183
|
+
})
|
|
184
|
+
}, group.start))
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
ShinyText.displayName = 'ShinyText';
|
|
188
|
+
//# sourceMappingURL=ShinyText.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_createStyles","_UIProvider","_Transition","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","DEFAULT_DURATION","DEFAULT_DELAY","DEFAULT_SPREAD","useStyles","createStyles","theme","text","fontSize","tokens","xl","lineHeight","lg","fontWeight","semibold","color","colors","row","flexDirection","flexWrap","overlay","position","top","left","group","ALIGN","center","right","toGroups","chars","Array","from","groups","current","start","forEach","char","index","length","push","next","isSpace","test","undefined","ShinyText","exports","memo","duration","delay","spread","animated","shineColor","align","style","testID","useTheme","styles","allowFontScaling","useAllowFontScaling","reduceMotion","useReduceMotion","progress","useRef","Animated","Value","base","textLight","shine","primary","running","useEffect","loop","sequence","timing","toValue","easing","Easing","linear","useNativeDriver","stop","useMemo","jsx","Text","textAlign","children","total","half","View","accessible","accessibilityRole","accessibilityLabel","justifyContent","map","offset","peak","charStyle","jsxs","opacity","interpolate","inputRange","outputRange","extrapolate","displayName"],"sourceRoot":"../../../src","sources":["atoms/ShinyText.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AASA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAA+C,IAAAK,WAAA,GAAAL,OAA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,CACL0C,SAAS,EACTvC,MAAM,CAACpC,OAAO,EACd;cACEL,KAAK,EAAEoD,KAAK;cACZ8B,OAAO,EAAEpC,QAAQ,CAACqC,WAAW,CAAC;gBAC5BC,UAAU,EAAE,CAACL,IAAI,GAAGR,IAAI,EAAEQ,IAAI,EAAEA,IAAI,GAAGR,IAAI,CAAC;gBAC5Cc,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;gBACtBC,WAAW,EAAE;cACf,CAAC;YACH,CAAC,CACD;YAAAjB,QAAA,EAEDhD;UAAI,CACQ,CAAC;QAAA,GApBPC,KAqBL,CAAC;MAEX,CAAC;IAAC,GAhCOb,KAAK,CAACU,KAiCX,CACP;EAAC,CACE,CAAC;AAEX,CACF,CAAC;AACDU,SAAS,CAAC0D,WAAW,GAAG,WAAW","ignoreList":[]}
|
|
@@ -63,6 +63,12 @@ Object.defineProperty(exports, "Fab", {
|
|
|
63
63
|
return _Fab.Fab;
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
|
+
Object.defineProperty(exports, "Gradient", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function () {
|
|
69
|
+
return _Gradient.Gradient;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
66
72
|
Object.defineProperty(exports, "IconButton", {
|
|
67
73
|
enumerable: true,
|
|
68
74
|
get: function () {
|
|
@@ -93,6 +99,12 @@ Object.defineProperty(exports, "PressableScale", {
|
|
|
93
99
|
return _PressableScale.PressableScale;
|
|
94
100
|
}
|
|
95
101
|
});
|
|
102
|
+
Object.defineProperty(exports, "ShinyText", {
|
|
103
|
+
enumerable: true,
|
|
104
|
+
get: function () {
|
|
105
|
+
return _ShinyText.ShinyText;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
96
108
|
Object.defineProperty(exports, "Skeleton", {
|
|
97
109
|
enumerable: true,
|
|
98
110
|
get: function () {
|
|
@@ -143,11 +155,13 @@ var _Checkbox = require("./Checkbox");
|
|
|
143
155
|
var _Badge = require("./Badge");
|
|
144
156
|
var _Card = require("./Card");
|
|
145
157
|
var _Divider = require("./Divider");
|
|
158
|
+
var _Gradient = require("./Gradient");
|
|
146
159
|
var _Avatar = require("./Avatar");
|
|
147
160
|
var _Image = require("./Image");
|
|
148
161
|
var _Spinner = require("./Spinner");
|
|
149
162
|
var _Skeleton = require("./Skeleton");
|
|
150
163
|
var _Transition = require("./Transition");
|
|
164
|
+
var _ShinyText = require("./ShinyText");
|
|
151
165
|
var _EmptyState = require("./EmptyState");
|
|
152
166
|
var _KeyValueRow = require("./KeyValueRow");
|
|
153
167
|
var _Fab = require("./Fab");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_Text","require","_Button","_IconButton","_Input","_Checkbox","_Badge","_Card","_Divider","_Avatar","_Image","_Spinner","_Skeleton","_Transition","_EmptyState","_KeyValueRow","_Fab","_PressableScale"],"sourceRoot":"../../../src","sources":["atoms/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_Text","require","_Button","_IconButton","_Input","_Checkbox","_Badge","_Card","_Divider","_Gradient","_Avatar","_Image","_Spinner","_Skeleton","_Transition","_ShinyText","_EmptyState","_KeyValueRow","_Fab","_PressableScale"],"sourceRoot":"../../../src","sources":["atoms/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAAE,WAAA,GAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAH,OAAA;AAEA,IAAAI,SAAA,GAAAJ,OAAA;AAEA,IAAAK,MAAA,GAAAL,OAAA;AAEA,IAAAM,KAAA,GAAAN,OAAA;AAEA,IAAAO,QAAA,GAAAP,OAAA;AAEA,IAAAQ,SAAA,GAAAR,OAAA;AAEA,IAAAS,OAAA,GAAAT,OAAA;AAEA,IAAAU,MAAA,GAAAV,OAAA;AAEA,IAAAW,QAAA,GAAAX,OAAA;AAEA,IAAAY,SAAA,GAAAZ,OAAA;AAEA,IAAAa,WAAA,GAAAb,OAAA;AAEA,IAAAc,UAAA,GAAAd,OAAA;AAEA,IAAAe,WAAA,GAAAf,OAAA;AAEA,IAAAgB,YAAA,GAAAhB,OAAA;AAEA,IAAAiB,IAAA,GAAAjB,OAAA;AAEA,IAAAkB,eAAA,GAAAlB,OAAA","ignoreList":[]}
|