@pagamio/frontend-commons-lib 0.8.261 → 0.8.262

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,4 @@
1
+ import React from 'react';
2
+ import type { InputProps } from '../../../types';
3
+ declare const ColorInput: React.ForwardRefExoticComponent<Omit<InputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
4
+ export default ColorInput;
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { ColorInput as MantineColorInput } from '@mantine/core';
3
+ import React from 'react';
4
+ const ColorInput = React.forwardRef(({ field, error, value, onChange, ...props }, ref) => {
5
+ return (_jsxs(_Fragment, { children: [_jsx("label", { htmlFor: field.name, className: "block text-sm font-medium text-foreground", children: field.label }), _jsx(MantineColorInput, { ref: ref, id: field.name, value: value || '', onChange: (color) => onChange(color), disabled: field.disabled, placeholder: field.placeholder || 'Pick a color', format: "hex", swatches: [
6
+ '#25262b',
7
+ '#868e96',
8
+ '#fa5252',
9
+ '#e64980',
10
+ '#be4bdb',
11
+ '#7950f2',
12
+ '#4c6ef5',
13
+ '#228be6',
14
+ '#15aabf',
15
+ '#12b886',
16
+ '#40c057',
17
+ '#82c91e',
18
+ '#fab005',
19
+ '#fd7e14',
20
+ ], error: error?.message, className: "mt-1" })] }));
21
+ });
22
+ export default ColorInput;
@@ -0,0 +1 @@
1
+ export { default as ColorInput } from './ColorInput';
@@ -0,0 +1 @@
1
+ export { default as ColorInput } from './ColorInput';
@@ -31,9 +31,10 @@ export const setupInputRegistry = async () => {
31
31
  return getRegistryPromise();
32
32
  };
33
33
  const doSetup = async () => {
34
- const [{ default: CardExpiryInput }, { default: CheckboxInput }, { default: CreditCardInput }, { default: DateInput }, { default: EmailInput }, { default: LabelInput }, { default: MultiSelectInputComponent }, { default: NumberInput }, { default: PasswordInput }, { default: RadioInput }, { default: SelectInput }, { default: TextareaInputFW }, { default: TimeInput }, { default: ToggleSwitchInput }, { default: UploadFieldForm }, { default: PhoneInput },] = await Promise.all([
34
+ const [{ default: CardExpiryInput }, { default: CheckboxInput }, { default: ColorInput }, { default: CreditCardInput }, { default: DateInput }, { default: EmailInput }, { default: LabelInput }, { default: MultiSelectInputComponent }, { default: NumberInput }, { default: PasswordInput }, { default: RadioInput }, { default: SelectInput }, { default: TextareaInputFW }, { default: TimeInput }, { default: ToggleSwitchInput }, { default: UploadFieldForm }, { default: PhoneInput },] = await Promise.all([
35
35
  import('../components/inputs/card-expiry-input/CardExpiryInput'),
36
36
  import('../components/inputs/checkbox-input/CheckboxInput'),
37
+ import('../components/inputs/color-input/ColorInput'),
37
38
  import('../components/inputs/credit-card-input/CreditCardInput'),
38
39
  import('../components/inputs/date-input/DateInput'),
39
40
  import('../components/inputs/email-input/EmailInput'),
@@ -51,6 +52,7 @@ const doSetup = async () => {
51
52
  ]);
52
53
  registerInput('card-expiry-input', CardExpiryInput);
53
54
  registerInput('checkbox', CheckboxInput);
55
+ registerInput('color', ColorInput);
54
56
  registerInput('credit-card', CreditCardInput);
55
57
  registerInput('date', DateInput);
56
58
  registerInput('email', EmailInput);
@@ -130,7 +130,7 @@ export interface DependencyValidation {
130
130
  /**
131
131
  * Available field types supported by the form engine
132
132
  */
133
- export type FieldType = 'card-expiry-input' | 'checkbox' | 'credit-card' | 'date' | 'email' | 'file' | 'multi-select' | 'number' | 'password' | 'radio' | 'searchable-multi-select' | 'select' | 'switch' | 'tel' | 'text' | 'textarea' | 'time';
133
+ export type FieldType = 'card-expiry-input' | 'checkbox' | 'color' | 'credit-card' | 'date' | 'email' | 'file' | 'multi-select' | 'number' | 'password' | 'radio' | 'searchable-multi-select' | 'select' | 'switch' | 'tel' | 'text' | 'textarea' | 'time';
134
134
  /**
135
135
  * Defines the structure of a form field
136
136
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pagamio/frontend-commons-lib",
3
3
  "description": "Pagamio library for Frontend reusable components like the form engine and table container",
4
- "version": "0.8.261",
4
+ "version": "0.8.262",
5
5
  "publishConfig": {
6
6
  "access": "public",
7
7
  "provenance": false