@objectifthunes/limestone-sdk 0.1.8 → 0.1.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/README.md +50 -18
- package/dist/components/content/block-quote/block-quote.d.ts +4 -0
- package/dist/components/content/block-quote/block-quote.d.ts.map +1 -0
- package/dist/components/content/block-quote/block-quote.js +12 -0
- package/dist/components/content/block-quote/block-quote.js.map +1 -0
- package/dist/components/content/block-quote/index.d.ts +4 -0
- package/dist/components/content/block-quote/index.d.ts.map +1 -0
- package/dist/components/content/block-quote/index.js +4 -0
- package/dist/components/content/block-quote/index.js.map +1 -0
- package/dist/components/content/block-quote/types.d.ts +26 -0
- package/dist/components/content/block-quote/types.d.ts.map +1 -0
- package/dist/components/content/block-quote/types.js +2 -0
- package/dist/components/content/block-quote/types.js.map +1 -0
- package/dist/components/content/block-quote/use-block-quote.d.ts +4 -0
- package/dist/components/content/block-quote/use-block-quote.d.ts.map +1 -0
- package/dist/components/content/block-quote/use-block-quote.js +59 -0
- package/dist/components/content/block-quote/use-block-quote.js.map +1 -0
- package/dist/components/content/callout/callout.d.ts +4 -0
- package/dist/components/content/callout/callout.d.ts.map +1 -0
- package/dist/components/content/callout/callout.js +12 -0
- package/dist/components/content/callout/callout.js.map +1 -0
- package/dist/components/content/callout/index.d.ts +4 -0
- package/dist/components/content/callout/index.d.ts.map +1 -0
- package/dist/components/content/callout/index.js +4 -0
- package/dist/components/content/callout/index.js.map +1 -0
- package/dist/components/content/callout/types.d.ts +33 -0
- package/dist/components/content/callout/types.d.ts.map +1 -0
- package/dist/components/content/callout/types.js +2 -0
- package/dist/components/content/callout/types.js.map +1 -0
- package/dist/components/content/callout/use-callout.d.ts +4 -0
- package/dist/components/content/callout/use-callout.d.ts.map +1 -0
- package/dist/components/content/callout/use-callout.js +81 -0
- package/dist/components/content/callout/use-callout.js.map +1 -0
- package/dist/components/content/code-block/code-block.d.ts +4 -0
- package/dist/components/content/code-block/code-block.d.ts.map +1 -0
- package/dist/components/content/code-block/code-block.js +12 -0
- package/dist/components/content/code-block/code-block.js.map +1 -0
- package/dist/components/content/code-block/index.d.ts +4 -0
- package/dist/components/content/code-block/index.d.ts.map +1 -0
- package/dist/components/content/code-block/index.js +4 -0
- package/dist/components/content/code-block/index.js.map +1 -0
- package/dist/components/content/code-block/types.d.ts +35 -0
- package/dist/components/content/code-block/types.d.ts.map +1 -0
- package/dist/components/content/code-block/types.js +2 -0
- package/dist/components/content/code-block/types.js.map +1 -0
- package/dist/components/content/code-block/use-code-block.d.ts +4 -0
- package/dist/components/content/code-block/use-code-block.d.ts.map +1 -0
- package/dist/components/content/code-block/use-code-block.js +81 -0
- package/dist/components/content/code-block/use-code-block.js.map +1 -0
- package/dist/components/content/index.d.ts +11 -0
- package/dist/components/content/index.d.ts.map +1 -0
- package/dist/components/content/index.js +7 -0
- package/dist/components/content/index.js.map +1 -0
- package/dist/components/content/markdown-renderer/index.d.ts +4 -0
- package/dist/components/content/markdown-renderer/index.d.ts.map +1 -0
- package/dist/components/content/markdown-renderer/index.js +4 -0
- package/dist/components/content/markdown-renderer/index.js.map +1 -0
- package/dist/components/content/markdown-renderer/markdown-renderer.d.ts +4 -0
- package/dist/components/content/markdown-renderer/markdown-renderer.d.ts.map +1 -0
- package/dist/components/content/markdown-renderer/markdown-renderer.js +12 -0
- package/dist/components/content/markdown-renderer/markdown-renderer.js.map +1 -0
- package/dist/components/content/markdown-renderer/types.d.ts +40 -0
- package/dist/components/content/markdown-renderer/types.d.ts.map +1 -0
- package/dist/components/content/markdown-renderer/types.js +2 -0
- package/dist/components/content/markdown-renderer/types.js.map +1 -0
- package/dist/components/content/markdown-renderer/use-markdown-renderer.d.ts +4 -0
- package/dist/components/content/markdown-renderer/use-markdown-renderer.d.ts.map +1 -0
- package/dist/components/content/markdown-renderer/use-markdown-renderer.js +177 -0
- package/dist/components/content/markdown-renderer/use-markdown-renderer.js.map +1 -0
- package/dist/components/content/rich-text-editor/index.d.ts +4 -0
- package/dist/components/content/rich-text-editor/index.d.ts.map +1 -0
- package/dist/components/content/rich-text-editor/index.js +4 -0
- package/dist/components/content/rich-text-editor/index.js.map +1 -0
- package/dist/components/content/rich-text-editor/rich-text-editor.d.ts +4 -0
- package/dist/components/content/rich-text-editor/rich-text-editor.d.ts.map +1 -0
- package/dist/components/content/rich-text-editor/rich-text-editor.js +12 -0
- package/dist/components/content/rich-text-editor/rich-text-editor.js.map +1 -0
- package/dist/components/content/rich-text-editor/types.d.ts +37 -0
- package/dist/components/content/rich-text-editor/types.d.ts.map +1 -0
- package/dist/components/content/rich-text-editor/types.js +2 -0
- package/dist/components/content/rich-text-editor/types.js.map +1 -0
- package/dist/components/content/rich-text-editor/use-rich-text-editor.d.ts +4 -0
- package/dist/components/content/rich-text-editor/use-rich-text-editor.d.ts.map +1 -0
- package/dist/components/content/rich-text-editor/use-rich-text-editor.js +78 -0
- package/dist/components/content/rich-text-editor/use-rich-text-editor.js.map +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,36 +1,68 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Limestone SDK
|
|
2
2
|
|
|
3
|
-
Contracts-first, LLM-first mobile toolkit for React Native + Expo.
|
|
3
|
+
> Contracts-first, LLM-first mobile toolkit for React Native + Expo. 155+ headless components, 16 ports, hexagonal architecture.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @objectifthunes/limestone-sdk
|
|
9
|
+
```
|
|
6
10
|
|
|
7
|
-
|
|
11
|
+
## What's Inside
|
|
12
|
+
|
|
13
|
+
| Category | Count | Highlights |
|
|
14
|
+
|----------|-------|------------|
|
|
15
|
+
| Primitives | 13 | Box, Text, Button, IconButton, Link, Skeleton... |
|
|
16
|
+
| Layout | 5 | Stack, Grid, ScrollView, SafeArea... |
|
|
17
|
+
| Inputs | 17 | TextInput, Select, DatePicker, Calendar, Autocomplete, SignaturePad... |
|
|
18
|
+
| Navigation | 9 | Header, TabBar, Tabs, CollapsibleHeader, PageIndicator... |
|
|
19
|
+
| Overlays | 6 | Modal, Tooltip, Menu, ContextMenu, Lightbox... |
|
|
20
|
+
| Feedback | 9 | Toast, Dialog, Badge, Banner, ConnectionStatus... |
|
|
21
|
+
| Data Display | 17 | Card, List, Chart, DataTable, ActivityRing, RatingStars... |
|
|
22
|
+
| Screens | 20 | Auth, Dashboard, ProductDetail, Cart, Feed, OrderTracking... |
|
|
23
|
+
| Media | 8 | VideoPlayer, Carousel, QRScanner, MapView, AudioPlayer... |
|
|
24
|
+
| Forms | 3 | Form, FormField, FormError |
|
|
25
|
+
| 3D | 6 | Scene3D, ModelViewer, Panorama360, BeforeAfter3D... |
|
|
26
|
+
| AR | 8 | ARView, ARPlacement, ARMeasure, ARNavigation... |
|
|
27
|
+
| Interactive | 6 | SwipeableRow, DragToReorder, PinchToZoom, ParallaxHeader... |
|
|
28
|
+
| Social | 5 | StoryRow, ReactionPicker, CommentThread, MentionInput... |
|
|
29
|
+
| Content | 5 | MarkdownRenderer, CodeBlock, RichTextEditor, BlockQuote, Callout |
|
|
30
|
+
| Animations | 8 | FadeIn, SlideUp, Shimmer, Confetti, ErrorShake... |
|
|
31
|
+
|
|
32
|
+
## Architecture
|
|
8
33
|
|
|
9
34
|
```
|
|
10
35
|
Ports (interfaces) → Core logic ← Adapters (implementations)
|
|
11
36
|
```
|
|
12
37
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
npm install @objectifthunes/limestone-sdk
|
|
17
|
-
```
|
|
38
|
+
16 ports for native features (biometrics, camera, location, etc.). 33 adapter factories across 4 subpaths (expo-*, r3f, viro, dev). Delete any adapter — core still compiles.
|
|
18
39
|
|
|
19
40
|
## Quick Start
|
|
20
41
|
|
|
21
|
-
```
|
|
22
|
-
import {
|
|
23
|
-
import { obsidianTheme } from '@objectifthunes/limestone-
|
|
42
|
+
```tsx
|
|
43
|
+
import { defineConfig, LimestoneProvider } from '@objectifthunes/limestone-sdk';
|
|
44
|
+
import { obsidianTheme } from '@objectifthunes/limestone-sdk';
|
|
45
|
+
import { createExpoBiometrics } from '@objectifthunes/limestone-sdk/expo-biometrics';
|
|
46
|
+
|
|
47
|
+
const config = defineConfig({
|
|
48
|
+
theme: obsidianTheme,
|
|
49
|
+
adapters: { biometrics: createExpoBiometrics() },
|
|
50
|
+
});
|
|
24
51
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
52
|
+
export default function App() {
|
|
53
|
+
return (
|
|
54
|
+
<LimestoneProvider config={config}>
|
|
55
|
+
<RootNavigator />
|
|
56
|
+
</LimestoneProvider>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
29
59
|
```
|
|
30
60
|
|
|
31
|
-
##
|
|
61
|
+
## Documentation
|
|
32
62
|
|
|
33
|
-
|
|
63
|
+
- [Docs Site](https://objectifthunes.github.io/limestone-sdk)
|
|
64
|
+
- [CLAUDE.md](./CLAUDE.md) — Full API reference for LLMs
|
|
65
|
+
- [llms.txt](https://objectifthunes.github.io/limestone-sdk/llms.txt) — Machine-readable summary
|
|
34
66
|
|
|
35
67
|
## License
|
|
36
68
|
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { View, type ViewProps } from 'react-native';
|
|
2
|
+
import type { BlockQuoteProps } from './types.js';
|
|
3
|
+
export declare const BlockQuote: import("react").ForwardRefExoticComponent<BlockQuoteProps & Omit<ViewProps, keyof BlockQuoteProps> & import("react").RefAttributes<View>>;
|
|
4
|
+
//# sourceMappingURL=block-quote.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block-quote.d.ts","sourceRoot":"","sources":["../../../../src/components/content/block-quote/block-quote.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAGpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,eAAO,MAAM,UAAU,2IA4BrB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// src/components/content/block-quote/block-quote.tsx
|
|
2
|
+
import { forwardRef, createElement } from 'react';
|
|
3
|
+
import { View } from 'react-native';
|
|
4
|
+
import { useTheme } from '../../../theme/context.js';
|
|
5
|
+
import { useBlockQuote } from './use-block-quote.js';
|
|
6
|
+
export const BlockQuote = forwardRef(function BlockQuote(props, ref) {
|
|
7
|
+
const { tokens } = useTheme();
|
|
8
|
+
const { children, author: _author, source: _source, variant: _variant, size: _size, bg: _bg, p: _p, px: _px, py: _py, pt: _pt, pb: _pb, pl: _pl, pr: _pr, m: _m, mx: _mx, my: _my, mt: _mt, mb: _mb, ml: _ml, mr: _mr, rounded: _r, shadow: _sh, flex: _f, row: _row, center: _cen, w: _w, h: _h, borderWidth: _bw, borderColor: _bc, opacity: _op, overflow: _ov, position: _pos, top: _top, bottom: _bot, left: _left, right: _right, zIndex: _zi, accessibilityLabel: _al, testID, ...rest } = props;
|
|
9
|
+
const { containerStyle, accessibilityProps } = useBlockQuote(tokens, props);
|
|
10
|
+
return createElement(View, { ref, style: containerStyle, ...accessibilityProps, testID, ...rest }, children);
|
|
11
|
+
});
|
|
12
|
+
//# sourceMappingURL=block-quote.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block-quote.js","sourceRoot":"","sources":["../../../../src/components/content/block-quote/block-quote.tsx"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,OAAO,EAAE,UAAU,EAAE,aAAa,EAA4B,MAAM,OAAO,CAAC;AAC5E,OAAO,EAAE,IAAI,EAAkB,MAAM,cAAc,CAAC;AACpD,OAAO,E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AAE,kBAAkB,EAAE,GAAG,aAAa,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAE5E,OAAO,aAAa,CAClB,IAAW,EACX,EAAE,GAAG,EAAE,KAAK,EAAE,cAAqB,EAAE,GAAG,kBAAkB,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,EAC7E,QAAqB,CACtB,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/content/block-quote/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,YAAY,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/content/block-quote/index.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ViewStyle, TextStyle } from 'react-native';
|
|
2
|
+
import type { BoxStyleProps } from '../../types.js';
|
|
3
|
+
export interface BlockQuoteProps extends BoxStyleProps {
|
|
4
|
+
children?: unknown;
|
|
5
|
+
author?: string;
|
|
6
|
+
source?: string;
|
|
7
|
+
variant?: 'default' | 'highlight';
|
|
8
|
+
size?: 'sm' | 'md' | 'lg';
|
|
9
|
+
accessibilityLabel?: string;
|
|
10
|
+
testID?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface UseBlockQuoteResult {
|
|
13
|
+
containerStyle: ViewStyle;
|
|
14
|
+
textStyle: TextStyle;
|
|
15
|
+
authorStyle: TextStyle;
|
|
16
|
+
sourceStyle: TextStyle;
|
|
17
|
+
quoteMarkStyle: TextStyle;
|
|
18
|
+
showAuthor: boolean;
|
|
19
|
+
showSource: boolean;
|
|
20
|
+
showQuoteMark: boolean;
|
|
21
|
+
accessibilityProps: {
|
|
22
|
+
accessibilityLabel: string;
|
|
23
|
+
accessibilityRole: 'text';
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/content/block-quote/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD,MAAM,WAAW,eAAgB,SAAQ,aAAa;IACpD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC;IAClC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IAClC,cAAc,EAAE,SAAS,CAAC;IAC1B,SAAS,EAAE,SAAS,CAAC;IACrB,WAAW,EAAE,SAAS,CAAC;IACvB,WAAW,EAAE,SAAS,CAAC;IACvB,cAAc,EAAE,SAAS,CAAC;IAC1B,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,OAAO,CAAC;IACvB,kBAAkB,EAAE;QAClB,kBAAkB,EAAE,MAAM,CAAC;QAC3B,iBAAiB,EAAE,MAAM,CAAC;KAC3B,CAAC;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/content/block-quote/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ThemeTokens } from '../../../theme/tokens.js';
|
|
2
|
+
import type { BlockQuoteProps, UseBlockQuoteResult } from './types.js';
|
|
3
|
+
export declare function useBlockQuote(tokens: ThemeTokens, props: BlockQuoteProps): UseBlockQuoteResult;
|
|
4
|
+
//# sourceMappingURL=use-block-quote.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-block-quote.d.ts","sourceRoot":"","sources":["../../../../src/components/content/block-quote/use-block-quote.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAQvE,wBAAgB,aAAa,CAC3B,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,eAAe,GACrB,mBAAmB,CAmErB"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
const SIZE_MAP = {
|
|
2
|
+
sm: 14,
|
|
3
|
+
md: 16,
|
|
4
|
+
lg: 18,
|
|
5
|
+
};
|
|
6
|
+
export function useBlockQuote(tokens, props) {
|
|
7
|
+
const { author, source, variant = 'default', size = 'md', accessibilityLabel, } = props;
|
|
8
|
+
const fontSize = SIZE_MAP[size] ?? 16;
|
|
9
|
+
const showAuthor = !!author;
|
|
10
|
+
const showSource = !!source;
|
|
11
|
+
const showQuoteMark = variant === 'highlight';
|
|
12
|
+
const borderLeftColor = variant === 'highlight' ? tokens.colors.primary : tokens.colors.muted;
|
|
13
|
+
const containerStyle = {
|
|
14
|
+
borderLeftWidth: 3,
|
|
15
|
+
borderLeftColor,
|
|
16
|
+
paddingLeft: tokens.spacing.md,
|
|
17
|
+
paddingVertical: tokens.spacing.sm,
|
|
18
|
+
marginBottom: tokens.spacing.sm,
|
|
19
|
+
};
|
|
20
|
+
const textStyle = {
|
|
21
|
+
fontStyle: 'italic',
|
|
22
|
+
fontSize,
|
|
23
|
+
color: tokens.colors.foreground,
|
|
24
|
+
lineHeight: fontSize * tokens.typography.lineHeights.relaxed,
|
|
25
|
+
};
|
|
26
|
+
const authorStyle = {
|
|
27
|
+
fontSize: tokens.typography.sizes.sm,
|
|
28
|
+
fontWeight: tokens.typography.weights.bold,
|
|
29
|
+
color: tokens.colors.foreground,
|
|
30
|
+
marginTop: tokens.spacing.sm,
|
|
31
|
+
};
|
|
32
|
+
const sourceStyle = {
|
|
33
|
+
fontSize: tokens.typography.sizes.xs,
|
|
34
|
+
color: tokens.colors.mutedForeground,
|
|
35
|
+
fontStyle: 'italic',
|
|
36
|
+
};
|
|
37
|
+
const quoteMarkStyle = {
|
|
38
|
+
fontSize: tokens.typography.sizes['4xl'],
|
|
39
|
+
color: tokens.colors.primary,
|
|
40
|
+
opacity: 0.3,
|
|
41
|
+
lineHeight: tokens.typography.sizes['4xl'] * 0.8,
|
|
42
|
+
marginBottom: -tokens.spacing.xs,
|
|
43
|
+
};
|
|
44
|
+
return {
|
|
45
|
+
containerStyle,
|
|
46
|
+
textStyle,
|
|
47
|
+
authorStyle,
|
|
48
|
+
sourceStyle,
|
|
49
|
+
quoteMarkStyle,
|
|
50
|
+
showAuthor,
|
|
51
|
+
showSource,
|
|
52
|
+
showQuoteMark,
|
|
53
|
+
accessibilityProps: {
|
|
54
|
+
accessibilityLabel: accessibilityLabel ?? 'Block quote',
|
|
55
|
+
accessibilityRole: 'text',
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=use-block-quote.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-block-quote.js","sourceRoot":"","sources":["../../../../src/components/content/block-quote/use-block-quote.ts"],"names":[],"mappings":"AAIA,MAAM,QAAQ,GAA2B;IACvC,EAAE,EAAE,EAAE;IACN,EAA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C,EAAE;KAC7B,CAAC;IAEF,MAAM,WAAW,GAAG;QAClB,QAAQ,EAAE,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE;QACpC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,eAAe;QACpC,SAAS,EAAE,QAAiB;KAC7B,CAAC;IAEF,MAAM,cAAc,GAAG;QACrB,QAAQ,EAAE,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC;QACxC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO;QAC5B,OAAO,EAAE,GAAG;QACZ,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,GAAG;QAChD,YAAY,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE;KACjC,CAAC;IAEF,OAAO;QACL,cAAc;QACd,SAAS;QACT,WAAW;QACX,WAAW;QACX,cAAc;QACd,UAAU;QACV,UAAU;QACV,aAAa;QACb,kBAAkB,EAAE;YAClB,kBAAkB,EAAE,kBAAkB,IAAI,aAAa;YACvD,iBAAiB,EAAE,MAAM;SAC1B;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { View, type ViewProps } from 'react-native';
|
|
2
|
+
import type { CalloutProps } from './types.js';
|
|
3
|
+
export declare const Callout: import("react").ForwardRefExoticComponent<CalloutProps & Omit<ViewProps, keyof CalloutProps> & import("react").RefAttributes<View>>;
|
|
4
|
+
//# sourceMappingURL=callout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"callout.d.ts","sourceRoot":"","sources":["../../../../src/components/content/callout/callout.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAGpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,eAAO,MAAM,OAAO,qIA4BlB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// src/components/content/callout/callout.tsx
|
|
2
|
+
import { forwardRef, createElement } from 'react';
|
|
3
|
+
import { View } from 'react-native';
|
|
4
|
+
import { useTheme } from '../../../theme/context.js';
|
|
5
|
+
import { useCallout } from './use-callout.js';
|
|
6
|
+
export const Callout = forwardRef(function Callout(props, ref) {
|
|
7
|
+
const { tokens } = useTheme();
|
|
8
|
+
const { type: _type, title: _title, message: _message, icon: _icon, dismissible: _dismissible, onDismiss: _onDismiss, bg: _bg, p: _p, px: _px, py: _py, pt: _pt, pb: _pb, pl: _pl, pr: _pr, m: _m, mx: _mx, my: _my, mt: _mt, mb: _mb, ml: _ml, mr: _mr, rounded: _r, shadow: _sh, flex: _f, row: _row, center: _cen, w: _w, h: _h, borderWidth: _bw, borderColor: _bc, opacity: _op, overflow: _ov, position: _pos, top: _top, bottom: _bot, left: _left, right: _right, zIndex: _zi, accessibilityLabel: _al, testID, ...rest } = props;
|
|
9
|
+
const { containerStyle, accessibilityProps } = useCallout(tokens, props);
|
|
10
|
+
return createElement(View, { ref, style: containerStyle, ...accessibilityProps, testID, ...rest });
|
|
11
|
+
});
|
|
12
|
+
//# sourceMappingURL=callout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"callout.js","sourceRoot":"","sources":["../../../../src/components/content/callout/callout.tsx"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,OAAO,EAAE,UAAU,EAAE,aAAa,EAAY,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAkB,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG9C,MAAM,CAAC,MAAM,OAAO,GAAG,UAAU,CAAC,SAAS,OAAO,CAChD,KAAyD,EACzD,GAAc;IAEd,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAC;IA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AC9E,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/content/callout/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/content/callout/index.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ViewStyle, TextStyle } from 'react-native';
|
|
2
|
+
import type { BoxStyleProps } from '../../types.js';
|
|
3
|
+
export type CalloutType = 'info' | 'warning' | 'error' | 'tip';
|
|
4
|
+
export interface CalloutProps extends BoxStyleProps {
|
|
5
|
+
type: CalloutType;
|
|
6
|
+
title?: string;
|
|
7
|
+
message: string;
|
|
8
|
+
icon?: string;
|
|
9
|
+
dismissible?: boolean;
|
|
10
|
+
onDismiss?: () => void;
|
|
11
|
+
accessibilityLabel?: string;
|
|
12
|
+
testID?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface UseCalloutResult {
|
|
15
|
+
containerStyle: ViewStyle;
|
|
16
|
+
headerRowStyle: ViewStyle;
|
|
17
|
+
titleRowStyle: ViewStyle;
|
|
18
|
+
titleStyle: TextStyle;
|
|
19
|
+
messageStyle: TextStyle;
|
|
20
|
+
iconColor: string;
|
|
21
|
+
iconSize: number;
|
|
22
|
+
dismissButtonStyle: ViewStyle;
|
|
23
|
+
dismissIconColor: string;
|
|
24
|
+
showTitle: boolean;
|
|
25
|
+
showIcon: boolean;
|
|
26
|
+
showDismiss: boolean;
|
|
27
|
+
accessibilityProps: {
|
|
28
|
+
accessibilityLabel: string;
|
|
29
|
+
accessibilityRole: 'alert' | 'note';
|
|
30
|
+
accessibilityLiveRegion: 'assertive' | 'polite';
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/content/callout/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,KAAK,CAAC;AAE/D,MAAM,WAAW,YAAa,SAAQ,aAAa;IACjD,IAAI,EAAE,WAAW,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC/B,cAAc,EAAE,SAAS,CAAC;IAC1B,cAAc,EAAE,SAAS,CAAC;IAC1B,aAAa,EAAE,SAAS,CAAC;IACzB,UAAU,EAAE,SAAS,CAAC;IACtB,YAAY,EAAE,SAAS,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,kBAAkB,EAAE,SAAS,CAAC;IAC9B,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,kBAAkB,EAAE;QAClB,kBAAkB,EAAE,MAAM,CAAC;QAC3B,iBAAiB,EAAE,OAAO,GAAG,MAAM,CAAC;QACpC,uBAAuB,EAAE,WAAW,GAAG,QAAQ,CAAC;KACjD,CAAC;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/content/callout/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-callout.d.ts","sourceRoot":"","sources":["../../../../src/components/content/callout/use-callout.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAe,MAAM,YAAY,CAAC;AAoB9E,wBAAgB,UAAU,CACxB,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,YAAY,GAClB,gBAAgB,CAkFlB"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
function getBorderColor(type, tokens) {
|
|
2
|
+
switch (type) {
|
|
3
|
+
case 'info': return tokens.colors.accent;
|
|
4
|
+
case 'warning': return '#eab308';
|
|
5
|
+
case 'error': return tokens.colors.destructive;
|
|
6
|
+
case 'tip': return '#22c55e';
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
function getBackgroundColor(type, tokens) {
|
|
10
|
+
const base = getBorderColor(type, tokens);
|
|
11
|
+
return `${base}1a`;
|
|
12
|
+
}
|
|
13
|
+
function getTextColor(type, tokens) {
|
|
14
|
+
return getBorderColor(type, tokens);
|
|
15
|
+
}
|
|
16
|
+
export function useCallout(tokens, props) {
|
|
17
|
+
const { type, title, icon, dismissible = false, accessibilityLabel, } = props;
|
|
18
|
+
const borderColor = getBorderColor(type, tokens);
|
|
19
|
+
const backgroundColor = getBackgroundColor(type, tokens);
|
|
20
|
+
const textColor = getTextColor(type, tokens);
|
|
21
|
+
const showTitle = !!title;
|
|
22
|
+
const showIcon = !!icon;
|
|
23
|
+
const showDismiss = dismissible;
|
|
24
|
+
const containerStyle = {
|
|
25
|
+
padding: tokens.spacing.md,
|
|
26
|
+
borderRadius: tokens.radii.md,
|
|
27
|
+
borderLeftWidth: 4,
|
|
28
|
+
backgroundColor,
|
|
29
|
+
borderLeftColor: borderColor,
|
|
30
|
+
};
|
|
31
|
+
const headerRowStyle = {
|
|
32
|
+
flexDirection: 'row',
|
|
33
|
+
alignItems: 'center',
|
|
34
|
+
justifyContent: 'space-between',
|
|
35
|
+
marginBottom: title ? tokens.spacing.xs : 0,
|
|
36
|
+
};
|
|
37
|
+
const titleRowStyle = {
|
|
38
|
+
flexDirection: 'row',
|
|
39
|
+
alignItems: 'center',
|
|
40
|
+
gap: tokens.spacing.xs,
|
|
41
|
+
flex: 1,
|
|
42
|
+
};
|
|
43
|
+
const titleStyle = {
|
|
44
|
+
fontSize: tokens.typography.sizes.sm,
|
|
45
|
+
fontWeight: tokens.typography.weights.bold,
|
|
46
|
+
color: textColor,
|
|
47
|
+
};
|
|
48
|
+
const messageStyle = {
|
|
49
|
+
fontSize: tokens.typography.sizes.sm,
|
|
50
|
+
color: tokens.colors.foreground,
|
|
51
|
+
lineHeight: tokens.typography.sizes.sm * tokens.typography.lineHeights.normal,
|
|
52
|
+
};
|
|
53
|
+
const iconColor = textColor;
|
|
54
|
+
const iconSize = 16;
|
|
55
|
+
const dismissButtonStyle = {
|
|
56
|
+
padding: tokens.spacing.xs,
|
|
57
|
+
borderRadius: tokens.radii.sm,
|
|
58
|
+
};
|
|
59
|
+
const dismissIconColor = tokens.colors.mutedForeground;
|
|
60
|
+
const isError = type === 'error';
|
|
61
|
+
return {
|
|
62
|
+
containerStyle,
|
|
63
|
+
headerRowStyle,
|
|
64
|
+
titleRowStyle,
|
|
65
|
+
titleStyle,
|
|
66
|
+
messageStyle,
|
|
67
|
+
iconColor,
|
|
68
|
+
iconSize,
|
|
69
|
+
dismissButtonStyle,
|
|
70
|
+
dismissIconColor,
|
|
71
|
+
showTitle,
|
|
72
|
+
showIcon,
|
|
73
|
+
showDismiss,
|
|
74
|
+
accessibilityProps: {
|
|
75
|
+
accessibilityLabel: accessibilityLabel ?? `${type} callout`,
|
|
76
|
+
accessibilityRole: isError ? 'alert' : 'note',
|
|
77
|
+
accessibilityLiveRegion: isError ? 'assertive' : 'polite',
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=use-callout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-callout.js","sourceRoot":"","sources":["../../../../src/components/content/callout/use-callout.ts"],"names":[],"mappings":"AAIA,SAAS,cAAc,CAAC,IAAiB,EAAE,MAAmB;IAC5D,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,MAAM,CAAC,CAAC,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;QACzC,KAAK,SAAS,CAAC,CAAC,OAAO,SAAS,CAAC;QACjC,KAAK,OAAO,CAAC,CAAC,OAAO,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC;QAC/C,KAAK,KAAK,CAAC,CAAC,OAAO,SAAS,CAAC;IAC/B,CAAC;AACH,CAAC;AAED,SAAS,kBAAkB,CAAC,IAAiB,EAAE,MAAmB;IAChE,MAAM,IAAI,GAAG,cAAc,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC1C,OAAO,GAAG,IAAI,IAAI,CAAC;AACrB,CAAC;AAED,SAAS,YAAY,CAAC,IAAiB,EAAE,MAAmB;IAC1D,OAAO,cAAc,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACtC,CAAC;AAED,MAAM,UAAU,UAAU,CACxB,MAAmB,EACnB,KAAmB;IAEnB,MAAM,EACJ,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,WAAW,GAAG,KAAK,EACnB,kBAAkB,GACnB,GAAG,KAAK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,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,MAAM;KAC9E,CAAC;IAEF,MAAM,SAAS,GAAG,SAAS,CAAC;IAC5B,MAAM,QAAQ,GAAG,EAAE,CAAC;IAEpB,MAAM,kBAAkB,GAAG;QACzB,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE;QAC1B,YAAY,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE;KAC9B,CAAC;IAEF,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC;IAEvD,MAAM,OAAO,GAAG,IAAI,KAAK,OAAO,CAAC;IAEjC,OAAO;QACL,cAAc;QACd,cAAc;QACd,aAAa;QACb,UAAU;QACV,YAAY;QACZ,SAAS;QACT,QAAQ;QACR,kBAAkB;QAClB,gBAAgB;QAChB,SAAS;QACT,QAAQ;QACR,WAAW;QACX,kBAAkB,EAAE;YAClB,kBAAkB,EAAE,kBAAkB,IAAI,GAAG,IAAI,UAAU;YAC3D,iBAAiB,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM;YAC7C,uBAAuB,EAAE,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ;SAC1D;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { View, type ViewProps } from 'react-native';
|
|
2
|
+
import type { CodeBlockProps } from './types.js';
|
|
3
|
+
export declare const CodeBlock: import("react").ForwardRefExoticComponent<CodeBlockProps & Omit<ViewProps, keyof CodeBlockProps> & import("react").RefAttributes<View>>;
|
|
4
|
+
//# sourceMappingURL=code-block.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-block.d.ts","sourceRoot":"","sources":["../../../../src/components/content/code-block/code-block.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAGpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,eAAO,MAAM,SAAS,yIA4BpB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// src/components/content/code-block/code-block.tsx
|
|
2
|
+
import { forwardRef, createElement } from 'react';
|
|
3
|
+
import { View } from 'react-native';
|
|
4
|
+
import { useTheme } from '../../../theme/context.js';
|
|
5
|
+
import { useCodeBlock } from './use-code-block.js';
|
|
6
|
+
export const CodeBlock = forwardRef(function CodeBlock(props, ref) {
|
|
7
|
+
const { tokens } = useTheme();
|
|
8
|
+
const { code: _code, language: _language, showLineNumbers: _showLineNumbers, showCopyButton: _showCopyButton, showLanguageBadge: _showLanguageBadge, maxHeight: _maxHeight, bg: _bg, p: _p, px: _px, py: _py, pt: _pt, pb: _pb, pl: _pl, pr: _pr, m: _m, mx: _mx, my: _my, mt: _mt, mb: _mb, ml: _ml, mr: _mr, rounded: _r, shadow: _sh, flex: _f, row: _row, center: _cen, w: _w, h: _h, borderWidth: _bw, borderColor: _bc, opacity: _op, overflow: _ov, position: _pos, top: _top, bottom: _bot, left: _left, right: _right, zIndex: _zi, accessibilityLabel: _al, testID, ...rest } = props;
|
|
9
|
+
const { containerStyle, accessibilityProps } = useCodeBlock(tokens, props);
|
|
10
|
+
return createElement(View, { ref, style: containerStyle, ...accessibilityProps, testID, ...rest });
|
|
11
|
+
});
|
|
12
|
+
//# sourceMappingURL=code-block.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-block.js","sourceRoot":"","sources":["../../../../src/components/content/code-block/code-block.tsx"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,OAAO,EAAE,UAAU,EAAE,aAAa,EAAY,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAkB,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2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AM,EAAE,cAAc,EAAE,kBAAkB,EAAE,GAAG,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAE3E,OAAO,aAAa,CAClB,IAAW,EACX,EAAE,GAAG,EAAE,KAAK,EAAE,cAAqB,EAAE,GAAG,kBAAkB,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,CAC9E,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/content/code-block/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/content/code-block/index.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ViewStyle, TextStyle } from 'react-native';
|
|
2
|
+
import type { BoxStyleProps } from '../../types.js';
|
|
3
|
+
export interface CodeBlockProps extends BoxStyleProps {
|
|
4
|
+
code: string;
|
|
5
|
+
language?: string;
|
|
6
|
+
showLineNumbers?: boolean;
|
|
7
|
+
showCopyButton?: boolean;
|
|
8
|
+
showLanguageBadge?: boolean;
|
|
9
|
+
maxHeight?: number;
|
|
10
|
+
accessibilityLabel?: string;
|
|
11
|
+
testID?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface UseCodeBlockResult {
|
|
14
|
+
containerStyle: ViewStyle;
|
|
15
|
+
headerStyle: ViewStyle;
|
|
16
|
+
languageBadgeStyle: TextStyle;
|
|
17
|
+
copyButtonStyle: ViewStyle;
|
|
18
|
+
copyButtonIconColor: string;
|
|
19
|
+
codeContainerStyle: ViewStyle;
|
|
20
|
+
lineNumberStyle: TextStyle;
|
|
21
|
+
codeTextStyle: TextStyle;
|
|
22
|
+
lineCount: number;
|
|
23
|
+
getLineStyle: (index: number) => ViewStyle;
|
|
24
|
+
showHeader: boolean;
|
|
25
|
+
showLineNumbers: boolean;
|
|
26
|
+
showCopyButton: boolean;
|
|
27
|
+
showLanguageBadge: boolean;
|
|
28
|
+
resolvedLanguage: string;
|
|
29
|
+
accessibilityProps: {
|
|
30
|
+
accessibilityLabel: string;
|
|
31
|
+
accessibilityRole: 'none';
|
|
32
|
+
accessibilityHint: string;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/content/code-block/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD,MAAM,WAAW,cAAe,SAAQ,aAAa;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,cAAc,EAAE,SAAS,CAAC;IAC1B,WAAW,EAAE,SAAS,CAAC;IACvB,kBAAkB,EAAE,SAAS,CAAC;IAC9B,eAAe,EAAE,SAAS,CAAC;IAC3B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,kBAAkB,EAAE,SAAS,CAAC;IAC9B,eAAe,EAAE,SAAS,CAAC;IAC3B,aAAa,EAAE,SAAS,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,SAAS,CAAC;IAC3C,UAAU,EAAE,OAAO,CAAC;IACpB,eAAe,EAAE,OAAO,CAAC;IACzB,cAAc,EAAE,OAAO,CAAC;IACxB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,kBAAkB,EAAE;QAClB,kBAAkB,EAAE,MAAM,CAAC;QAC3B,iBAAiB,EAAE,MAAM,CAAC;QAC1B,iBAAiB,EAAE,MAAM,CAAC;KAC3B,CAAC;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/content/code-block/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ThemeTokens } from '../../../theme/tokens.js';
|
|
2
|
+
import type { CodeBlockProps, UseCodeBlockResult } from './types.js';
|
|
3
|
+
export declare function useCodeBlock(tokens: ThemeTokens, props: CodeBlockProps): UseCodeBlockResult;
|
|
4
|
+
//# sourceMappingURL=use-code-block.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-code-block.d.ts","sourceRoot":"","sources":["../../../../src/components/content/code-block/use-code-block.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErE,wBAAgB,YAAY,CAC1B,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,cAAc,GACpB,kBAAkB,CAoGpB"}
|