@agimon-ai/po-native-components 0.0.0-alpha.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/LICENSE +22 -0
- package/README.md +71 -0
- package/dist/components/Badge.d.mts +17 -0
- package/dist/components/Badge.d.mts.map +1 -0
- package/dist/components/Badge.mjs +106 -0
- package/dist/components/Badge.mjs.map +1 -0
- package/dist/components/Button.d.mts +20 -0
- package/dist/components/Button.d.mts.map +1 -0
- package/dist/components/Button.mjs +278 -0
- package/dist/components/Button.mjs.map +1 -0
- package/dist/components/CodeBlock.d.mts +10 -0
- package/dist/components/CodeBlock.d.mts.map +1 -0
- package/dist/components/CodeBlock.mjs +88 -0
- package/dist/components/CodeBlock.mjs.map +1 -0
- package/dist/components/Dialog.d.mts +52 -0
- package/dist/components/Dialog.d.mts.map +1 -0
- package/dist/components/Dialog.mjs +257 -0
- package/dist/components/Dialog.mjs.map +1 -0
- package/dist/components/Dot.d.mts +17 -0
- package/dist/components/Dot.d.mts.map +1 -0
- package/dist/components/Dot.mjs +94 -0
- package/dist/components/Dot.mjs.map +1 -0
- package/dist/components/DropdownMenu.d.mts +63 -0
- package/dist/components/DropdownMenu.d.mts.map +1 -0
- package/dist/components/DropdownMenu.mjs +256 -0
- package/dist/components/DropdownMenu.mjs.map +1 -0
- package/dist/components/EmptyState.d.mts +14 -0
- package/dist/components/EmptyState.d.mts.map +1 -0
- package/dist/components/EmptyState.mjs +64 -0
- package/dist/components/EmptyState.mjs.map +1 -0
- package/dist/components/Input.d.mts +19 -0
- package/dist/components/Input.d.mts.map +1 -0
- package/dist/components/Input.mjs +123 -0
- package/dist/components/Input.mjs.map +1 -0
- package/dist/components/Label.d.mts +13 -0
- package/dist/components/Label.d.mts.map +1 -0
- package/dist/components/Label.mjs +36 -0
- package/dist/components/Label.mjs.map +1 -0
- package/dist/components/List.d.mts +48 -0
- package/dist/components/List.d.mts.map +1 -0
- package/dist/components/List.mjs +156 -0
- package/dist/components/List.mjs.map +1 -0
- package/dist/components/Markdown.d.mts +15 -0
- package/dist/components/Markdown.d.mts.map +1 -0
- package/dist/components/Markdown.mjs +219 -0
- package/dist/components/Markdown.mjs.map +1 -0
- package/dist/components/MessageItem.d.mts +87 -0
- package/dist/components/MessageItem.d.mts.map +1 -0
- package/dist/components/MessageItem.mjs +361 -0
- package/dist/components/MessageItem.mjs.map +1 -0
- package/dist/components/Panel.d.mts +15 -0
- package/dist/components/Panel.d.mts.map +1 -0
- package/dist/components/Panel.mjs +77 -0
- package/dist/components/Panel.mjs.map +1 -0
- package/dist/components/PoNativeProvider.d.mts +15 -0
- package/dist/components/PoNativeProvider.d.mts.map +1 -0
- package/dist/components/PoNativeProvider.mjs +22 -0
- package/dist/components/PoNativeProvider.mjs.map +1 -0
- package/dist/components/SectionLabel.d.mts +6 -0
- package/dist/components/SectionLabel.d.mts.map +1 -0
- package/dist/components/SectionLabel.mjs +40 -0
- package/dist/components/SectionLabel.mjs.map +1 -0
- package/dist/components/SegmentedControl.d.mts +26 -0
- package/dist/components/SegmentedControl.d.mts.map +1 -0
- package/dist/components/SegmentedControl.mjs +56 -0
- package/dist/components/SegmentedControl.mjs.map +1 -0
- package/dist/components/Sheet.d.mts +39 -0
- package/dist/components/Sheet.d.mts.map +1 -0
- package/dist/components/Sheet.mjs +166 -0
- package/dist/components/Sheet.mjs.map +1 -0
- package/dist/components/SheetFrame.mjs +84 -0
- package/dist/components/SheetFrame.mjs.map +1 -0
- package/dist/components/Spinner.d.mts +19 -0
- package/dist/components/Spinner.d.mts.map +1 -0
- package/dist/components/Spinner.mjs +34 -0
- package/dist/components/Spinner.mjs.map +1 -0
- package/dist/components/StatusBadge.d.mts +23 -0
- package/dist/components/StatusBadge.d.mts.map +1 -0
- package/dist/components/StatusBadge.mjs +116 -0
- package/dist/components/StatusBadge.mjs.map +1 -0
- package/dist/components/Tabs.d.mts +44 -0
- package/dist/components/Tabs.d.mts.map +1 -0
- package/dist/components/Tabs.mjs +197 -0
- package/dist/components/Tabs.mjs.map +1 -0
- package/dist/components/Textarea.d.mts +10 -0
- package/dist/components/Textarea.d.mts.map +1 -0
- package/dist/components/Textarea.mjs +29 -0
- package/dist/components/Textarea.mjs.map +1 -0
- package/dist/icons/IconColorContext.d.mts +10 -0
- package/dist/icons/IconColorContext.d.mts.map +1 -0
- package/dist/icons/IconColorContext.mjs +13 -0
- package/dist/icons/IconColorContext.mjs.map +1 -0
- package/dist/icons/iconGlyphs.d.mts +120 -0
- package/dist/icons/iconGlyphs.d.mts.map +1 -0
- package/dist/icons/iconGlyphs.mjs +121 -0
- package/dist/icons/iconGlyphs.mjs.map +1 -0
- package/dist/icons/icons.d.mts +122 -0
- package/dist/icons/icons.d.mts.map +1 -0
- package/dist/icons/icons.mjs +79 -0
- package/dist/icons/icons.mjs.map +1 -0
- package/dist/index.d.mts +27 -0
- package/dist/index.mjs +27 -0
- package/dist/lib/fonts.d.mts +13 -0
- package/dist/lib/fonts.d.mts.map +1 -0
- package/dist/lib/fonts.mjs +22 -0
- package/dist/lib/fonts.mjs.map +1 -0
- package/dist/lib/haptics.d.mts +7 -0
- package/dist/lib/haptics.d.mts.map +1 -0
- package/dist/lib/haptics.mjs +25 -0
- package/dist/lib/haptics.mjs.map +1 -0
- package/dist/lib/insideSheet.mjs +16 -0
- package/dist/lib/insideSheet.mjs.map +1 -0
- package/dist/lib/markdown.mjs +271 -0
- package/dist/lib/markdown.mjs.map +1 -0
- package/dist/lib/tone.mjs +50 -0
- package/dist/lib/tone.mjs.map +1 -0
- package/dist/lib/useControllable.mjs +22 -0
- package/dist/lib/useControllable.mjs.map +1 -0
- package/dist/lib/wrapText.mjs +20 -0
- package/dist/lib/wrapText.mjs.map +1 -0
- package/llms.txt +8 -0
- package/package.json +104 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { NativeColorToken } from "@agimon-ai/po-web-components/nativeTheme";
|
|
2
|
+
import { StyleProp, ViewStyle } from "react-native";
|
|
3
|
+
//#region src/icons/icons.d.ts
|
|
4
|
+
export interface IconProps {
|
|
5
|
+
/** Edge length in points. */
|
|
6
|
+
size?: number;
|
|
7
|
+
/** A theme token; defaults to the enclosing Button's label colour, else `dim`. */
|
|
8
|
+
color?: NativeColorToken;
|
|
9
|
+
/** Given one, the icon is announced as an image; without one it is hidden from screen readers. */
|
|
10
|
+
accessibilityLabel?: string;
|
|
11
|
+
style?: StyleProp<ViewStyle>;
|
|
12
|
+
}
|
|
13
|
+
export declare const CheckIcon: {
|
|
14
|
+
({ size, color, accessibilityLabel, style }: IconProps): import("react").JSX.Element;
|
|
15
|
+
displayName: string;
|
|
16
|
+
};
|
|
17
|
+
export declare const ChevronDownIcon: {
|
|
18
|
+
({ size, color, accessibilityLabel, style }: IconProps): import("react").JSX.Element;
|
|
19
|
+
displayName: string;
|
|
20
|
+
};
|
|
21
|
+
export declare const ChevronRightIcon: {
|
|
22
|
+
({ size, color, accessibilityLabel, style }: IconProps): import("react").JSX.Element;
|
|
23
|
+
displayName: string;
|
|
24
|
+
};
|
|
25
|
+
export declare const AlertIcon: {
|
|
26
|
+
({ size, color, accessibilityLabel, style }: IconProps): import("react").JSX.Element;
|
|
27
|
+
displayName: string;
|
|
28
|
+
};
|
|
29
|
+
export declare const CopyIcon: {
|
|
30
|
+
({ size, color, accessibilityLabel, style }: IconProps): import("react").JSX.Element;
|
|
31
|
+
displayName: string;
|
|
32
|
+
};
|
|
33
|
+
export declare const MessageIcon: {
|
|
34
|
+
({ size, color, accessibilityLabel, style }: IconProps): import("react").JSX.Element;
|
|
35
|
+
displayName: string;
|
|
36
|
+
};
|
|
37
|
+
export declare const KebabIcon: {
|
|
38
|
+
({ size, color, accessibilityLabel, style }: IconProps): import("react").JSX.Element;
|
|
39
|
+
displayName: string;
|
|
40
|
+
};
|
|
41
|
+
export declare const EditIcon: {
|
|
42
|
+
({ size, color, accessibilityLabel, style }: IconProps): import("react").JSX.Element;
|
|
43
|
+
displayName: string;
|
|
44
|
+
};
|
|
45
|
+
export declare const GearIcon: {
|
|
46
|
+
({ size, color, accessibilityLabel, style }: IconProps): import("react").JSX.Element;
|
|
47
|
+
displayName: string;
|
|
48
|
+
};
|
|
49
|
+
export declare const SendIcon: {
|
|
50
|
+
({ size, color, accessibilityLabel, style }: IconProps): import("react").JSX.Element;
|
|
51
|
+
displayName: string;
|
|
52
|
+
};
|
|
53
|
+
export declare const TaskIcon: {
|
|
54
|
+
({ size, color, accessibilityLabel, style }: IconProps): import("react").JSX.Element;
|
|
55
|
+
displayName: string;
|
|
56
|
+
};
|
|
57
|
+
export declare const TrashIcon: {
|
|
58
|
+
({ size, color, accessibilityLabel, style }: IconProps): import("react").JSX.Element;
|
|
59
|
+
displayName: string;
|
|
60
|
+
};
|
|
61
|
+
export declare const WrenchIcon: {
|
|
62
|
+
({ size, color, accessibilityLabel, style }: IconProps): import("react").JSX.Element;
|
|
63
|
+
displayName: string;
|
|
64
|
+
};
|
|
65
|
+
export declare const CloseIcon: {
|
|
66
|
+
({ size, color, accessibilityLabel, style }: IconProps): import("react").JSX.Element;
|
|
67
|
+
displayName: string;
|
|
68
|
+
};
|
|
69
|
+
export declare const FolderIcon: {
|
|
70
|
+
({ size, color, accessibilityLabel, style }: IconProps): import("react").JSX.Element;
|
|
71
|
+
displayName: string;
|
|
72
|
+
};
|
|
73
|
+
export declare const BranchIcon: {
|
|
74
|
+
({ size, color, accessibilityLabel, style }: IconProps): import("react").JSX.Element;
|
|
75
|
+
displayName: string;
|
|
76
|
+
};
|
|
77
|
+
export declare const HomeIcon: {
|
|
78
|
+
({ size, color, accessibilityLabel, style }: IconProps): import("react").JSX.Element;
|
|
79
|
+
displayName: string;
|
|
80
|
+
};
|
|
81
|
+
export declare const ActivityIcon: {
|
|
82
|
+
({ size, color, accessibilityLabel, style }: IconProps): import("react").JSX.Element;
|
|
83
|
+
displayName: string;
|
|
84
|
+
};
|
|
85
|
+
export declare const ArrowRightIcon: {
|
|
86
|
+
({ size, color, accessibilityLabel, style }: IconProps): import("react").JSX.Element;
|
|
87
|
+
displayName: string;
|
|
88
|
+
};
|
|
89
|
+
export declare const PlusIcon: {
|
|
90
|
+
({ size, color, accessibilityLabel, style }: IconProps): import("react").JSX.Element;
|
|
91
|
+
displayName: string;
|
|
92
|
+
};
|
|
93
|
+
export declare const UsersIcon: {
|
|
94
|
+
({ size, color, accessibilityLabel, style }: IconProps): import("react").JSX.Element;
|
|
95
|
+
displayName: string;
|
|
96
|
+
};
|
|
97
|
+
export declare const PlayCircleIcon: {
|
|
98
|
+
({ size, color, accessibilityLabel, style }: IconProps): import("react").JSX.Element;
|
|
99
|
+
displayName: string;
|
|
100
|
+
};
|
|
101
|
+
export declare const WorkflowIcon: {
|
|
102
|
+
({ size, color, accessibilityLabel, style }: IconProps): import("react").JSX.Element;
|
|
103
|
+
displayName: string;
|
|
104
|
+
};
|
|
105
|
+
export declare const PaletteIcon: {
|
|
106
|
+
({ size, color, accessibilityLabel, style }: IconProps): import("react").JSX.Element;
|
|
107
|
+
displayName: string;
|
|
108
|
+
};
|
|
109
|
+
export declare const LightbulbIcon: {
|
|
110
|
+
({ size, color, accessibilityLabel, style }: IconProps): import("react").JSX.Element;
|
|
111
|
+
displayName: string;
|
|
112
|
+
};
|
|
113
|
+
export declare const SparklesIcon: {
|
|
114
|
+
({ size, color, accessibilityLabel, style }: IconProps): import("react").JSX.Element;
|
|
115
|
+
displayName: string;
|
|
116
|
+
};
|
|
117
|
+
export declare const LockIcon: {
|
|
118
|
+
({ size, color, accessibilityLabel, style }: IconProps): import("react").JSX.Element;
|
|
119
|
+
displayName: string;
|
|
120
|
+
};
|
|
121
|
+
//#endregion
|
|
122
|
+
//# sourceMappingURL=icons.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icons.d.mts","names":[],"sources":["../../src/icons/icons.tsx"],"mappings":";;;iBAaiB;;EAEf;;EAEA,QAAQ;;EAER;EACA,QAAQ,UAAU;;qBAkCP;KA7B8D,MAAA,OAAA,oBAAA,SAAA,4BAAS,IAAA;;;qBA8BvE;KA9B8D,MAAA,OAAA,oBAAA,SAAA,4BAAS,IAAA;;;qBA+BvE;KA/B8D,MAAA,OAAA,oBAAA,SAAA,4BAAS,IAAA;;;qBAgCvE;KAhC8D,MAAA,OAAA,oBAAA,SAAA,4BAAS,IAAA;;;qBAiCvE;KAjC8D,MAAA,OAAA,oBAAA,SAAA,4BAAS,IAAA;;;qBAkCvE;KAlC8D,MAAA,OAAA,oBAAA,SAAA,4BAAS,IAAA;;;qBAmCvE;KAnC8D,MAAA,OAAA,oBAAA,SAAA,4BAAS,IAAA;;;qBAoCvE;KApC8D,MAAA,OAAA,oBAAA,SAAA,4BAAS,IAAA;;;qBAqCvE;KArC8D,MAAA,OAAA,oBAAA,SAAA,4BAAS,IAAA;;;qBAsCvE;KAtC8D,MAAA,OAAA,oBAAA,SAAA,4BAAS,IAAA;;;qBAuCvE;KAvC8D,MAAA,OAAA,oBAAA,SAAA,4BAAS,IAAA;;;qBAwCvE;KAxC8D,MAAA,OAAA,oBAAA,SAAA,4BAAS,IAAA;;;qBAyCvE;KAzC8D,MAAA,OAAA,oBAAA,SAAA,4BAAS,IAAA;;;qBA0CvE;KA1C8D,MAAA,OAAA,oBAAA,SAAA,4BAAS,IAAA;;;qBA2CvE;KA3C8D,MAAA,OAAA,oBAAA,SAAA,4BAAS,IAAA;;;qBA4CvE;KA5C8D,MAAA,OAAA,oBAAA,SAAA,4BAAS,IAAA;;;qBA6CvE;KA7C8D,MAAA,OAAA,oBAAA,SAAA,4BAAS,IAAA;;;qBA8CvE;KA9C8D,MAAA,OAAA,oBAAA,SAAA,4BAAS,IAAA;;;qBA+CvE;KA/C8D,MAAA,OAAA,oBAAA,SAAA,4BAAS,IAAA;;;qBAgDvE;KAhD8D,MAAA,OAAA,oBAAA,SAAA,4BAAS,IAAA;;;qBAiDvE;KAjD8D,MAAA,OAAA,oBAAA,SAAA,4BAAS,IAAA;;;qBAkDvE;KAlD8D,MAAA,OAAA,oBAAA,SAAA,4BAAS,IAAA;;;qBAmDvE;KAnD8D,MAAA,OAAA,oBAAA,SAAA,4BAAS,IAAA;;;qBAoDvE;KApD8D,MAAA,OAAA,oBAAA,SAAA,4BAAS,IAAA;;;qBAqDvE;KArD8D,MAAA,OAAA,oBAAA,SAAA,4BAAS,IAAA;;;qBAsDvE;KAtD8D,MAAA,OAAA,oBAAA,SAAA,4BAAS,IAAA;;;qBAuDvE;KAvD8D,MAAA,OAAA,oBAAA,SAAA,4BAAS,IAAA"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { IconColorContext } from "./IconColorContext.mjs";
|
|
2
|
+
import { ICON_GLYPHS } from "./iconGlyphs.mjs";
|
|
3
|
+
import { useUnistyles } from "react-native-unistyles";
|
|
4
|
+
import { Platform } from "react-native";
|
|
5
|
+
import { useContext } from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
import MaterialIcons from "@expo/vector-icons/MaterialIcons";
|
|
8
|
+
import { SymbolView } from "expo-symbols";
|
|
9
|
+
|
|
10
|
+
//#region src/icons/icons.tsx
|
|
11
|
+
const DEFAULT_SIZE = 16;
|
|
12
|
+
const DEFAULT_COLOR = "dim";
|
|
13
|
+
function createIcon(name) {
|
|
14
|
+
const glyph = ICON_GLYPHS[name];
|
|
15
|
+
function Icon({ size = DEFAULT_SIZE, color, accessibilityLabel, style }) {
|
|
16
|
+
const { theme } = useUnistyles();
|
|
17
|
+
const inherited = useContext(IconColorContext);
|
|
18
|
+
const tint = theme.colors[color ?? inherited ?? DEFAULT_COLOR];
|
|
19
|
+
const a11y = accessibilityLabel === void 0 ? {
|
|
20
|
+
accessible: false,
|
|
21
|
+
importantForAccessibility: "no-hide-descendants",
|
|
22
|
+
accessibilityElementsHidden: true
|
|
23
|
+
} : {
|
|
24
|
+
accessible: true,
|
|
25
|
+
accessibilityRole: "image",
|
|
26
|
+
accessibilityLabel
|
|
27
|
+
};
|
|
28
|
+
if (Platform.OS === "ios") return /* @__PURE__ */ jsx(SymbolView, {
|
|
29
|
+
name: glyph.sf,
|
|
30
|
+
size,
|
|
31
|
+
tintColor: tint,
|
|
32
|
+
style: [{
|
|
33
|
+
width: size,
|
|
34
|
+
height: size
|
|
35
|
+
}, style],
|
|
36
|
+
...a11y
|
|
37
|
+
});
|
|
38
|
+
return /* @__PURE__ */ jsx(MaterialIcons, {
|
|
39
|
+
name: glyph.material,
|
|
40
|
+
size,
|
|
41
|
+
color: tint,
|
|
42
|
+
style,
|
|
43
|
+
...a11y
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
Icon.displayName = `${name}Icon`;
|
|
47
|
+
return Icon;
|
|
48
|
+
}
|
|
49
|
+
const CheckIcon = createIcon("Check");
|
|
50
|
+
const ChevronDownIcon = createIcon("ChevronDown");
|
|
51
|
+
const ChevronRightIcon = createIcon("ChevronRight");
|
|
52
|
+
const AlertIcon = createIcon("Alert");
|
|
53
|
+
const CopyIcon = createIcon("Copy");
|
|
54
|
+
const MessageIcon = createIcon("Message");
|
|
55
|
+
const KebabIcon = createIcon("Kebab");
|
|
56
|
+
const EditIcon = createIcon("Edit");
|
|
57
|
+
const GearIcon = createIcon("Gear");
|
|
58
|
+
const SendIcon = createIcon("Send");
|
|
59
|
+
const TaskIcon = createIcon("Task");
|
|
60
|
+
const TrashIcon = createIcon("Trash");
|
|
61
|
+
const WrenchIcon = createIcon("Wrench");
|
|
62
|
+
const CloseIcon = createIcon("Close");
|
|
63
|
+
const FolderIcon = createIcon("Folder");
|
|
64
|
+
const BranchIcon = createIcon("Branch");
|
|
65
|
+
const HomeIcon = createIcon("Home");
|
|
66
|
+
const ActivityIcon = createIcon("Activity");
|
|
67
|
+
const ArrowRightIcon = createIcon("ArrowRight");
|
|
68
|
+
const PlusIcon = createIcon("Plus");
|
|
69
|
+
const UsersIcon = createIcon("Users");
|
|
70
|
+
const PlayCircleIcon = createIcon("PlayCircle");
|
|
71
|
+
const WorkflowIcon = createIcon("Workflow");
|
|
72
|
+
const PaletteIcon = createIcon("Palette");
|
|
73
|
+
const LightbulbIcon = createIcon("Lightbulb");
|
|
74
|
+
const SparklesIcon = createIcon("Sparkles");
|
|
75
|
+
const LockIcon = createIcon("Lock");
|
|
76
|
+
|
|
77
|
+
//#endregion
|
|
78
|
+
export { ActivityIcon, AlertIcon, ArrowRightIcon, BranchIcon, CheckIcon, ChevronDownIcon, ChevronRightIcon, CloseIcon, CopyIcon, EditIcon, FolderIcon, GearIcon, HomeIcon, KebabIcon, LightbulbIcon, LockIcon, MessageIcon, PaletteIcon, PlayCircleIcon, PlusIcon, SendIcon, SparklesIcon, TaskIcon, TrashIcon, UsersIcon, WorkflowIcon, WrenchIcon };
|
|
79
|
+
//# sourceMappingURL=icons.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icons.mjs","names":["NativeColorToken","MaterialIcons","SymbolView","useContext","Platform","StyleProp","ViewStyle","useUnistyles","IconColorContext","ICON_GLYPHS","IconName","DEFAULT_SIZE","DEFAULT_COLOR","IconProps","size","color","accessibilityLabel","style","createIcon","name","glyph","Icon","theme","inherited","tint","colors","a11y","undefined","accessible","importantForAccessibility","accessibilityElementsHidden","const","accessibilityRole","OS","sf","width","height","material","displayName","CheckIcon","ChevronDownIcon","ChevronRightIcon","AlertIcon","CopyIcon","MessageIcon","KebabIcon","EditIcon","GearIcon","SendIcon","TaskIcon","TrashIcon","WrenchIcon","CloseIcon","FolderIcon","BranchIcon","HomeIcon","ActivityIcon","ArrowRightIcon","PlusIcon","UsersIcon","PlayCircleIcon","WorkflowIcon","PaletteIcon","LightbulbIcon","SparklesIcon","LockIcon"],"sources":["../../src/icons/icons.tsx"],"sourcesContent":["import type { NativeColorToken } from '@agimon-ai/po-web-components/nativeTheme';\nimport MaterialIcons from '@expo/vector-icons/MaterialIcons';\nimport { SymbolView } from 'expo-symbols';\nimport { useContext } from 'react';\nimport { Platform, type StyleProp, type ViewStyle } from 'react-native';\nimport { useUnistyles } from 'react-native-unistyles';\n\nimport { IconColorContext } from './IconColorContext';\nimport { ICON_GLYPHS, type IconName } from './iconGlyphs';\n\nconst DEFAULT_SIZE = 16;\nconst DEFAULT_COLOR: NativeColorToken = 'dim';\n\nexport interface IconProps {\n /** Edge length in points. */\n size?: number;\n /** A theme token; defaults to the enclosing Button's label colour, else `dim`. */\n color?: NativeColorToken;\n /** Given one, the icon is announced as an image; without one it is hidden from screen readers. */\n accessibilityLabel?: string;\n style?: StyleProp<ViewStyle>;\n}\n\nfunction createIcon(name: IconName) {\n const glyph = ICON_GLYPHS[name];\n function Icon({ size = DEFAULT_SIZE, color, accessibilityLabel, style }: IconProps) {\n const { theme } = useUnistyles();\n const inherited = useContext(IconColorContext);\n const tint = theme.colors[color ?? inherited ?? DEFAULT_COLOR];\n const a11y =\n accessibilityLabel === undefined\n ? ({\n accessible: false,\n importantForAccessibility: 'no-hide-descendants',\n accessibilityElementsHidden: true,\n } as const)\n : ({ accessible: true, accessibilityRole: 'image', accessibilityLabel } as const);\n if (Platform.OS === 'ios') {\n return (\n <SymbolView\n name={glyph.sf}\n size={size}\n tintColor={tint}\n style={[{ width: size, height: size }, style]}\n {...a11y}\n />\n );\n }\n return <MaterialIcons name={glyph.material} size={size} color={tint} style={style} {...a11y} />;\n }\n Icon.displayName = `${name}Icon`;\n return Icon;\n}\n\nexport const CheckIcon = createIcon('Check');\nexport const ChevronDownIcon = createIcon('ChevronDown');\nexport const ChevronRightIcon = createIcon('ChevronRight');\nexport const AlertIcon = createIcon('Alert');\nexport const CopyIcon = createIcon('Copy');\nexport const MessageIcon = createIcon('Message');\nexport const KebabIcon = createIcon('Kebab');\nexport const EditIcon = createIcon('Edit');\nexport const GearIcon = createIcon('Gear');\nexport const SendIcon = createIcon('Send');\nexport const TaskIcon = createIcon('Task');\nexport const TrashIcon = createIcon('Trash');\nexport const WrenchIcon = createIcon('Wrench');\nexport const CloseIcon = createIcon('Close');\nexport const FolderIcon = createIcon('Folder');\nexport const BranchIcon = createIcon('Branch');\nexport const HomeIcon = createIcon('Home');\nexport const ActivityIcon = createIcon('Activity');\nexport const ArrowRightIcon = createIcon('ArrowRight');\nexport const PlusIcon = createIcon('Plus');\nexport const UsersIcon = createIcon('Users');\nexport const PlayCircleIcon = createIcon('PlayCircle');\nexport const WorkflowIcon = createIcon('Workflow');\nexport const PaletteIcon = createIcon('Palette');\nexport const LightbulbIcon = createIcon('Lightbulb');\nexport const SparklesIcon = createIcon('Sparkles');\nexport const LockIcon = createIcon('Lock');\n"],"mappings":";;;;;;;;;;AAUA,MAAMW,eAAe;AACrB,MAAMC,gBAAkC;AAYxC,SAASM,WAAWC,MAAgB;CAClC,MAAMC,QAAQX,YAAYU;CAC1B,SAASE,KAAK,EAAEP,OAAOH,cAAcI,OAAOC,oBAAoBC,SAAoB;EAClF,MAAM,EAAEK,UAAUf,aAAa;EAC/B,MAAMgB,YAAYpB,WAAWK,gBAAgB;EAC7C,MAAMgB,OAAOF,MAAMG,OAAOV,SAASQ,aAAaX;EAChD,MAAMc,OACJV,uBAAuBW,SAClB;GACCC,YAAY;GACZC,2BAA2B;GAC3BC,6BAA6B;EAC/B,IACC;GAAEF,YAAY;GAAMI,mBAAmB;GAAShB;EAAmB;EAC1E,IAAIZ,SAAS6B,OAAO,OAClB,OACE,oBAAC,YAAD;GACE,MAAMb,MAAMc;GACNpB;GACN,WAAWU;GACX,OAAO,CAAC;IAAEW,OAAOrB;IAAMsB,QAAQtB;GAAK,GAAGG,KAAK;GAC5C,GAAIS;EAAK;EAIf,OAAO,oBAAC,eAAD;GAAe,MAAMN,MAAMiB;GAAgBvB;GAAM,OAAOU;GAAaP;GAAO,GAAIS;EAAK;CAC9F;CACAL,KAAKiB,cAAc,GAAGnB,KAAI;CAC1B,OAAOE;AACT;AAEA,MAAakB,YAAYrB,WAAW,OAAO;AAC3C,MAAasB,kBAAkBtB,WAAW,aAAa;AACvD,MAAauB,mBAAmBvB,WAAW,cAAc;AACzD,MAAawB,YAAYxB,WAAW,OAAO;AAC3C,MAAayB,WAAWzB,WAAW,MAAM;AACzC,MAAa0B,cAAc1B,WAAW,SAAS;AAC/C,MAAa2B,YAAY3B,WAAW,OAAO;AAC3C,MAAa4B,WAAW5B,WAAW,MAAM;AACzC,MAAa6B,WAAW7B,WAAW,MAAM;AACzC,MAAa8B,WAAW9B,WAAW,MAAM;AACzC,MAAa+B,WAAW/B,WAAW,MAAM;AACzC,MAAagC,YAAYhC,WAAW,OAAO;AAC3C,MAAaiC,aAAajC,WAAW,QAAQ;AAC7C,MAAakC,YAAYlC,WAAW,OAAO;AAC3C,MAAamC,aAAanC,WAAW,QAAQ;AAC7C,MAAaoC,aAAapC,WAAW,QAAQ;AAC7C,MAAaqC,WAAWrC,WAAW,MAAM;AACzC,MAAasC,eAAetC,WAAW,UAAU;AACjD,MAAauC,iBAAiBvC,WAAW,YAAY;AACrD,MAAawC,WAAWxC,WAAW,MAAM;AACzC,MAAayC,YAAYzC,WAAW,OAAO;AAC3C,MAAa0C,iBAAiB1C,WAAW,YAAY;AACrD,MAAa2C,eAAe3C,WAAW,UAAU;AACjD,MAAa4C,cAAc5C,WAAW,SAAS;AAC/C,MAAa6C,gBAAgB7C,WAAW,WAAW;AACnD,MAAa8C,eAAe9C,WAAW,UAAU;AACjD,MAAa+C,WAAW/C,WAAW,MAAM"}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Badge, BadgeProps, BadgeSize, BadgeTone } from "./components/Badge.mjs";
|
|
2
|
+
import { Button, ButtonProps, ButtonSize, ButtonVariant } from "./components/Button.mjs";
|
|
3
|
+
import { CodeBlock, CodeBlockProps } from "./components/CodeBlock.mjs";
|
|
4
|
+
import { Dialog, DialogBody, DialogClose, DialogContent, DialogContentProps, DialogDescription, DialogFooter, DialogFooterProps, DialogFooterVariant, DialogHeader, DialogHeaderProps, DialogPartProps, DialogProps, DialogTitle, DialogTrigger, DialogWidth } from "./components/Dialog.mjs";
|
|
5
|
+
import { Dot, DotProps, DotSize, DotTone } from "./components/Dot.mjs";
|
|
6
|
+
import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuCheckboxItemProps, DropdownMenuContent, DropdownMenuContentProps, DropdownMenuGroup, DropdownMenuItem, DropdownMenuItemProps, DropdownMenuItemVariant, DropdownMenuLabel, DropdownMenuPartProps, DropdownMenuProps, DropdownMenuRadioGroup, DropdownMenuRadioGroupProps, DropdownMenuRadioItem, DropdownMenuRadioItemProps, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger } from "./components/DropdownMenu.mjs";
|
|
7
|
+
import { EmptyState, EmptyStateProps } from "./components/EmptyState.mjs";
|
|
8
|
+
import { FieldSize, FieldVariant, Input, InputProps } from "./components/Input.mjs";
|
|
9
|
+
import { Label, LabelProps } from "./components/Label.mjs";
|
|
10
|
+
import { List, ListProps, ListRow, ListRowProps } from "./components/List.mjs";
|
|
11
|
+
import { FileLinkHandler, Markdown, MarkdownProps } from "./components/Markdown.mjs";
|
|
12
|
+
import { STATUS_EDGE, StatusBadge, StatusBadgeProps, StatusBadgeSize, StatusTone } from "./components/StatusBadge.mjs";
|
|
13
|
+
import { MessageItem, MessageItemBody, MessageItemGroup, MessageItemGroupProps, MessageItemHeader, MessageItemHeaderProps, MessageItemPartProps, MessageItemProps, MessageItemState, MessageItemStatus, MessageItemStatusProps, STATUS_GLYPH, STATUS_LABEL, toolTone, useMessageItem } from "./components/MessageItem.mjs";
|
|
14
|
+
import { Panel, PanelBody, PanelHeader, PanelPartProps } from "./components/Panel.mjs";
|
|
15
|
+
import { PoNativeProvider, PoNativeProviderProps } from "./components/PoNativeProvider.mjs";
|
|
16
|
+
import { SectionLabel } from "./components/SectionLabel.mjs";
|
|
17
|
+
import { SegmentedControl, SegmentedControlOption, SegmentedControlProps } from "./components/SegmentedControl.mjs";
|
|
18
|
+
import { Sheet, SheetBody, SheetClose, SheetContent, SheetContentProps, SheetDescription, SheetFooter, SheetHeader, SheetHeaderProps, SheetPartProps, SheetProps, SheetTitle, SheetTrigger } from "./components/Sheet.mjs";
|
|
19
|
+
import { Spinner, SpinnerProps } from "./components/Spinner.mjs";
|
|
20
|
+
import { TabBadge, TabBadgeProps, Tabs, TabsContent, TabsContentProps, TabsList, TabsListProps, TabsProps, TabsTrigger, TabsTriggerProps } from "./components/Tabs.mjs";
|
|
21
|
+
import { Textarea, TextareaProps } from "./components/Textarea.mjs";
|
|
22
|
+
import { ActivityIcon, AlertIcon, ArrowRightIcon, BranchIcon, CheckIcon, ChevronDownIcon, ChevronRightIcon, CloseIcon, CopyIcon, EditIcon, FolderIcon, GearIcon, HomeIcon, IconProps, KebabIcon, LightbulbIcon, LockIcon, MessageIcon, PaletteIcon, PlayCircleIcon, PlusIcon, SendIcon, SparklesIcon, TaskIcon, TrashIcon, UsersIcon, WorkflowIcon, WrenchIcon } from "./icons/icons.mjs";
|
|
23
|
+
import { IconName } from "./icons/iconGlyphs.mjs";
|
|
24
|
+
import { fontOf } from "./lib/fonts.mjs";
|
|
25
|
+
import { IconColorContext } from "./icons/IconColorContext.mjs";
|
|
26
|
+
import { impactLight, selectionTick } from "./lib/haptics.mjs";
|
|
27
|
+
export { ActivityIcon, AlertIcon, ArrowRightIcon, Badge, type BadgeProps, type BadgeSize, type BadgeTone, BranchIcon, Button, type ButtonProps, type ButtonSize, type ButtonVariant, CheckIcon, ChevronDownIcon, ChevronRightIcon, CloseIcon, CodeBlock, type CodeBlockProps, CopyIcon, Dialog, DialogBody, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, type DialogFooterProps, type DialogFooterVariant, DialogHeader, type DialogHeaderProps, type DialogPartProps, type DialogProps, DialogTitle, DialogTrigger, type DialogWidth, Dot, type DotProps, type DotSize, type DotTone, DropdownMenu, DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemProps, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, DropdownMenuItem, type DropdownMenuItemProps, type DropdownMenuItemVariant, DropdownMenuLabel, type DropdownMenuPartProps, type DropdownMenuProps, DropdownMenuRadioGroup, type DropdownMenuRadioGroupProps, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger, EditIcon, EmptyState, type EmptyStateProps, type FieldSize, type FieldVariant, type FileLinkHandler, FolderIcon, GearIcon, HomeIcon, IconColorContext, type IconName, type IconProps, Input, type InputProps, KebabIcon, Label, type LabelProps, LightbulbIcon, List, type ListProps, ListRow, type ListRowProps, LockIcon, Markdown, type MarkdownProps, MessageIcon, MessageItem, MessageItemBody, MessageItemGroup, type MessageItemGroupProps, MessageItemHeader, type MessageItemHeaderProps, type MessageItemPartProps, type MessageItemProps, type MessageItemState, MessageItemStatus, type MessageItemStatusProps, PaletteIcon, Panel, PanelBody, PanelHeader, type PanelPartProps, PlayCircleIcon, PlusIcon, PoNativeProvider, type PoNativeProviderProps, STATUS_EDGE, STATUS_GLYPH, STATUS_LABEL, SectionLabel, SegmentedControl, type SegmentedControlOption, type SegmentedControlProps, SendIcon, Sheet, SheetBody, SheetClose, SheetContent, type SheetContentProps, SheetDescription, SheetFooter, SheetHeader, type SheetHeaderProps, type SheetPartProps, type SheetProps, SheetTitle, SheetTrigger, SparklesIcon, Spinner, type SpinnerProps, StatusBadge, type StatusBadgeProps, type StatusBadgeSize, type StatusTone, TabBadge, type TabBadgeProps, Tabs, TabsContent, type TabsContentProps, TabsList, type TabsListProps, type TabsProps, TabsTrigger, type TabsTriggerProps, TaskIcon, Textarea, type TextareaProps, TrashIcon, UsersIcon, WorkflowIcon, WrenchIcon, fontOf, impactLight, selectionTick, toolTone, useMessageItem };
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { fontOf } from "./lib/fonts.mjs";
|
|
2
|
+
import { Badge } from "./components/Badge.mjs";
|
|
3
|
+
import { IconColorContext } from "./icons/IconColorContext.mjs";
|
|
4
|
+
import { impactLight, selectionTick } from "./lib/haptics.mjs";
|
|
5
|
+
import { Spinner } from "./components/Spinner.mjs";
|
|
6
|
+
import { Button } from "./components/Button.mjs";
|
|
7
|
+
import { ActivityIcon, AlertIcon, ArrowRightIcon, BranchIcon, CheckIcon, ChevronDownIcon, ChevronRightIcon, CloseIcon, CopyIcon, EditIcon, FolderIcon, GearIcon, HomeIcon, KebabIcon, LightbulbIcon, LockIcon, MessageIcon, PaletteIcon, PlayCircleIcon, PlusIcon, SendIcon, SparklesIcon, TaskIcon, TrashIcon, UsersIcon, WorkflowIcon, WrenchIcon } from "./icons/icons.mjs";
|
|
8
|
+
import { CodeBlock } from "./components/CodeBlock.mjs";
|
|
9
|
+
import { Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "./components/Dialog.mjs";
|
|
10
|
+
import { Dot } from "./components/Dot.mjs";
|
|
11
|
+
import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger } from "./components/DropdownMenu.mjs";
|
|
12
|
+
import { EmptyState } from "./components/EmptyState.mjs";
|
|
13
|
+
import { Input } from "./components/Input.mjs";
|
|
14
|
+
import { Label } from "./components/Label.mjs";
|
|
15
|
+
import { List, ListRow } from "./components/List.mjs";
|
|
16
|
+
import { Markdown } from "./components/Markdown.mjs";
|
|
17
|
+
import { STATUS_EDGE, StatusBadge } from "./components/StatusBadge.mjs";
|
|
18
|
+
import { MessageItem, MessageItemBody, MessageItemGroup, MessageItemHeader, MessageItemStatus, STATUS_GLYPH, STATUS_LABEL, toolTone, useMessageItem } from "./components/MessageItem.mjs";
|
|
19
|
+
import { Panel, PanelBody, PanelHeader } from "./components/Panel.mjs";
|
|
20
|
+
import { PoNativeProvider } from "./components/PoNativeProvider.mjs";
|
|
21
|
+
import { SectionLabel } from "./components/SectionLabel.mjs";
|
|
22
|
+
import { SegmentedControl } from "./components/SegmentedControl.mjs";
|
|
23
|
+
import { Sheet, SheetBody, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger } from "./components/Sheet.mjs";
|
|
24
|
+
import { TabBadge, Tabs, TabsContent, TabsList, TabsTrigger } from "./components/Tabs.mjs";
|
|
25
|
+
import { Textarea } from "./components/Textarea.mjs";
|
|
26
|
+
|
|
27
|
+
export { ActivityIcon, AlertIcon, ArrowRightIcon, Badge, BranchIcon, Button, CheckIcon, ChevronDownIcon, ChevronRightIcon, CloseIcon, CodeBlock, CopyIcon, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, Dot, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger, EditIcon, EmptyState, FolderIcon, GearIcon, HomeIcon, IconColorContext, Input, KebabIcon, Label, LightbulbIcon, List, ListRow, LockIcon, Markdown, MessageIcon, MessageItem, MessageItemBody, MessageItemGroup, MessageItemHeader, MessageItemStatus, PaletteIcon, Panel, PanelBody, PanelHeader, PlayCircleIcon, PlusIcon, PoNativeProvider, STATUS_EDGE, STATUS_GLYPH, STATUS_LABEL, SectionLabel, SegmentedControl, SendIcon, Sheet, SheetBody, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, SparklesIcon, Spinner, StatusBadge, TabBadge, Tabs, TabsContent, TabsList, TabsTrigger, TaskIcon, Textarea, TrashIcon, UsersIcon, WorkflowIcon, WrenchIcon, fontOf, impactLight, selectionTick, toolTone, useMessageItem };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { NativeFontStack } from "@agimon-ai/po-web-components/nativeTheme";
|
|
2
|
+
//#region src/lib/fonts.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* The font family a native style names for a stack: the platform font on iOS
|
|
5
|
+
* and Android until the brand families are bundled, and the brand family with
|
|
6
|
+
* a CSS generic fallback on web, where story renders run.
|
|
7
|
+
*
|
|
8
|
+
* ponytail: load IBM Plex Sans and JetBrains Mono through expo-font and return
|
|
9
|
+
* `stack.family` everywhere once the native visual review starts.
|
|
10
|
+
*/
|
|
11
|
+
export declare function fontOf(stack: NativeFontStack): string;
|
|
12
|
+
//#endregion
|
|
13
|
+
//# sourceMappingURL=fonts.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fonts.d.mts","names":[],"sources":["../../src/lib/fonts.ts"],"mappings":";;;;;;;;;;wBAWgB,OAAO,OAAO"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Platform } from "react-native";
|
|
2
|
+
|
|
3
|
+
//#region src/lib/fonts.ts
|
|
4
|
+
/**
|
|
5
|
+
* The font family a native style names for a stack: the platform font on iOS
|
|
6
|
+
* and Android until the brand families are bundled, and the brand family with
|
|
7
|
+
* a CSS generic fallback on web, where story renders run.
|
|
8
|
+
*
|
|
9
|
+
* ponytail: load IBM Plex Sans and JetBrains Mono through expo-font and return
|
|
10
|
+
* `stack.family` everywhere once the native visual review starts.
|
|
11
|
+
*/
|
|
12
|
+
function fontOf(stack) {
|
|
13
|
+
return Platform.select({
|
|
14
|
+
ios: stack.ios,
|
|
15
|
+
android: stack.android,
|
|
16
|
+
default: `${stack.family}, ${stack.android}`
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { fontOf };
|
|
22
|
+
//# sourceMappingURL=fonts.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fonts.mjs","names":["NativeFontStack","Platform","fontOf","stack","select","ios","android","default","family"],"sources":["../../src/lib/fonts.ts"],"sourcesContent":["import type { NativeFontStack } from '@agimon-ai/po-web-components/nativeTheme';\nimport { Platform } from 'react-native';\n\n/**\n * The font family a native style names for a stack: the platform font on iOS\n * and Android until the brand families are bundled, and the brand family with\n * a CSS generic fallback on web, where story renders run.\n *\n * ponytail: load IBM Plex Sans and JetBrains Mono through expo-font and return\n * `stack.family` everywhere once the native visual review starts.\n */\nexport function fontOf(stack: NativeFontStack): string {\n return Platform.select({\n ios: stack.ios,\n android: stack.android,\n default: `${stack.family}, ${stack.android}`,\n });\n}\n"],"mappings":";;;;;;;;;;;AAWA,SAAgBE,OAAOC,OAAgC;CACrD,OAAOF,SAASG,OAAO;EACrBC,KAAKF,MAAME;EACXC,SAASH,MAAMG;EACfC,SAAS,GAAGJ,MAAMK,OAAM,IAAKL,MAAMG;CACrC,CAAC;AACH"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
//#region src/lib/haptics.d.ts
|
|
2
|
+
/** A light impact for a committing press. */
|
|
3
|
+
export declare function impactLight(): void;
|
|
4
|
+
/** A selection tick for choosing one option among several. */
|
|
5
|
+
export declare function selectionTick(): void;
|
|
6
|
+
//#endregion
|
|
7
|
+
//# sourceMappingURL=haptics.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"haptics.d.mts","names":[],"sources":["../../src/lib/haptics.ts"],"mappings":";;wBAqBgB;;wBAKA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Platform } from "react-native";
|
|
2
|
+
import { ImpactFeedbackStyle, impactAsync, selectionAsync } from "expo-haptics";
|
|
3
|
+
|
|
4
|
+
//#region src/lib/haptics.ts
|
|
5
|
+
/**
|
|
6
|
+
* Haptics are a courtesy. A device without a haptic engine, or with haptics
|
|
7
|
+
* turned off, rejects the call, and the press it accompanies must still go
|
|
8
|
+
* through, so a rejection resolves to "no buzz" and nothing more.
|
|
9
|
+
*/
|
|
10
|
+
function courtesy(feedback) {
|
|
11
|
+
if (Platform.OS === "web") return;
|
|
12
|
+
feedback().catch(() => void 0);
|
|
13
|
+
}
|
|
14
|
+
/** A light impact for a committing press. */
|
|
15
|
+
function impactLight() {
|
|
16
|
+
courtesy(() => impactAsync(ImpactFeedbackStyle.Light));
|
|
17
|
+
}
|
|
18
|
+
/** A selection tick for choosing one option among several. */
|
|
19
|
+
function selectionTick() {
|
|
20
|
+
courtesy(() => selectionAsync());
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
export { impactLight, selectionTick };
|
|
25
|
+
//# sourceMappingURL=haptics.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"haptics.mjs","names":["ImpactFeedbackStyle","impactAsync","selectionAsync","Platform","courtesy","feedback","Promise","OS","catch","undefined","impactLight","Light","selectionTick"],"sources":["../../src/lib/haptics.ts"],"sourcesContent":["import { ImpactFeedbackStyle, impactAsync, selectionAsync } from 'expo-haptics';\nimport { Platform } from 'react-native';\n\n/*\n * The whole haptics policy. A light impact confirms a press that commits\n * something (primary, danger and success buttons); a selection tick marks a\n * choice among options (tabs, segmented controls, menu items). Nothing else\n * buzzes: calm by default.\n */\n\n/**\n * Haptics are a courtesy. A device without a haptic engine, or with haptics\n * turned off, rejects the call, and the press it accompanies must still go\n * through, so a rejection resolves to \"no buzz\" and nothing more.\n */\nfunction courtesy(feedback: () => Promise<void>): void {\n if (Platform.OS === 'web') return;\n feedback().catch(() => undefined);\n}\n\n/** A light impact for a committing press. */\nexport function impactLight(): void {\n courtesy(() => impactAsync(ImpactFeedbackStyle.Light));\n}\n\n/** A selection tick for choosing one option among several. */\nexport function selectionTick(): void {\n courtesy(() => selectionAsync());\n}\n"],"mappings":";;;;;;;;;AAeA,SAASI,SAASC,UAAqC;CACrD,IAAIF,SAASI,OAAO,OAAO;CAC3BF,SAAS,CAAC,CAACG,YAAYC,MAAS;AAClC;;AAGA,SAAgBC,cAAoB;CAClCN,eAAeH,YAAYD,oBAAoBW,KAAK,CAAC;AACvD;;AAGA,SAAgBC,gBAAsB;CACpCR,eAAeF,eAAe,CAAC;AACjC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createContext, useContext } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/lib/insideSheet.ts
|
|
4
|
+
/**
|
|
5
|
+
* Whether the caller renders inside a bottom sheet. A sheet's text field has
|
|
6
|
+
* to be the bottom sheet's own TextInput, or the keyboard covers it and the
|
|
7
|
+
* sheet never moves; Input reads this instead of asking callers to pick.
|
|
8
|
+
*/
|
|
9
|
+
const InsideSheetContext = createContext(false);
|
|
10
|
+
function useInsideSheet() {
|
|
11
|
+
return useContext(InsideSheetContext);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
export { InsideSheetContext, useInsideSheet };
|
|
16
|
+
//# sourceMappingURL=insideSheet.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"insideSheet.mjs","names":[],"sources":["../../src/lib/insideSheet.ts"],"sourcesContent":["import { createContext, useContext } from 'react';\n\n/**\n * Whether the caller renders inside a bottom sheet. A sheet's text field has\n * to be the bottom sheet's own TextInput, or the keyboard covers it and the\n * sheet never moves; Input reads this instead of asking callers to pick.\n */\nexport const InsideSheetContext = createContext(false);\n\nexport function useInsideSheet(): boolean {\n return useContext(InsideSheetContext);\n}\n"],"mappings":";;;;;;;;AAOA,MAAa,qBAAqB,cAAc,KAAK;AAErD,SAAgB,iBAA0B;CACxC,OAAO,WAAW,kBAAkB;AACtC"}
|