@kaushverse/pickify 1.0.8 → 1.0.9

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/index.d.mts CHANGED
@@ -95,7 +95,7 @@ type MultiPickerGroupStyles = {
95
95
  type MultiPickerGroupProps = {
96
96
  label: string;
97
97
  children: React.ReactNode;
98
- renderIcon?: IconRenderer;
98
+ renderGroupIcon?: IconRenderer;
99
99
  styles?: MultiPickerGroupStyles;
100
100
  };
101
101
  type MultiPickerProps = {
@@ -107,28 +107,23 @@ type MultiPickerProps = {
107
107
  onChange: (val: string[]) => void;
108
108
  label?: string;
109
109
  placeholder?: string;
110
- error?: string;
111
- renderIcon?: IconRenderer;
110
+ error?: TextStyle;
111
+ renderInputIcon?: IconRenderer;
112
112
  styles?: {
113
113
  container?: ViewStyle;
114
114
  selectBox?: ViewStyle;
115
115
  selectText?: TextStyle;
116
116
  };
117
+ errorStyle?: TextStyle;
117
118
  };
118
119
 
119
- declare function MultiPickerModal({ visible, setVisible, selectedValues, options, groups, onChange, label, placeholder, error, renderIcon, }: MultiPickerProps): react_jsx_runtime.JSX.Element;
120
+ declare function MultiPickerModal({ visible, setVisible, selectedValues, options, groups, onChange, label, placeholder, error, renderInputIcon, errorStyle, }: MultiPickerProps & {
121
+ error: string;
122
+ }): react_jsx_runtime.JSX.Element;
120
123
 
121
124
  declare function MultiPickerItem({ label, selected, onPress, renderIcon, styles: customStyles, }: MultiPickerItemProps): react_jsx_runtime.JSX.Element;
122
125
 
123
- declare function MultiPickerGroup({ label, children, renderIcon, }: {
124
- label: string;
125
- children: React$1.ReactNode;
126
- renderIcon?: (props: {
127
- name: string;
128
- size: number;
129
- color: string;
130
- }) => React$1.ReactNode;
131
- }): react_jsx_runtime.JSX.Element;
126
+ declare function MultiPickerGroup({ label, children, renderGroupIcon, }: MultiPickerGroupProps): react_jsx_runtime.JSX.Element;
132
127
 
133
128
  declare const toggleValue: (arr: string[], value: string) => string[];
134
129
 
package/dist/index.d.ts CHANGED
@@ -95,7 +95,7 @@ type MultiPickerGroupStyles = {
95
95
  type MultiPickerGroupProps = {
96
96
  label: string;
97
97
  children: React.ReactNode;
98
- renderIcon?: IconRenderer;
98
+ renderGroupIcon?: IconRenderer;
99
99
  styles?: MultiPickerGroupStyles;
100
100
  };
101
101
  type MultiPickerProps = {
@@ -107,28 +107,23 @@ type MultiPickerProps = {
107
107
  onChange: (val: string[]) => void;
108
108
  label?: string;
109
109
  placeholder?: string;
110
- error?: string;
111
- renderIcon?: IconRenderer;
110
+ error?: TextStyle;
111
+ renderInputIcon?: IconRenderer;
112
112
  styles?: {
113
113
  container?: ViewStyle;
114
114
  selectBox?: ViewStyle;
115
115
  selectText?: TextStyle;
116
116
  };
117
+ errorStyle?: TextStyle;
117
118
  };
118
119
 
119
- declare function MultiPickerModal({ visible, setVisible, selectedValues, options, groups, onChange, label, placeholder, error, renderIcon, }: MultiPickerProps): react_jsx_runtime.JSX.Element;
120
+ declare function MultiPickerModal({ visible, setVisible, selectedValues, options, groups, onChange, label, placeholder, error, renderInputIcon, errorStyle, }: MultiPickerProps & {
121
+ error: string;
122
+ }): react_jsx_runtime.JSX.Element;
120
123
 
121
124
  declare function MultiPickerItem({ label, selected, onPress, renderIcon, styles: customStyles, }: MultiPickerItemProps): react_jsx_runtime.JSX.Element;
122
125
 
123
- declare function MultiPickerGroup({ label, children, renderIcon, }: {
124
- label: string;
125
- children: React$1.ReactNode;
126
- renderIcon?: (props: {
127
- name: string;
128
- size: number;
129
- color: string;
130
- }) => React$1.ReactNode;
131
- }): react_jsx_runtime.JSX.Element;
126
+ declare function MultiPickerGroup({ label, children, renderGroupIcon, }: MultiPickerGroupProps): react_jsx_runtime.JSX.Element;
132
127
 
133
128
  declare const toggleValue: (arr: string[], value: string) => string[];
134
129
 
package/dist/index.js CHANGED
@@ -277,13 +277,13 @@ var import_jsx_runtime2 = require("react/jsx-runtime");
277
277
  function MultiPickerGroup({
278
278
  label,
279
279
  children,
280
- renderIcon
280
+ renderGroupIcon
281
281
  }) {
282
282
  const [open, setOpen] = (0, import_react2.useState)(true);
283
283
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_react_native2.View, { style: styles.group, children: [
284
284
  /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_react_native2.TouchableOpacity, { style: styles.header, onPress: () => setOpen(!open), children: [
285
285
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_native2.Text, { style: styles.title, children: label }),
286
- renderIcon ? renderIcon({
286
+ renderGroupIcon ? renderGroupIcon({
287
287
  name: open ? "chevron-up" : "chevron-down",
288
288
  size: 18,
289
289
  color: "#6B7280"
@@ -391,7 +391,8 @@ function MultiPickerModal({
391
391
  label,
392
392
  placeholder = "Select",
393
393
  error,
394
- renderIcon
394
+ renderInputIcon,
395
+ errorStyle
395
396
  }) {
396
397
  const [internalVisible, setInternalVisible] = (0, import_react3.useState)(false);
397
398
  const isControlled = visible !== void 0 && setVisible !== void 0;
@@ -439,13 +440,13 @@ function MultiPickerModal({
439
440
  label && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native4.Text, { style: styles2.label, children: label }),
440
441
  /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native4.TouchableOpacity, { style: styles2.box, onPress: open, children: [
441
442
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native4.Text, { style: styles2.text, children: getLabel() }),
442
- renderIcon ? renderIcon({
443
+ renderInputIcon ? renderInputIcon({
443
444
  name: "chevron-down",
444
445
  size: 18,
445
446
  color: "#6B7280"
446
- }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native4.Text, { children: "\u2304" })
447
+ }) : null
447
448
  ] }),
448
- error && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native4.Text, { style: styles2.error, children: error }),
449
+ error && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native4.Text, { style: [styles2.error, styles2?.error, errorStyle], children: error }),
449
450
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native4.Modal, { visible: isVisible, transparent: true, animationType: "slide", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native4.View, { style: styles2.overlay, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native4.View, { style: styles2.container, children: [
450
451
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native4.TouchableOpacity, { onPress: close, style: styles2.done, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native4.Text, { style: { color: "#fff" }, children: "Done" }) }),
451
452
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native4.ScrollView, { children: renderList() })
@@ -470,6 +471,7 @@ var styles2 = import_react_native4.StyleSheet.create({
470
471
  },
471
472
  error: {
472
473
  color: "red",
474
+ fontSize: 12,
473
475
  marginTop: 4
474
476
  },
475
477
  overlay: {
package/dist/index.mjs CHANGED
@@ -260,13 +260,13 @@ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
260
260
  function MultiPickerGroup({
261
261
  label,
262
262
  children,
263
- renderIcon
263
+ renderGroupIcon
264
264
  }) {
265
265
  const [open, setOpen] = useState2(true);
266
266
  return /* @__PURE__ */ jsxs2(View2, { style: styles.group, children: [
267
267
  /* @__PURE__ */ jsxs2(TouchableOpacity2, { style: styles.header, onPress: () => setOpen(!open), children: [
268
268
  /* @__PURE__ */ jsx2(Text2, { style: styles.title, children: label }),
269
- renderIcon ? renderIcon({
269
+ renderGroupIcon ? renderGroupIcon({
270
270
  name: open ? "chevron-up" : "chevron-down",
271
271
  size: 18,
272
272
  color: "#6B7280"
@@ -374,7 +374,8 @@ function MultiPickerModal({
374
374
  label,
375
375
  placeholder = "Select",
376
376
  error,
377
- renderIcon
377
+ renderInputIcon,
378
+ errorStyle
378
379
  }) {
379
380
  const [internalVisible, setInternalVisible] = useState3(false);
380
381
  const isControlled = visible !== void 0 && setVisible !== void 0;
@@ -422,13 +423,13 @@ function MultiPickerModal({
422
423
  label && /* @__PURE__ */ jsx4(Text4, { style: styles2.label, children: label }),
423
424
  /* @__PURE__ */ jsxs4(TouchableOpacity4, { style: styles2.box, onPress: open, children: [
424
425
  /* @__PURE__ */ jsx4(Text4, { style: styles2.text, children: getLabel() }),
425
- renderIcon ? renderIcon({
426
+ renderInputIcon ? renderInputIcon({
426
427
  name: "chevron-down",
427
428
  size: 18,
428
429
  color: "#6B7280"
429
- }) : /* @__PURE__ */ jsx4(Text4, { children: "\u2304" })
430
+ }) : null
430
431
  ] }),
431
- error && /* @__PURE__ */ jsx4(Text4, { style: styles2.error, children: error }),
432
+ error && /* @__PURE__ */ jsx4(Text4, { style: [styles2.error, styles2?.error, errorStyle], children: error }),
432
433
  /* @__PURE__ */ jsx4(Modal2, { visible: isVisible, transparent: true, animationType: "slide", children: /* @__PURE__ */ jsx4(View4, { style: styles2.overlay, children: /* @__PURE__ */ jsxs4(View4, { style: styles2.container, children: [
433
434
  /* @__PURE__ */ jsx4(TouchableOpacity4, { onPress: close, style: styles2.done, children: /* @__PURE__ */ jsx4(Text4, { style: { color: "#fff" }, children: "Done" }) }),
434
435
  /* @__PURE__ */ jsx4(ScrollView2, { children: renderList() })
@@ -453,6 +454,7 @@ var styles2 = StyleSheet4.create({
453
454
  },
454
455
  error: {
455
456
  color: "red",
457
+ fontSize: 12,
456
458
  marginTop: 4
457
459
  },
458
460
  overlay: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaushverse/pickify",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "A fully customizable React Native picker with search, multi-select, grouping, and async support.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",