ingeniuscliq-core 0.5.11 → 0.5.13

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,19 @@
1
+ import { InputExtendedProps } from '../../ui/input';
2
+ import { BaseStyleProps } from '../../../types/ui/main';
3
+ import { Control, FieldValues, Path } from 'react-hook-form';
4
+ interface FormPasswordProps<T extends FieldValues = FieldValues> extends BaseStyleProps {
5
+ readonly control: Control<T>;
6
+ readonly name: Path<T>;
7
+ readonly label?: string;
8
+ readonly customLabel?: React.ReactNode;
9
+ readonly placeholder?: string;
10
+ readonly inputProps?: React.ComponentProps<"input"> & InputExtendedProps;
11
+ readonly withinLabel?: boolean;
12
+ readonly withinMessage?: boolean;
13
+ readonly withinControl?: boolean;
14
+ readonly required?: boolean;
15
+ readonly withoutPlaceholder?: boolean;
16
+ }
17
+ export declare function FormPassword<T extends FieldValues = FieldValues>({ control, name, label, customLabel, placeholder, className, inputProps, withinLabel, withinMessage, withinControl, required, withoutPlaceholder }: FormPasswordProps<T>): import("react").JSX.Element;
18
+ export {};
19
+ //# sourceMappingURL=FormPassword.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormPassword.d.ts","sourceRoot":"","sources":["../../../../src/components/common/form/FormPassword.tsx"],"names":[],"mappings":"AACA,OAAO,EAAS,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAElE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAGlE,UAAU,iBAAiB,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,CAAE,SAAQ,cAAc;IACrF,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,UAAU,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,GAAG,kBAAkB,CAAC;IACzE,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,kBAAkB,CAAC,EAAE,OAAO,CAAC;CACvC;AAED,wBAAgB,YAAY,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,EAAE,EAChE,OAAO,EACP,IAAI,EACJ,KAAiB,EACjB,WAAuB,EACvB,WAAgB,EAChB,SAAc,EACd,UAAe,EACf,WAAmB,EACnB,aAAqB,EACrB,aAAqB,EACrB,QAAgB,EAChB,kBAA0B,EAC3B,EAAE,iBAAiB,CAAC,CAAC,CAAC,+BAkDtB"}
@@ -0,0 +1,74 @@
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import { CustomFormField } from './CustomFormField.js';
3
+ import { Input } from '../../ui/input.js';
4
+ import { useLanguage } from '../../../hooks/useLanguage.js';
5
+ import { useState, useCallback } from 'react';
6
+ import { EyeOff, Eye } from 'lucide-react';
7
+
8
+ function FormPassword({
9
+ control,
10
+ name,
11
+ label = void 0,
12
+ customLabel = void 0,
13
+ placeholder = "",
14
+ className = "",
15
+ inputProps = {},
16
+ withinLabel = false,
17
+ withinMessage = false,
18
+ withinControl = false,
19
+ required = false,
20
+ withoutPlaceholder = false
21
+ }) {
22
+ const { t } = useLanguage();
23
+ const [showPassword, setShowPassword] = useState(false);
24
+ const getPlaceholder = useCallback(() => {
25
+ if (withoutPlaceholder) return "";
26
+ if (placeholder) return required ? placeholder : `${placeholder} ${t("fields.optional")}`;
27
+ if (name) return required ? t(`fields.${name}`) : `${t("fields." + name)} ${t("fields.fieldLabel.optional")}`;
28
+ return "";
29
+ }, [withoutPlaceholder, placeholder, name, required]);
30
+ const getLabel = useCallback(() => {
31
+ if (withinLabel) return "";
32
+ if (label) return required ? `${label} *` : label;
33
+ if (name) return t(`fields.${name}`);
34
+ return "";
35
+ }, [label, withinLabel, required, name, t]);
36
+ return /* @__PURE__ */ jsx(
37
+ CustomFormField,
38
+ {
39
+ control,
40
+ className,
41
+ name,
42
+ label: getLabel(),
43
+ customLabel,
44
+ withinLabel,
45
+ withinMessage,
46
+ withinControl,
47
+ render: (field) => /* @__PURE__ */ jsxs("div", { className: "relative", children: [
48
+ /* @__PURE__ */ jsx(
49
+ Input,
50
+ {
51
+ placeholder: getPlaceholder(),
52
+ type: showPassword ? "text" : "password",
53
+ required,
54
+ ...field,
55
+ ...inputProps,
56
+ className: inputProps?.className
57
+ }
58
+ ),
59
+ /* @__PURE__ */ jsx(
60
+ "button",
61
+ {
62
+ type: "button",
63
+ onClick: () => setShowPassword(!showPassword),
64
+ className: "absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700 focus:outline-none",
65
+ tabIndex: -1,
66
+ children: showPassword ? /* @__PURE__ */ jsx(EyeOff, { size: 20 }) : /* @__PURE__ */ jsx(Eye, { size: 20 })
67
+ }
68
+ )
69
+ ] })
70
+ }
71
+ );
72
+ }
73
+
74
+ export { FormPassword };
@@ -1,4 +1,5 @@
1
1
  export * from './FormInput';
