@entropix/react-native 0.3.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accordion.cjs +26 -0
- package/dist/accordion.d.cts +34 -0
- package/dist/accordion.d.ts +34 -0
- package/dist/accordion.js +5 -0
- package/dist/button.cjs +14 -0
- package/dist/button.d.cts +35 -0
- package/dist/button.d.ts +35 -0
- package/dist/button.js +5 -0
- package/dist/checkbox.cjs +14 -0
- package/dist/checkbox.d.cts +41 -0
- package/dist/checkbox.d.ts +41 -0
- package/dist/checkbox.js +5 -0
- package/dist/chunk-2SQB7RNT.cjs +110 -0
- package/dist/chunk-3MHE2C74.js +143 -0
- package/dist/chunk-45KMMZUT.js +131 -0
- package/dist/chunk-64DK6YFL.js +164 -0
- package/dist/chunk-73BDGPZT.js +89 -0
- package/dist/chunk-B5YFEA66.cjs +243 -0
- package/dist/chunk-BOUIB4OY.cjs +56 -0
- package/dist/chunk-C6HF6QXK.js +154 -0
- package/dist/chunk-CXQNNEPC.js +249 -0
- package/dist/chunk-EFRYMWJB.js +86 -0
- package/dist/chunk-FQUZIDVS.cjs +174 -0
- package/dist/chunk-G7WPUTB6.cjs +258 -0
- package/dist/chunk-HH3CEDSH.js +122 -0
- package/dist/chunk-IRQWSFCZ.cjs +156 -0
- package/dist/chunk-KU24A5PQ.js +92 -0
- package/dist/chunk-OMKUPSHJ.cjs +95 -0
- package/dist/chunk-P5NAXMSC.cjs +91 -0
- package/dist/chunk-PKDXWKLO.cjs +245 -0
- package/dist/chunk-PVTPOJRU.js +155 -0
- package/dist/chunk-Q7TEJ62Q.cjs +160 -0
- package/dist/chunk-THX22NZW.cjs +146 -0
- package/dist/chunk-UHVTF2Y4.js +172 -0
- package/dist/chunk-UYXJHKYK.cjs +166 -0
- package/dist/chunk-VP567WZL.js +237 -0
- package/dist/chunk-XBNX4SLA.js +105 -0
- package/dist/chunk-XND7AIKO.cjs +133 -0
- package/dist/chunk-XSOLJOBG.js +238 -0
- package/dist/chunk-Z2MBHXUQ.cjs +127 -0
- package/dist/chunk-ZPAOLIIG.cjs +88 -0
- package/dist/chunk-ZYOTKLBG.js +52 -0
- package/dist/dialog.cjs +38 -0
- package/dist/dialog.d.cts +83 -0
- package/dist/dialog.d.ts +83 -0
- package/dist/dialog.js +5 -0
- package/dist/index.cjs +187 -2063
- package/dist/index.d.cts +21 -651
- package/dist/index.d.ts +21 -651
- package/dist/index.js +15 -2025
- package/dist/input.cjs +14 -0
- package/dist/input.d.cts +57 -0
- package/dist/input.d.ts +57 -0
- package/dist/input.js +5 -0
- package/dist/layout.cjs +25 -0
- package/dist/layout.d.cts +108 -0
- package/dist/layout.d.ts +108 -0
- package/dist/layout.js +4 -0
- package/dist/menu.cjs +26 -0
- package/dist/menu.d.cts +34 -0
- package/dist/menu.d.ts +34 -0
- package/dist/menu.js +5 -0
- package/dist/radio.cjs +18 -0
- package/dist/radio.d.cts +55 -0
- package/dist/radio.d.ts +55 -0
- package/dist/radio.js +5 -0
- package/dist/select.cjs +26 -0
- package/dist/select.d.cts +86 -0
- package/dist/select.d.ts +86 -0
- package/dist/select.js +5 -0
- package/dist/switch.cjs +14 -0
- package/dist/switch.d.cts +27 -0
- package/dist/switch.d.ts +27 -0
- package/dist/switch.js +5 -0
- package/dist/tabs.cjs +26 -0
- package/dist/tabs.d.cts +33 -0
- package/dist/tabs.d.ts +33 -0
- package/dist/tabs.js +5 -0
- package/dist/textarea.cjs +14 -0
- package/dist/textarea.d.cts +55 -0
- package/dist/textarea.d.ts +55 -0
- package/dist/textarea.js +5 -0
- package/dist/theme.cjs +20 -0
- package/dist/theme.d.cts +59 -0
- package/dist/theme.d.ts +59 -0
- package/dist/theme.js +3 -0
- package/dist/toggle.cjs +18 -0
- package/dist/toggle.d.cts +41 -0
- package/dist/toggle.d.ts +41 -0
- package/dist/toggle.js +5 -0
- package/package.json +146 -4
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkP5NAXMSC_cjs = require('./chunk-P5NAXMSC.cjs');
|
|
4
|
+
var chunkBOUIB4OY_cjs = require('./chunk-BOUIB4OY.cjs');
|
|
5
|
+
var core = require('@entropix/core');
|
|
6
|
+
var react = require('react');
|
|
7
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
+
var reactNative = require('react-native');
|
|
9
|
+
|
|
10
|
+
var MenuContext = react.createContext(null);
|
|
11
|
+
function useMenuContext() {
|
|
12
|
+
const context = react.useContext(MenuContext);
|
|
13
|
+
if (!context) {
|
|
14
|
+
throw new Error(
|
|
15
|
+
"Menu compound components must be used within a <Menu> provider."
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
return context;
|
|
19
|
+
}
|
|
20
|
+
function Menu({ children, ...options }) {
|
|
21
|
+
const menu = core.useMenu(options);
|
|
22
|
+
return /* @__PURE__ */ jsxRuntime.jsx(MenuContext.Provider, { value: menu, children });
|
|
23
|
+
}
|
|
24
|
+
function MenuTrigger({ children, style, ...rest }) {
|
|
25
|
+
const { getTriggerProps } = useMenuContext();
|
|
26
|
+
const propGetterReturn = getTriggerProps();
|
|
27
|
+
const rnAccessibility = chunkP5NAXMSC_cjs.mapAccessibilityToRN(propGetterReturn.accessibility);
|
|
28
|
+
const handlePress = react.useCallback(() => {
|
|
29
|
+
propGetterReturn.onAction?.();
|
|
30
|
+
}, [propGetterReturn.onAction]);
|
|
31
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
32
|
+
reactNative.Pressable,
|
|
33
|
+
{
|
|
34
|
+
...rnAccessibility,
|
|
35
|
+
...rest,
|
|
36
|
+
onPress: handlePress,
|
|
37
|
+
style,
|
|
38
|
+
children
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
function MenuContent({ children, style, testID }) {
|
|
43
|
+
const { tokens: t, baseTokens: bt } = chunkBOUIB4OY_cjs.useTheme();
|
|
44
|
+
const { isOpen, getMenuProps } = useMenuContext();
|
|
45
|
+
const propGetterReturn = getMenuProps();
|
|
46
|
+
const rnAccessibility = chunkP5NAXMSC_cjs.mapAccessibilityToRN(propGetterReturn.accessibility);
|
|
47
|
+
if (!isOpen) return null;
|
|
48
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
49
|
+
reactNative.View,
|
|
50
|
+
{
|
|
51
|
+
...rnAccessibility,
|
|
52
|
+
testID,
|
|
53
|
+
style: [
|
|
54
|
+
{
|
|
55
|
+
minWidth: 160,
|
|
56
|
+
padding: bt.entropixSpacing1,
|
|
57
|
+
backgroundColor: t.entropixColorBgPrimary,
|
|
58
|
+
borderWidth: 1,
|
|
59
|
+
borderColor: t.entropixColorBorderDefault,
|
|
60
|
+
borderRadius: bt.entropixRadiusMd,
|
|
61
|
+
shadowColor: "#000",
|
|
62
|
+
shadowOffset: { width: 0, height: 2 },
|
|
63
|
+
shadowOpacity: 0.1,
|
|
64
|
+
shadowRadius: 8,
|
|
65
|
+
elevation: 4
|
|
66
|
+
},
|
|
67
|
+
style
|
|
68
|
+
],
|
|
69
|
+
children
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
function wrapStringChildren(children, style) {
|
|
74
|
+
if (typeof children === "string" || typeof children === "number") {
|
|
75
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style, children });
|
|
76
|
+
}
|
|
77
|
+
return children;
|
|
78
|
+
}
|
|
79
|
+
function MenuItem({
|
|
80
|
+
index,
|
|
81
|
+
onSelect,
|
|
82
|
+
disabled,
|
|
83
|
+
children,
|
|
84
|
+
style,
|
|
85
|
+
textStyle,
|
|
86
|
+
...rest
|
|
87
|
+
}) {
|
|
88
|
+
const { tokens: t, baseTokens: bt } = chunkBOUIB4OY_cjs.useTheme();
|
|
89
|
+
const { getItemProps } = useMenuContext();
|
|
90
|
+
const propGetterReturn = getItemProps(index, { onSelect, disabled });
|
|
91
|
+
const rnAccessibility = chunkP5NAXMSC_cjs.mapAccessibilityToRN(propGetterReturn.accessibility);
|
|
92
|
+
const handlePress = react.useCallback(() => {
|
|
93
|
+
propGetterReturn.onAction?.();
|
|
94
|
+
}, [propGetterReturn.onAction]);
|
|
95
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
96
|
+
reactNative.Pressable,
|
|
97
|
+
{
|
|
98
|
+
...rnAccessibility,
|
|
99
|
+
...rest,
|
|
100
|
+
disabled,
|
|
101
|
+
onPress: propGetterReturn.onAction ? handlePress : void 0,
|
|
102
|
+
style: [
|
|
103
|
+
{
|
|
104
|
+
flexDirection: "row",
|
|
105
|
+
alignItems: "center",
|
|
106
|
+
paddingVertical: bt.entropixSpacing2,
|
|
107
|
+
paddingHorizontal: bt.entropixSpacing3,
|
|
108
|
+
borderRadius: bt.entropixRadiusSm,
|
|
109
|
+
opacity: disabled ? 0.5 : 1
|
|
110
|
+
},
|
|
111
|
+
style
|
|
112
|
+
],
|
|
113
|
+
children: wrapStringChildren(children, {
|
|
114
|
+
fontSize: bt.entropixFontSizeSm,
|
|
115
|
+
color: t.entropixColorTextPrimary,
|
|
116
|
+
...textStyle
|
|
117
|
+
})
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
exports.Menu = Menu;
|
|
123
|
+
exports.MenuContent = MenuContent;
|
|
124
|
+
exports.MenuItem = MenuItem;
|
|
125
|
+
exports.MenuTrigger = MenuTrigger;
|
|
126
|
+
//# sourceMappingURL=chunk-Z2MBHXUQ.cjs.map
|
|
127
|
+
//# sourceMappingURL=chunk-Z2MBHXUQ.cjs.map
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkP5NAXMSC_cjs = require('./chunk-P5NAXMSC.cjs');
|
|
4
|
+
var chunkBOUIB4OY_cjs = require('./chunk-BOUIB4OY.cjs');
|
|
5
|
+
var react = require('react');
|
|
6
|
+
var reactNative = require('react-native');
|
|
7
|
+
var core = require('@entropix/core');
|
|
8
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
9
|
+
|
|
10
|
+
var TRACK_WIDTH = 44;
|
|
11
|
+
var TRACK_HEIGHT = 24;
|
|
12
|
+
var TRACK_PADDING = 2;
|
|
13
|
+
var THUMB_SIZE = TRACK_HEIGHT - TRACK_PADDING * 2;
|
|
14
|
+
var THUMB_TRAVEL = TRACK_WIDTH - TRACK_PADDING * 2 - THUMB_SIZE;
|
|
15
|
+
function Switch({
|
|
16
|
+
checked,
|
|
17
|
+
defaultChecked,
|
|
18
|
+
onChange,
|
|
19
|
+
disabled,
|
|
20
|
+
label,
|
|
21
|
+
style,
|
|
22
|
+
...rest
|
|
23
|
+
}) {
|
|
24
|
+
const { tokens: t, baseTokens: bt } = chunkBOUIB4OY_cjs.useTheme();
|
|
25
|
+
const { isDisabled, getToggleProps } = core.useToggle({
|
|
26
|
+
checked,
|
|
27
|
+
defaultChecked,
|
|
28
|
+
onChange,
|
|
29
|
+
disabled,
|
|
30
|
+
role: "switch"
|
|
31
|
+
});
|
|
32
|
+
const propGetterReturn = getToggleProps();
|
|
33
|
+
const rnAccessibility = chunkP5NAXMSC_cjs.mapAccessibilityToRN(propGetterReturn.accessibility);
|
|
34
|
+
const isChecked = propGetterReturn.accessibility.checked === true;
|
|
35
|
+
if (label) {
|
|
36
|
+
rnAccessibility.accessibilityLabel = label;
|
|
37
|
+
}
|
|
38
|
+
const handlePress = react.useCallback(() => {
|
|
39
|
+
propGetterReturn.onAction?.();
|
|
40
|
+
}, [propGetterReturn.onAction]);
|
|
41
|
+
const thumbAnim = react.useRef(
|
|
42
|
+
new reactNative.Animated.Value(defaultChecked || checked ? THUMB_TRAVEL : 0)
|
|
43
|
+
).current;
|
|
44
|
+
react.useEffect(() => {
|
|
45
|
+
reactNative.Animated.timing(thumbAnim, {
|
|
46
|
+
toValue: isChecked ? THUMB_TRAVEL : 0,
|
|
47
|
+
duration: 150,
|
|
48
|
+
useNativeDriver: false
|
|
49
|
+
}).start();
|
|
50
|
+
}, [isChecked, thumbAnim]);
|
|
51
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
52
|
+
reactNative.Pressable,
|
|
53
|
+
{
|
|
54
|
+
...rnAccessibility,
|
|
55
|
+
...rest,
|
|
56
|
+
disabled: isDisabled,
|
|
57
|
+
onPress: isDisabled ? void 0 : handlePress,
|
|
58
|
+
style: [
|
|
59
|
+
{
|
|
60
|
+
width: TRACK_WIDTH,
|
|
61
|
+
height: TRACK_HEIGHT,
|
|
62
|
+
borderRadius: bt.entropixRadiusFull,
|
|
63
|
+
backgroundColor: isChecked ? t.entropixColorActionPrimaryDefault : t.entropixColorGray300,
|
|
64
|
+
padding: TRACK_PADDING,
|
|
65
|
+
justifyContent: "center"
|
|
66
|
+
},
|
|
67
|
+
isDisabled && { opacity: 0.5 },
|
|
68
|
+
style
|
|
69
|
+
],
|
|
70
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
71
|
+
reactNative.Animated.View,
|
|
72
|
+
{
|
|
73
|
+
style: {
|
|
74
|
+
width: THUMB_SIZE,
|
|
75
|
+
height: THUMB_SIZE,
|
|
76
|
+
borderRadius: bt.entropixRadiusFull,
|
|
77
|
+
backgroundColor: t.entropixColorWhite,
|
|
78
|
+
transform: [{ translateX: thumbAnim }]
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
exports.Switch = Switch;
|
|
87
|
+
//# sourceMappingURL=chunk-ZPAOLIIG.cjs.map
|
|
88
|
+
//# sourceMappingURL=chunk-ZPAOLIIG.cjs.map
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { createContext, useMemo, useContext } from 'react';
|
|
2
|
+
import { tokens } from '@entropix/tokens/native';
|
|
3
|
+
import { tokens as tokens$1 } from '@entropix/tokens/native/light';
|
|
4
|
+
import { tokens as tokens$2 } from '@entropix/tokens/native/dark';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
// src/theme/theme-context.tsx
|
|
8
|
+
var ThemeContext = createContext({
|
|
9
|
+
mode: "light",
|
|
10
|
+
brand: "default",
|
|
11
|
+
tokens: tokens$1,
|
|
12
|
+
baseTokens: tokens
|
|
13
|
+
});
|
|
14
|
+
var brandRegistry = {
|
|
15
|
+
default: {
|
|
16
|
+
light: tokens$1,
|
|
17
|
+
dark: tokens$2
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
function registerBrand(name, themes) {
|
|
21
|
+
brandRegistry[name] = themes;
|
|
22
|
+
}
|
|
23
|
+
function EntropixProvider({
|
|
24
|
+
mode = "light",
|
|
25
|
+
brand = "default",
|
|
26
|
+
tokens: tokenOverride,
|
|
27
|
+
children
|
|
28
|
+
}) {
|
|
29
|
+
const value = useMemo(() => {
|
|
30
|
+
let resolvedTokens;
|
|
31
|
+
if (tokenOverride) {
|
|
32
|
+
resolvedTokens = tokenOverride;
|
|
33
|
+
} else {
|
|
34
|
+
const brandThemes = brandRegistry[brand] ?? brandRegistry.default;
|
|
35
|
+
resolvedTokens = brandThemes[mode] ?? brandThemes.light;
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
mode,
|
|
39
|
+
brand,
|
|
40
|
+
tokens: resolvedTokens,
|
|
41
|
+
baseTokens: tokens
|
|
42
|
+
};
|
|
43
|
+
}, [mode, brand, tokenOverride]);
|
|
44
|
+
return /* @__PURE__ */ jsx(ThemeContext.Provider, { value, children });
|
|
45
|
+
}
|
|
46
|
+
function useTheme() {
|
|
47
|
+
return useContext(ThemeContext);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export { EntropixProvider, registerBrand, useTheme };
|
|
51
|
+
//# sourceMappingURL=chunk-ZYOTKLBG.js.map
|
|
52
|
+
//# sourceMappingURL=chunk-ZYOTKLBG.js.map
|
package/dist/dialog.cjs
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkPKDXWKLO_cjs = require('./chunk-PKDXWKLO.cjs');
|
|
4
|
+
require('./chunk-P5NAXMSC.cjs');
|
|
5
|
+
require('./chunk-BOUIB4OY.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, "Dialog", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () { return chunkPKDXWKLO_cjs.Dialog; }
|
|
12
|
+
});
|
|
13
|
+
Object.defineProperty(exports, "DialogClose", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () { return chunkPKDXWKLO_cjs.DialogClose; }
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "DialogContent", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () { return chunkPKDXWKLO_cjs.DialogContent; }
|
|
20
|
+
});
|
|
21
|
+
Object.defineProperty(exports, "DialogDescription", {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () { return chunkPKDXWKLO_cjs.DialogDescription; }
|
|
24
|
+
});
|
|
25
|
+
Object.defineProperty(exports, "DialogOverlay", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () { return chunkPKDXWKLO_cjs.DialogOverlay; }
|
|
28
|
+
});
|
|
29
|
+
Object.defineProperty(exports, "DialogTitle", {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
get: function () { return chunkPKDXWKLO_cjs.DialogTitle; }
|
|
32
|
+
});
|
|
33
|
+
Object.defineProperty(exports, "DialogTrigger", {
|
|
34
|
+
enumerable: true,
|
|
35
|
+
get: function () { return chunkPKDXWKLO_cjs.DialogTrigger; }
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=dialog.cjs.map
|
|
38
|
+
//# sourceMappingURL=dialog.cjs.map
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { UseDialogOptions } from '@entropix/core';
|
|
4
|
+
import { PressableProps, StyleProp, ViewStyle, ViewProps, TextProps, TextStyle } from 'react-native';
|
|
5
|
+
|
|
6
|
+
interface DialogProps extends UseDialogOptions {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Dialog root — provides dialog state to compound sub-components.
|
|
11
|
+
* Renders no UI of its own.
|
|
12
|
+
*/
|
|
13
|
+
declare function Dialog({ children, isOpen, defaultOpen, onOpenChange, closeOnOverlayPress, closeOnEscape, modal, role, }: DialogProps): react_jsx_runtime.JSX.Element;
|
|
14
|
+
|
|
15
|
+
interface DialogTriggerProps extends Omit<PressableProps, "onPress" | "style"> {
|
|
16
|
+
children?: React.ReactNode;
|
|
17
|
+
style?: StyleProp<ViewStyle>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* DialogTrigger — Pressable that opens/closes the dialog.
|
|
21
|
+
*/
|
|
22
|
+
declare function DialogTrigger({ children, style, ...rest }: DialogTriggerProps): react_jsx_runtime.JSX.Element;
|
|
23
|
+
|
|
24
|
+
interface DialogContentProps extends Omit<ViewProps, "style"> {
|
|
25
|
+
children?: React.ReactNode;
|
|
26
|
+
style?: StyleProp<ViewStyle>;
|
|
27
|
+
/** Style for the inner card. */
|
|
28
|
+
cardStyle?: StyleProp<ViewStyle>;
|
|
29
|
+
/** Modal animation type. Default: "fade" */
|
|
30
|
+
animationType?: "none" | "slide" | "fade";
|
|
31
|
+
/** Whether the modal background is transparent. Default: true */
|
|
32
|
+
transparent?: boolean;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* DialogContent — wraps children in RN's Modal component.
|
|
36
|
+
*
|
|
37
|
+
* Modal provides native focus trapping for screen readers.
|
|
38
|
+
* onRequestClose handles Android back button (maps to core's "dismiss" intent).
|
|
39
|
+
*/
|
|
40
|
+
declare function DialogContent({ children, style, cardStyle, animationType, transparent, ...rest }: DialogContentProps): react_jsx_runtime.JSX.Element;
|
|
41
|
+
|
|
42
|
+
interface DialogTitleProps extends Omit<TextProps, "style"> {
|
|
43
|
+
children?: React.ReactNode;
|
|
44
|
+
style?: StyleProp<TextStyle>;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* DialogTitle — Text element with nativeID for accessibility linking.
|
|
48
|
+
* Uses accessibilityRole="header" for screen reader heading semantics.
|
|
49
|
+
*/
|
|
50
|
+
declare function DialogTitle({ children, style, ...rest }: DialogTitleProps): react_jsx_runtime.JSX.Element;
|
|
51
|
+
|
|
52
|
+
interface DialogDescriptionProps extends Omit<TextProps, "style"> {
|
|
53
|
+
children?: React.ReactNode;
|
|
54
|
+
style?: StyleProp<TextStyle>;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* DialogDescription — Text element with nativeID for accessibility linking.
|
|
58
|
+
*/
|
|
59
|
+
declare function DialogDescription({ children, style, ...rest }: DialogDescriptionProps): react_jsx_runtime.JSX.Element;
|
|
60
|
+
|
|
61
|
+
interface DialogCloseProps extends Omit<PressableProps, "onPress" | "style"> {
|
|
62
|
+
children?: React.ReactNode;
|
|
63
|
+
style?: StyleProp<ViewStyle>;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* DialogClose — Pressable that closes the dialog.
|
|
67
|
+
* Renders as a positioned "✕" button by default if no children provided.
|
|
68
|
+
*/
|
|
69
|
+
declare function DialogClose({ children, style, ...rest }: DialogCloseProps): react_jsx_runtime.JSX.Element;
|
|
70
|
+
|
|
71
|
+
interface DialogOverlayProps {
|
|
72
|
+
style?: StyleProp<ViewStyle>;
|
|
73
|
+
testID?: string;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* DialogOverlay — backdrop element behind dialog content.
|
|
77
|
+
* Note: With the self-styled DialogContent, the overlay is built into the
|
|
78
|
+
* Modal wrapper. This component is kept for consumers who need a separate
|
|
79
|
+
* overlay element (e.g., custom dismiss-on-tap behavior outside DialogContent).
|
|
80
|
+
*/
|
|
81
|
+
declare function DialogOverlay({ style, testID }: DialogOverlayProps): react_jsx_runtime.JSX.Element | null;
|
|
82
|
+
|
|
83
|
+
export { Dialog, DialogClose, type DialogCloseProps, DialogContent, type DialogContentProps, DialogDescription, type DialogDescriptionProps, DialogOverlay, type DialogOverlayProps, type DialogProps, DialogTitle, type DialogTitleProps, DialogTrigger, type DialogTriggerProps };
|
package/dist/dialog.d.ts
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { UseDialogOptions } from '@entropix/core';
|
|
4
|
+
import { PressableProps, StyleProp, ViewStyle, ViewProps, TextProps, TextStyle } from 'react-native';
|
|
5
|
+
|
|
6
|
+
interface DialogProps extends UseDialogOptions {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Dialog root — provides dialog state to compound sub-components.
|
|
11
|
+
* Renders no UI of its own.
|
|
12
|
+
*/
|
|
13
|
+
declare function Dialog({ children, isOpen, defaultOpen, onOpenChange, closeOnOverlayPress, closeOnEscape, modal, role, }: DialogProps): react_jsx_runtime.JSX.Element;
|
|
14
|
+
|
|
15
|
+
interface DialogTriggerProps extends Omit<PressableProps, "onPress" | "style"> {
|
|
16
|
+
children?: React.ReactNode;
|
|
17
|
+
style?: StyleProp<ViewStyle>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* DialogTrigger — Pressable that opens/closes the dialog.
|
|
21
|
+
*/
|
|
22
|
+
declare function DialogTrigger({ children, style, ...rest }: DialogTriggerProps): react_jsx_runtime.JSX.Element;
|
|
23
|
+
|
|
24
|
+
interface DialogContentProps extends Omit<ViewProps, "style"> {
|
|
25
|
+
children?: React.ReactNode;
|
|
26
|
+
style?: StyleProp<ViewStyle>;
|
|
27
|
+
/** Style for the inner card. */
|
|
28
|
+
cardStyle?: StyleProp<ViewStyle>;
|
|
29
|
+
/** Modal animation type. Default: "fade" */
|
|
30
|
+
animationType?: "none" | "slide" | "fade";
|
|
31
|
+
/** Whether the modal background is transparent. Default: true */
|
|
32
|
+
transparent?: boolean;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* DialogContent — wraps children in RN's Modal component.
|
|
36
|
+
*
|
|
37
|
+
* Modal provides native focus trapping for screen readers.
|
|
38
|
+
* onRequestClose handles Android back button (maps to core's "dismiss" intent).
|
|
39
|
+
*/
|
|
40
|
+
declare function DialogContent({ children, style, cardStyle, animationType, transparent, ...rest }: DialogContentProps): react_jsx_runtime.JSX.Element;
|
|
41
|
+
|
|
42
|
+
interface DialogTitleProps extends Omit<TextProps, "style"> {
|
|
43
|
+
children?: React.ReactNode;
|
|
44
|
+
style?: StyleProp<TextStyle>;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* DialogTitle — Text element with nativeID for accessibility linking.
|
|
48
|
+
* Uses accessibilityRole="header" for screen reader heading semantics.
|
|
49
|
+
*/
|
|
50
|
+
declare function DialogTitle({ children, style, ...rest }: DialogTitleProps): react_jsx_runtime.JSX.Element;
|
|
51
|
+
|
|
52
|
+
interface DialogDescriptionProps extends Omit<TextProps, "style"> {
|
|
53
|
+
children?: React.ReactNode;
|
|
54
|
+
style?: StyleProp<TextStyle>;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* DialogDescription — Text element with nativeID for accessibility linking.
|
|
58
|
+
*/
|
|
59
|
+
declare function DialogDescription({ children, style, ...rest }: DialogDescriptionProps): react_jsx_runtime.JSX.Element;
|
|
60
|
+
|
|
61
|
+
interface DialogCloseProps extends Omit<PressableProps, "onPress" | "style"> {
|
|
62
|
+
children?: React.ReactNode;
|
|
63
|
+
style?: StyleProp<ViewStyle>;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* DialogClose — Pressable that closes the dialog.
|
|
67
|
+
* Renders as a positioned "✕" button by default if no children provided.
|
|
68
|
+
*/
|
|
69
|
+
declare function DialogClose({ children, style, ...rest }: DialogCloseProps): react_jsx_runtime.JSX.Element;
|
|
70
|
+
|
|
71
|
+
interface DialogOverlayProps {
|
|
72
|
+
style?: StyleProp<ViewStyle>;
|
|
73
|
+
testID?: string;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* DialogOverlay — backdrop element behind dialog content.
|
|
77
|
+
* Note: With the self-styled DialogContent, the overlay is built into the
|
|
78
|
+
* Modal wrapper. This component is kept for consumers who need a separate
|
|
79
|
+
* overlay element (e.g., custom dismiss-on-tap behavior outside DialogContent).
|
|
80
|
+
*/
|
|
81
|
+
declare function DialogOverlay({ style, testID }: DialogOverlayProps): react_jsx_runtime.JSX.Element | null;
|
|
82
|
+
|
|
83
|
+
export { Dialog, DialogClose, type DialogCloseProps, DialogContent, type DialogContentProps, DialogDescription, type DialogDescriptionProps, DialogOverlay, type DialogOverlayProps, type DialogProps, DialogTitle, type DialogTitleProps, DialogTrigger, type DialogTriggerProps };
|
package/dist/dialog.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogOverlay, DialogTitle, DialogTrigger } from './chunk-VP567WZL.js';
|
|
2
|
+
import './chunk-73BDGPZT.js';
|
|
3
|
+
import './chunk-ZYOTKLBG.js';
|
|
4
|
+
//# sourceMappingURL=dialog.js.map
|
|
5
|
+
//# sourceMappingURL=dialog.js.map
|