pytech-ui 1.0.3 → 1.0.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/README.md +0 -6
- package/build/index.d.ts +1 -1
- package/build/index.js +0 -15
- package/build/jetpack-compose/index.d.ts +1 -0
- package/build/jetpack-compose/index.js +2 -0
- package/build/swift-ui/index.d.ts +0 -3
- package/build/swift-ui/index.js +0 -3
- package/expo-module.config.json +5 -2
- package/ios/PytechUiModule.swift +3 -6
- package/package.json +5 -2
- package/build/swift-ui/ListItemSimple.d.ts +0 -19
- package/build/swift-ui/ListItemSimple.js +0 -19
- package/build/swift-ui/NavigationLink.d.ts +0 -12
- package/build/swift-ui/NavigationLink.js +0 -8
- package/build/swift-ui/NavigationStack.d.ts +0 -5
- package/build/swift-ui/NavigationStack.js +0 -8
- package/ios/ListItemSimple.swift +0 -69
- package/ios/NavigationLinkView.swift +0 -43
- package/ios/NavigationStackView.swift +0 -19
- package/swift-ui/index.d.ts +0 -1
- package/swift-ui/index.js +0 -1
package/README.md
CHANGED
|
@@ -35,12 +35,6 @@ export function Example() {
|
|
|
35
35
|
}
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
También podés importar desde el entry principal:
|
|
39
|
-
|
|
40
|
-
```tsx
|
|
41
|
-
import { Gradient } from 'pytech-ui';
|
|
42
|
-
```
|
|
43
|
-
|
|
44
38
|
## Plataformas
|
|
45
39
|
|
|
46
40
|
Los componentes de `pytech-ui/swift-ui` requieren **iOS** y dependen de `@expo/ui`.
|
package/build/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export {};
|
package/build/index.js
CHANGED
|
@@ -1,17 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./swift-ui"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/build/swift-ui/index.js
CHANGED
|
@@ -14,9 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./NavigationLink"), exports);
|
|
18
|
-
__exportStar(require("./NavigationStack"), exports);
|
|
19
|
-
__exportStar(require("./ListItemSimple"), exports);
|
|
20
17
|
__exportStar(require("./ListItem"), exports);
|
|
21
18
|
__exportStar(require("./Text"), exports);
|
|
22
19
|
__exportStar(require("./Image"), exports);
|
package/expo-module.config.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pytech-ui",
|
|
3
|
-
"platforms": ["apple"],
|
|
4
|
-
"coreFeatures": ["swiftui"],
|
|
3
|
+
"platforms": ["apple", "android"],
|
|
4
|
+
"coreFeatures": ["swiftui", "compose"],
|
|
5
5
|
"apple": {
|
|
6
6
|
"modules": ["PytechUiModule"]
|
|
7
|
+
},
|
|
8
|
+
"android": {
|
|
9
|
+
"modules": ["expo.modules.pytechui.PytechUiModule"]
|
|
7
10
|
}
|
|
8
11
|
}
|
package/ios/PytechUiModule.swift
CHANGED
|
@@ -7,12 +7,9 @@ public class PytechUiModule: Module {
|
|
|
7
7
|
|
|
8
8
|
View(SlotView.self)
|
|
9
9
|
|
|
10
|
-
ExpoUIView(NavigationStackView.self)
|
|
11
|
-
ExpoUIView(NavigationLinkView.self)
|
|
12
|
-
ExpoUIView(ListItemSimpleView.self)
|
|
13
|
-
ExpoUIView(ListItemView.self)
|
|
14
|
-
ExpoUIView(ImageView.self)
|
|
15
|
-
ExpoUIView(GradientView.self)
|
|
16
10
|
ExpoUIView(ChevronForwardView.self)
|
|
11
|
+
ExpoUIView(GradientView.self)
|
|
12
|
+
ExpoUIView(ImageView.self)
|
|
13
|
+
ExpoUIView(ListItemView.self)
|
|
17
14
|
}
|
|
18
15
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pytech-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "Librería de componentes de UI para Pytech",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -30,6 +30,10 @@
|
|
|
30
30
|
"types": "./build/swift-ui/index.d.ts",
|
|
31
31
|
"default": "./build/swift-ui/index.js"
|
|
32
32
|
},
|
|
33
|
+
"./jetpack-compose": {
|
|
34
|
+
"types": "./build/jetpack-compose/index.d.ts",
|
|
35
|
+
"default": "./build/jetpack-compose/index.js"
|
|
36
|
+
},
|
|
33
37
|
"./package.json": "./package.json"
|
|
34
38
|
},
|
|
35
39
|
"main": "build/index.js",
|
|
@@ -37,7 +41,6 @@
|
|
|
37
41
|
"files": [
|
|
38
42
|
"build",
|
|
39
43
|
"ios",
|
|
40
|
-
"swift-ui",
|
|
41
44
|
"expo-module.config.json",
|
|
42
45
|
"LICENSE",
|
|
43
46
|
"README.md"
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { type CommonViewModifierProps } from '@expo/ui/swift-ui';
|
|
2
|
-
export interface ListItemSimpleProps extends CommonViewModifierProps {
|
|
3
|
-
children?: React.ReactNode;
|
|
4
|
-
}
|
|
5
|
-
export declare const ListItemSimple: {
|
|
6
|
-
({ modifiers, children, ...restProps }: ListItemSimpleProps): import("react").JSX.Element;
|
|
7
|
-
Headline: ({ children }: {
|
|
8
|
-
children: React.ReactNode;
|
|
9
|
-
}) => import("react").JSX.Element;
|
|
10
|
-
Supporting: ({ children }: {
|
|
11
|
-
children: React.ReactNode;
|
|
12
|
-
}) => import("react").JSX.Element;
|
|
13
|
-
Leading: ({ children }: {
|
|
14
|
-
children: React.ReactNode;
|
|
15
|
-
}) => import("react").JSX.Element;
|
|
16
|
-
Trailing: ({ children }: {
|
|
17
|
-
children: React.ReactNode;
|
|
18
|
-
}) => import("react").JSX.Element;
|
|
19
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ListItemSimple = void 0;
|
|
4
|
-
const expo_1 = require("expo");
|
|
5
|
-
const modifiers_1 = require("@expo/ui/swift-ui/modifiers");
|
|
6
|
-
const Slot_1 = require("./Slot");
|
|
7
|
-
const Headline = ({ children }) => (<Slot_1.Slot name="headlineContent">{children}</Slot_1.Slot>);
|
|
8
|
-
const Supporting = ({ children }) => (<Slot_1.Slot name="supportingContent">{children}</Slot_1.Slot>);
|
|
9
|
-
const Leading = ({ children }) => (<Slot_1.Slot name="leadingContent">{children}</Slot_1.Slot>);
|
|
10
|
-
const Trailing = ({ children }) => (<Slot_1.Slot name="trailingContent">{children}</Slot_1.Slot>);
|
|
11
|
-
const Native = (0, expo_1.requireNativeView)('PytechUi', 'ListItemSimpleView');
|
|
12
|
-
const ListItemSimple = ({ modifiers, children, ...restProps }) => (<Native modifiers={modifiers} {...(modifiers ? (0, modifiers_1.createViewModifierEventListener)(modifiers) : undefined)} {...restProps}>
|
|
13
|
-
{children}
|
|
14
|
-
</Native>);
|
|
15
|
-
exports.ListItemSimple = ListItemSimple;
|
|
16
|
-
exports.ListItemSimple.Headline = Headline;
|
|
17
|
-
exports.ListItemSimple.Supporting = Supporting;
|
|
18
|
-
exports.ListItemSimple.Leading = Leading;
|
|
19
|
-
exports.ListItemSimple.Trailing = Trailing;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { type CommonViewModifierProps } from '@expo/ui/swift-ui';
|
|
2
|
-
export interface NavigationLinkProps extends CommonViewModifierProps {
|
|
3
|
-
/**
|
|
4
|
-
The content that will be displayed as the navigation link.
|
|
5
|
-
*/
|
|
6
|
-
children?: React.ReactNode;
|
|
7
|
-
/**
|
|
8
|
-
The callback to be called when the navigation link is pressed.
|
|
9
|
-
*/
|
|
10
|
-
onPress?: () => void;
|
|
11
|
-
}
|
|
12
|
-
export declare const NavigationLink: ({ modifiers, onPress, ...restProps }: NavigationLinkProps) => import("react").JSX.Element;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NavigationLink = void 0;
|
|
4
|
-
const expo_1 = require("expo");
|
|
5
|
-
const modifiers_1 = require("@expo/ui/swift-ui/modifiers");
|
|
6
|
-
const Native = (0, expo_1.requireNativeView)('PytechUi', 'NavigationLinkView');
|
|
7
|
-
const NavigationLink = ({ modifiers, onPress, ...restProps }) => (<Native modifiers={modifiers} {...(modifiers ? (0, modifiers_1.createViewModifierEventListener)(modifiers) : undefined)} {...restProps} onLinkPress={onPress}/>);
|
|
8
|
-
exports.NavigationLink = NavigationLink;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { type CommonViewModifierProps } from '@expo/ui/swift-ui';
|
|
2
|
-
export interface NavigationStackProps extends CommonViewModifierProps {
|
|
3
|
-
children?: React.ReactNode;
|
|
4
|
-
}
|
|
5
|
-
export declare const NavigationStack: ({ modifiers, ...restProps }: NavigationStackProps) => import("react").JSX.Element;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NavigationStack = void 0;
|
|
4
|
-
const expo_1 = require("expo");
|
|
5
|
-
const modifiers_1 = require("@expo/ui/swift-ui/modifiers");
|
|
6
|
-
const Native = (0, expo_1.requireNativeView)('PytechUi', 'NavigationStackView');
|
|
7
|
-
const NavigationStack = ({ modifiers, ...restProps }) => (<Native modifiers={modifiers} {...(modifiers ? (0, modifiers_1.createViewModifierEventListener)(modifiers) : undefined)} {...restProps}/>);
|
|
8
|
-
exports.NavigationStack = NavigationStack;
|
package/ios/ListItemSimple.swift
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import SwiftUI
|
|
2
|
-
import ExpoModulesCore
|
|
3
|
-
import ExpoUI
|
|
4
|
-
|
|
5
|
-
public final class ListItemSimpleViewProps: UIBaseViewProps {}
|
|
6
|
-
|
|
7
|
-
struct ListItemSimpleView: ExpoSwiftUI.View {
|
|
8
|
-
@ObservedObject var props: ListItemSimpleViewProps
|
|
9
|
-
|
|
10
|
-
var body: some View {
|
|
11
|
-
if props.children?.slot("trailingContent") != nil {
|
|
12
|
-
HStack(){
|
|
13
|
-
mainLabel
|
|
14
|
-
|
|
15
|
-
Spacer()
|
|
16
|
-
|
|
17
|
-
slotContent(in: props.children, named: "trailingContent", secondary: true)
|
|
18
|
-
}
|
|
19
|
-
} else {
|
|
20
|
-
mainLabel
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// Renderiza el leading, headline y supporting content.
|
|
25
|
-
@ViewBuilder
|
|
26
|
-
private var mainLabel: some View {
|
|
27
|
-
let leading = props.children?.slot("leadingContent")
|
|
28
|
-
let hasImage = leading?.props.children?.slot("image") != nil
|
|
29
|
-
|
|
30
|
-
if let leading {
|
|
31
|
-
if hasImage {
|
|
32
|
-
Label {
|
|
33
|
-
titleContent // Label ya apila título + subtítulo
|
|
34
|
-
} icon: {
|
|
35
|
-
leading
|
|
36
|
-
}
|
|
37
|
-
} else {
|
|
38
|
-
HStack {
|
|
39
|
-
leading
|
|
40
|
-
alignedTitleContent
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
} else {
|
|
44
|
-
alignedTitleContent
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// Se fija si tiene que llevar un VStack o no.
|
|
49
|
-
@ViewBuilder
|
|
50
|
-
private var alignedTitleContent: some View {
|
|
51
|
-
let hasSupporting = props.children?.slot("supportingContent") != nil
|
|
52
|
-
|
|
53
|
-
if hasSupporting {
|
|
54
|
-
VStack(alignment: .leading) {
|
|
55
|
-
titleContent
|
|
56
|
-
}
|
|
57
|
-
} else {
|
|
58
|
-
slotContent(in: props.children, named: "headlineContent")
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// Renderiza el headline y supporting content dentro de Label o VStack.
|
|
63
|
-
@ViewBuilder
|
|
64
|
-
private var titleContent: some View {
|
|
65
|
-
slotContent(in: props.children, named: "headlineContent")
|
|
66
|
-
slotContent(in: props.children, named: "supportingContent", font: .subheadline, secondary: true)
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import SwiftUI
|
|
2
|
-
import ExpoModulesCore
|
|
3
|
-
import ExpoUI
|
|
4
|
-
|
|
5
|
-
public final class NavigationLinkViewProps: UIBaseViewProps {
|
|
6
|
-
var onLinkPress = EventDispatcher()
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
struct NavigationLinkView: ExpoSwiftUI.View {
|
|
10
|
-
@ObservedObject public var props: NavigationLinkViewProps
|
|
11
|
-
|
|
12
|
-
public init(props: NavigationLinkViewProps) {
|
|
13
|
-
self.props = props
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
public var body: some View {
|
|
17
|
-
ZStack {
|
|
18
|
-
NavigationLink {
|
|
19
|
-
EmptyView()
|
|
20
|
-
} label: {
|
|
21
|
-
labelContent
|
|
22
|
-
}
|
|
23
|
-
.allowsHitTesting(false)
|
|
24
|
-
.buttonStyle(.plain)
|
|
25
|
-
|
|
26
|
-
Color.clear
|
|
27
|
-
.contentShape(Rectangle())
|
|
28
|
-
.onTapGesture {
|
|
29
|
-
props.onLinkPress()
|
|
30
|
-
}
|
|
31
|
-
.onLongPressGesture(minimumDuration: 0.5) {
|
|
32
|
-
props.onLinkPress()
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
private var labelContent: some View {
|
|
38
|
-
HStack {
|
|
39
|
-
Children()
|
|
40
|
-
}
|
|
41
|
-
.frame(maxWidth: .infinity, alignment: .leading)
|
|
42
|
-
}
|
|
43
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import SwiftUI
|
|
2
|
-
import ExpoModulesCore
|
|
3
|
-
import ExpoUI
|
|
4
|
-
|
|
5
|
-
public final class NavigationStackViewProps: UIBaseViewProps {}
|
|
6
|
-
|
|
7
|
-
struct NavigationStackView: ExpoSwiftUI.View {
|
|
8
|
-
@ObservedObject public var props: NavigationStackViewProps
|
|
9
|
-
|
|
10
|
-
public init(props: NavigationStackViewProps) {
|
|
11
|
-
self.props = props
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
public var body: some View {
|
|
15
|
-
NavigationStack {
|
|
16
|
-
Children()
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
package/swift-ui/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../build/swift-ui/index';
|
package/swift-ui/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('../build/swift-ui/index.js');
|