2
+ export * from './FormPassword';
2
3
  export * from './FormTextArea';
3
4
  export * from './FormSelect';
4
5
  export * from './FormCheckbox';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/common/form/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/common/form/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC"}
@@ -7,13 +7,13 @@ import '../ui/input.js';
7
7
  import 'react-i18next';
8
8
  import '../../i18n/config.js';
9
9
  import 'react';
10
+ import 'lucide-react';
10
11
  import '../ui/textarea.js';
11
12
  import '../ui/select.js';
12
13
  import '../ui/checkbox.js';
13
14
  import '@tanstack/react-router';
14
15
  import '../ui/pagination.js';
15
16
  /* empty css */
16
- import 'lucide-react';
17
17
  import { Toaster } from '../common/toast/Toaster.js';
18
18
  import { CoreBaseLayout } from '../layouts/CoreBaseLayout.js';
19
19
 
@@ -7,13 +7,13 @@ import '../ui/input.js';
7
7
  import 'react-i18next';
8
8
  import '../../i18n/config.js';
9
9
  import 'react';
10
+ import 'lucide-react';
10
11
  import '../ui/textarea.js';
11
12
  import '../ui/select.js';
12
13
  import '../ui/checkbox.js';
13
14
  import '@tanstack/react-router';
14
15
  import '../ui/pagination.js';
15
16
  /* empty css */
16
- import 'lucide-react';
17
17
  import { Toaster } from '../common/toast/Toaster.js';
18
18
  import { CoreBaseLayout } from '../layouts/CoreBaseLayout.js';
19
19
 
package/dist/index.js CHANGED
@@ -33,6 +33,7 @@ export { CorePreviewLayout } from './components/templates/CorePreviewLayout.js';
33
33
  export { CustomCarousel } from './components/common/carousel/CustomCarousel.js';
34
34
  export { CustomCarouselSection } from './components/common/carousel/CustomCarouselSection.js';
35
35
  export { FormInput } from './components/common/form/FormInput.js';
36
+ export { FormPassword } from './components/common/form/FormPassword.js';
36
37
  export { FormTextArea } from './components/common/form/FormTextArea.js';
37
38
  export { FormSelect } from './components/common/form/FormSelect.js';
38
39
  export { FormCheckbox } from './components/common/form/FormCheckbox.js';
@@ -15,13 +15,23 @@ export interface CoreDesignTemplateColorProperties {
15
15
  export interface CoreDesignTemplateSettings {
16
16
  store_name: string;
17
17
  store_logo: string;
18
+ store_black_white_logo: string;
19
+ store_footer_logo: string;
20
+ store_footer_black_white_logo: string;
18
21
  store_favicon: string;
22
+ store_email: string;
23
+ store_phone: string;
24
+ store_about_us: string;
19
25
  store_map_iframe: string;
26
+ server_time: string;
27
+ policies: {
28
+ return_policy: string;
29
+ shipping_policy: string;
30
+ warranty_policy: string;
31
+ };
20
32
  available_coins: CoreDesignTemplateCoin[];
33
+ current_coin: CoreDesignTemplateCoin;
21
34
  base_coin: CoreDesignTemplateCoin;
22
- store_about_us: string;
23
- store_email: string;
24
- store_phone: string;
25
35
  }
26
36
  export interface CoreDesignTemplateCoin {
27
37
  short_name: string;
@@ -1 +1 @@
1
- {"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../../src/types/ui/template.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,wBAAwB,EAAE,CAAC;CACtC;AACD,MAAM,WAAW,wBAAwB;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,iCAAiC,EAAE,CAAC;CACxD;AACD,MAAM,WAAW,iCAAiC;IAC9C,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACjB;AACD,MAAM,WAAW,0BAA0B;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAA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AE,MAAM,CAAC;KAC3B,CAAC;IACF,eAAe,EAAE,sBAAsB,EAAE,CAAC;IAC1C,YAAY,EAAE,sBAAsB,CAAC;IACrC,SAAS,EAAE,sBAAsB,CAAC;CACrC;AACD,MAAM,WAAW,sBAAsB;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;CACzB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ingeniuscliq-core",
3
- "version": "0.5.11",
3
+ "version": "0.5.13",
4
4
  "description": "IngeniusCliq Core UI y lógica compartida",
5
5
  "license": "MIT",
6
6
  "type": "module",