@ftdata/ui 0.0.19 → 0.0.21

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.
Files changed (28) hide show
  1. package/dist/components/DateRangePicker/constants/index.d.ts +477 -0
  2. package/dist/components/DateRangePicker/constants/index.js +22 -0
  3. package/dist/components/DateRangePicker/helpers/createFormatDate.d.ts +2 -0
  4. package/dist/components/DateRangePicker/helpers/createFormatDate.js +9 -0
  5. package/dist/components/DateRangePicker/index.d.ts +26 -0
  6. package/dist/components/DateRangePicker/index.js +90 -0
  7. package/dist/components/DateRangePicker/styles.d.ts +16 -0
  8. package/dist/components/DateRangePicker/styles.js +147 -0
  9. package/dist/components/DateRangePicker/types/dataRange.d.ts +3 -0
  10. package/dist/components/DateRangePicker/types/dataRange.js +0 -0
  11. package/dist/components/Modal/Button/index.d.ts +50 -0
  12. package/dist/components/Modal/Button/index.js +105 -0
  13. package/dist/components/Modal/Button/modifiers/color.d.ts +9 -0
  14. package/dist/components/Modal/Button/modifiers/color.js +96 -0
  15. package/dist/components/Modal/Button/modifiers/size.d.ts +5 -0
  16. package/dist/components/Modal/Button/modifiers/size.js +22 -0
  17. package/dist/components/Modal/Button/styles.d.ts +20 -0
  18. package/dist/components/Modal/Button/styles.js +105 -0
  19. package/dist/components/Modal/index.d.ts +13 -9
  20. package/dist/components/Modal/index.js +12 -6
  21. package/dist/components/Modal/styles.d.ts +1 -1
  22. package/dist/components/Modal/styles.js +5 -6
  23. package/dist/components/MultiSelect/components/Badge/styles.js +4 -2
  24. package/dist/components/MultiSelect/index.js +2 -1
  25. package/dist/index.d.ts +3 -1
  26. package/dist/index.js +2 -1
  27. package/dist/style/rsuite.css +3192 -0
  28. package/package.json +4 -2
