panelui-native 0.25.0 → 0.30.0
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 +18 -1
- package/lib/module/components/accordion/index.js +8 -8
- package/lib/module/components/accordion/index.js.map +1 -1
- package/lib/module/components/alert/index.js +2 -2
- package/lib/module/components/alert/index.js.map +1 -1
- package/lib/module/components/area-chart/index.js +182 -50
- package/lib/module/components/area-chart/index.js.map +1 -1
- package/lib/module/components/attachment/index.js +2 -1
- package/lib/module/components/attachment/index.js.map +1 -1
- package/lib/module/components/avatar/index.js +3 -3
- package/lib/module/components/avatar/index.js.map +1 -1
- package/lib/module/components/badge/index.js +4 -4
- package/lib/module/components/badge/index.js.map +1 -1
- package/lib/module/components/bar-chart/index.js +197 -56
- package/lib/module/components/bar-chart/index.js.map +1 -1
- package/lib/module/components/bottom-sheet/index.js +15 -10
- package/lib/module/components/bottom-sheet/index.js.map +1 -1
- package/lib/module/components/breadcrumb/index.js +6 -6
- package/lib/module/components/breadcrumb/index.js.map +1 -1
- package/lib/module/components/button/index.js +11 -6
- package/lib/module/components/button/index.js.map +1 -1
- package/lib/module/components/calendar/index.js +792 -0
- package/lib/module/components/calendar/index.js.map +1 -0
- package/lib/module/components/carousel/index.js +680 -0
- package/lib/module/components/carousel/index.js.map +1 -0
- package/lib/module/components/chip/index.js +4 -4
- package/lib/module/components/chip/index.js.map +1 -1
- package/lib/module/components/code-block/highlight.js +363 -0
- package/lib/module/components/code-block/highlight.js.map +1 -0
- package/lib/module/components/code-block/index.js +313 -0
- package/lib/module/components/code-block/index.js.map +1 -0
- package/lib/module/components/date-picker/index.js +165 -0
- package/lib/module/components/date-picker/index.js.map +1 -0
- package/lib/module/components/dialog/index.js +7 -2
- package/lib/module/components/dialog/index.js.map +1 -1
- package/lib/module/components/direction/index.js +2 -1
- package/lib/module/components/direction/index.js.map +1 -1
- package/lib/module/components/empty-state/index.js +2 -2
- package/lib/module/components/empty-state/index.js.map +1 -1
- package/lib/module/components/field/index.js +5 -5
- package/lib/module/components/field/index.js.map +1 -1
- package/lib/module/components/flow/index.js +3 -3
- package/lib/module/components/flow/index.js.map +1 -1
- package/lib/module/components/frame/index.js +5 -5
- package/lib/module/components/frame/index.js.map +1 -1
- package/lib/module/components/input-group/index.js +3 -2
- package/lib/module/components/input-group/index.js.map +1 -1
- package/lib/module/components/item/index.js +9 -9
- package/lib/module/components/item/index.js.map +1 -1
- package/lib/module/components/label/index.js +4 -4
- package/lib/module/components/label/index.js.map +1 -1
- package/lib/module/components/line-chart/index.js +167 -44
- package/lib/module/components/line-chart/index.js.map +1 -1
- package/lib/module/components/map/index.js +7 -7
- package/lib/module/components/map/index.js.map +1 -1
- package/lib/module/components/marker/index.js +3 -3
- package/lib/module/components/marker/index.js.map +1 -1
- package/lib/module/components/menu/index.js +714 -0
- package/lib/module/components/menu/index.js.map +1 -0
- package/lib/module/components/message/index.js +7 -7
- package/lib/module/components/message/index.js.map +1 -1
- package/lib/module/components/message-scroller/index.js +5 -4
- package/lib/module/components/message-scroller/index.js.map +1 -1
- package/lib/module/components/plan/index.js +296 -0
- package/lib/module/components/plan/index.js.map +1 -0
- package/lib/module/components/popover/index.js +73 -10
- package/lib/module/components/popover/index.js.map +1 -1
- package/lib/module/components/radio-group/index.js +15 -10
- package/lib/module/components/radio-group/index.js.map +1 -1
- package/lib/module/components/reasoning/index.js +244 -0
- package/lib/module/components/reasoning/index.js.map +1 -0
- package/lib/module/components/section-rail/index.js +4 -4
- package/lib/module/components/section-rail/index.js.map +1 -1
- package/lib/module/components/select/index.js +10 -4
- package/lib/module/components/select/index.js.map +1 -1
- package/lib/module/components/sources/index.js +221 -0
- package/lib/module/components/sources/index.js.map +1 -0
- package/lib/module/components/steps/index.js +4 -4
- package/lib/module/components/steps/index.js.map +1 -1
- package/lib/module/components/tabs/index.js +7 -7
- package/lib/module/components/tabs/index.js.map +1 -1
- package/lib/module/components/task/index.js +300 -0
- package/lib/module/components/task/index.js.map +1 -0
- package/lib/module/components/textarea/index.js +295 -0
- package/lib/module/components/textarea/index.js.map +1 -0
- package/lib/module/components/timeline/index.js +4 -4
- package/lib/module/components/timeline/index.js.map +1 -1
- package/lib/module/components/toast/index.js +2 -2
- package/lib/module/components/toast/index.js.map +1 -1
- package/lib/module/components/toggle-button/index.js +5 -5
- package/lib/module/components/toggle-button/index.js.map +1 -1
- package/lib/module/components/tooltip/index.js +648 -0
- package/lib/module/components/tooltip/index.js.map +1 -0
- package/lib/module/components/typography/index.js +2 -2
- package/lib/module/components/typography/index.js.map +1 -1
- package/lib/module/hooks/index.js +1 -0
- package/lib/module/hooks/index.js.map +1 -1
- package/lib/module/hooks/use-back-handler.js +37 -0
- package/lib/module/hooks/use-back-handler.js.map +1 -0
- package/lib/module/icons/index.js +202 -0
- package/lib/module/icons/index.js.map +1 -1
- package/lib/module/index.js +13 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/primitives/collapse.js +112 -0
- package/lib/module/primitives/collapse.js.map +1 -0
- package/lib/module/primitives/keyboard-avoider.js +2 -1
- package/lib/module/primitives/keyboard-avoider.js.map +1 -1
- package/lib/module/primitives/text.js +25 -1
- package/lib/module/primitives/text.js.map +1 -1
- package/lib/module/utils/date.js +386 -0
- package/lib/module/utils/date.js.map +1 -0
- package/lib/typescript/src/components/accordion/index.d.ts.map +1 -1
- package/lib/typescript/src/components/alert/index.d.ts.map +1 -1
- package/lib/typescript/src/components/area-chart/index.d.ts +41 -1
- package/lib/typescript/src/components/area-chart/index.d.ts.map +1 -1
- package/lib/typescript/src/components/attachment/index.d.ts.map +1 -1
- package/lib/typescript/src/components/bar-chart/index.d.ts +44 -2
- package/lib/typescript/src/components/bar-chart/index.d.ts.map +1 -1
- package/lib/typescript/src/components/bottom-sheet/index.d.ts.map +1 -1
- package/lib/typescript/src/components/breadcrumb/index.d.ts.map +1 -1
- package/lib/typescript/src/components/button/index.d.ts.map +1 -1
- package/lib/typescript/src/components/calendar/index.d.ts +173 -0
- package/lib/typescript/src/components/calendar/index.d.ts.map +1 -0
- package/lib/typescript/src/components/carousel/index.d.ts +179 -0
- package/lib/typescript/src/components/carousel/index.d.ts.map +1 -0
- package/lib/typescript/src/components/chip/index.d.ts.map +1 -1
- package/lib/typescript/src/components/code-block/highlight.d.ts +39 -0
- package/lib/typescript/src/components/code-block/highlight.d.ts.map +1 -0
- package/lib/typescript/src/components/code-block/index.d.ts +113 -0
- package/lib/typescript/src/components/code-block/index.d.ts.map +1 -0
- package/lib/typescript/src/components/date-picker/index.d.ts +97 -0
- package/lib/typescript/src/components/date-picker/index.d.ts.map +1 -0
- package/lib/typescript/src/components/dialog/index.d.ts.map +1 -1
- package/lib/typescript/src/components/direction/index.d.ts.map +1 -1
- package/lib/typescript/src/components/empty-state/index.d.ts.map +1 -1
- package/lib/typescript/src/components/field/index.d.ts.map +1 -1
- package/lib/typescript/src/components/frame/index.d.ts.map +1 -1
- package/lib/typescript/src/components/input-group/index.d.ts.map +1 -1
- package/lib/typescript/src/components/item/index.d.ts.map +1 -1
- package/lib/typescript/src/components/label/index.d.ts.map +1 -1
- package/lib/typescript/src/components/line-chart/index.d.ts +41 -2
- package/lib/typescript/src/components/line-chart/index.d.ts.map +1 -1
- package/lib/typescript/src/components/map/index.d.ts.map +1 -1
- package/lib/typescript/src/components/marker/index.d.ts.map +1 -1
- package/lib/typescript/src/components/menu/index.d.ts +261 -0
- package/lib/typescript/src/components/menu/index.d.ts.map +1 -0
- package/lib/typescript/src/components/message/index.d.ts.map +1 -1
- package/lib/typescript/src/components/message-scroller/index.d.ts.map +1 -1
- package/lib/typescript/src/components/plan/index.d.ts +127 -0
- package/lib/typescript/src/components/plan/index.d.ts.map +1 -0
- package/lib/typescript/src/components/popover/index.d.ts +35 -1
- package/lib/typescript/src/components/popover/index.d.ts.map +1 -1
- package/lib/typescript/src/components/radio-group/index.d.ts.map +1 -1
- package/lib/typescript/src/components/reasoning/index.d.ts +97 -0
- package/lib/typescript/src/components/reasoning/index.d.ts.map +1 -0
- package/lib/typescript/src/components/select/index.d.ts.map +1 -1
- package/lib/typescript/src/components/sources/index.d.ts +85 -0
- package/lib/typescript/src/components/sources/index.d.ts.map +1 -0
- package/lib/typescript/src/components/steps/index.d.ts.map +1 -1
- package/lib/typescript/src/components/tabs/index.d.ts.map +1 -1
- package/lib/typescript/src/components/task/index.d.ts +103 -0
- package/lib/typescript/src/components/task/index.d.ts.map +1 -0
- package/lib/typescript/src/components/textarea/index.d.ts +175 -0
- package/lib/typescript/src/components/textarea/index.d.ts.map +1 -0
- package/lib/typescript/src/components/timeline/index.d.ts.map +1 -1
- package/lib/typescript/src/components/toast/index.d.ts.map +1 -1
- package/lib/typescript/src/components/toggle-button/index.d.ts.map +1 -1
- package/lib/typescript/src/components/tooltip/index.d.ts +180 -0
- package/lib/typescript/src/components/tooltip/index.d.ts.map +1 -0
- package/lib/typescript/src/components/typography/index.d.ts.map +1 -1
- package/lib/typescript/src/hooks/index.d.ts +1 -0
- package/lib/typescript/src/hooks/index.d.ts.map +1 -1
- package/lib/typescript/src/hooks/use-back-handler.d.ts +19 -0
- package/lib/typescript/src/hooks/use-back-handler.d.ts.map +1 -0
- package/lib/typescript/src/icons/index.d.ts +17 -0
- package/lib/typescript/src/icons/index.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +16 -4
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/primitives/collapse.d.ts +42 -0
- package/lib/typescript/src/primitives/collapse.d.ts.map +1 -0
- package/lib/typescript/src/primitives/keyboard-avoider.d.ts.map +1 -1
- package/lib/typescript/src/primitives/text.d.ts +20 -0
- package/lib/typescript/src/primitives/text.d.ts.map +1 -1
- package/lib/typescript/src/utils/date.d.ts +116 -0
- package/lib/typescript/src/utils/date.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/components/accordion/index.tsx +8 -12
- package/src/components/alert/index.tsx +2 -2
- package/src/components/area-chart/index.tsx +208 -55
- package/src/components/attachment/index.tsx +2 -2
- package/src/components/avatar/index.tsx +3 -3
- package/src/components/badge/index.tsx +6 -6
- package/src/components/bar-chart/index.tsx +214 -54
- package/src/components/bottom-sheet/index.tsx +17 -16
- package/src/components/breadcrumb/index.tsx +6 -8
- package/src/components/button/index.tsx +12 -8
- package/src/components/calendar/index.tsx +970 -0
- package/src/components/carousel/index.tsx +788 -0
- package/src/components/chip/index.tsx +4 -6
- package/src/components/code-block/highlight.ts +278 -0
- package/src/components/code-block/index.tsx +341 -0
- package/src/components/date-picker/index.tsx +255 -0
- package/src/components/dialog/index.tsx +7 -2
- package/src/components/direction/index.tsx +2 -1
- package/src/components/empty-state/index.tsx +2 -2
- package/src/components/field/index.tsx +3 -5
- package/src/components/flow/index.tsx +3 -3
- package/src/components/frame/index.tsx +5 -7
- package/src/components/input-group/index.tsx +3 -2
- package/src/components/item/index.tsx +9 -9
- package/src/components/label/index.tsx +2 -2
- package/src/components/line-chart/index.tsx +189 -50
- package/src/components/map/index.tsx +7 -9
- package/src/components/marker/index.tsx +3 -3
- package/src/components/menu/index.tsx +812 -0
- package/src/components/message/index.tsx +7 -7
- package/src/components/message-scroller/index.tsx +5 -4
- package/src/components/plan/index.tsx +325 -0
- package/src/components/popover/index.tsx +111 -8
- package/src/components/radio-group/index.tsx +13 -4
- package/src/components/reasoning/index.tsx +297 -0
- package/src/components/section-rail/index.tsx +4 -4
- package/src/components/select/index.tsx +10 -4
- package/src/components/sources/index.tsx +278 -0
- package/src/components/steps/index.tsx +4 -4
- package/src/components/tabs/index.tsx +7 -9
- package/src/components/task/index.tsx +329 -0
- package/src/components/textarea/index.tsx +381 -0
- package/src/components/timeline/index.tsx +4 -4
- package/src/components/toast/index.tsx +2 -2
- package/src/components/toggle-button/index.tsx +5 -7
- package/src/components/tooltip/index.tsx +793 -0
- package/src/components/typography/index.tsx +2 -2
- package/src/hooks/index.ts +1 -0
- package/src/hooks/use-back-handler.ts +37 -0
- package/src/icons/index.tsx +147 -0
- package/src/index.ts +116 -0
- package/src/primitives/collapse.tsx +128 -0
- package/src/primitives/keyboard-avoider.tsx +2 -1
- package/src/primitives/text.tsx +28 -1
- package/src/utils/date.ts +446 -0
- package/theme.css +112 -0
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* CodeBlock — a fenced snippet, syntax-coloured and scrolled sideways.
|
|
5
|
+
*
|
|
6
|
+
* Code does not wrap. Wrapping a line of code puts the continuation under the
|
|
7
|
+
* indentation and the two stop meaning different things, so the body scrolls
|
|
8
|
+
* horizontally instead — which on a phone is the only honest way to show a
|
|
9
|
+
* ninety-column line.
|
|
10
|
+
*
|
|
11
|
+
* ```tsx
|
|
12
|
+
* <CodeBlock code={code} language="tsx">
|
|
13
|
+
* <CodeBlock.Header>
|
|
14
|
+
* <CodeBlock.Filename>calendar.tsx</CodeBlock.Filename>
|
|
15
|
+
* <CodeBlock.CopyButton />
|
|
16
|
+
* </CodeBlock.Header>
|
|
17
|
+
* </CodeBlock>
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* ## Colouring
|
|
21
|
+
*
|
|
22
|
+
* The highlighter is a single pass of regex, shipped in the component, over the
|
|
23
|
+
* languages a chat actually streams. There is no grammar and no worker, because
|
|
24
|
+
* the alternative costs megabytes and has to run again on every frame of a
|
|
25
|
+
* stream. It gets keywords, strings, comments and numbers right in a twelve-line
|
|
26
|
+
* snippet and does not pretend to more; an unrecognised language renders as
|
|
27
|
+
* clean monospace rather than as a guess. Colours come from the theme's
|
|
28
|
+
* `--color-code-*` tokens, so a snippet follows light and dark like everything
|
|
29
|
+
* else.
|
|
30
|
+
*
|
|
31
|
+
* ## Where the props come from
|
|
32
|
+
*
|
|
33
|
+
* With the AI SDK, `code` and `language` are what you pull out of a fenced
|
|
34
|
+
* block in a text part, or the fields of a tool call that wrote a file.
|
|
35
|
+
*/
|
|
36
|
+
import { createContext, useContext, useMemo } from 'react';
|
|
37
|
+
import { ScrollView, View } from 'react-native';
|
|
38
|
+
import { tv } from 'tailwind-variants';
|
|
39
|
+
import { useCSSVariable } from 'uniwind';
|
|
40
|
+
import { useCopyToClipboard } from "../../hooks/use-copy-to-clipboard.js";
|
|
41
|
+
import { CheckIcon, CopyIcon } from "../../icons/index.js";
|
|
42
|
+
import { Text } from "../../primitives/text.js";
|
|
43
|
+
import { cn } from "../../utils/cn.js";
|
|
44
|
+
import { AnimatedPressable } from "../../primitives/animated-pressable.js";
|
|
45
|
+
import { highlight } from "./highlight.js";
|
|
46
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
47
|
+
const codeBlockVariants = tv({
|
|
48
|
+
slots: {
|
|
49
|
+
root: 'w-full overflow-hidden rounded-2xl border border-border bg-muted/40',
|
|
50
|
+
header: 'flex-row items-center justify-between gap-2 border-b border-border px-3 py-2',
|
|
51
|
+
filename: 'font-mono text-xs text-muted-foreground',
|
|
52
|
+
language: 'text-xs uppercase tracking-wide text-muted-foreground',
|
|
53
|
+
actions: 'flex-row items-center gap-1',
|
|
54
|
+
action: 'h-7 w-7 items-center justify-center rounded-lg active:bg-accent',
|
|
55
|
+
body: 'p-3',
|
|
56
|
+
line: 'flex-row',
|
|
57
|
+
/*
|
|
58
|
+
* `leading-*` on the row rather than on each token: the tokens of a line
|
|
59
|
+
* are separate Text nodes, and a line height set on some of them and not
|
|
60
|
+
* others makes the baseline jog wherever a keyword ends.
|
|
61
|
+
*/
|
|
62
|
+
gutter: 'w-8 pe-3 text-end font-mono text-xs text-muted-foreground/50',
|
|
63
|
+
code: 'font-mono text-xs leading-5'
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
const CodeBlockContext = /*#__PURE__*/createContext(null);
|
|
67
|
+
function useCodeBlock(component) {
|
|
68
|
+
const context = useContext(CodeBlockContext);
|
|
69
|
+
if (!context) {
|
|
70
|
+
throw new Error(`${component} must be used within a <CodeBlock>`);
|
|
71
|
+
}
|
|
72
|
+
return context;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** Which theme token paints each kind of token. */
|
|
76
|
+
const TOKEN_COLORS = {
|
|
77
|
+
plain: '--color-foreground',
|
|
78
|
+
keyword: '--color-code-keyword',
|
|
79
|
+
string: '--color-code-string',
|
|
80
|
+
number: '--color-code-number',
|
|
81
|
+
comment: '--color-code-comment',
|
|
82
|
+
function: '--color-code-function',
|
|
83
|
+
property: '--color-code-property',
|
|
84
|
+
punctuation: '--color-code-punctuation',
|
|
85
|
+
inserted: '--color-code-inserted',
|
|
86
|
+
deleted: '--color-code-deleted'
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* The palette, resolved once for the whole block.
|
|
91
|
+
*
|
|
92
|
+
* `useCSSVariable` is a hook, so it cannot be called per token — and a snippet
|
|
93
|
+
* has hundreds. Ten lookups at the top and a lookup table underneath is the
|
|
94
|
+
* same answer at a fraction of the cost.
|
|
95
|
+
*/
|
|
96
|
+
function useTokenColors() {
|
|
97
|
+
const plain = useCSSVariable(TOKEN_COLORS.plain);
|
|
98
|
+
const keyword = useCSSVariable(TOKEN_COLORS.keyword);
|
|
99
|
+
const string = useCSSVariable(TOKEN_COLORS.string);
|
|
100
|
+
const number = useCSSVariable(TOKEN_COLORS.number);
|
|
101
|
+
const comment = useCSSVariable(TOKEN_COLORS.comment);
|
|
102
|
+
const fn = useCSSVariable(TOKEN_COLORS.function);
|
|
103
|
+
const property = useCSSVariable(TOKEN_COLORS.property);
|
|
104
|
+
const punctuation = useCSSVariable(TOKEN_COLORS.punctuation);
|
|
105
|
+
const inserted = useCSSVariable(TOKEN_COLORS.inserted);
|
|
106
|
+
const deleted = useCSSVariable(TOKEN_COLORS.deleted);
|
|
107
|
+
const only = value => typeof value === 'string' ? value : undefined;
|
|
108
|
+
return useMemo(() => ({
|
|
109
|
+
plain: only(plain),
|
|
110
|
+
keyword: only(keyword),
|
|
111
|
+
string: only(string),
|
|
112
|
+
number: only(number),
|
|
113
|
+
comment: only(comment),
|
|
114
|
+
function: only(fn),
|
|
115
|
+
property: only(property),
|
|
116
|
+
punctuation: only(punctuation),
|
|
117
|
+
inserted: only(inserted),
|
|
118
|
+
deleted: only(deleted)
|
|
119
|
+
}), [plain, keyword, string, number, comment, fn, property, punctuation, inserted, deleted]);
|
|
120
|
+
}
|
|
121
|
+
function CodeBlockRoot({
|
|
122
|
+
className,
|
|
123
|
+
code,
|
|
124
|
+
language,
|
|
125
|
+
showLineNumbers = false,
|
|
126
|
+
children,
|
|
127
|
+
...props
|
|
128
|
+
}) {
|
|
129
|
+
const slots = codeBlockVariants();
|
|
130
|
+
const colors = useTokenColors();
|
|
131
|
+
const lines = useMemo(() => highlight(code, language), [code, language]);
|
|
132
|
+
const context = useMemo(() => ({
|
|
133
|
+
code
|
|
134
|
+
}), [code]);
|
|
135
|
+
const gutterWidth = String(lines.length).length;
|
|
136
|
+
return /*#__PURE__*/_jsx(CodeBlockContext.Provider, {
|
|
137
|
+
value: context,
|
|
138
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
139
|
+
...props,
|
|
140
|
+
className: cn(slots.root(), className),
|
|
141
|
+
children: [children, /*#__PURE__*/_jsx(ScrollView, {
|
|
142
|
+
horizontal: true,
|
|
143
|
+
bounces: false,
|
|
144
|
+
showsHorizontalScrollIndicator: false,
|
|
145
|
+
contentContainerClassName: slots.body(),
|
|
146
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
147
|
+
children: lines.map((tokens, index) => /*#__PURE__*/_jsxs(View, {
|
|
148
|
+
className: slots.line(),
|
|
149
|
+
children: [showLineNumbers ? /*#__PURE__*/_jsx(Text, {
|
|
150
|
+
className: slots.gutter(),
|
|
151
|
+
style: {
|
|
152
|
+
width: 16 + gutterWidth * 7
|
|
153
|
+
},
|
|
154
|
+
children: index + 1
|
|
155
|
+
}) : null, /*#__PURE__*/_jsx(CodeLine, {
|
|
156
|
+
tokens: tokens,
|
|
157
|
+
colors: colors,
|
|
158
|
+
className: slots.code()
|
|
159
|
+
})]
|
|
160
|
+
}, index))
|
|
161
|
+
})
|
|
162
|
+
})]
|
|
163
|
+
})
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
CodeBlockRoot.displayName = 'CodeBlock';
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* One line, as a single Text with a run of coloured children.
|
|
170
|
+
*
|
|
171
|
+
* Nested Text rather than a row of Views: only inside one Text do the runs
|
|
172
|
+
* share a baseline and keep their spaces. A row of Views gives every token its
|
|
173
|
+
* own box and the line comes apart at the seams.
|
|
174
|
+
*/
|
|
175
|
+
function CodeLine({
|
|
176
|
+
tokens,
|
|
177
|
+
colors,
|
|
178
|
+
className
|
|
179
|
+
}) {
|
|
180
|
+
return /*#__PURE__*/_jsxs(Text, {
|
|
181
|
+
className: className,
|
|
182
|
+
children: [tokens.length === 0 ? ' ' : null, tokens.map((token, index) => /*#__PURE__*/_jsx(Text, {
|
|
183
|
+
className: className,
|
|
184
|
+
style: {
|
|
185
|
+
color: colors[token.kind]
|
|
186
|
+
},
|
|
187
|
+
children: token.text
|
|
188
|
+
}, index))]
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
/** The bar above the code: what the file is, and what can be done with it. */
|
|
192
|
+
function CodeBlockHeader({
|
|
193
|
+
className,
|
|
194
|
+
children,
|
|
195
|
+
...props
|
|
196
|
+
}) {
|
|
197
|
+
const {
|
|
198
|
+
header
|
|
199
|
+
} = codeBlockVariants();
|
|
200
|
+
return /*#__PURE__*/_jsx(View, {
|
|
201
|
+
...props,
|
|
202
|
+
className: cn(header(), className),
|
|
203
|
+
children: children
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
function CodeBlockFilename({
|
|
207
|
+
className,
|
|
208
|
+
children,
|
|
209
|
+
...props
|
|
210
|
+
}) {
|
|
211
|
+
const {
|
|
212
|
+
filename
|
|
213
|
+
} = codeBlockVariants();
|
|
214
|
+
return /*#__PURE__*/_jsx(Text, {
|
|
215
|
+
numberOfLines: 1,
|
|
216
|
+
className: cn(filename(), className),
|
|
217
|
+
...props,
|
|
218
|
+
children: children
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
/** The language, for a block with no filename to name it by. */
|
|
222
|
+
function CodeBlockLanguage({
|
|
223
|
+
className,
|
|
224
|
+
children,
|
|
225
|
+
...props
|
|
226
|
+
}) {
|
|
227
|
+
const {
|
|
228
|
+
language
|
|
229
|
+
} = codeBlockVariants();
|
|
230
|
+
return /*#__PURE__*/_jsx(Text, {
|
|
231
|
+
className: cn(language(), className),
|
|
232
|
+
...props,
|
|
233
|
+
children: children
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
function CodeBlockActions({
|
|
237
|
+
className,
|
|
238
|
+
children,
|
|
239
|
+
...props
|
|
240
|
+
}) {
|
|
241
|
+
const {
|
|
242
|
+
actions
|
|
243
|
+
} = codeBlockVariants();
|
|
244
|
+
return /*#__PURE__*/_jsx(View, {
|
|
245
|
+
...props,
|
|
246
|
+
className: cn(actions(), className),
|
|
247
|
+
children: children
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Copies the block's code.
|
|
252
|
+
*
|
|
253
|
+
* The tick is the whole feedback: there is no toast, because a snippet in a
|
|
254
|
+
* transcript is copied often and a notification for each one is noise.
|
|
255
|
+
*/
|
|
256
|
+
function CodeBlockCopyButton({
|
|
257
|
+
className,
|
|
258
|
+
timeout = 2000,
|
|
259
|
+
onCopy
|
|
260
|
+
}) {
|
|
261
|
+
const {
|
|
262
|
+
code
|
|
263
|
+
} = useCodeBlock('CodeBlock.CopyButton');
|
|
264
|
+
const {
|
|
265
|
+
action
|
|
266
|
+
} = codeBlockVariants();
|
|
267
|
+
const {
|
|
268
|
+
copy,
|
|
269
|
+
copied
|
|
270
|
+
} = useCopyToClipboard({
|
|
271
|
+
timeout
|
|
272
|
+
});
|
|
273
|
+
// Both glyphs are given a colour: the check's own fallback is white, which is
|
|
274
|
+
// invisible on this header in a light theme.
|
|
275
|
+
const rawTick = useCSSVariable('--color-success');
|
|
276
|
+
const rawIdle = useCSSVariable('--color-muted-foreground');
|
|
277
|
+
const tick = typeof rawTick === 'string' ? rawTick : undefined;
|
|
278
|
+
const idle = typeof rawIdle === 'string' ? rawIdle : undefined;
|
|
279
|
+
return /*#__PURE__*/_jsx(AnimatedPressable, {
|
|
280
|
+
accessibilityRole: "button",
|
|
281
|
+
accessibilityLabel: copied ? 'Copied' : 'Copy code',
|
|
282
|
+
accessibilityState: {
|
|
283
|
+
selected: copied
|
|
284
|
+
},
|
|
285
|
+
hitSlop: 6,
|
|
286
|
+
onPress: () => {
|
|
287
|
+
void copy(code);
|
|
288
|
+
onCopy?.();
|
|
289
|
+
},
|
|
290
|
+
className: cn(action(), className),
|
|
291
|
+
children: copied ? /*#__PURE__*/_jsx(CheckIcon, {
|
|
292
|
+
size: 14,
|
|
293
|
+
color: tick
|
|
294
|
+
}) : /*#__PURE__*/_jsx(CopyIcon, {
|
|
295
|
+
size: 14,
|
|
296
|
+
color: idle
|
|
297
|
+
})
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
CodeBlockHeader.displayName = 'CodeBlock.Header';
|
|
301
|
+
CodeBlockFilename.displayName = 'CodeBlock.Filename';
|
|
302
|
+
CodeBlockLanguage.displayName = 'CodeBlock.Language';
|
|
303
|
+
CodeBlockActions.displayName = 'CodeBlock.Actions';
|
|
304
|
+
CodeBlockCopyButton.displayName = 'CodeBlock.CopyButton';
|
|
305
|
+
export { resolveLanguage } from "./highlight.js";
|
|
306
|
+
export const CodeBlock = Object.assign(CodeBlockRoot, {
|
|
307
|
+
Header: CodeBlockHeader,
|
|
308
|
+
Filename: CodeBlockFilename,
|
|
309
|
+
Language: CodeBlockLanguage,
|
|
310
|
+
Actions: CodeBlockActions,
|
|
311
|
+
CopyButton: CodeBlockCopyButton
|
|
312
|
+
});
|
|
313
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createContext","useContext","useMemo","ScrollView","View","tv","useCSSVariable","useCopyToClipboard","CheckIcon","CopyIcon","Text","cn","AnimatedPressable","highlight","jsx","_jsx","jsxs","_jsxs","codeBlockVariants","slots","root","header","filename","language","actions","action","body","line","gutter","code","CodeBlockContext","useCodeBlock","component","context","Error","TOKEN_COLORS","plain","keyword","string","number","comment","function","property","punctuation","inserted","deleted","useTokenColors","fn","only","value","undefined","CodeBlockRoot","className","showLineNumbers","children","props","colors","lines","gutterWidth","String","length","Provider","horizontal","bounces","showsHorizontalScrollIndicator","contentContainerClassName","map","tokens","index","style","width","CodeLine","displayName","token","color","kind","text","CodeBlockHeader","CodeBlockFilename","numberOfLines","CodeBlockLanguage","CodeBlockActions","CodeBlockCopyButton","timeout","onCopy","copy","copied","rawTick","rawIdle","tick","idle","accessibilityRole","accessibilityLabel","accessibilityState","selected","hitSlop","onPress","size","resolveLanguage","CodeBlock","Object","assign","Header","Filename","Language","Actions","CopyButton"],"sourceRoot":"../../../../src","sources":["components/code-block/index.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,aAAa,EAAEC,UAAU,EAAEC,OAAO,QAAwB,OAAO;AAC1E,SAASC,UAAU,EAAEC,IAAI,QAAwB,cAAc;AAC/D,SAASC,EAAE,QAAQ,mBAAmB;AACtC,SAASC,cAAc,QAAQ,SAAS;AACxC,SAASC,kBAAkB,QAAQ,sCAAmC;AACtE,SAASC,SAAS,EAAEC,QAAQ,QAAQ,sBAAa;AACjD,SAASC,IAAI,QAAQ,0BAAuB;AAC5C,SAASC,EAAE,QAAQ,mBAAgB;AACnC,SAASC,iBAAiB,QAAQ,wCAAqC;AACvE,SAASC,SAAS,QAAqD,gBAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;A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sBAAsB;AAExD,SAAS0B,eAAe,QAAuD,gBAAa;AAE5F,OAAO,MAAMC,SAAS,GAAGC,MAAM,CAACC,MAAM,CAAClD,aAAa,EAAE;EACpDmD,MAAM,EAAEzB,eAAe;EACvB0B,QAAQ,EAAEzB,iBAAiB;EAC3B0B,QAAQ,EAAExB,iBAAiB;EAC3ByB,OAAO,EAAExB,gBAAgB;EACzByB,UAAU,EAAExB;AACd,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* DatePicker — a calendar behind a button.
|
|
5
|
+
*
|
|
6
|
+
* ```tsx
|
|
7
|
+
* const [day, setDay] = useState<Date>();
|
|
8
|
+
*
|
|
9
|
+
* <DatePicker selected={day} onSelect={setDay} placeholder="Pick a date" />
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* It is the `Calendar` in a `Popover` with a trigger that reads back what was
|
|
13
|
+
* chosen, and it is a separate component from the calendar for the same reason
|
|
14
|
+
* `Select` is separate from a list: the hard parts are the ones around the
|
|
15
|
+
* grid — what a closed field says, when the panel closes, and what a range
|
|
16
|
+
* shows while only half of it has been picked.
|
|
17
|
+
*
|
|
18
|
+
* ## It closes when the selection is finished, not when it changes
|
|
19
|
+
*
|
|
20
|
+
* A single date is done in one tap, so the panel closes on it. A range needs
|
|
21
|
+
* two, so it stays open until the second — closing on the first would put
|
|
22
|
+
* someone back where they started with half a range on screen. Multiple never
|
|
23
|
+
* closes on its own; only the caller knows when a set is complete.
|
|
24
|
+
*
|
|
25
|
+
* ## An anchored panel, not a sheet
|
|
26
|
+
*
|
|
27
|
+
* A month grid is a fixed size that fits beside its trigger on any phone, and
|
|
28
|
+
* a sheet is the right container for a list of unknown length rather than for
|
|
29
|
+
* a shape that is always the same. Pass `presentation="bottom-sheet"` where the
|
|
30
|
+
* screen is busy — a form with the keyboard up is the usual case.
|
|
31
|
+
*/
|
|
32
|
+
import { useCallback, useMemo, useState } from 'react';
|
|
33
|
+
import { View } from 'react-native';
|
|
34
|
+
import { CalendarIcon } from "../../icons/index.js";
|
|
35
|
+
import { Text } from "../../primitives/text.js";
|
|
36
|
+
import { cn } from "../../utils/cn.js";
|
|
37
|
+
import { calendarShortDate, resolveCalendar } from "../../utils/date.js";
|
|
38
|
+
import { Button } from "../button/index.js";
|
|
39
|
+
import { Calendar } from "../calendar/index.js";
|
|
40
|
+
import { Popover } from "../popover/index.js";
|
|
41
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
42
|
+
/** What a closed picker shows when nothing has been chosen yet. */
|
|
43
|
+
const DEFAULT_PLACEHOLDER = 'Pick a date';
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* The chosen value as one line of text.
|
|
47
|
+
*
|
|
48
|
+
* A half-picked range reads as its start followed by a dash rather than as
|
|
49
|
+
* just the start: the dash is what says the picker is waiting for the other
|
|
50
|
+
* end, and without it a half range looks like a finished single date.
|
|
51
|
+
*/
|
|
52
|
+
function describe(mode, value, locale, system) {
|
|
53
|
+
if (!value) return null;
|
|
54
|
+
const write = date => calendarShortDate(date, system, locale);
|
|
55
|
+
if (mode === 'range') {
|
|
56
|
+
const range = value;
|
|
57
|
+
if (!range.from) return null;
|
|
58
|
+
return range.to ? `${write(range.from)} – ${write(range.to)}` : `${write(range.from)} –`;
|
|
59
|
+
}
|
|
60
|
+
if (mode === 'multiple') {
|
|
61
|
+
const days = value;
|
|
62
|
+
if (!days.length) return null;
|
|
63
|
+
if (days.length === 1) return write(days[0]);
|
|
64
|
+
return `${days.length} dates`;
|
|
65
|
+
}
|
|
66
|
+
return write(value);
|
|
67
|
+
}
|
|
68
|
+
function DatePickerRoot({
|
|
69
|
+
mode = 'single',
|
|
70
|
+
selected,
|
|
71
|
+
defaultSelected,
|
|
72
|
+
onSelect,
|
|
73
|
+
open: openProp,
|
|
74
|
+
onOpenChange,
|
|
75
|
+
placeholder = DEFAULT_PLACEHOLDER,
|
|
76
|
+
format,
|
|
77
|
+
presentation = 'popover',
|
|
78
|
+
disabled = false,
|
|
79
|
+
disabledDates,
|
|
80
|
+
minDate,
|
|
81
|
+
maxDate,
|
|
82
|
+
startMonth,
|
|
83
|
+
endMonth,
|
|
84
|
+
numberOfMonths = 1,
|
|
85
|
+
captionLayout = 'label',
|
|
86
|
+
weekStartsOn = 0,
|
|
87
|
+
selectOutsideDays = false,
|
|
88
|
+
locale,
|
|
89
|
+
calendar = 'gregory',
|
|
90
|
+
className,
|
|
91
|
+
children
|
|
92
|
+
}) {
|
|
93
|
+
// Resolved here as well as in the grid, because the trigger's text has to be
|
|
94
|
+
// written in the same calendar the cells were tapped in.
|
|
95
|
+
const system = useMemo(() => resolveCalendar(calendar, locale), [calendar, locale]);
|
|
96
|
+
const [internalOpen, setInternalOpen] = useState(false);
|
|
97
|
+
const [internalSelected, setInternalSelected] = useState(defaultSelected);
|
|
98
|
+
const isOpenControlled = openProp !== undefined;
|
|
99
|
+
const open = isOpenControlled ? openProp : internalOpen;
|
|
100
|
+
const isControlled = selected !== undefined;
|
|
101
|
+
const value = isControlled ? selected : internalSelected;
|
|
102
|
+
const setOpen = useCallback(next => {
|
|
103
|
+
if (!isOpenControlled) setInternalOpen(next);
|
|
104
|
+
onOpenChange?.(next);
|
|
105
|
+
}, [isOpenControlled, onOpenChange]);
|
|
106
|
+
const handleSelect = useCallback(next => {
|
|
107
|
+
if (!isControlled) setInternalSelected(next);
|
|
108
|
+
onSelect?.(next);
|
|
109
|
+
|
|
110
|
+
// Done in one tap, so it closes on one. A range waits for its second end,
|
|
111
|
+
// and a set of dates is only the caller's to call finished.
|
|
112
|
+
if (mode === 'single' && next) setOpen(false);
|
|
113
|
+
if (mode === 'range' && next?.to) setOpen(false);
|
|
114
|
+
}, [isControlled, onSelect, mode, setOpen]);
|
|
115
|
+
const label = useMemo(() => {
|
|
116
|
+
if (format && value) return format(value);
|
|
117
|
+
return describe(mode, value, locale, system);
|
|
118
|
+
}, [format, value, mode, locale, system]);
|
|
119
|
+
const trigger = children ?? /*#__PURE__*/_jsxs(Button, {
|
|
120
|
+
variant: "outline",
|
|
121
|
+
disabled: disabled,
|
|
122
|
+
className: cn('justify-start gap-2', className),
|
|
123
|
+
children: [/*#__PURE__*/_jsx(CalendarIcon, {
|
|
124
|
+
size: 16
|
|
125
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
126
|
+
className: label ? undefined : 'text-muted-foreground',
|
|
127
|
+
children: label ?? placeholder
|
|
128
|
+
})]
|
|
129
|
+
});
|
|
130
|
+
return /*#__PURE__*/_jsxs(Popover, {
|
|
131
|
+
open: open,
|
|
132
|
+
onOpenChange: setOpen,
|
|
133
|
+
presentation: presentation,
|
|
134
|
+
children: [/*#__PURE__*/_jsx(Popover.Trigger, {
|
|
135
|
+
children: trigger
|
|
136
|
+
}), /*#__PURE__*/_jsx(Popover.Content, {
|
|
137
|
+
width: "content-fit",
|
|
138
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
139
|
+
className: "w-[308px] max-w-full self-center p-3",
|
|
140
|
+
children: /*#__PURE__*/_jsx(Calendar, {
|
|
141
|
+
bordered: false,
|
|
142
|
+
mode: mode,
|
|
143
|
+
selected: value,
|
|
144
|
+
onSelect: handleSelect,
|
|
145
|
+
disabled: disabledDates,
|
|
146
|
+
minDate: minDate,
|
|
147
|
+
maxDate: maxDate,
|
|
148
|
+
startMonth: startMonth,
|
|
149
|
+
endMonth: endMonth,
|
|
150
|
+
numberOfMonths: numberOfMonths,
|
|
151
|
+
captionLayout: captionLayout,
|
|
152
|
+
weekStartsOn: weekStartsOn,
|
|
153
|
+
selectOutsideDays: selectOutsideDays,
|
|
154
|
+
locale: locale,
|
|
155
|
+
calendar: calendar
|
|
156
|
+
})
|
|
157
|
+
})
|
|
158
|
+
})]
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
DatePickerRoot.displayName = 'DatePicker';
|
|
162
|
+
export const DatePicker = Object.assign(DatePickerRoot, {
|
|
163
|
+
Trigger: Popover.Trigger
|
|
164
|
+
});
|
|
165
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useCallback","useMemo","useState","View","CalendarIcon","Text","cn","calendarShortDate","resolveCalendar","Button","Calendar","Popover","jsx","_jsx","jsxs","_jsxs","DEFAULT_PLACEHOLDER","describe","mode","value","locale","system","write","date","range","from","to","days","length","DatePickerRoot","selected","defaultSelected","onSelect","open","openProp","onOpenChange","placeholder","format","presentation","disabled","disabledDates","minDate","maxDate","startMonth","endMonth","numberOfMonths","captionLayout","weekStartsOn","selectOutsideDays","calendar","className","children","internalOpen","setInternalOpen","internalSelected","setInternalSelected","isOpenControlled","undefined","isControlled","setOpen","next","handleSelect","label","trigger","variant","size","Trigger","Content","width","bordered","displayName","DatePicker","Object","assign"],"sourceRoot":"../../../../src","sources":["components/date-picker/index.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,OAAO,EAAEC,QAAQ,QAA2C,OAAO;AACzF,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,YAAY,QAAQ,sBAAa;AAC1C,SAASC,IAAI,QAAQ,0BAAuB;AAC5C,SAASC,EAAE,QAAQ,mBAAgB;AACnC,SAASC,iBAAiB,EAAEC,eAAe,QAA6B,qBAAkB;AAC1F,SAASC,MAAM,QAAQ,oBAAW;AAClC,SACEC,QAAQ,QAMH,sBAAa;AACpB,SAASC,OAAO,QAAkC,qBAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAI/D;AACA,MAAMC,mBAAmB,GAAG,aAAa;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,QAAQA,CACfC,IAAU,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EC,aAAc;UACxBC,OAAO,EAAEA,OAAQ;UACjBC,OAAO,EAAEA,OAAQ;UACjBC,UAAU,EAAEA,UAAW;UACvBC,QAAQ,EAAEA,QAAS;UACnBC,cAAc,EAAEA,cAAe;UAC/BC,aAAa,EAAEA,aAAc;UAC7BC,YAAY,EAAEA,YAAa;UAC3BC,iBAAiB,EAAEA,iBAAkB;UACrC5B,MAAM,EAAEA,MAAO;UACf6B,QAAQ,EAAEA;QAAS,CACpB;MAAC,CACE;IAAC,CACQ,CAAC;EAAA,CACX,CAAC;AAEd;AACApB,cAAc,CAACyC,WAAW,GAAG,YAAY;AAEzC,OAAO,MAAMC,UAAU,GAAGC,MAAM,CAACC,MAAM,CAAC5C,cAAc,EAAE;EACtDqC,OAAO,EAAEvD,OAAO,CAACuD;AACnB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -5,7 +5,8 @@ import { Pressable, View } from 'react-native';
|
|
|
5
5
|
import Animated, { FadeIn, FadeOut, ZoomIn } from 'react-native-reanimated';
|
|
6
6
|
import { Portal } from "../../primitives/portal.js";
|
|
7
7
|
import { Scrim } from "../../primitives/scrim.js";
|
|
8
|
-
import { Text } from "../../primitives/text.js";
|
|
8
|
+
import { Text, textChildren } from "../../primitives/text.js";
|
|
9
|
+
import { useBackHandler } from "../../hooks/use-back-handler.js";
|
|
9
10
|
import { cn } from "../../utils/cn.js";
|
|
10
11
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
12
|
const DialogContext = /*#__PURE__*/createContext(null);
|
|
@@ -65,6 +66,10 @@ function DialogContent({
|
|
|
65
66
|
open,
|
|
66
67
|
setOpen
|
|
67
68
|
} = context;
|
|
69
|
+
|
|
70
|
+
// While the dialog is up, the Android back button closes it rather than
|
|
71
|
+
// popping the screen behind — but only when tapping outside would too.
|
|
72
|
+
useBackHandler(open && dismissible, () => setOpen(false));
|
|
68
73
|
if (!open) return null;
|
|
69
74
|
return /*#__PURE__*/_jsx(Portal, {
|
|
70
75
|
children: /*#__PURE__*/_jsx(DialogContext.Provider, {
|
|
@@ -85,7 +90,7 @@ function DialogContent({
|
|
|
85
90
|
accessibilityViewIsModal: true,
|
|
86
91
|
className: cn('w-full max-w-sm gap-1.5 rounded-2xl border border-border bg-popover p-5 shadow-lg', className),
|
|
87
92
|
...props,
|
|
88
|
-
children: children
|
|
93
|
+
children: textChildren(children)
|
|
89
94
|
})]
|
|
90
95
|
})
|
|
91
96
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["cloneElement","createContext","forwardRef","isValidElement","useCallback","useContext","useMemo","useState","Pressable","View","Animated","FadeIn","FadeOut","ZoomIn","Portal","Scrim","Text","cn","jsx","_jsx","jsxs","_jsxs","DialogContext","useDialog","component","context","Error","DialogRoot","children","open","onOpenChange","defaultOpen","internalOpen","setInternalOpen","isControlled","undefined","resolvedOpen","setOpen","next","Provider","value","DialogTrigger","onPress","args","props","DialogContent","className","dismissible","blur","entering","duration","exiting","accessibilityLabel","springify","damping","stiffness","mass","accessibilityViewIsModal","DialogTitle","ref","size","weight","displayName","DialogDescription","muted","DialogFooter","DialogClose","Dialog","Object","assign","Trigger","Content","Title","Description","Footer","Close"],"sourceRoot":"../../../../src","sources":["components/dialog/index.tsx"],"mappings":";;AAAA,SACEA,YAAY,EACZC,aAAa,EACbC,UAAU,EACVC,cAAc,EACdC,WAAW,EACXC,UAAU,EACVC,OAAO,EACPC,QAAQ,QAGH,OAAO;AACd,SAASC,SAAS,EAAEC,IAAI,QAAwB,cAAc;AAC9D,OAAOC,QAAQ,IAAIC,MAAM,EAAEC,OAAO,EAAEC,MAAM,QAAQ,yBAAyB;AAC3E,SAASC,MAAM,QAAQ,4BAAyB;AAChD,SAASC,KAAK,QAAQ,2BAAwB;AAC9C,SAASC,IAAI,
|
|
1
|
+
{"version":3,"names":["cloneElement","createContext","forwardRef","isValidElement","useCallback","useContext","useMemo","useState","Pressable","View","Animated","FadeIn","FadeOut","ZoomIn","Portal","Scrim","Text","textChildren","useBackHandler","cn","jsx","_jsx","jsxs","_jsxs","DialogContext","useDialog","component","context","Error","DialogRoot","children","open","onOpenChange","defaultOpen","internalOpen","setInternalOpen","isControlled","undefined","resolvedOpen","setOpen","next","Provider","value","DialogTrigger","onPress","args","props","DialogContent","className","dismissible","blur","entering","duration","exiting","accessibilityLabel","springify","damping","stiffness","mass","accessibilityViewIsModal","DialogTitle","ref","size","weight","displayName","DialogDescription","muted","DialogFooter","DialogClose","Dialog","Object","assign","Trigger","Content","Title","Description","Footer","Close"],"sourceRoot":"../../../../src","sources":["components/dialog/index.tsx"],"mappings":";;AAAA,SACEA,YAAY,EACZC,aAAa,EACbC,UAAU,EACVC,cAAc,EACdC,WAAW,EACXC,UAAU,EACVC,OAAO,EACPC,QAAQ,QAGH,OAAO;AACd,SAASC,SAAS,EAAEC,IAAI,QAAwB,cAAc;AAC9D,OAAOC,QAAQ,IAAIC,MAAM,EAAEC,OAAO,EAAEC,MAAM,QAAQ,yBAAyB;AAC3E,SAASC,MAAM,QAAQ,4BAAyB;AAChD,SAASC,KAAK,QAAQ,2BAAwB;AAC9C,SAASC,IAAI,EAAkBC,YAAY,QAAQ,0BAAuB;AAC1E,SAASC,cAAc,QAAQ,iCAA8B;AAC7D,SAASC,EAAE,QAAQ,mBAAgB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAOpC,MAAMC,aAAa,gBAAGvB,aAAa,CAA4B,IAAI,CAAC;AAEpE,SAASwB,SAASA,CAACC,SAAiB,EAAsB;EACxD,MAAMC,OAAO,GAAGtB,UAAU,CAACmB,aAAa,CAAC;EACzC,IAAI,CAACG,OAAO,EAAE;IACZ,MAAM,IAAIC,KAAK,CAAC,GAAGF,SAAS,iCAAiC,CAAC;EAChE;EACA,OAAOC,OAAO;AAChB;AAWA,SAASE,UAAUA,CAAC;EAAEC,QAAQ;EAAEC,IAAI;EAAEC,YAAY;EAAEC,WAAW,GAAG;AAAmB,CAAC,EAAE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EACF,CAAC,CAAC;AACJ;AAEA,OAAO,MAAM8B,MAAM,GAAGC,MAAM,CAACC,MAAM,CAAC1C,UAAU,EAAE;EAC9C2C,OAAO,EAAE7B,aAAa;EACtB8B,OAAO,EAAE1B,aAAa;EACtB2B,KAAK,EAAEd,WAAW;EAClBe,WAAW,EAAEV,iBAAiB;EAC9BW,MAAM,EAAET,YAAY;EACpBU,KAAK,EAAET;AACT,CAAC,CAAC","ignoreList":[]}
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
import { useContext, useMemo } from 'react';
|
|
39
39
|
import { View } from 'react-native';
|
|
40
40
|
import { DirectionContext, deviceDirection, useDirection, useDirectionSign } from "../../hooks/use-direction.js";
|
|
41
|
+
import { textChildren } from "../../primitives/text.js";
|
|
41
42
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
42
43
|
export { useDirection, useDirectionSign };
|
|
43
44
|
/**
|
|
@@ -72,7 +73,7 @@ export function Direction({
|
|
|
72
73
|
className: className,
|
|
73
74
|
style: [directionStyle, style],
|
|
74
75
|
...props,
|
|
75
|
-
children: children
|
|
76
|
+
children: textChildren(children)
|
|
76
77
|
})
|
|
77
78
|
});
|
|
78
79
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useContext","useMemo","View","DirectionContext","deviceDirection","useDirection","useDirectionSign","jsx","_jsx","Direction","className","children","dir","style","props","inherited","value","directionStyle","direction","Provider","displayName"],"sourceRoot":"../../../../src","sources":["components/direction/index.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,UAAU,EAAEC,OAAO,QAAwB,OAAO;AAC3D,SAASC,IAAI,QAAwB,cAAc;AACnD,SACEC,gBAAgB,EAChBC,eAAe,EACfC,YAAY,EACZC,gBAAgB,QAEX,8BAA2B;AAAC,SAAAC,GAAA,IAAAC,IAAA;
|
|
1
|
+
{"version":3,"names":["useContext","useMemo","View","DirectionContext","deviceDirection","useDirection","useDirectionSign","textChildren","jsx","_jsx","Direction","className","children","dir","style","props","inherited","value","directionStyle","direction","Provider","displayName"],"sourceRoot":"../../../../src","sources":["components/direction/index.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,UAAU,EAAEC,OAAO,QAAwB,OAAO;AAC3D,SAASC,IAAI,QAAwB,cAAc;AACnD,SACEC,gBAAgB,EAChBC,eAAe,EACfC,YAAY,EACZC,gBAAgB,QAEX,8BAA2B;AAClC,SAASC,YAAY,QAAQ,0BAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAErD,SAASJ,YAAY,EAAEC,gBAAgB;AAcvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASI,SAASA,CAAC;EAAEC,SAAS;EAAEC,QAAQ;EAAEC,GAAG;EAAEC,KAAK;EAAE,GAAGC;AAAsB,CAAC,EAAE;EACvF,MAAMC,SAAS,GAAGhB,UAAU,CAACG,gBAAgB,CAAC;EAC9C,MAAMc,KAAK,GAAGJ,GAAG,IAAIG,SAAS,IAAIZ,eAAe,CAAC,CAAC;;EAEnD;EACA;EACA;EACA,MAAMc,cAAc,GAAGjB,OAAO,CAAC,OAAO;IAAEkB,SAAS,EAAEF;EAAM,CAAC,CAAU,EAAE,CAACA,KAAK,CAAC,CAAC;EAE9E,oBACER,IAAA,CAACN,gBAAgB,CAACiB,QAAQ;IAACH,KAAK,EAAEA,KAAM;IAAAL,QAAA,eACtCH,IAAA,CAACP,IAAI;MAACS,SAAS,EAAEA,SAAU;MAACG,KAAK,EAAE,CAACI,cAAc,EAAEJ,KAAK,CAAE;MAAA,GAAKC,KAAK;MAAAH,QAAA,EAClEL,YAAY,CAACK,QAAQ;IAAC,CACnB;EAAC,CACkB,CAAC;AAEhC;AAEAF,SAAS,CAACW,WAAW,GAAG,WAAW","ignoreList":[]}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
import { createContext, forwardRef, useContext } from 'react';
|
|
12
12
|
import { View } from 'react-native';
|
|
13
13
|
import { tv } from 'tailwind-variants';
|
|
14
|
-
import { Text } from "../../primitives/text.js";
|
|
14
|
+
import { Text, textChildren } from "../../primitives/text.js";
|
|
15
15
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
16
|
/** Sub-components read the size so the title, description and media scale with the root. */
|
|
17
17
|
const EmptyStateContext = /*#__PURE__*/createContext({
|
|
@@ -179,7 +179,7 @@ const EmptyStateMedia = /*#__PURE__*/forwardRef(({
|
|
|
179
179
|
})]
|
|
180
180
|
}) : null, /*#__PURE__*/_jsx(View, {
|
|
181
181
|
className: card(),
|
|
182
|
-
children: children
|
|
182
|
+
children: textChildren(children)
|
|
183
183
|
})]
|
|
184
184
|
});
|
|
185
185
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createContext","forwardRef","useContext","View","tv","Text","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","EmptyStateContext","size","emptyStateVariants","slots","root","header","title","description","content","variants","variant","default","card","sm","lg","defaultVariants","mediaVariants","wrapper","ghost","icon","EmptyStateRoot","className","props","ref","Provider","value","children","displayName","EmptyStateHeader","EmptyStateMedia","accessibilityElementsHidden","importantForAccessibility","EmptyStateTitle","EmptyStateDescription","EmptyStateContent","EmptyState","Object","assign","Header","Media","Title","Description","Content"],"sourceRoot":"../../../../src","sources":["components/empty-state/index.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,aAAa,EAAEC,UAAU,EAAEC,UAAU,QAAwB,OAAO;AAC7E,SAASC,IAAI,QAA6C,cAAc;AACxE,SAASC,EAAE,QAA2B,mBAAmB;AACzD,SAASC,IAAI,
|
|
1
|
+
{"version":3,"names":["createContext","forwardRef","useContext","View","tv","Text","textChildren","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","EmptyStateContext","size","emptyStateVariants","slots","root","header","title","description","content","variants","variant","default","card","sm","lg","defaultVariants","mediaVariants","wrapper","ghost","icon","EmptyStateRoot","className","props","ref","Provider","value","children","displayName","EmptyStateHeader","EmptyStateMedia","accessibilityElementsHidden","importantForAccessibility","EmptyStateTitle","EmptyStateDescription","EmptyStateContent","EmptyState","Object","assign","Header","Media","Title","Description","Content"],"sourceRoot":"../../../../src","sources":["components/empty-state/index.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,aAAa,EAAEC,UAAU,EAAEC,UAAU,QAAwB,OAAO;AAC7E,SAASC,IAAI,QAA6C,cAAc;AACxE,SAASC,EAAE,QAA2B,mBAAmB;AACzD,SAASC,IAAI,EAAkBC,YAAY,QAAQ,0BAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAI3E;AACA,MAAMC,iBAAiB,gBAAGb,aAAa,CAA2B;EAAEc,IAAI,EAAE;AAAU,CAAC,CAAC;AAEtF,MAAMC,kBAAkB,GAAGX,EAAE,CAAC;EAC5BY,KAAK,EAAE;IACLC,IAAI,EAAE,oCAAoC;IAC1CC,MAAM,EAAE,oCAAoC;IAC5CC,KAAK,EAAE,2CAA2C;IAClDC,WAAW,EAAE,mCAAmC;IAChDC,OAAO,EAAE;EACX,CAAC;EACDC,QAAQ,EAAE;IACRC,OAAO,EAAE;MACP;MACAC,OAAO,EAAE;QAAEP,IAAI,EAAE;MAAS,CAAC;MAC3B;MACA;MACAQ,IAAI,EAAE;QAAER,IAAI,EAAE;MAA2C;IAC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