@terreno/ui 0.30.0 → 0.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,203 +1,21 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
4
-
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
- 1. Definitions.
8
-
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
25
-
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
29
-
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
34
-
35
- "Work" shall mean the work of authorship, whether in Source or
36
- Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work
38
- (an example is provided in the Appendix below).
39
-
40
- "Derivative Works" shall mean any work, whether in Source or Object
41
- form, that is based on (or derived from) the Work and for which the
42
- editorial revisions, annotations, elaborations, or other modifications
43
- represent, as a whole, an original work of authorship. For the purposes
44
- of this License, Derivative Works shall not include works that remain
45
- separable from, or merely link (or bind by name) to the interfaces of,
46
- the Work and Derivative Works thereof.
47
-
48
- "Contribution" shall mean any work of authorship, including
49
- the original version of the Work and any modifications or additions
50
- to that Work or Derivative Works thereof, that is intentionally
51
- submitted to Licensor for inclusion in the Work by the copyright owner
52
- or by an individual or Legal Entity authorized to submit on behalf of
53
- the copyright owner. For the purposes of this definition, "submitted"
54
- means any form of electronic, verbal, or written communication sent
55
- to the Licensor or its representatives, including but not limited to
56
- communication on electronic mailing lists, source code control systems,
57
- and issue tracking systems that are managed by, or on behalf of, the
58
- Licensor for the purpose of discussing and improving the Work, but
59
- excluding communication that is conspicuously marked or otherwise
60
- designated in writing by the copyright owner as "Not a Contribution."
61
-
62
- "Contributor" shall mean Licensor and any individual or Legal Entity
63
- on behalf of whom a Contribution has been received by Licensor and
64
- subsequently incorporated within the Work.
65
-
66
- 2. Grant of Copyright License. Subject to the terms and conditions of
67
- this License, each Contributor hereby grants to You a perpetual,
68
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
- copyright license to reproduce, prepare Derivative Works of,
70
- publicly display, publicly perform, sublicense, and distribute the
71
- Work and such Derivative Works in Source or Object form.
72
-
73
- 3. Grant of Patent License. Subject to the terms and conditions of
74
- this License, each Contributor hereby grants to You a perpetual,
75
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
- (except as stated in this section) patent license to make, have made,
77
- use, offer to sell, sell, import, and otherwise transfer the Work,
78
- where such license applies only to those patent claims licensable
79
- by such Contributor that are necessarily infringed by their
80
- Contribution(s) alone or by combination of their Contribution(s)
81
- with the Work to which such Contribution(s) was submitted. If You
82
- institute patent litigation against any entity (including a
83
- cross-claim or counterclaim in a lawsuit) alleging that the Work
84
- or a Contribution incorporated within the Work constitutes direct
85
- or contributory patent infringement, then any patent licenses
86
- granted to You under this License for that Work shall terminate
87
- as of the date such litigation is filed.
88
-
89
- 4. Redistribution. You may reproduce and distribute copies of the
90
- Work or Derivative Works thereof in any medium, with or without
91
- modifications, and in Source or Object form, provided that You
92
- meet the following conditions:
93
-
94
- (a) You must give any other recipients of the Work or
95
- Derivative Works a copy of this License; and
96
-
97
- (b) You must cause any modified files to carry prominent notices
98
- stating that You changed the files; and
99
-
100
- (c) You must retain, in the Source form of any Derivative Works
101
- that You distribute, all copyright, patent, trademark, and
102
- attribution notices from the Source form of the Work,
103
- excluding those notices that do not pertain to any part of
104
- the Derivative Works; and
105
-
106
- (d) If the Work includes a "NOTICE" text file as part of its
107
- distribution, then any Derivative Works that You distribute must
108
- include a readable copy of the attribution notices contained
109
- within such NOTICE file, excluding those notices that do not
110
- pertain to any part of the Derivative Works, in at least one
111
- of the following places: within a NOTICE text file distributed
112
- as part of the Derivative Works; within the Source form or
113
- documentation, if provided along with the Derivative Works; or,
114
- within a display generated by the Derivative Works, if and
115
- wherever such third-party notices normally appear. The contents
116
- of the NOTICE file are for informational purposes only and
117
- do not modify the License. You may add Your own attribution
118
- notices within Derivative Works that You distribute, alongside
119
- or as an addendum to the NOTICE text from the Work, provided
120
- that such additional attribution notices cannot be construed
121
- as modifying the License.
122
-
123
- You may add Your own copyright statement to Your modifications and
124
- may provide additional or different license terms and conditions
125
- for use, reproduction, or distribution of Your modifications, or
126
- for any such Derivative Works as a whole, provided Your use,
127
- reproduction, and distribution of the Work otherwise complies with
128
- the conditions stated in this License.
129
-
130
- 5. Submission of Contributions. Unless You explicitly state otherwise,
131
- any Contribution intentionally submitted for inclusion in the Work
132
- by You to the Licensor shall be under the terms and conditions of
133
- this License, without any additional terms or conditions.
134
- Notwithstanding the above, nothing herein shall supersede or modify
135
- the terms of any separate license agreement you may have executed
136
- with Licensor regarding such Contributions.
137
-
138
- 6. Trademarks. This License does not grant permission to use the trade
139
- names, trademarks, service marks, or product names of the Licensor,
140
- except as required for reasonable and customary use in describing the
141
- origin of the Work and reproducing the content of the NOTICE file.
142
-
143
- 7. Disclaimer of Warranty. Unless required by applicable law or
144
- agreed to in writing, Licensor provides the Work (and each
145
- Contributor provides its Contributions) on an "AS IS" BASIS,
146
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
- implied, including, without limitation, any warranties or conditions
148
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
- PARTICULAR PURPOSE. You are solely responsible for determining the
150
- appropriateness of using or redistributing the Work and assume any
151
- risks associated with Your exercise of permissions under this License.
152
-
153
- 8. Limitation of Liability. In no event and under no legal theory,
154
- whether in tort (including negligence), contract, or otherwise,
155
- unless required by applicable law (such as deliberate and grossly
156
- negligent acts) or agreed to in writing, shall any Contributor be
157
- liable to You for damages, including any direct, indirect, special,
158
- incidental, or consequential damages of any character arising as a
159
- result of this License or out of the use or inability to use the
160
- Work (including but not limited to damages for loss of goodwill,
161
- work stoppage, computer failure or malfunction, or any and all
162
- other commercial damages or losses), even if such Contributor
163
- has been advised of the possibility of such damages.
164
-
165
- 9. Accepting Warranty or Additional Liability. While redistributing
166
- the Work or Derivative Works thereof, You may choose to offer,
167
- and charge a fee for, acceptance of support, warranty, indemnity,
168
- or other liability obligations and/or rights consistent with this
169
- License. However, in accepting such obligations, You may act only
170
- on Your own behalf and on Your sole responsibility, not on behalf
171
- of any other Contributor, and only if You agree to indemnify,
172
- defend, and hold each Contributor harmless for any liability
173
- incurred by, or claims asserted against, such Contributor by reason
174
- of your accepting any such warranty or additional liability.
175
-
176
- END OF TERMS AND CONDITIONS
177
-
178
- APPENDIX: How to apply the Apache License to your work.
179
-
180
- To apply the Apache License to your work, attach the following
181
- boilerplate notice, with the fields enclosed by brackets "[]"
182
- replaced with your own identifying information. (Don't include
183
- the brackets!) The text should be enclosed in the appropriate
184
- comment syntax for the file format. We also recommend that a
185
- file or class name and description of purpose be included on the
186
- same "printed page" as the copyright notice for easier
187
- identification within third-party archives.
188
-
189
- Copyright 2018 Pinterest Inc.
190
- Copyright 2020 Josh Gachnang
191
- Copyright 2022 Flourish Health Inc.
192
-
193
- Licensed under the Apache License, Version 2.0 (the "License");
194
- you may not use this file except in compliance with the License.
195
- You may obtain a copy of the License at
196
-
197
- http://www.apache.org/licenses/LICENSE-2.0
198
-
199
- Unless required by applicable law or agreed to in writing, software
200
- distributed under the License is distributed on an "AS IS" BASIS,
201
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
202
- See the License for the specific language governing permissions and
203
- limitations under the License.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Flourish Health, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/Common.d.ts CHANGED
@@ -156,6 +156,7 @@ export interface TextThemeConfig {
156
156
  export interface SurfaceThemeConfig {
157
157
  base: keyof ThemePrimitiveColors;
158
158
  primary: keyof ThemePrimitiveColors;
159
+ secondaryExtraLight: keyof ThemePrimitiveColors;
159
160
  secondaryLight: keyof ThemePrimitiveColors;
160
161
  secondaryDark: keyof ThemePrimitiveColors;
161
162
  secondaryExtraDark: keyof ThemePrimitiveColors;
@@ -218,6 +219,7 @@ export interface TextTheme {
218
219
  export interface SurfaceTheme {
219
220
  base: string;
220
221
  primary: string;
222
+ secondaryExtraLight: string;
221
223
  secondaryLight: string;
222
224
  secondaryDark: string;
223
225
  secondaryExtraDark: string;
@@ -523,6 +525,43 @@ export type CardProps = BoxProps & {
523
525
  */
524
526
  imageHeight?: number;
525
527
  };
528
+ export type EditableCardProps = BoxProps & {
529
+ /**
530
+ * The name of an icon shown before the title.
531
+ */
532
+ iconName?: IconName;
533
+ /**
534
+ * The title of the summarized information.
535
+ */
536
+ title?: string;
537
+ /**
538
+ * Props for a badge rendered next to the title.
539
+ */
540
+ badge?: BadgeProps;
541
+ /**
542
+ * The summarized information itself, displayed below the title.
543
+ */
544
+ description?: string;
545
+ /**
546
+ * Secondary text displayed below the description, in a muted style.
547
+ */
548
+ helperText?: string;
549
+ /**
550
+ * Callback invoked when the edit button is pressed. The edit button is only rendered when this
551
+ * is provided.
552
+ */
553
+ onEdit?: () => void | Promise<void>;
554
+ /**
555
+ * Accessibility label for the edit button.
556
+ * @default "Edit"
557
+ */
558
+ editAccessibilityLabel?: string;
559
+ /**
560
+ * If true, the card is highlighted to draw attention to it, e.g. for content that needs review.
561
+ * @default false
562
+ */
563
+ attention?: boolean;
564
+ };
526
565
  export interface ErrorBoundaryProps {
527
566
  onError?: (error: Error, stack: string) => void;
528
567
  children?: ReactNode;
@@ -1 +1 @@
1
- {"version":3,"file":"Common.js","sourceRoot":"","sources":["../src/Common.ts"],"names":[],"mappings":"AA6BA,OAAO,EACL,yBAAyB,EACzB,gCAAgC,EAChC,4BAA4B,EAC5B,4BAA4B,EAC5B,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,WAAW,GACZ,MAAM,yBAAyB,CAAC;AA0ZjC,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,EAAE;IACL,CAAC,EAAE,EAAE;IACL,CAAC,EAAE,EAAE;IACL,CAAC,EAAE,EAAE;IACL,CAAC,EAAE,EAAE;IACL,CAAC,EAAE,EAAE;IACL,CAAC,EAAE,EAAE;IACL,EAAE,EAAE,EAAE;IACN,EAAE,EAAE,EAAE;IACN,EAAE,EAAE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CAAC;IACL,EAAE,EAAE,EAAE;CACP,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,QAAkB,EAAE,EAAE;IAChD,OAAO,YAAY,CAAC,QAAQ,CAAC,CAAC;AAChC,CAAC,CAAC;AAi0EF;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;CACV,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type React from "react";
2
+ import type { EditableCardProps } from "./Common";
3
+ export declare const EditableCard: ({ children, attention, badge, color, description, editAccessibilityLabel, helperText, iconName, onEdit, padding, title, ...rest }: EditableCardProps) => React.ReactElement;
@@ -0,0 +1,23 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { Badge } from "./Badge";
14
+ import { Box } from "./Box";
15
+ import { Card } from "./Card";
16
+ import { Icon } from "./Icon";
17
+ import { IconButton } from "./IconButton";
18
+ import { Text } from "./Text";
19
+ export const EditableCard = (_a) => {
20
+ var { children, attention = false, badge, color, description, editAccessibilityLabel = "Edit", helperText, iconName, onEdit, padding = 3, title } = _a, rest = __rest(_a, ["children", "attention", "badge", "color", "description", "editAccessibilityLabel", "helperText", "iconName", "onEdit", "padding", "title"]);
21
+ return (_jsxs(Card, Object.assign({ borderLeft: "default", borderRight: "default", color: color !== null && color !== void 0 ? color : (attention ? "secondaryExtraLight" : "base"), direction: "row", gap: 2, padding: padding, rounding: "md", width: "100%" }, rest, { children: [Boolean(iconName) && (_jsx(Box, { paddingY: 1, children: _jsx(Icon, { iconName: iconName, size: "md" }) })), _jsxs(Box, { direction: "column", flex: "grow", gap: 1, minWidth: 0, children: [(Boolean(title) || Boolean(badge)) && (_jsxs(Box, { alignItems: "center", direction: "row", gap: 2, children: [Boolean(title) && (_jsx(Box, { flex: "shrink", minWidth: 0, children: _jsx(Text, { bold: true, size: "md", truncate: true, children: title }) })), Boolean(badge) && _jsx(Badge, Object.assign({}, badge))] })), Boolean(description) && _jsx(Text, { size: "md", children: description }), Boolean(helperText) && (_jsx(Text, { color: "secondaryLight", size: "sm", children: helperText })), children] }), Boolean(onEdit) && (_jsx(IconButton, { accessibilityLabel: editAccessibilityLabel, iconName: "pencil", onClick: onEdit, variant: "ghost" }))] })));
22
+ };
23
+ //# sourceMappingURL=EditableCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditableCard.js","sourceRoot":"","sources":["../src/EditableCard.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAEA,OAAO,EAAC,KAAK,EAAC,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,IAAI,EAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAC,IAAI,EAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EAAC,IAAI,EAAC,MAAM,QAAQ,CAAC;AAE5B,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAaT,EAAsB,EAAE;QAbf,EAC3B,QAAQ,EACR,SAAS,GAAG,KAAK,EACjB,KAAK,EACL,KAAK,EACL,WAAW,EACX,sBAAsB,GAAG,MAAM,EAC/B,UAAU,EACV,QAAQ,EACR,MAAM,EACN,OAAO,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AU,CAAC,IAAI,CACtB,KAAC,IAAI,IAAC,KAAK,EAAC,gBAAgB,EAAC,IAAI,EAAC,IAAI,YACnC,UAAU,GACN,CACR,EACA,QAAQ,IACL,EACL,OAAO,CAAC,MAAM,CAAC,IAAI,CAClB,KAAC,UAAU,IACT,kBAAkB,EAAE,sBAAsB,EAC1C,QAAQ,EAAC,QAAQ,EACjB,OAAO,EAAE,MAAO,EAChB,OAAO,EAAC,OAAO,GACf,CACH,KACI,CACR,CAAC;AACJ,CAAC,CAAC"}
package/dist/Theme.js CHANGED
@@ -126,6 +126,7 @@ const defaultTheme = {
126
126
  primary: "primary400",
127
127
  secondaryDark: "secondary500",
128
128
  secondaryExtraDark: "secondary800",
129
+ secondaryExtraLight: "secondary000",
129
130
  secondaryLight: "secondary100",
130
131
  success: "success200",
131
132
  successLight: "success000",
package/dist/Theme.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Theme.js","sourceRoot":"","sources":["../src/Theme.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAC,aAAa,EAAE,OAAO,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAI9D,MAAM,iBAAiB,GAAG;IACxB,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,SAAS;IAEpB,QAAQ,EAAE,SAAS;IACnB,QAAQ,EAAE,SAAS;IACnB,QAAQ,EAAE,SAAS;IACnB,UAAU,EAAE,SAAS;IACrB,UAAU,EAAE,SAAS;IACrB,UAAU,EAAE,SAAS;IACrB,UAAU,EAAE,SAAS;IACrB,UAAU,EAAE,SAAS;IACrB,UAAU,EAAE,SAAS;IACrB,UAA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,YACtF,QAAQ,GACa,CACzB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC"}
package/dist/index.d.ts CHANGED
@@ -27,6 +27,7 @@ export * from "./DateUtilities";
27
27
  export * from "./DecimalRangeActionSheet";
28
28
  export * from "./DismissButton";
29
29
  export { DraggableList } from "./DraggableList";
30
+ export * from "./EditableCard";
30
31
  export * from "./EmailField";
31
32
  export { default as EmojiSelector } from "./EmojiSelector";
32
33
  export * from "./ErrorBoundary";
package/dist/index.js CHANGED
@@ -26,6 +26,7 @@ export * from "./DateUtilities";
26
26
  export * from "./DecimalRangeActionSheet";
27
27
  export * from "./DismissButton";
28
28
  export { DraggableList } from "./DraggableList";
29
+ export * from "./EditableCard";
29
30
  export * from "./EmailField";
30
31
  export { default as EmojiSelector } from "./EmojiSelector";
31
32
  export * from "./ErrorBoundary";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAEA,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,OAAO,EAAC,MAAM,EAAE,UAAU,EAAC,MAAM,UAAU,CAAC;AAC5C,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAA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BAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC"}
package/package.json CHANGED
@@ -104,11 +104,12 @@
104
104
  "typescript": "~5.9.2"
105
105
  },
106
106
  "files": [
107
+ "LICENSE",
107
108
  "dist/**/*",
108
109
  "src/**/*",
109
110
  ".ai/**/*"
110
111
  ],
111
- "license": "Apache-2.0",
112
+ "license": "MIT",
112
113
  "main": "dist/index.js",
113
114
  "name": "@terreno/ui",
114
115
  "peerDependencies": {
@@ -141,5 +142,5 @@
141
142
  "test:coverage": "TZ=America/New_York bun run ../scripts/check-coverage.ts",
142
143
  "types": "bun typedoc"
143
144
  },
144
- "version": "0.30.0"
145
+ "version": "0.31.0"
145
146
  }
@@ -1,9 +1,9 @@
1
1
  // noExplicitAny: test mock typing
2
2
  // biome-ignore-all lint/suspicious/noExplicitAny: test mock typing
3
- import {afterAll, afterEach, beforeAll, describe, expect, it, mock} from "bun:test";
3
+ import {afterAll, afterEach, beforeAll, describe, expect, it, type Mock, mock} from "bun:test";
4
4
  import {act, render} from "@testing-library/react-native";
5
- import {createRef} from "react";
6
- import {Text} from "react-native";
5
+ import {createRef, type RefObject} from "react";
6
+ import {Animated, Dimensions, type KeyboardEvent, Text} from "react-native";
7
7
 
8
8
  import {
9
9
  ActionSheet,
@@ -614,6 +614,44 @@ describe("ActionSheet", () => {
614
614
  });
615
615
 
616
616
  describe("_onKeyboardShow", () => {
617
+ const timing = (Animated as unknown as {timing: Mock<(...args: never[]) => unknown>}).timing;
618
+
619
+ /**
620
+ * Focuses a field at `pageY` with a 40pt height and measures it synchronously, mirroring
621
+ * how UIManager.measure calls back on a real device.
622
+ */
623
+ const withFocusedField = (pageY: number, run: () => void): void => {
624
+ const {TextInput: MockTextInput, UIManager: MockUIManager} = require("react-native");
625
+ const origState = MockTextInput.State;
626
+ const origMeasure = MockUIManager.measure;
627
+ MockTextInput.State = {currentlyFocusedField: () => 42};
628
+ MockUIManager.measure = (
629
+ _node: number,
630
+ callback: (
631
+ originX: number,
632
+ originY: number,
633
+ width: number,
634
+ height: number,
635
+ pageX: number,
636
+ pageY: number
637
+ ) => void
638
+ ): void => {
639
+ callback(0, 0, 100, 40, 0, pageY);
640
+ };
641
+ try {
642
+ run();
643
+ } finally {
644
+ MockTextInput.State = origState;
645
+ MockUIManager.measure = origMeasure;
646
+ }
647
+ };
648
+
649
+ const showKeyboard = (ref: RefObject<ActionSheet | null>, keyboardHeight: number): void => {
650
+ ref.current?._onKeyboardShow({
651
+ endCoordinates: {height: keyboardHeight, screenX: 0, screenY: 500, width: 400},
652
+ } as KeyboardEvent);
653
+ };
654
+
617
655
  it("sets keyboard state to true and handles no focused field", () => {
618
656
  const ref = createRef<ActionSheet>();
619
657
  render(
@@ -628,16 +666,16 @@ describe("ActionSheet", () => {
628
666
  MockTextInput.State = {
629
667
  currentlyFocusedField: () => null,
630
668
  };
669
+ const timingCallsBefore = timing.mock.calls.length;
631
670
  act(() => {
632
- (ref.current as any)._onKeyboardShow({
633
- endCoordinates: {height: 300, screenX: 0, screenY: 500, width: 400},
634
- });
671
+ showKeyboard(ref, 300);
635
672
  });
636
673
  expect(ref.current!.state.keyboard).toBe(true);
674
+ expect(timing.mock.calls.length).toBe(timingCallsBefore);
637
675
  MockTextInput.State = origState;
638
676
  });
639
677
 
640
- it("handles keyboard show with focused field", () => {
678
+ it("does not animate when the focused field stays above the keyboard", () => {
641
679
  const ref = createRef<ActionSheet>();
642
680
  render(
643
681
  <ThemeProvider>
@@ -646,26 +684,19 @@ describe("ActionSheet", () => {
646
684
  </ActionSheet>
647
685
  </ThemeProvider>
648
686
  );
649
- const {TextInput: MockTextInput, UIManager: MockUIManager} = require("react-native");
650
- const origState = MockTextInput.State;
651
- const origMeasure = MockUIManager.measure;
652
- MockTextInput.State = {
653
- currentlyFocusedField: () => 42,
654
- };
655
- MockUIManager.measure = (_node: any, cb: any) => {
656
- cb(0, 0, 100, 40, 0, 400);
657
- };
658
- act(() => {
659
- (ref.current as any)._onKeyboardShow({
660
- endCoordinates: {height: 300, screenX: 0, screenY: 500, width: 400},
687
+ const timingCallsBefore = timing.mock.calls.length;
688
+ withFocusedField(400, () => {
689
+ act(() => {
690
+ showKeyboard(ref, 300);
661
691
  });
662
692
  });
663
693
  expect(ref.current!.state.keyboard).toBe(true);
664
- MockTextInput.State = origState;
665
- MockUIManager.measure = origMeasure;
694
+ // windowHeight (896) - keyboardHeight (300) - (pageY (400) + fieldHeight (40)) = 156 above
695
+ // the keyboard, so no animation is needed.
696
+ expect(timing.mock.calls.length).toBe(timingCallsBefore);
666
697
  });
667
698
 
668
- it("handles keyboard show with enough gap (no animation needed)", () => {
699
+ it("animates the sheet up by the overlap when the keyboard covers the focused field", () => {
669
700
  const ref = createRef<ActionSheet>();
670
701
  render(
671
702
  <ThemeProvider>
@@ -674,23 +705,35 @@ describe("ActionSheet", () => {
674
705
  </ActionSheet>
675
706
  </ThemeProvider>
676
707
  );
677
- const {TextInput: MockTextInput, UIManager: MockUIManager} = require("react-native");
678
- const origState = MockTextInput.State;
679
- const origMeasure = MockUIManager.measure;
680
- MockTextInput.State = {
681
- currentlyFocusedField: () => 42,
682
- };
683
- MockUIManager.measure = (_node: any, cb: any) => {
684
- cb(0, 0, 100, 40, 0, 100);
685
- };
686
- act(() => {
687
- (ref.current as any)._onKeyboardShow({
688
- endCoordinates: {height: 100, screenX: 0, screenY: 500, width: 400},
708
+ const timingCallsBefore = timing.mock.calls.length;
709
+ withFocusedField(800, () => {
710
+ act(() => {
711
+ showKeyboard(ref, 300);
689
712
  });
690
713
  });
691
- expect(ref.current!.state.keyboard).toBe(true);
692
- MockTextInput.State = origState;
693
- MockUIManager.measure = origMeasure;
714
+ const {height: windowHeight} = Dimensions.get("window");
715
+ const gap = windowHeight - 300 - (800 + 40);
716
+ expect(timing.mock.calls.length).toBe(timingCallsBefore + 1);
717
+ expect(timing.mock.calls[timingCallsBefore][1].toValue).toBe(gap - 10);
718
+ });
719
+
720
+ it("shifts by the keyboard height instead of the overlap in position keyboard mode", () => {
721
+ const ref = createRef<ActionSheet>();
722
+ render(
723
+ <ThemeProvider>
724
+ <ActionSheet keyboardMode="position" ref={ref}>
725
+ <Text>Content</Text>
726
+ </ActionSheet>
727
+ </ThemeProvider>
728
+ );
729
+ const timingCallsBefore = timing.mock.calls.length;
730
+ withFocusedField(800, () => {
731
+ act(() => {
732
+ showKeyboard(ref, 300);
733
+ });
734
+ });
735
+ expect(timing.mock.calls.length).toBe(timingCallsBefore + 1);
736
+ expect(timing.mock.calls[timingCallsBefore][1].toValue).toBe(-(300 + 15));
694
737
  });
695
738
  });
696
739