@@ -0,0 +1,147 @@
1
+ import styled_components, { createGlobalStyle } from "styled-components";
2
+ import { COLOR_ACCENT_DARK, COLOR_ACCENT_MEDIUM, COLOR_DANGER_MEDIUM, COLOR_NEUTRAL_DARK, COLOR_NEUTRAL_DAY, COLOR_NEUTRAL_DUSK, COLOR_NEUTRAL_LIGHTER, COLOR_NEUTRAL_MEDIUM, COLOR_SUCCESS_MEDIUM, COLOR_WARNING_MEDIUM, FONT_WEIGHT_BOLD } from "@ftdata/f-tokens";
3
+ const DateRangePickerGlobalStyles = createGlobalStyle`
4
+ .rs-calendar-table-row {
5
+ color: ${COLOR_NEUTRAL_DUSK};
6
+ }
7
+ .rs-calendar-table-cell.rs-calendar-table-cell-un-same-month {
8
+ color: blue;
9
+ }
10
+
11
+ .rs-input-group-addon {
12
+ display: none;
13
+ }
14
+
15
+ .rs-picker-popup.rs-picker-popup-daterange {
16
+ font-family: 'Inter', sans-serif !important;
17
+ font-weight: 500 !important;
18
+ transform: translateY(${({ placement })=>placement?.startsWith("top") ? "-8px" : "8px"});
19
+ }
20
+
21
+ .rs-picker-header-date {
22
+ color: ${COLOR_NEUTRAL_DUSK};
23
+ }
24
+
25
+ .rs-calendar-month-dropdown-row {
26
+ color: ${COLOR_NEUTRAL_DUSK};
27
+ }
28
+ `;
29
+ const DateRangePickerWrapper = styled_components.div`
30
+ display: flex;
31
+ flex-direction: column;
32
+ gap: 0.5rem;
33
+ width: 100%;
34
+ `;
35
+ const LabelContainer = styled_components.div`
36
+ display: flex;
37
+ justify-content: space-between;
38
+ align-items: flex-end;
39
+ width: 100%;
40
+
41
+ button {
42
+ background: none;
43
+ border: none;
44
+ color: ${COLOR_ACCENT_MEDIUM};
45
+ cursor: pointer;
46
+ font-size: 0.875rem;
47
+ font-weight: ${FONT_WEIGHT_BOLD};
48
+ height: 1.5rem;
49
+ line-height: 1rem;
50
+ padding: 0;
51
+ transition: color 0.2s;
52
+ white-space: nowrap;
53
+
54
+ &:hover {
55
+ color: ${COLOR_ACCENT_DARK};
56
+ }
57
+ }
58
+ `;
59
+ const getFeedbackColor = (feedback)=>{
60
+ switch(feedback){
61
+ case "danger":
62
+ return COLOR_DANGER_MEDIUM;
63
+ case "success":
64
+ return COLOR_SUCCESS_MEDIUM;
65
+ case "warning":
66
+ return COLOR_WARNING_MEDIUM;
67
+ default:
68
+ return COLOR_NEUTRAL_MEDIUM;
69
+ }
70
+ };
71
+ const DateRangePickerContainer = styled_components.div`
72
+ display: flex;
73
+ width: 100%;
74
+ height: 2.5rem;
75
+ position: relative;
76
+
77
+ .rs_rotate {
78
+ position: absolute;
79
+ right: 1rem;
80
+ top: 0.5rem;
81
+ }
82
+
83
+ .rs-picker {
84
+ height: 2.5rem;
85
+ width: 100%;
86
+ }
87
+
88
+ .rs-input-group[data-inside="true"] .rs-input:not(:last-child),
89
+ .rs-input-group[data-inside="true"]
90
+ .rs-auto-complete:not(:last-child)
91
+ .rs-input {
92
+ padding-inline-end: 3rem;
93
+ }
94
+
95
+ .rs-picker-input-group.rs-input-group {
96
+ background-color: ${({ disabled })=>disabled ? COLOR_NEUTRAL_LIGHTER : COLOR_NEUTRAL_DAY};
97
+ border: none;
98
+ border-radius: 0.25rem;
99
+ box-shadow: 0px 0px 0px 1px ${({ feedback })=>getFeedbackColor(feedback)};
100
+ cursor: ${({ disabled })=>disabled ? "not-allowed" : "pointer"};
101
+ opacity: ${({ disabled })=>disabled ? "0.5" : "1"};
102
+ outline: none;
103
+ transition: box-shadow 0.2s;
104
+
105
+ &:focus-within {
106
+ box-shadow: 0px 0px 0px 2px
107
+ ${({ feedback })=>feedback ? getFeedbackColor(feedback) : COLOR_NEUTRAL_DARK};
108
+ }
109
+
110
+ ${({ $active, feedback })=>$active && `
111
+ box-shadow: 0px 0px 0px 2px ${feedback ? getFeedbackColor(feedback) : COLOR_NEUTRAL_DARK};
112
+ `}
113
+ }
114
+
115
+ .rs-date-range-input {
116
+ border: none;
117
+ box-sizing: border-box;
118
+ color: ${COLOR_NEUTRAL_DUSK};
119
+ font-family: "Inter", sans-serif;
120
+ font-size: 1rem;
121
+ font-weight: 500;
122
+ height: 2.5rem;
123
+ line-height: 1rem;
124
+ outline: none;
125
+ padding: 0.5rem 3rem 0.5rem ${({ $icon })=>$icon ? "3rem" : "1rem"};
126
+ width: 100%;
127
+
128
+ &::placeholder {
129
+ color: ${COLOR_NEUTRAL_MEDIUM};
130
+ }
131
+ }
132
+
133
+ .rs-picker-header-date {
134
+ color: ${COLOR_NEUTRAL_DUSK};
135
+ }
136
+ `;
137
+ const IconContainer = styled_components.div`
138
+ display: flex;
139
+ align-items: center;
140
+ justify-content: center;
141
+ flex-shrink: 0;
142
+ top: 0.5rem;
143
+ left: 1rem;
144
+ position: absolute;
145
+ z-index: 1;
146
+ `;
147
+ export { DateRangePickerContainer, DateRangePickerGlobalStyles, DateRangePickerWrapper, IconContainer, LabelContainer };
@@ -0,0 +1,3 @@
1
+ import type { DateRange as RsuiteDateRange } from "rsuite/esm/DateRangePicker";
2
+ export type DateRange = RsuiteDateRange;
3
+ export type LocaleCode = "pt-BR" | "en-US" | "es-ES";
@@ -0,0 +1,50 @@
1
+ import { MouseEventHandler as ReactMouseEventHandler, JSX } from "react";
2
+ import { IconsNames } from "@ftdata/f-icons";
3
+ export type DropdownOption = {
4
+ label: string;
5
+ action: ReactMouseEventHandler<HTMLSpanElement>;
6
+ };
7
+ export type ButtonVariants = "primary" | "secondary" | "ghost" | "danger" | "success" | "warning";
8
+ export type ButtonSizes = "small" | "medium" | "large";
9
+ export interface ButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
10
+ /** Define o texto do botão */
11
+ text: string;
12
+ /** Define se o botão é um seletor (dropdown). */
13
+ selectable?: {
14
+ /** Define se é selecionavel */
15
+ active: boolean;
16
+ /** componente de dropdown. */
17
+ dropdown?: JSX.Element;
18
+ /** Opções do dropdown, exibidas quando `select` é `true`. */
19
+ options?: DropdownOption[];
20
+ };
21
+ /** Define o estilo visual do botão. */
22
+ variant: ButtonVariants;
23
+ /** Define o tamanho do botão.
24
+ * @default 'medium'
25
+ */
26
+ size?: ButtonSizes;
27
+ /** Define se o botão está desabilitado. */
28
+ disabled?: boolean;
29
+ /**
30
+ * Ícone à esquerda do botão.
31
+ * Pode ser passado como string (`IconsNames`) ou um elemento JSX.
32
+ */
33
+ LeftIcon?: IconsNames | JSX.Element;
34
+ /**
35
+ * Ícone à direita do botão.
36
+ * Pode ser passado como string (`IconsNames`) ou um elemento JSX.
37
+ */
38
+ RightIcon?: IconsNames | JSX.Element;
39
+ /** Define se o botão está em estado de carregamento. */
40
+ loading?: boolean;
41
+ /** Função chamada ao clicar no botão. */
42
+ onClick: ReactMouseEventHandler<HTMLButtonElement>;
43
+ /** Define o tipo do botão (`button`, `submit` ou `reset`).
44
+ * @default 'button'
45
+ */
46
+ type?: "button" | "submit" | "reset";
47
+ /** Define se o botão ocupa 100% do container (wide). */
48
+ wide?: boolean;
49
+ }
50
+ export default function Button({ disabled, variant, LeftIcon, RightIcon, loading, onClick, selectable, wide, text, type, size, ...rest }: ButtonProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,105 @@
1
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
+ import { useLayoutEffect, useRef, useState } from "react";
3
+ import { ButtonWrapper, DropdownContainer, Spinner } from "./styles.js";
4
+ import { Icon } from "@ftdata/f-icons";
5
+ const LoadingTheme = {
6
+ primary: "dark",
7
+ secondary: "light",
8
+ ghost: "light",
9
+ danger: "dark",
10
+ success: "dark",
11
+ warning: "dark"
12
+ };
13
+ function Button({ disabled, variant, LeftIcon, RightIcon, loading, onClick, selectable, wide, text, type = "button", size = "medium", ...rest }) {
14
+ const [isOpen, setIsOpen] = useState(false);
15
+ const wrapperRef = useRef(null);
16
+ useLayoutEffect(()=>{
17
+ function handleClickOutside(e) {
18
+ if (wrapperRef.current && !wrapperRef.current.contains(e.target)) setIsOpen(false);
19
+ }
20
+ document.addEventListener("click", handleClickOutside);
21
+ return ()=>document.removeEventListener("click", handleClickOutside);
22
+ }, []);
23
+ const buttonHandler = (e)=>{
24
+ if (disabled || loading) return;
25
+ if (selectable?.active) return void setIsOpen((prev)=>!prev);
26
+ onClick(e);
27
+ };
28
+ const handleClickOption = (e, action)=>{
29
+ e.stopPropagation();
30
+ action(e);
31
+ setIsOpen(false);
32
+ };
33
+ const renderIcon = (icon, size)=>{
34
+ if (!icon) return null;
35
+ if ("string" == typeof icon) return /*#__PURE__*/ jsx(Icon, {
36
+ name: icon,
37
+ size: "small" === size ? "1rem" : "1.5rem"
38
+ });
39
+ return icon;
40
+ };
41
+ return /*#__PURE__*/ jsx(Fragment, {
42
+ children: /*#__PURE__*/ jsxs(ButtonWrapper, {
43
+ type: type,
44
+ variant: variant,
45
+ disabled: disabled,
46
+ onClick: buttonHandler,
47
+ size: size,
48
+ $wide: wide,
49
+ ref: wrapperRef,
50
+ selectable: selectable?.active,
51
+ ...rest,
52
+ children: [
53
+ loading ? /*#__PURE__*/ jsx(Spinner, {
54
+ size: "sm",
55
+ variant: LoadingTheme[variant]
56
+ }) : /*#__PURE__*/ jsxs(Fragment, {
57
+ children: [
58
+ selectable?.active ? /*#__PURE__*/ jsxs("div", {
59
+ className: "button-init-wrapper",
60
+ children: [
61
+ renderIcon(LeftIcon, size),
62
+ /*#__PURE__*/ jsx("span", {
63
+ children: text
64
+ })
65
+ ]
66
+ }) : /*#__PURE__*/ jsxs(Fragment, {
67
+ children: [
68
+ renderIcon(LeftIcon, size),
69
+ /*#__PURE__*/ jsx("span", {
70
+ children: text
71
+ })
72
+ ]
73
+ }),
74
+ selectable?.active && /*#__PURE__*/ jsx(Icon, {
75
+ name: "arw caret-down",
76
+ size: "small" === size ? "1rem" : "1.5rem",
77
+ className: `button-icon ${isOpen ? "open" : ""}`
78
+ }),
79
+ !selectable?.active && /*#__PURE__*/ jsx(Fragment, {
80
+ children: renderIcon(RightIcon, size)
81
+ })
82
+ ]
83
+ }),
84
+ selectable?.active && isOpen && !selectable?.dropdown && /*#__PURE__*/ jsxs(DropdownContainer, {
85
+ children: [
86
+ /*#__PURE__*/ jsx("span", {
87
+ children: text
88
+ }),
89
+ selectable?.options?.map(({ action, label }, index)=>/*#__PURE__*/ jsx("span", {
90
+ className: "button-select-hoverable",
91
+ onClick: (e)=>handleClickOption(e, action),
92
+ children: label
93
+ }, index))
94
+ ]
95
+ }),
96
+ selectable?.active && isOpen && selectable?.dropdown && /*#__PURE__*/ jsx(Fragment, {
97
+ children: /*#__PURE__*/ jsx(DropdownContainer, {
98
+ children: selectable.dropdown
99
+ })
100
+ })
101
+ ]
102
+ })
103
+ });
104
+ }
105
+ export { Button as default };
@@ -0,0 +1,9 @@
1
+ export type ButtonColorModifiersType = {
2
+ primary: string;
3
+ secondary: string;
4
+ danger: string;
5
+ success: string;
6
+ warning: string;
7
+ ghost: string;
8
+ };
9
+ export declare const BUTTON_COLOR_MODIFIERS: ButtonColorModifiersType;
@@ -0,0 +1,96 @@
1
+ import { COLOR_BRAND_DARK, COLOR_BRAND_DARKER, COLOR_BRAND_LIGHT, COLOR_BRAND_MEDIUM, COLOR_DANGER_DARK, COLOR_DANGER_DARKER, COLOR_DANGER_MEDIUM, COLOR_NEUTRAL_DARKER, COLOR_NEUTRAL_DAY, COLOR_NEUTRAL_DUSK, COLOR_NEUTRAL_LIGHTER, COLOR_NEUTRAL_MEDIUM, COLOR_SUCCESS_DARK, COLOR_SUCCESS_DARKER, COLOR_SUCCESS_MEDIUM, COLOR_WARNING_DARK, COLOR_WARNING_DARKER, COLOR_WARNING_MEDIUM, OPACITY_LEVEL_MEDIUM } from "@ftdata/f-tokens";
2
+ const BUTTON_COLOR_MODIFIERS = {
3
+ primary: `
4
+ background-color: ${COLOR_BRAND_MEDIUM};
5
+ color: ${COLOR_NEUTRAL_DAY};
6
+
7
+ &:not(:disabled):hover {
8
+ background-color: ${COLOR_BRAND_DARK};
9
+ }
10
+
11
+ &:not(:disabled):active {
12
+ background-color: ${COLOR_BRAND_DARKER};
13
+ }
14
+
15
+ &:disabled {
16
+ opacity: ${OPACITY_LEVEL_MEDIUM};
17
+ }
18
+ `,
19
+ secondary: `
20
+ background-color: ${COLOR_NEUTRAL_LIGHTER};
21
+ color: ${COLOR_NEUTRAL_DUSK};
22
+
23
+ &:not(:disabled):hover {
24
+ color: ${COLOR_BRAND_LIGHT};
25
+ }
26
+
27
+ &:not(:disabled):active {
28
+ color: ${COLOR_BRAND_MEDIUM};
29
+ }
30
+
31
+ &:disabled {
32
+ color: ${COLOR_NEUTRAL_MEDIUM};
33
+ }
34
+ `,
35
+ danger: `
36
+ background-color: ${COLOR_DANGER_MEDIUM};
37
+ color: ${COLOR_NEUTRAL_DAY};
38
+
39
+ &:not(:disabled):hover {
40
+ background-color: ${COLOR_DANGER_DARK};
41
+ }
42
+
43
+ &:not(:disabled):active {
44
+ background-color: ${COLOR_DANGER_DARKER};
45
+ }
46
+
47
+ &:disabled {
48
+ opacity: ${OPACITY_LEVEL_MEDIUM};
49
+ }
50
+ `,
51
+ success: `
52
+ background-color: ${COLOR_SUCCESS_MEDIUM};
53
+ color: ${COLOR_NEUTRAL_DAY};
54
+
55
+ &:not(:disabled):hover {
56
+ background-color: ${COLOR_SUCCESS_DARK};
57
+ }
58
+
59
+ &:not(:disabled):active {
60
+ background-color: ${COLOR_SUCCESS_DARKER};
61
+ }
62
+
63
+ &:disabled {
64
+ opacity: ${OPACITY_LEVEL_MEDIUM};
65
+ }
66
+ `,
67
+ warning: `
68
+ background-color: ${COLOR_WARNING_MEDIUM};
69
+ color: ${COLOR_NEUTRAL_DAY};
70
+
71
+ &:not(:disabled):hover {
72
+ background-color: ${COLOR_WARNING_DARK};
73
+ }
74
+
75
+ &:not(:disabled):active {
76
+ background-color: ${COLOR_WARNING_DARKER};
77
+ }
78
+
79
+ &:disabled {
80
+ opacity: ${OPACITY_LEVEL_MEDIUM};
81
+ }
82
+ `,
83
+ ghost: `
84
+ background-color: transparent;
85
+ color: ${COLOR_NEUTRAL_DUSK};
86
+
87
+ &:not(:disabled):hover {
88
+ color: ${COLOR_NEUTRAL_DARKER};
89
+ }
90
+
91
+ &:disabled {
92
+ color: ${COLOR_NEUTRAL_MEDIUM};
93
+ }
94
+ `
95
+ };
96
+ export { BUTTON_COLOR_MODIFIERS };
@@ -0,0 +1,5 @@
1
+ export declare const BUTTON_SIZE_MODIFIERS: {
2
+ small: string;
3
+ medium: string;
4
+ large: string;
5
+ };
@@ -0,0 +1,22 @@
1
+ import { FONT_RELATIVE_SIZE_LG, FONT_RELATIVE_SIZE_MD, FONT_RELATIVE_SIZE_SM, SPACING_REALTIVE_STACK_02, SPACING_RELATIVE_INLINE_03 } from "@ftdata/f-tokens";
2
+ const BUTTON_SIZE_MODIFIERS = {
3
+ small: `
4
+ font-size: ${FONT_RELATIVE_SIZE_SM};
5
+ line-height: 1.125rem;
6
+ height: 2rem;
7
+ padding: ${SPACING_REALTIVE_STACK_02} ${SPACING_RELATIVE_INLINE_03};
8
+ `,
9
+ medium: `
10
+ font-size: ${FONT_RELATIVE_SIZE_MD};
11
+ line-height: 1.5rem;
12
+ height: 2.5rem;
13
+ padding: ${SPACING_REALTIVE_STACK_02} ${SPACING_RELATIVE_INLINE_03};
14
+ `,
15
+ large: `
16
+ font-size: ${FONT_RELATIVE_SIZE_LG};
17
+ line-height: 1.5rem;
18
+ height: 3rem;
19
+ padding: ${SPACING_RELATIVE_INLINE_03} ${SPACING_RELATIVE_INLINE_03};
20
+ `
21
+ };
22
+ export { BUTTON_SIZE_MODIFIERS };
@@ -0,0 +1,20 @@
1
+ import type { ButtonSizes, ButtonVariants } from ".";
2
+ type WrapperProps = {
3
+ $wide?: boolean;
4
+ selectable?: boolean;
5
+ size: ButtonSizes;
6
+ variant?: ButtonVariants;
7
+ };
8
+ export declare const ButtonWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, WrapperProps>> & string;
9
+ export declare const DropdownContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
10
+ type SpinnerProps = {
11
+ variant: string;
12
+ };
13
+ export declare const Spinner: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("styled-components").FastOmit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>, keyof import("react").HTMLAttributes<HTMLDivElement> | keyof {
14
+ variant: "dark" | "light";
15
+ size: "sm" | "md" | "lg" | "xl";
16
+ }> & {
17
+ variant: "dark" | "light";
18
+ size: "sm" | "md" | "lg" | "xl";
19
+ } & import("react").HTMLAttributes<HTMLDivElement>, SpinnerProps>> & string;
20
+ export {};
@@ -0,0 +1,105 @@
1
+ import styled_components, { keyframes } from "styled-components";
2
+ import { BORDER_RELATIVE_RADIUS_SM, COLOR_BRAND_MEDIUM, COLOR_NEUTRAL_DARKER, COLOR_NEUTRAL_DUSK, COLOR_NEUTRAL_LIGHT, COLOR_NEUTRAL_LIGHTER, SHADOW_LEVEL_02, SPACING_REALTIVE_STACK_02, SPACING_STACK_02 } from "@ftdata/f-tokens";
3
+ import { BUTTON_COLOR_MODIFIERS } from "./modifiers/color.js";
4
+ import { BUTTON_SIZE_MODIFIERS } from "./modifiers/size.js";
5
+ import Loading from "../../Loading/index.js";
6
+ const ButtonWrapper = styled_components.button`
7
+ box-sizing: border-box;
8
+ align-items: center;
9
+ border: none;
10
+ border-radius: ${BORDER_RELATIVE_RADIUS_SM};
11
+ cursor: pointer;
12
+ display: inline-flex;
13
+ gap: 0.5rem;
14
+ justify-content: ${({ selectable })=>selectable ? "space-between" : "center"};
15
+ transition: all 0.15s ease;
16
+ position: relative;
17
+ outline: none;
18
+ font-weight: 500;
19
+
20
+ &:disabled {
21
+ cursor: not-allowed;
22
+ }
23
+
24
+ &:disabled:hover,
25
+ &:disabled:active {
26
+ cursor: not-allowed;
27
+ transform: none;
28
+ box-shadow: none;
29
+ }
30
+
31
+ * {
32
+ box-sizing: border-box;
33
+ }
34
+
35
+ ${({ variant })=>variant && BUTTON_COLOR_MODIFIERS[variant]};
36
+ ${({ size })=>size && BUTTON_SIZE_MODIFIERS[size]};
37
+ ${({ $wide })=>$wide ? "width: 100%;" : "width: fit-content;"};
38
+
39
+ .button-init-wrapper {
40
+ display: flex;
41
+ align-items: center;
42
+ gap: 0.5rem;
43
+ flex-direction: row;
44
+ }
45
+
46
+ .button-icon {
47
+ transition: transform 0.2s ease;
48
+ }
49
+
50
+ .button-icon.open {
51
+ transform: rotate(180deg);
52
+ }
53
+ `;
54
+ const dropdownAnimation = keyframes`
55
+ from {
56
+ opacity: 0;
57
+ transform: translateY(-5px);
58
+ }
59
+ to {
60
+ opacity: 1;
61
+ transform: translateY(0);
62
+ }
63
+ `;
64
+ const DropdownContainer = styled_components.div`
65
+ box-shadow: ${SHADOW_LEVEL_02} ${COLOR_NEUTRAL_LIGHT};
66
+ display: flex;
67
+ flex-direction: column;
68
+ left: 0;
69
+ padding: ${SPACING_REALTIVE_STACK_02} 0;
70
+ position: absolute;
71
+ top: calc(100% + ${SPACING_STACK_02});
72
+ z-index: 10;
73
+ overflow-y: auto;
74
+ white-space: nowrap;
75
+ animation: ${dropdownAnimation} 0.15s ease-out;
76
+ max-height: 200px;
77
+ min-width: 14.375rem;
78
+ width: 100%;
79
+
80
+ span {
81
+ box-sizing: border-box;
82
+ display: inline-flex;
83
+ height: 2.25rem;
84
+ color: ${COLOR_NEUTRAL_DUSK};
85
+ padding: 0.5rem 1rem;
86
+ white-space: nowrap;
87
+ overflow-y: hidden;
88
+ text-overflow: ellipsis;
89
+ font-weight: 500;
90
+ }
91
+
92
+ .button-select-hoverable {
93
+ color: ${COLOR_NEUTRAL_DARKER};
94
+ cursor: pointer;
95
+
96
+ &:hover {
97
+ background-color: ${COLOR_NEUTRAL_LIGHTER};
98
+ color: ${COLOR_NEUTRAL_DUSK};
99
+ }
100
+ }
101
+ `;
102
+ const Spinner = styled_components(Loading)`
103
+ background-color: ${({ variant })=>"dark" === variant ? COLOR_BRAND_MEDIUM : COLOR_NEUTRAL_LIGHTER};
104
+ `;
105
+ export { ButtonWrapper, DropdownContainer, Spinner };
@@ -4,22 +4,26 @@ export type ModalSizeCustom = {
4
4
  height: string;
5
5
  };
6
6
  export type ModalSizes = "small" | "medium" | "large" | ModalSizeCustom;
7
- export type ModalAction = {
8
- onClick: () => void;
9
- label: string;
10
- shouldClose?: boolean;
11
- disabled?: boolean;
12
- };
7
+ export type ModalFeedbacks = "danger" | "warning" | "success" | "default";
13
8
  export type ModalActions = {
14
- primary?: ModalAction;
15
- secondary?: ModalAction;
9
+ primary?: {
10
+ onClick: () => void;
11
+ label: string;
12
+ shouldClose?: boolean;
13
+ };
14
+ secondary?: {
15
+ onClick: () => void;
16
+ label: string;
17
+ shouldClose?: boolean;
18
+ };
16
19
  };
17
20
  export interface ModalProps extends HTMLAttributes<HTMLDivElement> {
18
21
  children: ReactNode;
19
22
  size?: ModalSizes;
23
+ feedback?: ModalFeedbacks;
20
24
  title?: string;
21
25
  message?: string;
22
26
  closeHandler: () => void;
23
27
  actions?: ModalActions;
24
28
  }
25
- export default function Modal({ children, size, title, message, closeHandler, actions, }: ModalProps): import("react/jsx-runtime").JSX.Element;
29
+ export default function Modal({ children, size, feedback, title, message, closeHandler, actions, }: ModalProps): import("react/jsx-runtime").JSX.Element;
@@ -3,9 +3,15 @@ import { useCallback, useState } from "react";
3
3
  import { ActionsContainer, ContentContainer, ModalContainer } from "./styles.js";
4
4
  import { Title } from "../Texts/titles.js";
5
5
  import { Paragraph } from "../Texts/paragraphs.js";
6
- import Button from "../Button/index.js";
6
+ import Button from "./Button/index.js";
7
7
  import IconButton from "../IconButton/index.js";
8
- function Modal({ children, size, title, message, closeHandler, actions }) {
8
+ const BUTTON_FEEDBACK = {
9
+ default: "primary",
10
+ danger: "danger",
11
+ warning: "warning",
12
+ success: "success"
13
+ };
14
+ function Modal({ children, size, feedback, title, message, closeHandler, actions }) {
9
15
  const [isClosing, setIsClosing] = useState(false);
10
16
  const handleClose = useCallback(()=>{
11
17
  setIsClosing(true);
@@ -52,14 +58,14 @@ function Modal({ children, size, title, message, closeHandler, actions }) {
52
58
  actions.secondary && /*#__PURE__*/ jsx(Button, {
53
59
  onClick: ()=>handleActionClick(actions.secondary),
54
60
  type: "button",
55
- variant: "secondary",
56
- children: actions.secondary.label
61
+ text: actions.secondary.label,
62
+ variant: "secondary"
57
63
  }),
58
64
  actions.primary && /*#__PURE__*/ jsx(Button, {
59
65
  onClick: ()=>handleActionClick(actions.primary),
60
66
  type: "button",
61
- variant: "primary",
62
- children: actions.primary.label
67
+ text: actions.primary.label,
68
+ variant: BUTTON_FEEDBACK[feedback || "default"]
63
69
  })
64
70
  ]
65
71
  })
@@ -1,4 +1,4 @@
1
- import { ModalProps, ModalSizes } from '.';
1
+ import { ModalProps, ModalSizes } from ".";
2
2
  export declare const getSize: (size?: ModalSizes) => import("styled-components").RuleSet<object> | undefined;
3
3
  export declare const ModalOverlay: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
4
4
  export declare const ModalContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Partial<ModalProps> & {