@yogiswara/honcho-editor-ui 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/dist/components/editor/HAccordionAspectRatio.d.ts +14 -0
  2. package/dist/components/editor/HAccordionAspectRatio.js +102 -0
  3. package/dist/components/editor/HAccordionColor.d.ts +12 -0
  4. package/dist/components/editor/HAccordionColor.js +234 -0
  5. package/dist/components/editor/HAccordionColorAdjustment.d.ts +31 -0
  6. package/dist/components/editor/HAccordionColorAdjustment.js +37 -0
  7. package/dist/components/editor/HAccordionDetails.d.ts +8 -0
  8. package/dist/components/editor/HAccordionDetails.js +133 -0
  9. package/dist/components/editor/HAccordionLight.d.ts +16 -0
  10. package/dist/components/editor/HAccordionLight.js +342 -0
  11. package/dist/components/editor/HAccordionPreset.d.ts +23 -0
  12. package/dist/components/editor/HAccordionPreset.js +59 -0
  13. package/dist/components/editor/HAlertBox.d.ts +7 -0
  14. package/dist/components/editor/HAlertBox.js +46 -0
  15. package/dist/components/editor/HAspectRatioMobile.d.ts +0 -0
  16. package/dist/components/editor/HAspectRatioMobile.js +1 -0
  17. package/dist/components/editor/HBulkAccordionColorAdjustment.d.ts +55 -0
  18. package/dist/components/editor/HBulkAccordionColorAdjustment.js +31 -0
  19. package/dist/components/editor/HBulkAccordionColorAdjustmentColors.d.ts +20 -0
  20. package/dist/components/editor/HBulkAccordionColorAdjustmentColors.js +121 -0
  21. package/dist/components/editor/HBulkAccordionColorAdjustmentDetails.d.ts +12 -0
  22. package/dist/components/editor/HBulkAccordionColorAdjustmentDetails.js +65 -0
  23. package/dist/components/editor/HBulkAccordionColorAdjustmentLight.d.ts +28 -0
  24. package/dist/components/editor/HBulkAccordionColorAdjustmentLight.js +177 -0
  25. package/dist/components/editor/HBulkColorAdjustmentMobile.d.ts +53 -0
  26. package/dist/components/editor/HBulkColorAdjustmentMobile.js +16 -0
  27. package/dist/components/editor/HBulkColorMobile.d.ts +20 -0
  28. package/dist/components/editor/HBulkColorMobile.js +121 -0
  29. package/dist/components/editor/HBulkDetailsMobile.d.ts +12 -0
  30. package/dist/components/editor/HBulkDetailsMobile.js +65 -0
  31. package/dist/components/editor/HBulkLightMobile.d.ts +28 -0
  32. package/dist/components/editor/HBulkLightMobile.js +192 -0
  33. package/dist/components/editor/HBulkPreset.d.ts +24 -0
  34. package/dist/components/editor/HBulkPreset.js +33 -0
  35. package/dist/components/editor/HBulkPresetMobile.d.ts +15 -0
  36. package/dist/components/editor/HBulkPresetMobile.js +26 -0
  37. package/dist/components/editor/HDialogBox.d.ts +18 -0
  38. package/dist/components/editor/HDialogBox.js +51 -0
  39. package/dist/components/editor/HDialogCopy.d.ts +40 -0
  40. package/dist/components/editor/HDialogCopy.js +80 -0
  41. package/dist/components/editor/HFooter.d.ts +12 -0
  42. package/dist/components/editor/HFooter.js +24 -0
  43. package/dist/components/editor/HHeaderEditor.d.ts +17 -0
  44. package/dist/components/editor/HHeaderEditor.js +27 -0
  45. package/dist/components/editor/HImageEditorBulkDekstop.d.ts +15 -0
  46. package/dist/components/editor/HImageEditorBulkDekstop.js +26 -0
  47. package/dist/components/editor/HImageEditorBulkMobile.d.ts +72 -0
  48. package/dist/components/editor/HImageEditorBulkMobile.js +81 -0
  49. package/dist/components/editor/HImageEditorDekstop.d.ts +15 -0
  50. package/dist/components/editor/HImageEditorDekstop.js +29 -0
  51. package/dist/components/editor/HImageEditorMobile.d.ts +47 -0
  52. package/dist/components/editor/HImageEditorMobile.js +91 -0
  53. package/dist/components/editor/HImageEditorMobileLayout.d.ts +14 -0
  54. package/dist/components/editor/HImageEditorMobileLayout.js +57 -0
  55. package/dist/components/editor/HImageEditorPage.d.ts +1 -0
  56. package/dist/components/editor/HImageEditorPage.js +187 -0
  57. package/dist/components/editor/HModalEditorDekstop.d.ts +13 -0
  58. package/dist/components/editor/HModalEditorDekstop.js +22 -0
  59. package/dist/components/editor/HModalMobile.d.ts +12 -0
  60. package/dist/components/editor/HModalMobile.js +7 -0
  61. package/dist/components/editor/HPresetOptionMenu.d.ts +11 -0
  62. package/dist/components/editor/HPresetOptionMenu.js +20 -0
  63. package/dist/components/editor/HSliderColorMobile.d.ts +12 -0
  64. package/dist/components/editor/HSliderColorMobile.js +222 -0
  65. package/dist/components/editor/HSliderDetailsMobile.d.ts +8 -0
  66. package/dist/components/editor/HSliderDetailsMobile.js +130 -0
  67. package/dist/components/editor/HSliderLightMobile.d.ts +16 -0
  68. package/dist/components/editor/HSliderLightMobile.js +342 -0
  69. package/dist/components/editor/HTabAspectRatioMobile.d.ts +0 -0
  70. package/dist/components/editor/HTabAspectRatioMobile.js +1 -0
  71. package/dist/components/editor/HTabColorAdjustmentMobile.d.ts +29 -0
  72. package/dist/components/editor/HTabColorAdjustmentMobile.js +16 -0
  73. package/dist/components/editor/HTabPresetMobile.d.ts +14 -0
  74. package/dist/components/editor/HTabPresetMobile.js +10 -0
  75. package/dist/components/editor/HTextField.d.ts +14 -0
  76. package/dist/components/editor/HTextField.js +51 -0
  77. package/dist/components/editor/HWatermarkView.d.ts +6 -0
  78. package/dist/components/editor/HWatermarkView.js +16 -0
  79. package/dist/hooks/editor/useHonchoEditor.d.ts +272 -0
  80. package/dist/hooks/editor/useHonchoEditor.js +1203 -0
  81. package/dist/index.d.ts +23 -0
  82. package/dist/index.js +23 -0
  83. package/dist/lib/editor/honcho-editor.d.ts +324 -0
  84. package/dist/lib/editor/honcho-editor.js +825 -0
  85. package/dist/themes/colors.d.ts +12 -0
  86. package/dist/themes/colors.js +12 -0
  87. package/dist/themes/honchoTheme.d.ts +25 -0
  88. package/dist/themes/honchoTheme.js +94 -0
  89. package/dist/utils/isMobile.d.ts +1 -0
  90. package/dist/utils/isMobile.js +5 -0
  91. package/package.json +41 -0
