@cdx-ui/components 0.2.4 → 0.2.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/docs/components/accordion/content.md +2 -2
- package/docs/components/alert/content.md +1 -1
- package/docs/components/badge/content.md +5 -15
- package/docs/components/bottom-sheet/content.md +16 -14
- package/docs/components/box/content.md +141 -0
- package/docs/components/breadcrumbs/content.md +9 -9
- package/docs/components/button/content.md +19 -19
- package/docs/components/card/content.md +2 -2
- package/docs/components/carousel/content.md +9 -8
- package/docs/components/chip/content.md +1 -1
- package/docs/components/color-area/content.md +3 -5
- package/docs/components/color-field/content.md +3 -5
- package/docs/components/color-picker/content.md +5 -4
- package/docs/components/color-slider/content.md +3 -5
- package/docs/components/color-swatch/content.md +3 -5
- package/docs/components/color-swatch-picker/content.md +3 -5
- package/docs/components/content.md +10 -9
- package/docs/components/data-grid/content.md +10 -11
- package/docs/components/drawer/content.md +17 -25
- package/docs/components/full-screen-dialog/content.md +2 -2
- package/docs/components/icon/content.md +1 -1
- package/docs/components/icon-button/content.md +3 -3
- package/docs/components/input/content.md +65 -0
- package/docs/components/list-item/content.md +9 -9
- package/docs/components/menu/content.md +57 -50
- package/docs/components/reorderable-list/content.md +5 -3
- package/docs/components/scoped-theme/content.md +1 -1
- package/docs/components/scroll-shadow/content.md +43 -36
- package/docs/components/select/content.md +80 -7
- package/docs/components/skeleton/content.md +7 -6
- package/docs/components/table/content.md +2 -2
- package/docs/components/tabs/content.md +14 -9
- package/docs/components/tile/content.md +9 -10
- package/docs/components/toggle-button/content.md +1 -1
- package/docs/components/tooltip/content.md +9 -9
- package/docs/components/virtualized-list/content.md +14 -14
- package/docs/getting-started/developers/content.md +2 -2
- package/docs/getting-started/developers/styling/content.md +20 -18
- package/docs/llms.txt +11 -9
- package/docs/patterns/authentication/content.md +4 -6
- package/docs/patterns/dashboard/content.md +8 -13
- package/docs/patterns/empty-states/content.md +7 -6
- package/docs/patterns/forms/content.md +6 -7
- package/docs/patterns/onboarding/content.md +4 -4
- package/docs/patterns/settings/content.md +5 -5
- package/docs/resources/release-notes/0.2.4/content.md +17 -0
- package/docs/resources/release-notes/content.md +1 -0
- package/lib/commonjs/components/Box/Box.js +9 -1
- package/lib/commonjs/components/Box/Box.js.map +1 -1
- package/lib/commonjs/components/Breadcrumbs/index.js +28 -3
- package/lib/commonjs/components/Breadcrumbs/index.js.map +1 -1
- package/lib/commonjs/components/Breadcrumbs/styles.js +27 -0
- package/lib/commonjs/components/Breadcrumbs/styles.js.map +1 -1
- package/lib/commonjs/components/Stack/HStack.js +6 -2
- package/lib/commonjs/components/Stack/HStack.js.map +1 -1
- package/lib/commonjs/components/Stack/VStack.js +6 -2
- package/lib/commonjs/components/Stack/VStack.js.map +1 -1
- package/lib/commonjs/index.js +10 -10
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/components/Box/Box.js +9 -1
- package/lib/module/components/Box/Box.js.map +1 -1
- package/lib/module/components/Breadcrumbs/index.js +29 -4
- package/lib/module/components/Breadcrumbs/index.js.map +1 -1
- package/lib/module/components/Breadcrumbs/styles.js +26 -0
- package/lib/module/components/Breadcrumbs/styles.js.map +1 -1
- package/lib/module/components/Stack/HStack.js +6 -2
- package/lib/module/components/Stack/HStack.js.map +1 -1
- package/lib/module/components/Stack/VStack.js +6 -2
- package/lib/module/components/Stack/VStack.js.map +1 -1
- package/lib/module/index.js +6 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/animation/hooks/usePopupDialogContentAnimation.d.ts +2 -2
- package/lib/typescript/animation/hooks/usePopupOverlayAnimation.d.ts +2 -2
- package/lib/typescript/components/Box/Box.d.ts +4 -0
- package/lib/typescript/components/Box/Box.d.ts.map +1 -1
- package/lib/typescript/components/Breadcrumbs/index.d.ts +3 -1
- package/lib/typescript/components/Breadcrumbs/index.d.ts.map +1 -1
- package/lib/typescript/components/Breadcrumbs/styles.d.ts +2 -0
- package/lib/typescript/components/Breadcrumbs/styles.d.ts.map +1 -1
- package/lib/typescript/components/Stack/HStack.d.ts +3 -2
- package/lib/typescript/components/Stack/HStack.d.ts.map +1 -1
- package/lib/typescript/components/Stack/VStack.d.ts +3 -2
- package/lib/typescript/components/Stack/VStack.d.ts.map +1 -1
- package/lib/typescript/components/Toast/animation.d.ts +3 -3
- package/lib/typescript/components/Toast/animation.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +6 -1
- package/lib/typescript/index.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/components/Box/Box.tsx +18 -4
- package/src/components/Breadcrumbs/index.tsx +28 -4
- package/src/components/Breadcrumbs/styles.ts +30 -0
- package/src/components/Stack/HStack.tsx +8 -4
- package/src/components/Stack/VStack.tsx +8 -4
- package/src/index.ts +8 -1
|
@@ -6,6 +6,32 @@ import { TRANSITION_COLORS } from '../../styles/constants';
|
|
|
6
6
|
export const breadcrumbRootVariants = cva(['flex-row flex-wrap items-center', 'data-[disabled=true]:opacity-[var(--opacity-disabled)]', 'web:data-[disabled=true]:cursor-not-allowed']);
|
|
7
7
|
export const breadcrumbDisabledCursor = 'web:cursor-not-allowed';
|
|
8
8
|
export const breadcrumbSeparatorVariants = cva(['body-md text-content-tertiary select-none px-1']);
|
|
9
|
+
const breadcrumbAncestorContentColor = {
|
|
10
|
+
neutral: 'text-content-secondary',
|
|
11
|
+
action: 'text-content-action',
|
|
12
|
+
danger: 'text-content-danger',
|
|
13
|
+
warning: 'text-content-warning',
|
|
14
|
+
success: 'text-content-success',
|
|
15
|
+
info: 'text-content-info'
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
// Color for an `Icon` or `Text` placed directly in item or separator content. Web inherits
|
|
19
|
+
// the CSS color of the content element, so hover follows it; native has no color cascade,
|
|
20
|
+
// so it resolves the state's token.
|
|
21
|
+
export function breadcrumbContentColor(state, color) {
|
|
22
|
+
if (Platform.OS === 'web') {
|
|
23
|
+
return 'text-inherit';
|
|
24
|
+
}
|
|
25
|
+
switch (state) {
|
|
26
|
+
case 'current':
|
|
27
|
+
return 'text-content-primary';
|
|
28
|
+
case 'ancestor':
|
|
29
|
+
return breadcrumbAncestorContentColor[color];
|
|
30
|
+
case 'disabled':
|
|
31
|
+
case 'separator':
|
|
32
|
+
return 'text-content-tertiary';
|
|
33
|
+
}
|
|
34
|
+
}
|
|
9
35
|
export const breadcrumbItemRootVariants = cva(['self-start', 'web:outline-none web:focus:outline-none web:focus-visible:outline-none', 'web:data-[focus-visible=true]:rounded-[2px]', 'web:data-[focus-visible=true]:ring-2 web:data-[focus-visible=true]:ring-stroke-focus web:data-[focus-visible=true]:ring-offset-2']);
|
|
10
36
|
const breadcrumbColorVariants = {
|
|
11
37
|
neutral: '',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Platform","cva","TRANSITION_COLORS","breadcrumbRootVariants","breadcrumbDisabledCursor","breadcrumbSeparatorVariants","
|
|
1
|
+
{"version":3,"names":["Platform","cva","TRANSITION_COLORS","breadcrumbRootVariants","breadcrumbDisabledCursor","breadcrumbSeparatorVariants","breadcrumbAncestorContentColor","neutral","action","danger","warning","success","info","breadcrumbContentColor","state","color","OS","breadcrumbItemRootVariants","breadcrumbColorVariants","breadcrumbItemVariants","variants","isUnderlined","true","select","web","default","false","defaultVariants"],"sourceRoot":"../../../../src","sources":["components/Breadcrumbs/styles.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,GAAG,QAA2B,eAAe;AAEtD,SAASC,iBAAiB,QAAQ,wBAAwB;AAE1D,OAAO,MAAMC,sBAAsB,GAAGF,GAAG,CAAC,CACxC,iCAAiC,EACjC,wDAAwD,EACxD,6CAA6C,CAC9C,CAAC;AAEF,OAAO,MAAMG,wBAAwB,GAAG,wBAAwB;AAEhE,OAAO,MAAMC,2BAA2B,GAAGJ,GAAG,CAAC,CAAC,gDAAgD,CAAC,CAAC;AAElG,MAAMK,8BAA8B,GAAG;EACrCC,OAAO,EAAE,wBAAwB;EACjCC,MAAM,EAAE,qBAAqB;EAC7BC,MAAM,EAAE,qBAAqB;EAC7BC,OAAO,EAAE,sBAAsB;EAC/BC,OAAO,EAAE,sBAAsB;EAC/BC,IAAI,EAAE;AACR,CAA2C;;AAE3C;AACA;AACA;AACA,OAAO,SAASC,sBAAsBA,CACpCC,KAAwD,EACxDC,KAAsB,EACd;EACR,IAAIf,QAAQ,CAACgB,EAAE,KAAK,KAAK,EAAE;IACzB,OAAO,cAAc;EACvB;EACA,QAAQF,KAAK;IACX,KAAK,SAAS;MACZ,OAAO,sBAAsB;IAC/B,KAAK,UAAU;MACb,OAAOR,8BAA8B,CAACS,KAAK,CAAC;IAC9C,KAAK,UAAU;IACf,KAAK,WAAW;MACd,OAAO,uBAAuB;EAClC;AACF;AAEA,OAAO,MAAME,0BAA0B,GAAGhB,GAAG,CAAC,CAC5C,YAAY,EACZ,wEAAwE,EACxE,6CAA6C,EAC7C,kIAAkI,CACnI,CAAC;AAEF,MAAMiB,uBAAuB,GAAG;EAC9BX,OAAO,EAAE,EAAE;EACXC,MAAM,EACJ,4IAA4I;EAC9IC,MAAM,EACJ,4IAA4I;EAC9IC,OAAO,EACL,8IAA8I;EAChJC,OAAO,EACL,8IAA8I;EAChJC,IAAI,EAAE;AACR,CAA2C;AAE3C,OAAO,MAAMO,sBAAsB,GAAGlB,GAAG,CACvC,CACE,SAAS,EACTC,iBAAiB,EACjB,2CAA2C,EAC3C,8CAA8C,EAC9C,6CAA6C,CAC9C,EACD;EACEkB,QAAQ,EAAE;IACRC,YAAY,EAAE;MACZC,IAAI,EAAEtB,QAAQ,CAACuB,MAAM,CAAC;QACpBC,GAAG,EAAE,0EAA0E;QAC/EC,OAAO,EACL;MACJ,CAAC,CAAC;MACFC,KAAK,EAAE;IACT,CAAC;IACDX,KAAK,EAAEG;EACT,CAAC;EACDS,eAAe,EAAE;IACfN,YAAY,EAAE,KAAK;IACnBN,KAAK,EAAE;EACT;AACF,CACF,CAAC","ignoreList":[]}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { dataAttributes, mergeDataAttributes } from '@cdx-ui/primitives';
|
|
5
5
|
import { cn } from '@cdx-ui/utils';
|
|
6
|
+
import { Box } from '../Box';
|
|
6
7
|
import { hStackRootVariants } from './styles';
|
|
7
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
9
|
export const HStack = /*#__PURE__*/forwardRef(({
|
|
@@ -13,7 +14,7 @@ export const HStack = /*#__PURE__*/forwardRef(({
|
|
|
13
14
|
children,
|
|
14
15
|
...restProps
|
|
15
16
|
}, ref) => {
|
|
16
|
-
return /*#__PURE__*/_jsx(
|
|
17
|
+
return /*#__PURE__*/_jsx(Box, {
|
|
17
18
|
ref: ref,
|
|
18
19
|
className: cn(hStackRootVariants({
|
|
19
20
|
reversed,
|
|
@@ -21,6 +22,9 @@ export const HStack = /*#__PURE__*/forwardRef(({
|
|
|
21
22
|
}), className),
|
|
22
23
|
style: style,
|
|
23
24
|
...restProps,
|
|
25
|
+
...mergeDataAttributes(dataAttributes({
|
|
26
|
+
slot: 'hstack'
|
|
27
|
+
}), restProps),
|
|
24
28
|
children: children
|
|
25
29
|
});
|
|
26
30
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["forwardRef","
|
|
1
|
+
{"version":3,"names":["forwardRef","dataAttributes","mergeDataAttributes","cn","Box","hStackRootVariants","jsx","_jsx","HStack","reversed","space","style","className","children","restProps","ref","slot","displayName"],"sourceRoot":"../../../../src","sources":["components/Stack/HStack.tsx"],"mappings":";;AACA,SAASA,UAAU,QAAQ,OAAO;AAElC,SAASC,cAAc,EAAEC,mBAAmB,QAAQ,oBAAoB;AACxE,SAASC,EAAE,QAAQ,eAAe;AAClC,SAASC,GAAG,QAAuB,QAAQ;AAC3C,SAASC,kBAAkB,QAAyB,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAc/D,OAAO,MAAMC,MAAM,gBAAGR,UAAU,CAC9B,CACE;EAAES,QAAQ,GAAG,KAAK;EAAEC,KAAK;EAAEC,KAAK;EAAEC,SAAS;EAAEC,QAAQ;EAAE,GAAGC;AAAU,CAAC,EACrEC,GAAuB,KACpB;EACH,oBACER,IAAA,CAACH,GAAG;IACFW,GAAG,EAAEA,GAAI;IACTH,SAAS,EAAET,EAAE,CAACE,kBAAkB,CAAC;MAAEI,QAAQ;MAAEC;IAAM,CAAC,CAAC,EAAEE,SAAS,CAAE;IAClED,KAAK,EAAEA,KAAM;IAAA,GACTG,SAAS;IAAA,GAETZ,mBAAmB,CAACD,cAAc,CAAC;MAAEe,IAAI,EAAE;IAAS,CAAC,CAAC,EAAEF,SAAS,CAAC;IAAAD,QAAA,EAErEA;EAAQ,CACN,CAAC;AAEV,CACF,CAAC;AAEDL,MAAM,CAACS,WAAW,GAAG,QAAQ","ignoreList":[]}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { dataAttributes, mergeDataAttributes } from '@cdx-ui/primitives';
|
|
5
5
|
import { cn } from '@cdx-ui/utils';
|
|
6
|
+
import { Box } from '../Box';
|
|
6
7
|
import { vStackRootVariants } from './styles';
|
|
7
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
9
|
export const VStack = /*#__PURE__*/forwardRef(({
|
|
@@ -13,7 +14,7 @@ export const VStack = /*#__PURE__*/forwardRef(({
|
|
|
13
14
|
children,
|
|
14
15
|
...restProps
|
|
15
16
|
}, ref) => {
|
|
16
|
-
return /*#__PURE__*/_jsx(
|
|
17
|
+
return /*#__PURE__*/_jsx(Box, {
|
|
17
18
|
ref: ref,
|
|
18
19
|
className: cn(vStackRootVariants({
|
|
19
20
|
reversed,
|
|
@@ -21,6 +22,9 @@ export const VStack = /*#__PURE__*/forwardRef(({
|
|
|
21
22
|
}), className),
|
|
22
23
|
style: style,
|
|
23
24
|
...restProps,
|
|
25
|
+
...mergeDataAttributes(dataAttributes({
|
|
26
|
+
slot: 'vstack'
|
|
27
|
+
}), restProps),
|
|
24
28
|
children: children
|
|
25
29
|
});
|
|
26
30
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["forwardRef","
|
|
1
|
+
{"version":3,"names":["forwardRef","dataAttributes","mergeDataAttributes","cn","Box","vStackRootVariants","jsx","_jsx","VStack","reversed","space","style","className","children","restProps","ref","slot","displayName"],"sourceRoot":"../../../../src","sources":["components/Stack/VStack.tsx"],"mappings":";;AACA,SAASA,UAAU,QAAQ,OAAO;AAElC,SAASC,cAAc,EAAEC,mBAAmB,QAAQ,oBAAoB;AACxE,SAASC,EAAE,QAAQ,eAAe;AAClC,SAASC,GAAG,QAAuB,QAAQ;AAC3C,SAASC,kBAAkB,QAAyB,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAc/D,OAAO,MAAMC,MAAM,gBAAGR,UAAU,CAC9B,CACE;EAAES,QAAQ,GAAG,KAAK;EAAEC,KAAK;EAAEC,KAAK;EAAEC,SAAS;EAAEC,QAAQ;EAAE,GAAGC;AAAU,CAAC,EACrEC,GAAuB,KACpB;EACH,oBACER,IAAA,CAACH,GAAG;IACFW,GAAG,EAAEA,GAAI;IACTH,SAAS,EAAET,EAAE,CAACE,kBAAkB,CAAC;MAAEI,QAAQ;MAAEC;IAAM,CAAC,CAAC,EAAEE,SAAS,CAAE;IAClED,KAAK,EAAEA,KAAM;IAAA,GACTG,SAAS;IAAA,GAETZ,mBAAmB,CAACD,cAAc,CAAC;MAAEe,IAAI,EAAE;IAAS,CAAC,CAAC,EAAEF,SAAS,CAAC;IAAAD,QAAA,EAErEA;EAAQ,CACN,CAAC;AAEV,CACF,CAAC;AAEDL,MAAM,CAACS,WAAW,GAAG,QAAQ","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
/// <reference types="uniwind/types" preserve="true" />
|
|
4
|
+
import { View as RNView } from 'react-native';
|
|
4
5
|
export * from './components';
|
|
5
6
|
export * from './hooks';
|
|
6
7
|
export * from './navigation';
|
|
7
8
|
export { ToastProvider, useToast } from './providers/toast';
|
|
8
9
|
export { ForgeDesignProvider } from './providers/forge-design';
|
|
9
|
-
export {
|
|
10
|
+
export { ScrollView, KeyboardAvoidingView } from 'react-native';
|
|
10
11
|
export { SafeAreaView, useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
12
|
+
|
|
13
|
+
/** @deprecated Use `Box` instead. */
|
|
14
|
+
export const View = RNView;
|
|
15
|
+
/** @deprecated Use `BoxRef` for refs and `BoxProps` for props instead. */
|
|
11
16
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ToastProvider","useToast","ForgeDesignProvider","
|
|
1
|
+
{"version":3,"names":["View","RNView","ToastProvider","useToast","ForgeDesignProvider","ScrollView","KeyboardAvoidingView","SafeAreaView","useSafeAreaInsets"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA;AACA,SAASA,IAAI,IAAIC,MAAM,QAAQ,cAAc;AAE7C,cAAc,cAAc;AAC5B,cAAc,SAAS;AACvB,cAAc,cAAc;AAC5B,SAASC,aAAa,EAAEC,QAAQ,QAAQ,mBAAmB;AAE3D,SAASC,mBAAmB,QAAQ,0BAA0B;AAE9D,SAASC,UAAU,EAAEC,oBAAoB,QAAQ,cAAc;AAC/D,SAASC,YAAY,EAAEC,iBAAiB,QAAQ,gCAAgC;;AAEhF;AACA,OAAO,MAAMR,IAAI,GAAGC,MAAM;AAC1B","ignoreList":[]}
|
|
@@ -22,7 +22,7 @@ export declare function usePopupDialogContentAnimation({ isOpen, progress, isDra
|
|
|
22
22
|
contentY: SharedValue<number>;
|
|
23
23
|
contentHeight: SharedValue<number>;
|
|
24
24
|
panGesture: import("react-native-gesture-handler/lib/typescript/handlers/gestures/panGesture").PanGesture;
|
|
25
|
-
rDragContainerStyle: {
|
|
25
|
+
rDragContainerStyle: import("react-native-reanimated/lib/typescript/hook/commonTypes").AnimatedStyleHandle<{
|
|
26
26
|
opacity: number;
|
|
27
27
|
transform: ({
|
|
28
28
|
translateY: number;
|
|
@@ -40,7 +40,7 @@ export declare function usePopupDialogContentAnimation({ isOpen, progress, isDra
|
|
|
40
40
|
translateY?: undefined;
|
|
41
41
|
})[];
|
|
42
42
|
opacity?: undefined;
|
|
43
|
-
}
|
|
43
|
+
}>;
|
|
44
44
|
entering: import("react-native-reanimated").BaseAnimationBuilder | ((targetValues: import("react-native-reanimated").EntryAnimationsValues) => import("react-native-reanimated").LayoutAnimation) | ((targetValues: import("react-native-reanimated").ExitAnimationsValues) => import("react-native-reanimated").LayoutAnimation) | import("react-native-reanimated").ReanimatedKeyframe | undefined;
|
|
45
45
|
exiting: import("react-native-reanimated").BaseAnimationBuilder | ((targetValues: import("react-native-reanimated").EntryAnimationsValues) => import("react-native-reanimated").LayoutAnimation) | ((targetValues: import("react-native-reanimated").ExitAnimationsValues) => import("react-native-reanimated").LayoutAnimation) | import("react-native-reanimated").ReanimatedKeyframe | undefined;
|
|
46
46
|
};
|
|
@@ -18,11 +18,11 @@ export interface UsePopupOverlayAnimationOptions {
|
|
|
18
18
|
* On web, entering/exiting are undefined (CSS transitions drive the visuals).
|
|
19
19
|
*/
|
|
20
20
|
export declare function usePopupOverlayAnimation(options: UsePopupOverlayAnimationOptions): {
|
|
21
|
-
rContainerStyle: {
|
|
21
|
+
rContainerStyle: import("react-native-reanimated/lib/typescript/hook/commonTypes").AnimatedStyleHandle<{
|
|
22
22
|
opacity?: undefined;
|
|
23
23
|
} | {
|
|
24
24
|
opacity: number;
|
|
25
|
-
}
|
|
25
|
+
}>;
|
|
26
26
|
entering: import("react-native-reanimated").BaseAnimationBuilder | ((targetValues: import("react-native-reanimated").EntryAnimationsValues) => import("react-native-reanimated").LayoutAnimation) | ((targetValues: import("react-native-reanimated").ExitAnimationsValues) => import("react-native-reanimated").LayoutAnimation) | import("react-native-reanimated").ReanimatedKeyframe | undefined;
|
|
27
27
|
exiting: import("react-native-reanimated").BaseAnimationBuilder | ((targetValues: import("react-native-reanimated").EntryAnimationsValues) => import("react-native-reanimated").LayoutAnimation) | ((targetValues: import("react-native-reanimated").ExitAnimationsValues) => import("react-native-reanimated").LayoutAnimation) | import("react-native-reanimated").ReanimatedKeyframe | undefined;
|
|
28
28
|
};
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { View, type ViewProps } from 'react-native';
|
|
2
2
|
export interface BoxProps extends ViewProps {
|
|
3
3
|
className?: string;
|
|
4
|
+
/** Renders the child element in place of the default `View`, merging Box's props onto it. */
|
|
5
|
+
asChild?: boolean;
|
|
4
6
|
}
|
|
7
|
+
/** The instance type of a `Box` ref, e.g. `useRef<BoxRef>(null)`. */
|
|
8
|
+
export type BoxRef = View;
|
|
5
9
|
export declare const Box: import("react").ForwardRefExoticComponent<BoxProps & import("react").RefAttributes<View>>;
|
|
6
10
|
//# sourceMappingURL=Box.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Box.d.ts","sourceRoot":"","sources":["../../../../src/components/Box/Box.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"Box.d.ts","sourceRoot":"","sources":["../../../../src/components/Box/Box.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAGpD,MAAM,WAAW,QAAS,SAAQ,SAAS;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6FAA6F;IAC7F,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,qEAAqE;AACrE,MAAM,MAAM,MAAM,GAAG,IAAI,CAAC;AAE1B,eAAO,MAAM,GAAG,2FAgBf,CAAC"}
|
|
@@ -6,7 +6,8 @@ export type { BreadcrumbVariantProps } from './styles';
|
|
|
6
6
|
export interface BreadcrumbsProps extends IBreadcrumbsProps {
|
|
7
7
|
className?: string;
|
|
8
8
|
/**
|
|
9
|
-
* Separator rendered between breadcrumb items.
|
|
9
|
+
* Separator rendered between breadcrumb items. A direct `Icon` or `Text` child takes the
|
|
10
|
+
* separator color unless it sets `color`.
|
|
10
11
|
* @default `/`
|
|
11
12
|
*/
|
|
12
13
|
separator?: ReactNode;
|
|
@@ -17,6 +18,7 @@ interface BreadcrumbItemInternalProps {
|
|
|
17
18
|
}
|
|
18
19
|
export interface BreadcrumbsItemProps extends Omit<ILinkProps, 'children' | 'disabled'> {
|
|
19
20
|
className?: string;
|
|
21
|
+
/** Item content. A direct `Icon` or `Text` child takes the item's state color unless it sets `color`. */
|
|
20
22
|
children?: ReactNode;
|
|
21
23
|
}
|
|
22
24
|
declare const BreadcrumbsRoot: import("react").ForwardRefExoticComponent<BreadcrumbsProps & import("react").RefAttributes<View>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Breadcrumbs/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAkB,IAAI,EAAkC,MAAM,cAAc,CAAC;AACpF,OAAO,EAML,KAAK,iBAAiB,EACtB,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Breadcrumbs/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAkB,IAAI,EAAkC,MAAM,cAAc,CAAC;AACpF,OAAO,EAML,KAAK,iBAAiB,EACtB,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAC;AAa5B,YAAY,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,YAAY,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAIvD,MAAM,WAAW,gBAAiB,SAAQ,iBAAiB;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,UAAU,2BAA2B;IACnC,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,CAAC;IACrF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yGAAyG;IACzG,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAgGD,QAAA,MAAM,eAAe,mGAqDpB,CAAC;AAkBF,QAAA,MAAM,eAAe,qIAqGpB,CAAC;AAIF,KAAK,4BAA4B,GAAG,OAAO,eAAe,GAAG;IAC3D,IAAI,EAAE,OAAO,eAAe,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,WAAW,EAElB,4BAA4B,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { type VariantProps } from '@cdx-ui/utils';
|
|
2
|
+
import type { BreadcrumbColor } from '@cdx-ui/primitives';
|
|
2
3
|
export declare const breadcrumbRootVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
3
4
|
export declare const breadcrumbDisabledCursor = "web:cursor-not-allowed";
|
|
4
5
|
export declare const breadcrumbSeparatorVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
6
|
+
export declare function breadcrumbContentColor(state: 'current' | 'ancestor' | 'disabled' | 'separator', color: BreadcrumbColor): string;
|
|
5
7
|
export declare const breadcrumbItemRootVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
6
8
|
export declare const breadcrumbItemVariants: (props?: ({
|
|
7
9
|
isUnderlined?: boolean | null | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Breadcrumbs/styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Breadcrumbs/styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAG1D,eAAO,MAAM,sBAAsB,oFAIjC,CAAC;AAEH,eAAO,MAAM,wBAAwB,2BAA2B,CAAC;AAEjE,eAAO,MAAM,2BAA2B,oFAA0D,CAAC;AAcnG,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,WAAW,EACxD,KAAK,EAAE,eAAe,GACrB,MAAM,CAaR;AAED,eAAO,MAAM,0BAA0B,oFAKrC,CAAC;AAeH,eAAO,MAAM,sBAAsB;;;8EAyBlC,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,YAAY,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { View
|
|
1
|
+
import type { View } from 'react-native';
|
|
2
|
+
import { type BoxProps } from '../Box';
|
|
2
3
|
import { type StackSpace } from './styles';
|
|
3
|
-
export interface HStackProps extends
|
|
4
|
+
export interface HStackProps extends Omit<BoxProps, 'asChild'> {
|
|
4
5
|
className?: string;
|
|
5
6
|
/** Token-based gap between children. */
|
|
6
7
|
space?: StackSpace;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HStack.d.ts","sourceRoot":"","sources":["../../../../src/components/Stack/HStack.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"HStack.d.ts","sourceRoot":"","sources":["../../../../src/components/Stack/HStack.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGzC,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,EAAsB,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAE/D,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wCAAwC;IACxC,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,MAAM,8FAkBlB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { View
|
|
1
|
+
import type { View } from 'react-native';
|
|
2
|
+
import { type BoxProps } from '../Box';
|
|
2
3
|
import { type StackSpace } from './styles';
|
|
3
|
-
export interface VStackProps extends
|
|
4
|
+
export interface VStackProps extends Omit<BoxProps, 'asChild'> {
|
|
4
5
|
className?: string;
|
|
5
6
|
/** Token-based gap between children. */
|
|
6
7
|
space?: StackSpace;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VStack.d.ts","sourceRoot":"","sources":["../../../../src/components/Stack/VStack.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"VStack.d.ts","sourceRoot":"","sources":["../../../../src/components/Stack/VStack.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGzC,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,EAAsB,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAE/D,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wCAAwC;IACxC,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,MAAM,8FAkBlB,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Gesture } from 'react-native-gesture-handler';
|
|
2
|
-
import { EntryOrExitLayoutType, useAnimatedStyle } from 'react-native-reanimated';
|
|
2
|
+
import { EntryOrExitLayoutType, FadeInDown, FadeInUp, useAnimatedStyle } from 'react-native-reanimated';
|
|
3
3
|
import type { UseToastRootAnimationOptions } from './types';
|
|
4
|
-
export declare const enteringTop:
|
|
4
|
+
export declare const enteringTop: FadeInUp;
|
|
5
5
|
export declare const exitingTop: import("react-native-reanimated").ReanimatedKeyframe;
|
|
6
|
-
export declare const enteringBottom:
|
|
6
|
+
export declare const enteringBottom: FadeInDown;
|
|
7
7
|
export declare const exitingBottom: import("react-native-reanimated").ReanimatedKeyframe;
|
|
8
8
|
export interface UseToastRootAnimationResult {
|
|
9
9
|
rContainerStyle: ReturnType<typeof useAnimatedStyle>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"animation.d.ts","sourceRoot":"","sources":["../../../../src/components/Toast/animation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAEL,qBAAqB,
|
|
1
|
+
{"version":3,"file":"animation.d.ts","sourceRoot":"","sources":["../../../../src/components/Toast/animation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAEL,qBAAqB,EAErB,UAAU,EACV,QAAQ,EAGR,gBAAgB,EAKjB,MAAM,yBAAyB,CAAC;AASjC,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AAI5D,eAAO,MAAM,WAAW,UAKd,CAAC;AAEX,eAAO,MAAM,UAAU,sDAUP,CAAC;AAEjB,eAAO,MAAM,cAAc,YAKjB,CAAC;AAEX,eAAO,MAAM,aAAa,sDAUV,CAAC;AAEjB,MAAM,WAAW,2BAA2B;IAC1C,eAAe,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;IACrD,uBAAuB,EAAE,OAAO,CAAC;IACjC,QAAQ,EAAE,qBAAqB,GAAG,SAAS,CAAC;IAC5C,OAAO,EAAE,qBAAqB,GAAG,SAAS,CAAC;IAC3C,UAAU,EAAE,UAAU,CAAC,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC;CAC5C;AAID;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,4BAA4B,GACpC,2BAA2B,CAiU7B"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="uniwind/types" preserve="true" />
|
|
2
|
+
import { View as RNView } from 'react-native';
|
|
2
3
|
export * from './components';
|
|
3
4
|
export * from './hooks';
|
|
4
5
|
export * from './navigation';
|
|
@@ -6,6 +7,10 @@ export { ToastProvider, useToast } from './providers/toast';
|
|
|
6
7
|
export type * from './providers/toast';
|
|
7
8
|
export { ForgeDesignProvider } from './providers/forge-design';
|
|
8
9
|
export type { ForgeDesignConfig, ForgeDesignProviderProps } from './providers/forge-design';
|
|
9
|
-
export {
|
|
10
|
+
export { ScrollView, KeyboardAvoidingView } from 'react-native';
|
|
10
11
|
export { SafeAreaView, useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
12
|
+
/** @deprecated Use `Box` instead. */
|
|
13
|
+
export declare const View: typeof RNView;
|
|
14
|
+
/** @deprecated Use `BoxRef` for refs and `BoxProps` for props instead. */
|
|
15
|
+
export type View = RNView;
|
|
11
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AACA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,mBAAmB,mBAAmB,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,YAAY,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAC5F,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,IAAI,MAAM,EAAE,MAAM,cAAc,CAAC;AAE9C,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,mBAAmB,mBAAmB,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,YAAY,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAC5F,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAEjF,qCAAqC;AACrC,eAAO,MAAM,IAAI,eAAS,CAAC;AAC3B,0EAA0E;AAC1E,MAAM,MAAM,IAAI,GAAG,MAAM,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cdx-ui/components",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -106,20 +106,20 @@
|
|
|
106
106
|
"@marceloterreiro/flash-calendar": "2.0.0",
|
|
107
107
|
"react-native-reanimated-carousel": "5.0.0-beta.5",
|
|
108
108
|
"uniwind": "1.10.0",
|
|
109
|
-
"@cdx-ui/
|
|
110
|
-
"@cdx-ui/
|
|
111
|
-
"@cdx-ui/
|
|
112
|
-
"@cdx-ui/
|
|
109
|
+
"@cdx-ui/icons": "0.2.5",
|
|
110
|
+
"@cdx-ui/utils": "0.2.5",
|
|
111
|
+
"@cdx-ui/primitives": "0.2.5",
|
|
112
|
+
"@cdx-ui/formatters": "0.2.5"
|
|
113
113
|
},
|
|
114
114
|
"devDependencies": {
|
|
115
115
|
"@dnd-kit/core": "6.3.1",
|
|
116
116
|
"@dnd-kit/sortable": "10.0.0",
|
|
117
117
|
"@dnd-kit/utilities": "3.2.2",
|
|
118
118
|
"@react-navigation/bottom-tabs": "*",
|
|
119
|
-
"@types/react": "19.
|
|
119
|
+
"@types/react": "19.2.14",
|
|
120
120
|
"@types/react-dom": "*",
|
|
121
|
-
"react": "19.
|
|
122
|
-
"react-dom": "19.
|
|
121
|
+
"react": "19.2.3",
|
|
122
|
+
"react-dom": "19.2.3",
|
|
123
123
|
"react-native": "*",
|
|
124
124
|
"react-native-builder-bob": "*",
|
|
125
125
|
"react-native-screens": "*",
|
|
@@ -1,16 +1,30 @@
|
|
|
1
1
|
import { type ForwardedRef, forwardRef } from 'react';
|
|
2
2
|
import { View, type ViewProps } from 'react-native';
|
|
3
|
+
import { Slot, dataAttributes, mergeDataAttributes } from '@cdx-ui/primitives';
|
|
3
4
|
|
|
4
5
|
export interface BoxProps extends ViewProps {
|
|
5
6
|
className?: string;
|
|
7
|
+
/** Renders the child element in place of the default `View`, merging Box's props onto it. */
|
|
8
|
+
asChild?: boolean;
|
|
6
9
|
}
|
|
7
10
|
|
|
8
|
-
|
|
9
|
-
|
|
11
|
+
/** The instance type of a `Box` ref, e.g. `useRef<BoxRef>(null)`. */
|
|
12
|
+
export type BoxRef = View;
|
|
13
|
+
|
|
14
|
+
export const Box = forwardRef<BoxRef, BoxProps>(
|
|
15
|
+
({ asChild, children, ...restProps }, ref: ForwardedRef<BoxRef>) => {
|
|
16
|
+
const Comp = asChild ? Slot : View;
|
|
17
|
+
|
|
10
18
|
return (
|
|
11
|
-
<
|
|
19
|
+
<Comp
|
|
20
|
+
ref={ref}
|
|
21
|
+
{...restProps}
|
|
22
|
+
// Caller-supplied data attributes win so components composed on Box
|
|
23
|
+
// (HStack, VStack and their consumers) can replace the default slot.
|
|
24
|
+
{...mergeDataAttributes(dataAttributes({ slot: 'box' }), restProps)}
|
|
25
|
+
>
|
|
12
26
|
{children}
|
|
13
|
-
</
|
|
27
|
+
</Comp>
|
|
14
28
|
);
|
|
15
29
|
},
|
|
16
30
|
);
|
|
@@ -19,7 +19,10 @@ import {
|
|
|
19
19
|
type ILinkProps,
|
|
20
20
|
} from '@cdx-ui/primitives';
|
|
21
21
|
import { cn } from '@cdx-ui/utils';
|
|
22
|
+
import { Icon } from '../Icon';
|
|
23
|
+
import { Text as ForgeText } from '../Text';
|
|
22
24
|
import {
|
|
25
|
+
breadcrumbContentColor,
|
|
23
26
|
breadcrumbItemVariants,
|
|
24
27
|
breadcrumbDisabledCursor,
|
|
25
28
|
breadcrumbItemRootVariants,
|
|
@@ -35,7 +38,8 @@ type BreadcrumbItemState = 'current' | 'ancestor' | 'disabled';
|
|
|
35
38
|
export interface BreadcrumbsProps extends IBreadcrumbsProps {
|
|
36
39
|
className?: string;
|
|
37
40
|
/**
|
|
38
|
-
* Separator rendered between breadcrumb items.
|
|
41
|
+
* Separator rendered between breadcrumb items. A direct `Icon` or `Text` child takes the
|
|
42
|
+
* separator color unless it sets `color`.
|
|
39
43
|
* @default `/`
|
|
40
44
|
*/
|
|
41
45
|
separator?: ReactNode;
|
|
@@ -48,6 +52,7 @@ interface BreadcrumbItemInternalProps {
|
|
|
48
52
|
|
|
49
53
|
export interface BreadcrumbsItemProps extends Omit<ILinkProps, 'children' | 'disabled'> {
|
|
50
54
|
className?: string;
|
|
55
|
+
/** Item content. A direct `Icon` or `Text` child takes the item's state color unless it sets `color`. */
|
|
51
56
|
children?: ReactNode;
|
|
52
57
|
}
|
|
53
58
|
|
|
@@ -65,6 +70,23 @@ function isTextOnlyChild(children: ReactNode): children is string | number {
|
|
|
65
70
|
return typeof children === 'string' || typeof children === 'number';
|
|
66
71
|
}
|
|
67
72
|
|
|
73
|
+
// `Icon` and `Text` default to `text-content-primary` and native has no color cascade, so
|
|
74
|
+
// direct children that leave `color` unset take the content color through `className`.
|
|
75
|
+
function withContentColor(children: ReactNode, colorClassName: string): ReactNode {
|
|
76
|
+
return Children.map(children, (child) => {
|
|
77
|
+
if (!isValidElement<{ className?: string; color?: unknown }>(child)) {
|
|
78
|
+
return child;
|
|
79
|
+
}
|
|
80
|
+
if (child.type !== Icon && child.type !== ForgeText) {
|
|
81
|
+
return child;
|
|
82
|
+
}
|
|
83
|
+
if (child.props.color !== undefined) {
|
|
84
|
+
return child;
|
|
85
|
+
}
|
|
86
|
+
return cloneElement(child, { className: cn(colorClassName, child.props.className) });
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
|
|
68
90
|
function BreadcrumbItemContent({
|
|
69
91
|
children,
|
|
70
92
|
className,
|
|
@@ -74,6 +96,8 @@ function BreadcrumbItemContent({
|
|
|
74
96
|
className: string;
|
|
75
97
|
state: BreadcrumbItemState;
|
|
76
98
|
}) {
|
|
99
|
+
const { color } = useBreadcrumbsContext();
|
|
100
|
+
|
|
77
101
|
if (isTextOnlyChild(children)) {
|
|
78
102
|
return (
|
|
79
103
|
<Text className={className} {...dataAttributes({ state })}>
|
|
@@ -84,13 +108,13 @@ function BreadcrumbItemContent({
|
|
|
84
108
|
|
|
85
109
|
return (
|
|
86
110
|
<View className={cn('flex-row items-center gap-1', className)} {...dataAttributes({ state })}>
|
|
87
|
-
{children}
|
|
111
|
+
{withContentColor(children, breadcrumbContentColor(state, color))}
|
|
88
112
|
</View>
|
|
89
113
|
);
|
|
90
114
|
}
|
|
91
115
|
|
|
92
116
|
function BreadcrumbsSeparator({ separator }: { separator: ReactNode }) {
|
|
93
|
-
const { isDisabled } = useBreadcrumbsContext();
|
|
117
|
+
const { isDisabled, color } = useBreadcrumbsContext();
|
|
94
118
|
const disabledClassName = isDisabled ? breadcrumbDisabledCursor : undefined;
|
|
95
119
|
const slotProps = mergeDataAttributes({}, dataAttributes({ slot: 'breadcrumbs-separator' }));
|
|
96
120
|
const a11yProps = {
|
|
@@ -121,7 +145,7 @@ function BreadcrumbsSeparator({ separator }: { separator: ReactNode }) {
|
|
|
121
145
|
{...a11yProps}
|
|
122
146
|
{...slotProps}
|
|
123
147
|
>
|
|
124
|
-
{separator}
|
|
148
|
+
{withContentColor(separator, breadcrumbContentColor('separator', color))}
|
|
125
149
|
</View>
|
|
126
150
|
);
|
|
127
151
|
}
|
|
@@ -13,6 +13,36 @@ export const breadcrumbDisabledCursor = 'web:cursor-not-allowed';
|
|
|
13
13
|
|
|
14
14
|
export const breadcrumbSeparatorVariants = cva(['body-md text-content-tertiary select-none px-1']);
|
|
15
15
|
|
|
16
|
+
const breadcrumbAncestorContentColor = {
|
|
17
|
+
neutral: 'text-content-secondary',
|
|
18
|
+
action: 'text-content-action',
|
|
19
|
+
danger: 'text-content-danger',
|
|
20
|
+
warning: 'text-content-warning',
|
|
21
|
+
success: 'text-content-success',
|
|
22
|
+
info: 'text-content-info',
|
|
23
|
+
} satisfies Record<BreadcrumbColor, string>;
|
|
24
|
+
|
|
25
|
+
// Color for an `Icon` or `Text` placed directly in item or separator content. Web inherits
|
|
26
|
+
// the CSS color of the content element, so hover follows it; native has no color cascade,
|
|
27
|
+
// so it resolves the state's token.
|
|
28
|
+
export function breadcrumbContentColor(
|
|
29
|
+
state: 'current' | 'ancestor' | 'disabled' | 'separator',
|
|
30
|
+
color: BreadcrumbColor,
|
|
31
|
+
): string {
|
|
32
|
+
if (Platform.OS === 'web') {
|
|
33
|
+
return 'text-inherit';
|
|
34
|
+
}
|
|
35
|
+
switch (state) {
|
|
36
|
+
case 'current':
|
|
37
|
+
return 'text-content-primary';
|
|
38
|
+
case 'ancestor':
|
|
39
|
+
return breadcrumbAncestorContentColor[color];
|
|
40
|
+
case 'disabled':
|
|
41
|
+
case 'separator':
|
|
42
|
+
return 'text-content-tertiary';
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
16
46
|
export const breadcrumbItemRootVariants = cva([
|
|
17
47
|
'self-start',
|
|
18
48
|
'web:outline-none web:focus:outline-none web:focus-visible:outline-none',
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { ForwardedRef } from 'react';
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
|
-
import { View
|
|
3
|
+
import type { View } from 'react-native';
|
|
4
|
+
import { dataAttributes, mergeDataAttributes } from '@cdx-ui/primitives';
|
|
4
5
|
import { cn } from '@cdx-ui/utils';
|
|
6
|
+
import { Box, type BoxProps } from '../Box';
|
|
5
7
|
import { hStackRootVariants, type StackSpace } from './styles';
|
|
6
8
|
|
|
7
|
-
export interface HStackProps extends
|
|
9
|
+
export interface HStackProps extends Omit<BoxProps, 'asChild'> {
|
|
8
10
|
className?: string;
|
|
9
11
|
/** Token-based gap between children. */
|
|
10
12
|
space?: StackSpace;
|
|
@@ -22,14 +24,16 @@ export const HStack = forwardRef<View, HStackProps>(
|
|
|
22
24
|
ref: ForwardedRef<View>,
|
|
23
25
|
) => {
|
|
24
26
|
return (
|
|
25
|
-
<
|
|
27
|
+
<Box
|
|
26
28
|
ref={ref}
|
|
27
29
|
className={cn(hStackRootVariants({ reversed, space }), className)}
|
|
28
30
|
style={style}
|
|
29
31
|
{...restProps}
|
|
32
|
+
// Caller-supplied data attributes win so components composed on HStack keep their own slot.
|
|
33
|
+
{...mergeDataAttributes(dataAttributes({ slot: 'hstack' }), restProps)}
|
|
30
34
|
>
|
|
31
35
|
{children}
|
|
32
|
-
</
|
|
36
|
+
</Box>
|
|
33
37
|
);
|
|
34
38
|
},
|
|
35
39
|
);
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { ForwardedRef } from 'react';
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
|
-
import { View
|
|
3
|
+
import type { View } from 'react-native';
|
|
4
|
+
import { dataAttributes, mergeDataAttributes } from '@cdx-ui/primitives';
|
|
4
5
|
import { cn } from '@cdx-ui/utils';
|
|
6
|
+
import { Box, type BoxProps } from '../Box';
|
|
5
7
|
import { vStackRootVariants, type StackSpace } from './styles';
|
|
6
8
|
|
|
7
|
-
export interface VStackProps extends
|
|
9
|
+
export interface VStackProps extends Omit<BoxProps, 'asChild'> {
|
|
8
10
|
className?: string;
|
|
9
11
|
/** Token-based gap between children. */
|
|
10
12
|
space?: StackSpace;
|
|
@@ -22,14 +24,16 @@ export const VStack = forwardRef<View, VStackProps>(
|
|
|
22
24
|
ref: ForwardedRef<View>,
|
|
23
25
|
) => {
|
|
24
26
|
return (
|
|
25
|
-
<
|
|
27
|
+
<Box
|
|
26
28
|
ref={ref}
|
|
27
29
|
className={cn(vStackRootVariants({ reversed, space }), className)}
|
|
28
30
|
style={style}
|
|
29
31
|
{...restProps}
|
|
32
|
+
// Caller-supplied data attributes win so components composed on VStack keep their own slot.
|
|
33
|
+
{...mergeDataAttributes(dataAttributes({ slot: 'vstack' }), restProps)}
|
|
30
34
|
>
|
|
31
35
|
{children}
|
|
32
|
-
</
|
|
36
|
+
</Box>
|
|
33
37
|
);
|
|
34
38
|
},
|
|
35
39
|
);
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
/// <reference types="uniwind/types" preserve="true" />
|
|
2
|
+
import { View as RNView } from 'react-native';
|
|
3
|
+
|
|
2
4
|
export * from './components';
|
|
3
5
|
export * from './hooks';
|
|
4
6
|
export * from './navigation';
|
|
@@ -6,5 +8,10 @@ export { ToastProvider, useToast } from './providers/toast';
|
|
|
6
8
|
export type * from './providers/toast';
|
|
7
9
|
export { ForgeDesignProvider } from './providers/forge-design';
|
|
8
10
|
export type { ForgeDesignConfig, ForgeDesignProviderProps } from './providers/forge-design';
|
|
9
|
-
export {
|
|
11
|
+
export { ScrollView, KeyboardAvoidingView } from 'react-native';
|
|
10
12
|
export { SafeAreaView, useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
13
|
+
|
|
14
|
+
/** @deprecated Use `Box` instead. */
|
|
15
|
+
export const View = RNView;
|
|
16
|
+
/** @deprecated Use `BoxRef` for refs and `BoxProps` for props instead. */
|
|
17
|
+
export type View = RNView;
|