@cdx-ui/components 0.0.1-alpha.12 → 0.0.1-alpha.14
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/Icon/index.js +60 -0
- package/lib/commonjs/components/Icon/index.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/Icon/index.js +56 -0
- package/lib/module/components/Icon/index.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/Icon/index.d.ts +28 -0
- package/lib/typescript/components/Icon/index.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 +4 -4
- package/src/components/Heading/index.tsx +4 -4
- package/src/components/Icon/index.tsx +49 -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,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Icon = Icon;
|
|
7
|
+
var _uniwind = require("uniwind");
|
|
8
|
+
var _utils = require("@cdx-ui/utils");
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
function IconImpl({
|
|
11
|
+
as: IconComponent,
|
|
12
|
+
...props
|
|
13
|
+
}) {
|
|
14
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(IconComponent, {
|
|
15
|
+
...props
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
const StyledIcon = (0, _uniwind.withUniwind)(IconImpl, {
|
|
19
|
+
size: {
|
|
20
|
+
fromClassName: 'className',
|
|
21
|
+
styleProperty: 'width'
|
|
22
|
+
},
|
|
23
|
+
color: {
|
|
24
|
+
fromClassName: 'className',
|
|
25
|
+
styleProperty: 'color'
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* A wrapper component for CDX icons with Uniwind `className` support via `withUniwind`.
|
|
31
|
+
*
|
|
32
|
+
* This component allows you to render any CDX icon while applying utility classes
|
|
33
|
+
* using `uniwind`. It avoids the need to wrap or configure each icon individually.
|
|
34
|
+
*
|
|
35
|
+
* @component
|
|
36
|
+
* @example
|
|
37
|
+
* ```tsx
|
|
38
|
+
* import { Icon } from '@cdx-ui/components';
|
|
39
|
+
* import { ArrowRight } from '@cdx-ui/icons';
|
|
40
|
+
*
|
|
41
|
+
* <Icon as={ArrowRight} className="text-red-500 size-4" />
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* @param {CdxIcon} as - The CDX icon component to render.
|
|
45
|
+
* @param {string} className - Utility classes to style the icon using Uniwind.
|
|
46
|
+
* @param {number} size - Icon size (overrides the size class).
|
|
47
|
+
* @param {...CdxIconProps} ...props - Additional icon props passed to the "as" icon.
|
|
48
|
+
*/
|
|
49
|
+
function Icon({
|
|
50
|
+
as: IconComponent,
|
|
51
|
+
className,
|
|
52
|
+
...props
|
|
53
|
+
}) {
|
|
54
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledIcon, {
|
|
55
|
+
as: IconComponent,
|
|
56
|
+
className: (0, _utils.cn)('text-foreground size-5', className),
|
|
57
|
+
...props
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_uniwind","require","_utils","_jsxRuntime","IconImpl","as","IconComponent","props","jsx","StyledIcon","withUniwind","size","fromClassName","styleProperty","color","Icon","className","cn"],"sourceRoot":"../../../../src","sources":["components/Icon/index.tsx"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAAmC,IAAAE,WAAA,GAAAF,OAAA;AAQnC,SAASG,QAAQA,CAAC;EAAEC,EAAE,EAAEC,aAAa;EAAE,GAAGC;AAAiB,CAAC,EAAE;EAC5D,oBAAO,IAAAJ,WAAA,CAAAK,GAAA,EAACF,aAAa;IAAA,GAAKC;EAAK,CAAG,CAAC;AACrC;AAEA,MAAME,UAAU,GAAG,IAAAC,oBAAW,EAACN,QAAQ,EAAE;EACvCO,IAAI,EAAE;IACJC,aAAa,EAAE,WAAW;IAC1BC,aAAa,EAAE;EACjB,CAAC;EACDC,KAAK,EAAE;IACLF,aAAa,EAAE,WAAW;IAC1BC,aAAa,EAAE;EACjB;AACF,CAAC,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,IAAIA,CAAC;EAAEV,EAAE,EAAEC,aAAa;EAAEU,SAAS;EAAE,GAAGT;AAAiB,CAAC,EAAE;EAC1E,oBACE,IAAAJ,WAAA,CAAAK,GAAA,EAACC,UAAU;IAACJ,EAAE,EAAEC,aAAc;IAACU,SAAS,EAAE,IAAAC,SAAE,EAAC,wBAAwB,EAAED,SAAS,CAAE;IAAA,GAAKT;EAAK,CAAG,CAAC;AAEpG","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":[]}
|
|
@@ -128,4 +128,16 @@ Object.keys(_Text).forEach(function (key) {
|
|
|
128
128
|
}
|
|
129
129
|
});
|
|
130
130
|
});
|
|
131
|
+
var _Icon = require("./Icon");
|
|
132
|
+
Object.keys(_Icon).forEach(function (key) {
|
|
133
|
+
if (key === "default" || key === "__esModule") return;
|
|
134
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
135
|
+
if (key in exports && exports[key] === _Icon[key]) return;
|
|
136
|
+
Object.defineProperty(exports, key, {
|
|
137
|
+
enumerable: true,
|
|
138
|
+
get: function () {
|
|
139
|
+
return _Icon[key];
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
});
|
|
131
143
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
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.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,MAAA,CAAAC,IAAA,CAAAmB,KAAA,EAAAlB,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,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
|
+
{"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","_Icon"],"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,MA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,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAkB,KAAA,CAAAlB,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAU,KAAA,CAAAlB,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,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { withUniwind } from 'uniwind';
|
|
4
|
+
import { cn } from '@cdx-ui/utils';
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
function IconImpl({
|
|
7
|
+
as: IconComponent,
|
|
8
|
+
...props
|
|
9
|
+
}) {
|
|
10
|
+
return /*#__PURE__*/_jsx(IconComponent, {
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
const StyledIcon = withUniwind(IconImpl, {
|
|
15
|
+
size: {
|
|
16
|
+
fromClassName: 'className',
|
|
17
|
+
styleProperty: 'width'
|
|
18
|
+
},
|
|
19
|
+
color: {
|
|
20
|
+
fromClassName: 'className',
|
|
21
|
+
styleProperty: 'color'
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* A wrapper component for CDX icons with Uniwind `className` support via `withUniwind`.
|
|
27
|
+
*
|
|
28
|
+
* This component allows you to render any CDX icon while applying utility classes
|
|
29
|
+
* using `uniwind`. It avoids the need to wrap or configure each icon individually.
|
|
30
|
+
*
|
|
31
|
+
* @component
|
|
32
|
+
* @example
|
|
33
|
+
* ```tsx
|
|
34
|
+
* import { Icon } from '@cdx-ui/components';
|
|
35
|
+
* import { ArrowRight } from '@cdx-ui/icons';
|
|
36
|
+
*
|
|
37
|
+
* <Icon as={ArrowRight} className="text-red-500 size-4" />
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @param {CdxIcon} as - The CDX icon component to render.
|
|
41
|
+
* @param {string} className - Utility classes to style the icon using Uniwind.
|
|
42
|
+
* @param {number} size - Icon size (overrides the size class).
|
|
43
|
+
* @param {...CdxIconProps} ...props - Additional icon props passed to the "as" icon.
|
|
44
|
+
*/
|
|
45
|
+
export function Icon({
|
|
46
|
+
as: IconComponent,
|
|
47
|
+
className,
|
|
48
|
+
...props
|
|
49
|
+
}) {
|
|
50
|
+
return /*#__PURE__*/_jsx(StyledIcon, {
|
|
51
|
+
as: IconComponent,
|
|
52
|
+
className: cn('text-foreground size-5', className),
|
|
53
|
+
...props
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["withUniwind","cn","jsx","_jsx","IconImpl","as","IconComponent","props","StyledIcon","size","fromClassName","styleProperty","color","Icon","className"],"sourceRoot":"../../../../src","sources":["components/Icon/index.tsx"],"mappings":";;AAAA,SAASA,WAAW,QAAQ,SAAS;AACrC,SAASC,EAAE,QAAQ,eAAe;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAQnC,SAASC,QAAQA,CAAC;EAAEC,EAAE,EAAEC,aAAa;EAAE,GAAGC;AAAiB,CAAC,EAAE;EAC5D,oBAAOJ,IAAA,CAACG,aAAa;IAAA,GAAKC;EAAK,CAAG,CAAC;AACrC;AAEA,MAAMC,UAAU,GAAGR,WAAW,CAACI,QAAQ,EAAE;EACvCK,IAAI,EAAE;IACJC,aAAa,EAAE,WAAW;IAC1BC,aAAa,EAAE;EACjB,CAAC;EACDC,KAAK,EAAE;IACLF,aAAa,EAAE,WAAW;IAC1BC,aAAa,EAAE;EACjB;AACF,CAAC,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,IAAIA,CAAC;EAAER,EAAE,EAAEC,aAAa;EAAEQ,SAAS;EAAE,GAAGP;AAAiB,CAAC,EAAE;EAC1E,oBACEJ,IAAA,CAACK,UAAU;IAACH,EAAE,EAAEC,aAAc;IAACQ,SAAS,EAAEb,EAAE,CAAC,wBAAwB,EAAEa,SAAS,CAAE;IAAA,GAAKP;EAAK,CAAG,CAAC;AAEpG","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,QAAQ;AACtB,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;AACtB,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,28 @@
|
|
|
1
|
+
import type { CdxIcon, CdxIconProps } from '@cdx-ui/icons';
|
|
2
|
+
type IconProps = CdxIconProps & {
|
|
3
|
+
className?: string;
|
|
4
|
+
as: CdxIcon;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* A wrapper component for CDX icons with Uniwind `className` support via `withUniwind`.
|
|
8
|
+
*
|
|
9
|
+
* This component allows you to render any CDX icon while applying utility classes
|
|
10
|
+
* using `uniwind`. It avoids the need to wrap or configure each icon individually.
|
|
11
|
+
*
|
|
12
|
+
* @component
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* import { Icon } from '@cdx-ui/components';
|
|
16
|
+
* import { ArrowRight } from '@cdx-ui/icons';
|
|
17
|
+
*
|
|
18
|
+
* <Icon as={ArrowRight} className="text-red-500 size-4" />
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @param {CdxIcon} as - The CDX icon component to render.
|
|
22
|
+
* @param {string} className - Utility classes to style the icon using Uniwind.
|
|
23
|
+
* @param {number} size - Icon size (overrides the size class).
|
|
24
|
+
* @param {...CdxIconProps} ...props - Additional icon props passed to the "as" icon.
|
|
25
|
+
*/
|
|
26
|
+
export declare function Icon({ as: IconComponent, className, ...props }: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Icon/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE3D,KAAK,SAAS,GAAG,YAAY,GAAG;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,EAAE,OAAO,CAAC;CACb,CAAC;AAiBF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,IAAI,CAAC,EAAE,EAAE,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,2CAIzE"}
|
|
@@ -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,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"}
|
|
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;AACvB,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.14",
|
|
4
4
|
"main": "lib/commonjs/index.js",
|
|
5
5
|
"module": "lib/module/index.js",
|
|
6
6
|
"react-native": "src/index.ts",
|
|
@@ -58,11 +58,11 @@
|
|
|
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.14",
|
|
64
|
+
"@cdx-ui/utils": "0.0.1-alpha.14",
|
|
65
|
+
"@cdx-ui/icons": "0.0.1-alpha.9"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@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,49 @@
|
|
|
1
|
+
import { withUniwind } from 'uniwind';
|
|
2
|
+
import { cn } from '@cdx-ui/utils';
|
|
3
|
+
import type { CdxIcon, CdxIconProps } from '@cdx-ui/icons';
|
|
4
|
+
|
|
5
|
+
type IconProps = CdxIconProps & {
|
|
6
|
+
className?: string; // TODO: Why does this need to specified manually?
|
|
7
|
+
as: CdxIcon;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
function IconImpl({ as: IconComponent, ...props }: IconProps) {
|
|
11
|
+
return <IconComponent {...props} />;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const StyledIcon = withUniwind(IconImpl, {
|
|
15
|
+
size: {
|
|
16
|
+
fromClassName: 'className',
|
|
17
|
+
styleProperty: 'width',
|
|
18
|
+
},
|
|
19
|
+
color: {
|
|
20
|
+
fromClassName: 'className',
|
|
21
|
+
styleProperty: 'color',
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* A wrapper component for CDX icons with Uniwind `className` support via `withUniwind`.
|
|
27
|
+
*
|
|
28
|
+
* This component allows you to render any CDX icon while applying utility classes
|
|
29
|
+
* using `uniwind`. It avoids the need to wrap or configure each icon individually.
|
|
30
|
+
*
|
|
31
|
+
* @component
|
|
32
|
+
* @example
|
|
33
|
+
* ```tsx
|
|
34
|
+
* import { Icon } from '@cdx-ui/components';
|
|
35
|
+
* import { ArrowRight } from '@cdx-ui/icons';
|
|
36
|
+
*
|
|
37
|
+
* <Icon as={ArrowRight} className="text-red-500 size-4" />
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @param {CdxIcon} as - The CDX icon component to render.
|
|
41
|
+
* @param {string} className - Utility classes to style the icon using Uniwind.
|
|
42
|
+
* @param {number} size - Icon size (overrides the size class).
|
|
43
|
+
* @param {...CdxIconProps} ...props - Additional icon props passed to the "as" icon.
|
|
44
|
+
*/
|
|
45
|
+
export function Icon({ as: IconComponent, className, ...props }: IconProps) {
|
|
46
|
+
return (
|
|
47
|
+
<StyledIcon as={IconComponent} className={cn('text-foreground size-5', className)} {...props} />
|
|
48
|
+
);
|
|
49
|
+
}
|
|
@@ -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