@@ -0,0 +1,14 @@
1
+ interface Props {
2
+ activeRatio: string;
3
+ activeSquareRatio: string;
4
+ activeWideRatio: string;
5
+ angelChange: number;
6
+ widthPX: number;
7
+ heightPX: number;
8
+ onRatioSelect: (ratio: string) => void;
9
+ onAngleChange: (angle: number) => void;
10
+ onWidthChange: (value: number) => void;
11
+ onHeightChange: (value: number) => void;
12
+ }
13
+ export default function HAccordionAspectRatio(props: Props): import("react/jsx-runtime").JSX.Element;
14
+ export {};
@@ -0,0 +1,102 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useState } from "react";
3
+ import { Accordion, AccordionDetails, AccordionSummary, Button, Stack, Slider, Typography, CardMedia, IconButton, TextField } from "@mui/material";
4
+ import useHonchoTypography from "@/honchoTheme";
5
+ import useColors from "@/colors";
6
+ export default function HAccordionAspectRatio(props) {
7
+ const typography = useHonchoTypography();
8
+ const colors = useColors();
9
+ const [isCustomExpanded, setIsCustomExpanded] = useState(false);
10
+ const handleCustomAccordionChange = (event, isExpanded) => {
11
+ setIsCustomExpanded(isExpanded);
12
+ if (isExpanded) {
13
+ props.onRatioSelect('original');
14
+ }
15
+ };
16
+ const handleAngleSliderChange = (_event, newValue) => {
17
+ props.onAngleChange(newValue);
18
+ };
19
+ const textFieldSx = {
20
+ width: "80px",
21
+ padding: "4px",
22
+ borderRadius: "4px",
23
+ alignItems: "center",
24
+ border: `1px solid ${colors.outlineVariant}`,
25
+ textAlign: "center",
26
+ '& .MuiFilledInput-root': {
27
+ backgroundColor: 'transparent',
28
+ border: 'none',
29
+ '&:before': {
30
+ borderBottom: 'none',
31
+ },
32
+ '&:after': {
33
+ borderBottom: 'none',
34
+ },
35
+ '&:hover:not(.Mui-disabled):before': {
36
+ borderBottom: 'none',
37
+ },
38
+ '&.Mui-focused:after': {
39
+ borderBottom: 'none',
40
+ },
41
+ },
42
+ '& .MuiFilledInput-input': {
43
+ textAlign: 'center',
44
+ padding: 0,
45
+ color: colors.surface,
46
+ }
47
+ };
48
+ const customAccordionStyle = {
49
+ backgroundColor: 'transparent',
50
+ boxShadow: 'none',
51
+ margin: '0px',
52
+ '&.MuiAccordion-root:before': {
53
+ display: 'none',
54
+ },
55
+ '& .MuiAccordionSummary-root': {
56
+ minHeight: '22px',
57
+ padding: '0px',
58
+ '& .MuiAccordionSummary-content': {
59
+ margin: '0px',
60
+ justifyContent: 'flex-start',
61
+ },
62
+ },
63
+ '& .MuiAccordionDetails-root': {
64
+ padding: '8px 0px 0px 0px',
65
+ },
66
+ '&.MuiAccordion-root.Mui-expanded': {
67
+ margin: '0px',
68
+ },
69
+ };
70
+ return (_jsx(_Fragment, { children: _jsxs(Stack, { direction: "column", spacing: 2, sx: { p: 2, color: colors.surface }, children: [_jsxs(Stack, { direction: "row", spacing: 2, justifyContent: "start", alignItems: "center", children: [_jsx(IconButton, { "aria-label": "potrait", onClick: () => props.onRatioSelect('potrait'), children: _jsx(CardMedia, { component: "img", image: props.activeRatio === 'potrait' ? "/v1/svg/aspect-ratio-potrait-activate-editor.svg" : "/v1/svg/aspect-ratio-potrait-inactive-editor.svg", sx: { width: "14px", height: "20px" } }) }), _jsx(IconButton, { "aria-label": "wide", onClick: () => props.onRatioSelect('wide'), children: _jsx(CardMedia, { component: "img", image: props.activeRatio === 'wide' ? "/v1/svg/aspect-ratio-potrait-activate-editor.svg" : "/v1/svg/aspect-ratio-potrait-inactive-editor.svg", sx: { width: "14px", height: "20px", rotate: "-90deg" } }) })] }), _jsxs(Stack, { direction: "row", justifyContent: "space-between", alignItems: "center", children: [_jsx(IconButton, { onClick: () => props.onRatioSelect('original'), sx: { justifyContent: 'flex-start', color: props.activeSquareRatio === 'original' ? colors.surface : colors.onSurfaceVariant1, ...typography.bodyMedium }, children: "Original" }), _jsx(CardMedia, { component: "img", image: "v1/svg/check-ratio-editor.svg", sx: { width: "20px", height: "20px" } })] }), _jsx(Button, { onClick: () => props.onRatioSelect('freeform'), sx: { justifyContent: 'flex-start', color: props.activeSquareRatio === 'freeform' ? colors.surface : colors.onSurfaceVariant1, ...typography.bodyMedium }, children: "Freeform" }), _jsxs(Accordion, { expanded: isCustomExpanded, onChange: handleCustomAccordionChange, sx: customAccordionStyle, children: [_jsx(AccordionSummary, { children: _jsx(Typography, { sx: {
71
+ ...typography.bodyMedium,
72
+ color: props.activeSquareRatio === 'custom' ? colors.surface : colors.onSurfaceVariant1,
73
+ width: '100%',
74
+ cursor: 'pointer',
75
+ paddingLeft: '8px'
76
+ }, children: "Custom" }) }), _jsx(AccordionDetails, { children: _jsx(Stack, { direction: "row", spacing: 4, justifyContent: "center", alignItems: "center", sx: { paddingLeft: '16px' }, children: _jsxs(Stack, { direction: "row", spacing: 2, justifyContent: "center", alignItems: "center", children: [_jsx(Stack, { direction: "column", spacing: 0.5, children: _jsx(TextField, { hiddenLabel: true, placeholder: "Width", id: "width-px-input", value: props.widthPX === 0 ? '' : props.widthPX, variant: "filled", onChange: (e) => props.onWidthChange(Number(e.target.value)), sx: textFieldSx }) }), _jsx(Typography, { sx: { ...typography.bodyMedium, color: colors.surface }, children: " : " }), _jsx(Stack, { direction: "column", spacing: 0.5, children: _jsx(TextField, { hiddenLabel: true, placeholder: "Height", id: "height-px-input", value: props.heightPX === 0 ? '' : props.heightPX, variant: "filled", onChange: (e) => props.onHeightChange(Number(e.target.value)), sx: textFieldSx }) })] }) }) })] }), _jsx(Button, { onClick: () => props.onRatioSelect('1:1'), sx: { justifyContent: 'flex-start', color: props.activeWideRatio === '1:1' ? colors.surface : colors.onSurfaceVariant1, ...typography.bodyMedium }, children: "1:1" }), _jsx(Button, { onClick: () => props.onRatioSelect(props.activeRatio === 'wide' ? '3:2' : '2:3'), sx: { justifyContent: 'flex-start', color: props.activeWideRatio === (props.activeRatio === 'wide' ? '3:2' : '2:3') ? colors.surface : colors.onSurfaceVariant1, ...typography.bodyMedium }, children: props.activeRatio === 'wide' ? '3:2' : '2:3' }), _jsx(Button, { onClick: () => props.onRatioSelect(props.activeRatio === 'wide' ? '16:9' : '9:16'), sx: { justifyContent: 'flex-start', color: props.activeWideRatio === (props.activeRatio === 'wide' ? '16:9' : '9:16') ? colors.surface : colors.onSurfaceVariant1, ...typography.bodyMedium }, children: props.activeRatio === 'wide' ? '16:9' : '9:16' }), _jsxs(Stack, { direction: "row", justifyContent: "space-between", children: [_jsx(Typography, { sx: { ...typography.bodyMedium }, children: "Angel:" }), _jsx(TextField, { hiddenLabel: true, id: "filled-hidden-label-small", value: props.angelChange, variant: "filled", onChange: (e) => props.onAngleChange(Number(e.target.value)), sx: {
77
+ width: "40px",
78
+ alignItems: "center",
79
+ textAlign: "center",
80
+ '& .MuiFilledInput-root': {
81
+ backgroundColor: 'transparent',
82
+ border: 'none',
83
+ '&:before': {
84
+ borderBottom: 'none',
85
+ },
86
+ '&:after': {
87
+ borderBottom: 'none',
88
+ },
89
+ '&:hover:not(.Mui-disabled):before': {
90
+ borderBottom: 'none',
91
+ },
92
+ '&.Mui-focused:after': {
93
+ borderBottom: 'none',
94
+ },
95
+ },
96
+ '& .MuiFilledInput-input': {
97
+ textAlign: 'center',
98
+ padding: 0,
99
+ color: colors.surface,
100
+ }
101
+ } })] }), _jsx(Slider, { sx: { width: "200px", color: colors.surface }, size: "small", value: props.angelChange, step: 1, min: -360, max: 360, onChange: handleAngleSliderChange })] }) }));
102
+ }
@@ -0,0 +1,12 @@
1
+ interface Props {
2
+ TempScore: number;
3
+ TintScore: number;
4
+ SaturationScore: number;
5
+ VibranceScore: number;
6
+ onTempChange: (value: number) => void;
7
+ onTintChange: (value: number) => void;
8
+ onSaturationChange: (value: number) => void;
9
+ onVibranceChange: (value: number) => void;
10
+ }
11
+ export default function HAccordionColor(props: Props): import("react/jsx-runtime").JSX.Element;
12
+ export {};
@@ -0,0 +1,234 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { Stack, Slider, Typography, TextField } from "@mui/material";
3
+ import useHonchoTypography from "@/honchoTheme";
4
+ import useColors from "@/colors";
5
+ export default function HAccordionColor(props) {
6
+ const typography = useHonchoTypography();
7
+ const colors = useColors();
8
+ const blueScale = '#292bc0'; // Blue color on left
9
+ const yellowScale = '#dfdc28'; // Yellow color on right
10
+ const greenScale = '#00ff04';
11
+ const purpleScale = '#b700ff';
12
+ // The gradient for the *entire* background of the slider bar
13
+ const tempGradient = `linear-gradient(to right, ${blueScale} 35%, ${yellowScale} 75%)`;
14
+ const tintGradient = `linear-gradient(to right, ${greenScale} 20%, ${purpleScale} 75%)`;
15
+ const spectrumColorsSaturation = ['yellow', 'lime', 'deepskyblue', 'magenta', 'red'];
16
+ const greyScaleStart = '#000000'; // Black at -100
17
+ const greyScaleEnd = '#ffffff'; // White at 0 (or a very light grey)
18
+ const colorStops = spectrumColorsSaturation.map((color, index) => {
19
+ const position = 50 + (index / (spectrumColorsSaturation.length - 1)) * 50;
20
+ return `${color} ${position}%`;
21
+ }).join(', ');
22
+ // The gradient for the *entire* background of the slider bar
23
+ const fullTrackGradient = `linear-gradient(to right, ${greyScaleStart} 0%, ${greyScaleEnd} 50%, ${colorStops})`;
24
+ const focusedInputStyle = {
25
+ backgroundColor: "#1C1B1FB2",
26
+ borderRadius: '5px 5px 0px 0px',
27
+ borderBottom: 'none',
28
+ pl: '2px',
29
+ };
30
+ const formatValue = (value) => {
31
+ if (value > 0)
32
+ return `+${value}`;
33
+ return value.toString();
34
+ };
35
+ const handleInputChange = (event, min, max, onChange) => {
36
+ const value = event.target.value;
37
+ if (value === '+' || value === '-')
38
+ return;
39
+ let numericValue = parseInt(value, 10);
40
+ if (isNaN(numericValue))
41
+ numericValue = 0;
42
+ const clampedValue = Math.max(min, Math.min(max, numericValue));
43
+ onChange(clampedValue);
44
+ };
45
+ return (_jsx(_Fragment, { children: _jsxs(Stack, { children: [_jsxs(Stack, { direction: "column", gap: "4px", sx: { pt: '6px', pb: '2px', px: '0px', mx: '0px', '&:focus-within .MuiFilledInput-input': focusedInputStyle }, children: [_jsxs(Stack, { direction: "row", justifyContent: "space-between", children: [_jsx(Typography, { component: "label", htmlFor: "temperature-input", onDoubleClick: () => props.onTempChange(0), sx: { ...typography.bodyMedium, userSelect: 'none' }, children: "Temperature" }), _jsx(TextField, { hiddenLabel: true, id: "temperature-input", value: formatValue(props.TempScore), variant: "filled", onChange: (e) => handleInputChange(e, -100, 100, props.onTempChange), className: "control-label", sx: {
46
+ width: "40px",
47
+ height: "10px",
48
+ alignItems: "center",
49
+ textAlign: "right",
50
+ display: "flex",
51
+ '& .MuiFilledInput-root': {
52
+ backgroundColor: 'transparent',
53
+ borderRadius: "0px",
54
+ border: 'none',
55
+ '&:before': {
56
+ borderBottom: 'none',
57
+ },
58
+ '&:after': {
59
+ borderBottom: 'none',
60
+ },
61
+ '&:hover:not(.Mui-disabled):before': {
62
+ borderBottom: 'none',
63
+ },
64
+ '&.Mui-focused:after': {
65
+ borderBottom: 'none',
66
+ },
67
+ },
68
+ '& .MuiFilledInput-input': {
69
+ textAlign: 'right',
70
+ padding: 0,
71
+ pr: '4px',
72
+ color: colors.surface,
73
+ fontSize: "14px",
74
+ },
75
+ } })] }), _jsx(Slider, { sx: {
76
+ width: "200px",
77
+ color: colors.surface,
78
+ '& .MuiSlider-rail': {
79
+ background: tempGradient,
80
+ opacity: 1,
81
+ },
82
+ '& .MuiSlider-track': {
83
+ background: 'transparent',
84
+ border: 'none',
85
+ },
86
+ '& .MuiSlider-thumb': {
87
+ boxShadow: 'none',
88
+ },
89
+ '& .MuiSlider-thumb:hover': {
90
+ boxShadow: 'none',
91
+ },
92
+ }, size: "small", value: props.TempScore, step: 1, min: -100, max: 100, onChange: (_event, newValue) => props.onTempChange(newValue), onDoubleClick: () => props.onTempChange(0) })] }), _jsxs(Stack, { direction: "column", gap: "3px", sx: { pt: '10px', pb: '0px', px: '0px', mx: '0px', '&:focus-within .MuiFilledInput-input': focusedInputStyle }, children: [_jsxs(Stack, { direction: "row", justifyContent: "space-between", children: [_jsx(Typography, { component: "label", htmlFor: "tint-input", onDoubleClick: () => props.onTintChange(0), sx: { ...typography.bodyMedium, userSelect: 'none' }, children: "Tint" }), _jsx(TextField, { hiddenLabel: true, id: "tint-input", value: formatValue(props.TintScore), variant: "filled", onChange: (e) => handleInputChange(e, -100, 100, props.onTintChange), sx: {
93
+ width: "40px",
94
+ height: "10px",
95
+ alignItems: "center",
96
+ textAlign: "right",
97
+ display: "flex",
98
+ '& .MuiFilledInput-root': {
99
+ backgroundColor: 'transparent',
100
+ borderRadius: "0px",
101
+ border: 'none',
102
+ '&:before': {
103
+ borderBottom: 'none',
104
+ },
105
+ '&:after': {
106
+ borderBottom: 'none',
107
+ },
108
+ '&:hover:not(.Mui-disabled):before': {
109
+ borderBottom: 'none',
110
+ },
111
+ '&.Mui-focused:after': {
112
+ borderBottom: 'none',
113
+ },
114
+ },
115
+ '& .MuiFilledInput-input': {
116
+ textAlign: 'right',
117
+ padding: 0,
118
+ pr: '4px',
119
+ color: colors.surface,
120
+ fontSize: "14px",
121
+ },
122
+ } })] }), _jsx(Slider, { sx: {
123
+ width: "200px",
124
+ color: colors.surface,
125
+ '& .MuiSlider-rail': {
126
+ background: tintGradient,
127
+ opacity: 1,
128
+ },
129
+ '& .MuiSlider-track': {
130
+ background: 'transparent',
131
+ border: 'none',
132
+ },
133
+ '& .MuiSlider-thumb': {
134
+ boxShadow: 'none',
135
+ },
136
+ '& .MuiSlider-thumb:hover': {
137
+ boxShadow: 'none',
138
+ },
139
+ }, size: "small", value: props.TintScore, step: 1, min: -100, max: 100, onChange: (_event, newValue) => props.onTintChange(newValue), onDoubleClick: () => props.onTintChange(0) })] }), _jsxs(Stack, { direction: "column", gap: "3px", sx: { pt: '10px', pb: '0px', px: '0px', mx: '0px', '&:focus-within .MuiFilledInput-input': focusedInputStyle }, children: [_jsxs(Stack, { direction: "row", justifyContent: "space-between", children: [_jsx(Typography, { component: "label", htmlFor: "vibrance-input", onDoubleClick: () => props.onVibranceChange(0), sx: { ...typography.bodyMedium, userSelect: 'none' }, children: "Vibrance" }), _jsx(TextField, { hiddenLabel: true, id: "vibrance-input", value: formatValue(props.VibranceScore), variant: "filled", onChange: (e) => handleInputChange(e, -100, 100, props.onVibranceChange), sx: {
140
+ width: "40px",
141
+ height: "10px",
142
+ alignItems: "center",
143
+ textAlign: "right",
144
+ display: "flex",
145
+ '& .MuiFilledInput-root': {
146
+ backgroundColor: 'transparent',
147
+ borderRadius: "0px",
148
+ border: 'none',
149
+ '&:before': {
150
+ borderBottom: 'none',
151
+ },
152
+ '&:after': {
153
+ borderBottom: 'none',
154
+ },
155
+ '&:hover:not(.Mui-disabled):before': {
156
+ borderBottom: 'none',
157
+ },
158
+ '&.Mui-focused:after': {
159
+ borderBottom: 'none',
160
+ },
161
+ },
162
+ '& .MuiFilledInput-input': {
163
+ textAlign: 'right',
164
+ padding: 0,
165
+ pr: '4px',
166
+ color: colors.surface,
167
+ fontSize: "14px",
168
+ },
169
+ } })] }), _jsx(Slider, { sx: {
170
+ width: "200px",
171
+ color: colors.surface,
172
+ '& .MuiSlider-rail': {
173
+ background: fullTrackGradient,
174
+ opacity: 1,
175
+ },
176
+ '& .MuiSlider-track': {
177
+ background: 'transparent',
178
+ border: 'none',
179
+ },
180
+ '& .MuiSlider-thumb': {
181
+ boxShadow: 'none',
182
+ },
183
+ '& .MuiSlider-thumb:hover': {
184
+ boxShadow: 'none',
185
+ },
186
+ }, size: "small", value: props.VibranceScore, step: 1, min: -100, max: 100, onChange: (_event, newValue) => props.onVibranceChange(newValue), onDoubleClick: () => props.onVibranceChange(0) })] }), _jsxs(Stack, { direction: "column", gap: "3px", sx: { pt: '10px', pb: '0px', px: '0px', mx: '0px', '&:focus-within .MuiFilledInput-input': focusedInputStyle }, children: [_jsxs(Stack, { direction: "row", justifyContent: "space-between", children: [_jsx(Typography, { component: "label", htmlFor: "saturation-input", onDoubleClick: () => props.onSaturationChange(0), sx: { ...typography.bodyMedium, userSelect: 'none' }, children: "Saturation" }), _jsx(TextField, { hiddenLabel: true, id: "saturation-input", value: formatValue(props.SaturationScore), variant: "filled", onChange: (e) => handleInputChange(e, -100, 100, props.onSaturationChange), sx: {
187
+ width: "40px",
188
+ height: "10px",
189
+ alignItems: "center",
190
+ textAlign: "right",
191
+ display: "flex",
192
+ '& .MuiFilledInput-root': {
193
+ backgroundColor: 'transparent',
194
+ borderRadius: "0px",
195
+ border: 'none',
196
+ '&:before': {
197
+ borderBottom: 'none',
198
+ },
199
+ '&:after': {
200
+ borderBottom: 'none',
201
+ },
202
+ '&:hover:not(.Mui-disabled):before': {
203
+ borderBottom: 'none',
204
+ },
205
+ '&.Mui-focused:after': {
206
+ borderBottom: 'none',
207
+ },
208
+ },
209
+ '& .MuiFilledInput-input': {
210
+ textAlign: 'right',
211
+ padding: 0,
212
+ pr: '4px',
213
+ color: colors.surface,
214
+ fontSize: "14px",
215
+ },
216
+ } })] }), _jsx(Slider, { sx: {
217
+ width: "200px",
218
+ color: colors.surface,
219
+ '& .MuiSlider-rail': {
220
+ background: fullTrackGradient,
221
+ opacity: 1,
222
+ },
223
+ '& .MuiSlider-track': {
224
+ background: 'transparent',
225
+ border: 'none',
226
+ },
227
+ '& .': {
228
+ boxShadow: 'none',
229
+ },
230
+ '& .MuiSlider-thumb:hover': {
231
+ boxShadow: 'none',
232
+ },
233
+ }, size: "small", value: props.SaturationScore, step: 1, min: -100, max: 100, onChange: (_event, newValue) => props.onSaturationChange(newValue), onDoubleClick: () => props.onSaturationChange(0) })] })] }) }));
234
+ }
@@ -0,0 +1,31 @@
1
+ import React from "react";
2
+ interface Props {
3
+ tempScore: number;
4
+ tintScore: number;
5
+ vibranceScore: number;
6
+ saturationScore: number;
7
+ exposureScore: number;
8
+ HighlightsScore: number;
9
+ shadowsScore: number;
10
+ whitesScore: number;
11
+ blacksScore: number;
12
+ contrastScore: number;
13
+ clarityScore: number;
14
+ sharpnessScore: number;
15
+ expandedPanels: string[];
16
+ setTempScore: (value: number) => void;
17
+ setTintScore: (value: number) => void;
18
+ setExposureScore: (value: number) => void;
19
+ setVibranceScore: (value: number) => void;
20
+ setSaturationScore: (value: number) => void;
21
+ setHighlightsScore: (value: number) => void;
22
+ setShadowsScore: (value: number) => void;
23
+ setWhitesScore: (value: number) => void;
24
+ setBlacksScore: (value: number) => void;
25
+ setContrastScore: (value: number) => void;
26
+ setClarityScore: (value: number) => void;
27
+ setSharpnessScore: (value: number) => void;
28
+ onPanelChange: (panel: string) => (event: React.SyntheticEvent, isExpanded: boolean) => void;
29
+ }
30
+ export default function HAccordionColorAdjustment(props: Props): import("react/jsx-runtime").JSX.Element;
31
+ export {};
@@ -0,0 +1,37 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { Accordion, AccordionDetails, AccordionSummary, CardMedia, Stack, Typography } from "@mui/material";
3
+ import useHonchoTypography from "@/honchoTheme";
4
+ import HAccordionColor from "./HAccordionColor";
5
+ import HAccordionLight from "./HAccordionLight";
6
+ import HAccordionDetails from "./HAccordionDetails";
7
+ import useColors from "@/colors";
8
+ export default function HAccordionColorAdjustment(props) {
9
+ const typography = useHonchoTypography();
10
+ const colors = useColors();
11
+ const accordionStyle = {
12
+ backgroundColor: colors.onBackground,
13
+ color: colors.surface,
14
+ '& .MuiAccordionSummary-root': {
15
+ backgroundColor: colors.onBackground,
16
+ color: colors.surface,
17
+ },
18
+ '& .MuiAccordionDetails-root': {
19
+ backgroundColor: colors.onBackground,
20
+ color: colors.surface,
21
+ },
22
+ '& .MuiTypography-root': {
23
+ color: colors.surface,
24
+ },
25
+ '& .MuiSvgIcon-root': {
26
+ color: colors.surface,
27
+ }
28
+ };
29
+ const isPanelExpanded = (panelName) => props.expandedPanels.includes(panelName);
30
+ return (_jsx(_Fragment, { children: _jsxs(Stack, { direction: "column", sx: { accordionStyle }, children: [_jsxs(Accordion, { sx: accordionStyle, expanded: isPanelExpanded('whiteBalance'), onChange: props.onPanelChange('whiteBalance'), 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 }, children: "Color" }), _jsx(CardMedia, { component: "img", image: isPanelExpanded('whiteBalance') ? "/v1/svg/expanded-editor.svg" : "/v1/svg/expand-editor.svg", sx: { width: "11.67px", height: "5.83px" } })] }) }), _jsx(AccordionDetails, { sx: { pr: "4px" }, children: _jsx(HAccordionColor, { TempScore: props.tempScore, TintScore: props.tintScore, VibranceScore: props.vibranceScore, SaturationScore: props.saturationScore, onTempChange: props.setTempScore, onTintChange: props.setTintScore, onVibranceChange: props.setVibranceScore, onSaturationChange: props.setSaturationScore }) })] }), _jsxs(Accordion, { sx: accordionStyle, expanded: isPanelExpanded('light'), onChange: props.onPanelChange('light'), 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 }, children: "Light" }), _jsx(CardMedia, { component: "img", image: isPanelExpanded('light') ? "/v1/svg/expanded-editor.svg" : "/v1/svg/expand-editor.svg", sx: { width: "11.67px", height: "5.83px" } })] }) }), _jsx(AccordionDetails, { sx: { pr: "4px" }, children: _jsx(HAccordionLight, { ExposureScore: props.exposureScore, ContrastScore: props.contrastScore, HighlightsScore: props.HighlightsScore, ShadowsScore: props.shadowsScore, WhitesScore: props.whitesScore, BlacksScore: props.blacksScore, onExposureChange: props.setExposureScore, onContrastChange: props.setContrastScore, onHighlightsChange: props.setHighlightsScore, onShadowsChange: props.setShadowsScore, onWhitesChange: props.setWhitesScore, onBlacksChange: props.setBlacksScore }) })] }), _jsxs(Accordion, { sx: accordionStyle, expanded: isPanelExpanded('details'), onChange: props.onPanelChange('details'), 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 }, children: "Details" }), _jsx(CardMedia, { component: "img", image: isPanelExpanded('details') ? "/v1/svg/expanded-editor.svg" : "/v1/svg/expand-editor.svg", sx: { width: "11.67px", height: "5.83px" } })] }) }), _jsx(AccordionDetails, { sx: { pr: "4px" }, children: _jsx(HAccordionDetails
31
+ // ContrastScore = {props.contrastScore}
32
+ , {
33
+ // ContrastScore = {props.contrastScore}
34
+ ClarityScore: props.clarityScore, SharpnessScore: props.sharpnessScore,
35
+ // onContrastChange={props.setContrastScore}
36
+ onClarityChange: props.setClarityScore, onSharpnessChange: props.setSharpnessScore }) })] })] }) }));
37
+ }
@@ -0,0 +1,8 @@
1
+ interface Props {
2
+ ClarityScore: number;
3
+ SharpnessScore: number;
4
+ onClarityChange: (value: number) => void;
5
+ onSharpnessChange: (value: number) => void;
6
+ }
7
+ export default function HAccordionDetails(props: Props): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,133 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { Stack, Slider, Typography, TextField } from "@mui/material";
3
+ import useHonchoTypography from "@/honchoTheme";
4
+ import useColors from "@/colors";
5
+ export default function HAccordionDetails(props) {
6
+ const typography = useHonchoTypography();
7
+ const colors = useColors();
8
+ const formatValue = (value) => {
9
+ if (value > 0)
10
+ return `+${value}`;
11
+ return value.toString();
12
+ };
13
+ const focusedInputStyle = {
14
+ backgroundColor: "#1C1B1FB2",
15
+ borderRadius: '5px 5px 0px 0px',
16
+ borderBottom: 'none',
17
+ pl: '2px',
18
+ };
19
+ const handleInputChange = (event, min, max, onChange) => {
20
+ const value = event.target.value;
21
+ if (value === '+' || value === '-')
22
+ return;
23
+ let numericValue = parseInt(value, 10);
24
+ if (isNaN(numericValue))
25
+ numericValue = 0;
26
+ const clampedValue = Math.max(min, Math.min(max, numericValue));
27
+ onChange(clampedValue);
28
+ };
29
+ return (_jsx(_Fragment, { children: _jsxs(Stack, { children: [_jsxs(Stack, { direction: "column", gap: "4px", sx: { pt: '6px', pb: '2px', px: '0px', mx: '0px', '&:focus-within .MuiFilledInput-input': focusedInputStyle, }, children: [_jsxs(Stack, { direction: "row", justifyContent: "space-between", children: [_jsx(Typography, { component: "label", htmlFor: "clarity-input", onDoubleClick: () => props.onClarityChange(0), sx: { ...typography.bodyMedium, userSelect: 'none' }, children: "Clarity" }), _jsx(TextField, { hiddenLabel: true, id: "clarity-input", value: formatValue(props.ClarityScore), variant: "filled", onChange: (e) => handleInputChange(e, -100, 100, props.onClarityChange), sx: {
30
+ width: "40px",
31
+ height: "10px",
32
+ alignItems: "center",
33
+ textAlign: "right",
34
+ display: "flex",
35
+ '& .MuiFilledInput-root': {
36
+ // backgroundColor: 'transparent',
37
+ // border: '',
38
+ '&:before': {
39
+ borderBottom: 'none',
40
+ },
41
+ '&:after': {
42
+ borderBottom: 'none',
43
+ },
44
+ '&:hover:not(.Mui-disabled):before': {
45
+ borderBottom: 'none',
46
+ },
47
+ '&.Mui-focused:after': {
48
+ borderBottom: 'none',
49
+ },
50
+ },
51
+ '& .MuiFilledInput-input': {
52
+ textAlign: 'right',
53
+ padding: 0,
54
+ pr: '4px',
55
+ color: colors.surface,
56
+ fontSize: "14px",
57
+ },
58
+ '& .Mui-focused': {
59
+ '& .MuiFilledInput-input': {
60
+ backgroundColor: "#1C1B1FB2",
61
+ textAlign: 'right',
62
+ borderRadius: '5px 5px 0px 0px',
63
+ borderBottom: 'none',
64
+ // pr: '8px',
65
+ pl: '2px',
66
+ }
67
+ }
68
+ } })] }), _jsx(Slider, { sx: {
69
+ width: "200px",
70
+ color: colors.onSurfaceVariant,
71
+ '& .MuiSlider-rail': {
72
+ background: colors.onSurfaceVariant,
73
+ opacity: 1,
74
+ },
75
+ '& .MuiSlider-thumb': {
76
+ background: colors.surface,
77
+ opacity: 1,
78
+ boxShadow: 'none',
79
+ },
80
+ }, size: "small", value: props.ClarityScore, step: 1, min: -100, max: 100, onChange: (_event, newValue) => props.onClarityChange(newValue), onDoubleClick: () => props.onClarityChange(0) })] }), _jsxs(Stack, { direction: "column", gap: "3px", sx: { pt: '10px', pb: '0px', px: '0px', mx: '0px', '&:focus-within .MuiFilledInput-input': focusedInputStyle, }, children: [_jsxs(Stack, { direction: "row", justifyContent: "space-between", children: [_jsx(Typography, { component: "label", htmlFor: "sharpness-input", onDoubleClick: () => props.onSharpnessChange(0), sx: { ...typography.bodyMedium, userSelect: 'none' }, children: "Sharpness" }), _jsx(TextField, { hiddenLabel: true, id: "sharpness-input", value: formatValue(props.SharpnessScore), variant: "filled", onChange: (e) => handleInputChange(e, -100, 100, props.onSharpnessChange), sx: {
81
+ width: "40px",
82
+ height: "10px",
83
+ alignItems: "center",
84
+ textAlign: "right",
85
+ display: "flex",
86
+ '& .MuiFilledInput-root': {
87
+ backgroundColor: 'transparent',
88
+ borderRadius: "0px",
89
+ border: 'none',
90
+ '&:before': {
91
+ borderBottom: 'none',
92
+ },
93
+ '&:after': {
94
+ borderBottom: 'none',
95
+ },
96
+ '&:hover:not(.Mui-disabled):before': {
97
+ borderBottom: 'none',
98
+ },
99
+ '&.Mui-focused:after': {
100
+ borderBottom: 'none',
101
+ },
102
+ },
103
+ '& .MuiFilledInput-input': {
104
+ textAlign: 'right',
105
+ padding: 0,
106
+ pr: '4px',
107
+ color: colors.surface,
108
+ fontSize: "14px",
109
+ },
110
+ '& .Mui-focused': {
111
+ '& .MuiFilledInput-input': {
112
+ backgroundColor: "#1C1B1FB2",
113
+ textAlign: 'right',
114
+ borderRadius: '5px 5px 0px 0px',
115
+ borderBottom: 'none',
116
+ // pr: '8px',
117
+ pl: '2px',
118
+ }
119
+ }
120
+ } })] }), _jsx(Slider, { sx: {
121
+ width: "200px",
122
+ color: colors.onSurfaceVariant,
123
+ '& .MuiSlider-rail': {
124
+ background: colors.onSurfaceVariant,
125
+ opacity: 1,
126
+ },
127
+ '& .MuiSlider-thumb': {
128
+ background: colors.surface,
129
+ opacity: 1,
130
+ boxShadow: 'none',
131
+ },
132
+ }, size: "small", value: props.SharpnessScore, step: 1, min: -100, max: 100, onChange: (_event, newValue) => props.onSharpnessChange(newValue), onDoubleClick: () => props.onSharpnessChange(0) })] })] }) }));
133
+ }
@@ -0,0 +1,16 @@
1
+ interface Props {
2
+ ExposureScore: number;
3
+ ContrastScore: number;
4
+ HighlightsScore: number;
5
+ ShadowsScore: number;
6
+ WhitesScore: number;
7
+ BlacksScore: number;
8
+ onContrastChange: (value: number) => void;
9
+ onExposureChange: (value: number) => void;
10
+ onHighlightsChange: (value: number) => void;
11
+ onShadowsChange: (value: number) => void;
12
+ onWhitesChange: (value: number) => void;
13
+ onBlacksChange: (value: number) => void;
14
+ }
15
+ export default function HAccordionLight(props: Props): import("react/jsx-runtime").JSX.Element;
16
+ export {};