jy-headless 0.1.1 → 0.1.5
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/README.md +4 -1
- package/dist/components/icons/CallIcon.d.ts +1 -1
- package/dist/components/icons/CloseIcon.d.ts +1 -1
- package/dist/components/icons/DownArrowIcon.d.ts +1 -1
- package/dist/components/icons/HomeIcon.d.ts +1 -1
- package/dist/components/icons/ImageIcon.d.ts +3 -0
- package/dist/components/icons/ImagePlusIcon.d.ts +3 -0
- package/dist/components/icons/SearchIcon.d.ts +1 -1
- package/dist/components/icons/UpArrowIcon.d.ts +1 -1
- package/dist/components/icons/index.d.ts +5 -1
- package/dist/components/input/ImageInput.d.ts +8 -0
- package/dist/components/utils/generateHash.d.ts +2 -0
- package/dist/index.d.ts +4 -3
- package/dist/index.esm.js +45 -234
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +47 -233
- package/dist/index.js.map +1 -1
- package/package.json +9 -12
package/dist/index.js
CHANGED
|
@@ -787,230 +787,14 @@ const Input = (_a) => {
|
|
|
787
787
|
(typeof error === 'string' ? (jsxRuntimeExports.jsx("span", { className: 'error-message', style: { position: 'absolute', top: '100%', left: 0 }, children: error })) : (error))] }));
|
|
788
788
|
};
|
|
789
789
|
|
|
790
|
-
const
|
|
791
|
-
|
|
792
|
-
{ code: 'Escape', label: 'Esc', key: 'Escape' },
|
|
793
|
-
{ code: null, label: '', key: '' },
|
|
794
|
-
],
|
|
795
|
-
[
|
|
796
|
-
{ code: 'F1', label: 'F1', key: 'F1' },
|
|
797
|
-
{ code: 'F2', label: 'F2', key: 'F2' },
|
|
798
|
-
{ code: 'F3', label: 'F3', key: 'F3' },
|
|
799
|
-
{ code: 'F4', label: 'F4', key: 'F4' },
|
|
800
|
-
{ code: null, label: '', key: '' },
|
|
801
|
-
],
|
|
802
|
-
[
|
|
803
|
-
{ code: 'F5', label: 'F5', key: 'F5' },
|
|
804
|
-
{ code: 'F6', label: 'F6', key: 'F6' },
|
|
805
|
-
{ code: 'F7', label: 'F7', key: 'F7' },
|
|
806
|
-
{ code: 'F8', label: 'F8', key: 'F8' },
|
|
807
|
-
{ code: null, label: '', key: '' },
|
|
808
|
-
],
|
|
809
|
-
[
|
|
810
|
-
{ code: 'F9', label: 'F9', key: 'F9' },
|
|
811
|
-
{ code: 'F10', label: 'F10', key: 'F10' },
|
|
812
|
-
{ code: 'F11', label: 'F11', key: 'F11' },
|
|
813
|
-
{ code: 'F12', label: 'F12', key: 'F12' },
|
|
814
|
-
{ code: null, label: '', key: '' },
|
|
815
|
-
],
|
|
816
|
-
[
|
|
817
|
-
{ code: 'PrintScreen', label: 'Print Screen', key: 'PrintScreen' },
|
|
818
|
-
{ code: 'ScrollLock', label: 'Scroll Lock', key: 'ScrollLock' },
|
|
819
|
-
{ code: 'Pause', label: 'Pause', key: 'Pause' },
|
|
820
|
-
],
|
|
821
|
-
];
|
|
822
|
-
const numberRow = [
|
|
823
|
-
{ code: 'Backquote', label: '~', shiftLabel: '¡', key: '`' },
|
|
824
|
-
{ code: 'Digit1', label: '1', shiftLabel: '!', key: '1' },
|
|
825
|
-
{ code: 'Digit2', label: '2', shiftLabel: '@', key: '2' },
|
|
826
|
-
{ code: 'Digit3', label: '3', shiftLabel: '#', key: '3' },
|
|
827
|
-
{ code: 'Digit4', label: '4', shiftLabel: '$', key: '4' },
|
|
828
|
-
{ code: 'Digit5', label: '5', shiftLabel: '%', key: '5' },
|
|
829
|
-
{ code: 'Digit6', label: '6', shiftLabel: '^', key: '6' },
|
|
830
|
-
{ code: 'Digit7', label: '7', shiftLabel: '&', key: '7' },
|
|
831
|
-
{ code: 'Digit8', label: '8', shiftLabel: '*', key: '8' },
|
|
832
|
-
{ code: 'Digit9', label: '9', shiftLabel: '(', key: '9' },
|
|
833
|
-
{ code: 'Digit0', label: '0', shiftLabel: ')', key: '0' },
|
|
834
|
-
{ code: 'Minus', label: '-', shiftLabel: '_', key: '-' },
|
|
835
|
-
{ code: 'Equal', label: '=', shiftLabel: '+', key: '=' },
|
|
836
|
-
{ code: 'Backspace', label: 'Backspace', key: 'Backspace' },
|
|
837
|
-
];
|
|
838
|
-
const qwertyRow = [
|
|
839
|
-
{ code: 'Tab', label: 'Tab', key: 'Tab' },
|
|
840
|
-
{ code: 'KeyQ', label: 'q', shiftLabel: 'Q', kor: 'ㅂ', korShift: 'ㅃ', key: 'q' },
|
|
841
|
-
{ code: 'KeyW', label: 'w', shiftLabel: 'W', kor: 'ㅈ', korShift: 'ㅉ', key: 'w' },
|
|
842
|
-
{ code: 'KeyE', label: 'e', shiftLabel: 'E', kor: 'ㄷ', korShift: 'ㄸ', key: 'e' },
|
|
843
|
-
{ code: 'KeyR', label: 'r', shiftLabel: 'R', kor: 'ㄱ', korShift: 'ㄲ', key: 'r' },
|
|
844
|
-
{ code: 'KeyT', label: 't', shiftLabel: 'T', kor: 'ㅅ', korShift: 'ㅆ', key: 't' },
|
|
845
|
-
{ code: 'KeyY', label: 'y', shiftLabel: 'Y', kor: 'ㅛ', korShift: 'ㅕ', key: 'y' },
|
|
846
|
-
{ code: 'KeyU', label: 'u', shiftLabel: 'U', kor: 'ㅕ', korShift: 'ㅕ', key: 'u' },
|
|
847
|
-
{ code: 'KeyI', label: 'i', shiftLabel: 'I', kor: 'ㅑ', korShift: 'ㅑ', key: 'i' },
|
|
848
|
-
{ code: 'KeyO', label: 'o', shiftLabel: 'O', kor: 'ㅐ', korShift: 'ㅒ', key: 'o' },
|
|
849
|
-
{ code: 'KeyP', label: 'p', shiftLabel: 'P', kor: 'ㅔ', korShift: 'ㅖ', key: 'p' },
|
|
850
|
-
{ code: 'BracketLeft', label: '[', shiftLabel: '{', kor: null, korShift: null, key: '[' },
|
|
851
|
-
{ code: 'BracketRight', label: ']', shiftLabel: '}', kor: null, korShift: null, key: ']' },
|
|
852
|
-
{ code: 'Backslash', label: '\\', shiftLabel: '|', kor: null, korShift: null, key: '\\' },
|
|
853
|
-
];
|
|
854
|
-
const homeRow = [
|
|
855
|
-
{ code: 'CapsLock', label: 'Caps Lock', kor: null, korShift: null, key: 'CapsLock' },
|
|
856
|
-
{ code: 'KeyA', label: 'a', shiftLabel: 'A', kor: 'ㅁ', korShift: 'ㅁ', key: 'a' },
|
|
857
|
-
{ code: 'KeyS', label: 's', shiftLabel: 'S', kor: 'ㄴ', korShift: 'ㄴ', key: 's' },
|
|
858
|
-
{ code: 'KeyD', label: 'd', shiftLabel: 'D', kor: 'ㅇ', korShift: 'ㅇ', key: 'd' },
|
|
859
|
-
{ code: 'KeyF', label: 'f', shiftLabel: 'F', kor: 'ㄹ', korShift: 'ㄹ', key: 'f' },
|
|
860
|
-
{ code: 'KeyG', label: 'g', shiftLabel: 'G', kor: 'ㅎ', korShift: 'ㅎ', key: 'g' },
|
|
861
|
-
{ code: 'KeyH', label: 'h', shiftLabel: 'H', kor: 'ㅗ', korShift: 'ㅗ', key: 'h' },
|
|
862
|
-
{ code: 'KeyJ', label: 'j', shiftLabel: 'J', kor: 'ㅓ', korShift: 'ㅓ', key: 'j' },
|
|
863
|
-
{ code: 'KeyK', label: 'k', shiftLabel: 'K', kor: 'ㅏ', korShift: 'ㅏ', key: 'k' },
|
|
864
|
-
{ code: 'KeyL', label: 'l', shiftLabel: 'L', kor: 'ㅣ', korShift: 'ㅣ', key: 'l' },
|
|
865
|
-
{ code: 'Semicolon', label: ';', shiftLabel: ':', kor: null, korShift: null, key: ';' },
|
|
866
|
-
{ code: 'Quote', label: "'", shiftLabel: '"', kor: null, korShift: null, key: "'" },
|
|
867
|
-
{ code: 'Enter', label: 'Enter', kor: null, korShift: null, key: 'Enter' },
|
|
868
|
-
];
|
|
869
|
-
const bottomRow = [
|
|
870
|
-
{ code: 'ShiftLeft', label: 'Shift', kor: null, key: 'Shift' },
|
|
871
|
-
{ code: 'KeyZ', label: 'z', shiftLabel: 'Z', kor: 'ㅋ', key: 'z' },
|
|
872
|
-
{ code: 'KeyX', label: 'x', shiftLabel: 'X', kor: 'ㅌ', key: 'x' },
|
|
873
|
-
{ code: 'KeyC', label: 'c', shiftLabel: 'C', kor: 'ㅊ', key: 'c' },
|
|
874
|
-
{ code: 'KeyV', label: 'v', shiftLabel: 'V', kor: 'ㅍ', key: 'v' },
|
|
875
|
-
{ code: 'KeyB', label: 'b', shiftLabel: 'B', kor: 'ㅠ', key: 'b' },
|
|
876
|
-
{ code: 'KeyN', label: 'n', shiftLabel: 'N', kor: 'ㅜ', key: 'n' },
|
|
877
|
-
{ code: 'KeyM', label: 'm', shiftLabel: 'M', kor: 'ㅡ', key: 'm' },
|
|
878
|
-
{ code: 'Comma', label: ',', shiftLabel: '<', kor: null, key: ',' },
|
|
879
|
-
{ code: 'Period', label: '.', shiftLabel: '>', kor: null, key: '.' },
|
|
880
|
-
{ code: 'Slash', label: '/', shiftLabel: '?', kor: null, key: '/' },
|
|
881
|
-
{ code: 'ShiftRight', label: 'Shift', kor: null, key: 'Shift' },
|
|
882
|
-
];
|
|
883
|
-
const spaceRow = [
|
|
884
|
-
{ code: 'ControlLeft', label: 'Ctrl', key: 'Control' },
|
|
885
|
-
{ code: 'MetaLeft', label: 'Win', key: 'Meta' },
|
|
886
|
-
{ code: 'AltLeft', label: 'Alt', key: 'Alt' },
|
|
887
|
-
{ code: 'Space', label: 'Space', key: ' ' },
|
|
888
|
-
{ code: 'AltRight', label: 'Alt', key: 'Alt' },
|
|
889
|
-
{ code: 'Fn', label: 'Fn', key: 'Fn' },
|
|
890
|
-
{ code: 'ContextMenu', label: 'Menu', key: 'ContextMenu' },
|
|
891
|
-
{ code: 'ControlRight', label: 'Ctrl', key: 'Control' },
|
|
892
|
-
];
|
|
893
|
-
const DesktopKeyboardInput = ({ type = 'full-size', hasFunction = true, hasNumpad = true, cellStyle = {}, cellClassName = '', activeCellStyle = {}, activeCellClassName = '', style = {}, className = '', onKeyDown, onKeyUp, }) => {
|
|
894
|
-
const [inputKey, setInputKey] = React.useState([]);
|
|
895
|
-
const [isShift, setIsShift] = React.useState(false);
|
|
896
|
-
const [isHangulMode, setIsHangulMode] = React.useState(false);
|
|
897
|
-
const getKeyFromEvent = (keyCode) => {
|
|
898
|
-
var _a, _b;
|
|
899
|
-
let row = null;
|
|
900
|
-
const allRows = [
|
|
901
|
-
...functionRow.flat(),
|
|
902
|
-
...numberRow,
|
|
903
|
-
...qwertyRow,
|
|
904
|
-
...homeRow,
|
|
905
|
-
...bottomRow,
|
|
906
|
-
...spaceRow,
|
|
907
|
-
];
|
|
908
|
-
row = allRows.find((row) => row.code === keyCode);
|
|
909
|
-
return {
|
|
910
|
-
code: (_a = row.code) !== null && _a !== undefined ? _a : '',
|
|
911
|
-
label: (_b = getLabel(row)) !== null && _b !== undefined ? _b : '',
|
|
912
|
-
};
|
|
913
|
-
};
|
|
914
|
-
const getLabel = (key) => {
|
|
915
|
-
if (isHangulMode) {
|
|
916
|
-
if (isShift) {
|
|
917
|
-
return key.korShift || key.kor || key.shiftLabel || key.label;
|
|
918
|
-
}
|
|
919
|
-
return key.kor || key.label;
|
|
920
|
-
}
|
|
921
|
-
if (isShift) {
|
|
922
|
-
return key.shiftLabel || key.label;
|
|
923
|
-
}
|
|
924
|
-
return key.label;
|
|
925
|
-
};
|
|
926
|
-
React.useEffect(() => {
|
|
927
|
-
const keyDown = (e) => {
|
|
928
|
-
e.preventDefault();
|
|
929
|
-
setInputKey((prevState) => [...prevState, e.code]);
|
|
930
|
-
if (e.key === 'Shift')
|
|
931
|
-
setIsShift(true);
|
|
932
|
-
onKeyDown === null || onKeyDown === undefined ? undefined : onKeyDown(getKeyFromEvent(e.code));
|
|
933
|
-
};
|
|
934
|
-
const keyUp = (e) => {
|
|
935
|
-
e.preventDefault();
|
|
936
|
-
if (e.key === 'HangulMode') {
|
|
937
|
-
setIsHangulMode((prev) => !prev);
|
|
938
|
-
}
|
|
939
|
-
setInputKey((prevState) => prevState.filter((it) => it !== e.code));
|
|
940
|
-
if (e.key === 'Shift')
|
|
941
|
-
setIsShift(false);
|
|
942
|
-
onKeyUp === null || onKeyUp === undefined ? undefined : onKeyUp(getKeyFromEvent(e.code));
|
|
943
|
-
};
|
|
944
|
-
window.addEventListener('keydown', keyDown);
|
|
945
|
-
window.addEventListener('keyup', keyUp);
|
|
946
|
-
return () => {
|
|
947
|
-
window.removeEventListener('keydown', keyDown);
|
|
948
|
-
window.removeEventListener('keyup', keyUp);
|
|
949
|
-
};
|
|
950
|
-
}, [onKeyDown, onKeyUp, isShift, isHangulMode]);
|
|
951
|
-
const renderRow = (row, rowType) => {
|
|
952
|
-
const getCellStyle = (key) => {
|
|
953
|
-
var _a;
|
|
954
|
-
if (key.code === null)
|
|
955
|
-
return;
|
|
956
|
-
const isActive = inputKey.map((it) => it === null || it === undefined ? undefined : it.toUpperCase()).includes((_a = key.code) === null || _a === undefined ? undefined : _a.toUpperCase()) ||
|
|
957
|
-
(inputKey.includes('HangulMode') && key.code === 'AltRight');
|
|
958
|
-
let gridColumn = '';
|
|
959
|
-
switch (key.code) {
|
|
960
|
-
case 'Space':
|
|
961
|
-
gridColumn = '4/12';
|
|
962
|
-
break;
|
|
963
|
-
case 'ShiftRight':
|
|
964
|
-
gridColumn = '13/15';
|
|
965
|
-
break;
|
|
966
|
-
case 'Backspace':
|
|
967
|
-
gridColumn = '14/16';
|
|
968
|
-
break;
|
|
969
|
-
case 'Tab':
|
|
970
|
-
case 'ShiftLeft':
|
|
971
|
-
case 'CapsLock':
|
|
972
|
-
gridColumn = '1/3';
|
|
973
|
-
break;
|
|
974
|
-
case 'Backslash':
|
|
975
|
-
gridColumn = '15/17';
|
|
976
|
-
break;
|
|
977
|
-
case 'Enter':
|
|
978
|
-
gridColumn = '14/16';
|
|
979
|
-
break;
|
|
980
|
-
}
|
|
981
|
-
return {
|
|
982
|
-
style: Object.assign({ gridColumn }, (isActive ? activeCellStyle : cellStyle)),
|
|
983
|
-
className: isActive ? activeCellClassName : cellClassName,
|
|
984
|
-
};
|
|
985
|
-
};
|
|
986
|
-
const onMouseDown = (key) => {
|
|
987
|
-
if (!key.code)
|
|
988
|
-
return;
|
|
989
|
-
setInputKey([key.code]);
|
|
990
|
-
if (['ShiftRight', 'ShiftLeft'].includes(key.code))
|
|
991
|
-
setIsShift(true);
|
|
992
|
-
onKeyDown === null || onKeyDown === undefined ? undefined : onKeyDown(getKeyFromEvent(key.code));
|
|
993
|
-
};
|
|
994
|
-
const onMouseUp = (key) => {
|
|
995
|
-
if (!key.code)
|
|
996
|
-
return;
|
|
997
|
-
if (key.code === 'AltRight') {
|
|
998
|
-
setIsHangulMode((prev) => !prev);
|
|
999
|
-
}
|
|
1000
|
-
setInputKey((prevState) => prevState.filter((it) => it !== key.code));
|
|
1001
|
-
if (['ShiftRight', 'ShiftLeft'].includes(key.code))
|
|
1002
|
-
setIsShift(false);
|
|
1003
|
-
onKeyUp === null || onKeyUp === undefined ? undefined : onKeyUp(getKeyFromEvent(key.code));
|
|
1004
|
-
};
|
|
1005
|
-
return row.map((key, idx) => (jsxRuntimeExports.jsx("div", Object.assign({ onMouseDown: () => onMouseDown(key), onMouseUp: () => onMouseUp(key) }, getCellStyle(key), { children: getLabel(key) }), `${key.code}-${idx}`)));
|
|
1006
|
-
};
|
|
1007
|
-
return (jsxRuntimeExports.jsxs("div", { style: style, className: className, children: [['full-size', 'tenkeyless'].includes(type) && hasFunction && (jsxRuntimeExports.jsx("div", { style: { display: 'grid', gridTemplateColumns: `repeat(20, 1fr)`, gap: '2px' }, children: renderRow(functionRow.flat()) })), jsxRuntimeExports.jsx("div", { style: { display: 'grid', gridTemplateColumns: 'repeat(15, 1fr)', gap: '2px' }, children: renderRow(numberRow) }), jsxRuntimeExports.jsx("div", { style: { display: 'grid', gridTemplateColumns: 'repeat(16, 1fr)', gap: '2px' }, children: renderRow(qwertyRow) }), jsxRuntimeExports.jsx("div", { style: { display: 'grid', gridTemplateColumns: 'repeat(15, 1fr)', gap: '2px' }, children: renderRow(homeRow) }), jsxRuntimeExports.jsx("div", { style: { display: 'grid', gridTemplateColumns: 'repeat(14, 1fr)', gap: '2px' }, children: renderRow(bottomRow) }), jsxRuntimeExports.jsx("div", { style: { display: 'grid', gridTemplateColumns: 'repeat(15, 1fr)', gap: '2px' }, children: renderRow(spaceRow) })] }));
|
|
790
|
+
const generateHash = () => {
|
|
791
|
+
return Math.random().toString(36).substr(2, 9) + Date.now().toString(36);
|
|
1008
792
|
};
|
|
1009
793
|
|
|
1010
794
|
const RadioInput = (_a) => {
|
|
1011
795
|
var { clearable = false, children = '', checked = false, onChange, onToggle, style, className, id, defaultChecked, readOnly, showError = false, error = null } = _a, restProps = __rest(_a, ["clearable", "children", "checked", "onChange", "onToggle", "style", "className", "id", "defaultChecked", "readOnly", "showError", "error"]);
|
|
1012
796
|
const [selected, setSelected] = React.useState(checked || false);
|
|
1013
|
-
const uniqueId = React.useMemo(() => id || `radio-${
|
|
797
|
+
const uniqueId = React.useMemo(() => id || `radio-${generateHash()}`, [id]);
|
|
1014
798
|
React.useEffect(() => {
|
|
1015
799
|
setSelected(checked || false);
|
|
1016
800
|
}, [checked]);
|
|
@@ -1066,7 +850,7 @@ const RadioGroup = ({ title, style, className, children, value = [], onChange, c
|
|
|
1066
850
|
};
|
|
1067
851
|
const RadioGroupItem = (_a) => {
|
|
1068
852
|
var { selectedValues, onToggle, clearable, readOnly, disabled } = _a, restProps = __rest(_a, ["selectedValues", "onToggle", "clearable", "readOnly", "disabled"]);
|
|
1069
|
-
const uniqueId = React.useMemo(() => { var _a; return (_a = restProps.id) !== null && _a !== undefined ? _a : `radio-${
|
|
853
|
+
const uniqueId = React.useMemo(() => { var _a; return (_a = restProps.id) !== null && _a !== undefined ? _a : `radio-${generateHash()}`; }, [restProps.id]);
|
|
1070
854
|
return (jsxRuntimeExports.jsx(RadioInput, Object.assign({}, restProps, { clearable: clearable, readOnly: readOnly, disabled: disabled, id: uniqueId, checked: selectedValues === null || selectedValues === undefined ? undefined : selectedValues.includes(uniqueId), onToggle: (e) => {
|
|
1071
855
|
if (readOnly || disabled)
|
|
1072
856
|
return;
|
|
@@ -1131,8 +915,8 @@ const TabItem = (_a) => {
|
|
|
1131
915
|
};
|
|
1132
916
|
Tab.Item = TabItem;
|
|
1133
917
|
|
|
1134
|
-
const DownArrowIcon = ({ color = '#000', size = '1em', bgColor = 'transparent', fill = 'none', }) => {
|
|
1135
|
-
return (jsxRuntimeExports.jsxs("svg", { "data-testid": 'down-arrow-icon', width: size, height: size, fill: color, style: { backgroundColor: bgColor }, viewBox: "0 0 24 24", transform: "matrix(1, 0, 0, -1, 0, 0)", xmlns: "http://www.w3.org/2000/svg", children: [jsxRuntimeExports.jsx("g", { id: "SVGRepo_bgCarrier", strokeWidth: "0" }), jsxRuntimeExports.jsx("g", { id: "SVGRepo_tracerCarrier", strokeLinecap: "round", strokeLinejoin: "round" }), jsxRuntimeExports.jsx("g", { id: "SVGRepo_iconCarrier", children: jsxRuntimeExports.jsx("path", { d: "M3 19h18a1.002 1.002 0 0 0 .823-1.569l-9-13c-.373-.539-1.271-.539-1.645 0l-9 13A.999.999 0 0 0 3 19z" }) })] }));
|
|
918
|
+
const DownArrowIcon = ({ color = '#000', size = '1em', bgColor = 'transparent', fill = 'none', style, }) => {
|
|
919
|
+
return (jsxRuntimeExports.jsxs("svg", { "data-testid": 'down-arrow-icon', width: size, height: size, fill: color, style: Object.assign({ backgroundColor: bgColor }, style), viewBox: "0 0 24 24", transform: "matrix(1, 0, 0, -1, 0, 0)", xmlns: "http://www.w3.org/2000/svg", children: [jsxRuntimeExports.jsx("g", { id: "SVGRepo_bgCarrier", strokeWidth: "0" }), jsxRuntimeExports.jsx("g", { id: "SVGRepo_tracerCarrier", strokeLinecap: "round", strokeLinejoin: "round" }), jsxRuntimeExports.jsx("g", { id: "SVGRepo_iconCarrier", children: jsxRuntimeExports.jsx("path", { d: "M3 19h18a1.002 1.002 0 0 0 .823-1.569l-9-13c-.373-.539-1.271-.539-1.645 0l-9 13A.999.999 0 0 0 3 19z" }) })] }));
|
|
1136
920
|
};
|
|
1137
921
|
|
|
1138
922
|
const Accordion = (_a) => {
|
|
@@ -1201,34 +985,63 @@ const DropdownItem = (_a) => {
|
|
|
1201
985
|
};
|
|
1202
986
|
Dropdown.Item = DropdownItem;
|
|
1203
987
|
|
|
1204
|
-
const
|
|
1205
|
-
return (jsxRuntimeExports.jsxs("svg", { viewBox: "0 0 24 24", width: size, height: size, fill:
|
|
988
|
+
const ImagePlusIcon = ({ color = '#000', size = '1em', bgColor = 'transparent', fill = 'none', style, }) => {
|
|
989
|
+
return (jsxRuntimeExports.jsxs("svg", { viewBox: "0 0 24 24", width: size, height: size, fill: fill, style: Object.assign({ backgroundColor: bgColor }, style), xmlns: "http://www.w3.org/2000/svg", children: [jsxRuntimeExports.jsx("g", { id: "SVGRepo_bgCarrier", strokeWidth: "0" }), jsxRuntimeExports.jsx("g", { id: "SVGRepo_tracerCarrier", strokeLinecap: "round", strokeLinejoin: "round" }), jsxRuntimeExports.jsx("g", { id: "SVGRepo_iconCarrier", children: jsxRuntimeExports.jsx("path", { d: "M14.2647 15.9377L12.5473 14.2346C11.758 13.4519 11.3633 13.0605 10.9089 12.9137C10.5092 12.7845 10.079 12.7845 9.67922 12.9137C9.22485 13.0605 8.83017 13.4519 8.04082 14.2346L4.04193 18.2622M14.2647 15.9377L14.606 15.5991C15.412 14.7999 15.8149 14.4003 16.2773 14.2545C16.6839 14.1262 17.1208 14.1312 17.5244 14.2688C17.9832 14.4253 18.3769 14.834 19.1642 15.6515L20 16.5001M14.2647 15.9377L18.22 19.9628M18.22 19.9628C17.8703 20 17.4213 20 16.8 20H7.2C6.07989 20 5.51984 20 5.09202 19.782C4.7157 19.5903 4.40973 19.2843 4.21799 18.908C4.12583 18.7271 4.07264 18.5226 4.04193 18.2622M18.22 19.9628C18.5007 19.9329 18.7175 19.8791 18.908 19.782C19.2843 19.5903 19.5903 19.2843 19.782 18.908C20 18.4802 20 17.9201 20 16.8V13M11 4H7.2C6.07989 4 5.51984 4 5.09202 4.21799C4.7157 4.40973 4.40973 4.71569 4.21799 5.09202C4 5.51984 4 6.0799 4 7.2V16.8C4 17.4466 4 17.9066 4.04193 18.2622M18 9V6M18 6V3M18 6H21M18 6H15", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) })] }));
|
|
990
|
+
};
|
|
991
|
+
|
|
992
|
+
const ImageInput = ({ id = generateHash(), preview, defaultElement = (jsxRuntimeExports.jsx(ImagePlusIcon, { style: { borderRadius: '10px' }, bgColor: '#cecece', color: '#919191', size: '120px' })), onFileChange, onChange, style, className, children, }) => {
|
|
993
|
+
const onFileInput = (e) => {
|
|
994
|
+
var _a;
|
|
995
|
+
const file = (_a = e.target.files) === null || _a === undefined ? undefined : _a[0];
|
|
996
|
+
const reader = new FileReader();
|
|
997
|
+
if (file) {
|
|
998
|
+
reader.onload = (fileEvent) => {
|
|
999
|
+
var _a;
|
|
1000
|
+
if (fileEvent) {
|
|
1001
|
+
onFileChange((_a = fileEvent.target) === null || _a === undefined ? undefined : _a.result);
|
|
1002
|
+
reader.readAsDataURL(file);
|
|
1003
|
+
}
|
|
1004
|
+
};
|
|
1005
|
+
}
|
|
1006
|
+
onChange === null || onChange === undefined ? undefined : onChange(e);
|
|
1007
|
+
};
|
|
1008
|
+
return (jsxRuntimeExports.jsxs("span", { "data-testid": 'image-input-wrapper', children: [jsxRuntimeExports.jsx("label", { htmlFor: id, children: preview ? (jsxRuntimeExports.jsx("span", { "data-testid": 'image-input-preview', style: Object.assign({ display: 'inline-block', background: `url(${preview}) no-repeat center/cover` }, style), className: className, children: children })) : (defaultElement) }), jsxRuntimeExports.jsx("input", { id: id, "data-testid": 'image-input', type: "file", style: { display: 'none' }, accept: 'image/*', onChange: onFileInput })] }));
|
|
1009
|
+
};
|
|
1010
|
+
|
|
1011
|
+
const CloseIcon = ({ color = '#000', size = '1em', bgColor = 'transparent', style }) => {
|
|
1012
|
+
return (jsxRuntimeExports.jsxs("svg", { viewBox: "0 0 24 24", width: size, height: size, fill: "none", style: Object.assign({ backgroundColor: bgColor }, style), xmlns: "http://www.w3.org/2000/svg", children: [jsxRuntimeExports.jsx("g", { id: "SVGRepo_bgCarrier", strokeWidth: "0" }), jsxRuntimeExports.jsx("g", { id: "SVGRepo_tracerCarrier", strokeLinecap: "round", strokeLinejoin: "round" }), jsxRuntimeExports.jsx("g", { id: "SVGRepo_iconCarrier", children: jsxRuntimeExports.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M5.29289 5.29289C5.68342 4.90237 6.31658 4.90237 6.70711 5.29289L12 10.5858L17.2929 5.29289C17.6834 4.90237 18.3166 4.90237 18.7071 5.29289C19.0976 5.68342 19.0976 6.31658 18.7071 6.70711L13.4142 12L18.7071 17.2929C19.0976 17.6834 19.0976 18.3166 18.7071 18.7071C18.3166 19.0976 17.6834 19.0976 17.2929 18.7071L12 13.4142L6.70711 18.7071C6.31658 19.0976 5.68342 19.0976 5.29289 18.7071C4.90237 18.3166 4.90237 17.6834 5.29289 17.2929L10.5858 12L5.29289 6.70711C4.90237 6.31658 4.90237 5.68342 5.29289 5.29289Z", fill: color }) })] }));
|
|
1013
|
+
};
|
|
1014
|
+
|
|
1015
|
+
const CallIcon = ({ color = '#000', size = '1em', bgColor = 'transparent', fill = 'none', style, }) => {
|
|
1016
|
+
return (jsxRuntimeExports.jsxs("svg", { viewBox: "0 -0.5 25 25", width: size, height: size, fill: fill, style: Object.assign({ backgroundColor: bgColor }, style), xmlns: "http://www.w3.org/2000/svg", children: [jsxRuntimeExports.jsx("g", { id: "SVGRepo_bgCarrier", strokeWidth: "0" }), jsxRuntimeExports.jsx("g", { id: "SVGRepo_tracerCarrier", strokeLinecap: "round", strokeLinejoin: "round" }), jsxRuntimeExports.jsx("g", { id: "SVGRepo_iconCarrier", children: jsxRuntimeExports.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M6.36343 6.36195C7.24343 5.43495 7.55443 5.17495 7.92943 5.05395C8.18895 4.98595 8.46112 4.98217 8.72243 5.04295C9.06643 5.14295 9.15743 5.21895 10.2854 6.34295C11.2764 7.32995 11.3754 7.43695 11.4704 7.62995C11.6521 7.96873 11.6805 8.36894 11.5484 8.72995C11.4484 9.00495 11.3064 9.18695 10.7054 9.78995L10.3134 10.183C10.2105 10.2876 10.1863 10.4464 10.2534 10.577C11.1244 12.0628 12.36 13.3019 13.8434 14.177C14.0142 14.2684 14.2245 14.2389 14.3634 14.104L14.7404 13.733C14.9734 13.4941 15.2202 13.2691 15.4794 13.059C15.8866 12.809 16.3939 12.7867 16.8214 13C17.0304 13.1 17.0994 13.162 18.1214 14.182C19.1754 15.233 19.2054 15.266 19.3214 15.507C19.5397 15.9059 19.5374 16.3891 19.3154 16.786C19.2024 17.01 19.1334 17.091 18.5404 17.697C18.1824 18.063 17.8454 18.397 17.7914 18.446C17.3022 18.851 16.6746 19.0497 16.0414 19C14.883 18.8944 13.7617 18.5363 12.7564 17.951C10.5296 16.7711 8.63383 15.0521 7.24243 12.951C6.93937 12.5112 6.66994 12.0492 6.43643 11.569C5.81001 10.4953 5.48653 9.27189 5.50043 8.02895C5.54825 7.37871 5.86008 6.77637 6.36343 6.36195Z", stroke: color, strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })] }));
|
|
1206
1017
|
};
|
|
1207
1018
|
|
|
1208
|
-
const
|
|
1209
|
-
return (jsxRuntimeExports.jsxs("svg", { viewBox: "0 -0.5 25 25", width: size, height: size, fill: fill, style: { backgroundColor: bgColor }, xmlns: "http://www.w3.org/2000/svg", children: [jsxRuntimeExports.jsx("g", { id: "SVGRepo_bgCarrier", strokeWidth: "0" }), jsxRuntimeExports.jsx("g", { id: "SVGRepo_tracerCarrier", strokeLinecap: "round", strokeLinejoin: "round" }), jsxRuntimeExports.
|
|
1019
|
+
const HomeIcon = ({ color = '#000', size = '1em', bgColor = 'transparent', fill = 'none', style, }) => {
|
|
1020
|
+
return (jsxRuntimeExports.jsxs("svg", { viewBox: "0 -0.5 25 25", width: size, height: size, fill: fill, style: Object.assign({ backgroundColor: bgColor }, style), xmlns: "http://www.w3.org/2000/svg", children: [jsxRuntimeExports.jsx("g", { id: "SVGRepo_bgCarrier", strokeWidth: "0" }), jsxRuntimeExports.jsx("g", { id: "SVGRepo_tracerCarrier", strokeLinecap: "round", strokeLinejoin: "round" }), jsxRuntimeExports.jsxs("g", { id: "SVGRepo_iconCarrier", children: [jsxRuntimeExports.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M18.867 15.8321L18.873 10.0391L14.75 5.92908C13.5057 4.69031 11.4942 4.69031 10.25 5.92908L6.13599 10.0291V15.8291C6.1393 17.5833 7.56377 19.0028 9.31799 19.0001H15.685C17.438 19.0029 18.862 17.5851 18.867 15.8321Z", stroke: color, strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), jsxRuntimeExports.jsx("path", { d: "M19.624 6.01807C19.624 5.60385 19.2882 5.26807 18.874 5.26807C18.4598 5.26807 18.124 5.60385 18.124 6.01807H19.624ZM18.874 10.0391H18.124C18.124 10.2384 18.2033 10.4295 18.3445 10.5702L18.874 10.0391ZM19.9705 12.1912C20.2638 12.4837 20.7387 12.4829 21.0311 12.1896C21.3236 11.8962 21.3229 11.4214 21.0295 11.1289L19.9705 12.1912ZM6.66552 10.5602C6.95886 10.2678 6.95959 9.79289 6.66714 9.49955C6.3747 9.20621 5.89982 9.20548 5.60648 9.49793L6.66552 10.5602ZM3.97048 11.1289C3.67714 11.4214 3.67641 11.8962 3.96886 12.1896C4.2613 12.4829 4.73618 12.4837 5.02952 12.1912L3.97048 11.1289ZM13.75 19.0001C13.75 19.4143 14.0858 19.7501 14.5 19.7501C14.9142 19.7501 15.25 19.4143 15.25 19.0001H13.75ZM9.75 19.0001C9.75 19.4143 10.0858 19.7501 10.5 19.7501C10.9142 19.7501 11.25 19.4143 11.25 19.0001H9.75ZM18.124 6.01807V10.0391H19.624V6.01807H18.124ZM18.3445 10.5702L19.9705 12.1912L21.0295 11.1289L19.4035 9.50792L18.3445 10.5702ZM5.60648 9.49793L3.97048 11.1289L5.02952 12.1912L6.66552 10.5602L5.60648 9.49793ZM15.25 19.0001V17.2201H13.75V19.0001H15.25ZM15.25 17.2201C15.25 15.7013 14.0188 14.4701 12.5 14.4701V15.9701C13.1904 15.9701 13.75 16.5297 13.75 17.2201H15.25ZM12.5 14.4701C10.9812 14.4701 9.75 15.7013 9.75 17.2201H11.25C11.25 16.5297 11.8096 15.9701 12.5 15.9701V14.4701ZM9.75 17.2201V19.0001H11.25V17.2201H9.75Z", fill: color })] })] }));
|
|
1210
1021
|
};
|
|
1211
1022
|
|
|
1212
|
-
const
|
|
1213
|
-
return (jsxRuntimeExports.jsxs("svg", { viewBox: "0
|
|
1023
|
+
const SearchIcon = ({ color = '#000', size = '1em', bgColor = 'transparent', fill = 'none', style, }) => {
|
|
1024
|
+
return (jsxRuntimeExports.jsxs("svg", { viewBox: "0 0 24 24", width: size, height: size, fill: fill, style: Object.assign({ backgroundColor: bgColor }, style), xmlns: "http://www.w3.org/2000/svg", children: [jsxRuntimeExports.jsx("g", { id: "SVGRepo_bgCarrier", strokeWidth: "0" }), jsxRuntimeExports.jsx("g", { id: "SVGRepo_tracerCarrier", strokeLinecap: "round", strokeLinejoin: "round" }), jsxRuntimeExports.jsx("g", { id: "SVGRepo_iconCarrier", children: jsxRuntimeExports.jsx("g", { id: "Interface / Search_Magnifying_Glass", children: jsxRuntimeExports.jsx("path", { id: "Vector", d: "M15 15L21 21M10 17C6.13401 17 3 13.866 3 10C3 6.13401 6.13401 3 10 3C13.866 3 17 6.13401 17 10C17 13.866 13.866 17 10 17Z", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }) })] }));
|
|
1214
1025
|
};
|
|
1215
1026
|
|
|
1216
|
-
const
|
|
1217
|
-
return (jsxRuntimeExports.jsxs("svg", {
|
|
1027
|
+
const UpArrowIcon = ({ color = '#000', size = '1em', bgColor = 'transparent', fill = 'none', style, }) => {
|
|
1028
|
+
return (jsxRuntimeExports.jsxs("svg", { width: size, height: size, fill: color, style: Object.assign({ backgroundColor: bgColor }, style), viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: [jsxRuntimeExports.jsx("g", { id: "SVGRepo_bgCarrier", strokeWidth: "0" }), jsxRuntimeExports.jsx("g", { id: "SVGRepo_tracerCarrier", strokeLinecap: "round", strokeLinejoin: "round" }), jsxRuntimeExports.jsx("g", { id: "SVGRepo_iconCarrier", children: jsxRuntimeExports.jsx("path", { d: "M3 19h18a1.002 1.002 0 0 0 .823-1.569l-9-13c-.373-.539-1.271-.539-1.645 0l-9 13A.999.999 0 0 0 3 19z" }) })] }));
|
|
1218
1029
|
};
|
|
1219
1030
|
|
|
1220
|
-
const
|
|
1221
|
-
return (jsxRuntimeExports.jsxs("svg", { width: size, height: size, fill:
|
|
1031
|
+
const ImageIcon = ({ color = '#000', size = '1em', bgColor = 'transparent', fill = 'none', style, }) => {
|
|
1032
|
+
return (jsxRuntimeExports.jsxs("svg", { width: size, height: size, fill: fill, style: Object.assign({ backgroundColor: bgColor }, style), viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: [jsxRuntimeExports.jsx("g", { id: "SVGRepo_bgCarrier", strokeWidth: "0" }), jsxRuntimeExports.jsx("g", { id: "SVGRepo_tracerCarrier", strokeLinecap: "round", strokeLinejoin: "round" }), jsxRuntimeExports.jsx("g", { id: "SVGRepo_iconCarrier", children: jsxRuntimeExports.jsx("path", { d: "M14.2639 15.9375L12.5958 14.2834C11.7909 13.4851 11.3884 13.086 10.9266 12.9401C10.5204 12.8118 10.0838 12.8165 9.68048 12.9536C9.22188 13.1095 8.82814 13.5172 8.04068 14.3326L4.04409 18.2801M14.2639 15.9375L14.6053 15.599C15.4112 14.7998 15.8141 14.4002 16.2765 14.2543C16.6831 14.126 17.12 14.1311 17.5236 14.2687C17.9824 14.4251 18.3761 14.8339 19.1634 15.6514L20 16.4934M14.2639 15.9375L18.275 19.9565M18.275 19.9565C17.9176 20 17.4543 20 16.8 20H7.2C6.07989 20 5.51984 20 5.09202 19.782C4.71569 19.5903 4.40973 19.2843 4.21799 18.908C4.12796 18.7313 4.07512 18.5321 4.04409 18.2801M18.275 19.9565C18.5293 19.9256 18.7301 19.8727 18.908 19.782C19.2843 19.5903 19.5903 19.2843 19.782 18.908C20 18.4802 20 17.9201 20 16.8V16.4934M4.04409 18.2801C4 17.9221 4 17.4575 4 16.8V7.2C4 6.0799 4 5.51984 4.21799 5.09202C4.40973 4.71569 4.71569 4.40973 5.09202 4.21799C5.51984 4 6.07989 4 7.2 4H16.8C17.9201 4 18.4802 4 18.908 4.21799C19.2843 4.40973 19.5903 4.71569 19.782 5.09202C20 5.51984 20 6.0799 20 7.2V16.4934M17 8.99989C17 10.1045 16.1046 10.9999 15 10.9999C13.8954 10.9999 13 10.1045 13 8.99989C13 7.89532 13.8954 6.99989 15 6.99989C16.1046 6.99989 17 7.89532 17 8.99989Z", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) })] }));
|
|
1222
1033
|
};
|
|
1223
1034
|
|
|
1224
1035
|
exports.Accordion = Accordion;
|
|
1225
1036
|
exports.Button = Button;
|
|
1226
1037
|
exports.CallIcon = CallIcon;
|
|
1227
1038
|
exports.CloseIcon = CloseIcon;
|
|
1228
|
-
exports.DesktopKeyboardInput = DesktopKeyboardInput;
|
|
1229
1039
|
exports.DownArrowIcon = DownArrowIcon;
|
|
1230
1040
|
exports.Dropdown = Dropdown;
|
|
1231
1041
|
exports.HomeIcon = HomeIcon;
|
|
1042
|
+
exports.ImageIcon = ImageIcon;
|
|
1043
|
+
exports.ImageInput = ImageInput;
|
|
1044
|
+
exports.ImagePlusIcon = ImagePlusIcon;
|
|
1232
1045
|
exports.Input = Input;
|
|
1233
1046
|
exports.Modal = Modal;
|
|
1234
1047
|
exports.RadioGroup = RadioGroup;
|
|
@@ -1237,4 +1050,5 @@ exports.SearchIcon = SearchIcon;
|
|
|
1237
1050
|
exports.Spinner = Spinner;
|
|
1238
1051
|
exports.Tab = Tab;
|
|
1239
1052
|
exports.UpArrowIcon = UpArrowIcon;
|
|
1053
|
+
exports.generateHash = generateHash;
|
|
1240
1054
|
//# sourceMappingURL=index.js.map
|