@onlynative/components 0.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,263 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/card/index.ts
21
+ var card_exports = {};
22
+ __export(card_exports, {
23
+ Card: () => Card
24
+ });
25
+ module.exports = __toCommonJS(card_exports);
26
+
27
+ // src/card/Card.tsx
28
+ var import_react = require("react");
29
+ var import_react_native4 = require("react-native");
30
+ var import_core = require("@onlynative/core");
31
+
32
+ // src/card/styles.ts
33
+ var import_react_native3 = require("react-native");
34
+
35
+ // ../utils/dist/index.mjs
36
+ var import_react_native = require("react-native");
37
+ var import_react_native2 = require("react-native");
38
+ function parseHexColor(color) {
39
+ const normalized = color.replace("#", "");
40
+ if (normalized.length !== 6 && normalized.length !== 8) {
41
+ return null;
42
+ }
43
+ const r = Number.parseInt(normalized.slice(0, 2), 16);
44
+ const g = Number.parseInt(normalized.slice(2, 4), 16);
45
+ const b = Number.parseInt(normalized.slice(4, 6), 16);
46
+ if (Number.isNaN(r) || Number.isNaN(g) || Number.isNaN(b)) {
47
+ return null;
48
+ }
49
+ return { r, g, b };
50
+ }
51
+ function clampAlpha(alpha) {
52
+ return Math.max(0, Math.min(1, alpha));
53
+ }
54
+ function alphaColor(color, alpha) {
55
+ const channels = parseHexColor(color);
56
+ const boundedAlpha = clampAlpha(alpha);
57
+ if (!channels) {
58
+ return color;
59
+ }
60
+ return `rgba(${channels.r}, ${channels.g}, ${channels.b}, ${boundedAlpha})`;
61
+ }
62
+ function blendColor(base, overlay, overlayAlpha) {
63
+ const baseChannels = parseHexColor(base);
64
+ const overlayChannels = parseHexColor(overlay);
65
+ const boundedAlpha = clampAlpha(overlayAlpha);
66
+ if (!baseChannels || !overlayChannels) {
67
+ return alphaColor(overlay, boundedAlpha);
68
+ }
69
+ const r = Math.round(
70
+ (1 - boundedAlpha) * baseChannels.r + boundedAlpha * overlayChannels.r
71
+ );
72
+ const g = Math.round(
73
+ (1 - boundedAlpha) * baseChannels.g + boundedAlpha * overlayChannels.g
74
+ );
75
+ const b = Math.round(
76
+ (1 - boundedAlpha) * baseChannels.b + boundedAlpha * overlayChannels.b
77
+ );
78
+ return `rgb(${r}, ${g}, ${b})`;
79
+ }
80
+ function elevationStyle(level) {
81
+ if (import_react_native.Platform.OS === "web") {
82
+ const { shadowOffset, shadowOpacity, shadowRadius } = level;
83
+ if (shadowOpacity === 0) {
84
+ return { boxShadow: "none" };
85
+ }
86
+ return {
87
+ boxShadow: `${shadowOffset.width}px ${shadowOffset.height}px ${shadowRadius}px rgba(0, 0, 0, ${shadowOpacity})`
88
+ };
89
+ }
90
+ return {
91
+ shadowColor: level.shadowColor,
92
+ shadowOffset: {
93
+ width: level.shadowOffset.width,
94
+ height: level.shadowOffset.height
95
+ },
96
+ shadowOpacity: level.shadowOpacity,
97
+ shadowRadius: level.shadowRadius,
98
+ elevation: level.elevation
99
+ };
100
+ }
101
+
102
+ // src/card/styles.ts
103
+ function getVariantColors(theme, variant) {
104
+ const disabledContainerColor = alphaColor(theme.colors.onSurface, 0.12);
105
+ const disabledOutlineColor = alphaColor(theme.colors.onSurface, 0.12);
106
+ if (variant === "outlined") {
107
+ return {
108
+ backgroundColor: theme.colors.surface,
109
+ borderColor: theme.colors.outline,
110
+ borderWidth: 1,
111
+ hoveredBackgroundColor: alphaColor(
112
+ theme.colors.onSurface,
113
+ theme.stateLayer.hoveredOpacity
114
+ ),
115
+ pressedBackgroundColor: alphaColor(
116
+ theme.colors.onSurface,
117
+ theme.stateLayer.pressedOpacity
118
+ ),
119
+ disabledBackgroundColor: theme.colors.surface,
120
+ disabledBorderColor: disabledOutlineColor
121
+ };
122
+ }
123
+ if (variant === "filled") {
124
+ return {
125
+ backgroundColor: theme.colors.surfaceContainerHighest,
126
+ borderColor: "transparent",
127
+ borderWidth: 0,
128
+ hoveredBackgroundColor: blendColor(
129
+ theme.colors.surfaceContainerHighest,
130
+ theme.colors.onSurface,
131
+ theme.stateLayer.hoveredOpacity
132
+ ),
133
+ pressedBackgroundColor: blendColor(
134
+ theme.colors.surfaceContainerHighest,
135
+ theme.colors.onSurface,
136
+ theme.stateLayer.pressedOpacity
137
+ ),
138
+ disabledBackgroundColor: disabledContainerColor,
139
+ disabledBorderColor: "transparent"
140
+ };
141
+ }
142
+ return {
143
+ backgroundColor: theme.colors.surface,
144
+ borderColor: "transparent",
145
+ borderWidth: 0,
146
+ hoveredBackgroundColor: blendColor(
147
+ theme.colors.surface,
148
+ theme.colors.onSurface,
149
+ theme.stateLayer.hoveredOpacity
150
+ ),
151
+ pressedBackgroundColor: blendColor(
152
+ theme.colors.surface,
153
+ theme.colors.onSurface,
154
+ theme.stateLayer.pressedOpacity
155
+ ),
156
+ disabledBackgroundColor: disabledContainerColor,
157
+ disabledBorderColor: "transparent"
158
+ };
159
+ }
160
+ function applyColorOverrides(theme, colors, containerColor) {
161
+ if (!containerColor) return colors;
162
+ return {
163
+ ...colors,
164
+ backgroundColor: containerColor,
165
+ borderColor: containerColor,
166
+ borderWidth: 0,
167
+ hoveredBackgroundColor: blendColor(
168
+ containerColor,
169
+ theme.colors.onSurface,
170
+ theme.stateLayer.hoveredOpacity
171
+ ),
172
+ pressedBackgroundColor: blendColor(
173
+ containerColor,
174
+ theme.colors.onSurface,
175
+ theme.stateLayer.pressedOpacity
176
+ )
177
+ };
178
+ }
179
+ function createStyles(theme, variant, containerColor) {
180
+ const baseColors = getVariantColors(theme, variant);
181
+ const colors = applyColorOverrides(theme, baseColors, containerColor);
182
+ const elevationLevel0 = elevationStyle(theme.elevation.level0);
183
+ const elevationLevel1 = elevationStyle(theme.elevation.level1);
184
+ const elevationLevel2 = elevationStyle(theme.elevation.level2);
185
+ const baseElevation = variant === "elevated" ? elevationLevel1 : elevationLevel0;
186
+ return import_react_native3.StyleSheet.create({
187
+ container: {
188
+ borderRadius: theme.shape.cornerMedium,
189
+ backgroundColor: colors.backgroundColor,
190
+ borderColor: colors.borderColor,
191
+ borderWidth: colors.borderWidth,
192
+ overflow: "hidden",
193
+ ...baseElevation
194
+ },
195
+ interactiveContainer: {
196
+ cursor: "pointer"
197
+ },
198
+ hoveredContainer: {
199
+ backgroundColor: colors.hoveredBackgroundColor,
200
+ ...variant === "elevated" ? elevationLevel2 : variant === "filled" ? elevationLevel1 : void 0
201
+ },
202
+ pressedContainer: {
203
+ backgroundColor: colors.pressedBackgroundColor
204
+ },
205
+ disabledContainer: {
206
+ backgroundColor: colors.disabledBackgroundColor,
207
+ borderColor: colors.disabledBorderColor,
208
+ cursor: "auto",
209
+ ...elevationLevel0
210
+ },
211
+ disabledContent: {
212
+ opacity: theme.stateLayer.disabledOpacity
213
+ }
214
+ });
215
+ }
216
+
217
+ // src/card/Card.tsx
218
+ var import_jsx_runtime = require("react/jsx-runtime");
219
+ function Card({
220
+ children,
221
+ style,
222
+ variant = "elevated",
223
+ onPress,
224
+ disabled = false,
225
+ containerColor,
226
+ ...props
227
+ }) {
228
+ const isDisabled = Boolean(disabled);
229
+ const isInteractive = onPress !== void 0;
230
+ const theme = (0, import_core.useTheme)();
231
+ const styles = (0, import_react.useMemo)(
232
+ () => createStyles(theme, variant, containerColor),
233
+ [theme, variant, containerColor]
234
+ );
235
+ if (!isInteractive) {
236
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native4.View, { ...props, style: [styles.container, style], children });
237
+ }
238
+ const resolvedStyle = (state) => [
239
+ styles.container,
240
+ styles.interactiveContainer,
241
+ state.hovered && !state.pressed && !isDisabled ? styles.hoveredContainer : void 0,
242
+ state.pressed && !isDisabled ? styles.pressedContainer : void 0,
243
+ isDisabled ? styles.disabledContainer : void 0,
244
+ typeof style === "function" ? style(state) : style
245
+ ];
246
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
247
+ import_react_native4.Pressable,
248
+ {
249
+ ...props,
250
+ role: "button",
251
+ accessibilityState: { disabled: isDisabled },
252
+ hitSlop: import_react_native4.Platform.OS === "web" ? void 0 : 4,
253
+ disabled: isDisabled,
254
+ onPress,
255
+ style: resolvedStyle,
256
+ children: isDisabled ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native4.View, { style: styles.disabledContent, children }) : children
257
+ }
258
+ );
259
+ }
260
+ // Annotate the CommonJS export names for ESM import in node:
261
+ 0 && (module.exports = {
262
+ Card
263
+ });
@@ -0,0 +1,25 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { PressableProps } from 'react-native';
3
+
4
+ interface CheckboxProps extends Omit<PressableProps, 'children'> {
5
+ /**
6
+ * Whether the checkbox is checked.
7
+ * @default false
8
+ */
9
+ value?: boolean;
10
+ /** Callback fired when the checkbox is toggled. Receives the new value. */
11
+ onValueChange?: (value: boolean) => void;
12
+ /**
13
+ * Override the container (box) color when checked.
14
+ * State-layer colors (hover, press) are derived automatically.
15
+ */
16
+ containerColor?: string;
17
+ /**
18
+ * Override the checkmark icon color.
19
+ */
20
+ contentColor?: string;
21
+ }
22
+
23
+ declare function Checkbox({ style, value, onValueChange, containerColor, contentColor, disabled, ...props }: CheckboxProps): react_jsx_runtime.JSX.Element;
24
+
25
+ export { Checkbox, type CheckboxProps };
@@ -0,0 +1,308 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/checkbox/index.ts
21
+ var checkbox_exports = {};
22
+ __export(checkbox_exports, {
23
+ Checkbox: () => Checkbox
24
+ });
25
+ module.exports = __toCommonJS(checkbox_exports);
26
+
27
+ // src/checkbox/Checkbox.tsx
28
+ var import_react = require("react");
29
+ var import_react_native4 = require("react-native");
30
+ var import_core = require("@onlynative/core");
31
+
32
+ // ../utils/dist/chunk-OQRDRRQA.mjs
33
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
34
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
35
+ }) : x)(function(x) {
36
+ if (typeof require !== "undefined") return require.apply(this, arguments);
37
+ throw Error('Dynamic require of "' + x + '" is not supported');
38
+ });
39
+
40
+ // ../utils/dist/index.mjs
41
+ var import_react_native = require("react-native");
42
+ var import_react_native2 = require("react-native");
43
+ function parseHexColor(color) {
44
+ const normalized = color.replace("#", "");
45
+ if (normalized.length !== 6 && normalized.length !== 8) {
46
+ return null;
47
+ }
48
+ const r = Number.parseInt(normalized.slice(0, 2), 16);
49
+ const g = Number.parseInt(normalized.slice(2, 4), 16);
50
+ const b = Number.parseInt(normalized.slice(4, 6), 16);
51
+ if (Number.isNaN(r) || Number.isNaN(g) || Number.isNaN(b)) {
52
+ return null;
53
+ }
54
+ return { r, g, b };
55
+ }
56
+ function clampAlpha(alpha) {
57
+ return Math.max(0, Math.min(1, alpha));
58
+ }
59
+ function alphaColor(color, alpha) {
60
+ const channels = parseHexColor(color);
61
+ const boundedAlpha = clampAlpha(alpha);
62
+ if (!channels) {
63
+ return color;
64
+ }
65
+ return `rgba(${channels.r}, ${channels.g}, ${channels.b}, ${boundedAlpha})`;
66
+ }
67
+ function blendColor(base, overlay, overlayAlpha) {
68
+ const baseChannels = parseHexColor(base);
69
+ const overlayChannels = parseHexColor(overlay);
70
+ const boundedAlpha = clampAlpha(overlayAlpha);
71
+ if (!baseChannels || !overlayChannels) {
72
+ return alphaColor(overlay, boundedAlpha);
73
+ }
74
+ const r = Math.round(
75
+ (1 - boundedAlpha) * baseChannels.r + boundedAlpha * overlayChannels.r
76
+ );
77
+ const g = Math.round(
78
+ (1 - boundedAlpha) * baseChannels.g + boundedAlpha * overlayChannels.g
79
+ );
80
+ const b = Math.round(
81
+ (1 - boundedAlpha) * baseChannels.b + boundedAlpha * overlayChannels.b
82
+ );
83
+ return `rgb(${r}, ${g}, ${b})`;
84
+ }
85
+ var _MCIcons = null;
86
+ var _resolved = false;
87
+ function getMaterialCommunityIcons() {
88
+ if (!_resolved) {
89
+ _resolved = true;
90
+ try {
91
+ const mod = __require("@expo/vector-icons/MaterialCommunityIcons");
92
+ _MCIcons = mod.default || mod;
93
+ } catch {
94
+ _MCIcons = null;
95
+ }
96
+ }
97
+ if (!_MCIcons) {
98
+ throw new Error(
99
+ "@expo/vector-icons is required for icon support. Install it with: npx expo install @expo/vector-icons"
100
+ );
101
+ }
102
+ return _MCIcons;
103
+ }
104
+
105
+ // src/checkbox/styles.ts
106
+ var import_react_native3 = require("react-native");
107
+ function getColors(theme, checked) {
108
+ const disabledOnSurface38 = alphaColor(theme.colors.onSurface, 0.38);
109
+ if (checked) {
110
+ return {
111
+ backgroundColor: theme.colors.primary,
112
+ borderColor: "transparent",
113
+ borderWidth: 0,
114
+ iconColor: theme.colors.onPrimary,
115
+ hoveredBackgroundColor: blendColor(
116
+ theme.colors.primary,
117
+ theme.colors.onPrimary,
118
+ theme.stateLayer.hoveredOpacity
119
+ ),
120
+ pressedBackgroundColor: blendColor(
121
+ theme.colors.primary,
122
+ theme.colors.onPrimary,
123
+ theme.stateLayer.pressedOpacity
124
+ ),
125
+ disabledBackgroundColor: disabledOnSurface38,
126
+ disabledBorderColor: "transparent",
127
+ disabledBorderWidth: 0,
128
+ disabledIconColor: theme.colors.surface
129
+ };
130
+ }
131
+ return {
132
+ backgroundColor: "transparent",
133
+ borderColor: theme.colors.onSurfaceVariant,
134
+ borderWidth: 2,
135
+ iconColor: "transparent",
136
+ hoveredBackgroundColor: alphaColor(
137
+ theme.colors.onSurface,
138
+ theme.stateLayer.hoveredOpacity
139
+ ),
140
+ pressedBackgroundColor: alphaColor(
141
+ theme.colors.onSurface,
142
+ theme.stateLayer.pressedOpacity
143
+ ),
144
+ disabledBackgroundColor: "transparent",
145
+ disabledBorderColor: disabledOnSurface38,
146
+ disabledBorderWidth: 2,
147
+ disabledIconColor: "transparent"
148
+ };
149
+ }
150
+ function applyColorOverrides(theme, colors, containerColor, contentColor) {
151
+ if (!containerColor && !contentColor) return colors;
152
+ const result = { ...colors };
153
+ if (contentColor) {
154
+ result.iconColor = contentColor;
155
+ }
156
+ if (containerColor) {
157
+ const overlay = contentColor != null ? contentColor : colors.iconColor;
158
+ result.backgroundColor = containerColor;
159
+ result.borderColor = containerColor;
160
+ result.hoveredBackgroundColor = blendColor(
161
+ containerColor,
162
+ overlay,
163
+ theme.stateLayer.hoveredOpacity
164
+ );
165
+ result.pressedBackgroundColor = blendColor(
166
+ containerColor,
167
+ overlay,
168
+ theme.stateLayer.pressedOpacity
169
+ );
170
+ }
171
+ return result;
172
+ }
173
+ function createStyles(theme, checked, containerColor, contentColor) {
174
+ const colors = applyColorOverrides(
175
+ theme,
176
+ getColors(theme, checked),
177
+ containerColor,
178
+ contentColor
179
+ );
180
+ const size = 18;
181
+ const touchTarget = 48;
182
+ return import_react_native3.StyleSheet.create({
183
+ container: {
184
+ width: touchTarget,
185
+ height: touchTarget,
186
+ alignItems: "center",
187
+ justifyContent: "center",
188
+ cursor: "pointer"
189
+ },
190
+ hoveredContainer: {
191
+ borderRadius: touchTarget / 2,
192
+ backgroundColor: colors.hoveredBackgroundColor
193
+ },
194
+ pressedContainer: {
195
+ borderRadius: touchTarget / 2,
196
+ backgroundColor: colors.pressedBackgroundColor
197
+ },
198
+ disabledContainer: {
199
+ cursor: "auto"
200
+ },
201
+ box: {
202
+ width: size,
203
+ height: size,
204
+ borderRadius: theme.shape.cornerExtraSmall,
205
+ backgroundColor: colors.backgroundColor,
206
+ borderColor: colors.borderColor,
207
+ borderWidth: colors.borderWidth,
208
+ alignItems: "center",
209
+ justifyContent: "center"
210
+ },
211
+ disabledBox: {
212
+ backgroundColor: colors.disabledBackgroundColor,
213
+ borderColor: colors.disabledBorderColor,
214
+ borderWidth: colors.disabledBorderWidth
215
+ },
216
+ iconColor: {
217
+ color: colors.iconColor
218
+ },
219
+ disabledIconColor: {
220
+ color: colors.disabledIconColor
221
+ }
222
+ });
223
+ }
224
+
225
+ // src/checkbox/Checkbox.tsx
226
+ var import_jsx_runtime = require("react/jsx-runtime");
227
+ function resolveStyle(containerStyle, hoveredContainerStyle, pressedContainerStyle, disabledContainerStyle, disabled, style) {
228
+ if (typeof style === "function") {
229
+ return (state) => [
230
+ containerStyle,
231
+ state.hovered && !state.pressed && !disabled ? hoveredContainerStyle : void 0,
232
+ state.pressed && !disabled ? pressedContainerStyle : void 0,
233
+ disabled ? disabledContainerStyle : void 0,
234
+ style(state)
235
+ ];
236
+ }
237
+ return (state) => [
238
+ containerStyle,
239
+ state.hovered && !state.pressed && !disabled ? hoveredContainerStyle : void 0,
240
+ state.pressed && !disabled ? pressedContainerStyle : void 0,
241
+ disabled ? disabledContainerStyle : void 0,
242
+ style
243
+ ];
244
+ }
245
+ function Checkbox({
246
+ style,
247
+ value = false,
248
+ onValueChange,
249
+ containerColor,
250
+ contentColor,
251
+ disabled = false,
252
+ ...props
253
+ }) {
254
+ const isDisabled = Boolean(disabled);
255
+ const isChecked = Boolean(value);
256
+ const MaterialCommunityIcons = isChecked ? getMaterialCommunityIcons() : null;
257
+ const theme = (0, import_core.useTheme)();
258
+ const styles = (0, import_react.useMemo)(
259
+ () => createStyles(theme, isChecked, containerColor, contentColor),
260
+ [theme, isChecked, containerColor, contentColor]
261
+ );
262
+ const resolvedIconColor = (0, import_react.useMemo)(() => {
263
+ const base = import_react_native4.StyleSheet.flatten([
264
+ styles.iconColor,
265
+ isDisabled ? styles.disabledIconColor : void 0
266
+ ]);
267
+ return typeof (base == null ? void 0 : base.color) === "string" ? base.color : void 0;
268
+ }, [styles.iconColor, styles.disabledIconColor, isDisabled]);
269
+ const handlePress = () => {
270
+ if (!isDisabled) {
271
+ onValueChange == null ? void 0 : onValueChange(!isChecked);
272
+ }
273
+ };
274
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
275
+ import_react_native4.Pressable,
276
+ {
277
+ ...props,
278
+ accessibilityRole: "checkbox",
279
+ accessibilityState: {
280
+ disabled: isDisabled,
281
+ checked: isChecked
282
+ },
283
+ hitSlop: import_react_native4.Platform.OS === "web" ? void 0 : 4,
284
+ disabled: isDisabled,
285
+ onPress: handlePress,
286
+ style: resolveStyle(
287
+ styles.container,
288
+ styles.hoveredContainer,
289
+ styles.pressedContainer,
290
+ styles.disabledContainer,
291
+ isDisabled,
292
+ style
293
+ ),
294
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native4.View, { style: [styles.box, isDisabled ? styles.disabledBox : void 0], children: isChecked ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
295
+ MaterialCommunityIcons,
296
+ {
297
+ name: "check",
298
+ size: 14,
299
+ color: resolvedIconColor
300
+ }
301
+ ) : null })
302
+ }
303
+ );
304
+ }
305
+ // Annotate the CommonJS export names for ESM import in node:
306
+ 0 && (module.exports = {
307
+ Checkbox
308
+ });
@@ -0,0 +1,62 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import MaterialCommunityIcons from '@expo/vector-icons/MaterialCommunityIcons';
3
+ import { ComponentProps, ReactNode } from 'react';
4
+ import { PressableProps, StyleProp, TextStyle } from 'react-native';
5
+
6
+ /** Visual variant of the chip following Material Design 3 chip types. */
7
+ type ChipVariant = 'assist' | 'filter' | 'input' | 'suggestion';
8
+ interface ChipProps extends Omit<PressableProps, 'children'> {
9
+ /** Text label rendered inside the chip. */
10
+ children: string;
11
+ /**
12
+ * Chip type variant. Controls appearance, allowed interactions, and icon behavior.
13
+ * @default 'assist'
14
+ */
15
+ variant?: ChipVariant;
16
+ /**
17
+ * Whether the chip uses an elevated surface instead of an outline border.
18
+ * Available on `assist`, `filter`, and `suggestion` variants.
19
+ * Ignored on `input` variant (always outlined).
20
+ * @default false
21
+ */
22
+ elevated?: boolean;
23
+ /**
24
+ * Whether the chip is in a selected (toggled-on) state.
25
+ * Only meaningful for the `filter` variant. Ignored by other variants.
26
+ */
27
+ selected?: boolean;
28
+ /** Name of a MaterialCommunityIcons icon to show before the label. */
29
+ leadingIcon?: ComponentProps<typeof MaterialCommunityIcons>['name'];
30
+ /**
31
+ * Size of the leading icon in dp.
32
+ * @default 18
33
+ */
34
+ iconSize?: number;
35
+ /**
36
+ * Custom avatar content (e.g. a small Image or View) to render before the label.
37
+ * Only applicable to the `input` variant. Takes precedence over `leadingIcon`.
38
+ */
39
+ avatar?: ReactNode;
40
+ /**
41
+ * Callback fired when the close/remove icon is pressed.
42
+ * When provided, renders a trailing close icon.
43
+ * Only renders on `input` and `filter` (when selected) variants.
44
+ */
45
+ onClose?: () => void;
46
+ /**
47
+ * Override the container (background) color.
48
+ * State-layer colors (hover, press) are derived automatically.
49
+ */
50
+ containerColor?: string;
51
+ /**
52
+ * Override the content (label and icon) color.
53
+ * State-layer colors are derived automatically when no containerColor is set.
54
+ */
55
+ contentColor?: string;
56
+ /** Additional style applied to the label text. */
57
+ labelStyle?: StyleProp<TextStyle>;
58
+ }
59
+
60
+ declare function Chip({ children, style, variant, elevated, selected, leadingIcon, iconSize, avatar, onClose, containerColor, contentColor, labelStyle: labelStyleOverride, disabled, ...props }: ChipProps): react_jsx_runtime.JSX.Element;
61
+
62
+ export { Chip, type ChipProps, type ChipVariant };