@producteca/producteca-ui-kit 1.14.0 → 1.15.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.
- package/dist/components/breadcrumb/breadcrumb.d.ts +15 -0
- package/dist/components/breadcrumb/index.d.ts +2 -0
- package/dist/components/image/image.d.ts +11 -0
- package/dist/components/image/index.d.ts +1 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/inputs/datePicker/datePickerTypes.d.ts +1 -2
- package/dist/components/inputs/dateRangePicker/dateRangePicker.d.ts +5 -0
- package/dist/components/inputs/dateRangePicker/dateRangePickerTypes.d.ts +14 -0
- package/dist/components/inputs/dateRangePicker/dateRangePickerUtils.d.ts +9 -0
- package/dist/components/inputs/dateRangePicker/index.d.ts +3 -0
- package/dist/components/inputs/formField/textInput.d.ts +1 -1
- package/dist/components/inputs/index.d.ts +2 -1
- package/dist/components/menuAction/index.d.ts +1 -0
- package/dist/components/menuAction/menuAction.d.ts +18 -0
- package/dist/components/menuAction/menuActionCustomStyles.d.ts +4 -0
- package/dist/components/patterns/headerSection/headerSection.d.ts +14 -0
- package/dist/components/patterns/headerSection/index.d.ts +1 -0
- package/dist/components/patterns/iconWithIdentifier/iconWithIdentifier.d.ts +11 -0
- package/dist/components/patterns/iconWithIdentifier/index.d.ts +1 -0
- package/dist/components/patterns/index.d.ts +3 -1
- package/dist/components/patterns/linkWithIcon/index.d.ts +1 -0
- package/dist/components/patterns/linkWithIcon/linkWithIcon.d.ts +14 -0
- package/dist/locales/description.d.ts +1 -0
- package/dist/locales/es.d.ts +45 -0
- package/dist/producteca-ui-kit.es.js +25856 -19786
- package/dist/producteca-ui-kit.umd.js +193 -123
- package/dist/style.css +1 -1
- package/package.json +4 -2
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
interface BreadcrumbItem {
|
|
4
|
+
text: string;
|
|
5
|
+
href?: string;
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
isActive?: boolean;
|
|
8
|
+
}
|
|
9
|
+
interface BreadcrumbProps {
|
|
10
|
+
items: BreadcrumbItem[];
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const Breadcrumb: React.FC<BreadcrumbProps>;
|
|
14
|
+
export type { BreadcrumbProps, BreadcrumbItem };
|
|
15
|
+
export default Breadcrumb;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
interface ImageProps {
|
|
4
|
+
src: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
sx?: React.CSSProperties;
|
|
7
|
+
alt?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const Image: React.FC<ImageProps>;
|
|
10
|
+
export type { ImageProps };
|
|
11
|
+
export default Image;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Image, type ImageProps } from './image';
|
|
@@ -6,10 +6,9 @@ export interface DatePickerSpecificProps {
|
|
|
6
6
|
minDate?: InputValue;
|
|
7
7
|
maxDate?: InputValue;
|
|
8
8
|
format?: string;
|
|
9
|
-
size?: "md" | "lg";
|
|
10
9
|
}
|
|
11
10
|
type UnusedFormFieldProps = 'max' | 'min' | 'isClearable' | 'leftIcon' | 'rightIcon' | 'type' | 'inputRef' | 'children';
|
|
12
|
-
type OverriddenFormFieldProps = 'value'
|
|
11
|
+
type OverriddenFormFieldProps = 'value';
|
|
13
12
|
export interface DatePickerProps extends Omit<FormFieldProps, UnusedFormFieldProps | OverriddenFormFieldProps>, DatePickerSpecificProps {
|
|
14
13
|
}
|
|
15
14
|
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { DateRangePickerProps } from './dateRangePickerTypes';
|
|
3
|
+
|
|
4
|
+
export declare const DateRangePickerInput: React.FC<DateRangePickerProps>;
|
|
5
|
+
export declare const DateRangePicker: ({ label, rightAdornment, value, ...props }: DateRangePickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { InputValue } from '../../../validators';
|
|
2
|
+
import { DatePickerProps } from '../datePicker';
|
|
3
|
+
|
|
4
|
+
export interface DateRangeValue {
|
|
5
|
+
from: InputValue;
|
|
6
|
+
to: InputValue;
|
|
7
|
+
}
|
|
8
|
+
export interface DateRangePickerSpecificProps {
|
|
9
|
+
value?: DateRangeValue;
|
|
10
|
+
}
|
|
11
|
+
type OverriddenDatePickerProps = 'value';
|
|
12
|
+
export interface DateRangePickerProps extends Omit<DatePickerProps, OverriddenDatePickerProps>, DateRangePickerSpecificProps {
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DateRange, Matcher } from 'react-day-picker';
|
|
2
|
+
import { InputValue } from '../../../validators';
|
|
3
|
+
|
|
4
|
+
export declare const fromInputValue: (inputValue: InputValue) => DateRange | undefined;
|
|
5
|
+
export declare const getDisplayRange: (range: DateRange | undefined, format?: string) => string;
|
|
6
|
+
export declare const convertToDate: (val: InputValue | undefined) => Date | undefined;
|
|
7
|
+
export declare const CustomWeekday: (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export type DisabledDays = Matcher | Matcher[] | undefined;
|
|
9
|
+
export declare const getDisabledDays: (disabled: boolean, minDate?: InputValue, maxDate?: InputValue) => DisabledDays;
|
|
@@ -17,7 +17,7 @@ export interface TextInputProps {
|
|
|
17
17
|
leftIcon?: React.ReactNode;
|
|
18
18
|
rightIcon?: React.ReactNode;
|
|
19
19
|
isValid?: (value: InputValue) => boolean;
|
|
20
|
-
type?: 'text' | 'number' | 'password' | 'date' | undefined;
|
|
20
|
+
type?: 'text' | 'number' | 'password' | 'date' | 'dateRange' | undefined;
|
|
21
21
|
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
22
22
|
input?: ReduxFormInput;
|
|
23
23
|
inputRef?: React.RefObject<HTMLInputElement>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MenuAction, type MenuActionProps, type MenuActionItem } from './menuAction';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
interface MenuActionItem {
|
|
4
|
+
label: React.ReactNode;
|
|
5
|
+
onClick?: () => void;
|
|
6
|
+
selected?: boolean;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
interface MenuActionProps {
|
|
10
|
+
items: MenuActionItem[];
|
|
11
|
+
id?: string;
|
|
12
|
+
maxItemsVisible?: number;
|
|
13
|
+
icon?: React.ReactNode;
|
|
14
|
+
otherProps?: React.HTMLAttributes<HTMLButtonElement>;
|
|
15
|
+
}
|
|
16
|
+
export declare const MenuAction: React.FC<MenuActionProps>;
|
|
17
|
+
export type { MenuActionProps, MenuActionItem };
|
|
18
|
+
export default MenuAction;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
interface HeaderSectionProps {
|
|
4
|
+
breadcrumb?: React.ReactNode;
|
|
5
|
+
image?: React.ReactNode;
|
|
6
|
+
dense?: boolean;
|
|
7
|
+
title?: string;
|
|
8
|
+
subtitle?: React.ReactNode;
|
|
9
|
+
link?: React.ReactNode;
|
|
10
|
+
menuAction?: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export declare const HeaderSection: React.FC<HeaderSectionProps>;
|
|
13
|
+
export type { HeaderSectionProps };
|
|
14
|
+
export default HeaderSection;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { HeaderSection, type HeaderSectionProps } from './headerSection';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
interface IconWithIdentifierProps {
|
|
4
|
+
text: string;
|
|
5
|
+
showDivider?: boolean;
|
|
6
|
+
icon?: React.ReactNode;
|
|
7
|
+
color?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const IconWithIdentifier: React.FC<IconWithIdentifierProps>;
|
|
10
|
+
export type { IconWithIdentifierProps };
|
|
11
|
+
export default IconWithIdentifier;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { IconWithIdentifier, type IconWithIdentifierProps } from './iconWithIdentifier';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { LinkWithIcon, type LinkComponentProps } from './linkWithIcon';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ButtonProps } from '../../button/button';
|
|
3
|
+
|
|
4
|
+
interface LinkWithIconProps {
|
|
5
|
+
text: string;
|
|
6
|
+
icon?: React.ReactElement;
|
|
7
|
+
onClick: () => void;
|
|
8
|
+
className?: string;
|
|
9
|
+
size?: ButtonProps['size'];
|
|
10
|
+
otherProps?: Record<string, any>;
|
|
11
|
+
}
|
|
12
|
+
export declare const LinkWithIcon: React.FC<LinkWithIconProps>;
|
|
13
|
+
export type { LinkWithIconProps as LinkComponentProps };
|
|
14
|
+
export default LinkWithIcon;
|
|
@@ -12,3 +12,4 @@ export declare const checkboxInputExample = " \n Versi\u00F3n con una sola op
|
|
|
12
12
|
export declare const searcherExample = " \n Note la diferencia entre onChange y onInputChange (oficia de onSearch):\n \n ```typescript\n <Searcher\n label=\"Search label\"\n name=\"Searcher\"\n onChange={(event) => onSelectOption(event.target.value)}\n onInputChange={(event) => handleSearch(event.target.value)}\n options={[{ label: 'text', value: 1 }]}\n />\n ```\n";
|
|
13
13
|
export declare const saveBarExample = "\n #### Uso b\u00E1sico\n ```typescript\n <SaveBar\n saveProps={{\n onSave: () => handleSave(),\n label: 'Save'\n }}\n cancelProps={{\n onCancel: () => handleCancel(),\n label: 'Cancel'\n }}\n />\n ```\n #### Con bot\u00F3n de navegaci\u00F3n\n ```typescript\n <SaveBar\n saveProps={{\n onSave: () => handleSave(),\n label: 'Save',\n variant: 'primary'\n }}\n cancelProps={{\n onCancel: () => handleCancel(),\n label: 'Cancel'\n }}\n previousProps={{\n onPrevious: () => handlePrevious(),\n label: 'Previous'\n }}\n />\n ```\n #### Ejemplo completo\n ```typescript\n <SaveBar\n saveProps={{\n onSave: () => handleSave(),\n label: 'Guardar cambios',\n variant: 'success',\n disabled: false,\n onClick: () => {},\n }}\n cancelProps={{\n onCancel: () => handleCancel(),\n label: 'Descartar',\n }}\n previousProps={{\n onPrevious: () => handlePrevious(),\n label: 'Anterior',\n variant: 'primary',\n outline: true,\n disabled: false,\n onClick: () => console.log('Previous clicked'),\n }}\n />\n ```\n";
|
|
14
14
|
export declare const checkboxInputReduxFormExample = "\n #### Ejemplo de uso con Redux Form - CheckboxInput\n \n ```typescript\n <Field\n name=\"salesSync\"\n component={CheckboxInput}\n classComponent={'decrease-stock'}\n props={{\n name: 'cancelSales',\n value: this.salesSync().cancelSales,\n checked: this.salesSync().cancelSales,\n label: this.context.localize('settings.cancelSales')\n }}\n />\n ```\n";
|
|
15
|
+
export declare const breadcrumbItemFormat = "\n ## Formato de BreadcrumbItem\n\n El componente Breadcrumb acepta un array de objetos `BreadcrumbItem` con las siguientes propiedades:\n\n ### Propiedades disponibles:\n\n - **`text`** (string, requerido): El texto que se muestra para el item del breadcrumb\n - **`onClick`** (function, opcional): Funci\u00F3n que se ejecuta al hacer click en el item\n - **`isActive`** (boolean, opcional): Indica si el item est\u00E1 activo. Por defecto, el \u00FAltimo item se considera activo\n - **`href`** (string, opcional): URL del enlace (actualmente no implementado en el renderizado)\n\n ### Comportamiento:\n\n - Los items con `onClick` se renderizan como botones clickeables\n - Los items sin `onClick` se renderizan como texto est\u00E1tico\n - El \u00FAltimo item siempre se considera activo (a menos que se especifique `isActive: true` en otro item)\n - Cada item se separa autom\u00E1ticamente con el s\u00EDmbolo \">\"\n\n ### Ejemplo de uso:\n\n ```tsx\n const breadcrumbItems = [\n { text: 'Dashboard' },\n { text: 'Productos', onClick: () => navigate('/products') },\n { text: 'Detalles', isActive: true }\n ]\n\n <Breadcrumb items={breadcrumbItems} />\n ```\n";
|
package/dist/locales/es.d.ts
CHANGED
|
@@ -90,6 +90,9 @@ declare const _default: {
|
|
|
90
90
|
noResults: string;
|
|
91
91
|
writeToSearch: string;
|
|
92
92
|
};
|
|
93
|
+
breadcrumb: {
|
|
94
|
+
itemFormat: string;
|
|
95
|
+
};
|
|
93
96
|
alert: {
|
|
94
97
|
message: string;
|
|
95
98
|
infoMessage: string;
|
|
@@ -97,6 +100,11 @@ declare const _default: {
|
|
|
97
100
|
customAlert: string;
|
|
98
101
|
};
|
|
99
102
|
};
|
|
103
|
+
headerSection: {
|
|
104
|
+
edit: string;
|
|
105
|
+
duplicate: string;
|
|
106
|
+
delete: string;
|
|
107
|
+
};
|
|
100
108
|
error: {
|
|
101
109
|
required: string;
|
|
102
110
|
notValid: string;
|
|
@@ -112,6 +120,23 @@ declare const _default: {
|
|
|
112
120
|
running: string;
|
|
113
121
|
alert: string;
|
|
114
122
|
};
|
|
123
|
+
linkWithIcon: {
|
|
124
|
+
historyChange: string;
|
|
125
|
+
edit: string;
|
|
126
|
+
customAction: string;
|
|
127
|
+
};
|
|
128
|
+
breadcrumb: {
|
|
129
|
+
historyChanges: string;
|
|
130
|
+
products: string;
|
|
131
|
+
dashboard: string;
|
|
132
|
+
categories: string;
|
|
133
|
+
electronics: string;
|
|
134
|
+
details: string;
|
|
135
|
+
page1: string;
|
|
136
|
+
page2: string;
|
|
137
|
+
page3: string;
|
|
138
|
+
home: string;
|
|
139
|
+
};
|
|
115
140
|
datePicker: {
|
|
116
141
|
name: string;
|
|
117
142
|
value: string;
|
|
@@ -146,5 +171,25 @@ declare const _default: {
|
|
|
146
171
|
selectTime: string;
|
|
147
172
|
selectDateTime: string;
|
|
148
173
|
};
|
|
174
|
+
dateRangePicker: {
|
|
175
|
+
size: string;
|
|
176
|
+
disabled: string;
|
|
177
|
+
required: string;
|
|
178
|
+
noErrors: string;
|
|
179
|
+
placeholder: string;
|
|
180
|
+
label: string;
|
|
181
|
+
format: string;
|
|
182
|
+
minDate: string;
|
|
183
|
+
maxDate: string;
|
|
184
|
+
onChange: string;
|
|
185
|
+
selectDateRange: string;
|
|
186
|
+
dateRangeLabel: string;
|
|
187
|
+
disabledRange: string;
|
|
188
|
+
disabledComponent: string;
|
|
189
|
+
rangeWithMinMax: string;
|
|
190
|
+
restrictedRange: string;
|
|
191
|
+
disabledWithRestrictions: string;
|
|
192
|
+
completelyDisabled: string;
|
|
193
|
+
};
|
|
149
194
|
};
|
|
150
195
|
export default _default;
|