@jarrodmedrano/ui 0.1.0 → 0.1.1

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.
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
10
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
11
+ var __spreadValues = (a, b) => {
12
+ for (var prop in b || (b = {}))
13
+ if (__hasOwnProp.call(b, prop))
14
+ __defNormalProp(a, prop, b[prop]);
15
+ if (__getOwnPropSymbols)
16
+ for (var prop of __getOwnPropSymbols(b)) {
17
+ if (__propIsEnum.call(b, prop))
18
+ __defNormalProp(a, prop, b[prop]);
19
+ }
20
+ return a;
21
+ };
22
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
23
+ var __objRest = (source, exclude) => {
24
+ var target = {};
25
+ for (var prop in source)
26
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
27
+ target[prop] = source[prop];
28
+ if (source != null && __getOwnPropSymbols)
29
+ for (var prop of __getOwnPropSymbols(source)) {
30
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
31
+ target[prop] = source[prop];
32
+ }
33
+ return target;
34
+ };
35
+ var __export = (target, all) => {
36
+ for (var name in all)
37
+ __defProp(target, name, { get: all[name], enumerable: true });
38
+ };
39
+ var __copyProps = (to, from, except, desc) => {
40
+ if (from && typeof from === "object" || typeof from === "function") {
41
+ for (let key of __getOwnPropNames(from))
42
+ if (!__hasOwnProp.call(to, key) && key !== except)
43
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
44
+ }
45
+ return to;
46
+ };
47
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
48
+ var link_exports = {};
49
+ __export(link_exports, {
50
+ A: () => A,
51
+ Text: () => Text
52
+ });
53
+ module.exports = __toCommonJS(link_exports);
54
+ var import_jsx_runtime = require("react/jsx-runtime");
55
+ var import_react_native = require("react-native");
56
+ var import_nativewind = require("nativewind");
57
+ const Text = (0, import_nativewind.styled)(import_react_native.Text);
58
+ const A = (_a) => {
59
+ var _b = _a, {
60
+ className = "",
61
+ href,
62
+ target,
63
+ ref
64
+ } = _b, props = __objRest(_b, [
65
+ "className",
66
+ "href",
67
+ "target",
68
+ "ref"
69
+ ]);
70
+ const nativeAProps = import_react_native.Platform.select({
71
+ web: {
72
+ href,
73
+ target,
74
+ hrefAttrs: {
75
+ rel: "noreferrer",
76
+ target
77
+ }
78
+ },
79
+ default: {
80
+ onPress: (event) => {
81
+ props.onPress && props.onPress(event);
82
+ if (import_react_native.Platform.OS !== "web" && href !== void 0) {
83
+ import_react_native.Linking.openURL(href);
84
+ }
85
+ }
86
+ }
87
+ });
88
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
89
+ Text,
90
+ __spreadProps(__spreadValues(__spreadValues({
91
+ role: "link",
92
+ className: `text-blue-500 hover:underline ${className}`
93
+ }, props), nativeAProps), {
94
+ ref
95
+ })
96
+ );
97
+ };
98
+ // Annotate the CommonJS export names for ESM import in node:
99
+ 0 && (module.exports = {
100
+ A,
101
+ Text
102
+ });
103
+ //# sourceMappingURL=link.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../components/generic/link.tsx"],"sourcesContent":["import { ComponentProps } from 'react'\nimport { Text as NativeText, Platform, Linking, TextStyle } from 'react-native'\n// @ts-ignore — nativewind v2 types not fully resolved in TS; runtime works correctly\nimport { styled, StyledProps } from 'nativewind'\n\nexport const Text = styled(NativeText)\n\n/**\n * This is a more advanced component with custom styles and per-platform functionality\n */\nexport interface AProps extends ComponentProps<typeof Text> {\n href?: string\n target?: '_blank'\n onPress?: (_event: any) => void\n style?: TextStyle\n className?: string\n ref?: any\n children?: React.ReactNode\n hrefAttrs?: {\n rel?: string\n target?: string\n }\n}\n\nexport const A = ({\n className = '',\n href,\n target,\n ref,\n ...props\n}: StyledProps<AProps>) => {\n const nativeAProps = Platform.select<Partial<AProps>>({\n web: {\n href,\n target,\n hrefAttrs: {\n rel: 'noreferrer',\n target,\n },\n },\n default: {\n onPress: (event) => {\n props.onPress && props.onPress(event)\n if (Platform.OS !== 'web' && href !== undefined) {\n Linking.openURL(href)\n }\n },\n },\n })\n\n return (\n <Text\n role=\"link\"\n className={`text-blue-500 hover:underline ${className}`}\n {...props}\n {...nativeAProps}\n ref={ref}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmDI;AAlDJ,0BAAiE;AAEjE,wBAAoC;AAE7B,MAAM,WAAO,0BAAO,oBAAAA,IAAU;AAmB9B,MAAM,IAAI,CAAC,OAMS;AANT,eAChB;AAAA,gBAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,EA5BF,IAwBkB,IAKb,kBALa,IAKb;AAAA,IAJH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAGA,QAAM,eAAe,6BAAS,OAAwB;AAAA,IACpD,KAAK;AAAA,MACH;AAAA,MACA;AAAA,MACA,WAAW;AAAA,QACT,KAAK;AAAA,QACL;AAAA,MACF;AAAA,IACF;AAAA,IACA,SAAS;AAAA,MACP,SAAS,CAAC,UAAU;AAClB,cAAM,WAAW,MAAM,QAAQ,KAAK;AACpC,YAAI,6BAAS,OAAO,SAAS,SAAS,QAAW;AAC/C,sCAAQ,QAAQ,IAAI;AAAA,QACtB;AAAA,MACF;AAAA,IACF;AAAA,EACF,CAAC;AAED,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,WAAW,iCAAiC,SAAS;AAAA,OACjD,QACA,eAJL;AAAA,MAKC;AAAA;AAAA,EACF;AAEJ;","names":["NativeText"]}
@@ -0,0 +1,22 @@
1
+ import { ComponentProps } from 'react';
2
+ import { TextStyle } from 'react-native';
3
+ import { StyledProps } from 'nativewind';
4
+ export declare const Text: any;
5
+ /**
6
+ * This is a more advanced component with custom styles and per-platform functionality
7
+ */
8
+ export interface AProps extends ComponentProps<typeof Text> {
9
+ href?: string;
10
+ target?: '_blank';
11
+ onPress?: (_event: any) => void;
12
+ style?: TextStyle;
13
+ className?: string;
14
+ ref?: any;
15
+ children?: React.ReactNode;
16
+ hrefAttrs?: {
17
+ rel?: string;
18
+ target?: string;
19
+ };
20
+ }
21
+ export declare const A: ({ className, href, target, ref, ...props }: StyledProps<AProps>) => import("react/jsx-runtime").JSX.Element;
22
+ //# sourceMappingURL=link.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../../components/generic/link.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,EAAyC,SAAS,EAAE,MAAM,cAAc,CAAA;AAE/E,OAAO,EAAU,WAAW,EAAE,MAAM,YAAY,CAAA;AAEhD,eAAO,MAAM,IAAI,KAAqB,CAAA;AAEtC;;GAEG;AACH,MAAM,WAAW,MAAO,SAAQ,cAAc,CAAC,OAAO,IAAI,CAAC;IACzD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,QAAQ,CAAA;IACjB,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,CAAA;IAC/B,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,GAAG,CAAC,EAAE,GAAG,CAAA;IACT,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,SAAS,CAAC,EAAE;QACV,GAAG,CAAC,EAAE,MAAM,CAAA;QACZ,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;CACF;AAED,eAAO,MAAM,CAAC,+CAMX,WAAW,CAAC,MAAM,CAAC,4CA6BrB,CAAA"}
@@ -0,0 +1,80 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __objRest = (source, exclude) => {
21
+ var target = {};
22
+ for (var prop in source)
23
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
+ target[prop] = source[prop];
25
+ if (source != null && __getOwnPropSymbols)
26
+ for (var prop of __getOwnPropSymbols(source)) {
27
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
+ target[prop] = source[prop];
29
+ }
30
+ return target;
31
+ };
32
+ import { jsx } from "react/jsx-runtime";
33
+ import { Text as NativeText, Platform, Linking } from "react-native";
34
+ import { styled } from "nativewind";
35
+ const Text = styled(NativeText);
36
+ const A = (_a) => {
37
+ var _b = _a, {
38
+ className = "",
39
+ href,
40
+ target,
41
+ ref
42
+ } = _b, props = __objRest(_b, [
43
+ "className",
44
+ "href",
45
+ "target",
46
+ "ref"
47
+ ]);
48
+ const nativeAProps = Platform.select({
49
+ web: {
50
+ href,
51
+ target,
52
+ hrefAttrs: {
53
+ rel: "noreferrer",
54
+ target
55
+ }
56
+ },
57
+ default: {
58
+ onPress: (event) => {
59
+ props.onPress && props.onPress(event);
60
+ if (Platform.OS !== "web" && href !== void 0) {
61
+ Linking.openURL(href);
62
+ }
63
+ }
64
+ }
65
+ });
66
+ return /* @__PURE__ */ jsx(
67
+ Text,
68
+ __spreadProps(__spreadValues(__spreadValues({
69
+ role: "link",
70
+ className: `text-blue-500 hover:underline ${className}`
71
+ }, props), nativeAProps), {
72
+ ref
73
+ })
74
+ );
75
+ };
76
+ export {
77
+ A,
78
+ Text
79
+ };
80
+ //# sourceMappingURL=link.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../components/generic/link.tsx"],"sourcesContent":["import { ComponentProps } from 'react'\nimport { Text as NativeText, Platform, Linking, TextStyle } from 'react-native'\n// @ts-ignore — nativewind v2 types not fully resolved in TS; runtime works correctly\nimport { styled, StyledProps } from 'nativewind'\n\nexport const Text = styled(NativeText)\n\n/**\n * This is a more advanced component with custom styles and per-platform functionality\n */\nexport interface AProps extends ComponentProps<typeof Text> {\n href?: string\n target?: '_blank'\n onPress?: (_event: any) => void\n style?: TextStyle\n className?: string\n ref?: any\n children?: React.ReactNode\n hrefAttrs?: {\n rel?: string\n target?: string\n }\n}\n\nexport const A = ({\n className = '',\n href,\n target,\n ref,\n ...props\n}: StyledProps<AProps>) => {\n const nativeAProps = Platform.select<Partial<AProps>>({\n web: {\n href,\n target,\n hrefAttrs: {\n rel: 'noreferrer',\n target,\n },\n },\n default: {\n onPress: (event) => {\n props.onPress && props.onPress(event)\n if (Platform.OS !== 'web' && href !== undefined) {\n Linking.openURL(href)\n }\n },\n },\n })\n\n return (\n <Text\n role=\"link\"\n className={`text-blue-500 hover:underline ${className}`}\n {...props}\n {...nativeAProps}\n ref={ref}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDI;AAlDJ,SAAS,QAAQ,YAAY,UAAU,eAA0B;AAEjE,SAAS,cAA2B;AAE7B,MAAM,OAAO,OAAO,UAAU;AAmB9B,MAAM,IAAI,CAAC,OAMS;AANT,eAChB;AAAA,gBAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,EA5BF,IAwBkB,IAKb,kBALa,IAKb;AAAA,IAJH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAGA,QAAM,eAAe,SAAS,OAAwB;AAAA,IACpD,KAAK;AAAA,MACH;AAAA,MACA;AAAA,MACA,WAAW;AAAA,QACT,KAAK;AAAA,QACL;AAAA,MACF;AAAA,IACF;AAAA,IACA,SAAS;AAAA,MACP,SAAS,CAAC,UAAU;AAClB,cAAM,WAAW,MAAM,QAAQ,KAAK;AACpC,YAAI,SAAS,OAAO,SAAS,SAAS,QAAW;AAC/C,kBAAQ,QAAQ,IAAI;AAAA,QACtB;AAAA,MACF;AAAA,IACF;AAAA,EACF,CAAC;AAED,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,WAAW,iCAAiC,SAAS;AAAA,OACjD,QACA,eAJL;AAAA,MAKC;AAAA;AAAA,EACF;AAEJ;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jarrodmedrano/ui",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": [