@agimon-ai/po-native-components 0.0.0-alpha.2 → 0.0.0-alpha.21
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/Badge.mjs +1 -1
- package/dist/components/Badge.mjs.map +1 -1
- package/dist/components/Button.mjs +1 -1
- package/dist/components/Button.mjs.map +1 -1
- package/dist/components/Dialog.mjs +2 -2
- package/dist/components/Dialog.mjs.map +1 -1
- package/dist/components/Dot.mjs +1 -1
- package/dist/components/Dot.mjs.map +1 -1
- package/dist/components/Input.mjs +1 -1
- package/dist/components/Input.mjs.map +1 -1
- package/dist/components/SegmentedControl.d.mts.map +1 -1
- package/dist/components/SegmentedControl.mjs.map +1 -1
- package/dist/components/SheetFrame.mjs +1 -1
- package/dist/components/SheetFrame.mjs.map +1 -1
- package/dist/icons/iconGlyphs.d.mts +74 -54
- package/dist/icons/iconGlyphs.d.mts.map +1 -1
- package/dist/icons/iconGlyphs.mjs +20 -0
- package/dist/icons/iconGlyphs.mjs.map +1 -1
- package/dist/icons/icons.d.mts +20 -0
- package/dist/icons/icons.d.mts.map +1 -1
- package/dist/icons/icons.mjs +6 -1
- package/dist/icons/icons.mjs.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +13 -13
package/LICENSE
CHANGED
|
@@ -1,22 +1,149 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
1
|
+
License text copyright © 2017 MariaDB Corporation Ab, All Rights Reserved.
|
|
2
|
+
"Business Source License" is a trademark of MariaDB Corporation Ab.
|
|
3
|
+
|
|
4
|
+
Parameters
|
|
5
|
+
|
|
6
|
+
Licensor: Agimon Pty Ltd
|
|
7
|
+
Licensed Work: Po, the software in the Po source repository and the
|
|
8
|
+
packages released from it, in each version released by
|
|
9
|
+
the Licensor.
|
|
10
|
+
The Licensed Work is (c) 2026 Agimon Pty Ltd.
|
|
11
|
+
Material identified as third-party in the "Third-party
|
|
12
|
+
components" section at the end of this file or in a
|
|
13
|
+
NOTICE file, and any package or directory whose own
|
|
14
|
+
license file grants a different license, is not part of
|
|
15
|
+
the Licensed Work and remains under its own license.
|
|
16
|
+
Additional Use Grant: You may make production use of the Licensed Work if
|
|
17
|
+
your use is Eligible Use. "Eligible Use" is production use that falls
|
|
18
|
+
within at least one of the following:
|
|
19
|
+
|
|
20
|
+
(a) Personal Use. Use by an individual for their own personal purposes,
|
|
21
|
+
and not on behalf of, or for the benefit of, an employer, client, or
|
|
22
|
+
other Organization. Use by an individual in the course of employment
|
|
23
|
+
or engagement by an Organization is use by that Organization.
|
|
24
|
+
|
|
25
|
+
(b) Small Organization Use. Use by or on behalf of an Organization whose
|
|
26
|
+
Annual Revenue is less than USD 1,000,000.
|
|
27
|
+
|
|
28
|
+
(c) Non-profit, Education and Research Use. Use, regardless of Annual
|
|
29
|
+
Revenue, by (i) an Organization registered or recognized as a
|
|
30
|
+
non-profit or charitable organization under the laws of its
|
|
31
|
+
jurisdiction, for its non-profit purposes; (ii) an accredited school,
|
|
32
|
+
college, or university, for teaching, learning, or academic research;
|
|
33
|
+
or (iii) a publicly funded research institution, for its research.
|
|
34
|
+
|
|
35
|
+
(d) Service Provider Use. Use by a consultant, contractor, agency, or other
|
|
36
|
+
service provider, regardless of its own Annual Revenue, solely to
|
|
37
|
+
build, deploy, host, operate, or support the Licensed Work for a client
|
|
38
|
+
whose own use would be Eligible Use under (a), (b), or (c). A service
|
|
39
|
+
provider's use for its own purposes is Eligible Use only if the service
|
|
40
|
+
provider itself qualifies under (b) or (c).
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
Hosted services. Offering the Licensed Work to third parties as a hosted
|
|
44
|
+
or managed service whose primary value is the Licensed Work is Eligible
|
|
45
|
+
Use only if each such third party's own use would be Eligible Use.
|
|
46
|
+
|
|
47
|
+
Definitions. "Organization" means any company, partnership, sole
|
|
48
|
+
proprietorship, trust, association, government body, or other entity, and
|
|
49
|
+
includes an individual acting in a business or professional capacity.
|
|
50
|
+
"Affiliate" means any entity that directly or indirectly controls, is
|
|
51
|
+
controlled by, or is under common control with an Organization, where
|
|
52
|
+
"control" means ownership of more than 50% of the voting interests of an
|
|
53
|
+
entity or the power to direct its management and policies by contract or
|
|
54
|
+
otherwise. "Annual Revenue" means the total gross revenue of an
|
|
55
|
+
Organization and all of its Affiliates combined, from all sources and
|
|
56
|
+
whether or not related to the Licensed Work, for its most recently
|
|
57
|
+
completed fiscal year, or, if it has not completed a fiscal year, for the
|
|
58
|
+
twelve months before the use (or since its formation, if shorter),
|
|
59
|
+
converted into US dollars at the average exchange rate for that period.
|
|
60
|
+
Proceeds of equity or debt financing are not revenue.
|
|
61
|
+
|
|
62
|
+
Threshold. If an Organization stops qualifying under (b), its existing
|
|
63
|
+
production use remains Eligible Use for 90 days after it stops
|
|
64
|
+
qualifying, after which it must obtain a commercial license or stop
|
|
65
|
+
production use. Use that was Eligible Use when it occurred never requires
|
|
66
|
+
a commercial license after the fact.
|
|
67
|
+
Change Date: Four years from the date a version of the Licensed Work
|
|
68
|
+
is first publicly released by the Licensor.
|
|
69
|
+
Change License: Apache License, Version 2.0
|
|
70
|
+
|
|
71
|
+
For information about alternative licensing arrangements for the Licensed
|
|
72
|
+
Work, please visit: https://agimon.ai/licensing
|
|
73
|
+
|
|
74
|
+
Notice
|
|
75
|
+
|
|
76
|
+
The Business Source License (this document, or the "License") is not an Open
|
|
77
|
+
Source license. However, the Licensed Work will eventually be made available
|
|
78
|
+
under an Open Source License, as stated in this License.
|
|
79
|
+
|
|
80
|
+
-----------------------------------------------------------------------------
|
|
81
|
+
|
|
82
|
+
Business Source License 1.1
|
|
83
|
+
|
|
84
|
+
Terms
|
|
85
|
+
|
|
86
|
+
The Licensor hereby grants you the right to copy, modify, create derivative
|
|
87
|
+
works, redistribute, and make non-production use of the Licensed Work. The
|
|
88
|
+
Licensor may make an Additional Use Grant, above, permitting limited
|
|
89
|
+
production use.
|
|
90
|
+
|
|
91
|
+
Effective on the Change Date, or the fourth anniversary of the first publicly
|
|
92
|
+
available distribution of a specific version of the Licensed Work under this
|
|
93
|
+
License, whichever comes first, the Licensor hereby grants you rights under
|
|
94
|
+
the terms of the Change License, and the rights granted in the paragraph
|
|
95
|
+
above terminate.
|
|
96
|
+
|
|
97
|
+
If your use of the Licensed Work does not comply with the requirements
|
|
98
|
+
currently in effect as described in this License, you must purchase a
|
|
99
|
+
commercial license from the Licensor, its affiliated entities, or authorized
|
|
100
|
+
resellers, or you must refrain from using the Licensed Work.
|
|
101
|
+
|
|
102
|
+
All copies of the original and modified Licensed Work, and derivative works
|
|
103
|
+
of the Licensed Work, are subject to this License. This License applies
|
|
104
|
+
separately for each version of the Licensed Work and the Change Date may vary
|
|
105
|
+
for each version of the Licensed Work released by Licensor.
|
|
106
|
+
|
|
107
|
+
You must conspicuously display this License on each original or modified copy
|
|
108
|
+
of the Licensed Work. If you receive the Licensed Work in original or
|
|
109
|
+
modified form from a third party, the terms and conditions set forth in this
|
|
110
|
+
License apply to your use of that work.
|
|
111
|
+
|
|
112
|
+
Any use of the Licensed Work in violation of this License will automatically
|
|
113
|
+
terminate your rights under this License for the current and all other
|
|
114
|
+
versions of the Licensed Work.
|
|
115
|
+
|
|
116
|
+
This License does not grant you any right in any trademark or logo of
|
|
117
|
+
Licensor or its affiliates (provided that you may use a trademark or logo of
|
|
118
|
+
Licensor as expressly required by this License).
|
|
119
|
+
|
|
120
|
+
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
|
|
121
|
+
AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
|
|
122
|
+
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
|
|
123
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
|
|
124
|
+
TITLE.
|
|
125
|
+
|
|
126
|
+
MariaDB hereby grants you permission to use this License’s text to license
|
|
127
|
+
your works, and to refer to it using the trademark “Business Source License”,
|
|
128
|
+
as long as you comply with the Covenants of Licensor below.
|
|
129
|
+
|
|
130
|
+
Covenants of Licensor
|
|
131
|
+
|
|
132
|
+
In consideration of the right to use this License’s text and the “Business
|
|
133
|
+
Source License” name and trademark, Licensor covenants to MariaDB, and to all
|
|
134
|
+
other recipients of the licensed work to be provided by Licensor:
|
|
135
|
+
|
|
136
|
+
1. To specify as the Change License the GPL Version 2.0 or any later version,
|
|
137
|
+
or a license that is compatible with GPL Version 2.0 or a later version,
|
|
138
|
+
where “compatible” means that software provided under the Change License can
|
|
139
|
+
be included in a program with software provided under GPL Version 2.0 or a
|
|
140
|
+
later version. Licensor may specify additional Change Licenses without
|
|
141
|
+
limitation.
|
|
142
|
+
|
|
143
|
+
2. To either: (a) specify an additional grant of rights to use that does not
|
|
144
|
+
impose any additional restriction on the right granted in this License, as
|
|
145
|
+
the Additional Use Grant; or (b) insert the text “None”.
|
|
146
|
+
|
|
147
|
+
3. To specify a Change Date.
|
|
148
|
+
|
|
149
|
+
4. Not to modify this License in any other way.
|
|
@@ -7,7 +7,7 @@ import { StyleSheet, useUnistyles } from "react-native-unistyles";
|
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
8
|
|
|
9
9
|
//#region src/components/Badge.tsx
|
|
10
|
-
/** `border-
|
|
10
|
+
/** `border-po-<accent>/40`. */
|
|
11
11
|
const EDGE_ALPHA_PERCENT = 40;
|
|
12
12
|
/** An outlined chip in one of the accent tones. */
|
|
13
13
|
function Badge({ tone = "neutral", size = "sm", children, style, ...props }) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.mjs","names":["ChipTone","withAlpha","ReactNode","StyleProp","ViewProps","ViewStyle","StyleSheet","useUnistyles","fontOf","CHIP_INK","wrapText","BadgeTone","BadgeSize","EDGE_ALPHA_PERCENT","BadgeProps","Omit","tone","size","children","style","Badge","props","theme","_styles","styles","useVariants","edge","undefined","borderColor","colors","badge","label","create","ink","color","flexDirection","alignItems","alignSelf","gap","spacing","borderRadius","DEFAULT","borderWidth","border","variants","xs","paddingHorizontal","paddingVertical","sm","md","lg","uni__dependencies","fontFamily","sans","neutral","blue","green","yellow","red","magenta","violet","cyan","orange","teal","fontSize","lineHeight","fontWeight","semibold","base"],"sources":["../../src/components/Badge.tsx"],"sourcesContent":["import { type ChipTone, withAlpha } from '@agimon-ai/po-web-components/nativeTheme';\nimport type { ReactNode } from 'react';\nimport { type StyleProp, View, type ViewProps, type ViewStyle } from 'react-native';\nimport { StyleSheet, useUnistyles } from 'react-native-unistyles';\n\nimport { fontOf } from '../lib/fonts';\nimport { CHIP_INK } from '../lib/tone';\nimport { wrapText } from '../lib/wrapText';\n\nexport type BadgeTone = ChipTone;\nexport type BadgeSize = 'xs' | 'sm' | 'md' | 'lg';\n\n/** `border-
|
|
1
|
+
{"version":3,"file":"Badge.mjs","names":["ChipTone","withAlpha","ReactNode","StyleProp","ViewProps","ViewStyle","StyleSheet","useUnistyles","fontOf","CHIP_INK","wrapText","BadgeTone","BadgeSize","EDGE_ALPHA_PERCENT","BadgeProps","Omit","tone","size","children","style","Badge","props","theme","_styles","styles","useVariants","edge","undefined","borderColor","colors","badge","label","create","ink","color","flexDirection","alignItems","alignSelf","gap","spacing","borderRadius","DEFAULT","borderWidth","border","variants","xs","paddingHorizontal","paddingVertical","sm","md","lg","uni__dependencies","fontFamily","sans","neutral","blue","green","yellow","red","magenta","violet","cyan","orange","teal","fontSize","lineHeight","fontWeight","semibold","base"],"sources":["../../src/components/Badge.tsx"],"sourcesContent":["import { type ChipTone, withAlpha } from '@agimon-ai/po-web-components/nativeTheme';\nimport type { ReactNode } from 'react';\nimport { type StyleProp, View, type ViewProps, type ViewStyle } from 'react-native';\nimport { StyleSheet, useUnistyles } from 'react-native-unistyles';\n\nimport { fontOf } from '../lib/fonts';\nimport { CHIP_INK } from '../lib/tone';\nimport { wrapText } from '../lib/wrapText';\n\nexport type BadgeTone = ChipTone;\nexport type BadgeSize = 'xs' | 'sm' | 'md' | 'lg';\n\n/** `border-po-<accent>/40`. */\nconst EDGE_ALPHA_PERCENT = 40;\n\nexport interface BadgeProps extends Omit<ViewProps, 'children' | 'style'> {\n tone?: BadgeTone;\n /** The same rungs Button names, so a chip can sit beside a button of any size. */\n size?: BadgeSize;\n children?: ReactNode;\n style?: StyleProp<ViewStyle>;\n}\n\n/** An outlined chip in one of the accent tones. */\nexport function Badge({ tone = 'neutral', size = 'sm', children, style, ...props }: BadgeProps) {\n const { theme } = useUnistyles();\n styles.useVariants({ tone, size });\n // Alpha mixes are computed in render from useUnistyles(), not in StyleSheet.create: on web Unistyles hands\n // the stylesheet CSS variables, which withAlpha cannot read.\n const edge =\n tone === 'neutral' ? undefined : { borderColor: withAlpha(theme.colors[CHIP_INK[tone]], EDGE_ALPHA_PERCENT) };\n return (\n <View style={[styles.badge, edge, style]} {...props}>\n {wrapText(children, styles.label)}\n </View>\n );\n}\n\nconst styles = StyleSheet.create((theme) => {\n const ink = (tone: ChipTone) => ({ color: theme.colors[CHIP_INK[tone]] });\n return {\n badge: {\n flexDirection: 'row',\n alignItems: 'center',\n alignSelf: 'flex-start',\n gap: theme.spacing(1.5),\n borderRadius: theme.borderRadius.DEFAULT,\n borderWidth: 1,\n borderColor: theme.colors.border,\n variants: {\n size: {\n xs: { paddingHorizontal: theme.spacing(1.5), paddingVertical: 1 },\n sm: { paddingHorizontal: theme.spacing(2), paddingVertical: theme.spacing(0.5) },\n md: { paddingHorizontal: theme.spacing(2.5), paddingVertical: theme.spacing(1) },\n lg: { paddingHorizontal: theme.spacing(3), paddingVertical: theme.spacing(1.5) },\n },\n },\n },\n label: {\n fontFamily: fontOf(theme.fontFamily.sans),\n variants: {\n tone: {\n neutral: ink('neutral'),\n blue: ink('blue'),\n green: ink('green'),\n yellow: ink('yellow'),\n red: ink('red'),\n magenta: ink('magenta'),\n violet: ink('violet'),\n cyan: ink('cyan'),\n orange: ink('orange'),\n teal: ink('teal'),\n },\n size: {\n xs: { fontSize: theme.fontSize.sm, lineHeight: theme.lineHeight.sm, fontWeight: theme.fontWeight.semibold },\n sm: { fontSize: theme.fontSize.sm, lineHeight: theme.lineHeight.sm },\n md: { fontSize: theme.fontSize.sm, lineHeight: theme.lineHeight.sm },\n lg: { fontSize: theme.fontSize.base, lineHeight: theme.lineHeight.base },\n },\n },\n },\n };\n});\n"],"mappings":";;;;;;;;;;AAaA,MAAMa,qBAAqB;;AAW3B,SAAgBO,MAAM,EAAEJ,OAAO,WAAWC,OAAO,MAAMC,UAAUC,OAAO,GAAGE,SAAqB;CAC9F,MAAM,EAAEC,UAAUf,aAAa;CAAE,MAAAgB,UAAAC;CAAA;EAAA,MAAAA,SAAAD,QAAAE,YACd;GAAET;GAAMC;EAAK,CAAC;EAGjC,MAAMS,OACJV,SAAS,YAAYW,SAAY,EAAEC,aAAa3B,UAAUqB,MAAMO,OAAOpB,SAASO,QAAQH,kBAAkB,EAAE;EAC9G,OACE,oBAAC,MAAD;GAAM,OAAO;IAACW,OAAOM;IAAOJ;IAAMP;GAAK;GAAG,GAAIE;aAC3CX,SAASQ,UAAUM,OAAOO,KAAK;EAC5B;CACN;AACJ;AAEA,MAAMP,SAASlB,WAAW0B,QAAQV,UAAU;CAC1C,MAAMW,OAAOjB,UAAoB,EAAEkB,OAAOZ,MAAMO,OAAOpB,SAASO,OAAO;CACvE,OAAO;EACLc,OAAO;GACLK,eAAe;GACfC,YAAY;GACZC,WAAW;GACXC,KAAKhB,MAAMiB,QAAQ,GAAG;GACtBC,cAAclB,MAAMkB,aAAaC;GACjCC,aAAa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C,WAAWG;KAAK;IACzE;GACF;GAACjB,mBAAA,CAAA,GAAA,CAAA;EACH;CACF;AACF,CAAC"}
|
|
@@ -14,7 +14,7 @@ const MIN_TAP_TARGET = 44;
|
|
|
14
14
|
const DISABLED_OPACITY = .4;
|
|
15
15
|
const PRESSED_FILL_OPACITY = .85;
|
|
16
16
|
const RIPPLE_ALPHA_PERCENT = 20;
|
|
17
|
-
/** `hover:border-
|
|
17
|
+
/** `hover:border-po-green/50`. */
|
|
18
18
|
const PRESSED_EDGE_ALPHA_PERCENT = 50;
|
|
19
19
|
/** The visual height of each size, from which hitSlop pads the tap target to 44pt. */
|
|
20
20
|
const SIZE_HEIGHT = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.mjs","names":["NativeColorToken","withAlpha","ReactNode","PressableProps","StyleProp","ViewStyle","StyleSheet","useUnistyles","IconColorContext","fontOf","impactLight","wrapText","Spinner","ButtonVariant","ButtonSize","MIN_TAP_TARGET","DISABLED_OPACITY","PRESSED_FILL_OPACITY","RIPPLE_ALPHA_PERCENT","PRESSED_EDGE_ALPHA_PERCENT","SIZE_HEIGHT","Readonly","Record","xs","sm","md","lg","icon","card","INK","rest","pressed","primary","secondary","outline","ghost","subtle","danger","success","link","HAPTIC_VARIANTS","ReadonlySet","Set","ButtonProps","Omit","variant","size","loading","loadingLabel","children","style","Button","disabled","onPress","hitSlop","accessibilityState","props","theme","_styles","styles","useVariants","inactive","slop","Math","max","ink","busy","undefined","text","color","colors","borderless","event","has","button","borderColor","green","token","label","labelPressed","create","flexDirection","alignItems","justifyContent","gap","spacing","borderRadius","borderWidth","overflow","variants","backgroundColor","selected","border","panel","red","height","paddingHorizontal","DEFAULT","width","padding","alignSelf","minHeight","paddingVertical","uni__dependencies","opacity","deep","fontFamily","sans","fontWeight","medium","semibold","fontSize","lineHeight","base","textDecorationLine"],"sources":["../../src/components/Button.tsx"],"sourcesContent":["import { type NativeColorToken, withAlpha } from '@agimon-ai/po-web-components/nativeTheme';\nimport type { ReactNode } from 'react';\nimport { Pressable, type PressableProps, type StyleProp, type ViewStyle } from 'react-native';\nimport { StyleSheet, useUnistyles } from 'react-native-unistyles';\n\nimport { IconColorContext } from '../icons/IconColorContext';\nimport { fontOf } from '../lib/fonts';\nimport { impactLight } from '../lib/haptics';\nimport { wrapText } from '../lib/wrapText';\nimport { Spinner } from './Spinner';\n\nexport type ButtonVariant =\n | 'primary'\n | 'secondary'\n | 'outline'\n | 'ghost'\n | 'subtle'\n | 'danger'\n | 'danger-outline'\n | 'success'\n | 'link';\nexport type ButtonSize = 'xs' | 'sm' | 'md' | 'lg' | 'icon' | 'icon-md' | 'card';\n\n/** Apple's and Google's minimum tap target; a smaller visual box makes up the rest with hitSlop. */\nconst MIN_TAP_TARGET = 44;\nconst DISABLED_OPACITY = 0.4;\nconst PRESSED_FILL_OPACITY = 0.85;\nconst RIPPLE_ALPHA_PERCENT = 20;\n/** `hover:border-doom-green/50`. */\nconst PRESSED_EDGE_ALPHA_PERCENT = 50;\n\n/** The visual height of each size, from which hitSlop pads the tap target to 44pt. */\nconst SIZE_HEIGHT: Readonly<Record<ButtonSize, number>> = {\n xs: 24,\n sm: 28,\n md: 32,\n lg: 36,\n icon: 24,\n 'icon-md': 32,\n card: MIN_TAP_TARGET,\n};\n\n/** The label ink of each variant, and the ink it lifts to while pressed (the web hover). */\nconst INK: Readonly<Record<ButtonVariant, { rest: NativeColorToken; pressed: NativeColorToken }>> = {\n primary: { rest: 'on-selected', pressed: 'on-selected' },\n secondary: { rest: 'magenta', pressed: 'magenta' },\n outline: { rest: 'dim', pressed: 'hi' },\n ghost: { rest: 'dim', pressed: 'hi' },\n subtle: { rest: 'dim', pressed: 'hi' },\n danger: { rest: 'rail', pressed: 'rail' },\n 'danger-outline': { rest: 'red', pressed: 'red' },\n success: { rest: 'rail', pressed: 'rail' },\n link: { rest: 'blue', pressed: 'blue' },\n};\n\n/** Presses that commit something get a light impact; the rest stay quiet. */\nconst HAPTIC_VARIANTS: ReadonlySet<ButtonVariant> = new Set(['primary', 'danger', 'success']);\n\nexport interface ButtonProps extends Omit<PressableProps, 'children' | 'style'> {\n variant?: ButtonVariant;\n size?: ButtonSize;\n /** Work is in flight: the button shows a spinner and stops accepting presses. */\n loading?: boolean;\n /** What the spinner announces while loading; omit it and the wait is silent. */\n loadingLabel?: string;\n /** A bare string is drawn as the label; elements (an icon, a card's lines) render as given. */\n children?: ReactNode;\n style?: StyleProp<ViewStyle>;\n}\n\n/** The one button: every variant is a theme token, a press dims or lifts it, and committing presses buzz once. */\nexport function Button({\n variant = 'outline',\n size = 'md',\n loading = false,\n loadingLabel,\n disabled,\n onPress,\n children,\n style,\n hitSlop,\n accessibilityState,\n ...props\n}: ButtonProps) {\n const { theme } = useUnistyles();\n styles.useVariants({ variant, size });\n const inactive = (disabled ?? false) || loading;\n const slop = Math.max(0, (MIN_TAP_TARGET - SIZE_HEIGHT[size]) / 2);\n const ink = INK[variant];\n return (\n <Pressable\n accessibilityRole={variant === 'link' ? 'link' : 'button'}\n accessibilityState={{ ...accessibilityState, disabled: inactive, busy: loading }}\n accessibilityValue={loading && loadingLabel !== undefined ? { text: loadingLabel } : undefined}\n disabled={inactive}\n hitSlop={hitSlop ?? slop}\n android_ripple={{ color: withAlpha(theme.colors[ink.pressed], RIPPLE_ALPHA_PERCENT), borderless: false }}\n onPress={(event) => {\n if (HAPTIC_VARIANTS.has(variant)) impactLight();\n onPress?.(event);\n }}\n style={({ pressed }) => [\n styles.button,\n pressed && styles.pressed,\n // Alpha mixes are computed in render from useUnistyles(), not in StyleSheet.create: on web Unistyles hands\n // the stylesheet CSS variables, which withAlpha cannot read.\n pressed && variant === 'outline' && { borderColor: withAlpha(theme.colors.green, PRESSED_EDGE_ALPHA_PERCENT) },\n inactive && styles.disabled,\n style,\n ]}\n {...props}\n >\n {({ pressed }) => {\n const token = pressed ? ink.pressed : ink.rest;\n return (\n <IconColorContext.Provider value={token}>\n {loading ? <Spinner color={token} /> : null}\n {wrapText(children, [styles.label, pressed && styles.labelPressed, { color: theme.colors[token] }])}\n </IconColorContext.Provider>\n );\n }}\n </Pressable>\n );\n}\n\nconst styles = StyleSheet.create((theme) => ({\n button: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n gap: theme.spacing(1.5),\n borderRadius: theme.borderRadius.md,\n borderWidth: 1,\n borderColor: 'transparent',\n overflow: 'hidden',\n variants: {\n variant: {\n primary: { backgroundColor: theme.colors.selected },\n secondary: { borderColor: theme.colors['edge-magenta'], backgroundColor: theme.colors['tint-magenta'] },\n outline: { borderColor: theme.colors.border },\n ghost: {},\n subtle: { backgroundColor: theme.colors.panel },\n danger: { backgroundColor: theme.colors.red },\n 'danger-outline': { borderColor: theme.colors['edge-red'], backgroundColor: theme.colors['tint-red'] },\n success: { backgroundColor: theme.colors.green },\n link: {},\n },\n size: {\n xs: { height: SIZE_HEIGHT.xs, paddingHorizontal: theme.spacing(1.5), borderRadius: theme.borderRadius.DEFAULT },\n sm: { height: SIZE_HEIGHT.sm, paddingHorizontal: theme.spacing(2.5) },\n md: { height: SIZE_HEIGHT.md, paddingHorizontal: theme.spacing(3) },\n lg: { height: SIZE_HEIGHT.lg, paddingHorizontal: theme.spacing(3.5) },\n icon: {\n width: SIZE_HEIGHT.icon,\n height: SIZE_HEIGHT.icon,\n padding: 0,\n borderRadius: theme.borderRadius.DEFAULT,\n },\n 'icon-md': { width: SIZE_HEIGHT['icon-md'], height: SIZE_HEIGHT['icon-md'], padding: 0 },\n card: {\n alignSelf: 'stretch',\n flexDirection: 'column',\n alignItems: 'stretch',\n justifyContent: 'flex-start',\n gap: theme.spacing(1),\n minHeight: SIZE_HEIGHT.card,\n paddingHorizontal: 11,\n paddingVertical: theme.spacing(2.5),\n },\n },\n },\n },\n pressed: {\n variants: {\n variant: {\n primary: { opacity: PRESSED_FILL_OPACITY },\n secondary: { opacity: PRESSED_FILL_OPACITY },\n outline: {},\n ghost: { backgroundColor: theme.colors.panel },\n subtle: { backgroundColor: theme.colors.deep },\n danger: { opacity: PRESSED_FILL_OPACITY },\n 'danger-outline': { opacity: PRESSED_FILL_OPACITY },\n success: { opacity: PRESSED_FILL_OPACITY },\n link: {},\n },\n },\n },\n disabled: { opacity: DISABLED_OPACITY },\n label: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontWeight: theme.fontWeight.medium,\n variants: {\n variant: {\n primary: { fontWeight: theme.fontWeight.semibold },\n secondary: { fontWeight: theme.fontWeight.semibold },\n outline: {},\n ghost: {},\n subtle: {},\n danger: { fontWeight: theme.fontWeight.semibold },\n 'danger-outline': { fontWeight: theme.fontWeight.semibold },\n success: { fontWeight: theme.fontWeight.semibold },\n link: {},\n },\n size: {\n xs: { fontSize: theme.fontSize.sm, lineHeight: theme.lineHeight.sm },\n sm: { fontSize: theme.fontSize.sm, lineHeight: theme.lineHeight.sm },\n md: { fontSize: theme.fontSize.base, lineHeight: theme.lineHeight.base },\n lg: { fontSize: theme.fontSize.base, lineHeight: theme.lineHeight.base },\n icon: { fontSize: theme.fontSize.base, lineHeight: theme.lineHeight.base },\n 'icon-md': { fontSize: theme.fontSize.base, lineHeight: theme.lineHeight.base },\n card: { fontSize: theme.fontSize.base, lineHeight: theme.lineHeight.base },\n },\n },\n },\n labelPressed: {\n variants: {\n variant: {\n primary: {},\n secondary: {},\n outline: {},\n ghost: {},\n subtle: {},\n danger: {},\n 'danger-outline': {},\n success: {},\n link: { textDecorationLine: 'underline' },\n },\n },\n },\n}));\n"],"mappings":";;;;;;;;;;;;AAwBA,MAAMe,iBAAiB;AACvB,MAAMC,mBAAmB;AACzB,MAAMC,uBAAuB;AAC7B,MAAMC,uBAAuB;;AAE7B,MAAMC,6BAA6B;;AAGnC,MAAMC,cAAoD;CACxDG,IAAI;CACJC,IAAI;CACJC,IAAI;CACJC,IAAI;CACJC,MAAM;CACN,WAAW;CACXC,MAAMb;AACR;;AAGA,MAAMc,MAA8F;CAClGG,SAAS;EAAEF,MAAM;EAAeC,SAAS;CAAc;C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,SAAS;GACPb,SAAS,CAAC;GACVC,WAAW,CAAC;GACZC,SAAS,CAAC;GACVC,OAAO,CAAC;GACRC,QAAQ,CAAC;GACTC,QAAQ,CAAC;GACT,kBAAkB,CAAC;GACnBC,SAAS,CAAC;GACVC,MAAM,EAAE2E,oBAAoB,YAAY;EAC1C,EACF;EAACX,mBAAA,CAAA,CAAA;CACH;AACF,EAAE"}
|
|
1
|
+
{"version":3,"file":"Button.mjs","names":["NativeColorToken","withAlpha","ReactNode","PressableProps","StyleProp","ViewStyle","StyleSheet","useUnistyles","IconColorContext","fontOf","impactLight","wrapText","Spinner","ButtonVariant","ButtonSize","MIN_TAP_TARGET","DISABLED_OPACITY","PRESSED_FILL_OPACITY","RIPPLE_ALPHA_PERCENT","PRESSED_EDGE_ALPHA_PERCENT","SIZE_HEIGHT","Readonly","Record","xs","sm","md","lg","icon","card","INK","rest","pressed","primary","secondary","outline","ghost","subtle","danger","success","link","HAPTIC_VARIANTS","ReadonlySet","Set","ButtonProps","Omit","variant","size","loading","loadingLabel","children","style","Button","disabled","onPress","hitSlop","accessibilityState","props","theme","_styles","styles","useVariants","inactive","slop","Math","max","ink","busy","undefined","text","color","colors","borderless","event","has","button","borderColor","green","token","label","labelPressed","create","flexDirection","alignItems","justifyContent","gap","spacing","borderRadius","borderWidth","overflow","variants","backgroundColor","selected","border","panel","red","height","paddingHorizontal","DEFAULT","width","padding","alignSelf","minHeight","paddingVertical","uni__dependencies","opacity","deep","fontFamily","sans","fontWeight","medium","semibold","fontSize","lineHeight","base","textDecorationLine"],"sources":["../../src/components/Button.tsx"],"sourcesContent":["import { type NativeColorToken, withAlpha } from '@agimon-ai/po-web-components/nativeTheme';\nimport type { ReactNode } from 'react';\nimport { Pressable, type PressableProps, type StyleProp, type ViewStyle } from 'react-native';\nimport { StyleSheet, useUnistyles } from 'react-native-unistyles';\n\nimport { IconColorContext } from '../icons/IconColorContext';\nimport { fontOf } from '../lib/fonts';\nimport { impactLight } from '../lib/haptics';\nimport { wrapText } from '../lib/wrapText';\nimport { Spinner } from './Spinner';\n\nexport type ButtonVariant =\n | 'primary'\n | 'secondary'\n | 'outline'\n | 'ghost'\n | 'subtle'\n | 'danger'\n | 'danger-outline'\n | 'success'\n | 'link';\nexport type ButtonSize = 'xs' | 'sm' | 'md' | 'lg' | 'icon' | 'icon-md' | 'card';\n\n/** Apple's and Google's minimum tap target; a smaller visual box makes up the rest with hitSlop. */\nconst MIN_TAP_TARGET = 44;\nconst DISABLED_OPACITY = 0.4;\nconst PRESSED_FILL_OPACITY = 0.85;\nconst RIPPLE_ALPHA_PERCENT = 20;\n/** `hover:border-po-green/50`. */\nconst PRESSED_EDGE_ALPHA_PERCENT = 50;\n\n/** The visual height of each size, from which hitSlop pads the tap target to 44pt. */\nconst SIZE_HEIGHT: Readonly<Record<ButtonSize, number>> = {\n xs: 24,\n sm: 28,\n md: 32,\n lg: 36,\n icon: 24,\n 'icon-md': 32,\n card: MIN_TAP_TARGET,\n};\n\n/** The label ink of each variant, and the ink it lifts to while pressed (the web hover). */\nconst INK: Readonly<Record<ButtonVariant, { rest: NativeColorToken; pressed: NativeColorToken }>> = {\n primary: { rest: 'on-selected', pressed: 'on-selected' },\n secondary: { rest: 'magenta', pressed: 'magenta' },\n outline: { rest: 'dim', pressed: 'hi' },\n ghost: { rest: 'dim', pressed: 'hi' },\n subtle: { rest: 'dim', pressed: 'hi' },\n danger: { rest: 'rail', pressed: 'rail' },\n 'danger-outline': { rest: 'red', pressed: 'red' },\n success: { rest: 'rail', pressed: 'rail' },\n link: { rest: 'blue', pressed: 'blue' },\n};\n\n/** Presses that commit something get a light impact; the rest stay quiet. */\nconst HAPTIC_VARIANTS: ReadonlySet<ButtonVariant> = new Set(['primary', 'danger', 'success']);\n\nexport interface ButtonProps extends Omit<PressableProps, 'children' | 'style'> {\n variant?: ButtonVariant;\n size?: ButtonSize;\n /** Work is in flight: the button shows a spinner and stops accepting presses. */\n loading?: boolean;\n /** What the spinner announces while loading; omit it and the wait is silent. */\n loadingLabel?: string;\n /** A bare string is drawn as the label; elements (an icon, a card's lines) render as given. */\n children?: ReactNode;\n style?: StyleProp<ViewStyle>;\n}\n\n/** The one button: every variant is a theme token, a press dims or lifts it, and committing presses buzz once. */\nexport function Button({\n variant = 'outline',\n size = 'md',\n loading = false,\n loadingLabel,\n disabled,\n onPress,\n children,\n style,\n hitSlop,\n accessibilityState,\n ...props\n}: ButtonProps) {\n const { theme } = useUnistyles();\n styles.useVariants({ variant, size });\n const inactive = (disabled ?? false) || loading;\n const slop = Math.max(0, (MIN_TAP_TARGET - SIZE_HEIGHT[size]) / 2);\n const ink = INK[variant];\n return (\n <Pressable\n accessibilityRole={variant === 'link' ? 'link' : 'button'}\n accessibilityState={{ ...accessibilityState, disabled: inactive, busy: loading }}\n accessibilityValue={loading && loadingLabel !== undefined ? { text: loadingLabel } : undefined}\n disabled={inactive}\n hitSlop={hitSlop ?? slop}\n android_ripple={{ color: withAlpha(theme.colors[ink.pressed], RIPPLE_ALPHA_PERCENT), borderless: false }}\n onPress={(event) => {\n if (HAPTIC_VARIANTS.has(variant)) impactLight();\n onPress?.(event);\n }}\n style={({ pressed }) => [\n styles.button,\n pressed && styles.pressed,\n // Alpha mixes are computed in render from useUnistyles(), not in StyleSheet.create: on web Unistyles hands\n // the stylesheet CSS variables, which withAlpha cannot read.\n pressed && variant === 'outline' && { borderColor: withAlpha(theme.colors.green, PRESSED_EDGE_ALPHA_PERCENT) },\n inactive && styles.disabled,\n style,\n ]}\n {...props}\n >\n {({ pressed }) => {\n const token = pressed ? ink.pressed : ink.rest;\n return (\n <IconColorContext.Provider value={token}>\n {loading ? <Spinner color={token} /> : null}\n {wrapText(children, [styles.label, pressed && styles.labelPressed, { color: theme.colors[token] }])}\n </IconColorContext.Provider>\n );\n }}\n </Pressable>\n );\n}\n\nconst styles = StyleSheet.create((theme) => ({\n button: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n gap: theme.spacing(1.5),\n borderRadius: theme.borderRadius.md,\n borderWidth: 1,\n borderColor: 'transparent',\n overflow: 'hidden',\n variants: {\n variant: {\n primary: { backgroundColor: theme.colors.selected },\n secondary: { borderColor: theme.colors['edge-magenta'], backgroundColor: theme.colors['tint-magenta'] },\n outline: { borderColor: theme.colors.border },\n ghost: {},\n subtle: { backgroundColor: theme.colors.panel },\n danger: { backgroundColor: theme.colors.red },\n 'danger-outline': { borderColor: theme.colors['edge-red'], backgroundColor: theme.colors['tint-red'] },\n success: { backgroundColor: theme.colors.green },\n link: {},\n },\n size: {\n xs: { height: SIZE_HEIGHT.xs, paddingHorizontal: theme.spacing(1.5), borderRadius: theme.borderRadius.DEFAULT },\n sm: { height: SIZE_HEIGHT.sm, paddingHorizontal: theme.spacing(2.5) },\n md: { height: SIZE_HEIGHT.md, paddingHorizontal: theme.spacing(3) },\n lg: { height: SIZE_HEIGHT.lg, paddingHorizontal: theme.spacing(3.5) },\n icon: {\n width: SIZE_HEIGHT.icon,\n height: SIZE_HEIGHT.icon,\n padding: 0,\n borderRadius: theme.borderRadius.DEFAULT,\n },\n 'icon-md': { width: SIZE_HEIGHT['icon-md'], height: SIZE_HEIGHT['icon-md'], padding: 0 },\n card: {\n alignSelf: 'stretch',\n flexDirection: 'column',\n alignItems: 'stretch',\n justifyContent: 'flex-start',\n gap: theme.spacing(1),\n minHeight: SIZE_HEIGHT.card,\n paddingHorizontal: 11,\n paddingVertical: theme.spacing(2.5),\n },\n },\n },\n },\n pressed: {\n variants: {\n variant: {\n primary: { opacity: PRESSED_FILL_OPACITY },\n secondary: { opacity: PRESSED_FILL_OPACITY },\n outline: {},\n ghost: { backgroundColor: theme.colors.panel },\n subtle: { backgroundColor: theme.colors.deep },\n danger: { opacity: PRESSED_FILL_OPACITY },\n 'danger-outline': { opacity: PRESSED_FILL_OPACITY },\n success: { opacity: PRESSED_FILL_OPACITY },\n link: {},\n },\n },\n },\n disabled: { opacity: DISABLED_OPACITY },\n label: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontWeight: theme.fontWeight.medium,\n variants: {\n variant: {\n primary: { fontWeight: theme.fontWeight.semibold },\n secondary: { fontWeight: theme.fontWeight.semibold },\n outline: {},\n ghost: {},\n subtle: {},\n danger: { fontWeight: theme.fontWeight.semibold },\n 'danger-outline': { fontWeight: theme.fontWeight.semibold },\n success: { fontWeight: theme.fontWeight.semibold },\n link: {},\n },\n size: {\n xs: { fontSize: theme.fontSize.sm, lineHeight: theme.lineHeight.sm },\n sm: { fontSize: theme.fontSize.sm, lineHeight: theme.lineHeight.sm },\n md: { fontSize: theme.fontSize.base, lineHeight: theme.lineHeight.base },\n lg: { fontSize: theme.fontSize.base, lineHeight: theme.lineHeight.base },\n icon: { fontSize: theme.fontSize.base, lineHeight: theme.lineHeight.base },\n 'icon-md': { fontSize: theme.fontSize.base, lineHeight: theme.lineHeight.base },\n card: { fontSize: theme.fontSize.base, lineHeight: theme.lineHeight.base },\n },\n },\n },\n labelPressed: {\n variants: {\n variant: {\n primary: {},\n secondary: {},\n outline: {},\n ghost: {},\n subtle: {},\n danger: {},\n 'danger-outline': {},\n success: {},\n link: { textDecorationLine: 'underline' },\n },\n },\n },\n}));\n"],"mappings":";;;;;;;;;;;;AAwBA,MAAMe,iBAAiB;AACvB,MAAMC,mBAAmB;AACzB,MAAMC,uBAAuB;AAC7B,MAAMC,uBAAuB;;AAE7B,MAAMC,6BAA6B;;AAGnC,MAAMC,cAAoD;CACxDG,IAAI;CACJC,IAAI;CACJC,IAAI;CACJC,IAAI;CACJC,MAAM;CACN,WAAW;CACXC,MAAMb;AACR;;AAGA,MAAMc,MAA8F;CAClGG,SAAS;EAAEF,MAAM;EAAeC,SAAS;CAAc;CACvDE,WAAW;EAAEH,MAAM;EAAWC,SAAS;CAAU;CACjDG,SAAS;EAAEJ,MAAM;EAAOC,SAAS;CAAK;CACtCI,OAAO;EAAEL,MAAM;EAAOC,SAAS;CAAK;CACpCK,QAAQ;EAAEN,MAAM;EAAOC,SAAS;CAAK;CACrCM,QAAQ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,EACF;EAACX,mBAAA,CAAA,CAAA;CACH;AACF,EAAE"}
|
|
@@ -14,9 +14,9 @@ import { Pressable } from "react-native-unistyles/components/native/Pressable";
|
|
|
14
14
|
import { Animated } from "react-native-unistyles/components/native/Animated";
|
|
15
15
|
|
|
16
16
|
//#region src/components/Dialog.tsx
|
|
17
|
-
/** `bg-
|
|
17
|
+
/** `bg-po-deep/70`. */
|
|
18
18
|
const BACKDROP_ALPHA_PERCENT = 70;
|
|
19
|
-
/** `animate-
|
|
19
|
+
/** `animate-po-pop` starts the card slightly small and grows it into place. */
|
|
20
20
|
const POP_FROM_SCALE = .96;
|
|
21
21
|
/** `max-w-[calc(100vw-24px)]`: 12pt clear of each screen edge. */
|
|
22
22
|
const SCREEN_MARGIN = 12;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.mjs","names":["withAlpha","createContext","ReactNode","useContext","useEffect","useRef","Easing","Modal","Platform","StyleProp","TextProps","ViewProps","ViewStyle","StyleSheet","useUnistyles","CloseIcon","fontOf","useControllable","wrapText","Button","ButtonProps","BACKDROP_ALPHA_PERCENT","POP_FROM_SCALE","SCREEN_MARGIN","DialogWidth","DialogState","open","setOpen","DialogContext","undefined","DialogProps","defaultOpen","onOpenChange","children","Dialog","current","DialogTrigger","onPress","props","event","DialogClose","DialogContentProps","width","style","closeLabel","DialogContent","theme","progress","Animated","Value","x1","y1","x2","y2","motion","easing","setValue","timing","toValue","duration","pop","bezier","useNativeDriver","OS","start","_styles","styles","useVariants","root","backdrop","backgroundColor","colors","deep","card","opacity","transform","scale","interpolate","inputRange","outputRange","DialogPartProps","Omit","DialogHeaderProps","dismissible","DialogHeader","header","DialogTitle","title","DialogDescription","description","DialogBody","body","DialogFooterVariant","DialogFooterProps","variant","DialogFooter","_styles2","footer","hint","create","flex","alignItems","justifyContent","padding","position","top","right","bottom","left","maxHeight","overflow","borderRadius","lg","borderWidth","borderColor","border","panel","variants","sm","maxWidth","md","uni__dependencies","flexDirection","gap","spacing","minWidth","borderBottomWidth","borderBottomColor","flexShrink","color","hi","fontFamily","sans","fontSize","xl","lineHeight","letterSpacing","fontWeight","semibold","dim","lineHeightRelaxed","plain","bar","flexWrap","minHeight","borderTopWidth","borderTopColor","paddingHorizontal","paddingVertical","faint"],"sources":["../../src/components/Dialog.tsx"],"sourcesContent":["import { withAlpha } from '@agimon-ai/po-web-components/nativeTheme';\nimport { createContext, type ReactNode, useContext, useEffect, useRef } from 'react';\nimport {\n Animated,\n Easing,\n Modal,\n Platform,\n Pressable,\n type StyleProp,\n Text,\n type TextProps,\n View,\n type ViewProps,\n type ViewStyle,\n} from 'react-native';\nimport { StyleSheet, useUnistyles } 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';\n\n/*\n * The web Dialog as a centred card in an RN Modal: the native shape for a\n * question that blocks, such as a destructive confirmation. Android back and\n * a backdrop tap close it, as Escape and an outside click do on the web.\n */\n\n/** `bg-doom-deep/70`. */\nconst BACKDROP_ALPHA_PERCENT = 70;\n/** `animate-doom-pop` starts the card slightly small and grows it into place. */\nconst POP_FROM_SCALE = 0.96;\n/** `max-w-[calc(100vw-24px)]`: 12pt clear of each screen edge. */\nconst SCREEN_MARGIN = 12;\n\nexport type DialogWidth = 'sm' | 'md' | 'lg';\n\ninterface DialogState {\n open: boolean;\n setOpen: (open: boolean) => void;\n}\n\nconst DialogContext = createContext<DialogState>({ open: false, setOpen: () => undefined });\n\nexport interface DialogProps {\n /** Controlled mode; pair with onOpenChange. Omit it and the dialog keeps its own state. */\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n children?: ReactNode;\n}\n\nexport function Dialog({ open, defaultOpen = false, onOpenChange, children }: DialogProps) {\n const [current, setOpen] = useControllable(open, defaultOpen, onOpenChange);\n return <DialogContext.Provider value={{ open: current, setOpen }}>{children}</DialogContext.Provider>;\n}\n\n/** A Button that opens the enclosing dialog. */\nexport function DialogTrigger({ onPress, ...props }: ButtonProps) {\n const { setOpen } = useContext(DialogContext);\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 dialog. */\nexport function DialogClose({ onPress, ...props }: ButtonProps) {\n const { setOpen } = useContext(DialogContext);\n return (\n <Button\n onPress={(event) => {\n onPress?.(event);\n setOpen(false);\n }}\n {...props}\n />\n );\n}\n\nexport interface DialogContentProps {\n /** Width preset; `style` may still override. */\n width?: DialogWidth;\n /** Applied to the card, after the preset. */\n style?: StyleProp<ViewStyle>;\n /** What the backdrop announces as its close action. */\n closeLabel?: string;\n children?: ReactNode;\n}\n\nexport function DialogContent({ width = 'md', style, closeLabel = 'close', children }: DialogContentProps) {\n const { open, setOpen } = useContext(DialogContext);\n const { theme } = useUnistyles();\n const progress = useRef(new Animated.Value(0)).current;\n const [x1, y1, x2, y2] = theme.motion.easing;\n useEffect(() => {\n if (!open) return;\n progress.setValue(0);\n Animated.timing(progress, {\n toValue: 1,\n duration: theme.motion.pop,\n easing: Easing.bezier(x1, y1, x2, y2),\n useNativeDriver: Platform.OS !== 'web',\n }).start();\n }, [open, progress, theme.motion.pop, x1, y1, x2, y2]);\n styles.useVariants({ width });\n return (\n <Modal visible={open} transparent animationType=\"fade\" statusBarTranslucent onRequestClose={() => setOpen(false)}>\n <View style={styles.root}>\n <Pressable\n accessibilityRole=\"button\"\n accessibilityLabel={closeLabel}\n onPress={() => setOpen(false)}\n // Alpha mixes are computed in render from useUnistyles(), not in StyleSheet.create: on web Unistyles hands\n // the stylesheet CSS variables, which withAlpha cannot read.\n style={[styles.backdrop, { backgroundColor: withAlpha(theme.colors.deep, BACKDROP_ALPHA_PERCENT) }]}\n />\n <Animated.View\n accessibilityViewIsModal\n style={[\n styles.card,\n style,\n {\n opacity: progress,\n transform: [{ scale: progress.interpolate({ inputRange: [0, 1], outputRange: [POP_FROM_SCALE, 1] }) }],\n },\n ]}\n >\n {children}\n </Animated.View>\n </View>\n </Modal>\n );\n}\n\nexport interface DialogPartProps extends Omit<ViewProps, 'children' | 'style'> {\n children?: ReactNode;\n style?: StyleProp<ViewStyle>;\n}\n\nexport interface DialogHeaderProps extends DialogPartProps {\n /**\n * Show the close control at the right of the strip. Off by default, as on\n * the web: Android back and a backdrop tap already close every dialog.\n */\n dismissible?: boolean;\n /** What the close control announces. */\n closeLabel?: string;\n}\n\nexport function DialogHeader({\n dismissible = false,\n closeLabel = 'close',\n style,\n children,\n ...props\n}: DialogHeaderProps) {\n const { setOpen } = useContext(DialogContext);\n return (\n <View style={[styles.header, style]} {...props}>\n {children}\n {dismissible ? (\n <Button variant=\"ghost\" size=\"icon\" accessibilityLabel={closeLabel} onPress={() => setOpen(false)}>\n <CloseIcon size={12} color=\"faint\" />\n </Button>\n ) : null}\n </View>\n );\n}\n\nexport function DialogTitle({ style, ...props }: TextProps) {\n return <Text accessibilityRole=\"header\" style={[styles.title, style]} {...props} />;\n}\n\nexport function DialogDescription({ style, ...props }: TextProps) {\n return <Text style={[styles.description, style]} {...props} />;\n}\n\nexport function DialogBody({ style, children, ...props }: DialogPartProps) {\n return (\n <View style={[styles.body, style]} {...props}>\n {wrapText(children, styles.description)}\n </View>\n );\n}\n\nexport type DialogFooterVariant = 'plain' | 'bar';\n\nexport interface DialogFooterProps extends DialogPartProps {\n /** `plain`: buttons alone, inside the body's padding. `bar`: the recessed full-width strip with a hint at the left. */\n variant?: DialogFooterVariant;\n}\n\nexport function DialogFooter({ variant = 'plain', style, children, ...props }: DialogFooterProps) {\n styles.useVariants({ footer: variant });\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 root: { flex: 1, alignItems: 'center', justifyContent: 'center', padding: SCREEN_MARGIN },\n backdrop: { position: 'absolute', top: 0, right: 0, bottom: 0, left: 0 },\n card: {\n width: '100%',\n maxHeight: '100%',\n overflow: 'hidden',\n borderRadius: theme.borderRadius.lg,\n borderWidth: 1,\n borderColor: theme.colors.border,\n backgroundColor: theme.colors.panel,\n variants: {\n width: {\n sm: { maxWidth: 360 },\n md: { maxWidth: 480 },\n lg: { maxWidth: 620 },\n },\n },\n },\n header: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n gap: theme.spacing(3),\n minWidth: 0,\n borderBottomWidth: 1,\n borderBottomColor: theme.colors.border,\n padding: theme.spacing(3),\n },\n title: {\n flexShrink: 1,\n color: theme.colors.hi,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.xl,\n lineHeight: theme.lineHeight.xl,\n letterSpacing: theme.letterSpacing.xl,\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: { gap: theme.spacing(3), padding: theme.spacing(3) },\n footer: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: theme.spacing(2),\n variants: {\n footer: {\n plain: { justifyContent: 'flex-end' },\n bar: {\n flexWrap: 'wrap',\n justifyContent: 'space-between',\n minHeight: 34,\n borderTopWidth: 1,\n borderTopColor: theme.colors['border-soft'],\n backgroundColor: theme.colors.deep,\n paddingHorizontal: theme.spacing(3),\n paddingVertical: theme.spacing(1.5),\n },\n },\n },\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":";;;;;;;;;;;;;;;;;AA8BA,MAAMqB,yBAAyB;;AAE/B,MAAMC,iBAAiB;;AAEvB,MAAMC,gBAAgB;AAStB,MAAMK,gBAAgB3B,cAA2B;CAAEyB,MAAM;CAAOC,eAAeE;AAAU,CAAC;AAU1F,SAAgBK,OA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YnH,OAAO8B,MAAMqF,WAAWC,IAAI;EACxCC,UAAUvF,MAAMuF,SAAS;EACzBE,YAAYzF,MAAMyF,WAAW;EAAMd,mBAAA,CAAA,CAAA;CACrC;AACF,EAAE"}
|
|
1
|
+
{"version":3,"file":"Dialog.mjs","names":["withAlpha","createContext","ReactNode","useContext","useEffect","useRef","Easing","Modal","Platform","StyleProp","TextProps","ViewProps","ViewStyle","StyleSheet","useUnistyles","CloseIcon","fontOf","useControllable","wrapText","Button","ButtonProps","BACKDROP_ALPHA_PERCENT","POP_FROM_SCALE","SCREEN_MARGIN","DialogWidth","DialogState","open","setOpen","DialogContext","undefined","DialogProps","defaultOpen","onOpenChange","children","Dialog","current","DialogTrigger","onPress","props","event","DialogClose","DialogContentProps","width","style","closeLabel","DialogContent","theme","progress","Animated","Value","x1","y1","x2","y2","motion","easing","setValue","timing","toValue","duration","pop","bezier","useNativeDriver","OS","start","_styles","styles","useVariants","root","backdrop","backgroundColor","colors","deep","card","opacity","transform","scale","interpolate","inputRange","outputRange","DialogPartProps","Omit","DialogHeaderProps","dismissible","DialogHeader","header","DialogTitle","title","DialogDescription","description","DialogBody","body","DialogFooterVariant","DialogFooterProps","variant","DialogFooter","_styles2","footer","hint","create","flex","alignItems","justifyContent","padding","position","top","right","bottom","left","maxHeight","overflow","borderRadius","lg","borderWidth","borderColor","border","panel","variants","sm","maxWidth","md","uni__dependencies","flexDirection","gap","spacing","minWidth","borderBottomWidth","borderBottomColor","flexShrink","color","hi","fontFamily","sans","fontSize","xl","lineHeight","letterSpacing","fontWeight","semibold","dim","lineHeightRelaxed","plain","bar","flexWrap","minHeight","borderTopWidth","borderTopColor","paddingHorizontal","paddingVertical","faint"],"sources":["../../src/components/Dialog.tsx"],"sourcesContent":["import { withAlpha } from '@agimon-ai/po-web-components/nativeTheme';\nimport { createContext, type ReactNode, useContext, useEffect, useRef } from 'react';\nimport {\n Animated,\n Easing,\n Modal,\n Platform,\n Pressable,\n type StyleProp,\n Text,\n type TextProps,\n View,\n type ViewProps,\n type ViewStyle,\n} from 'react-native';\nimport { StyleSheet, useUnistyles } 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';\n\n/*\n * The web Dialog as a centred card in an RN Modal: the native shape for a\n * question that blocks, such as a destructive confirmation. Android back and\n * a backdrop tap close it, as Escape and an outside click do on the web.\n */\n\n/** `bg-po-deep/70`. */\nconst BACKDROP_ALPHA_PERCENT = 70;\n/** `animate-po-pop` starts the card slightly small and grows it into place. */\nconst POP_FROM_SCALE = 0.96;\n/** `max-w-[calc(100vw-24px)]`: 12pt clear of each screen edge. */\nconst SCREEN_MARGIN = 12;\n\nexport type DialogWidth = 'sm' | 'md' | 'lg';\n\ninterface DialogState {\n open: boolean;\n setOpen: (open: boolean) => void;\n}\n\nconst DialogContext = createContext<DialogState>({ open: false, setOpen: () => undefined });\n\nexport interface DialogProps {\n /** Controlled mode; pair with onOpenChange. Omit it and the dialog keeps its own state. */\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n children?: ReactNode;\n}\n\nexport function Dialog({ open, defaultOpen = false, onOpenChange, children }: DialogProps) {\n const [current, setOpen] = useControllable(open, defaultOpen, onOpenChange);\n return <DialogContext.Provider value={{ open: current, setOpen }}>{children}</DialogContext.Provider>;\n}\n\n/** A Button that opens the enclosing dialog. */\nexport function DialogTrigger({ onPress, ...props }: ButtonProps) {\n const { setOpen } = useContext(DialogContext);\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 dialog. */\nexport function DialogClose({ onPress, ...props }: ButtonProps) {\n const { setOpen } = useContext(DialogContext);\n return (\n <Button\n onPress={(event) => {\n onPress?.(event);\n setOpen(false);\n }}\n {...props}\n />\n );\n}\n\nexport interface DialogContentProps {\n /** Width preset; `style` may still override. */\n width?: DialogWidth;\n /** Applied to the card, after the preset. */\n style?: StyleProp<ViewStyle>;\n /** What the backdrop announces as its close action. */\n closeLabel?: string;\n children?: ReactNode;\n}\n\nexport function DialogContent({ width = 'md', style, closeLabel = 'close', children }: DialogContentProps) {\n const { open, setOpen } = useContext(DialogContext);\n const { theme } = useUnistyles();\n const progress = useRef(new Animated.Value(0)).current;\n const [x1, y1, x2, y2] = theme.motion.easing;\n useEffect(() => {\n if (!open) return;\n progress.setValue(0);\n Animated.timing(progress, {\n toValue: 1,\n duration: theme.motion.pop,\n easing: Easing.bezier(x1, y1, x2, y2),\n useNativeDriver: Platform.OS !== 'web',\n }).start();\n }, [open, progress, theme.motion.pop, x1, y1, x2, y2]);\n styles.useVariants({ width });\n return (\n <Modal visible={open} transparent animationType=\"fade\" statusBarTranslucent onRequestClose={() => setOpen(false)}>\n <View style={styles.root}>\n <Pressable\n accessibilityRole=\"button\"\n accessibilityLabel={closeLabel}\n onPress={() => setOpen(false)}\n // Alpha mixes are computed in render from useUnistyles(), not in StyleSheet.create: on web Unistyles hands\n // the stylesheet CSS variables, which withAlpha cannot read.\n style={[styles.backdrop, { backgroundColor: withAlpha(theme.colors.deep, BACKDROP_ALPHA_PERCENT) }]}\n />\n <Animated.View\n accessibilityViewIsModal\n style={[\n styles.card,\n style,\n {\n opacity: progress,\n transform: [{ scale: progress.interpolate({ inputRange: [0, 1], outputRange: [POP_FROM_SCALE, 1] }) }],\n },\n ]}\n >\n {children}\n </Animated.View>\n </View>\n </Modal>\n );\n}\n\nexport interface DialogPartProps extends Omit<ViewProps, 'children' | 'style'> {\n children?: ReactNode;\n style?: StyleProp<ViewStyle>;\n}\n\nexport interface DialogHeaderProps extends DialogPartProps {\n /**\n * Show the close control at the right of the strip. Off by default, as on\n * the web: Android back and a backdrop tap already close every dialog.\n */\n dismissible?: boolean;\n /** What the close control announces. */\n closeLabel?: string;\n}\n\nexport function DialogHeader({\n dismissible = false,\n closeLabel = 'close',\n style,\n children,\n ...props\n}: DialogHeaderProps) {\n const { setOpen } = useContext(DialogContext);\n return (\n <View style={[styles.header, style]} {...props}>\n {children}\n {dismissible ? (\n <Button variant=\"ghost\" size=\"icon\" accessibilityLabel={closeLabel} onPress={() => setOpen(false)}>\n <CloseIcon size={12} color=\"faint\" />\n </Button>\n ) : null}\n </View>\n );\n}\n\nexport function DialogTitle({ style, ...props }: TextProps) {\n return <Text accessibilityRole=\"header\" style={[styles.title, style]} {...props} />;\n}\n\nexport function DialogDescription({ style, ...props }: TextProps) {\n return <Text style={[styles.description, style]} {...props} />;\n}\n\nexport function DialogBody({ style, children, ...props }: DialogPartProps) {\n return (\n <View style={[styles.body, style]} {...props}>\n {wrapText(children, styles.description)}\n </View>\n );\n}\n\nexport type DialogFooterVariant = 'plain' | 'bar';\n\nexport interface DialogFooterProps extends DialogPartProps {\n /** `plain`: buttons alone, inside the body's padding. `bar`: the recessed full-width strip with a hint at the left. */\n variant?: DialogFooterVariant;\n}\n\nexport function DialogFooter({ variant = 'plain', style, children, ...props }: DialogFooterProps) {\n styles.useVariants({ footer: variant });\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 root: { flex: 1, alignItems: 'center', justifyContent: 'center', padding: SCREEN_MARGIN },\n backdrop: { position: 'absolute', top: 0, right: 0, bottom: 0, left: 0 },\n card: {\n width: '100%',\n maxHeight: '100%',\n overflow: 'hidden',\n borderRadius: theme.borderRadius.lg,\n borderWidth: 1,\n borderColor: theme.colors.border,\n backgroundColor: theme.colors.panel,\n variants: {\n width: {\n sm: { maxWidth: 360 },\n md: { maxWidth: 480 },\n lg: { maxWidth: 620 },\n },\n },\n },\n header: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n gap: theme.spacing(3),\n minWidth: 0,\n borderBottomWidth: 1,\n borderBottomColor: theme.colors.border,\n padding: theme.spacing(3),\n },\n title: {\n flexShrink: 1,\n color: theme.colors.hi,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.xl,\n lineHeight: theme.lineHeight.xl,\n letterSpacing: theme.letterSpacing.xl,\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: { gap: theme.spacing(3), padding: theme.spacing(3) },\n footer: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: theme.spacing(2),\n variants: {\n footer: {\n plain: { justifyContent: 'flex-end' },\n bar: {\n flexWrap: 'wrap',\n justifyContent: 'space-between',\n minHeight: 34,\n borderTopWidth: 1,\n borderTopColor: theme.colors['border-soft'],\n backgroundColor: theme.colors.deep,\n paddingHorizontal: theme.spacing(3),\n paddingVertical: theme.spacing(1.5),\n },\n },\n },\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":";;;;;;;;;;;;;;;;;AA8BA,MAAMqB,yBAAyB;;AAE/B,MAAMC,iBAAiB;;AAEvB,MAAMC,gBAAgB;AAStB,MAAMK,gBAAgB3B,cAA2B;CAAEyB,MAAM;CAAOC,eAAeE;AAAU,CAAC;AAU1F,SAAgBK,OAAO,EAAER,MAAMK,cAAc,OAAOC,cAAcC,YAAyB;CACzF,MAAM,CAACE,SAASR,WAAWV,gBAAgBS,MAAMK,aAAaC,YAAY;CAC1E,OAAO,oBAAC,cAAc,UAAf;EAAwB,OAAO;GAAEN,MAAMS;GAASR;EAAQ;EAAIM;CAAiC;AACtG;;AAGA,SAAgBG,cAAc,EAAEC,SAAS,GAAGC,SAAsB;CAChE,MAAM,EAAEX,YAAYxB,WAAWyB,aAAa;CAC5C,OACE,oBAAC,QAAD;EACE,UAAUW,UAAU;GAClBF,UAAUE,KAAK;GACf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AAe1F,MAAM0F,cAAcF;EACnCG,YAAY3F,MAAM2F,WAAWC;EAAQjB,mBAAA,CAAA,CAAA;CACvC;CACAhC,aAAa;EACXwC,OAAOnF,MAAMyB,OAAOoE;EACpBR,YAAYnH,OAAO8B,MAAMqF,WAAWC,IAAI;EACxCC,UAAUvF,MAAMuF,SAASf;EACzBiB,YAAYzF,MAAM8F,kBAAkBtB;EAAEG,mBAAA,CAAA,CAAA;CACxC;CACA9B,MAAM;EAAEgC,KAAK7E,MAAM8E,QAAQ,CAAC;EAAGrB,SAASzD,MAAM8E,QAAQ,CAAC;EAACH,mBAAA,CAAA,CAAA;CAAC;CACzDxB,QAAQ;EACNyB,eAAe;EACfrB,YAAY;EACZsB,KAAK7E,MAAM8E,QAAQ,CAAC;EACpBP,UAAU,EACRpB,QAAQ;GACN4C,OAAO,EAAEvC,gBAAgB,WAAW;GACpCwC,KAAK;IACHC,UAAU;IACVzC,gBAAgB;IAChB0C,WAAW;IACXC,gBAAgB;IAChBC,gBAAgBpG,MAAMyB,OAAO;IAC7BD,iBAAiBxB,MAAMyB,OAAOC;IAC9B2E,mBAAmBrG,MAAM8E,QAAQ,CAAC;IAClCwB,iBAAiBtG,MAAM8E,QAAQ,GAAG;GACpC;EACF,EACF;EAACH,mBAAA,CAAA,GAAA,CAAA;CACH;CACAvB,MAAM;EACJ+B,OAAOnF,MAAMyB,OAAO8E;EACpBlB,YAAYnH,OAAO8B,MAAMqF,WAAWC,IAAI;EACxCC,UAAUvF,MAAMuF,SAAS;EACzBE,YAAYzF,MAAMyF,WAAW;EAAMd,mBAAA,CAAA,CAAA;CACrC;AACF,EAAE"}
|
package/dist/components/Dot.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
5
5
|
import { Animated } from "react-native-unistyles/components/native/Animated";
|
|
6
6
|
|
|
7
7
|
//#region src/components/Dot.tsx
|
|
8
|
-
/** `bg-
|
|
8
|
+
/** `bg-po-faint/40`: a thing that exists but is not live. */
|
|
9
9
|
const MUTED_ALPHA_PERCENT = 40;
|
|
10
10
|
/** Tailwind's `animate-pulse`: a 2s cycle down to half opacity and back. */
|
|
11
11
|
const PULSE_HALF_CYCLE_MS = 1e3;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dot.mjs","names":["DotTone","Tone","withAlpha","useEffect","useRef","StyleProp","ViewStyle","StyleSheet","useUnistyles","DotSize","MUTED_ALPHA_PERCENT","PULSE_HALF_CYCLE_MS","PULSE_LOW_OPACITY","DotProps","tone","size","pulse","style","Dot","theme","_styles","styles","useVariants","opacity","Animated","Value","current","setValue","undefined","loop","sequence","timing","toValue","duration","useNativeDriver","start","stop","dot","backgroundColor","colors","faint","create","flexShrink","borderRadius","full","variants","neutral","muted","blue","green","yellow","red","magenta","violet","cyan","orange","teal","xs","width","spacing","height","sm","md","lg","uni__dependencies"],"sources":["../../src/components/Dot.tsx"],"sourcesContent":["import { type DotTone as Tone, withAlpha } from '@agimon-ai/po-web-components/nativeTheme';\nimport { useEffect, useRef } from 'react';\nimport { Animated, type StyleProp, type ViewStyle } from 'react-native';\nimport { StyleSheet, useUnistyles } from 'react-native-unistyles';\n\nexport type DotTone = Tone;\nexport type DotSize = 'xs' | 'sm' | 'md' | 'lg';\n\n/** `bg-
|
|
1
|
+
{"version":3,"file":"Dot.mjs","names":["DotTone","Tone","withAlpha","useEffect","useRef","StyleProp","ViewStyle","StyleSheet","useUnistyles","DotSize","MUTED_ALPHA_PERCENT","PULSE_HALF_CYCLE_MS","PULSE_LOW_OPACITY","DotProps","tone","size","pulse","style","Dot","theme","_styles","styles","useVariants","opacity","Animated","Value","current","setValue","undefined","loop","sequence","timing","toValue","duration","useNativeDriver","start","stop","dot","backgroundColor","colors","faint","create","flexShrink","borderRadius","full","variants","neutral","muted","blue","green","yellow","red","magenta","violet","cyan","orange","teal","xs","width","spacing","height","sm","md","lg","uni__dependencies"],"sources":["../../src/components/Dot.tsx"],"sourcesContent":["import { type DotTone as Tone, withAlpha } from '@agimon-ai/po-web-components/nativeTheme';\nimport { useEffect, useRef } from 'react';\nimport { Animated, type StyleProp, type ViewStyle } from 'react-native';\nimport { StyleSheet, useUnistyles } from 'react-native-unistyles';\n\nexport type DotTone = Tone;\nexport type DotSize = 'xs' | 'sm' | 'md' | 'lg';\n\n/** `bg-po-faint/40`: a thing that exists but is not live. */\nconst MUTED_ALPHA_PERCENT = 40;\n/** Tailwind's `animate-pulse`: a 2s cycle down to half opacity and back. */\nconst PULSE_HALF_CYCLE_MS = 1000;\nconst PULSE_LOW_OPACITY = 0.5;\n\nexport interface DotProps {\n tone?: DotTone;\n size?: DotSize;\n /** Something is live: the dot breathes. */\n pulse?: boolean;\n style?: StyleProp<ViewStyle>;\n}\n\n/** The status dot: a colour and, while something is live, a pulse. Hidden from screen readers. */\nexport function Dot({ tone = 'neutral', size = 'sm', pulse = false, style }: DotProps) {\n const { theme } = useUnistyles();\n styles.useVariants({ tone, size });\n const opacity = useRef(new Animated.Value(1)).current;\n useEffect(() => {\n if (!pulse) {\n opacity.setValue(1);\n return undefined;\n }\n const loop = Animated.loop(\n Animated.sequence([\n Animated.timing(opacity, { toValue: PULSE_LOW_OPACITY, duration: PULSE_HALF_CYCLE_MS, useNativeDriver: true }),\n Animated.timing(opacity, { toValue: 1, duration: PULSE_HALF_CYCLE_MS, useNativeDriver: true }),\n ]),\n );\n loop.start();\n return () => loop.stop();\n }, [pulse, opacity]);\n return (\n <Animated.View\n accessible={false}\n importantForAccessibility=\"no-hide-descendants\"\n accessibilityElementsHidden\n style={[\n styles.dot,\n // Alpha mixes are computed in render from useUnistyles(), not in StyleSheet.create: on web Unistyles hands\n // the stylesheet CSS variables, which withAlpha cannot read.\n tone === 'muted' && { backgroundColor: withAlpha(theme.colors.faint, MUTED_ALPHA_PERCENT) },\n { opacity },\n style,\n ]}\n />\n );\n}\n\nconst styles = StyleSheet.create((theme) => ({\n dot: {\n flexShrink: 0,\n borderRadius: theme.borderRadius.full,\n variants: {\n tone: {\n neutral: { backgroundColor: theme.colors.faint },\n muted: {},\n blue: { backgroundColor: theme.colors.blue },\n green: { backgroundColor: theme.colors.green },\n yellow: { backgroundColor: theme.colors.yellow },\n red: { backgroundColor: theme.colors.red },\n magenta: { backgroundColor: theme.colors.magenta },\n violet: { backgroundColor: theme.colors.violet },\n cyan: { backgroundColor: theme.colors.cyan },\n orange: { backgroundColor: theme.colors.orange },\n teal: { backgroundColor: theme.colors.teal },\n },\n size: {\n xs: { width: theme.spacing(1), height: theme.spacing(1) },\n sm: { width: theme.spacing(1.5), height: theme.spacing(1.5) },\n md: { width: theme.spacing(2), height: theme.spacing(2) },\n lg: { width: theme.spacing(2.5), height: theme.spacing(2.5) },\n },\n },\n },\n}));\n"],"mappings":";;;;;;;;AASA,MAAMU,sBAAsB;;AAE5B,MAAMC,sBAAsB;AAC5B,MAAMC,oBAAoB;;AAW1B,SAAgBM,IAAI,EAAEJ,OAAO,WAAWC,OAAO,MAAMC,QAAQ,OAAOC,SAAmB;CACrF,MAAM,EAAEE,UAAUX,aAAa;CAAE,MAAAY,UAAAC;CAAA;EAAA,MAAAA,SAAAD,QAAAE,YACd;GAAER;GAAMC;EAAK,CAAC;EACjC,MAAMQ,UAAUnB,OAAO,IAAIoB,SAASC,MAAM,CAAC,CAAC,CAAC,CAACC;EAC9CvB,gBAAgB;GACd,IAAI,CAACa,OAAO;IACVO,QAAQI,SAAS,CAAC;IAClB;GACF;GACA,MAAME,OAAOL,SAASK,KACpBL,SAASM,SAAS,CAChBN,SAASO,OAAOR,SAAS;IAAES,SAASpB;IAAmBqB,UAAUtB;IAAqBuB,iBAAiB;GAAK,CAAC,GAC7GV,SAASO,OAAOR,SAAS;IAAES,SAAS;IAAGC,UAAUtB;IAAqBuB,iBAAiB;GAAK,CAAC,CAAC,CAC/F,CACH;GACAL,KAAKM,MAAM;GACX,aAAaN,KAAKO,KAAK;EACzB,GAAG,CAACpB,OAAOO,OAAO,CAAC;EACnB,OACE,oBAAC,SAA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AAMwC,QAAQ,GAAG;IAAGC,QAAQzC,MAAMwC,QAAQ,GAAG;GAAE;EAC9D;CACF;CAACK,mBAAA,CAAA,GAAA,CAAA;AACH,EACF,EAAE"}
|
|
@@ -8,7 +8,7 @@ import { BottomSheetTextInput } from "@gorhom/bottom-sheet";
|
|
|
8
8
|
import { TextInput } from "react-native-unistyles/components/native/TextInput";
|
|
9
9
|
|
|
10
10
|
//#region src/components/Input.tsx
|
|
11
|
-
/** `focus:border-
|
|
11
|
+
/** `focus:border-po-green/60`. */
|
|
12
12
|
const FOCUS_EDGE_ALPHA_PERCENT = 60;
|
|
13
13
|
const DISABLED_OPACITY = .5;
|
|
14
14
|
const ThemedSheetTextInput = withUnistyles(BottomSheetTextInput);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.mjs","names":["withAlpha","BottomSheetTextInput","useState","TextInputProps","StyleSheet","useUnistyles","withUnistyles","fontOf","useInsideSheet","FieldVariant","FieldSize","FOCUS_EDGE_ALPHA_PERCENT","DISABLED_OPACITY","ThemedSheetTextInput","InputProps","Omit","variant","size","invalid","disabled","Input","style","onFocus","onBlur","accessibilityState","props","theme","focused","setFocused","Field","TextInput","_styles","styles","useVariants","undefined","colors","faint","green","event","field","borderColor","create","minWidth","minHeight","color","hi","fontFamily","sans","variants","default","borderRadius","DEFAULT","borderWidth","border","backgroundColor","deep","bare","padding","xs","paddingHorizontal","spacing","paddingVertical","fontSize","sm","md","base","lg","compoundVariants","uni__dependencies","red","opacity"],"sources":["../../src/components/Input.tsx"],"sourcesContent":["import { withAlpha } from '@agimon-ai/po-web-components/nativeTheme';\nimport { BottomSheetTextInput } from '@gorhom/bottom-sheet';\nimport { useState } from 'react';\nimport { TextInput, type TextInputProps } from 'react-native';\nimport { StyleSheet, useUnistyles, withUnistyles } from 'react-native-unistyles';\n\nimport { fontOf } from '../lib/fonts';\nimport { useInsideSheet } from '../lib/insideSheet';\n\nexport type FieldVariant = 'default' | 'bare';\nexport type FieldSize = 'xs' | 'sm' | 'md' | 'lg';\n\n/** `focus:border-
|
|
1
|
+
{"version":3,"file":"Input.mjs","names":["withAlpha","BottomSheetTextInput","useState","TextInputProps","StyleSheet","useUnistyles","withUnistyles","fontOf","useInsideSheet","FieldVariant","FieldSize","FOCUS_EDGE_ALPHA_PERCENT","DISABLED_OPACITY","ThemedSheetTextInput","InputProps","Omit","variant","size","invalid","disabled","Input","style","onFocus","onBlur","accessibilityState","props","theme","focused","setFocused","Field","TextInput","_styles","styles","useVariants","undefined","colors","faint","green","event","field","borderColor","create","minWidth","minHeight","color","hi","fontFamily","sans","variants","default","borderRadius","DEFAULT","borderWidth","border","backgroundColor","deep","bare","padding","xs","paddingHorizontal","spacing","paddingVertical","fontSize","sm","md","base","lg","compoundVariants","uni__dependencies","red","opacity"],"sources":["../../src/components/Input.tsx"],"sourcesContent":["import { withAlpha } from '@agimon-ai/po-web-components/nativeTheme';\nimport { BottomSheetTextInput } from '@gorhom/bottom-sheet';\nimport { useState } from 'react';\nimport { TextInput, type TextInputProps } from 'react-native';\nimport { StyleSheet, useUnistyles, withUnistyles } from 'react-native-unistyles';\n\nimport { fontOf } from '../lib/fonts';\nimport { useInsideSheet } from '../lib/insideSheet';\n\nexport type FieldVariant = 'default' | 'bare';\nexport type FieldSize = 'xs' | 'sm' | 'md' | 'lg';\n\n/** `focus:border-po-green/60`. */\nconst FOCUS_EDGE_ALPHA_PERCENT = 60;\nconst DISABLED_OPACITY = 0.5;\n\nconst ThemedSheetTextInput = withUnistyles(BottomSheetTextInput);\nexport interface InputProps extends Omit<TextInputProps, 'editable'> {\n variant?: FieldVariant;\n /** The same rungs Button names, so a field and the button beside it line up. */\n size?: FieldSize;\n /** The value is wrong: red edge and red text, as `aria-invalid` on the web. */\n invalid?: boolean;\n disabled?: boolean;\n}\n\n/**\n * The one text field: deep well, quiet border, jade edge and cursor on focus,\n * red edge when invalid. Inside a Sheet it becomes the sheet's own input.\n */\nexport function Input({\n variant = 'default',\n size = 'md',\n invalid = false,\n disabled = false,\n style,\n onFocus,\n onBlur,\n accessibilityState,\n ...props\n}: InputProps) {\n const { theme } = useUnistyles();\n const [focused, setFocused] = useState(false);\n // Inside a Sheet the field must be the sheet's own input, so the sheet rises with the keyboard.\n const Field = useInsideSheet() ? ThemedSheetTextInput : TextInput;\n // Unistyles reserves a variant named `default` as the fallback for an unset variant.\n styles.useVariants({ variant: variant === 'bare' ? 'bare' : undefined, size });\n return (\n <Field\n autoCorrect={false}\n spellCheck={false}\n placeholderTextColor={theme.colors.faint}\n selectionColor={theme.colors.green}\n cursorColor={theme.colors.green}\n editable={!disabled}\n accessibilityState={{ ...accessibilityState, disabled }}\n onFocus={(event) => {\n setFocused(true);\n onFocus?.(event);\n }}\n onBlur={(event) => {\n setFocused(false);\n onBlur?.(event);\n }}\n style={[\n styles.field,\n // Alpha mixes are computed in render from useUnistyles(), not in StyleSheet.create: on web Unistyles hands\n // the stylesheet CSS variables, which withAlpha cannot read.\n focused && variant === 'default' && { borderColor: withAlpha(theme.colors.green, FOCUS_EDGE_ALPHA_PERCENT) },\n invalid && styles.invalid,\n disabled && styles.disabled,\n style,\n ]}\n {...props}\n />\n );\n}\n\nconst styles = StyleSheet.create((theme) => ({\n field: {\n minWidth: 0,\n minHeight: 44,\n color: theme.colors.hi,\n fontFamily: fontOf(theme.fontFamily.sans),\n variants: {\n variant: {\n default: {\n borderRadius: theme.borderRadius.DEFAULT,\n borderWidth: 1,\n borderColor: theme.colors.border,\n backgroundColor: theme.colors.deep,\n },\n /** No well: a composer or a search that draws its own surface keeps the type and drops the box. */\n bare: { borderWidth: 0, backgroundColor: 'transparent', padding: 0 },\n },\n size: {\n xs: {\n paddingHorizontal: theme.spacing(1.5),\n paddingVertical: theme.spacing(0.5),\n fontSize: theme.fontSize.sm,\n },\n sm: {\n paddingHorizontal: theme.spacing(2),\n paddingVertical: theme.spacing(1),\n fontSize: theme.fontSize.sm,\n },\n md: {\n paddingHorizontal: theme.spacing(2.5),\n paddingVertical: theme.spacing(1.5),\n fontSize: theme.fontSize.base,\n },\n lg: {\n paddingHorizontal: theme.spacing(3),\n paddingVertical: theme.spacing(1.5),\n fontSize: theme.fontSize.base,\n },\n },\n },\n compoundVariants: [{ variant: 'bare', styles: { padding: 0, paddingHorizontal: 0, paddingVertical: 0 } }],\n },\n invalid: { borderColor: theme.colors['edge-red'], color: theme.colors.red },\n disabled: { opacity: DISABLED_OPACITY },\n}));\n"],"mappings":";;;;;;;;;;;AAaA,MAAMW,2BAA2B;AACjC,MAAMC,mBAAmB;AAEzB,MAAMC,uBAAuBP,cAAcL,oBAAoB;;;;;AAc/D,SAAgBmB,MAAM,EACpBJ,UAAU,WACVC,OAAO,MACPC,UAAU,OACVC,WAAW,OACXE,OACAC,SACAC,QACAC,oBACA,GAAGC,SACU;CACb,MAAM,EAAEC,UAAUrB,aAAa;CAC/B,MAAM,CAACsB,SAASC,cAAc1B,SAAS,KAAK;CAE5C,MAAM2B,QAAQrB,eAAe,IAAIK,uBAAuBiB;CACxD,MAAAC,UAAAC;CAAA;EAAA,MAAAA,SAAAD,QAAAE,YACmB;GAAEjB,SAASA,YAAY,SAAS,SAASkB;GAAWjB;EAAK,CAAC;EAC7E,OACE,oBAAC,OAAD;GACE,aAAa;GACb,YAAY;GACZ,sBAAsBS,MAAMS,OAAOC;GACnC,gBAAgBV,MAAMS,OAAOE;GAC7B,aAAaX,MAAMS,OAAOE;GAC1B,UAAU,CAAClB;GACX,oBAAoB;IAAE,GAAGK;IAAoBL;GAAS;GACtD,UAAUmB,UAAU;IAClBV,WAAW,IAAI;IACfN,UAAUgB,KAAK;GACjB;GACA,SAASA,UAAU;IACjBV,WAAW,KAAK;IAChBL,SAASe,KAAK;GAChB;GACA,OAAO;IACLN,OAAOO;IAGPZ,WAAWX,YAAY,aAAa,EAAEwB,aAAaxC,UAAU0B,MAAMS,OAAOE,OAAO1B,wBAAwB,EAAE;IAC3GO,WAAWc,OAAOd;IAClBC,YAAYa,OAAOb;IACnBE;GAAK;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S1D,iBAAiB;AACxC,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedControl.d.mts","names":[],"sources":["../../src/components/SegmentedControl.tsx"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"SegmentedControl.d.mts","names":[],"sources":["../../src/components/SegmentedControl.tsx"],"mappings":";;iBA6BiB;EACf;EACA;;iBAGe;;EAEf,kBAAkB;;EAElB;EACA,gBAAgB;EAChB;;EAEA;EACA,QAAQ,UAAU;;;;;;;;wBASJ,mBACd,SACA,OACA,eACA,UACA,oBACA,SACC,wCAAqB,IAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedControl.mjs","names":["RNSegmentedControl","StyleProp","ViewStyle","StyleSheet","withUnistyles","fontOf","selectionTick","ThemedSegmentedControl","theme","backgroundColor","colors","deep","tintColor","fontStyle","color","dim","fontFamily","sans","fontSize","base","fontWeight","medium","activeFontStyle","green","semibold","appearance","scheme","SegmentedControlOption","value","label","
|
|
1
|
+
{"version":3,"file":"SegmentedControl.mjs","names":["RNSegmentedControl","SegmentedControlProps","RNSegmentedControlProps","ComponentType","StyleProp","ViewStyle","StyleSheet","withUnistyles","fontOf","selectionTick","ThemedSegmentedControl","theme","backgroundColor","colors","deep","tintColor","fontStyle","color","dim","fontFamily","sans","fontSize","base","fontWeight","medium","activeFontStyle","green","semibold","appearance","scheme","SegmentedControlOption","value","label","options","onValueChange","disabled","accessibilityLabel","style","SegmentedControl","map","option","findIndex","event","next","nativeEvent","selectedSegmentIndex","undefined","styles","control","create","minHeight","borderRadius","md","uni__dependencies"],"sources":["../../src/components/SegmentedControl.tsx"],"sourcesContent":["import RNSegmentedControl, {\n type SegmentedControlProps as RNSegmentedControlProps,\n} from '@react-native-segmented-control/segmented-control';\nimport type { ComponentType } from 'react';\nimport type { StyleProp, ViewStyle } from 'react-native';\nimport { StyleSheet, withUnistyles } from 'react-native-unistyles';\n\nimport { fontOf } from '../lib/fonts';\nimport { selectionTick } from '../lib/haptics';\n\n/** Theme colours reach the third-party control through withUnistyles, so it follows theme changes. */\nconst ThemedSegmentedControl = withUnistyles(RNSegmentedControl as ComponentType<RNSegmentedControlProps>, (theme) => ({\n backgroundColor: theme.colors.deep,\n tintColor: theme.colors['tint-green'],\n fontStyle: {\n color: theme.colors.dim,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.base,\n fontWeight: theme.fontWeight.medium,\n },\n activeFontStyle: {\n color: theme.colors.green,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.base,\n fontWeight: theme.fontWeight.semibold,\n },\n appearance: theme.scheme,\n}));\n\nexport interface SegmentedControlOption {\n value: string;\n label: string;\n}\n\nexport interface SegmentedControlProps {\n /** The segments, in order. */\n options: readonly SegmentedControlOption[];\n /** The selected option's value. */\n value: string;\n onValueChange: (value: string) => void;\n disabled?: boolean;\n /** What the control is for, such as \"Status\". */\n accessibilityLabel?: string;\n style?: StyleProp<ViewStyle>;\n}\n\n/**\n * A short exclusive choice, such as a task's status: the platform's own\n * segmented control on iOS, the library's drawn fallback elsewhere, with a\n * selection tick on each change. It is the native stand-in for a web Select\n * with a handful of options.\n */\nexport function SegmentedControl({\n options,\n value,\n onValueChange,\n disabled = false,\n accessibilityLabel,\n style,\n}: SegmentedControlProps) {\n return (\n <ThemedSegmentedControl\n values={options.map((option) => option.label)}\n selectedIndex={options.findIndex((option) => option.value === value)}\n enabled={!disabled}\n accessibilityLabel={accessibilityLabel}\n accessibilityState={{ disabled }}\n onChange={(event) => {\n const next = options[event.nativeEvent.selectedSegmentIndex];\n if (next === undefined || next.value === value) return;\n selectionTick();\n onValueChange(next.value);\n }}\n style={[styles.control, style]}\n />\n );\n}\n\nconst styles = StyleSheet.create((theme) => ({\n control: { minHeight: 32, borderRadius: theme.borderRadius.md },\n}));\n"],"mappings":";;;;;;;;AAWA,MAAMU,yBAAyBH,cAAcP,qBAA+DW,WAAW;CACrHC,iBAAiBD,MAAME,OAAOC;CAC9BC,WAAWJ,MAAME,OAAO;CACxBG,WAAW;EACTC,OAAON,MAAME,OAAOK;EACpBC,YAAYX,OAAOG,MAAMQ,WAAWC,IAAI;EACxCC,UAAUV,MAAMU,SAASC;EACzBC,YAAYZ,MAAMY,WAAWC;CAC/B;CACAC,iBAAiB;EACfR,OAAON,MAAME,OAAOa;EACpBP,YAAYX,OAAOG,MAAMQ,WAAWC,IAAI;EACxCC,UAAUV,MAAMU,SAASC;EACzBC,YAAYZ,MAAMY,WAAWI;CAC/B;CACAC,YAAYjB,MAAMkB;AACpB,EAAE;;;;;;;AAyBF,SAAgBS,iBAAiB,EAC/BL,SACAF,OACAG,eACAC,WAAW,OACXC,oBACAC,SACwB;CACxB,OACE,oBAAC,wBAAD;EACE,QAAQJ,QAAQM,KAAKC,WAAWA,OAAOR,KAAK;EAC5C,eAAeC,QAAQQ,WAAWD,WAAWA,OAAOT,UAAUA,KAAK;EACnE,SAAS,CAACI;EACUC;EACpB,oBAAoB,EAAED,SAAS;EAC/B,WAAWO,UAAU;GACnB,MAAMC,OAAOV,QAAQS,MAAME,YAAYC;GACvC,IAAIF,SAASG,UAAaH,KAAKZ,UAAUA,OAAO;GAChDtB,cAAc;GACdyB,cAAcS,KAAKZ,KAAK;EAC1B;EACA,OAAO,CAACgB,OAAOC,SAASX,KAAK;CAAE;AAGrC;AAEA,MAAMU,SAASzC,WAAW2C,QAAQtC,WAAW,EAC3CqC,SAAS;CAAEE,WAAW;CAAIC,cAAcxC,MAAMwC,aAAaC;CAAEC,mBAAA,CAAA,CAAA;AAAC,EAChE,EAAE"}
|
|
@@ -8,7 +8,7 @@ import { BottomSheetBackdrop, BottomSheetModal, BottomSheetScrollView } from "@g
|
|
|
8
8
|
import { SafeAreaInsetsContext } from "react-native-safe-area-context";
|
|
9
9
|
|
|
10
10
|
//#region src/components/SheetFrame.tsx
|
|
11
|
-
/** `bg-
|
|
11
|
+
/** `bg-po-deep/70`, the overlay every web sheet and dialog draws. */
|
|
12
12
|
const BACKDROP_ALPHA_PERCENT = 70;
|
|
13
13
|
/**
|
|
14
14
|
* The bottom sheet both Sheet and DropdownMenu sit in: a drag handle, sized
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SheetFrame.mjs","names":["withAlpha","BottomSheetBackdrop","BottomSheetBackdropProps","BottomSheetModal","BottomSheetScrollView","ReactNode","useCallback","useContext","useEffect","useRef","BackHandler","SafeAreaInsetsContext","StyleSheet","useUnistyles","InsideSheetContext","BACKDROP_ALPHA_PERCENT","SheetFrameProps","open","onClose","children","SheetFrame","theme","insets","sheet","openRef","presented","current","present","dismiss","undefined","subscription","addEventListener","remove","backdropColor","colors","deep","renderBackdrop","props","style","backgroundColor","top","rail","borderRadius","lg","border","styles","content","paddingBottom","bottom","create","flexGrow"],"sources":["../../src/components/SheetFrame.tsx"],"sourcesContent":["import { withAlpha } from '@agimon-ai/po-web-components/nativeTheme';\nimport {\n BottomSheetBackdrop,\n type BottomSheetBackdropProps,\n BottomSheetModal,\n BottomSheetScrollView,\n} from '@gorhom/bottom-sheet';\nimport { type ReactNode, useCallback, useContext, useEffect, useRef } from 'react';\nimport { BackHandler } from 'react-native';\nimport { SafeAreaInsetsContext } from 'react-native-safe-area-context';\nimport { StyleSheet, useUnistyles } from 'react-native-unistyles';\n\nimport { InsideSheetContext } from '../lib/insideSheet';\n\n/** `bg-
|
|
1
|
+
{"version":3,"file":"SheetFrame.mjs","names":["withAlpha","BottomSheetBackdrop","BottomSheetBackdropProps","BottomSheetModal","BottomSheetScrollView","ReactNode","useCallback","useContext","useEffect","useRef","BackHandler","SafeAreaInsetsContext","StyleSheet","useUnistyles","InsideSheetContext","BACKDROP_ALPHA_PERCENT","SheetFrameProps","open","onClose","children","SheetFrame","theme","insets","sheet","openRef","presented","current","present","dismiss","undefined","subscription","addEventListener","remove","backdropColor","colors","deep","renderBackdrop","props","style","backgroundColor","top","rail","borderRadius","lg","border","styles","content","paddingBottom","bottom","create","flexGrow"],"sources":["../../src/components/SheetFrame.tsx"],"sourcesContent":["import { withAlpha } from '@agimon-ai/po-web-components/nativeTheme';\nimport {\n BottomSheetBackdrop,\n type BottomSheetBackdropProps,\n BottomSheetModal,\n BottomSheetScrollView,\n} from '@gorhom/bottom-sheet';\nimport { type ReactNode, useCallback, useContext, useEffect, useRef } from 'react';\nimport { BackHandler } from 'react-native';\nimport { SafeAreaInsetsContext } from 'react-native-safe-area-context';\nimport { StyleSheet, useUnistyles } from 'react-native-unistyles';\n\nimport { InsideSheetContext } from '../lib/insideSheet';\n\n/** `bg-po-deep/70`, the overlay every web sheet and dialog draws. */\nconst BACKDROP_ALPHA_PERCENT = 70;\n\nexport interface SheetFrameProps {\n open: boolean;\n /** The sheet asked to close: a drag down, a backdrop tap or Android back. */\n onClose: () => void;\n children?: ReactNode;\n}\n\n/**\n * The bottom sheet both Sheet and DropdownMenu sit in: a drag handle, sized\n * to its content, closed by dragging down, tapping the backdrop or Android\n * back, clear of the safe area and lifted by the keyboard. Private: the public\n * parts keep bottom-sheet types out of the package API.\n */\nexport function SheetFrame({ open, onClose, children }: SheetFrameProps) {\n const { theme } = useUnistyles();\n const insets = useContext(SafeAreaInsetsContext);\n const sheet = useRef<BottomSheetModal>(null);\n const openRef = useRef(open);\n const presented = useRef(false);\n\n useEffect(() => {\n openRef.current = open;\n if (open) {\n presented.current = true;\n sheet.current?.present();\n } else if (presented.current) {\n // Only a presented sheet is dismissed. Dismissing one that never opened leaves bottom-sheet's\n // modal stuck in its dismissing status, and the next present() then never draws.\n presented.current = false;\n sheet.current?.dismiss();\n }\n }, [open]);\n\n useEffect(() => {\n if (!open) return undefined;\n const subscription = BackHandler.addEventListener('hardwareBackPress', () => {\n onClose();\n return true;\n });\n return () => subscription.remove();\n }, [open, onClose]);\n\n const backdropColor = withAlpha(theme.colors.deep, BACKDROP_ALPHA_PERCENT);\n const renderBackdrop = useCallback(\n (props: BottomSheetBackdropProps) => (\n <BottomSheetBackdrop\n {...props}\n appearsOnIndex={0}\n disappearsOnIndex={-1}\n opacity={1}\n pressBehavior=\"close\"\n style={[props.style, { backgroundColor: backdropColor }]}\n />\n ),\n [backdropColor],\n );\n\n return (\n <BottomSheetModal\n ref={sheet}\n stackBehavior=\"push\"\n enablePanDownToClose\n topInset={insets?.top ?? 0}\n keyboardBehavior=\"interactive\"\n keyboardBlurBehavior=\"restore\"\n android_keyboardInputMode=\"adjustResize\"\n backdropComponent={renderBackdrop}\n backgroundStyle={{ backgroundColor: theme.colors.rail, borderRadius: theme.borderRadius.lg }}\n handleIndicatorStyle={{ backgroundColor: theme.colors.border }}\n // A sheet the caller closed is already shut; only a close the sheet started is reported.\n onDismiss={() => {\n // Already shut, so the close the parent answers with must not dismiss it a second time.\n presented.current = false;\n if (openRef.current) onClose();\n }}\n >\n <BottomSheetScrollView\n keyboardShouldPersistTaps=\"handled\"\n contentContainerStyle={[styles.content, { paddingBottom: insets?.bottom ?? 0 }]}\n >\n <InsideSheetContext.Provider value>{children}</InsideSheetContext.Provider>\n </BottomSheetScrollView>\n </BottomSheetModal>\n );\n}\n\nconst styles = StyleSheet.create({ content: { flexGrow: 1 } });\n"],"mappings":";;;;;;;;;;;AAeA,MAAMe,yBAAyB;;;;;;;AAe/B,SAAgBK,WAAW,EAAEH,MAAMC,SAASC,YAA6B;CACvE,MAAM,EAAEE,UAAUR,aAAa;CAC/B,MAAMS,SAASf,WAAWI,qBAAqB;CAC/C,MAAMY,QAAQd,OAAyB,IAAI;CAC3C,MAAMe,UAAUf,OAAOQ,IAAI;CAC3B,MAAMQ,YAAYhB,OAAO,KAAK;CAE9BD,gBAAgB;EACdgB,QAAQE,UAAUT;EAClB,IAAIA,MAAM;GACRQ,UAAUC,UAAU;GACpBH,MAAMG,SAASC,QAAQ;EACzB,OAAO,IAAIF,UAAUC,SAAS;GAG5BD,UAAUC,UAAU;GACpBH,MAAMG,SAASE,QAAQ;EACzB;CACF,GAAG,CAACX,IAAI,CAAC;CAETT,gBAAgB;EACd,IAAI,CAAC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
readonly material: "check";
|
|
12
12
|
};
|
|
13
13
|
readonly ChevronDown: {
|
|
14
|
-
readonly sf:
|
|
15
|
-
readonly material:
|
|
14
|
+
readonly sf: "chevron.down";
|
|
15
|
+
readonly material: "expand-more";
|
|
16
16
|
};
|
|
17
17
|
readonly ChevronRight: {
|
|
18
|
-
readonly sf:
|
|
19
|
-
readonly material:
|
|
18
|
+
readonly sf: "chevron.right";
|
|
19
|
+
readonly material: "chevron-right";
|
|
20
20
|
};
|
|
21
21
|
readonly Alert: {
|
|
22
|
-
readonly sf:
|
|
23
|
-
readonly material:
|
|
22
|
+
readonly sf: "exclamationmark.circle";
|
|
23
|
+
readonly material: "error-outline";
|
|
24
24
|
};
|
|
25
25
|
readonly Copy: {
|
|
26
|
-
readonly sf:
|
|
27
|
-
readonly material:
|
|
26
|
+
readonly sf: "doc.on.doc";
|
|
27
|
+
readonly material: "content-copy";
|
|
28
28
|
};
|
|
29
29
|
readonly Message: {
|
|
30
|
-
readonly sf:
|
|
31
|
-
readonly material:
|
|
30
|
+
readonly sf: "message";
|
|
31
|
+
readonly material: "chat-bubble-outline";
|
|
32
32
|
};
|
|
33
33
|
readonly Kebab: {
|
|
34
|
-
readonly sf:
|
|
35
|
-
readonly material:
|
|
34
|
+
readonly sf: "ellipsis";
|
|
35
|
+
readonly material: "more-vert";
|
|
36
36
|
};
|
|
37
37
|
readonly Edit: {
|
|
38
|
-
readonly sf:
|
|
39
|
-
readonly material:
|
|
38
|
+
readonly sf: "pencil";
|
|
39
|
+
readonly material: "edit";
|
|
40
40
|
};
|
|
41
41
|
readonly Gear: {
|
|
42
|
-
readonly sf:
|
|
43
|
-
readonly material:
|
|
42
|
+
readonly sf: "gearshape";
|
|
43
|
+
readonly material: "settings";
|
|
44
44
|
};
|
|
45
45
|
readonly Send: {
|
|
46
|
-
readonly sf:
|
|
47
|
-
readonly material:
|
|
46
|
+
readonly sf: "paperplane";
|
|
47
|
+
readonly material: "send";
|
|
48
48
|
};
|
|
49
49
|
readonly Task: {
|
|
50
|
-
readonly sf:
|
|
51
|
-
readonly material:
|
|
50
|
+
readonly sf: "checkmark.square";
|
|
51
|
+
readonly material: "check-box";
|
|
52
52
|
};
|
|
53
53
|
readonly Trash: {
|
|
54
|
-
readonly sf:
|
|
55
|
-
readonly material:
|
|
54
|
+
readonly sf: "trash";
|
|
55
|
+
readonly material: "delete-outline";
|
|
56
56
|
};
|
|
57
57
|
readonly Wrench: {
|
|
58
|
-
readonly sf:
|
|
59
|
-
readonly material:
|
|
58
|
+
readonly sf: "wrench.and.screwdriver";
|
|
59
|
+
readonly material: "build";
|
|
60
60
|
};
|
|
61
61
|
readonly Close: {
|
|
62
|
-
readonly sf:
|
|
63
|
-
readonly material:
|
|
62
|
+
readonly sf: "xmark";
|
|
63
|
+
readonly material: "close";
|
|
64
|
+
};
|
|
65
|
+
readonly File: {
|
|
66
|
+
readonly sf: "doc";
|
|
67
|
+
readonly material: "insert-drive-file";
|
|
68
|
+
};
|
|
69
|
+
readonly Search: {
|
|
70
|
+
readonly sf: "magnifyingglass";
|
|
71
|
+
readonly material: "search";
|
|
72
|
+
};
|
|
73
|
+
readonly Image: {
|
|
74
|
+
readonly sf: "photo";
|
|
75
|
+
readonly material: "image";
|
|
76
|
+
};
|
|
77
|
+
readonly Sliders: {
|
|
78
|
+
readonly sf: "slider.horizontal.3";
|
|
79
|
+
readonly material: "tune";
|
|
64
80
|
};
|
|
65
81
|
readonly Folder: {
|
|
66
|
-
readonly sf:
|
|
67
|
-
readonly material:
|
|
82
|
+
readonly sf: "folder";
|
|
83
|
+
readonly material: "folder";
|
|
68
84
|
};
|
|
69
85
|
readonly Branch: {
|
|
70
|
-
readonly sf:
|
|
71
|
-
readonly material:
|
|
86
|
+
readonly sf: "arrow.triangle.branch";
|
|
87
|
+
readonly material: "call-split";
|
|
88
|
+
};
|
|
89
|
+
readonly Fork: {
|
|
90
|
+
readonly sf: "arrow.triangle.branch";
|
|
91
|
+
readonly material: "fork-right";
|
|
72
92
|
};
|
|
73
93
|
readonly Home: {
|
|
74
|
-
readonly sf:
|
|
75
|
-
readonly material:
|
|
94
|
+
readonly sf: "house";
|
|
95
|
+
readonly material: "home";
|
|
76
96
|
};
|
|
77
97
|
readonly Activity: {
|
|
78
|
-
readonly sf:
|
|
79
|
-
readonly material:
|
|
98
|
+
readonly sf: "waveform.path.ecg";
|
|
99
|
+
readonly material: "monitor-heart";
|
|
80
100
|
};
|
|
81
101
|
readonly ArrowRight: {
|
|
82
|
-
readonly sf:
|
|
83
|
-
readonly material:
|
|
102
|
+
readonly sf: "arrow.right";
|
|
103
|
+
readonly material: "arrow-forward";
|
|
84
104
|
};
|
|
85
105
|
readonly Plus: {
|
|
86
|
-
readonly sf:
|
|
87
|
-
readonly material:
|
|
106
|
+
readonly sf: "plus";
|
|
107
|
+
readonly material: "add";
|
|
88
108
|
};
|
|
89
109
|
readonly Users: {
|
|
90
|
-
readonly sf:
|
|
91
|
-
readonly material:
|
|
110
|
+
readonly sf: "person.2";
|
|
111
|
+
readonly material: "group";
|
|
92
112
|
};
|
|
93
113
|
readonly PlayCircle: {
|
|
94
|
-
readonly sf:
|
|
95
|
-
readonly material:
|
|
114
|
+
readonly sf: "play.circle";
|
|
115
|
+
readonly material: "play-circle-outline";
|
|
96
116
|
};
|
|
97
117
|
readonly Workflow: {
|
|
98
|
-
readonly sf:
|
|
99
|
-
readonly material:
|
|
118
|
+
readonly sf: "flowchart";
|
|
119
|
+
readonly material: "account-tree";
|
|
100
120
|
};
|
|
101
121
|
readonly Palette: {
|
|
102
|
-
readonly sf:
|
|
103
|
-
readonly material:
|
|
122
|
+
readonly sf: "paintpalette";
|
|
123
|
+
readonly material: "palette";
|
|
104
124
|
};
|
|
105
125
|
readonly Lightbulb: {
|
|
106
|
-
readonly sf:
|
|
107
|
-
readonly material:
|
|
126
|
+
readonly sf: "lightbulb";
|
|
127
|
+
readonly material: "lightbulb-outline";
|
|
108
128
|
};
|
|
109
129
|
readonly Sparkles: {
|
|
110
|
-
readonly sf:
|
|
111
|
-
readonly material:
|
|
130
|
+
readonly sf: "sparkles";
|
|
131
|
+
readonly material: "auto-awesome";
|
|
112
132
|
};
|
|
113
133
|
readonly Lock: {
|
|
114
|
-
readonly sf:
|
|
115
|
-
readonly material:
|
|
134
|
+
readonly sf: "lock";
|
|
135
|
+
readonly material: "lock-outline";
|
|
116
136
|
};
|
|
117
137
|
};
|
|
118
138
|
export type IconName = keyof typeof ICON_GLYPHS;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iconGlyphs.d.mts","names":[],"sources":["../../src/icons/iconGlyphs.ts"],"mappings":";;;;;;;qBAMa
|
|
1
|
+
{"version":3,"file":"iconGlyphs.d.mts","names":[],"sources":["../../src/icons/iconGlyphs.ts"],"mappings":";;;;;;;qBAMa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAqCD,wBAAwB"}
|
|
@@ -62,6 +62,22 @@ const ICON_GLYPHS = {
|
|
|
62
62
|
sf: "xmark",
|
|
63
63
|
material: "close"
|
|
64
64
|
},
|
|
65
|
+
File: {
|
|
66
|
+
sf: "doc",
|
|
67
|
+
material: "insert-drive-file"
|
|
68
|
+
},
|
|
69
|
+
Search: {
|
|
70
|
+
sf: "magnifyingglass",
|
|
71
|
+
material: "search"
|
|
72
|
+
},
|
|
73
|
+
Image: {
|
|
74
|
+
sf: "photo",
|
|
75
|
+
material: "image"
|
|
76
|
+
},
|
|
77
|
+
Sliders: {
|
|
78
|
+
sf: "slider.horizontal.3",
|
|
79
|
+
material: "tune"
|
|
80
|
+
},
|
|
65
81
|
Folder: {
|
|
66
82
|
sf: "folder",
|
|
67
83
|
material: "folder"
|
|
@@ -70,6 +86,10 @@ const ICON_GLYPHS = {
|
|
|
70
86
|
sf: "arrow.triangle.branch",
|
|
71
87
|
material: "call-split"
|
|
72
88
|
},
|
|
89
|
+
Fork: {
|
|
90
|
+
sf: "arrow.triangle.branch",
|
|
91
|
+
material: "fork-right"
|
|
92
|
+
},
|
|
73
93
|
Home: {
|
|
74
94
|
sf: "house",
|
|
75
95
|
material: "home"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iconGlyphs.mjs","names":[],"sources":["../../src/icons/iconGlyphs.ts"],"sourcesContent":["/**\n * The curated native icon set: the same names the web library re-exports from\n * lucide, each drawn with the platform's own family. iOS gets an SF Symbol,\n * Android and web get a Material Icons glyph. Kept free of React Native so a\n * unit test can check every glyph against the installed glyph map.\n */\nexport const ICON_GLYPHS = {\n Check: { sf: 'checkmark', material: 'check' },\n ChevronDown: { sf: 'chevron.down', material: 'expand-more' },\n ChevronRight: { sf: 'chevron.right', material: 'chevron-right' },\n Alert: { sf: 'exclamationmark.circle', material: 'error-outline' },\n Copy: { sf: 'doc.on.doc', material: 'content-copy' },\n Message: { sf: 'message', material: 'chat-bubble-outline' },\n // Each platform's own overflow mark: a horizontal ellipsis on iOS, vertical dots on Android.\n Kebab: { sf: 'ellipsis', material: 'more-vert' },\n Edit: { sf: 'pencil', material: 'edit' },\n Gear: { sf: 'gearshape', material: 'settings' },\n Send: { sf: 'paperplane', material: 'send' },\n Task: { sf: 'checkmark.square', material: 'check-box' },\n Trash: { sf: 'trash', material: 'delete-outline' },\n Wrench: { sf: 'wrench.and.screwdriver', material: 'build' },\n Close: { sf: 'xmark', material: 'close' },\n Folder: { sf: 'folder', material: 'folder' },\n Branch: { sf: 'arrow.triangle.branch', material: 'call-split' },\n Home: { sf: 'house', material: 'home' },\n Activity: { sf: 'waveform.path.ecg', material: 'monitor-heart' },\n ArrowRight: { sf: 'arrow.right', material: 'arrow-forward' },\n Plus: { sf: 'plus', material: 'add' },\n Users: { sf: 'person.2', material: 'group' },\n PlayCircle: { sf: 'play.circle', material: 'play-circle-outline' },\n Workflow: { sf: 'flowchart', material: 'account-tree' },\n Palette: { sf: 'paintpalette', material: 'palette' },\n Lightbulb: { sf: 'lightbulb', material: 'lightbulb-outline' },\n Sparkles: { sf: 'sparkles', material: 'auto-awesome' },\n Lock: { sf: 'lock', material: 'lock-outline' },\n} as const;\n\nexport type IconName = keyof typeof ICON_GLYPHS;\n"],"mappings":";;;;;;;AAMA,MAAa,cAAc;CACzB,OAAO;EAAE,IAAI;EAAa,UAAU;CAAQ;CAC5C,aAAa;EAAE,IAAI;EAAgB,UAAU;CAAc;CAC3D,cAAc;EAAE,IAAI;EAAiB,UAAU;CAAgB;CAC/D,OAAO;EAAE,IAAI;EAA0B,UAAU;CAAgB;CACjE,MAAM;EAAE,IAAI;EAAc,UAAU;CAAe;CACnD,SAAS;EAAE,IAAI;EAAW,UAAU;CAAsB;CAE1D,OAAO;EAAE,IAAI;EAAY,UAAU;CAAY;CAC/C,MAAM;EAAE,IAAI;EAAU,UAAU;CAAO;CACvC,MAAM;EAAE,IAAI;EAAa,UAAU;CAAW;CAC9C,MAAM;EAAE,IAAI;EAAc,UAAU;CAAO;CAC3C,MAAM;EAAE,IAAI;EAAoB,UAAU;CAAY;CACtD,OAAO;EAAE,IAAI;EAAS,UAAU;CAAiB;CACjD,QAAQ;EAAE,IAAI;EAA0B,UAAU;CAAQ;CAC1D,OAAO;EAAE,IAAI;EAAS,UAAU;CAAQ;CACxC,QAAQ;EAAE,IAAI;EAAU,UAAU;CAAS;CAC3C,QAAQ;EAAE,IAAI;EAAyB,UAAU;CAAa;
|
|
1
|
+
{"version":3,"file":"iconGlyphs.mjs","names":[],"sources":["../../src/icons/iconGlyphs.ts"],"sourcesContent":["/**\n * The curated native icon set: the same names the web library re-exports from\n * lucide, each drawn with the platform's own family. iOS gets an SF Symbol,\n * Android and web get a Material Icons glyph. Kept free of React Native so a\n * unit test can check every glyph against the installed glyph map.\n */\nexport const ICON_GLYPHS = {\n Check: { sf: 'checkmark', material: 'check' },\n ChevronDown: { sf: 'chevron.down', material: 'expand-more' },\n ChevronRight: { sf: 'chevron.right', material: 'chevron-right' },\n Alert: { sf: 'exclamationmark.circle', material: 'error-outline' },\n Copy: { sf: 'doc.on.doc', material: 'content-copy' },\n Message: { sf: 'message', material: 'chat-bubble-outline' },\n // Each platform's own overflow mark: a horizontal ellipsis on iOS, vertical dots on Android.\n Kebab: { sf: 'ellipsis', material: 'more-vert' },\n Edit: { sf: 'pencil', material: 'edit' },\n Gear: { sf: 'gearshape', material: 'settings' },\n Send: { sf: 'paperplane', material: 'send' },\n Task: { sf: 'checkmark.square', material: 'check-box' },\n Trash: { sf: 'trash', material: 'delete-outline' },\n Wrench: { sf: 'wrench.and.screwdriver', material: 'build' },\n Close: { sf: 'xmark', material: 'close' },\n File: { sf: 'doc', material: 'insert-drive-file' },\n Search: { sf: 'magnifyingglass', material: 'search' },\n Image: { sf: 'photo', material: 'image' },\n Sliders: { sf: 'slider.horizontal.3', material: 'tune' },\n Folder: { sf: 'folder', material: 'folder' },\n Branch: { sf: 'arrow.triangle.branch', material: 'call-split' },\n // ponytail: SF Symbols has no fork distinct from a branch, so iOS draws Fork as Branch. Swap in a custom symbol if the two must differ there.\n Fork: { sf: 'arrow.triangle.branch', material: 'fork-right' },\n Home: { sf: 'house', material: 'home' },\n Activity: { sf: 'waveform.path.ecg', material: 'monitor-heart' },\n ArrowRight: { sf: 'arrow.right', material: 'arrow-forward' },\n Plus: { sf: 'plus', material: 'add' },\n Users: { sf: 'person.2', material: 'group' },\n PlayCircle: { sf: 'play.circle', material: 'play-circle-outline' },\n Workflow: { sf: 'flowchart', material: 'account-tree' },\n Palette: { sf: 'paintpalette', material: 'palette' },\n Lightbulb: { sf: 'lightbulb', material: 'lightbulb-outline' },\n Sparkles: { sf: 'sparkles', material: 'auto-awesome' },\n Lock: { sf: 'lock', material: 'lock-outline' },\n} as const;\n\nexport type IconName = keyof typeof ICON_GLYPHS;\n"],"mappings":";;;;;;;AAMA,MAAa,cAAc;CACzB,OAAO;EAAE,IAAI;EAAa,UAAU;CAAQ;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nD,WAAW;EAAE,IAAI;EAAa,UAAU;CAAoB;CAC5D,UAAU;EAAE,IAAI;EAAY,UAAU;CAAe;CACrD,MAAM;EAAE,IAAI;EAAQ,UAAU;CAAe;AAC/C"}
|
package/dist/icons/icons.d.mts
CHANGED
|
@@ -74,6 +74,10 @@ export declare const BranchIcon: {
|
|
|
74
74
|
({ size, color, accessibilityLabel, style }: IconProps): import("react").JSX.Element;
|
|
75
75
|
displayName: string;
|
|
76
76
|
};
|
|
77
|
+
export declare const ForkIcon: {
|
|
78
|
+
({ size, color, accessibilityLabel, style }: IconProps): import("react").JSX.Element;
|
|
79
|
+
displayName: string;
|
|
80
|
+
};
|
|
77
81
|
export declare const HomeIcon: {
|
|
78
82
|
({ size, color, accessibilityLabel, style }: IconProps): import("react").JSX.Element;
|
|
79
83
|
displayName: string;
|
|
@@ -118,5 +122,21 @@ export declare const LockIcon: {
|
|
|
118
122
|
({ size, color, accessibilityLabel, style }: IconProps): import("react").JSX.Element;
|
|
119
123
|
displayName: string;
|
|
120
124
|
};
|
|
125
|
+
export declare const FileIcon: {
|
|
126
|
+
({ size, color, accessibilityLabel, style }: IconProps): import("react").JSX.Element;
|
|
127
|
+
displayName: string;
|
|
128
|
+
};
|
|
129
|
+
export declare const SearchIcon: {
|
|
130
|
+
({ size, color, accessibilityLabel, style }: IconProps): import("react").JSX.Element;
|
|
131
|
+
displayName: string;
|
|
132
|
+
};
|
|
133
|
+
export declare const ImageIcon: {
|
|
134
|
+
({ size, color, accessibilityLabel, style }: IconProps): import("react").JSX.Element;
|
|
135
|
+
displayName: string;
|
|
136
|
+
};
|
|
137
|
+
export declare const SlidersIcon: {
|
|
138
|
+
({ size, color, accessibilityLabel, style }: IconProps): import("react").JSX.Element;
|
|
139
|
+
displayName: string;
|
|
140
|
+
};
|
|
121
141
|
//#endregion
|
|
122
142
|
//# sourceMappingURL=icons.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icons.d.mts","names":[],"sources":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s
CHANGED
|
@@ -62,6 +62,7 @@ const WrenchIcon = createIcon("Wrench");
|
|
|
62
62
|
const CloseIcon = createIcon("Close");
|
|
63
63
|
const FolderIcon = createIcon("Folder");
|
|
64
64
|
const BranchIcon = createIcon("Branch");
|
|
65
|
+
const ForkIcon = createIcon("Fork");
|
|
65
66
|
const HomeIcon = createIcon("Home");
|
|
66
67
|
const ActivityIcon = createIcon("Activity");
|
|
67
68
|
const ArrowRightIcon = createIcon("ArrowRight");
|
|
@@ -73,7 +74,11 @@ const PaletteIcon = createIcon("Palette");
|
|
|
73
74
|
const LightbulbIcon = createIcon("Lightbulb");
|
|
74
75
|
const SparklesIcon = createIcon("Sparkles");
|
|
75
76
|
const LockIcon = createIcon("Lock");
|
|
77
|
+
const FileIcon = createIcon("File");
|
|
78
|
+
const SearchIcon = createIcon("Search");
|
|
79
|
+
const ImageIcon = createIcon("Image");
|
|
80
|
+
const SlidersIcon = createIcon("Sliders");
|
|
76
81
|
|
|
77
82
|
//#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 };
|
|
83
|
+
export { ActivityIcon, AlertIcon, ArrowRightIcon, BranchIcon, CheckIcon, ChevronDownIcon, ChevronRightIcon, CloseIcon, CopyIcon, EditIcon, FileIcon, FolderIcon, ForkIcon, GearIcon, HomeIcon, ImageIcon, KebabIcon, LightbulbIcon, LockIcon, MessageIcon, PaletteIcon, PlayCircleIcon, PlusIcon, SearchIcon, SendIcon, SlidersIcon, SparklesIcon, TaskIcon, TrashIcon, UsersIcon, WorkflowIcon, WrenchIcon };
|
|
79
84
|
//# sourceMappingURL=icons.mjs.map
|
package/dist/icons/icons.mjs.map
CHANGED
|
@@ -1 +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,EA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,MAAM;AACzC,MAAasC,
|
|
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","ForkIcon","HomeIcon","ActivityIcon","ArrowRightIcon","PlusIcon","UsersIcon","PlayCircleIcon","WorkflowIcon","PaletteIcon","LightbulbIcon","SparklesIcon","LockIcon","FileIcon","SearchIcon","ImageIcon","SlidersIcon"],"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 ForkIcon = createIcon('Fork');\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\nexport const FileIcon = createIcon('File');\nexport const SearchIcon = createIcon('Search');\nexport const ImageIcon = createIcon('Image');\nexport const SlidersIcon = createIcon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WAAW,QAAQ;AAC7C,MAAakC,YAAYlC,WAAW,OAAO;AAC3C,MAAamC,aAAanC,WAAW,QAAQ;AAC7C,MAAaoC,aAAapC,WAAW,QAAQ;AAC7C,MAAaqC,WAAWrC,WAAW,MAAM;AACzC,MAAasC,WAAWtC,WAAW,MAAM;AACzC,MAAauC,eAAevC,WAAW,UAAU;AACjD,MAAawC,iBAAiBxC,WAAW,YAAY;AACrD,MAAayC,WAAWzC,WAAW,MAAM;AACzC,MAAa0C,YAAY1C,WAAW,OAAO;AAC3C,MAAa2C,iBAAiB3C,WAAW,YAAY;AACrD,MAAa4C,eAAe5C,WAAW,UAAU;AACjD,MAAa6C,cAAc7C,WAAW,SAAS;AAC/C,MAAa8C,gBAAgB9C,WAAW,WAAW;AACnD,MAAa+C,eAAe/C,WAAW,UAAU;AACjD,MAAagD,WAAWhD,WAAW,MAAM;AAEzC,MAAaiD,WAAWjD,WAAW,MAAM;AACzC,MAAakD,aAAalD,WAAW,QAAQ;AAC7C,MAAamD,YAAYnD,WAAW,OAAO;AAC3C,MAAaoD,cAAcpD,WAAW,SAAS"}
|
package/dist/index.d.mts
CHANGED
|
@@ -19,10 +19,10 @@ import { Sheet, SheetBody, SheetClose, SheetContent, SheetContentProps, SheetDes
|
|
|
19
19
|
import { Spinner, SpinnerProps } from "./components/Spinner.mjs";
|
|
20
20
|
import { TabBadge, TabBadgeProps, Tabs, TabsContent, TabsContentProps, TabsList, TabsListProps, TabsProps, TabsTrigger, TabsTriggerProps } from "./components/Tabs.mjs";
|
|
21
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";
|
|
22
|
+
import { ActivityIcon, AlertIcon, ArrowRightIcon, BranchIcon, CheckIcon, ChevronDownIcon, ChevronRightIcon, CloseIcon, CopyIcon, EditIcon, FileIcon, FolderIcon, ForkIcon, GearIcon, HomeIcon, IconProps, ImageIcon, KebabIcon, LightbulbIcon, LockIcon, MessageIcon, PaletteIcon, PlayCircleIcon, PlusIcon, SearchIcon, SendIcon, SlidersIcon, SparklesIcon, TaskIcon, TrashIcon, UsersIcon, WorkflowIcon, WrenchIcon } from "./icons/icons.mjs";
|
|
23
23
|
import { IconName } from "./icons/iconGlyphs.mjs";
|
|
24
24
|
import { fontOf } from "./lib/fonts.mjs";
|
|
25
25
|
import { IconColorContext } from "./icons/IconColorContext.mjs";
|
|
26
26
|
import { impactLight, selectionTick } from "./lib/haptics.mjs";
|
|
27
27
|
import { AnsiSpan, ReviewComment, ansiSpans, buildReviewPrompt } from "@agimon-ai/po-web-components/text";
|
|
28
|
-
export { ActivityIcon, AlertIcon, type AnsiSpan, 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, type ReviewComment, 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, ansiSpans, buildReviewPrompt, fontOf, impactLight, selectionTick, toolTone, useMessageItem };
|
|
28
|
+
export { ActivityIcon, AlertIcon, type AnsiSpan, 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, FileIcon, type FileLinkHandler, FolderIcon, ForkIcon, GearIcon, HomeIcon, IconColorContext, type IconName, type IconProps, ImageIcon, 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, type ReviewComment, STATUS_EDGE, STATUS_GLYPH, STATUS_LABEL, SearchIcon, SectionLabel, SegmentedControl, type SegmentedControlOption, type SegmentedControlProps, SendIcon, Sheet, SheetBody, SheetClose, SheetContent, type SheetContentProps, SheetDescription, SheetFooter, SheetHeader, type SheetHeaderProps, type SheetPartProps, type SheetProps, SheetTitle, SheetTrigger, SlidersIcon, 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, ansiSpans, buildReviewPrompt, fontOf, impactLight, selectionTick, toolTone, useMessageItem };
|
package/dist/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { IconColorContext } from "./icons/IconColorContext.mjs";
|
|
|
4
4
|
import { impactLight, selectionTick } from "./lib/haptics.mjs";
|
|
5
5
|
import { Spinner } from "./components/Spinner.mjs";
|
|
6
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";
|
|
7
|
+
import { ActivityIcon, AlertIcon, ArrowRightIcon, BranchIcon, CheckIcon, ChevronDownIcon, ChevronRightIcon, CloseIcon, CopyIcon, EditIcon, FileIcon, FolderIcon, ForkIcon, GearIcon, HomeIcon, ImageIcon, KebabIcon, LightbulbIcon, LockIcon, MessageIcon, PaletteIcon, PlayCircleIcon, PlusIcon, SearchIcon, SendIcon, SlidersIcon, SparklesIcon, TaskIcon, TrashIcon, UsersIcon, WorkflowIcon, WrenchIcon } from "./icons/icons.mjs";
|
|
8
8
|
import { CodeBlock } from "./components/CodeBlock.mjs";
|
|
9
9
|
import { Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "./components/Dialog.mjs";
|
|
10
10
|
import { Dot } from "./components/Dot.mjs";
|
|
@@ -25,4 +25,4 @@ import { TabBadge, Tabs, TabsContent, TabsList, TabsTrigger } from "./components
|
|
|
25
25
|
import { Textarea } from "./components/Textarea.mjs";
|
|
26
26
|
import { ansiSpans, buildReviewPrompt } from "@agimon-ai/po-web-components/text";
|
|
27
27
|
|
|
28
|
-
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, ansiSpans, buildReviewPrompt, fontOf, impactLight, selectionTick, toolTone, useMessageItem };
|
|
28
|
+
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, FileIcon, FolderIcon, ForkIcon, GearIcon, HomeIcon, IconColorContext, ImageIcon, 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, SearchIcon, SectionLabel, SegmentedControl, SendIcon, Sheet, SheetBody, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, SlidersIcon, SparklesIcon, Spinner, StatusBadge, TabBadge, Tabs, TabsContent, TabsList, TabsTrigger, TaskIcon, Textarea, TrashIcon, UsersIcon, WorkflowIcon, WrenchIcon, ansiSpans, buildReviewPrompt, fontOf, impactLight, selectionTick, toolTone, useMessageItem };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agimon-ai/po-native-components",
|
|
3
|
-
"version": "0.0.0-alpha.
|
|
4
|
-
"description": "Shared React Native components for Po and its native plugins: the web component library's look and API on native parts, tuned to the
|
|
3
|
+
"version": "0.0.0-alpha.21",
|
|
4
|
+
"description": "Shared React Native components for Po and its native plugins: the web component library's look and API on native parts, tuned to the Po palette.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
7
7
|
"coding-agent",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"bugs": {
|
|
20
20
|
"url": "https://github.com/AgiFlow/po/issues"
|
|
21
21
|
},
|
|
22
|
-
"license": "
|
|
22
|
+
"license": "BUSL-1.1",
|
|
23
23
|
"author": "Vuong Ngo",
|
|
24
24
|
"repository": {
|
|
25
25
|
"type": "git",
|
|
@@ -45,18 +45,18 @@
|
|
|
45
45
|
"access": "public"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@agimon-ai/po-web-components": "0.0.0-alpha.
|
|
48
|
+
"@agimon-ai/po-web-components": "0.0.0-alpha.21"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@agimon-ai/po-build": "0.0.0-alpha.
|
|
52
|
-
"@agimon-ai/vibe-lint-plugin-
|
|
51
|
+
"@agimon-ai/po-build": "0.0.0-alpha.21",
|
|
52
|
+
"@agimon-ai/vibe-lint-plugin-po-web": "0.0.0-alpha.21",
|
|
53
53
|
"@babel/core": "7.29.7",
|
|
54
54
|
"@expo/vector-icons": "15.1.1",
|
|
55
55
|
"@gorhom/bottom-sheet": "5.2.14",
|
|
56
56
|
"@react-native-segmented-control/segmented-control": "2.5.7",
|
|
57
57
|
"@shopify/flash-list": "2.0.2",
|
|
58
|
-
"@types/node": "26.6.
|
|
59
|
-
"@types/react": "19.
|
|
58
|
+
"@types/node": "26.6.5",
|
|
59
|
+
"@types/react": "~19.2.4",
|
|
60
60
|
"expo": "57.0.27",
|
|
61
61
|
"expo-clipboard": "~57.0.2",
|
|
62
62
|
"expo-font": "~57.0.4",
|
|
@@ -66,14 +66,14 @@
|
|
|
66
66
|
"react": "19.2.3",
|
|
67
67
|
"react-dom": "19.2.3",
|
|
68
68
|
"react-native": "0.86.3",
|
|
69
|
-
"react-native-gesture-handler": "~
|
|
69
|
+
"react-native-gesture-handler": "~2.32.0",
|
|
70
70
|
"react-native-reanimated": "4.5.1",
|
|
71
71
|
"react-native-safe-area-context": "~5.7.0",
|
|
72
|
-
"react-native-unistyles": "3.5.
|
|
72
|
+
"react-native-unistyles": "3.5.3",
|
|
73
73
|
"react-native-worklets": "0.10.1",
|
|
74
|
-
"tsdown": "0.23.
|
|
75
|
-
"typescript": "
|
|
76
|
-
"vitest": "5.0.
|
|
74
|
+
"tsdown": "0.23.1",
|
|
75
|
+
"typescript": "~6.0.3",
|
|
76
|
+
"vitest": "5.0.4"
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|
|
79
79
|
"@expo/vector-icons": "^15.0.0",
|