@yogiswara/honcho-editor-ui 2.7.0 → 2.7.1
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.
|
@@ -26,33 +26,20 @@ export default function HAccordionPreset(props) {
|
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
28
|
const isPanelExpanded = (panelName) => props.expandedPanels.includes(panelName);
|
|
29
|
-
return (_jsx(_Fragment, { children: _jsx(Box, { children: _jsxs(Accordion, { sx: accordionStyle, expanded: isPanelExpanded('preset'), onChange: props.onChange('preset'), disableGutters: true, children: [_jsx(AccordionSummary, { sx: { pr: 0 }, children: _jsxs(Stack, { direction: "row", justifyContent: "space-between", alignItems: "center", sx: { width: '100%' }, children: [_jsx(Typography, { sx: { ...typography.titleMedium, color: colors.surface }, children: "Preset" }), _jsx(CardMedia, { component: "img", image: isPanelExpanded('preset') ? "/v1/svg/expanded-editor.svg" : "/v1/svg/expand-editor.svg", sx: { width: "11.67px", height: "5.83px" } })] }) }), _jsx(AccordionDetails, { sx: { pr: "4px" }, children: _jsxs(Stack, { direction: "column", gap: "8px", sx: { pt: '0px', pb: '0px', mx: '0px', width: '100%' }, children: [props.presets.map((preset) => (_jsxs(Stack, { direction: "row",
|
|
30
|
-
width:
|
|
31
|
-
textWrap: 'nowrap',
|
|
32
|
-
overflow: 'hidden',
|
|
33
|
-
textOverflow: 'ellipsis',
|
|
34
|
-
display: 'block',
|
|
35
|
-
textTransform: 'none',
|
|
36
|
-
color: colors.surface,
|
|
37
|
-
pr: "120px",
|
|
38
|
-
pl: "0px",
|
|
39
|
-
ml: "0px",
|
|
40
|
-
justifyContent: 'flex-start',
|
|
41
|
-
...typography.bodyMedium
|
|
42
|
-
}, onClick: () => props.onSelectPreset(preset.id), children: preset.name })), props.selectedPreset === preset.id && (_jsx(Button, { sx: {
|
|
43
|
-
flex: 1,
|
|
29
|
+
return (_jsx(_Fragment, { children: _jsx(Box, { children: _jsxs(Accordion, { sx: accordionStyle, expanded: isPanelExpanded('preset'), onChange: props.onChange('preset'), disableGutters: true, children: [_jsx(AccordionSummary, { sx: { pr: 0 }, children: _jsxs(Stack, { direction: "row", justifyContent: "space-between", alignItems: "center", sx: { width: '100%' }, children: [_jsx(Typography, { sx: { ...typography.titleMedium, color: colors.surface }, children: "Preset" }), _jsx(CardMedia, { component: "img", image: isPanelExpanded('preset') ? "/v1/svg/expanded-editor.svg" : "/v1/svg/expand-editor.svg", sx: { width: "11.67px", height: "5.83px" } })] }) }), _jsx(AccordionDetails, { sx: { pr: "4px" }, children: _jsxs(Stack, { direction: "column", gap: "8px", sx: { pt: '0px', pb: '0px', mx: '0px', width: '100%' }, children: [props.presets.map((preset) => (_jsxs(Stack, { direction: "row", alignItems: "center", sx: { width: "100%" }, children: [_jsx(Button, { sx: {
|
|
30
|
+
width: props.selectedPreset !== preset.id ? "100px" : "100px", // always fixed width
|
|
44
31
|
minWidth: 0,
|
|
45
|
-
textWrap:
|
|
46
|
-
overflow:
|
|
47
|
-
textOverflow:
|
|
48
|
-
textTransform:
|
|
49
|
-
display:
|
|
32
|
+
textWrap: "nowrap",
|
|
33
|
+
overflow: "hidden",
|
|
34
|
+
textOverflow: "ellipsis",
|
|
35
|
+
textTransform: "none",
|
|
36
|
+
display: "block",
|
|
50
37
|
color: colors.surface,
|
|
51
38
|
pl: 0,
|
|
52
39
|
ml: 0,
|
|
53
|
-
justifyContent:
|
|
54
|
-
...typography.bodyMedium
|
|
55
|
-
}, onClick: () => props.onSelectPreset(preset.id), children: preset.name })
|
|
40
|
+
justifyContent: "flex-start",
|
|
41
|
+
...typography.bodyMedium,
|
|
42
|
+
}, onClick: () => props.onSelectPreset(preset.id), children: preset.name }), props.selectedPreset === preset.id && (_jsx(CardMedia, { component: "img", image: "v1/svg/check-ratio-editor.svg", sx: { width: "20px", height: "20px", ml: 1 } })), _jsx(IconButton, { "aria-label": preset.name, onClick: (event) => props.onPresetMenuClick(event, preset.id), sx: { p: 0, m: 0, ml: 1 }, children: _jsx(CardMedia, { component: "img", image: "/v1/svg/dots-editor.svg", alt: "Options" }) })] }, preset.id))), _jsx(Button, { variant: "text", sx: { color: colors.surface, border: "1px solid",
|
|
56
43
|
borderColor: colors.surface,
|
|
57
44
|
borderRadius: "40px",
|
|
58
45
|
textTransform: 'none',
|