@agimon-ai/po-native-components 0.0.0-alpha.13 → 0.0.0-alpha.130
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/LICENSE +149 -22
- package/dist/components/AgentAvatar.d.mts +14 -0
- package/dist/components/AgentAvatar.d.mts.map +1 -0
- package/dist/components/AgentAvatar.mjs +87 -0
- package/dist/components/AgentAvatar.mjs.map +1 -0
- package/dist/components/AnnotationSurface.d.mts +69 -0
- package/dist/components/AnnotationSurface.d.mts.map +1 -0
- package/dist/components/AnnotationSurface.mjs +426 -0
- package/dist/components/AnnotationSurface.mjs.map +1 -0
- package/dist/components/Badge.d.mts +1 -1
- package/dist/components/Badge.mjs +1 -1
- package/dist/components/Button.mjs +3 -3
- package/dist/components/Button.mjs.map +1 -1
- package/dist/components/CodeBlock.d.mts +3 -1
- package/dist/components/CodeBlock.d.mts.map +1 -1
- package/dist/components/CodeBlock.mjs +35 -47
- package/dist/components/CodeBlock.mjs.map +1 -1
- package/dist/components/CopyButton.d.mts +13 -0
- package/dist/components/CopyButton.d.mts.map +1 -0
- package/dist/components/CopyButton.mjs +43 -0
- package/dist/components/CopyButton.mjs.map +1 -0
- package/dist/components/CountBadge.d.mts +15 -0
- package/dist/components/CountBadge.d.mts.map +1 -0
- package/dist/components/CountBadge.mjs +49 -0
- package/dist/components/CountBadge.mjs.map +1 -0
- package/dist/components/Dialog.d.mts.map +1 -1
- package/dist/components/Dialog.mjs +9 -8
- package/dist/components/Dialog.mjs.map +1 -1
- package/dist/components/Dot.d.mts +1 -1
- package/dist/components/Dot.mjs +2 -2
- package/dist/components/DropdownMenu.d.mts +3 -1
- package/dist/components/DropdownMenu.d.mts.map +1 -1
- package/dist/components/DropdownMenu.mjs +21 -14
- package/dist/components/DropdownMenu.mjs.map +1 -1
- package/dist/components/HashlineLines.d.mts +13 -0
- package/dist/components/HashlineLines.d.mts.map +1 -0
- package/dist/components/HashlineLines.mjs +148 -0
- package/dist/components/HashlineLines.mjs.map +1 -0
- package/dist/components/HostFilter.d.mts +17 -0
- package/dist/components/HostFilter.d.mts.map +1 -0
- package/dist/components/HostFilter.mjs +66 -0
- package/dist/components/HostFilter.mjs.map +1 -0
- package/dist/components/HostTag.d.mts +7 -0
- package/dist/components/HostTag.d.mts.map +1 -0
- package/dist/components/HostTag.mjs +47 -0
- package/dist/components/HostTag.mjs.map +1 -0
- package/dist/components/InfoStrip.d.mts +9 -0
- package/dist/components/InfoStrip.d.mts.map +1 -0
- package/dist/components/InfoStrip.mjs +53 -0
- package/dist/components/InfoStrip.mjs.map +1 -0
- package/dist/components/Input.d.mts +3 -1
- package/dist/components/Input.d.mts.map +1 -1
- package/dist/components/Input.mjs +4 -3
- package/dist/components/Input.mjs.map +1 -1
- package/dist/components/Label.mjs +1 -1
- package/dist/components/List.d.mts.map +1 -1
- package/dist/components/List.mjs +38 -6
- package/dist/components/List.mjs.map +1 -1
- package/dist/components/LiveDuration.d.mts +30 -0
- package/dist/components/LiveDuration.d.mts.map +1 -0
- package/dist/components/LiveDuration.mjs +67 -0
- package/dist/components/LiveDuration.mjs.map +1 -0
- package/dist/components/Markdown.d.mts +10 -1
- package/dist/components/Markdown.d.mts.map +1 -1
- package/dist/components/Markdown.mjs +335 -26
- package/dist/components/Markdown.mjs.map +1 -1
- package/dist/components/MessageItem.d.mts +10 -15
- package/dist/components/MessageItem.d.mts.map +1 -1
- package/dist/components/MessageItem.mjs +72 -63
- package/dist/components/MessageItem.mjs.map +1 -1
- package/dist/components/NativeShellState.d.mts +30 -0
- package/dist/components/NativeShellState.d.mts.map +1 -0
- package/dist/components/NativeShellState.mjs +61 -0
- package/dist/components/NativeShellState.mjs.map +1 -0
- package/dist/components/SectionLabel.mjs +1 -1
- package/dist/components/Select.d.mts +33 -0
- package/dist/components/Select.d.mts.map +1 -0
- package/dist/components/Select.mjs +222 -0
- package/dist/components/Select.mjs.map +1 -0
- package/dist/components/Sheet.d.mts +9 -1
- package/dist/components/Sheet.d.mts.map +1 -1
- package/dist/components/Sheet.mjs +27 -10
- package/dist/components/Sheet.mjs.map +1 -1
- package/dist/components/SheetFrame.mjs +143 -28
- package/dist/components/SheetFrame.mjs.map +1 -1
- package/dist/components/SheetList.d.mts +14 -0
- package/dist/components/SheetList.d.mts.map +1 -0
- package/dist/components/SheetList.mjs +34 -0
- package/dist/components/SheetList.mjs.map +1 -0
- package/dist/components/ShowMore.d.mts +10 -0
- package/dist/components/ShowMore.d.mts.map +1 -0
- package/dist/components/ShowMore.mjs +44 -0
- package/dist/components/ShowMore.mjs.map +1 -0
- package/dist/components/Spinner.d.mts +1 -1
- package/dist/components/StatusBadge.d.mts +1 -1
- package/dist/components/Switch.d.mts +14 -0
- package/dist/components/Switch.d.mts.map +1 -0
- package/dist/components/Switch.mjs +37 -0
- package/dist/components/Switch.mjs.map +1 -0
- package/dist/components/SyntaxLine.d.mts +19 -0
- package/dist/components/SyntaxLine.d.mts.map +1 -0
- package/dist/components/SyntaxLine.mjs +134 -0
- package/dist/components/SyntaxLine.mjs.map +1 -0
- package/dist/components/Tabs.d.mts.map +1 -1
- package/dist/components/Tabs.mjs +8 -7
- package/dist/components/Tabs.mjs.map +1 -1
- package/dist/components/ToolPathLink.d.mts +10 -0
- package/dist/components/ToolPathLink.d.mts.map +1 -0
- package/dist/components/ToolPathLink.mjs +40 -0
- package/dist/components/ToolPathLink.mjs.map +1 -0
- package/dist/components/ToolResultImage.d.mts +12 -0
- package/dist/components/ToolResultImage.d.mts.map +1 -0
- package/dist/components/ToolResultImage.mjs +48 -0
- package/dist/components/ToolResultImage.mjs.map +1 -0
- package/dist/icons/iconGlyphs.d.mts +60 -0
- package/dist/icons/iconGlyphs.d.mts.map +1 -1
- package/dist/icons/iconGlyphs.mjs +60 -0
- package/dist/icons/iconGlyphs.mjs.map +1 -1
- package/dist/icons/icons.d.mts +61 -1
- package/dist/icons/icons.d.mts.map +1 -1
- package/dist/icons/icons.mjs +17 -2
- package/dist/icons/icons.mjs.map +1 -1
- package/dist/index.d.mts +20 -6
- package/dist/index.mjs +21 -7
- package/dist/lib/fonts.d.mts +3 -1
- package/dist/lib/fonts.d.mts.map +1 -1
- package/dist/lib/fonts.mjs +4 -2
- package/dist/lib/fonts.mjs.map +1 -1
- package/dist/lib/insideSheet.d.mts +10 -0
- package/dist/lib/insideSheet.d.mts.map +1 -0
- package/dist/lib/markdown.mjs +172 -23
- package/dist/lib/markdown.mjs.map +1 -1
- package/dist/lib/reading.mjs +60 -0
- package/dist/lib/reading.mjs.map +1 -0
- package/dist/lib/useControllable.mjs +14 -6
- package/dist/lib/useControllable.mjs.map +1 -1
- package/dist/lib/useReadingPage.mjs +33 -0
- package/dist/lib/useReadingPage.mjs.map +1 -0
- package/dist/shell.d.mts +6 -0
- package/dist/shell.mjs +7 -0
- package/package.json +37 -28
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { fontOf } from "../lib/fonts.mjs";
|
|
2
|
-
import { StyleSheet } from "react-native-unistyles";
|
|
3
2
|
import { Text } from "react-native-unistyles/components/native/Text";
|
|
3
|
+
import { StyleSheet } from "react-native-unistyles";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
|
|
6
6
|
//#region src/components/SectionLabel.tsx
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { StyleProp, ViewStyle } from "react-native";
|
|
2
|
+
//#region src/components/Select.d.ts
|
|
3
|
+
export interface SelectOption {
|
|
4
|
+
value: string;
|
|
5
|
+
label: string;
|
|
6
|
+
/** Options sharing a group sit under one heading, in the order the groups first appear. */
|
|
7
|
+
group?: string;
|
|
8
|
+
/** A quieter line under the label. */
|
|
9
|
+
detail?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface SelectProps {
|
|
12
|
+
options: readonly SelectOption[];
|
|
13
|
+
/** The chosen value; unset or unknown shows the placeholder. */
|
|
14
|
+
value?: string;
|
|
15
|
+
onValueChange: (value: string) => void;
|
|
16
|
+
/** The sheet's heading and the trigger's accessible name, such as "Narration engine". */
|
|
17
|
+
title: string;
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
/** Offer a way back to no value, such as "Use the default". Shown only with onClear. */
|
|
20
|
+
clearLabel?: string;
|
|
21
|
+
onClear?: () => void;
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
/** Start with the sheet up, as a story shows it. */
|
|
24
|
+
defaultOpen?: boolean;
|
|
25
|
+
style?: StyleProp<ViewStyle>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The web Select as a phone picker: the current value and a chevron, which open a bottom sheet of
|
|
29
|
+
* the options, grouped, with a tick on the chosen one. Choosing ticks once and closes the sheet.
|
|
30
|
+
*/
|
|
31
|
+
export declare function Select({ options, value, onValueChange, title, placeholder, clearLabel, onClear, disabled, defaultOpen, style }: SelectProps): import("react").JSX.Element;
|
|
32
|
+
//#endregion
|
|
33
|
+
//# sourceMappingURL=Select.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.d.mts","names":[],"sources":["../../src/components/Select.tsx"],"mappings":";;iBAeiB;EACf;EACA;;EAEA;;EAEA;;iBAGe;EACf,kBAAkB;;EAElB;EACA,gBAAgB;;EAEhB;EACA;;EAEA;EACA;EACA;;EAEA;EACA,QAAQ,UAAU;;;;;;wBAOJ,SACd,SACA,OACA,eACA,OACA,aACA,YACA,SACA,UACA,aACA,SACC,8BAAW,IAAA"}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import { fontOf } from "../lib/fonts.mjs";
|
|
2
|
+
import { selectionTick } from "../lib/haptics.mjs";
|
|
3
|
+
import { Button } from "./Button.mjs";
|
|
4
|
+
import { CheckIcon, ChevronDownIcon } from "../icons/icons.mjs";
|
|
5
|
+
import { SheetFrame } from "./SheetFrame.mjs";
|
|
6
|
+
import { View } from "react-native-unistyles/components/native/View";
|
|
7
|
+
import { Text } from "react-native-unistyles/components/native/Text";
|
|
8
|
+
import { StyleSheet } from "react-native-unistyles";
|
|
9
|
+
import { useState } from "react";
|
|
10
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
import { Pressable } from "react-native-unistyles/components/native/Pressable";
|
|
12
|
+
|
|
13
|
+
//#region src/components/Select.tsx
|
|
14
|
+
const MIN_ROW_HEIGHT = 44;
|
|
15
|
+
const DISABLED_OPACITY = .4;
|
|
16
|
+
/** A long value gives way to the row's title rather than pushing it off screen. */
|
|
17
|
+
const MAX_VALUE_WIDTH = 180;
|
|
18
|
+
/**
|
|
19
|
+
* The web Select as a phone picker: the current value and a chevron, which open a bottom sheet of
|
|
20
|
+
* the options, grouped, with a tick on the chosen one. Choosing ticks once and closes the sheet.
|
|
21
|
+
*/
|
|
22
|
+
function Select({ options, value, onValueChange, title, placeholder = "Choose", clearLabel, onClear, disabled = false, defaultOpen = false, style }) {
|
|
23
|
+
const [open, setOpen] = useState(defaultOpen);
|
|
24
|
+
const chosen = options.find((option) => option.value === value);
|
|
25
|
+
const groups = [...new Set(options.map((option) => option.group))];
|
|
26
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(Pressable, {
|
|
27
|
+
accessibilityRole: "button",
|
|
28
|
+
accessibilityLabel: title,
|
|
29
|
+
accessibilityValue: { text: chosen?.label ?? placeholder },
|
|
30
|
+
accessibilityState: {
|
|
31
|
+
disabled,
|
|
32
|
+
expanded: open
|
|
33
|
+
},
|
|
34
|
+
disabled,
|
|
35
|
+
hitSlop: 8,
|
|
36
|
+
onPress: () => setOpen(true),
|
|
37
|
+
style: ({ pressed }) => [
|
|
38
|
+
styles.trigger,
|
|
39
|
+
pressed && styles.pressed,
|
|
40
|
+
disabled && styles.disabled,
|
|
41
|
+
style
|
|
42
|
+
],
|
|
43
|
+
children: [/* @__PURE__ */ jsx(Text, {
|
|
44
|
+
numberOfLines: 1,
|
|
45
|
+
style: chosen ? styles.value : styles.placeholder,
|
|
46
|
+
children: chosen?.label ?? placeholder
|
|
47
|
+
}), /* @__PURE__ */ jsx(ChevronDownIcon, {
|
|
48
|
+
size: 14,
|
|
49
|
+
color: "faint"
|
|
50
|
+
})]
|
|
51
|
+
}), /* @__PURE__ */ jsx(SheetFrame, {
|
|
52
|
+
open,
|
|
53
|
+
onClose: () => setOpen(false),
|
|
54
|
+
children: /* @__PURE__ */ jsxs(View, {
|
|
55
|
+
style: styles.sheet,
|
|
56
|
+
children: [
|
|
57
|
+
/* @__PURE__ */ jsx(Text, {
|
|
58
|
+
accessibilityRole: "header",
|
|
59
|
+
style: styles.title,
|
|
60
|
+
children: title
|
|
61
|
+
}),
|
|
62
|
+
groups.map((group) => /* @__PURE__ */ jsxs(View, {
|
|
63
|
+
accessibilityRole: "radiogroup",
|
|
64
|
+
style: styles.group,
|
|
65
|
+
children: [group === void 0 ? null : /* @__PURE__ */ jsx(Text, {
|
|
66
|
+
style: styles.groupLabel,
|
|
67
|
+
children: group
|
|
68
|
+
}), /* @__PURE__ */ jsx(View, {
|
|
69
|
+
style: styles.card,
|
|
70
|
+
children: options.filter((option) => option.group === group).map((option, index, rows) => {
|
|
71
|
+
const selected = option.value === value;
|
|
72
|
+
return /* @__PURE__ */ jsxs(Pressable, {
|
|
73
|
+
accessibilityRole: "radio",
|
|
74
|
+
accessibilityState: { checked: selected },
|
|
75
|
+
onPress: () => {
|
|
76
|
+
selectionTick();
|
|
77
|
+
setOpen(false);
|
|
78
|
+
if (!selected) onValueChange(option.value);
|
|
79
|
+
},
|
|
80
|
+
style: ({ pressed }) => [
|
|
81
|
+
styles.option,
|
|
82
|
+
index < rows.length - 1 && styles.divider,
|
|
83
|
+
pressed && styles.pressed
|
|
84
|
+
],
|
|
85
|
+
children: [/* @__PURE__ */ jsxs(View, {
|
|
86
|
+
style: styles.optionText,
|
|
87
|
+
children: [/* @__PURE__ */ jsx(Text, {
|
|
88
|
+
style: [styles.optionLabel, selected && styles.selected],
|
|
89
|
+
children: option.label
|
|
90
|
+
}), option.detail ? /* @__PURE__ */ jsx(Text, {
|
|
91
|
+
style: styles.detail,
|
|
92
|
+
children: option.detail
|
|
93
|
+
}) : null]
|
|
94
|
+
}), /* @__PURE__ */ jsx(View, {
|
|
95
|
+
style: styles.tick,
|
|
96
|
+
children: selected ? /* @__PURE__ */ jsx(CheckIcon, {
|
|
97
|
+
size: 18,
|
|
98
|
+
color: "green"
|
|
99
|
+
}) : null
|
|
100
|
+
})]
|
|
101
|
+
}, option.value);
|
|
102
|
+
})
|
|
103
|
+
})]
|
|
104
|
+
}, group ?? "")),
|
|
105
|
+
onClear === void 0 ? null : /* @__PURE__ */ jsx(Button, {
|
|
106
|
+
variant: "ghost",
|
|
107
|
+
size: "md",
|
|
108
|
+
onPress: () => {
|
|
109
|
+
setOpen(false);
|
|
110
|
+
onClear();
|
|
111
|
+
},
|
|
112
|
+
children: clearLabel ?? "Clear"
|
|
113
|
+
})
|
|
114
|
+
]
|
|
115
|
+
})
|
|
116
|
+
})] });
|
|
117
|
+
}
|
|
118
|
+
const styles = StyleSheet.create((theme) => {
|
|
119
|
+
const text = (size) => ({
|
|
120
|
+
fontFamily: fontOf(theme.fontFamily.sans),
|
|
121
|
+
fontSize: theme.fontSize[size],
|
|
122
|
+
lineHeight: theme.lineHeight[size]
|
|
123
|
+
});
|
|
124
|
+
return {
|
|
125
|
+
trigger: {
|
|
126
|
+
flexDirection: "row",
|
|
127
|
+
alignItems: "center",
|
|
128
|
+
gap: theme.spacing(1.5),
|
|
129
|
+
minHeight: MIN_ROW_HEIGHT,
|
|
130
|
+
borderRadius: theme.borderRadius.md,
|
|
131
|
+
uni__dependencies: [0]
|
|
132
|
+
},
|
|
133
|
+
pressed: { opacity: .6 },
|
|
134
|
+
disabled: { opacity: DISABLED_OPACITY },
|
|
135
|
+
value: {
|
|
136
|
+
...text("sm"),
|
|
137
|
+
color: theme.colors.text,
|
|
138
|
+
maxWidth: MAX_VALUE_WIDTH,
|
|
139
|
+
uni__dependencies: [0]
|
|
140
|
+
},
|
|
141
|
+
placeholder: {
|
|
142
|
+
...text("sm"),
|
|
143
|
+
color: theme.colors.faint,
|
|
144
|
+
maxWidth: MAX_VALUE_WIDTH,
|
|
145
|
+
uni__dependencies: [0]
|
|
146
|
+
},
|
|
147
|
+
sheet: {
|
|
148
|
+
gap: theme.spacing(4),
|
|
149
|
+
paddingHorizontal: theme.spacing(5),
|
|
150
|
+
paddingTop: theme.spacing(1),
|
|
151
|
+
paddingBottom: theme.spacing(4),
|
|
152
|
+
uni__dependencies: [0]
|
|
153
|
+
},
|
|
154
|
+
title: {
|
|
155
|
+
...text("lg"),
|
|
156
|
+
color: theme.colors.hi,
|
|
157
|
+
fontWeight: theme.fontWeight.semibold,
|
|
158
|
+
uni__dependencies: [0]
|
|
159
|
+
},
|
|
160
|
+
group: {
|
|
161
|
+
gap: theme.spacing(2),
|
|
162
|
+
uni__dependencies: [0]
|
|
163
|
+
},
|
|
164
|
+
groupLabel: {
|
|
165
|
+
...text("sm"),
|
|
166
|
+
color: theme.colors.dim,
|
|
167
|
+
fontWeight: theme.fontWeight.semibold,
|
|
168
|
+
uni__dependencies: [0]
|
|
169
|
+
},
|
|
170
|
+
card: {
|
|
171
|
+
overflow: "hidden",
|
|
172
|
+
borderRadius: theme.borderRadius.lg,
|
|
173
|
+
borderWidth: StyleSheet.hairlineWidth,
|
|
174
|
+
borderColor: theme.colors.border,
|
|
175
|
+
backgroundColor: theme.colors.panel,
|
|
176
|
+
uni__dependencies: [0]
|
|
177
|
+
},
|
|
178
|
+
option: {
|
|
179
|
+
flexDirection: "row",
|
|
180
|
+
alignItems: "flex-start",
|
|
181
|
+
gap: theme.spacing(3),
|
|
182
|
+
minHeight: MIN_ROW_HEIGHT,
|
|
183
|
+
paddingHorizontal: theme.spacing(4),
|
|
184
|
+
paddingVertical: theme.spacing(3),
|
|
185
|
+
uni__dependencies: [0]
|
|
186
|
+
},
|
|
187
|
+
divider: {
|
|
188
|
+
borderBottomWidth: StyleSheet.hairlineWidth,
|
|
189
|
+
borderBottomColor: theme.colors["border-soft"],
|
|
190
|
+
uni__dependencies: [0]
|
|
191
|
+
},
|
|
192
|
+
optionText: {
|
|
193
|
+
flex: 1,
|
|
194
|
+
minWidth: 0,
|
|
195
|
+
gap: 2
|
|
196
|
+
},
|
|
197
|
+
optionLabel: {
|
|
198
|
+
...text("base"),
|
|
199
|
+
color: theme.colors.hi,
|
|
200
|
+
fontWeight: theme.fontWeight.medium,
|
|
201
|
+
uni__dependencies: [0]
|
|
202
|
+
},
|
|
203
|
+
selected: {
|
|
204
|
+
color: theme.colors.green,
|
|
205
|
+
uni__dependencies: [0]
|
|
206
|
+
},
|
|
207
|
+
detail: {
|
|
208
|
+
...text("sm"),
|
|
209
|
+
color: theme.colors.dim,
|
|
210
|
+
lineHeight: theme.lineHeightRelaxed.sm,
|
|
211
|
+
uni__dependencies: [0]
|
|
212
|
+
},
|
|
213
|
+
tick: {
|
|
214
|
+
width: 18,
|
|
215
|
+
paddingTop: 2
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
//#endregion
|
|
221
|
+
export { Select };
|
|
222
|
+
//# sourceMappingURL=Select.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.mjs","names":["useState","StyleProp","ViewStyle","StyleSheet","CheckIcon","ChevronDownIcon","fontOf","selectionTick","Button","SheetFrame","MIN_ROW_HEIGHT","DISABLED_OPACITY","MAX_VALUE_WIDTH","SelectOption","value","label","group","detail","SelectProps","options","onValueChange","title","placeholder","clearLabel","onClear","disabled","defaultOpen","style","Select","open","setOpen","chosen","find","option","groups","Set","map","text","expanded","pressed","styles","trigger","sheet","undefined","groupLabel","card","filter","index","rows","selected","checked","length","divider","optionText","optionLabel","tick","create","theme","size","fontFamily","sans","fontSize","lineHeight","flexDirection","alignItems","gap","spacing","minHeight","borderRadius","md","uni__dependencies","opacity","color","colors","maxWidth","faint","paddingHorizontal","paddingTop","paddingBottom","hi","fontWeight","semibold","dim","overflow","lg","borderWidth","hairlineWidth","borderColor","border","backgroundColor","panel","paddingVertical","borderBottomWidth","borderBottomColor","flex","minWidth","medium","green","lineHeightRelaxed","sm","width"],"sources":["../../src/components/Select.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { Pressable, type StyleProp, Text, View, type ViewStyle } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\nimport { CheckIcon, ChevronDownIcon } from '../icons/icons';\nimport { fontOf } from '../lib/fonts';\nimport { selectionTick } from '../lib/haptics';\nimport { Button } from './Button';\nimport { SheetFrame } from './SheetFrame';\n\nconst MIN_ROW_HEIGHT = 44;\nconst DISABLED_OPACITY = 0.4;\n/** A long value gives way to the row's title rather than pushing it off screen. */\nconst MAX_VALUE_WIDTH = 180;\n\nexport interface SelectOption {\n value: string;\n label: string;\n /** Options sharing a group sit under one heading, in the order the groups first appear. */\n group?: string;\n /** A quieter line under the label. */\n detail?: string;\n}\n\nexport interface SelectProps {\n options: readonly SelectOption[];\n /** The chosen value; unset or unknown shows the placeholder. */\n value?: string;\n onValueChange: (value: string) => void;\n /** The sheet's heading and the trigger's accessible name, such as \"Narration engine\". */\n title: string;\n placeholder?: string;\n /** Offer a way back to no value, such as \"Use the default\". Shown only with onClear. */\n clearLabel?: string;\n onClear?: () => void;\n disabled?: boolean;\n /** Start with the sheet up, as a story shows it. */\n defaultOpen?: boolean;\n style?: StyleProp<ViewStyle>;\n}\n\n/**\n * The web Select as a phone picker: the current value and a chevron, which open a bottom sheet of\n * the options, grouped, with a tick on the chosen one. Choosing ticks once and closes the sheet.\n */\nexport function Select({\n options,\n value,\n onValueChange,\n title,\n placeholder = 'Choose',\n clearLabel,\n onClear,\n disabled = false,\n defaultOpen = false,\n style,\n}: SelectProps) {\n const [open, setOpen] = useState(defaultOpen);\n const chosen = options.find((option) => option.value === value);\n const groups = [...new Set(options.map((option) => option.group))];\n return (\n <>\n <Pressable\n accessibilityRole=\"button\"\n accessibilityLabel={title}\n accessibilityValue={{ text: chosen?.label ?? placeholder }}\n accessibilityState={{ disabled, expanded: open }}\n disabled={disabled}\n hitSlop={8}\n onPress={() => setOpen(true)}\n style={({ pressed }) => [styles.trigger, pressed && styles.pressed, disabled && styles.disabled, style]}\n >\n <Text numberOfLines={1} style={chosen ? styles.value : styles.placeholder}>\n {chosen?.label ?? placeholder}\n </Text>\n <ChevronDownIcon size={14} color=\"faint\" />\n </Pressable>\n <SheetFrame open={open} onClose={() => setOpen(false)}>\n <View style={styles.sheet}>\n <Text accessibilityRole=\"header\" style={styles.title}>\n {title}\n </Text>\n {groups.map((group) => (\n <View key={group ?? ''} accessibilityRole=\"radiogroup\" style={styles.group}>\n {group === undefined ? null : <Text style={styles.groupLabel}>{group}</Text>}\n <View style={styles.card}>\n {options\n .filter((option) => option.group === group)\n .map((option, index, rows) => {\n const selected = option.value === value;\n return (\n <Pressable\n key={option.value}\n accessibilityRole=\"radio\"\n accessibilityState={{ checked: selected }}\n onPress={() => {\n selectionTick();\n setOpen(false);\n if (!selected) onValueChange(option.value);\n }}\n style={({ pressed }) => [\n styles.option,\n index < rows.length - 1 && styles.divider,\n pressed && styles.pressed,\n ]}\n >\n <View style={styles.optionText}>\n <Text style={[styles.optionLabel, selected && styles.selected]}>{option.label}</Text>\n {option.detail ? <Text style={styles.detail}>{option.detail}</Text> : null}\n </View>\n <View style={styles.tick}>{selected ? <CheckIcon size={18} color=\"green\" /> : null}</View>\n </Pressable>\n );\n })}\n </View>\n </View>\n ))}\n {onClear === undefined ? null : (\n <Button\n variant=\"ghost\"\n size=\"md\"\n onPress={() => {\n setOpen(false);\n onClear();\n }}\n >\n {clearLabel ?? 'Clear'}\n </Button>\n )}\n </View>\n </SheetFrame>\n </>\n );\n}\n\nconst styles = StyleSheet.create((theme) => {\n const text = (size: 'sm' | 'base' | 'lg') => ({\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize[size],\n lineHeight: theme.lineHeight[size],\n });\n return {\n trigger: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: theme.spacing(1.5),\n minHeight: MIN_ROW_HEIGHT,\n borderRadius: theme.borderRadius.md,\n },\n pressed: { opacity: 0.6 },\n disabled: { opacity: DISABLED_OPACITY },\n value: { ...text('sm'), color: theme.colors.text, maxWidth: MAX_VALUE_WIDTH },\n placeholder: { ...text('sm'), color: theme.colors.faint, maxWidth: MAX_VALUE_WIDTH },\n sheet: {\n gap: theme.spacing(4),\n paddingHorizontal: theme.spacing(5),\n paddingTop: theme.spacing(1),\n paddingBottom: theme.spacing(4),\n },\n title: { ...text('lg'), color: theme.colors.hi, fontWeight: theme.fontWeight.semibold },\n group: { gap: theme.spacing(2) },\n groupLabel: { ...text('sm'), color: theme.colors.dim, fontWeight: theme.fontWeight.semibold },\n card: {\n overflow: 'hidden',\n borderRadius: theme.borderRadius.lg,\n borderWidth: StyleSheet.hairlineWidth,\n borderColor: theme.colors.border,\n backgroundColor: theme.colors.panel,\n },\n option: {\n flexDirection: 'row',\n alignItems: 'flex-start',\n gap: theme.spacing(3),\n minHeight: MIN_ROW_HEIGHT,\n paddingHorizontal: theme.spacing(4),\n paddingVertical: theme.spacing(3),\n },\n divider: { borderBottomWidth: StyleSheet.hairlineWidth, borderBottomColor: theme.colors['border-soft'] },\n optionText: { flex: 1, minWidth: 0, gap: 2 },\n optionLabel: { ...text('base'), color: theme.colors.hi, fontWeight: theme.fontWeight.medium },\n selected: { color: theme.colors.green },\n detail: { ...text('sm'), color: theme.colors.dim, lineHeight: theme.lineHeightRelaxed.sm },\n tick: { width: 18, paddingTop: 2 },\n };\n});\n"],"mappings":";;;;;;;;;;;;;AAUA,MAAMU,iBAAiB;AACvB,MAAMC,mBAAmB;;AAEzB,MAAMC,kBAAkB;;;;;AAgCxB,SAAgBgB,OAAO,EACrBT,SACAL,OACAM,eACAC,OACAC,cAAc,UACdC,YACAC,SACAC,WAAW,OACXC,cAAc,OACdC,SACc;CACd,MAAM,CAACE,MAAMC,WAAW9B,SAAS0B,WAAW;CAC5C,MAAMK,SAASZ,QAAQa,MAAMC,WAA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AAK;EAAE;EAC3CX,aAAa;GAAE,GAAGjB,KAAK,MAAM;GAAGmC,OAAOf,MAAMgB,OAAOM;GAAIC,YAAYvB,MAAMuB,WAAWgB;GAAM1B,mBAAA,CAAA,CAAA;EAAC;EAC5FrB,UAAU;GAAEuB,OAAOf,MAAMgB,OAAOwB;GAAK3B,mBAAA,CAAA,CAAA;EAAC;EACtCrD,QAAQ;GAAE,GAAGoB,KAAK,IAAI;GAAGmC,OAAOf,MAAMgB,OAAOS;GAAKpB,YAAYL,MAAMyC,kBAAkBC;GAAE7B,mBAAA,CAAA,CAAA;EAAC;EACzFf,MAAM;GAAE6C,OAAO;GAAIvB,YAAY;EAAE;CACnC;AACF,CAAC"}
|
|
@@ -16,9 +16,17 @@ export declare function SheetTrigger({ onPress, ...props }: ButtonProps): import
|
|
|
16
16
|
export declare function SheetClose({ onPress, ...props }: ButtonProps): import("react").JSX.Element;
|
|
17
17
|
export interface SheetContentProps {
|
|
18
18
|
children?: ReactNode;
|
|
19
|
+
/** Pinned actions outside the scrolling body. The footer carries the bottom safe area. */
|
|
20
|
+
footer?: ReactNode;
|
|
21
|
+
/** False when an embedded SheetList owns vertical scrolling. */
|
|
22
|
+
scrollable?: boolean;
|
|
23
|
+
/** The sheet holds unsaved work: a prompt arriving in the conversation leaves it open with a note. */
|
|
24
|
+
keep?: boolean;
|
|
25
|
+
/** Runs after the native modal is dismissed, including a caller-initiated close. */
|
|
26
|
+
onDismiss?: () => void;
|
|
19
27
|
}
|
|
20
28
|
/** The sheet surface. Fields inside it switch to the sheet's own input so the keyboard lifts the sheet. */
|
|
21
|
-
export declare function SheetContent({ children }: SheetContentProps): import("react").JSX.Element;
|
|
29
|
+
export declare function SheetContent({ children, scrollable, footer, keep, onDismiss }: SheetContentProps): import("react").JSX.Element;
|
|
22
30
|
export interface SheetPartProps extends Omit<ViewProps, 'children' | 'style'> {
|
|
23
31
|
children?: ReactNode;
|
|
24
32
|
style?: StyleProp<ViewStyle>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sheet.d.mts","names":[],"sources":["../../src/components/Sheet.tsx"],"mappings":";;;;iBAwBiB;;EAEf;EACA;EACA,gBAAgB;EAChB,WAAW;;wBAGG,QAAQ,MAAM,aAAqB,cAAc,YAAY,6BAAU,IAAA;;
|
|
1
|
+
{"version":3,"file":"Sheet.d.mts","names":[],"sources":["../../src/components/Sheet.tsx"],"mappings":";;;;iBAwBiB;;EAEf;EACA;EACA,gBAAgB;EAChB,WAAW;;wBAGG,QAAQ,MAAM,aAAqB,cAAc,YAAY,6BAAU,IAAA;;wBAOvE,eAAe,YAAY,SAAS,8BAAW,IAAA;;wBAc/C,aAAa,YAAY,SAAS,8BAAW,IAAA;iBAa5C;EACf,WAAW;;EAEX,SAAS;;EAET;;EAEA;;EAEA;;;wBAIc,eAAe,UAAU,YAAmB,QAAQ,MAAM,aAAa,oCAAiB,IAAA;iBAsBvF,uBAAuB,KAAK;EAC3C,WAAW;EACX,QAAQ,UAAU;;iBAGH,yBAAyB;;EAExC;;EAEA;;wBAGc,cAAc,aAAoB,YAAsB,OAAO,aAAa,SAAS,mCAAgB,IAAA;wBAoBrG,aAAa,UAAU,SAAS,4BAAS,IAAA;wBAIzC,mBAAmB,UAAU,SAAS,4BAAS,IAAA;;wBAK/C,YAAY,OAAO,aAAa,SAAS,iCAAc,IAAA;wBAQvD,cAAc,OAAO,aAAa,SAAS,iCAAc,IAAA"}
|
|
@@ -5,9 +5,9 @@ import { CloseIcon } from "../icons/icons.mjs";
|
|
|
5
5
|
import { useControllable } from "../lib/useControllable.mjs";
|
|
6
6
|
import { SheetFrame } from "./SheetFrame.mjs";
|
|
7
7
|
import { View } from "react-native-unistyles/components/native/View";
|
|
8
|
-
import { StyleSheet } from "react-native-unistyles";
|
|
9
8
|
import { Text } from "react-native-unistyles/components/native/Text";
|
|
10
|
-
import {
|
|
9
|
+
import { StyleSheet } from "react-native-unistyles";
|
|
10
|
+
import { createContext, useCallback, useContext, useMemo } from "react";
|
|
11
11
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
12
|
|
|
13
13
|
//#region src/components/Sheet.tsx
|
|
@@ -17,11 +17,12 @@ const SheetContext = createContext({
|
|
|
17
17
|
});
|
|
18
18
|
function Sheet({ open, defaultOpen = false, onOpenChange, children }) {
|
|
19
19
|
const [current, setOpen] = useControllable(open, defaultOpen, onOpenChange);
|
|
20
|
+
const value = useMemo(() => ({
|
|
21
|
+
open: current,
|
|
22
|
+
setOpen
|
|
23
|
+
}), [current, setOpen]);
|
|
20
24
|
return /* @__PURE__ */ jsx(SheetContext.Provider, {
|
|
21
|
-
value
|
|
22
|
-
open: current,
|
|
23
|
-
setOpen
|
|
24
|
-
},
|
|
25
|
+
value,
|
|
25
26
|
children
|
|
26
27
|
});
|
|
27
28
|
}
|
|
@@ -48,12 +49,28 @@ function SheetClose({ onPress, ...props }) {
|
|
|
48
49
|
});
|
|
49
50
|
}
|
|
50
51
|
/** The sheet surface. Fields inside it switch to the sheet's own input so the keyboard lifts the sheet. */
|
|
51
|
-
function SheetContent({ children }) {
|
|
52
|
+
function SheetContent({ children, scrollable = true, footer, keep, onDismiss }) {
|
|
52
53
|
const { open, setOpen } = useContext(SheetContext);
|
|
54
|
+
const value = useMemo(() => ({
|
|
55
|
+
open,
|
|
56
|
+
setOpen
|
|
57
|
+
}), [open, setOpen]);
|
|
58
|
+
const close = useCallback(() => setOpen(false), [setOpen]);
|
|
59
|
+
const pinned = useMemo(() => footer === void 0 ? void 0 : /* @__PURE__ */ jsx(SheetContext.Provider, {
|
|
60
|
+
value,
|
|
61
|
+
children: footer
|
|
62
|
+
}), [footer, value]);
|
|
53
63
|
return /* @__PURE__ */ jsx(SheetFrame, {
|
|
54
64
|
open,
|
|
55
|
-
onClose:
|
|
56
|
-
|
|
65
|
+
onClose: close,
|
|
66
|
+
scrollable,
|
|
67
|
+
keep,
|
|
68
|
+
onDismiss,
|
|
69
|
+
...pinned === void 0 ? {} : { footer: pinned },
|
|
70
|
+
children: /* @__PURE__ */ jsx(SheetContext.Provider, {
|
|
71
|
+
value,
|
|
72
|
+
children
|
|
73
|
+
})
|
|
57
74
|
});
|
|
58
75
|
}
|
|
59
76
|
function SheetHeader({ dismissible = true, closeLabel = "close", style, children, ...props }) {
|
|
@@ -162,5 +179,5 @@ const styles = StyleSheet.create((theme) => ({
|
|
|
162
179
|
}));
|
|
163
180
|
|
|
164
181
|
//#endregion
|
|
165
|
-
export { Sheet, SheetBody, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger };
|
|
182
|
+
export { Sheet, SheetBody, SheetClose, SheetContent, SheetContext, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger };
|
|
166
183
|
//# sourceMappingURL=Sheet.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sheet.mjs","names":["createContext","ReactNode","useContext","StyleProp","TextProps","ViewProps","ViewStyle","StyleSheet","CloseIcon","fontOf","useControllable","wrapText","Button","ButtonProps","SheetFrame","SheetState","open","setOpen","SheetContext","undefined","SheetProps","defaultOpen","onOpenChange","children","Sheet","current","SheetTrigger","onPress","props","event","SheetClose","SheetContentProps","SheetContent","SheetPartProps","Omit","style","SheetHeaderProps","dismissible","closeLabel","SheetHeader","styles","header","close","SheetTitle","title","SheetDescription","description","SheetBody","body","SheetFooter","footer","hint","create","theme","flexDirection","alignItems","gap","spacing","minWidth","height","borderBottomWidth","borderBottomColor","colors","border","paddingHorizontal","uni__dependencies","marginLeft","flexShrink","color","hi","fontFamily","sans","fontSize","lg","lineHeight","fontWeight","semibold","dim","sm","lineHeightRelaxed","paddingVertical","flexWrap","justifyContent","minHeight","borderTopWidth","borderTopColor","backgroundColor","deep","faint"],"sources":["../../src/components/Sheet.tsx"],"sourcesContent":["import { createContext, type ReactNode, useContext } from 'react';\nimport { type StyleProp, Text, type TextProps, View, type ViewProps, type ViewStyle } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\nimport { CloseIcon } from '../icons/icons';\nimport { fontOf } from '../lib/fonts';\nimport { useControllable } from '../lib/useControllable';\nimport { wrapText } from '../lib/wrapText';\nimport { Button, type ButtonProps } from './Button';\nimport { SheetFrame } from './SheetFrame';\n\n/*\n * The web Sheet as a bottom sheet: the native shape for a detail view or a\n * short form over what the reader was looking at. `side` and `width` are\n * dropped; a phone sheet rises from the bottom edge and takes the width.\n */\n\ninterface SheetState {\n open: boolean;\n setOpen: (open: boolean) => void;\n}\n\nconst SheetContext = createContext<SheetState>({ open: false, setOpen: () => undefined });\n\nexport interface SheetProps {\n /** Controlled mode; pair with onOpenChange. Omit it and the sheet keeps its own state. */\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n children?: ReactNode;\n}\n\nexport function Sheet({ open, defaultOpen = false, onOpenChange, children }: SheetProps) {\n const [current, setOpen] = useControllable(open, defaultOpen, onOpenChange);\n return <SheetContext.Provider value={{ open: current, setOpen }}>{children}</SheetContext.Provider>;\n}\n\n/** A Button that opens the enclosing sheet. */\nexport function SheetTrigger({ onPress, ...props }: ButtonProps) {\n const { setOpen } = useContext(SheetContext);\n return (\n <Button\n onPress={(event) => {\n onPress?.(event);\n setOpen(true);\n }}\n {...props}\n />\n );\n}\n\n/** A Button that closes the enclosing sheet. */\nexport function SheetClose({ onPress, ...props }: ButtonProps) {\n const { setOpen } = useContext(SheetContext);\n return (\n <Button\n onPress={(event) => {\n onPress?.(event);\n setOpen(false);\n }}\n {...props}\n />\n );\n}\n\nexport interface SheetContentProps {\n children?: ReactNode;\n}\n\n/** The sheet surface. Fields inside it switch to the sheet's own input so the keyboard lifts the sheet. */\nexport function SheetContent({ children }: SheetContentProps) {\n const { open, setOpen } = useContext(SheetContext);\n return (\n <SheetFrame open={open} onClose={() => setOpen(false)}>\n {children}\n </SheetFrame>\n );\n}\n\nexport interface SheetPartProps extends Omit<ViewProps, 'children' | 'style'> {\n children?: ReactNode;\n style?: StyleProp<ViewStyle>;\n}\n\nexport interface SheetHeaderProps extends SheetPartProps {\n /** Show the close control at the right of the strip. On by default: a sheet is dismissed, not answered. */\n dismissible?: boolean;\n /** What the close control announces. */\n closeLabel?: string;\n}\n\nexport function SheetHeader({ dismissible = true, closeLabel = 'close', style, children, ...props }: SheetHeaderProps) {\n const { setOpen } = useContext(SheetContext);\n return (\n <View style={[styles.header, style]} {...props}>\n {children}\n {dismissible ? (\n <Button\n variant=\"ghost\"\n size=\"icon\"\n accessibilityLabel={closeLabel}\n onPress={() => setOpen(false)}\n style={styles.close}\n >\n <CloseIcon size={12} color=\"faint\" />\n </Button>\n ) : null}\n </View>\n );\n}\n\nexport function SheetTitle({ style, ...props }: TextProps) {\n return <Text accessibilityRole=\"header\" numberOfLines={1} style={[styles.title, style]} {...props} />;\n}\n\nexport function SheetDescription({ style, ...props }: TextProps) {\n return <Text style={[styles.description, style]} {...props} />;\n}\n\n/** The scrolling middle; the sheet itself scrolls, so this only spaces its children. */\nexport function SheetBody({ style, children, ...props }: SheetPartProps) {\n return (\n <View style={[styles.body, style]} {...props}>\n {wrapText(children, styles.description)}\n </View>\n );\n}\n\nexport function SheetFooter({ style, children, ...props }: SheetPartProps) {\n return (\n <View style={[styles.footer, style]} {...props}>\n {wrapText(children, styles.hint)}\n </View>\n );\n}\n\nconst styles = StyleSheet.create((theme) => ({\n header: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: theme.spacing(2.5),\n minWidth: 0,\n height: theme.spacing(11),\n borderBottomWidth: 1,\n borderBottomColor: theme.colors.border,\n paddingHorizontal: theme.spacing(4),\n },\n close: { marginLeft: 'auto' },\n title: {\n flexShrink: 1,\n color: theme.colors.hi,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.lg,\n lineHeight: theme.lineHeight.lg,\n fontWeight: theme.fontWeight.semibold,\n },\n description: {\n color: theme.colors.dim,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeightRelaxed.sm,\n },\n body: {\n gap: theme.spacing(3),\n paddingHorizontal: theme.spacing(4),\n paddingVertical: theme.spacing(3),\n },\n footer: {\n flexDirection: 'row',\n flexWrap: 'wrap',\n alignItems: 'center',\n justifyContent: 'space-between',\n gap: theme.spacing(2),\n minHeight: 34,\n borderTopWidth: 1,\n borderTopColor: theme.colors['border-soft'],\n backgroundColor: theme.colors.deep,\n paddingHorizontal: theme.spacing(4),\n paddingVertical: theme.spacing(1.5),\n },\n hint: {\n color: theme.colors.faint,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize['2xs'],\n lineHeight: theme.lineHeight['2xs'],\n },\n}));\n"],"mappings":";;;;;;;;;;;;;AAsBA,MAAMkB,eAAelB,cAA0B;CAAEgB,MAAM;CAAOC,eAAeE;AAAU,CAAC;AAUxF,SAAgBK,MAAM,EAAER,MAAMK,cAAc,OAAOC,cAAcC,YAAwB;CACvF,MAAM,CAACE,SAASR,WAAWP,gBAAgBM,MAAMK,aAAaC,YAAY;CAC1E,OAAO,oBAAC,aAAa,UAAd;EAAuB,OAAO;GAAEN,MAAMS;GAASR;EAAQ;EAAIM;CAAgC;AACpG;;AAGA,SAAgBG,aAAa,EAAEC,SAAS,GAAGC,SAAsB;CAC/D,MAAM,EAAEX,YAAYf,WAAWgB,YAAY;CAC3C,OACE,oBAAC,QAAD;EACE,UAAUW,UAAU;GAClBF,UAAUE,KAAK;GACfZ,QAAQ,IAAI;EACd;EACA,GAAIW;CAAM;AAGhB;;AAGA,SAAgBE,WAAW,EAAEH,SAAS,GAAGC,SAAsB;CAC7D,MAAM,EAAEX,YAAYf,WAAWgB,YAAY;CAC3C,OACE,oBAAC,QAAD;EACE,UAAUW,UAAU;GAClBF,UAAUE,KAAK;GACfZ,QAAQ,KAAK;EACf;EACA,GAAIW;CAAM;AAGhB;;AAOA,SAAgBI,aAAa,EAAET,YAA+B;CAC5D,MAAM,EAAEP,MAAMC,YAAYf,WAAWgB,YAAY;CACjD,OACE,oBAA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rB,MAAMqB,WAAW;EAAMT,mBAAA,CAAA,CAAA;CACrC;AACF,EAAE"}
|
|
1
|
+
{"version":3,"file":"Sheet.mjs","names":["createContext","ReactNode","useCallback","useContext","useMemo","StyleProp","TextProps","ViewProps","ViewStyle","StyleSheet","CloseIcon","fontOf","useControllable","wrapText","Button","ButtonProps","SheetFrame","SheetState","open","setOpen","SheetContext","undefined","SheetProps","defaultOpen","onOpenChange","children","Sheet","current","value","SheetTrigger","onPress","props","event","SheetClose","SheetContentProps","footer","scrollable","keep","onDismiss","SheetContent","close","pinned","SheetPartProps","Omit","style","SheetHeaderProps","dismissible","closeLabel","SheetHeader","styles","header","SheetTitle","title","SheetDescription","description","SheetBody","body","SheetFooter","hint","create","theme","flexDirection","alignItems","gap","spacing","minWidth","height","borderBottomWidth","borderBottomColor","colors","border","paddingHorizontal","uni__dependencies","marginLeft","flexShrink","color","hi","fontFamily","sans","fontSize","lg","lineHeight","fontWeight","semibold","dim","sm","lineHeightRelaxed","paddingVertical","flexWrap","justifyContent","minHeight","borderTopWidth","borderTopColor","backgroundColor","deep","faint"],"sources":["../../src/components/Sheet.tsx"],"sourcesContent":["import { createContext, type ReactNode, useCallback, useContext, useMemo } from 'react';\nimport { type StyleProp, Text, type TextProps, View, type ViewProps, type ViewStyle } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\nimport { CloseIcon } from '../icons/icons';\nimport { fontOf } from '../lib/fonts';\nimport { useControllable } from '../lib/useControllable';\nimport { wrapText } from '../lib/wrapText';\nimport { Button, type ButtonProps } from './Button';\nimport { SheetFrame } from './SheetFrame';\n\n/*\n * The web Sheet as a bottom sheet: the native shape for a detail view or a\n * short form over what the reader was looking at. `side` and `width` are\n * dropped; a phone sheet rises from the bottom edge and takes the width.\n */\n\ninterface SheetState {\n open: boolean;\n setOpen: (open: boolean) => void;\n}\n\nexport const SheetContext = createContext<SheetState>({ open: false, setOpen: () => undefined });\n\nexport interface SheetProps {\n /** Controlled mode; pair with onOpenChange. Omit it and the sheet keeps its own state. */\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n children?: ReactNode;\n}\n\nexport function Sheet({ open, defaultOpen = false, onOpenChange, children }: SheetProps) {\n const [current, setOpen] = useControllable(open, defaultOpen, onOpenChange);\n const value = useMemo(() => ({ open: current, setOpen }), [current, setOpen]);\n return <SheetContext.Provider value={value}>{children}</SheetContext.Provider>;\n}\n\n/** A Button that opens the enclosing sheet. */\nexport function SheetTrigger({ onPress, ...props }: ButtonProps) {\n const { setOpen } = useContext(SheetContext);\n return (\n <Button\n onPress={(event) => {\n onPress?.(event);\n setOpen(true);\n }}\n {...props}\n />\n );\n}\n\n/** A Button that closes the enclosing sheet. */\nexport function SheetClose({ onPress, ...props }: ButtonProps) {\n const { setOpen } = useContext(SheetContext);\n return (\n <Button\n onPress={(event) => {\n onPress?.(event);\n setOpen(false);\n }}\n {...props}\n />\n );\n}\n\nexport interface SheetContentProps {\n children?: ReactNode;\n /** Pinned actions outside the scrolling body. The footer carries the bottom safe area. */\n footer?: ReactNode;\n /** False when an embedded SheetList owns vertical scrolling. */\n scrollable?: boolean;\n /** The sheet holds unsaved work: a prompt arriving in the conversation leaves it open with a note. */\n keep?: boolean;\n /** Runs after the native modal is dismissed, including a caller-initiated close. */\n onDismiss?: () => void;\n}\n\n/** The sheet surface. Fields inside it switch to the sheet's own input so the keyboard lifts the sheet. */\nexport function SheetContent({ children, scrollable = true, footer, keep, onDismiss }: SheetContentProps) {\n const { open, setOpen } = useContext(SheetContext);\n const value = useMemo(() => ({ open, setOpen }), [open, setOpen]);\n const close = useCallback(() => setOpen(false), [setOpen]);\n const pinned = useMemo(\n () => (footer === undefined ? undefined : <SheetContext.Provider value={value}>{footer}</SheetContext.Provider>),\n [footer, value],\n );\n return (\n <SheetFrame\n open={open}\n onClose={close}\n scrollable={scrollable}\n keep={keep}\n onDismiss={onDismiss}\n {...(pinned === undefined ? {} : { footer: pinned })}\n >\n <SheetContext.Provider value={value}>{children}</SheetContext.Provider>\n </SheetFrame>\n );\n}\n\nexport interface SheetPartProps extends Omit<ViewProps, 'children' | 'style'> {\n children?: ReactNode;\n style?: StyleProp<ViewStyle>;\n}\n\nexport interface SheetHeaderProps extends SheetPartProps {\n /** Show the close control at the right of the strip. On by default: a sheet is dismissed, not answered. */\n dismissible?: boolean;\n /** What the close control announces. */\n closeLabel?: string;\n}\n\nexport function SheetHeader({ dismissible = true, closeLabel = 'close', style, children, ...props }: SheetHeaderProps) {\n const { setOpen } = useContext(SheetContext);\n return (\n <View style={[styles.header, style]} {...props}>\n {children}\n {dismissible ? (\n <Button\n variant=\"ghost\"\n size=\"icon\"\n accessibilityLabel={closeLabel}\n onPress={() => setOpen(false)}\n style={styles.close}\n >\n <CloseIcon size={12} color=\"faint\" />\n </Button>\n ) : null}\n </View>\n );\n}\n\nexport function SheetTitle({ style, ...props }: TextProps) {\n return <Text accessibilityRole=\"header\" numberOfLines={1} style={[styles.title, style]} {...props} />;\n}\n\nexport function SheetDescription({ style, ...props }: TextProps) {\n return <Text style={[styles.description, style]} {...props} />;\n}\n\n/** The scrolling middle; the sheet itself scrolls, so this only spaces its children. */\nexport function SheetBody({ style, children, ...props }: SheetPartProps) {\n return (\n <View style={[styles.body, style]} {...props}>\n {wrapText(children, styles.description)}\n </View>\n );\n}\n\nexport function SheetFooter({ style, children, ...props }: SheetPartProps) {\n return (\n <View style={[styles.footer, style]} {...props}>\n {wrapText(children, styles.hint)}\n </View>\n );\n}\n\nconst styles = StyleSheet.create((theme) => ({\n header: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: theme.spacing(2.5),\n minWidth: 0,\n height: theme.spacing(11),\n borderBottomWidth: 1,\n borderBottomColor: theme.colors.border,\n paddingHorizontal: theme.spacing(4),\n },\n close: { marginLeft: 'auto' },\n title: {\n flexShrink: 1,\n color: theme.colors.hi,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.lg,\n lineHeight: theme.lineHeight.lg,\n fontWeight: theme.fontWeight.semibold,\n },\n description: {\n color: theme.colors.dim,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeightRelaxed.sm,\n },\n body: {\n gap: theme.spacing(3),\n paddingHorizontal: theme.spacing(4),\n paddingVertical: theme.spacing(3),\n },\n footer: {\n flexDirection: 'row',\n flexWrap: 'wrap',\n alignItems: 'center',\n justifyContent: 'space-between',\n gap: theme.spacing(2),\n minHeight: 34,\n borderTopWidth: 1,\n borderTopColor: theme.colors['border-soft'],\n backgroundColor: theme.colors.deep,\n paddingHorizontal: theme.spacing(4),\n paddingVertical: theme.spacing(1.5),\n },\n hint: {\n color: theme.colors.faint,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize['2xs'],\n lineHeight: theme.lineHeight['2xs'],\n },\n}));\n"],"mappings":";;;;;;;;;;;;;AAsBA,MAAaoB,eAAepB,cAA0B;CAAEkB,MAAM;CAAOC,eAAeE;AAAU,CAAC;AAU/F,SAAgBK,MAAM,EAAER,MAAMK,cAAc,OAAOC,cAAcC,YAAwB;CACvF,MAAM,CAACE,SAASR,WAAWP,gBAAgBM,MAAMK,aAAaC,YAAY;CAC1E,MAAMI,QAAQxB,eAAe;EAAEc,MAAMS;EAASR;CAAQ,IAAI,CAACQ,SAASR,OAAO,CAAC;CAC5E,OAAO,oBAAC,aAAa,UAAd;EAA8BS;EAAQH;CAAgC;AAC/E;;AAGA,SAAgBI,aAAa,EAAEC,SAAS,GAAGC,SAAsB;CAC/D,MAAM,EAAEZ,YAAYhB,WAAWiB,YAAY;CAC3C,OACE,oBAAC,QAAD;EACE,UAAUY,UAAU;GAClBF,UAAUE,KAAK;GACfb,QAAQ,IAAI;EACd;EACA,GAAIY;CAAM;AAGhB;;AAGA,SAAgBE,WAAW,EAAEH,SAAS,GAAGC,SAAsB;CAC7D,MAAM,EAAEZ,YAAYhB,WAAWiB,YAAY;CAC3C,OACE,oBAAC,QAAD;EACE,UAA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