@ftdata/ui 0.0.15 → 0.0.17
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/Collapse/styles.js +2 -0
- package/dist/components/IconButton/index.d.ts +15 -0
- package/dist/components/IconButton/index.js +37 -0
- package/dist/components/IconButton/modifiers/color.d.ts +36 -0
- package/dist/components/IconButton/modifiers/color.js +38 -0
- package/dist/components/IconButton/styles.d.ts +10 -0
- package/dist/components/IconButton/styles.js +32 -0
- package/dist/components/Menu/constants/icons.d.ts +2 -16
- package/dist/components/Menu/constants/icons.js +13 -58
- package/dist/components/Menu/helpers/createMenus.js +13 -6
- package/dist/components/Menu/helpers/createSubMenus.d.ts +1 -1
- package/dist/components/Menu/helpers/createSubMenus.js +1 -1
- package/dist/components/Menu/helpers/generateColorScale.js +2 -2
- package/dist/components/Menu/helpers/getLuminance.d.ts +1 -1
- package/dist/components/Menu/helpers/getLuminance.js +2 -2
- package/dist/components/Menu/index.d.ts +1 -1
- package/dist/components/Menu/index.js +18 -31
- package/dist/components/Menu/styles.d.ts +0 -1
- package/dist/components/Menu/styles.js +29 -45
- package/dist/components/Menu/types/IconKeysType.d.ts +1 -1
- package/dist/components/Menu/types/MenuItem.d.ts +3 -2
- package/dist/components/Modal/index.d.ts +25 -0
- package/dist/components/Modal/index.js +69 -0
- package/dist/components/Modal/styles.d.ts +8 -0
- package/dist/components/Modal/styles.js +81 -0
- package/dist/components/MultiSelect/components/Badge/index.d.ts +2 -1
- package/dist/components/MultiSelect/components/Badge/index.js +5 -2
- package/dist/components/MultiSelect/components/Badge/styles.d.ts +5 -1
- package/dist/components/MultiSelect/components/Badge/styles.js +2 -1
- package/dist/components/MultiSelect/components/MultiSelectList/Row/index.d.ts +3 -2
- package/dist/components/MultiSelect/components/MultiSelectList/Row/index.js +21 -10
- package/dist/components/MultiSelect/components/MultiSelectList/Row/style.js +0 -1
- package/dist/components/MultiSelect/components/MultiSelectList/index.d.ts +3 -3
- package/dist/components/MultiSelect/components/MultiSelectList/index.js +8 -11
- package/dist/components/MultiSelect/components/MultiSelectList/style.d.ts +1 -1
- package/dist/components/MultiSelect/components/MultiSelectList/style.js +21 -3
- package/dist/components/MultiSelect/helpers/addOption.d.ts +3 -3
- package/dist/components/MultiSelect/helpers/computeUnselected.d.ts +1 -1
- package/dist/components/MultiSelect/helpers/computeUnselected.js +1 -1
- package/dist/components/MultiSelect/helpers/feedbackText.d.ts +1 -1
- package/dist/components/MultiSelect/helpers/feedbackText.js +9 -9
- package/dist/components/MultiSelect/helpers/filterOptions.d.ts +1 -1
- package/dist/components/MultiSelect/helpers/removeOptions.d.ts +3 -3
- package/dist/components/MultiSelect/index.d.ts +37 -19
- package/dist/components/MultiSelect/index.js +92 -135
- package/dist/components/MultiSelect/styles.js +8 -23
- package/dist/components/Texts/paragraphs.d.ts +12 -0
- package/dist/components/Texts/paragraphs.js +14 -0
- package/dist/components/Texts/text.d.ts +17 -0
- package/dist/components/Texts/text.js +21 -0
- package/dist/components/Texts/titles.d.ts +7 -0
- package/dist/components/Texts/titles.js +37 -0
- package/dist/components/fields/modifiers/selectColorModifier.d.ts +1 -1
- package/dist/components/fields/modifiers/selectColorModifier.js +7 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +4 -2
- package/package.json +3 -3
- package/dist/components/Collapse/Colapse.stories.d.ts +0 -10
- package/dist/components/Collapse/Colapse.stories.js +0 -108
- package/dist/components/Menu/Menu.stories.d.ts +0 -6
- package/dist/components/Menu/Menu.stories.js +0 -116
- package/dist/components/MultiSelect/helpers/arraysEqual.d.ts +0 -2
- package/dist/components/MultiSelect/helpers/arraysEqual.js +0 -5
- package/dist/components/MultiSelect/helpers/computeSelected.d.ts +0 -2
- package/dist/components/MultiSelect/helpers/computeSelected.js +0 -2
- package/dist/components/MultiSelect/helpers/getChangedFieds.d.ts +0 -2
- package/dist/components/MultiSelect/helpers/getChangedFieds.js +0 -17
- package/dist/components/MultiSelect/hooks/useMultiSelect.d.ts +0 -10
- package/dist/components/MultiSelect/hooks/useMultiSelect.js +0 -44
- package/dist/components/MultiSelect/interfaces/actions.d.ts +0 -4
- package/dist/components/MultiSelect/interfaces/actions.js +0 -0
- package/dist/components/MultiSelect/interfaces/config.d.ts +0 -17
- package/dist/components/MultiSelect/interfaces/config.js +0 -0
- package/dist/components/MultiSelect/interfaces/state.d.ts +0 -10
- package/dist/components/MultiSelect/interfaces/state.js +0 -0
- package/dist/components/MultiSelect/reducers/stateReducer.d.ts +0 -21
- package/dist/components/MultiSelect/reducers/stateReducer.js +0 -44
- package/dist/components/Text/Paragraph/Paragraph.stories.d.ts +0 -29
- package/dist/components/Text/Paragraph/Paragraph.stories.js +0 -124
- package/dist/components/Text/Title/Title.stories.d.ts +0 -41
- package/dist/components/Text/Title/Title.stories.js +0 -106
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import index from "./index.js";
|
|
3
|
-
import { COLOR_CUSTOM_COLUMNBG } from "@ftdata/f-tokens";
|
|
4
|
-
import { Paragraph } from "../Text/index.js";
|
|
5
|
-
const Element = /*#__PURE__*/ jsx("div", {
|
|
6
|
-
style: {
|
|
7
|
-
backgroundColor: "#FF5656",
|
|
8
|
-
fontFamily: "sans-serif",
|
|
9
|
-
border: "none",
|
|
10
|
-
borderRadius: "10px",
|
|
11
|
-
height: "10rem",
|
|
12
|
-
color: "#f5f5f5",
|
|
13
|
-
fontWeight: "800",
|
|
14
|
-
display: "flex",
|
|
15
|
-
alignItems: "center",
|
|
16
|
-
justifyContent: "center",
|
|
17
|
-
marginTop: "1rem"
|
|
18
|
-
},
|
|
19
|
-
children: "Elemento"
|
|
20
|
-
});
|
|
21
|
-
const defaultExample = /*#__PURE__*/ jsx(Paragraph, {
|
|
22
|
-
size: "sm",
|
|
23
|
-
children: "Este \xe9 o conte\xfado exibido dentro do Collapse."
|
|
24
|
-
});
|
|
25
|
-
const firstExample = /*#__PURE__*/ jsxs("div", {
|
|
26
|
-
children: [
|
|
27
|
-
Element,
|
|
28
|
-
Element
|
|
29
|
-
]
|
|
30
|
-
});
|
|
31
|
-
const meta = {
|
|
32
|
-
title: "DESIGN COMPONENTS/Collapse",
|
|
33
|
-
component: index,
|
|
34
|
-
tags: [
|
|
35
|
-
"autodocs"
|
|
36
|
-
],
|
|
37
|
-
parameters: {
|
|
38
|
-
layout: "centered"
|
|
39
|
-
},
|
|
40
|
-
decorators: [
|
|
41
|
-
(Story)=>/*#__PURE__*/ jsx("div", {
|
|
42
|
-
style: {
|
|
43
|
-
width: "300px"
|
|
44
|
-
},
|
|
45
|
-
children: /*#__PURE__*/ jsx(Story, {})
|
|
46
|
-
})
|
|
47
|
-
],
|
|
48
|
-
argTypes: {
|
|
49
|
-
title: {
|
|
50
|
-
description: "Define o t\xedtulo do Collpase.",
|
|
51
|
-
table: {
|
|
52
|
-
type: {
|
|
53
|
-
summary: "string | JSX.Element"
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
showCollapse: {
|
|
58
|
-
description: "Define se o Collapse est\xe1 aberto ou fechado."
|
|
59
|
-
},
|
|
60
|
-
margin: {
|
|
61
|
-
description: "Define a margem do Collapse."
|
|
62
|
-
},
|
|
63
|
-
iconColor: {
|
|
64
|
-
description: "Define a cor do icone do Collapse."
|
|
65
|
-
},
|
|
66
|
-
iconCavet: {
|
|
67
|
-
description: "Define a posi\xe7\xe3o do \xedcone do Collapse."
|
|
68
|
-
},
|
|
69
|
-
children: {
|
|
70
|
-
control: {
|
|
71
|
-
type: "select"
|
|
72
|
-
},
|
|
73
|
-
description: "Recebe o que ser\xe1 exibido dentro do Collapse.",
|
|
74
|
-
mapping: {
|
|
75
|
-
"Default Example": defaultExample,
|
|
76
|
-
"First Example": firstExample
|
|
77
|
-
},
|
|
78
|
-
options: [
|
|
79
|
-
"Deafault Example",
|
|
80
|
-
"First Example"
|
|
81
|
-
]
|
|
82
|
-
},
|
|
83
|
-
handleChange: {
|
|
84
|
-
description: "Recebe uma fun\xe7\xe3o respons\xe1vel em lidar com as altera\xe7\xf5es da visibilidade do Collapse."
|
|
85
|
-
},
|
|
86
|
-
fontSyze: {
|
|
87
|
-
description: "Define o tamanho da fonte do Collapse."
|
|
88
|
-
},
|
|
89
|
-
maxHeight: {
|
|
90
|
-
description: "Define o tamanho m\xe1ximo do children do Collapse."
|
|
91
|
-
},
|
|
92
|
-
espacamentoTitleIcon: {
|
|
93
|
-
description: "Define o espa\xe7amento entre o titulo e o \xedcone"
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
const Colapse_stories = meta;
|
|
98
|
-
const Default = {
|
|
99
|
-
args: {
|
|
100
|
-
title: "Collapse",
|
|
101
|
-
showCollapse: false,
|
|
102
|
-
margin: "0",
|
|
103
|
-
iconColor: COLOR_CUSTOM_COLUMNBG,
|
|
104
|
-
iconCavet: "left",
|
|
105
|
-
children: defaultExample
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
export { Default, Colapse_stories as default };
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import index from "./index.js";
|
|
3
|
-
import { Icon } from "@ftdata/f-icons";
|
|
4
|
-
const meta = {
|
|
5
|
-
title: "Components/Menu",
|
|
6
|
-
component: index,
|
|
7
|
-
argTypes: {
|
|
8
|
-
background: {
|
|
9
|
-
control: "color"
|
|
10
|
-
},
|
|
11
|
-
fontcolor: {
|
|
12
|
-
control: "color"
|
|
13
|
-
},
|
|
14
|
-
subMenusBackground: {
|
|
15
|
-
control: "color"
|
|
16
|
-
},
|
|
17
|
-
active: {
|
|
18
|
-
control: "text"
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
const Menu_stories = meta;
|
|
23
|
-
const mockLogo = /*#__PURE__*/ jsx(Icon, {
|
|
24
|
-
name: "ui airplay-signal",
|
|
25
|
-
width: "2rem"
|
|
26
|
-
});
|
|
27
|
-
const mockItems = [
|
|
28
|
-
{
|
|
29
|
-
id: 1,
|
|
30
|
-
description: "Dashboard principal",
|
|
31
|
-
endpoint: "/dashboard",
|
|
32
|
-
itens: [
|
|
33
|
-
{
|
|
34
|
-
id: 11,
|
|
35
|
-
description: "Relat\xf3rios",
|
|
36
|
-
endpoint: "/dashboard/reports",
|
|
37
|
-
itens: [
|
|
38
|
-
{
|
|
39
|
-
id: 12,
|
|
40
|
-
description: "Estat\xedsticas",
|
|
41
|
-
endpoint: "/dashboard/statistics",
|
|
42
|
-
itens: [],
|
|
43
|
-
menu_icon: "ui statistics",
|
|
44
|
-
translate_key: "changelog",
|
|
45
|
-
ordenation: 2
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
id: 12,
|
|
49
|
-
description: "Estat\xedsticas",
|
|
50
|
-
endpoint: "/dashboard/statistics",
|
|
51
|
-
itens: [],
|
|
52
|
-
menu_icon: "ui statistics",
|
|
53
|
-
translate_key: "changelog",
|
|
54
|
-
ordenation: 2
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
id: 12,
|
|
58
|
-
description: "Estat\xedsticas",
|
|
59
|
-
endpoint: "/dashboard/statistics",
|
|
60
|
-
itens: [],
|
|
61
|
-
menu_icon: "ui statistics",
|
|
62
|
-
translate_key: "changelog",
|
|
63
|
-
ordenation: 2
|
|
64
|
-
}
|
|
65
|
-
],
|
|
66
|
-
menu_icon: "ui report",
|
|
67
|
-
translate_key: "reports",
|
|
68
|
-
ordenation: 1
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
id: 12,
|
|
72
|
-
description: "Estat\xedsticas",
|
|
73
|
-
endpoint: "/dashboard/statistics",
|
|
74
|
-
itens: [],
|
|
75
|
-
menu_icon: "ui statistics",
|
|
76
|
-
translate_key: "changelog",
|
|
77
|
-
ordenation: 2
|
|
78
|
-
}
|
|
79
|
-
],
|
|
80
|
-
menu_icon: "ui dashboard",
|
|
81
|
-
translate_key: "dashboard",
|
|
82
|
-
ordenation: 1
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
id: 2,
|
|
86
|
-
description: "Configura\xe7\xf5es do sistema",
|
|
87
|
-
endpoint: "/settings",
|
|
88
|
-
itens: [],
|
|
89
|
-
menu_icon: "ui settings",
|
|
90
|
-
translate_key: "settings",
|
|
91
|
-
ordenation: 2
|
|
92
|
-
}
|
|
93
|
-
];
|
|
94
|
-
const mockTranslate = (key)=>{
|
|
95
|
-
const dict = {
|
|
96
|
-
menu: "Menu",
|
|
97
|
-
dashboard: "Dashboard",
|
|
98
|
-
settings: "Configura\xe7\xf5es",
|
|
99
|
-
back: "Voltar",
|
|
100
|
-
reports: "Relat\xf3rios",
|
|
101
|
-
statistics: "Estat\xedsticas"
|
|
102
|
-
};
|
|
103
|
-
return dict[key] || key;
|
|
104
|
-
};
|
|
105
|
-
const Default = {
|
|
106
|
-
args: {
|
|
107
|
-
background: "#222",
|
|
108
|
-
fontcolor: "#fff",
|
|
109
|
-
subMenusBackground: "#333",
|
|
110
|
-
logo: mockLogo,
|
|
111
|
-
items: mockItems,
|
|
112
|
-
translate: mockTranslate,
|
|
113
|
-
active: "dashboard"
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
export { Default, Menu_stories as default };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { arraysEqual } from "./arraysEqual.js";
|
|
2
|
-
const FIELDS = [
|
|
3
|
-
"selected",
|
|
4
|
-
"options",
|
|
5
|
-
"filtered",
|
|
6
|
-
"unselected"
|
|
7
|
-
];
|
|
8
|
-
function getChangedFields(base, compare) {
|
|
9
|
-
const changed = [];
|
|
10
|
-
FIELDS.forEach((key)=>{
|
|
11
|
-
const last = base[key] || [];
|
|
12
|
-
const next = compare[key] || [];
|
|
13
|
-
if (arraysEqual(last, next)) changed.push(key);
|
|
14
|
-
});
|
|
15
|
-
return changed;
|
|
16
|
-
}
|
|
17
|
-
export { getChangedFields };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { IMultiSelectState } from "../interfaces/state";
|
|
2
|
-
import { IMultiSelectConfig } from "../interfaces/config";
|
|
3
|
-
interface UseIMultiSelectConfig {
|
|
4
|
-
config?: IMultiSelectConfig;
|
|
5
|
-
}
|
|
6
|
-
export declare function useMultiSelect({ config }: UseIMultiSelectConfig): {
|
|
7
|
-
state: IMultiSelectState;
|
|
8
|
-
updateState: (newPartial: Partial<IMultiSelectState>) => void;
|
|
9
|
-
};
|
|
10
|
-
export {};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { useEffect, useReducer } from "react";
|
|
2
|
-
import { computeUnselected } from "../helpers/computeUnselected.js";
|
|
3
|
-
import { stateReducer } from "../reducers/stateReducer.js";
|
|
4
|
-
import { arraysEqual } from "../helpers/arraysEqual.js";
|
|
5
|
-
function useMultiSelect({ config }) {
|
|
6
|
-
const initial = {
|
|
7
|
-
selected: config?.fields?.externalSelected ?? [],
|
|
8
|
-
options: config?.fields?.externalOptions ?? [],
|
|
9
|
-
filtered: config?.fields?.externalFiltered ?? [],
|
|
10
|
-
unselected: computeUnselected(config?.fields?.externalOptions ?? [], config?.fields?.externalSelected ?? [])
|
|
11
|
-
};
|
|
12
|
-
const [state, dispatch] = useReducer(stateReducer, initial);
|
|
13
|
-
useEffect(()=>{
|
|
14
|
-
if (!config) return;
|
|
15
|
-
const { fields, actions } = config;
|
|
16
|
-
const payload = {};
|
|
17
|
-
if (fields?.externalSelected && !arraysEqual(fields.externalSelected, state.selected)) payload.selected = fields.externalSelected;
|
|
18
|
-
if (fields?.externalOptions && !arraysEqual(fields.externalOptions, state.options)) payload.options = fields.externalOptions;
|
|
19
|
-
if (fields?.externalFiltered && !arraysEqual(fields.externalFiltered, state.filtered)) payload.filtered = fields.externalFiltered;
|
|
20
|
-
if (fields?.externalUnselected && !arraysEqual(fields.externalUnselected, state.unselected)) payload.unselected = fields.externalUnselected;
|
|
21
|
-
if (Object.keys(payload).length) dispatch({
|
|
22
|
-
type: "SET_STATE",
|
|
23
|
-
payload
|
|
24
|
-
});
|
|
25
|
-
if (actions?.onSelectedChange) actions.onSelectedChange(state.selected);
|
|
26
|
-
if (actions?.onOptionsChange) actions.onOptionsChange(state.options);
|
|
27
|
-
if (actions?.onFilteredChange) actions.onFilteredChange(state.filtered);
|
|
28
|
-
if (actions?.onUnselectedChange) actions.onUnselectedChange(state.unselected);
|
|
29
|
-
}, [
|
|
30
|
-
state,
|
|
31
|
-
config
|
|
32
|
-
]);
|
|
33
|
-
const updateState = (newPartial)=>{
|
|
34
|
-
dispatch({
|
|
35
|
-
type: "SET_STATE",
|
|
36
|
-
payload: newPartial
|
|
37
|
-
});
|
|
38
|
-
};
|
|
39
|
-
return {
|
|
40
|
-
state,
|
|
41
|
-
updateState
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
export { useMultiSelect };
|
|
File without changes
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { IMultiSelectState, IMultiSelectOption } from "./state";
|
|
2
|
-
export interface IMultiSelectConfigFields {
|
|
3
|
-
externalSelected?: IMultiSelectOption[];
|
|
4
|
-
externalOptions?: IMultiSelectOption[];
|
|
5
|
-
externalFiltered?: IMultiSelectOption[];
|
|
6
|
-
externalUnselected?: IMultiSelectOption[];
|
|
7
|
-
}
|
|
8
|
-
export interface IMultiSelectConfigActions {
|
|
9
|
-
onSelectedChange?: (selected: IMultiSelectState["selected"]) => void;
|
|
10
|
-
onOptionsChange?: (options: IMultiSelectState["options"]) => void;
|
|
11
|
-
onFilteredChange?: (filtered: IMultiSelectState["filtered"]) => void;
|
|
12
|
-
onUnselectedChange?: (unselected: IMultiSelectState["unselected"]) => void;
|
|
13
|
-
}
|
|
14
|
-
export interface IMultiSelectConfig {
|
|
15
|
-
fields?: IMultiSelectConfigFields;
|
|
16
|
-
actions?: IMultiSelectConfigActions;
|
|
17
|
-
}
|
|
File without changes
|
|
File without changes
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { IMultiSelectOption, IMultiSelectState } from "../interfaces/state";
|
|
2
|
-
type MultiSelectAction = {
|
|
3
|
-
type: "SET_STATE";
|
|
4
|
-
payload: Partial<IMultiSelectState>;
|
|
5
|
-
} | {
|
|
6
|
-
type: "SET_OPTIONS";
|
|
7
|
-
payload: IMultiSelectOption[];
|
|
8
|
-
} | {
|
|
9
|
-
type: "SET_SELECTED";
|
|
10
|
-
payload: IMultiSelectOption[];
|
|
11
|
-
} | {
|
|
12
|
-
type: "SET_UNSELECTED";
|
|
13
|
-
payload: IMultiSelectOption[];
|
|
14
|
-
} | {
|
|
15
|
-
type: "SET_FILTERED";
|
|
16
|
-
payload: IMultiSelectOption[];
|
|
17
|
-
} | {
|
|
18
|
-
type: "CLEAR";
|
|
19
|
-
};
|
|
20
|
-
export declare function stateReducer(state: IMultiSelectState, action: MultiSelectAction): IMultiSelectState;
|
|
21
|
-
export {};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { computeUnselected } from "../helpers/computeUnselected.js";
|
|
2
|
-
import { computeSelected } from "../helpers/computeSelected.js";
|
|
3
|
-
function stateReducer(state, action) {
|
|
4
|
-
switch(action.type){
|
|
5
|
-
case "SET_STATE":
|
|
6
|
-
return {
|
|
7
|
-
...state,
|
|
8
|
-
...action.payload,
|
|
9
|
-
unselected: computeUnselected(action.payload.options ?? state.options, action.payload.selected ?? state.selected)
|
|
10
|
-
};
|
|
11
|
-
case "SET_OPTIONS":
|
|
12
|
-
return {
|
|
13
|
-
...state,
|
|
14
|
-
options: action.payload,
|
|
15
|
-
unselected: computeUnselected(action.payload, state.selected)
|
|
16
|
-
};
|
|
17
|
-
case "SET_SELECTED":
|
|
18
|
-
return {
|
|
19
|
-
...state,
|
|
20
|
-
selected: action.payload,
|
|
21
|
-
unselected: computeUnselected(state.options, action.payload)
|
|
22
|
-
};
|
|
23
|
-
case "SET_UNSELECTED":
|
|
24
|
-
return {
|
|
25
|
-
...state,
|
|
26
|
-
selected: computeSelected(state.options, action.payload),
|
|
27
|
-
unselected: action.payload
|
|
28
|
-
};
|
|
29
|
-
case "SET_FILTERED":
|
|
30
|
-
return {
|
|
31
|
-
...state,
|
|
32
|
-
filtered: action.payload
|
|
33
|
-
};
|
|
34
|
-
case "CLEAR":
|
|
35
|
-
return {
|
|
36
|
-
...state,
|
|
37
|
-
selected: [],
|
|
38
|
-
unselected: state.options
|
|
39
|
-
};
|
|
40
|
-
default:
|
|
41
|
-
return state;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
export { stateReducer };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { Paragraph } from "../index";
|
|
3
|
-
/**
|
|
4
|
-
* Títulos são usados para mostrar textos regulares em uma página.
|
|
5
|
-
* Este componente também funciona com os atributos nativos de um HTML paragraph element.
|
|
6
|
-
*/
|
|
7
|
-
declare const meta: Meta<typeof Paragraph>;
|
|
8
|
-
export default meta;
|
|
9
|
-
type Story = StoryObj<typeof meta>;
|
|
10
|
-
/**
|
|
11
|
-
* Variação padrão do Paragraph quando apenas as propriedades obrigatórias são fornecidas.
|
|
12
|
-
*/
|
|
13
|
-
export declare const Default: Story;
|
|
14
|
-
/**
|
|
15
|
-
* Variação de tamanho caption do Paragraph.
|
|
16
|
-
*/
|
|
17
|
-
export declare const Caption: Story;
|
|
18
|
-
/**
|
|
19
|
-
* Variação de tamanho sm do Paragraph.
|
|
20
|
-
*/
|
|
21
|
-
export declare const Sm: Story;
|
|
22
|
-
/**
|
|
23
|
-
* Variação de tamanho md do Paragraph.
|
|
24
|
-
*/
|
|
25
|
-
export declare const Md: Story;
|
|
26
|
-
/**
|
|
27
|
-
* Todas as variações padrão de de tamanho do Paragraph.
|
|
28
|
-
*/
|
|
29
|
-
export declare const Sizes: Story;
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Paragraph, Title } from "../index.js";
|
|
3
|
-
const meta = {
|
|
4
|
-
title: "DESIGN COMPONENTS/Text/Paragraph",
|
|
5
|
-
component: Paragraph,
|
|
6
|
-
tags: [
|
|
7
|
-
"autodocs"
|
|
8
|
-
],
|
|
9
|
-
parameters: {
|
|
10
|
-
layout: "centered"
|
|
11
|
-
},
|
|
12
|
-
argTypes: {
|
|
13
|
-
children: {
|
|
14
|
-
description: "Define o texto que ser\xe1 renderizado.",
|
|
15
|
-
control: {
|
|
16
|
-
type: "text"
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
size: {
|
|
20
|
-
description: "Define o tamanho do Paragraph.",
|
|
21
|
-
table: {
|
|
22
|
-
type: {
|
|
23
|
-
summary: '"caption" | "sm" | "md"'
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
const Paragraph_stories = meta;
|
|
30
|
-
const loremIpsum = `Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
31
|
-
Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
32
|
-
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
|
33
|
-
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
|
|
34
|
-
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.`;
|
|
35
|
-
const Default = {
|
|
36
|
-
args: {
|
|
37
|
-
size: "caption",
|
|
38
|
-
children: loremIpsum
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
const Caption = {
|
|
42
|
-
args: {
|
|
43
|
-
children: loremIpsum,
|
|
44
|
-
size: "caption"
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
const Sm = {
|
|
48
|
-
args: {
|
|
49
|
-
children: loremIpsum,
|
|
50
|
-
size: "sm"
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
const Md = {
|
|
54
|
-
args: {
|
|
55
|
-
children: loremIpsum,
|
|
56
|
-
size: "md"
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
const Sizes = {
|
|
60
|
-
render: ()=>/*#__PURE__*/ jsxs("div", {
|
|
61
|
-
style: {
|
|
62
|
-
display: "flex",
|
|
63
|
-
justifyContent: "center",
|
|
64
|
-
alignItems: "center",
|
|
65
|
-
flexDirection: "column",
|
|
66
|
-
gap: "2.5rem",
|
|
67
|
-
width: "100%"
|
|
68
|
-
},
|
|
69
|
-
children: [
|
|
70
|
-
/*#__PURE__*/ jsxs("div", {
|
|
71
|
-
style: {
|
|
72
|
-
display: "grid",
|
|
73
|
-
gridTemplateColumns: "10% 90%",
|
|
74
|
-
alignItems: "center"
|
|
75
|
-
},
|
|
76
|
-
children: [
|
|
77
|
-
/*#__PURE__*/ jsx(Title, {
|
|
78
|
-
size: "md",
|
|
79
|
-
children: "Caption"
|
|
80
|
-
}),
|
|
81
|
-
/*#__PURE__*/ jsx(Paragraph, {
|
|
82
|
-
size: "caption",
|
|
83
|
-
children: loremIpsum
|
|
84
|
-
})
|
|
85
|
-
]
|
|
86
|
-
}),
|
|
87
|
-
/*#__PURE__*/ jsxs("div", {
|
|
88
|
-
style: {
|
|
89
|
-
display: "grid",
|
|
90
|
-
gridTemplateColumns: "10% 90%",
|
|
91
|
-
alignItems: "center"
|
|
92
|
-
},
|
|
93
|
-
children: [
|
|
94
|
-
/*#__PURE__*/ jsx(Title, {
|
|
95
|
-
size: "md",
|
|
96
|
-
children: "md"
|
|
97
|
-
}),
|
|
98
|
-
/*#__PURE__*/ jsx(Paragraph, {
|
|
99
|
-
size: "md",
|
|
100
|
-
children: loremIpsum
|
|
101
|
-
})
|
|
102
|
-
]
|
|
103
|
-
}),
|
|
104
|
-
/*#__PURE__*/ jsxs("div", {
|
|
105
|
-
style: {
|
|
106
|
-
display: "grid",
|
|
107
|
-
gridTemplateColumns: "10% 90%",
|
|
108
|
-
alignItems: "center"
|
|
109
|
-
},
|
|
110
|
-
children: [
|
|
111
|
-
/*#__PURE__*/ jsx(Title, {
|
|
112
|
-
size: "md",
|
|
113
|
-
children: "sm"
|
|
114
|
-
}),
|
|
115
|
-
/*#__PURE__*/ jsx(Paragraph, {
|
|
116
|
-
size: "sm",
|
|
117
|
-
children: loremIpsum
|
|
118
|
-
})
|
|
119
|
-
]
|
|
120
|
-
})
|
|
121
|
-
]
|
|
122
|
-
})
|
|
123
|
-
};
|
|
124
|
-
export { Caption, Default, Md, Sizes, Sm, Paragraph_stories as default };
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { Title } from "../index";
|
|
3
|
-
/**
|
|
4
|
-
* Títulos são usados para mostrar textos importantes em uma página.
|
|
5
|
-
* Este componente também funciona com os atributos nativos de um HTML input element.
|
|
6
|
-
*/
|
|
7
|
-
declare const meta: Meta<typeof Title>;
|
|
8
|
-
export default meta;
|
|
9
|
-
type Story = StoryObj<typeof meta>;
|
|
10
|
-
/**
|
|
11
|
-
* Variação padrão do Title quando apenas as propriedades obrigatórias são fornecidas.
|
|
12
|
-
*/
|
|
13
|
-
export declare const Default: Story;
|
|
14
|
-
/**
|
|
15
|
-
* Variação subheading do Title.
|
|
16
|
-
*/
|
|
17
|
-
export declare const Subheading: Story;
|
|
18
|
-
/**
|
|
19
|
-
* Variação sm do Title.
|
|
20
|
-
*/
|
|
21
|
-
export declare const Sm: Story;
|
|
22
|
-
/**
|
|
23
|
-
* Variação md do Title.
|
|
24
|
-
*/
|
|
25
|
-
export declare const Md: Story;
|
|
26
|
-
/**
|
|
27
|
-
* Variação section do Title.
|
|
28
|
-
*/
|
|
29
|
-
export declare const Section: Story;
|
|
30
|
-
/**
|
|
31
|
-
* Variação standart do Title.
|
|
32
|
-
*/
|
|
33
|
-
export declare const Standart: Story;
|
|
34
|
-
/**
|
|
35
|
-
* Variação huge do Title.
|
|
36
|
-
*/
|
|
37
|
-
export declare const Huge: Story;
|
|
38
|
-
/**
|
|
39
|
-
* Todas as variações padrão de de tamanho do Title.
|
|
40
|
-
*/
|
|
41
|
-
export declare const Sizes: Story;
|