@imj_media/ui 1.2.37 → 1.2.39
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/CHANGELOG.md +73 -0
- package/dist/index.css +1 -1
- package/dist/index.esm.js +13037 -12294
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +9 -9
- package/dist/index.js.map +1 -1
- package/dist/modules/Button/components/organisms/Button.d.ts +1 -1
- package/dist/modules/Checkbox/index.d.ts +30 -0
- package/dist/modules/Checkbox/index.d.ts.map +1 -0
- package/dist/modules/Checkbox/stories/Checkbox.stories.d.ts +33 -0
- package/dist/modules/Checkbox/stories/Checkbox.stories.d.ts.map +1 -0
- package/dist/modules/EmojiPicker/components/organisms/EmojiPicker.d.ts +1 -1
- package/dist/modules/EmojiPicker/stories/emojipicker.stories.d.ts +1 -1
- package/dist/modules/InnerButton/InnerButton.d.ts +6 -0
- package/dist/modules/InnerButton/InnerButton.d.ts.map +1 -0
- package/dist/modules/InnerButton/components/ButtonBadge.d.ts +50 -0
- package/dist/modules/InnerButton/components/ButtonBadge.d.ts.map +1 -0
- package/dist/modules/InnerButton/components/ButtonContent.d.ts +38 -0
- package/dist/modules/InnerButton/components/ButtonContent.d.ts.map +1 -0
- package/dist/modules/InnerButton/components/ButtonIcon.d.ts +42 -0
- package/dist/modules/InnerButton/components/ButtonIcon.d.ts.map +1 -0
- package/dist/modules/InnerButton/components/ButtonSlots.d.ts +64 -0
- package/dist/modules/InnerButton/components/ButtonSlots.d.ts.map +1 -0
- package/dist/modules/InnerButton/components/index.d.ts +15 -0
- package/dist/modules/InnerButton/components/index.d.ts.map +1 -0
- package/dist/modules/InnerButton/hooks/index.d.ts +7 -0
- package/dist/modules/InnerButton/hooks/index.d.ts.map +1 -0
- package/dist/modules/InnerButton/hooks/useBadgeLoading.d.ts +14 -0
- package/dist/modules/InnerButton/hooks/useBadgeLoading.d.ts.map +1 -0
- package/dist/modules/InnerButton/hooks/useButtonClasses.d.ts +37 -0
- package/dist/modules/InnerButton/hooks/useButtonClasses.d.ts.map +1 -0
- package/dist/modules/InnerButton/hooks/useHoverText.d.ts +28 -0
- package/dist/modules/InnerButton/hooks/useHoverText.d.ts.map +1 -0
- package/dist/modules/InnerButton/index.d.ts +7 -2
- package/dist/modules/InnerButton/index.d.ts.map +1 -1
- package/dist/modules/InnerButton/stories/InnerButton.stories.d.ts +20 -0
- package/dist/modules/InnerButton/stories/InnerButton.stories.d.ts.map +1 -1
- package/dist/modules/InnerButton/styles/buttonVariants.d.ts +42 -0
- package/dist/modules/InnerButton/styles/buttonVariants.d.ts.map +1 -0
- package/dist/modules/InnerButton/styles/index.d.ts +6 -0
- package/dist/modules/InnerButton/styles/index.d.ts.map +1 -0
- package/dist/modules/InnerButton/styles/variantColors.d.ts +42 -0
- package/dist/modules/InnerButton/styles/variantColors.d.ts.map +1 -0
- package/dist/modules/InnerButton/utils/badgeUtils.d.ts +40 -0
- package/dist/modules/InnerButton/utils/badgeUtils.d.ts.map +1 -0
- package/dist/modules/InnerButton/utils/colorUtils.d.ts +14 -0
- package/dist/modules/InnerButton/utils/colorUtils.d.ts.map +1 -0
- package/dist/modules/InnerButton/utils/configConverters.d.ts +31 -0
- package/dist/modules/InnerButton/utils/configConverters.d.ts.map +1 -0
- package/dist/modules/InnerButton/utils/deprecation.d.ts +11 -0
- package/dist/modules/InnerButton/utils/deprecation.d.ts.map +1 -0
- package/dist/modules/InnerButton/utils/iconUtils.d.ts +16 -0
- package/dist/modules/InnerButton/utils/iconUtils.d.ts.map +1 -0
- package/dist/modules/InnerButton/utils/index.d.ts +9 -0
- package/dist/modules/InnerButton/utils/index.d.ts.map +1 -0
- package/dist/modules/Lists/components/molecules/ListItemCheckbox.d.ts.map +1 -1
- package/dist/modules/Lists/components/organisms/List.d.ts.map +1 -1
- package/dist/modules/Lists/components/organisms/ListBase.d.ts.map +1 -1
- package/dist/modules/Lists/components/organisms/ListFiltersCheckbox.d.ts.map +1 -1
- package/dist/modules/Lists/components/organisms/ListUsersSelect.d.ts.map +1 -1
- package/dist/modules/Modal/Modal.d.ts.map +1 -1
- package/dist/modules/Modal/components/molecules/ModalFooter.d.ts +1 -1
- package/dist/modules/Modal/components/molecules/ModalFooter.d.ts.map +1 -1
- package/dist/modules/Modal/components/molecules/ModalHeader.d.ts +1 -1
- package/dist/modules/Modal/components/molecules/ModalHeader.d.ts.map +1 -1
- package/dist/modules/Modal/context/ModalContext.d.ts.map +1 -1
- package/dist/modules/Modal/stories/Modal.stories.d.ts +6 -0
- package/dist/modules/Modal/stories/Modal.stories.d.ts.map +1 -1
- package/dist/modules/Table/components/molecules/SelectionCheckbox.d.ts +9 -9
- package/dist/modules/Table/components/molecules/SelectionCheckbox.d.ts.map +1 -1
- package/dist/modules/Table/components/molecules/TableRow.d.ts.map +1 -1
- package/dist/modules/Toolbar/components/organisms/Toolbar.d.ts.map +1 -1
- package/dist/modules/index.d.ts +1 -0
- package/dist/modules/index.d.ts.map +1 -1
- package/dist/shared/types/button.d.ts +88 -4
- package/dist/shared/types/button.d.ts.map +1 -1
- package/dist/shared/types/buttonConfig.d.ts +67 -0
- package/dist/shared/types/buttonConfig.d.ts.map +1 -0
- package/dist/shared/types/emojipicker.d.ts +2 -2
- package/dist/shared/types/modal.d.ts +174 -21
- package/dist/shared/types/modal.d.ts.map +1 -1
- package/dist/shared/types/switch.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { IButtonProps } from '../../../../shared/types/button';
|
|
2
|
-
export declare const Button: ({ ref, className, fullWidth,
|
|
2
|
+
export declare const Button: ({ ref, className, fullWidth, leftSlot, rightSlot, theme, badgeColor, badgeLabel, badgeTheme, badgeSize, badgeStroke, badgeIcon, badgeIconDuotonePrimary, badgeIconDuotoneSecondary, badgeIconDuotoneOpacityPrimary, badgeIconDuotoneOpacitySecondary, clickable, color, rounded, children, icon, link, size, target, onClickIcon, disabled, colorIcon, tooltip, tooltipPosition, tooltipAlignment, tooltipDelay, ...props }: IButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface CheckboxProps {
|
|
2
|
+
/** Estado del checkbox (marcado o no) */
|
|
3
|
+
checked: boolean;
|
|
4
|
+
/** Estado indeterminado (parcialmente seleccionado) */
|
|
5
|
+
indeterminate?: boolean;
|
|
6
|
+
/** Handler cuando cambia el estado */
|
|
7
|
+
onChange: (checked: boolean) => void;
|
|
8
|
+
/** Si el checkbox está deshabilitado */
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
/** Si el checkbox tiene estado de error */
|
|
11
|
+
error?: boolean;
|
|
12
|
+
/** Clases CSS adicionales para el input */
|
|
13
|
+
className?: string;
|
|
14
|
+
/** Hace el checkbox redondo en lugar de cuadrado */
|
|
15
|
+
round?: boolean;
|
|
16
|
+
/** Tamaño del checkbox */
|
|
17
|
+
size?: 'sm' | 'md';
|
|
18
|
+
/** Nombre del input para formularios */
|
|
19
|
+
name?: string;
|
|
20
|
+
/** ID del input */
|
|
21
|
+
id?: string;
|
|
22
|
+
/** Texto del label asociado al checkbox */
|
|
23
|
+
label?: string;
|
|
24
|
+
/** Texto de soporte debajo del label */
|
|
25
|
+
supportingText?: string;
|
|
26
|
+
/** Clases CSS adicionales para el contenedor del label */
|
|
27
|
+
classNameLabel?: string;
|
|
28
|
+
}
|
|
29
|
+
export declare const Checkbox: ({ checked, indeterminate, onChange, disabled, error, className, round, size, name, id, label, supportingText, classNameLabel, }: CheckboxProps) => import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/Checkbox/index.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,aAAa;IAC5B,yCAAyC;IACzC,OAAO,EAAE,OAAO,CAAA;IAChB,uDAAuD;IACvD,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,sCAAsC;IACtC,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAA;IACpC,wCAAwC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,2CAA2C;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,oDAAoD;IACpD,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,0BAA0B;IAC1B,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;IAClB,wCAAwC;IACxC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,mBAAmB;IACnB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,wCAAwC;IACxC,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,0DAA0D;IAC1D,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB;AAED,eAAO,MAAM,QAAQ,GAAI,iIActB,aAAa,4CAuJf,CAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Checkbox } from '../index';
|
|
3
|
+
/**
|
|
4
|
+
* # Checkbox Component
|
|
5
|
+
*
|
|
6
|
+
* Componente base de checkbox reutilizable en todo el sistema de diseño.
|
|
7
|
+
* Basado en los tokens semánticos de Figma (Forms).
|
|
8
|
+
*
|
|
9
|
+
* ### Características:
|
|
10
|
+
* - Estados: Default, Hover, Focus, Disabled, Error
|
|
11
|
+
* - Estado checked / unchecked / indeterminate
|
|
12
|
+
* - Forma cuadrada (`radius/surface/forms = 2px`) o redonda
|
|
13
|
+
* - Dos tamaños: `sm` y `md`
|
|
14
|
+
* - Label + Supporting text con tipografía semántica
|
|
15
|
+
* - Checkmark SVG y minus SVG (indeterminate) con tamaños exactos de Figma (10×12)
|
|
16
|
+
*
|
|
17
|
+
* ### Componentes que lo extienden:
|
|
18
|
+
* - `SelectionCheckbox` (Table)
|
|
19
|
+
* - `ListItemCheckbox` (Lists)
|
|
20
|
+
* - `ListFiltersCheckbox` (Lists)
|
|
21
|
+
*/
|
|
22
|
+
declare const meta: Meta<typeof Checkbox>;
|
|
23
|
+
export default meta;
|
|
24
|
+
type Story = StoryObj<typeof Checkbox>;
|
|
25
|
+
export declare const Estados: Story;
|
|
26
|
+
export declare const Error: Story;
|
|
27
|
+
export declare const Formas: Story;
|
|
28
|
+
export declare const Tamanos: Story;
|
|
29
|
+
export declare const ConLabel: Story;
|
|
30
|
+
export declare const SeleccionMultiple: Story;
|
|
31
|
+
export declare const Combinaciones: Story;
|
|
32
|
+
export declare const ComponentesQueExtienden: Story;
|
|
33
|
+
//# sourceMappingURL=Checkbox.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Checkbox.stories.d.ts","sourceRoot":"","sources":["../../../../src/modules/Checkbox/stories/Checkbox.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAEtD,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAGnC;;;;;;;;;;;;;;;;;;GAkBG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,QAAQ,CAyC/B,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,QAAQ,CAAC,CAAA;AAMtC,eAAO,MAAM,OAAO,EAAE,KA6DrB,CAAA;AAMD,eAAO,MAAM,KAAK,EAAE,KAyCnB,CAAA;AAMD,eAAO,MAAM,MAAM,EAAE,KA4DpB,CAAA;AAMD,eAAO,MAAM,OAAO,EAAE,KA0CrB,CAAA;AAMD,eAAO,MAAM,QAAQ,EAAE,KA8GtB,CAAA;AAMD,eAAO,MAAM,iBAAiB,EAAE,KAoF/B,CAAA;AAMD,eAAO,MAAM,aAAa,EAAE,KAiF3B,CAAA;AAMD,eAAO,MAAM,uBAAuB,EAAE,KAwCrC,CAAA"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { EmojiPickerProps } from '../../../../shared/types/emojipicker';
|
|
2
|
-
export declare const EmojiPicker: ({ onEmojiSelect, maxRecentEmojis, className, width, height, initialRecentEmojis, showSearch, searchPlaceholder, closeOnSelect, label, position, variant, color, size, icon,
|
|
2
|
+
export declare const EmojiPicker: ({ onEmojiSelect, maxRecentEmojis, className, width, height, initialRecentEmojis, showSearch, searchPlaceholder, closeOnSelect, label, position, variant, color, size, icon, leftSlot, rightSlot, borderRadius, disabled, buttonClassName, tooltip, }: EmojiPickerProps) => JSX.Element;
|
|
3
3
|
//# sourceMappingURL=EmojiPicker.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
title: string;
|
|
3
|
-
component: ({ onEmojiSelect, maxRecentEmojis, className, width, height, initialRecentEmojis, showSearch, searchPlaceholder, closeOnSelect, label, position, variant, color, size, icon,
|
|
3
|
+
component: ({ onEmojiSelect, maxRecentEmojis, className, width, height, initialRecentEmojis, showSearch, searchPlaceholder, closeOnSelect, label, position, variant, color, size, icon, leftSlot, rightSlot, borderRadius, disabled, buttonClassName, tooltip, }: import('../../..').EmojiPickerProps) => JSX.Element;
|
|
4
4
|
};
|
|
5
5
|
export default _default;
|
|
6
6
|
export declare const Default: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IInnerButtonProps } from '../../shared/types/button';
|
|
2
|
+
export declare const InnerButton: {
|
|
3
|
+
({ className, classNameLabel, fullWidth, leftSlot, rightSlot, theme, badgeColor, badgeLabel, badgeTheme, badgeSize, badgeStroke, badgeIcon, badgeIconDuotonePrimary, badgeIconDuotoneSecondary, badgeIconDuotoneOpacityPrimary, badgeIconDuotoneOpacitySecondary, badgeLoading, hoverText, color, rounded, children, textColor, clickable, icon, link, size, square, target, onClickIcon, onClickLeftSlot, onClickRightSlot, disabled, colorIcon, iconDuotonePrimary, iconDuotoneSecondary, iconDuotoneOpacityPrimary, iconDuotoneOpacitySecondary, leftSlotDuotonePrimary, leftSlotDuotoneSecondary, leftSlotDuotoneOpacityPrimary, leftSlotDuotoneOpacitySecondary, rightSlotDuotonePrimary, rightSlotDuotoneSecondary, rightSlotDuotoneOpacityPrimary, rightSlotDuotoneOpacitySecondary, showShadow, borderable, iconSizeExtended, defaultSizeIcon, as, classNameId, tooltip, tooltipPosition, tooltipAlignment, tooltipDelay, tooltipAbsolute, classNameTooltip, stopPropagation, pointer, ref, onClick, pill, textAlign, whiteBackground, strokeWidth, transition, classNameIcon, active, iconProps: iconPropsProp, badge: badgeProp, leftSlotProps: leftSlotPropsProp, rightSlotProps: rightSlotPropsProp, tooltipProps: tooltipPropsProp, ...props }: IInnerButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
displayName: string;
|
|
5
|
+
};
|
|
6
|
+
//# sourceMappingURL=InnerButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InnerButton.d.ts","sourceRoot":"","sources":["../../../src/modules/InnerButton/InnerButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAyCzD,eAAO,MAAM,WAAW;isCA4ErB,iBAAiB;;CAsZnB,CAAA"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BadgeColor, BadgeTheme, BadgeSize } from '../../../shared/types/badge';
|
|
3
|
+
import { IconFontColor, IconType } from '../../../shared/types/types';
|
|
4
|
+
import { IconProp, IconDefinition } from '@fortawesome/fontawesome-svg-core';
|
|
5
|
+
type AnyIconDefinition = IconProp | IconDefinition | {
|
|
6
|
+
icon: any;
|
|
7
|
+
prefix?: string;
|
|
8
|
+
};
|
|
9
|
+
export interface ButtonBadgeProps {
|
|
10
|
+
/** Si el badge debe mostrarse */
|
|
11
|
+
shouldShow: boolean;
|
|
12
|
+
/** Color del badge */
|
|
13
|
+
badgeColor?: BadgeColor;
|
|
14
|
+
/** Label del badge */
|
|
15
|
+
badgeLabel?: string;
|
|
16
|
+
/** Tema del badge */
|
|
17
|
+
badgeTheme?: BadgeTheme;
|
|
18
|
+
/** Tamaño del badge */
|
|
19
|
+
badgeSize?: BadgeSize;
|
|
20
|
+
/** Si el badge debe tener borde */
|
|
21
|
+
badgeStroke?: boolean;
|
|
22
|
+
/** Icono del badge */
|
|
23
|
+
badgeIcon?: IconType | AnyIconDefinition;
|
|
24
|
+
/** Props de duotone para el icono del badge */
|
|
25
|
+
badgeIconDuotonePrimary?: IconFontColor;
|
|
26
|
+
badgeIconDuotoneSecondary?: IconFontColor;
|
|
27
|
+
badgeIconDuotoneOpacityPrimary?: number;
|
|
28
|
+
badgeIconDuotoneOpacitySecondary?: number;
|
|
29
|
+
/** Si el badge está en estado de carga */
|
|
30
|
+
badgeLoading?: boolean;
|
|
31
|
+
/** Si el badge debe posicionarse absolutamente (para icon buttons) */
|
|
32
|
+
isAbsolute?: boolean;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Renderiza el badge del botón
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```tsx
|
|
39
|
+
* <ButtonBadge
|
|
40
|
+
* shouldShow={true}
|
|
41
|
+
* badgeColor="accent"
|
|
42
|
+
* badgeLabel="5"
|
|
43
|
+
* badgeSize="sm"
|
|
44
|
+
* isAbsolute={false}
|
|
45
|
+
* />
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
export declare const ButtonBadge: React.FC<ButtonBadgeProps>;
|
|
49
|
+
export {};
|
|
50
|
+
//# sourceMappingURL=ButtonBadge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonBadge.d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|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ButtonColors } from '../../../shared/types/types';
|
|
3
|
+
export interface ButtonContentProps {
|
|
4
|
+
/** Contenido a mostrar */
|
|
5
|
+
displayText: React.ReactNode;
|
|
6
|
+
/** Si hay leftSlot o rightSlot */
|
|
7
|
+
hasSlots: boolean;
|
|
8
|
+
/** Estilo inline para el texto */
|
|
9
|
+
textStyle?: React.CSSProperties;
|
|
10
|
+
/** Color del texto */
|
|
11
|
+
textColor?: ButtonColors;
|
|
12
|
+
/** Alineación del texto */
|
|
13
|
+
textAlign?: 'left' | 'center' | 'right';
|
|
14
|
+
/** Referencia al elemento de medición */
|
|
15
|
+
measureRef: React.RefObject<HTMLSpanElement>;
|
|
16
|
+
/** Referencia al elemento de texto */
|
|
17
|
+
textRef: React.RefObject<HTMLParagraphElement>;
|
|
18
|
+
/** Clases para el span de medición */
|
|
19
|
+
measureSpanClassName: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Renderiza el contenido de texto del botón
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* <ButtonContent
|
|
27
|
+
* displayText="Click me"
|
|
28
|
+
* hasSlots={false}
|
|
29
|
+
* textColor="primary"
|
|
30
|
+
* textAlign="center"
|
|
31
|
+
* measureRef={measureRef}
|
|
32
|
+
* textRef={textRef}
|
|
33
|
+
* measureSpanClassName={measureSpanClassName}
|
|
34
|
+
* />
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export declare const ButtonContent: React.FC<ButtonContentProps>;
|
|
38
|
+
//# sourceMappingURL=ButtonContent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonContent.d.ts","sourceRoot":"","sources":["../../../../src/modules/InnerButton/components/ButtonContent.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AA4BnD,MAAM,WAAW,kBAAkB;IACjC,0BAA0B;IAC1B,WAAW,EAAE,KAAK,CAAC,SAAS,CAAA;IAC5B,kCAAkC;IAClC,QAAQ,EAAE,OAAO,CAAA;IACjB,kCAAkC;IAClC,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IAC/B,sBAAsB;IACtB,SAAS,CAAC,EAAE,YAAY,CAAA;IACxB,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAA;IACvC,yCAAyC;IACzC,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,eAAe,CAAC,CAAA;IAC5C,sCAAsC;IACtC,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAA;IAC9C,sCAAsC;IACtC,oBAAoB,EAAE,MAAM,CAAA;CAC7B;AAED;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAgCtD,CAAA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { IconFontColor, VisualSlotType, ButtonColors } from '../../../shared/types/types';
|
|
3
|
+
export interface ButtonIconProps {
|
|
4
|
+
/** Icono a renderizar */
|
|
5
|
+
icon: VisualSlotType | React.ReactElement;
|
|
6
|
+
/** Tamaño del botón */
|
|
7
|
+
size?: 'xxs' | 'xs' | 'sm' | 'md' | 'lg';
|
|
8
|
+
/** Color del botón */
|
|
9
|
+
color?: ButtonColors;
|
|
10
|
+
/** Color personalizado del icono */
|
|
11
|
+
colorIcon?: string;
|
|
12
|
+
/** Clases CSS adicionales para el icono */
|
|
13
|
+
classNameIcon?: string;
|
|
14
|
+
/** Ancho de línea del icono */
|
|
15
|
+
strokeWidth?: number;
|
|
16
|
+
/** Tema del botón */
|
|
17
|
+
theme?: 'solid' | 'icon' | 'emoji';
|
|
18
|
+
/** Handler de click del icono */
|
|
19
|
+
onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
20
|
+
/** Handler de click del icono (alternativo) */
|
|
21
|
+
onClickIcon?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
22
|
+
/** Props de duotone para el icono */
|
|
23
|
+
iconDuotonePrimary?: IconFontColor;
|
|
24
|
+
iconDuotoneSecondary?: IconFontColor;
|
|
25
|
+
iconDuotoneOpacityPrimary?: number;
|
|
26
|
+
iconDuotoneOpacitySecondary?: number;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Renderiza el icono del botón
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```tsx
|
|
33
|
+
* <ButtonIcon
|
|
34
|
+
* icon="ImageOutlined"
|
|
35
|
+
* size="md"
|
|
36
|
+
* color="primary"
|
|
37
|
+
* theme="solid"
|
|
38
|
+
* />
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare const ButtonIcon: React.FC<ButtonIconProps>;
|
|
42
|
+
//# sourceMappingURL=ButtonIcon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonIcon.d.ts","sourceRoot":"","sources":["../../../../src/modules/InnerButton/components/ButtonIcon.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAY,aAAa,EAAa,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAKzF,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAEnD,MAAM,WAAW,eAAe;IAC9B,yBAAyB;IACzB,IAAI,EAAE,cAAc,GAAG,KAAK,CAAC,YAAY,CAAA;IACzC,uBAAuB;IACvB,IAAI,CAAC,EAAE,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;IACxC,sBAAsB;IACtB,KAAK,CAAC,EAAE,YAAY,CAAA;IACpB,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,2CAA2C;IAC3C,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,+BAA+B;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,qBAAqB;IACrB,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAA;IAClC,iCAAiC;IACjC,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,KAAK,IAAI,CAAA;IACvD,+CAA+C;IAC/C,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,KAAK,IAAI,CAAA;IAC3D,qCAAqC;IACrC,kBAAkB,CAAC,EAAE,aAAa,CAAA;IAClC,oBAAoB,CAAC,EAAE,aAAa,CAAA;IACpC,yBAAyB,CAAC,EAAE,MAAM,CAAA;IAClC,2BAA2B,CAAC,EAAE,MAAM,CAAA;CACrC;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAsDhD,CAAA"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { IconColor, IconFontColor, ButtonColors, VisualSlotType } from '../../../shared/types/types';
|
|
3
|
+
export interface ButtonSlotLeftProps {
|
|
4
|
+
/** Slot izquierdo */
|
|
5
|
+
leftSlot?: VisualSlotType;
|
|
6
|
+
/** Tamaño del botón */
|
|
7
|
+
size?: 'xxs' | 'xs' | 'sm' | 'md' | 'lg';
|
|
8
|
+
/** Color del botón */
|
|
9
|
+
color?: ButtonColors;
|
|
10
|
+
/** Color personalizado del icono */
|
|
11
|
+
colorIcon?: IconColor | IconFontColor;
|
|
12
|
+
/** Clases CSS adicionales */
|
|
13
|
+
className?: string;
|
|
14
|
+
/** Si el botón está deshabilitado */
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/** Ancho de línea del icono */
|
|
17
|
+
strokeWidth?: number;
|
|
18
|
+
/** Handler de click del slot izquierdo */
|
|
19
|
+
onClickLeftSlot?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
20
|
+
/** Props de duotone para slot izquierdo */
|
|
21
|
+
leftSlotDuotonePrimary?: IconFontColor;
|
|
22
|
+
leftSlotDuotoneSecondary?: IconFontColor;
|
|
23
|
+
leftSlotDuotoneOpacityPrimary?: number;
|
|
24
|
+
leftSlotDuotoneOpacitySecondary?: number;
|
|
25
|
+
/** Si hay children (texto) */
|
|
26
|
+
hasChildren: boolean;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Renderiza el slot izquierdo del botón
|
|
30
|
+
*/
|
|
31
|
+
export declare const ButtonSlotLeft: React.FC<ButtonSlotLeftProps>;
|
|
32
|
+
/**
|
|
33
|
+
* Componente atómico para el slot derecho del botón
|
|
34
|
+
*/
|
|
35
|
+
export interface ButtonSlotRightProps {
|
|
36
|
+
/** Slot derecho */
|
|
37
|
+
rightSlot?: VisualSlotType;
|
|
38
|
+
/** Tamaño del botón */
|
|
39
|
+
size?: 'xxs' | 'xs' | 'sm' | 'md' | 'lg';
|
|
40
|
+
/** Color del botón */
|
|
41
|
+
color?: ButtonColors;
|
|
42
|
+
/** Color personalizado del icono */
|
|
43
|
+
colorIcon?: IconColor | IconFontColor;
|
|
44
|
+
/** Clases CSS adicionales */
|
|
45
|
+
className?: string;
|
|
46
|
+
/** Si el botón está deshabilitado */
|
|
47
|
+
disabled?: boolean;
|
|
48
|
+
/** Ancho de línea del icono */
|
|
49
|
+
strokeWidth?: number;
|
|
50
|
+
/** Handler de click del slot derecho */
|
|
51
|
+
onClickRightSlot?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
52
|
+
/** Props de duotone para slot derecho */
|
|
53
|
+
rightSlotDuotonePrimary?: IconFontColor;
|
|
54
|
+
rightSlotDuotoneSecondary?: IconFontColor;
|
|
55
|
+
rightSlotDuotoneOpacityPrimary?: number;
|
|
56
|
+
rightSlotDuotoneOpacitySecondary?: number;
|
|
57
|
+
/** Si hay children (texto) */
|
|
58
|
+
hasChildren: boolean;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Renderiza el slot derecho del botón
|
|
62
|
+
*/
|
|
63
|
+
export declare const ButtonSlotRight: React.FC<ButtonSlotRightProps>;
|
|
64
|
+
//# sourceMappingURL=ButtonSlots.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonSlots.d.ts","sourceRoot":"","sources":["../../../../src/modules/InnerButton/components/ButtonSlots.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAG/D,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAErD,MAAM,WAAW,mBAAmB;IAClC,qBAAqB;IACrB,QAAQ,CAAC,EAAE,cAAc,CAAA;IACzB,uBAAuB;IACvB,IAAI,CAAC,EAAE,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;IACxC,sBAAsB;IACtB,KAAK,CAAC,EAAE,YAAY,CAAA;IACpB,oCAAoC;IACpC,SAAS,CAAC,EAAE,SAAS,GAAG,aAAa,CAAA;IACrC,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,qCAAqC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,+BAA+B;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,0CAA0C;IAC1C,eAAe,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,KAAK,IAAI,CAAA;IAC/D,2CAA2C;IAC3C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icos del módulo InnerButton
|
|
3
|
+
*
|
|
4
|
+
* Estos componentes son los bloques de construcción más pequeños
|
|
5
|
+
* y reutilizables del botón, siguiendo Atomic Design.
|
|
6
|
+
*/
|
|
7
|
+
export { ButtonContent } from './ButtonContent';
|
|
8
|
+
export type { ButtonContentProps } from './ButtonContent';
|
|
9
|
+
export { ButtonIcon } from './ButtonIcon';
|
|
10
|
+
export type { ButtonIconProps } from './ButtonIcon';
|
|
11
|
+
export { ButtonSlotLeft, ButtonSlotRight } from './ButtonSlots';
|
|
12
|
+
export type { ButtonSlotLeftProps, ButtonSlotRightProps } from './ButtonSlots';
|
|
13
|
+
export { ButtonBadge } from './ButtonBadge';
|
|
14
|
+
export type { ButtonBadgeProps } from './ButtonBadge';
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/InnerButton/components/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAEzD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAEnD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAC/D,YAAY,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAA;AAE9E,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/InnerButton/hooks/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,mBAAmB,CAAA;AACjC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,oBAAoB,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook para manejar el estado de carga del badge
|
|
3
|
+
*
|
|
4
|
+
* Detecta cuando el badge termina de cargar (badgeLoading cambia de true a false)
|
|
5
|
+
* y actualiza el estado correspondiente.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Hook que detecta cuando el badge termina de cargar
|
|
9
|
+
*
|
|
10
|
+
* @param badgeLoading - Estado actual de carga del badge
|
|
11
|
+
* @returns true si el badge ha terminado de cargar (badgeLoading cambió de true a false)
|
|
12
|
+
*/
|
|
13
|
+
export declare const useBadgeLoading: (badgeLoading?: boolean) => boolean;
|
|
14
|
+
//# sourceMappingURL=useBadgeLoading.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useBadgeLoading.d.ts","sourceRoot":"","sources":["../../../../src/modules/InnerButton/hooks/useBadgeLoading.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAAI,eAAe,OAAO,YAmBrD,CAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ButtonColors } from '../../../shared/types/types';
|
|
2
|
+
interface UseButtonClassesOptions {
|
|
3
|
+
theme: 'solid' | 'icon' | 'emoji';
|
|
4
|
+
size?: 'xxs' | 'xs' | 'sm' | 'md' | 'lg';
|
|
5
|
+
color?: ButtonColors;
|
|
6
|
+
rounded?: boolean;
|
|
7
|
+
fullWidth: boolean;
|
|
8
|
+
pill?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'pill';
|
|
9
|
+
clickable: boolean;
|
|
10
|
+
borderable?: boolean;
|
|
11
|
+
whiteBackground: boolean;
|
|
12
|
+
active: boolean;
|
|
13
|
+
square: boolean;
|
|
14
|
+
icon: boolean;
|
|
15
|
+
children: boolean;
|
|
16
|
+
shouldShowBadge: boolean;
|
|
17
|
+
showShadow: boolean;
|
|
18
|
+
pointer: boolean;
|
|
19
|
+
transition: boolean;
|
|
20
|
+
classNameId: string;
|
|
21
|
+
className?: string;
|
|
22
|
+
isIconVariant: boolean;
|
|
23
|
+
defaultSizeIcon: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Hook que genera las clases CSS del botón
|
|
27
|
+
*
|
|
28
|
+
* @param options - Opciones para generar las clases
|
|
29
|
+
* @returns Clases CSS del botón
|
|
30
|
+
*/
|
|
31
|
+
export declare const useButtonClasses: ({ theme, size, color, rounded, fullWidth, pill, clickable, borderable, whiteBackground, active, square, icon, children, shouldShowBadge, showShadow, pointer, transition, classNameId, className, isIconVariant, defaultSizeIcon, }: UseButtonClassesOptions) => {
|
|
32
|
+
buttonClasses: string;
|
|
33
|
+
currentSizeIcon: "xs" | "sm" | "md" | "lg" | "xxs";
|
|
34
|
+
currentDefaultSizeIcon: boolean;
|
|
35
|
+
};
|
|
36
|
+
export {};
|
|
37
|
+
//# sourceMappingURL=useButtonClasses.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useButtonClasses.d.ts","sourceRoot":"","sources":["../../../../src/modules/InnerButton/hooks/useButtonClasses.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAEnD,UAAU,uBAAuB;IAC/B,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAA;IACjC,IAAI,CAAC,EAAE,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;IACxC,KAAK,CAAC,EAAE,YAAY,CAAA;IACpB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,SAAS,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAA;IAClD,SAAS,EAAE,OAAO,CAAA;IAClB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,eAAe,EAAE,OAAO,CAAA;IACxB,MAAM,EAAE,OAAO,CAAA;IACf,MAAM,EAAE,OAAO,CAAA;IACf,IAAI,EAAE,OAAO,CAAA;IACb,QAAQ,EAAE,OAAO,CAAA;IACjB,eAAe,EAAE,OAAO,CAAA;IACxB,UAAU,EAAE,OAAO,CAAA;IACnB,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,EAAE,OAAO,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,OAAO,CAAA;IACtB,eAAe,EAAE,OAAO,CAAA;CACzB;AAED;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAAI,qOAsB9B,uBAAuB;;;;CAyDzB,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ButtonColors } from '../../../shared/types/types';
|
|
2
|
+
interface UseHoverTextOptions {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
hoverText?: string;
|
|
5
|
+
badgeFinishedLoading: boolean;
|
|
6
|
+
size?: 'xxs' | 'xs' | 'sm' | 'md' | 'lg';
|
|
7
|
+
textColor?: ButtonColors;
|
|
8
|
+
textAlign?: 'left' | 'center' | 'right';
|
|
9
|
+
}
|
|
10
|
+
interface UseHoverTextReturn {
|
|
11
|
+
isHovered: boolean;
|
|
12
|
+
displayText: React.ReactNode;
|
|
13
|
+
textStyle: React.CSSProperties | undefined;
|
|
14
|
+
measureRef: React.RefObject<HTMLSpanElement>;
|
|
15
|
+
textRef: React.RefObject<HTMLParagraphElement>;
|
|
16
|
+
handleMouseEnter: () => void;
|
|
17
|
+
handleMouseLeave: () => void;
|
|
18
|
+
measureSpanClassName: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Hook que maneja la lógica de hover text y cálculo de ancho máximo
|
|
22
|
+
*
|
|
23
|
+
* @param options - Opciones del hook
|
|
24
|
+
* @returns Estado y funciones relacionadas con hover text
|
|
25
|
+
*/
|
|
26
|
+
export declare const useHoverText: ({ children, hoverText, badgeFinishedLoading, size, textColor, textAlign, }: UseHoverTextOptions) => UseHoverTextReturn;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=useHoverText.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useHoverText.d.ts","sourceRoot":"","sources":["../../../../src/modules/InnerButton/hooks/useHoverText.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AA4BnD,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,oBAAoB,EAAE,OAAO,CAAA;IAC7B,IAAI,CAAC,EAAE,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;IACxC,SAAS,CAAC,EAAE,YAAY,CAAA;IACxB,SAAS,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAA;CACxC;AAED,UAAU,kBAAkB;IAC1B,SAAS,EAAE,OAAO,CAAA;IAClB,WAAW,EAAE,KAAK,CAAC,SAAS,CAAA;IAC5B,SAAS,EAAE,KAAK,CAAC,aAAa,GAAG,SAAS,CAAA;IAC1C,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,eAAe,CAAC,CAAA;IAC5C,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAA;IAC9C,gBAAgB,EAAE,MAAM,IAAI,CAAA;IAC5B,gBAAgB,EAAE,MAAM,IAAI,CAAA;IAC5B,oBAAoB,EAAE,MAAM,CAAA;CAC7B;AAED;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GAAI,4EAO1B,mBAAmB,KAAG,kBA+GxB,CAAA"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Re-exportar el componente InnerButton desde el archivo refactorizado
|
|
3
|
+
*
|
|
4
|
+
* Este archivo mantiene la compatibilidad con las importaciones existentes
|
|
5
|
+
* mientras que la implementación real está en InnerButton.tsx
|
|
6
|
+
*/
|
|
7
|
+
export { InnerButton } from './InnerButton';
|
|
3
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/InnerButton/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/InnerButton/index.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA"}
|
|
@@ -20,4 +20,24 @@ export declare const HoverTextDifferentSizes: Story;
|
|
|
20
20
|
export declare const HoverTextWithoutLoading: Story;
|
|
21
21
|
export declare const HoverTextMultipleScenarios: Story;
|
|
22
22
|
export declare const HoverTextWithIcons: Story;
|
|
23
|
+
export declare const CompleteSystemNewConfig: Story;
|
|
24
|
+
export declare const CompleteSystemLegacyComparison: Story;
|
|
25
|
+
export declare const CompleteSystemDuotone: Story;
|
|
26
|
+
export declare const CompleteSystemConvergence: Story;
|
|
27
|
+
export declare const CompleteSystemRareCases: Story;
|
|
28
|
+
/**
|
|
29
|
+
* Demuestra el uso de `icon`, `leftSlot`, `rightSlot` y `tooltip` tanto como strings simples
|
|
30
|
+
* como objetos de configuración completos.
|
|
31
|
+
*
|
|
32
|
+
* **Uso como string simple:**
|
|
33
|
+
* - Funciona sin warnings
|
|
34
|
+
* - Estilos por defecto
|
|
35
|
+
* - Ideal para casos simples sin personalización
|
|
36
|
+
*
|
|
37
|
+
* **Uso como objeto de configuración:**
|
|
38
|
+
* - Permite personalización completa (colores, onClick, duotone, etc.)
|
|
39
|
+
* - Misma funcionalidad que iconProps/leftSlotProps/rightSlotProps/tooltipProps
|
|
40
|
+
* - Ideal cuando necesitas estilos personalizados pero prefieres pasar todo en una sola prop
|
|
41
|
+
*/
|
|
42
|
+
export declare const IconAndSlotsAsStringOrObject: Story;
|
|
23
43
|
//# sourceMappingURL=InnerButton.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InnerButton.stories.d.ts","sourceRoot":"","sources":["../../../../src/modules/InnerButton/stories/InnerButton.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAGtC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAMjD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,WAAW,CAuGlC,CAAA;AAED,eAAe,IAAI,CAAA;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAA;AAGlC,eAAO,MAAM,OAAO,EAAE,KAkCrB,CAAA;AAGD,eAAO,MAAM,QAAQ,EAAE,KAsCtB,CAAA;AAGD,eAAO,MAAM,IAAI,EAAE,KA6FlB,CAAA;AAGD,eAAO,MAAM,OAAO,EAAE,KAyCrB,CAAA;AAGD,eAAO,MAAM,QAAQ,EAAE,KAuBtB,CAAA;AAGD,eAAO,MAAM,KAAK,EAAE,KAqDnB,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,KA0M3B,CAAA;AAGD,eAAO,MAAM,WAAW,EAAE,KAmGzB,CAAA;AAGD,eAAO,MAAM,aAAa,EAAE,KAuI3B,CAAA;AAGD,eAAO,MAAM,mBAAmB,EAAE,KAmVjC,CAAA;AAGD,eAAO,MAAM,gBAAgB,EAAE,KA0X9B,CAAA;AAKD,eAAO,MAAM,qBAAqB,EAAE,KA8DnC,CAAA;AAKD,eAAO,MAAM,oBAAoB,EAAE,KA4DlC,CAAA;AAKD,eAAO,MAAM,uBAAuB,EAAE,KA2FrC,CAAA;A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E,KA2HxC,CAAA;AAKD,eAAO,MAAM,kBAAkB,EAAE,KAsLhC,CAAA;AAKD,eAAO,MAAM,uBAAuB,EAAE,KAqJrC,CAAA;AAGD,eAAO,MAAM,8BAA8B,EAAE,KAuF5C,CAAA;AAGD,eAAO,MAAM,qBAAqB,EAAE,KAoHnC,CAAA;AAGD,eAAO,MAAM,yBAAyB,EAAE,KAuFvC,CAAA;AAGD,eAAO,MAAM,uBAAuB,EAAE,KAyHrC,CAAA;AAMD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,4BAA4B,EAAE,KAsX1C,CAAA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Variantes del botón usando class-variance-authority
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Constantes para el posicionamiento del badge
|
|
6
|
+
*/
|
|
7
|
+
export declare const BADGE_POSITION_STYLE: React.CSSProperties;
|
|
8
|
+
export declare const BADGE_POSITION_CLASSES = "ui-absolute ui-z-10 ui-pointer-events-none";
|
|
9
|
+
/**
|
|
10
|
+
* Crea las variantes del botón usando CVA
|
|
11
|
+
*
|
|
12
|
+
* @param theme - Tema del botón (solid, icon, emoji)
|
|
13
|
+
* @param clickable - Si el botón es clickeable
|
|
14
|
+
* @param borderable - Si el botón debe tener borde
|
|
15
|
+
* @param whiteBackground - Si el botón tiene fondo blanco
|
|
16
|
+
* @param active - Si el botón está en estado activo
|
|
17
|
+
* @param square - Si el botón es cuadrado
|
|
18
|
+
* @param icon - Si el botón tiene icono
|
|
19
|
+
* @param children - Si el botón tiene children
|
|
20
|
+
* @param shouldShowBadge - Si el badge debe mostrarse
|
|
21
|
+
* @param showShadow - Si el botón debe mostrar sombra
|
|
22
|
+
* @param pointer - Si el botón debe mostrar cursor pointer
|
|
23
|
+
* @param transition - Si el botón debe tener transición
|
|
24
|
+
* @param classNameId - ID de clase del botón
|
|
25
|
+
* @returns Función CVA para generar las clases del botón
|
|
26
|
+
*/
|
|
27
|
+
export declare const createButtonVariants: (theme: string, clickable: boolean, borderable: boolean | undefined, whiteBackground: boolean, active: boolean, square: boolean, icon: boolean, children: boolean, shouldShowBadge: boolean, showShadow: boolean, pointer: boolean, transition: boolean, classNameId: string) => (props?: ({
|
|
28
|
+
theme?: "solid" | "icon" | "emoji" | null | undefined;
|
|
29
|
+
size?: "xs" | "sm" | "md" | "lg" | "xxs" | null | undefined;
|
|
30
|
+
color?: "link" | "primary" | "secondary" | "tertiary" | "destructive" | "ghost" | "soft" | null | undefined;
|
|
31
|
+
pill?: "none" | "xs" | "sm" | "md" | "lg" | "pill" | null | undefined;
|
|
32
|
+
rounded?: boolean | null | undefined;
|
|
33
|
+
fullWidth?: boolean | null | undefined;
|
|
34
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
35
|
+
/**
|
|
36
|
+
* Crea las variantes de color de texto usando CVA
|
|
37
|
+
*/
|
|
38
|
+
export declare const createTextColorVariants: () => (props?: ({
|
|
39
|
+
color?: "link" | "primary" | "secondary" | "tertiary" | "destructive" | "ghost" | "soft" | null | undefined;
|
|
40
|
+
textAlign?: "right" | "left" | "center" | null | undefined;
|
|
41
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
42
|
+
//# sourceMappingURL=buttonVariants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buttonVariants.d.ts","sourceRoot":"","sources":["../../../../src/modules/InnerButton/styles/buttonVariants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,aAIxC,CAAA;AAED,eAAO,MAAM,sBAAsB,+CAA+C,CAAA;AAElF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,oBAAoB,GAC/B,OAAO,MAAM,EACb,WAAW,OAAO,EAClB,YAAY,OAAO,GAAG,SAAS,EAC/B,iBAAiB,OAAO,EACxB,QAAQ,OAAO,EACf,QAAQ,OAAO,EACf,MAAM,OAAO,EACb,UAAU,OAAO,EACjB,iBAAiB,OAAO,EACxB,YAAY,OAAO,EACnB,SAAS,OAAO,EAChB,YAAY,OAAO,EACnB,aAAa,MAAM;;;;;;;8EAuDpB,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;8EAuBnC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/InnerButton/styles/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,iBAAiB,CAAA;AAC/B,cAAc,kBAAkB,CAAA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuración de colores por variante del botón
|
|
3
|
+
*
|
|
4
|
+
* Este archivo contiene toda la lógica de estilos y colores
|
|
5
|
+
* para las diferentes variantes (solid, icon, emoji) y colores del botón.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Obtiene las clases CSS de colores según la variante del botón
|
|
9
|
+
*
|
|
10
|
+
* @param variant - Variante del botón (solid, icon, emoji)
|
|
11
|
+
* @param clickable - Si el botón es clickeable
|
|
12
|
+
* @param borderable - Si el botón debe tener borde
|
|
13
|
+
* @param whiteBackground - Si el botón tiene fondo blanco
|
|
14
|
+
* @param active - Si el botón está en estado activo
|
|
15
|
+
* @returns Objeto con las clases CSS para cada color
|
|
16
|
+
*/
|
|
17
|
+
export declare const getVariantColors: (variant: string, clickable: boolean, borderable: boolean | undefined, whiteBackground: boolean, active?: boolean) => {
|
|
18
|
+
primary: string;
|
|
19
|
+
secondary: string;
|
|
20
|
+
tertiary: string;
|
|
21
|
+
destructive: string;
|
|
22
|
+
link: string;
|
|
23
|
+
ghost: string;
|
|
24
|
+
soft: string;
|
|
25
|
+
} | {
|
|
26
|
+
primary: string;
|
|
27
|
+
secondary: string;
|
|
28
|
+
tertiary: string;
|
|
29
|
+
destructive: string;
|
|
30
|
+
link: string;
|
|
31
|
+
ghost: string;
|
|
32
|
+
soft: string;
|
|
33
|
+
} | {
|
|
34
|
+
primary: string;
|
|
35
|
+
secondary: string;
|
|
36
|
+
tertiary: string;
|
|
37
|
+
destructive: string;
|
|
38
|
+
link: string;
|
|
39
|
+
ghost: string;
|
|
40
|
+
soft: string;
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=variantColors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variantColors.d.ts","sourceRoot":"","sources":["../../../../src/modules/InnerButton/styles/variantColors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,GAC3B,SAAS,MAAM,EACf,WAAW,OAAO,EAClB,YAAY,OAAO,GAAG,SAAS,EAC/B,iBAAiB,OAAO,EACxB,SAAQ,OAAe;;;;;;;;;;;;;;;;;;;;;;;;CA2CxB,CAAA"}
|