@cdx-ui/components 0.0.1-alpha.11 → 0.0.1-alpha.13
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/lib/commonjs/components/Heading/index.js +2 -2
- package/lib/commonjs/components/Heading/index.js.map +1 -1
- package/lib/commonjs/components/Link/index.js +38 -0
- package/lib/commonjs/components/Link/index.js.map +1 -0
- package/lib/commonjs/components/Link/styles.js +9 -0
- package/lib/commonjs/components/Link/styles.js.map +1 -0
- package/lib/commonjs/components/Text/index.js +2 -2
- package/lib/commonjs/components/Text/index.js.map +1 -1
- package/lib/commonjs/components/index.js +12 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/module/components/Heading/index.js +2 -2
- package/lib/module/components/Heading/index.js.map +1 -1
- package/lib/module/components/Link/index.js +29 -0
- package/lib/module/components/Link/index.js.map +1 -0
- package/lib/module/components/Link/styles.js +5 -0
- package/lib/module/components/Link/styles.js.map +1 -0
- package/lib/module/components/Text/index.js +2 -2
- package/lib/module/components/Text/index.js.map +1 -1
- package/lib/module/components/index.js +1 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/typescript/components/Heading/index.d.ts +3 -3
- package/lib/typescript/components/Heading/index.d.ts.map +1 -1
- package/lib/typescript/components/Link/index.d.ts +8 -0
- package/lib/typescript/components/Link/index.d.ts.map +1 -0
- package/lib/typescript/components/Link/styles.d.ts +2 -0
- package/lib/typescript/components/Link/styles.d.ts.map +1 -0
- package/lib/typescript/components/Text/index.d.ts +3 -3
- package/lib/typescript/components/Text/index.d.ts.map +1 -1
- package/lib/typescript/components/index.d.ts +1 -0
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/package.json +3 -4
- package/src/components/Heading/index.tsx +4 -4
- package/src/components/Link/index.tsx +27 -0
- package/src/components/Link/styles.ts +7 -0
- package/src/components/Text/index.tsx +4 -4
- package/src/components/index.ts +1 -0
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.Heading = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
|
-
var
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
9
|
var _utils = require("@cdx-ui/utils");
|
|
10
10
|
var _styles = require("./styles");
|
|
11
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -21,7 +21,7 @@ const Heading = exports.Heading = /*#__PURE__*/(0, _react.memo)(/*#__PURE__*/(0,
|
|
|
21
21
|
size = 'lg',
|
|
22
22
|
...props
|
|
23
23
|
}, ref) {
|
|
24
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
24
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
25
25
|
role: "heading",
|
|
26
26
|
"aria-level": sizeToLevel[size ?? 'lg'],
|
|
27
27
|
className: (0, _utils.cn)((0, _styles.headingStyle)({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_utils","_styles","_jsxRuntime","sizeToLevel","xl","lg","md","sm","xs","Heading","exports","memo","forwardRef","className","size","props","ref","jsx","Text","role","cn","headingStyle","displayName"],"sourceRoot":"../../../../src","sources":["components/Heading/index.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAAkE,IAAAI,WAAA,GAAAJ,OAAA;AAElE,MAAMK,WAAW,GAAG;EAClBC,EAAE,EAAE,CAAC;EACLC,EAAE,EAAE,CAAC;EACLC,EAAE,EAAE,CAAC;EACLC,EAAE,EAAE,CAAC;EACLC,EAAE,EAAE;AACN,CAAU;AAIH,MAAMC,OAAO,GAAAC,OAAA,CAAAD,OAAA,gBAAG,IAAAE,WAAI,eACzB,IAAAC,iBAAU,EAA0C,SAASH,OAAOA,CAClE;EAAEI,SAAS;EAAEC,IAAI,GAAG,IAAI;EAAE,GAAGC;AAAM,CAAC,EACpCC,GAAG,EACH;EACA,oBACE,IAAAd,WAAA,CAAAe,GAAA,EAAClB,YAAA,CAAAmB,IAAI;IACHC,IAAI,EAAC,SAAS;IACd,cAAYhB,WAAW,CAACW,IAAI,IAAI,IAAI,CAAE;IACtCD,SAAS,EAAE,IAAAO,SAAE,EAAC,IAAAC,oBAAY,EAAC;MAAEP;IAAK,CAAC,CAAC,EAAED,SAAS,CAAE;IAAA,GAC7CE,KAAK;IACTC,GAAG,EAAEA;EAAI,CACV,CAAC;AAEN,CAAC,CACH,CAAC;AAEDP,OAAO,CAACa,WAAW,GAAG,SAAS","ignoreList":[]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Link = void 0;
|
|
7
|
+
Object.defineProperty(exports, "LinkProvider", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return _primitives.LinkProvider;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
var _react = require("react");
|
|
14
|
+
var _reactNative = require("react-native");
|
|
15
|
+
var _primitives = require("@cdx-ui/primitives");
|
|
16
|
+
var _utils = require("@cdx-ui/utils");
|
|
17
|
+
var _styles = require("./styles");
|
|
18
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
+
const LinkPrimitive = (0, _primitives.createLink)({
|
|
20
|
+
Root: _reactNative.Pressable
|
|
21
|
+
});
|
|
22
|
+
const Link = exports.Link = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
23
|
+
className,
|
|
24
|
+
children,
|
|
25
|
+
style,
|
|
26
|
+
...props
|
|
27
|
+
}, ref) => {
|
|
28
|
+
const rootClassName = (0, _utils.cn)((0, _styles.linkRootVariants)(), className);
|
|
29
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(LinkPrimitive, {
|
|
30
|
+
ref: ref,
|
|
31
|
+
className: rootClassName,
|
|
32
|
+
style: style,
|
|
33
|
+
...props,
|
|
34
|
+
children: children
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
Link.displayName = 'Link';
|
|
38
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_primitives","_utils","_styles","_jsxRuntime","LinkPrimitive","createLink","Root","Pressable","Link","exports","forwardRef","className","children","style","props","ref","rootClassName","cn","linkRootVariants","jsx","displayName"],"sourceRoot":"../../../../src","sources":["components/Link/index.tsx"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAA4C,IAAAK,WAAA,GAAAL,OAAA;AAI5C,MAAMM,aAAa,GAAG,IAAAC,sBAAU,EAAC;EAC/BC,IAAI,EAAEC;AACR,CAAC,CAAC;AAMK,MAAMC,IAAI,GAAAC,OAAA,CAAAD,IAAA,gBAAG,IAAAE,iBAAU,EAAkB,CAAC;EAAEC,SAAS;EAAEC,QAAQ;EAAEC,KAAK;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAG,KAAK;EACjG,MAAMC,aAAa,GAAG,IAAAC,SAAE,EAAC,IAAAC,wBAAgB,EAAC,CAAC,EAAEP,SAAS,CAAC;EAEvD,oBACE,IAAAR,WAAA,CAAAgB,GAAA,EAACf,aAAa;IAACW,GAAG,EAAEA,GAAI;IAACJ,SAAS,EAAEK,aAAc;IAACH,KAAK,EAAEA,KAAM;IAAA,GAAKC,KAAK;IAAAF,QAAA,EACvEA;EAAQ,CACI,CAAC;AAEpB,CAAC,CAAC;AAEFJ,IAAI,CAACY,WAAW,GAAG,MAAM","ignoreList":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.linkRootVariants = void 0;
|
|
7
|
+
var _classVarianceAuthority = require("class-variance-authority");
|
|
8
|
+
const linkRootVariants = exports.linkRootVariants = (0, _classVarianceAuthority.cva)(['flex-row items-center', 'web:outline-none web:focus:outline-none web:focus-visible:outline-none', 'web:data-[focus-visible=true]:ring-2 web:data-[focus-visible=true]:ring-blue-300/50']);
|
|
9
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_classVarianceAuthority","require","linkRootVariants","exports","cva"],"sourceRoot":"../../../../src","sources":["components/Link/styles.ts"],"mappings":";;;;;;AAAA,IAAAA,uBAAA,GAAAC,OAAA;AAEO,MAAMC,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAG,IAAAE,2BAAG,EAAC,CAClC,uBAAuB,EACvB,wEAAwE,EACxE,qFAAqF,CACtF,CAAC","ignoreList":[]}
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.Text = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
|
-
var
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
9
|
var _utils = require("@cdx-ui/utils");
|
|
10
10
|
var _styles = require("./styles");
|
|
11
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -14,7 +14,7 @@ const Text = exports.Text = /*#__PURE__*/(0, _react.forwardRef)(function Text({
|
|
|
14
14
|
size = 'md',
|
|
15
15
|
...props
|
|
16
16
|
}, ref) {
|
|
17
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
17
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
18
18
|
className: (0, _utils.cn)((0, _styles.textStyle)({
|
|
19
19
|
size
|
|
20
20
|
}), className),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_utils","_styles","_jsxRuntime","Text","exports","forwardRef","className","size","props","ref","jsx","cn","textStyle","displayName"],"sourceRoot":"../../../../src","sources":["components/Text/index.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAAuD,IAAAI,WAAA,GAAAJ,OAAA;AAIhD,MAAMK,IAAI,GAAAC,OAAA,CAAAD,IAAA,gBAAG,IAAAE,iBAAU,EAAyC,SAASF,IAAIA,CAClF;EAAEG,SAAS;EAAEC,IAAI,GAAG,IAAI;EAAE,GAAGC;AAAM,CAAC,EACpCC,GAAG,EACH;EACA,oBAAO,IAAAP,WAAA,CAAAQ,GAAA,EAACX,YAAA,CAAAI,IAAM;IAACG,SAAS,EAAE,IAAAK,SAAE,EAAC,IAAAC,iBAAS,EAAC;MAAEL;IAAK,CAAC,CAAC,EAAED,SAAS,CAAE;IAAA,GAAKE,KAAK;IAAEC,GAAG,EAAEA;EAAI,CAAE,CAAC;AACvF,CAAC,CAAC;AAEFN,IAAI,CAACU,WAAW,GAAG,MAAM","ignoreList":[]}
|
|
@@ -67,6 +67,18 @@ Object.keys(_Input).forEach(function (key) {
|
|
|
67
67
|
}
|
|
68
68
|
});
|
|
69
69
|
});
|
|
70
|
+
var _Link = require("./Link");
|
|
71
|
+
Object.keys(_Link).forEach(function (key) {
|
|
72
|
+
if (key === "default" || key === "__esModule") return;
|
|
73
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
74
|
+
if (key in exports && exports[key] === _Link[key]) return;
|
|
75
|
+
Object.defineProperty(exports, key, {
|
|
76
|
+
enumerable: true,
|
|
77
|
+
get: function () {
|
|
78
|
+
return _Link[key];
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
});
|
|
70
82
|
var _Select = require("./Select");
|
|
71
83
|
Object.keys(_Select).forEach(function (key) {
|
|
72
84
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_Box","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_Button","_Checkbox","_Input","_Select","_Switch","_Stack","_Heading","_Text"],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,IAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,IAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAL,IAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAb,IAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,OAAA,GAAAb,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAW,OAAA,EAAAV,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAS,OAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,OAAA,CAAAT,GAAA;IAAA;EAAA;AAAA;AACA,IAAAU,SAAA,GAAAd,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAY,SAAA,EAAAX,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAU,SAAA,CAAAV,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAE,SAAA,CAAAV,GAAA;IAAA;EAAA;AAAA;AACA,IAAAW,MAAA,GAAAf,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAa,MAAA,EAAAZ,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAW,MAAA,CAAAX,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAG,MAAA,CAAAX,GAAA;IAAA;EAAA;AAAA;AACA,IAAAY,
|
|
1
|
+
{"version":3,"names":["_Box","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_Button","_Checkbox","_Input","_Link","_Select","_Switch","_Stack","_Heading","_Text"],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,IAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,IAAA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H,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAiB,KAAA,CAAAjB,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAS,KAAA,CAAAjB,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { forwardRef, memo } from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { Text } from 'react-native';
|
|
5
5
|
import { cn } from '@cdx-ui/utils';
|
|
6
6
|
import { headingStyle } from './styles';
|
|
7
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -17,7 +17,7 @@ export const Heading = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function Headin
|
|
|
17
17
|
size = 'lg',
|
|
18
18
|
...props
|
|
19
19
|
}, ref) {
|
|
20
|
-
return /*#__PURE__*/_jsx(
|
|
20
|
+
return /*#__PURE__*/_jsx(Text, {
|
|
21
21
|
role: "heading",
|
|
22
22
|
"aria-level": sizeToLevel[size ?? 'lg'],
|
|
23
23
|
className: cn(headingStyle({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["forwardRef","memo","
|
|
1
|
+
{"version":3,"names":["forwardRef","memo","Text","cn","headingStyle","jsx","_jsx","sizeToLevel","xl","lg","md","sm","xs","Heading","className","size","props","ref","role","displayName"],"sourceRoot":"../../../../src","sources":["components/Heading/index.tsx"],"mappings":";;AAAA,SAASA,UAAU,EAAEC,IAAI,QAA0D,OAAO;AAC1F,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,EAAE,QAAQ,eAAe;AAClC,SAASC,YAAY,QAAkC,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAElE,MAAMC,WAAW,GAAG;EAClBC,EAAE,EAAE,CAAC;EACLC,EAAE,EAAE,CAAC;EACLC,EAAE,EAAE,CAAC;EACLC,EAAE,EAAE,CAAC;EACLC,EAAE,EAAE;AACN,CAAU;AAIV,OAAO,MAAMC,OAAO,gBAAGZ,IAAI,cACzBD,UAAU,CAA0C,SAASa,OAAOA,CAClE;EAAEC,SAAS;EAAEC,IAAI,GAAG,IAAI;EAAE,GAAGC;AAAM,CAAC,EACpCC,GAAG,EACH;EACA,oBACEX,IAAA,CAACJ,IAAI;IACHgB,IAAI,EAAC,SAAS;IACd,cAAYX,WAAW,CAACQ,IAAI,IAAI,IAAI,CAAE;IACtCD,SAAS,EAAEX,EAAE,CAACC,YAAY,CAAC;MAAEW;IAAK,CAAC,CAAC,EAAED,SAAS,CAAE;IAAA,GAC7CE,KAAK;IACTC,GAAG,EAAEA;EAAI,CACV,CAAC;AAEN,CAAC,CACH,CAAC;AAEDJ,OAAO,CAACM,WAAW,GAAG,SAAS","ignoreList":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { Pressable } from 'react-native';
|
|
5
|
+
import { createLink } from '@cdx-ui/primitives';
|
|
6
|
+
import { cn } from '@cdx-ui/utils';
|
|
7
|
+
import { linkRootVariants } from './styles';
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
export { LinkProvider } from '@cdx-ui/primitives';
|
|
10
|
+
const LinkPrimitive = createLink({
|
|
11
|
+
Root: Pressable
|
|
12
|
+
});
|
|
13
|
+
export const Link = /*#__PURE__*/forwardRef(({
|
|
14
|
+
className,
|
|
15
|
+
children,
|
|
16
|
+
style,
|
|
17
|
+
...props
|
|
18
|
+
}, ref) => {
|
|
19
|
+
const rootClassName = cn(linkRootVariants(), className);
|
|
20
|
+
return /*#__PURE__*/_jsx(LinkPrimitive, {
|
|
21
|
+
ref: ref,
|
|
22
|
+
className: rootClassName,
|
|
23
|
+
style: style,
|
|
24
|
+
...props,
|
|
25
|
+
children: children
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
Link.displayName = 'Link';
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["forwardRef","Pressable","createLink","cn","linkRootVariants","jsx","_jsx","LinkProvider","LinkPrimitive","Root","Link","className","children","style","props","ref","rootClassName","displayName"],"sourceRoot":"../../../../src","sources":["components/Link/index.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,OAAO;AAClC,SAASC,SAAS,QAAmB,cAAc;AACnD,SAASC,UAAU,QAAyB,oBAAoB;AAChE,SAASC,EAAE,QAAQ,eAAe;AAClC,SAASC,gBAAgB,QAAQ,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE5C,SAASC,YAAY,QAA0C,oBAAoB;AAEnF,MAAMC,aAAa,GAAGN,UAAU,CAAC;EAC/BO,IAAI,EAAER;AACR,CAAC,CAAC;AAMF,OAAO,MAAMS,IAAI,gBAAGV,UAAU,CAAkB,CAAC;EAAEW,SAAS;EAAEC,QAAQ;EAAEC,KAAK;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAG,KAAK;EACjG,MAAMC,aAAa,GAAGb,EAAE,CAACC,gBAAgB,CAAC,CAAC,EAAEO,SAAS,CAAC;EAEvD,oBACEL,IAAA,CAACE,aAAa;IAACO,GAAG,EAAEA,GAAI;IAACJ,SAAS,EAAEK,aAAc;IAACH,KAAK,EAAEA,KAAM;IAAA,GAAKC,KAAK;IAAAF,QAAA,EACvEA;EAAQ,CACI,CAAC;AAEpB,CAAC,CAAC;AAEFF,IAAI,CAACO,WAAW,GAAG,MAAM","ignoreList":[]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { cva } from 'class-variance-authority';
|
|
4
|
+
export const linkRootVariants = cva(['flex-row items-center', 'web:outline-none web:focus:outline-none web:focus-visible:outline-none', 'web:data-[focus-visible=true]:ring-2 web:data-[focus-visible=true]:ring-blue-300/50']);
|
|
5
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["cva","linkRootVariants"],"sourceRoot":"../../../../src","sources":["components/Link/styles.ts"],"mappings":";;AAAA,SAASA,GAAG,QAAQ,0BAA0B;AAE9C,OAAO,MAAMC,gBAAgB,GAAGD,GAAG,CAAC,CAClC,uBAAuB,EACvB,wEAAwE,EACxE,qFAAqF,CACtF,CAAC","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { Text as RNText } from 'react-native';
|
|
5
5
|
import { cn } from '@cdx-ui/utils';
|
|
6
6
|
import { textStyle } from './styles';
|
|
7
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -10,7 +10,7 @@ export const Text = /*#__PURE__*/forwardRef(function Text({
|
|
|
10
10
|
size = 'md',
|
|
11
11
|
...props
|
|
12
12
|
}, ref) {
|
|
13
|
-
return /*#__PURE__*/_jsx(
|
|
13
|
+
return /*#__PURE__*/_jsx(RNText, {
|
|
14
14
|
className: cn(textStyle({
|
|
15
15
|
size
|
|
16
16
|
}), className),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["forwardRef","
|
|
1
|
+
{"version":3,"names":["forwardRef","Text","RNText","cn","textStyle","jsx","_jsx","className","size","props","ref","displayName"],"sourceRoot":"../../../../src","sources":["components/Text/index.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAA0D,OAAO;AACpF,SAASC,IAAI,IAAIC,MAAM,QAAQ,cAAc;AAC7C,SAASC,EAAE,QAAQ,eAAe;AAClC,SAASC,SAAS,QAA0B,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAIvD,OAAO,MAAML,IAAI,gBAAGD,UAAU,CAAyC,SAASC,IAAIA,CAClF;EAAEM,SAAS;EAAEC,IAAI,GAAG,IAAI;EAAE,GAAGC;AAAM,CAAC,EACpCC,GAAG,EACH;EACA,oBAAOJ,IAAA,CAACJ,MAAM;IAACK,SAAS,EAAEJ,EAAE,CAACC,SAAS,CAAC;MAAEI;IAAK,CAAC,CAAC,EAAED,SAAS,CAAE;IAAA,GAAKE,KAAK;IAAEC,GAAG,EAAEA;EAAI,CAAE,CAAC;AACvF,CAAC,CAAC;AAEFT,IAAI,CAACU,WAAW,GAAG,MAAM","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["HStack","VStack"],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":";;AAAA,cAAc,OAAO;AACrB,cAAc,UAAU;AACxB,cAAc,YAAY;AAC1B,cAAc,SAAS;AACvB,cAAc,UAAU;AACxB,cAAc,UAAU;AACxB,SAASA,MAAM,EAAEC,MAAM,QAAQ,SAAS;AACxC,cAAc,WAAW;AACzB,cAAc,QAAQ","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["HStack","VStack"],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":";;AAAA,cAAc,OAAO;AACrB,cAAc,UAAU;AACxB,cAAc,YAAY;AAC1B,cAAc,SAAS;AACvB,cAAc,QAAQ;AACtB,cAAc,UAAU;AACxB,cAAc,UAAU;AACxB,SAASA,MAAM,EAAEC,MAAM,QAAQ,SAAS;AACxC,cAAc,WAAW;AACzB,cAAc,QAAQ","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Text } from 'react-native';
|
|
3
3
|
import { type HeadingVariantProps } from './styles';
|
|
4
|
-
export type HeadingProps = HeadingVariantProps & ComponentPropsWithoutRef<typeof
|
|
5
|
-
export declare const Heading: import("react").NamedExoticComponent<HeadingVariantProps &
|
|
4
|
+
export type HeadingProps = HeadingVariantProps & ComponentPropsWithoutRef<typeof Text>;
|
|
5
|
+
export declare const Heading: import("react").NamedExoticComponent<HeadingVariantProps & import("react-native").TextProps & import("react").RefAttributes<Text>>;
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Heading/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuC,KAAK,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAC3F,OAAO,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Heading/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuC,KAAK,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAC3F,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,OAAO,EAAgB,KAAK,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAUlE,MAAM,MAAM,YAAY,GAAG,mBAAmB,GAAG,wBAAwB,CAAC,OAAO,IAAI,CAAC,CAAC;AAEvF,eAAO,MAAM,OAAO,oIAenB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type View } from 'react-native';
|
|
2
|
+
import { type ILinkProps } from '@cdx-ui/primitives';
|
|
3
|
+
export { LinkProvider, type LinkConfig, type LinkAction } from '@cdx-ui/primitives';
|
|
4
|
+
export interface LinkProps extends ILinkProps {
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const Link: import("react").ForwardRefExoticComponent<LinkProps & import("react").RefAttributes<View>>;
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Link/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAa,KAAK,IAAI,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAc,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAIjE,OAAO,EAAE,YAAY,EAAE,KAAK,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAMpF,MAAM,WAAW,SAAU,SAAQ,UAAU;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,IAAI,4FAQf,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Link/styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB,oFAI3B,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Text as RNText } from 'react-native';
|
|
3
3
|
import { TextVariantProps } from './styles';
|
|
4
|
-
export type TextProps = TextVariantProps & ComponentPropsWithoutRef<typeof
|
|
5
|
-
export declare const Text: import("react").ForwardRefExoticComponent<TextVariantProps &
|
|
4
|
+
export type TextProps = TextVariantProps & ComponentPropsWithoutRef<typeof RNText>;
|
|
5
|
+
export declare const Text: import("react").ForwardRefExoticComponent<TextVariantProps & import("react-native").TextProps & import("react").RefAttributes<RNText>>;
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Text/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,wBAAwB,EAAqB,MAAM,OAAO,CAAC;AACrF,OAAO,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Text/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,wBAAwB,EAAqB,MAAM,OAAO,CAAC;AACrF,OAAO,EAAE,IAAI,IAAI,MAAM,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAa,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEvD,MAAM,MAAM,SAAS,GAAG,gBAAgB,GAAG,wBAAwB,CAAC,OAAO,MAAM,CAAC,CAAC;AAEnF,eAAO,MAAM,IAAI,wIAKf,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACzC,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACzC,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cdx-ui/components",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.13",
|
|
4
4
|
"main": "lib/commonjs/index.js",
|
|
5
5
|
"module": "lib/module/index.js",
|
|
6
6
|
"react-native": "src/index.ts",
|
|
@@ -58,11 +58,10 @@
|
|
|
58
58
|
}
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@expo/html-elements": "55.0.3",
|
|
62
61
|
"class-variance-authority": "^0.7.1",
|
|
63
62
|
"uniwind": "1.4.1",
|
|
64
|
-
"@cdx-ui/primitives": "0.0.1-alpha.
|
|
65
|
-
"@cdx-ui/utils": "0.0.1-alpha.
|
|
63
|
+
"@cdx-ui/primitives": "0.0.1-alpha.13",
|
|
64
|
+
"@cdx-ui/utils": "0.0.1-alpha.13"
|
|
66
65
|
},
|
|
67
66
|
"devDependencies": {
|
|
68
67
|
"@types/react": "*",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { forwardRef, memo, type ComponentRef, type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Text } from 'react-native';
|
|
3
3
|
import { cn } from '@cdx-ui/utils';
|
|
4
4
|
import { headingStyle, type HeadingVariantProps } from './styles';
|
|
5
5
|
|
|
@@ -11,15 +11,15 @@ const sizeToLevel = {
|
|
|
11
11
|
xs: 5,
|
|
12
12
|
} as const;
|
|
13
13
|
|
|
14
|
-
export type HeadingProps = HeadingVariantProps & ComponentPropsWithoutRef<typeof
|
|
14
|
+
export type HeadingProps = HeadingVariantProps & ComponentPropsWithoutRef<typeof Text>;
|
|
15
15
|
|
|
16
16
|
export const Heading = memo(
|
|
17
|
-
forwardRef<ComponentRef<typeof
|
|
17
|
+
forwardRef<ComponentRef<typeof Text>, HeadingProps>(function Heading(
|
|
18
18
|
{ className, size = 'lg', ...props },
|
|
19
19
|
ref,
|
|
20
20
|
) {
|
|
21
21
|
return (
|
|
22
|
-
<
|
|
22
|
+
<Text
|
|
23
23
|
role="heading"
|
|
24
24
|
aria-level={sizeToLevel[size ?? 'lg']}
|
|
25
25
|
className={cn(headingStyle({ size }), className)}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
|
+
import { Pressable, type View } from 'react-native';
|
|
3
|
+
import { createLink, type ILinkProps } from '@cdx-ui/primitives';
|
|
4
|
+
import { cn } from '@cdx-ui/utils';
|
|
5
|
+
import { linkRootVariants } from './styles';
|
|
6
|
+
|
|
7
|
+
export { LinkProvider, type LinkConfig, type LinkAction } from '@cdx-ui/primitives';
|
|
8
|
+
|
|
9
|
+
const LinkPrimitive = createLink({
|
|
10
|
+
Root: Pressable,
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export interface LinkProps extends ILinkProps {
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const Link = forwardRef<View, LinkProps>(({ className, children, style, ...props }, ref) => {
|
|
18
|
+
const rootClassName = cn(linkRootVariants(), className);
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<LinkPrimitive ref={ref} className={rootClassName} style={style} {...props}>
|
|
22
|
+
{children}
|
|
23
|
+
</LinkPrimitive>
|
|
24
|
+
);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
Link.displayName = 'Link';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { cva } from 'class-variance-authority';
|
|
2
|
+
|
|
3
|
+
export const linkRootVariants = cva([
|
|
4
|
+
'flex-row items-center',
|
|
5
|
+
'web:outline-none web:focus:outline-none web:focus-visible:outline-none',
|
|
6
|
+
'web:data-[focus-visible=true]:ring-2 web:data-[focus-visible=true]:ring-blue-300/50',
|
|
7
|
+
]);
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { forwardRef, type ComponentPropsWithoutRef, type ComponentRef } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Text as RNText } from 'react-native';
|
|
3
3
|
import { cn } from '@cdx-ui/utils';
|
|
4
4
|
import { textStyle, TextVariantProps } from './styles';
|
|
5
5
|
|
|
6
|
-
export type TextProps = TextVariantProps & ComponentPropsWithoutRef<typeof
|
|
6
|
+
export type TextProps = TextVariantProps & ComponentPropsWithoutRef<typeof RNText>;
|
|
7
7
|
|
|
8
|
-
export const Text = forwardRef<ComponentRef<typeof
|
|
8
|
+
export const Text = forwardRef<ComponentRef<typeof RNText>, TextProps>(function Text(
|
|
9
9
|
{ className, size = 'md', ...props },
|
|
10
10
|
ref,
|
|
11
11
|
) {
|
|
12
|
-
return <
|
|
12
|
+
return <RNText className={cn(textStyle({ size }), className)} {...props} ref={ref} />;
|
|
13
13
|
});
|
|
14
14
|
|
|
15
15
|
Text.displayName = 'Text';
|
package/src/components/index.ts
CHANGED