@delacour/react-native-ui 0.1.0-alpha.20261005223004 → 0.1.0-alpha.20261006134908
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@delacour/react-native-ui",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.20261006134908",
|
|
4
4
|
"description": "React Native UI components — Uniwind, Reanimated, Gesture Handler",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -101,8 +101,8 @@
|
|
|
101
101
|
},
|
|
102
102
|
"peerDependencies": {
|
|
103
103
|
"@central-icons-react-native/round-outlined-radius-1-stroke-1.5": "^1.1",
|
|
104
|
-
"@delacour/react-native-bottom-sheet": "0.1.0-alpha.
|
|
105
|
-
"@delacour/react-native-charts": "0.1.0-alpha.
|
|
104
|
+
"@delacour/react-native-bottom-sheet": "0.1.0-alpha.20261006134908",
|
|
105
|
+
"@delacour/react-native-charts": "0.1.0-alpha.20261006134908",
|
|
106
106
|
"@legendapp/list": ">=3.3",
|
|
107
107
|
"expo-linear-gradient": ">=15",
|
|
108
108
|
"expo-router": ">=57",
|
|
@@ -44,11 +44,11 @@ Compound root plus `Avatar.Badge` and `Avatar.Group`.
|
|
|
44
44
|
the clipped circle. An `Avatar.Badge` hangs over the circle's edge, and a
|
|
45
45
|
single clipped box would cut it in half. A test asserts `overflow-hidden` is on
|
|
46
46
|
`face` and never on `root`.
|
|
47
|
-
- **Initials are the first letter of the first and last word.** `
|
|
48
|
-
|
|
47
|
+
- **Initials are the first letter of the first and last word.** `Anahera Rose
|
|
48
|
+
Tui` is `AT`, the way a person signs, and `Mihi` is `M`.
|
|
49
49
|
`resolveAvatarInitials` walks code points rather than UTF-16 units, so a letter
|
|
50
50
|
outside the basic plane is never split into a replacement box, and skips
|
|
51
|
-
leading punctuation so `"(
|
|
51
|
+
leading punctuation so `"(Aria)"` still gives `A`. `fallback` overrides the
|
|
52
52
|
drawn text only; `name` is still what a screen reader reads.
|
|
53
53
|
- **Two axes paint the fallback, on `Badge`'s six colours.** `variant` is `soft`
|
|
54
54
|
or `solid`, `color` is `default` … `info`, and the twelve cells live in
|
|
@@ -77,7 +77,7 @@ Compound root plus `Avatar.Badge` and `Avatar.Group`.
|
|
|
77
77
|
- **The avatar is one element to assistive technology.** The root is
|
|
78
78
|
`accessible`, so an `Avatar.Badge` inside it is never focused on its own. A
|
|
79
79
|
presence dot has no words; put the status into the avatar's
|
|
80
|
-
`accessibilityLabel` (`"
|
|
80
|
+
`accessibilityLabel` (`"Aria Whitlock, online"`).
|
|
81
81
|
- **`Avatar.Badge` is a pin, and a dot only when empty.** Given children — a
|
|
82
82
|
`Badge` with a count, an `Icon` — it positions them and adds nothing else, so a
|
|
83
83
|
count keeps the look it has everywhere else. Empty, it draws a dot sized to
|
|
@@ -165,7 +165,7 @@ function AvatarRoot({
|
|
|
165
165
|
* is tried again. With no `fallback` and no `name` the fallback is a person glyph.
|
|
166
166
|
*
|
|
167
167
|
* `name` is what a screen reader reads, and its initials — first and last word,
|
|
168
|
-
* `
|
|
168
|
+
* `Anahera Rose Tui` → `AT` — are the default fallback. `fallback` overrides the
|
|
169
169
|
* drawn text only.
|
|
170
170
|
*
|
|
171
171
|
* `variant` and `color` paint the fallback surface, on the same six colours a
|
|
@@ -180,10 +180,10 @@ function AvatarRoot({
|
|
|
180
180
|
* corner, outside the clipped circle so it is never cut in half.
|
|
181
181
|
*
|
|
182
182
|
* @example
|
|
183
|
-
* <Avatar name="
|
|
183
|
+
* <Avatar name="Aria Whitlock" source={{ uri: user.avatarUrl }} />
|
|
184
184
|
*
|
|
185
185
|
* @example
|
|
186
|
-
* <Avatar accessibilityLabel="
|
|
186
|
+
* <Avatar accessibilityLabel="Aria Whitlock, online" name="Aria Whitlock">
|
|
187
187
|
* <Avatar.Badge placement="bottom-right" />
|
|
188
188
|
* </Avatar>
|
|
189
189
|
*
|
|
@@ -10,17 +10,17 @@ import {
|
|
|
10
10
|
|
|
11
11
|
describe("resolveAvatarInitials", () => {
|
|
12
12
|
test("takes the first letter of the first and last words", () => {
|
|
13
|
-
expect(resolveAvatarInitials("
|
|
14
|
-
expect(resolveAvatarInitials("
|
|
13
|
+
expect(resolveAvatarInitials("Aria Whitlock")).toBe("AW");
|
|
14
|
+
expect(resolveAvatarInitials("Anahera Rose Tui")).toBe("AT");
|
|
15
15
|
});
|
|
16
16
|
|
|
17
17
|
test("a single word gives a single letter", () => {
|
|
18
|
-
expect(resolveAvatarInitials("
|
|
18
|
+
expect(resolveAvatarInitials("Mihi")).toBe("M");
|
|
19
19
|
});
|
|
20
20
|
|
|
21
21
|
test("uppercases, and ignores surrounding and repeated whitespace", () => {
|
|
22
|
-
expect(resolveAvatarInitials("
|
|
23
|
-
expect(resolveAvatarInitials("
|
|
22
|
+
expect(resolveAvatarInitials(" rawiri kemp ")).toBe("RK");
|
|
23
|
+
expect(resolveAvatarInitials("lena\tvarga")).toBe("LV");
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
test("is empty for an empty, blank or missing name", () => {
|
|
@@ -31,15 +31,15 @@ describe("resolveAvatarInitials", () => {
|
|
|
31
31
|
|
|
32
32
|
test("never splits a letter outside the basic plane", () => {
|
|
33
33
|
// A naive `word[0]` would take half of a surrogate pair and draw a box.
|
|
34
|
-
expect(resolveAvatarInitials("𝒜
|
|
34
|
+
expect(resolveAvatarInitials("𝒜ria 𝒲hitlock")).toBe("𝒜𝒲");
|
|
35
35
|
});
|
|
36
36
|
|
|
37
37
|
test("keeps letters in scripts with no case", () => {
|
|
38
|
-
expect(resolveAvatarInitials("
|
|
38
|
+
expect(resolveAvatarInitials("森山 健二")).toBe("森健");
|
|
39
39
|
});
|
|
40
40
|
|
|
41
41
|
test("skips a leading punctuation mark in a word", () => {
|
|
42
|
-
expect(resolveAvatarInitials("(
|
|
42
|
+
expect(resolveAvatarInitials("(Aria) 'Whitlock'")).toBe("AW");
|
|
43
43
|
});
|
|
44
44
|
});
|
|
45
45
|
|
|
@@ -156,11 +156,11 @@ describe("resolveAvatarOverflowLabel", () => {
|
|
|
156
156
|
|
|
157
157
|
describe("resolveAvatarAccessibilityLabel", () => {
|
|
158
158
|
test("prefers the name", () => {
|
|
159
|
-
expect(resolveAvatarAccessibilityLabel({ name: "
|
|
159
|
+
expect(resolveAvatarAccessibilityLabel({ name: "Aria Whitlock", fallback: "AW" })).toBe("Aria Whitlock");
|
|
160
160
|
});
|
|
161
161
|
|
|
162
162
|
test("falls back to the fallback text", () => {
|
|
163
|
-
expect(resolveAvatarAccessibilityLabel({ fallback: "
|
|
163
|
+
expect(resolveAvatarAccessibilityLabel({ fallback: "AW" })).toBe("AW");
|
|
164
164
|
});
|
|
165
165
|
|
|
166
166
|
test("is undefined when there is nothing to read", () => {
|
|
@@ -169,6 +169,6 @@ describe("resolveAvatarAccessibilityLabel", () => {
|
|
|
169
169
|
});
|
|
170
170
|
|
|
171
171
|
test("an explicit label wins over both", () => {
|
|
172
|
-
expect(resolveAvatarAccessibilityLabel({ accessibilityLabel: "You", name: "
|
|
172
|
+
expect(resolveAvatarAccessibilityLabel({ accessibilityLabel: "You", name: "Aria Whitlock" })).toBe("You");
|
|
173
173
|
});
|
|
174
174
|
});
|
|
@@ -23,7 +23,7 @@ function initialOf(word: string): string {
|
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* Up to two initials from a name: the first letter of the first word and of the
|
|
26
|
-
* last. `
|
|
26
|
+
* last. `Anahera Rose Tui` reads `AT`, which is how a person signs rather than
|
|
27
27
|
* how a form abbreviates them. A single word gives a single letter.
|
|
28
28
|
*
|
|
29
29
|
* Walks code points rather than UTF-16 units, so a letter outside the basic
|