@storybook/react-native-ui-lite 10.2.2-alpha.4 → 10.2.2-alpha.5
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/dist/index.js +3 -19
- package/package.json +4 -4
- package/src/Tree.tsx +2 -22
package/dist/index.js
CHANGED
|
@@ -464,22 +464,6 @@ var useSelectedNode = () => (0, import_react3.useContext)(SelectedNodeContext);
|
|
|
464
464
|
|
|
465
465
|
// src/Tree.tsx
|
|
466
466
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
467
|
-
var CASE_SPLIT_PATTERN = /\p{Lu}?\p{Ll}+|[0-9]+|\p{Lu}+(?!\p{Ll})|\p{Emoji_Presentation}|\p{Extended_Pictographic}|\p{L}+/gu;
|
|
468
|
-
function words(str) {
|
|
469
|
-
return Array.from(str.match(CASE_SPLIT_PATTERN) ?? []);
|
|
470
|
-
}
|
|
471
|
-
function startCase(str) {
|
|
472
|
-
const words$1 = words(str.trim());
|
|
473
|
-
let result = "";
|
|
474
|
-
for (let i = 0; i < words$1.length; i++) {
|
|
475
|
-
const word = words$1[i];
|
|
476
|
-
if (result) {
|
|
477
|
-
result += " ";
|
|
478
|
-
}
|
|
479
|
-
result += word[0].toUpperCase() + word.slice(1).toLowerCase();
|
|
480
|
-
}
|
|
481
|
-
return result;
|
|
482
|
-
}
|
|
483
467
|
var Node = import_react4.default.memo(function Node2({
|
|
484
468
|
item,
|
|
485
469
|
refId,
|
|
@@ -524,7 +508,7 @@ var Node = import_react4.default.memo(function Node2({
|
|
|
524
508
|
"aria-expanded": isExpanded,
|
|
525
509
|
children: [
|
|
526
510
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(CollapseIcon, { isExpanded }),
|
|
527
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(RootNodeText, { children: startCase(item.name) })
|
|
511
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(RootNodeText, { children: (0, import_react_native_ui_common.startCase)(item.name) })
|
|
528
512
|
]
|
|
529
513
|
}
|
|
530
514
|
),
|
|
@@ -560,7 +544,7 @@ var Node = import_react4.default.memo(function Node2({
|
|
|
560
544
|
event.preventDefault();
|
|
561
545
|
setExpanded({ ids: [item.id], value: !isExpanded });
|
|
562
546
|
},
|
|
563
|
-
children: startCase(item.name)
|
|
547
|
+
children: (0, import_react_native_ui_common.startCase)(item.name)
|
|
564
548
|
},
|
|
565
549
|
id
|
|
566
550
|
);
|
|
@@ -589,7 +573,7 @@ var RootNode = import_react_native_theming3.styled.View(() => ({
|
|
|
589
573
|
minHeight: 34
|
|
590
574
|
}));
|
|
591
575
|
var RootNodeText = import_react_native_theming3.styled.Text(({ theme }) => ({
|
|
592
|
-
fontSize: theme.typography.size.s2,
|
|
576
|
+
fontSize: theme.typography.size.s2 - 1,
|
|
593
577
|
fontWeight: theme.typography.weight.bold,
|
|
594
578
|
color: theme.textMutedColor,
|
|
595
579
|
lineHeight: 16,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/react-native-ui-lite",
|
|
3
|
-
"version": "10.2.2-alpha.
|
|
3
|
+
"version": "10.2.2-alpha.5",
|
|
4
4
|
"description": "lightweight ui components for react native storybook",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"@legendapp/list": "3.0.0-beta.31",
|
|
43
43
|
"@nozbe/microfuzz": "^1.0.0",
|
|
44
44
|
"@storybook/react": "^10.2.2",
|
|
45
|
-
"@storybook/react-native-theming": "^10.2.2-alpha.
|
|
46
|
-
"@storybook/react-native-ui-common": "^10.2.2-alpha.
|
|
45
|
+
"@storybook/react-native-theming": "^10.2.2-alpha.5",
|
|
46
|
+
"@storybook/react-native-ui-common": "^10.2.2-alpha.5",
|
|
47
47
|
"polished": "^4.3.1",
|
|
48
48
|
"react-native-safe-area-context": "^5"
|
|
49
49
|
},
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"publishConfig": {
|
|
59
59
|
"access": "public"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "51485fba2ef3d8f323905bdbee0ad1828ce45eb4"
|
|
62
62
|
}
|
package/src/Tree.tsx
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
isStoryHoistable,
|
|
9
9
|
Item,
|
|
10
10
|
useExpanded,
|
|
11
|
+
startCase,
|
|
11
12
|
} from '@storybook/react-native-ui-common';
|
|
12
13
|
import React, { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
13
14
|
import { View, ViewStyle } from 'react-native';
|
|
@@ -40,27 +41,6 @@ interface NodeProps {
|
|
|
40
41
|
status: State['status'][keyof State['status']];
|
|
41
42
|
}
|
|
42
43
|
|
|
43
|
-
// from estookit/string
|
|
44
|
-
const CASE_SPLIT_PATTERN =
|
|
45
|
-
/\p{Lu}?\p{Ll}+|[0-9]+|\p{Lu}+(?!\p{Ll})|\p{Emoji_Presentation}|\p{Extended_Pictographic}|\p{L}+/gu;
|
|
46
|
-
// from estookit/string
|
|
47
|
-
function words(str: string) {
|
|
48
|
-
return Array.from(str.match(CASE_SPLIT_PATTERN) ?? []);
|
|
49
|
-
}
|
|
50
|
-
// from estookit/string
|
|
51
|
-
function startCase(str: string) {
|
|
52
|
-
const words$1 = words(str.trim());
|
|
53
|
-
let result = '';
|
|
54
|
-
for (let i = 0; i < words$1.length; i++) {
|
|
55
|
-
const word = words$1[i];
|
|
56
|
-
if (result) {
|
|
57
|
-
result += ' ';
|
|
58
|
-
}
|
|
59
|
-
result += word[0].toUpperCase() + word.slice(1).toLowerCase();
|
|
60
|
-
}
|
|
61
|
-
return result;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
44
|
export const Node = React.memo<NodeProps>(function Node({
|
|
65
45
|
item,
|
|
66
46
|
refId,
|
|
@@ -177,7 +157,7 @@ export const RootNode = styled.View(() => ({
|
|
|
177
157
|
}));
|
|
178
158
|
|
|
179
159
|
export const RootNodeText = styled.Text(({ theme }) => ({
|
|
180
|
-
fontSize: theme.typography.size.s2,
|
|
160
|
+
fontSize: theme.typography.size.s2 - 1,
|
|
181
161
|
fontWeight: theme.typography.weight.bold,
|
|
182
162
|
color: theme.textMutedColor,
|
|
183
163
|
lineHeight: 16,
|