@tipp/ui 1.1.7 → 1.1.9
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/atoms/drawer.js +2 -2
- package/dist/atoms/field-error-wrapper.js +2 -2
- package/dist/atoms/heading.d.cts +1 -1
- package/dist/atoms/heading.d.ts +1 -1
- package/dist/atoms/index.js +71 -71
- package/dist/atoms/pagination.js +3 -3
- package/dist/chunk-2DF7YI2O.js +123 -0
- package/dist/chunk-2DF7YI2O.js.map +1 -0
- package/dist/chunk-2L4KWP7B.js +53 -0
- package/dist/chunk-2L4KWP7B.js.map +1 -0
- package/dist/chunk-5O5NOQQI.js +91 -0
- package/dist/chunk-5O5NOQQI.js.map +1 -0
- package/dist/chunk-6QAY57B6.js +54 -0
- package/dist/chunk-6QAY57B6.js.map +1 -0
- package/dist/chunk-7ORFESPJ.js +54 -0
- package/dist/chunk-7ORFESPJ.js.map +1 -0
- package/dist/chunk-AEXDX2VS.js +53 -0
- package/dist/chunk-AEXDX2VS.js.map +1 -0
- package/dist/chunk-BUWFX67O.js +54 -0
- package/dist/chunk-BUWFX67O.js.map +1 -0
- package/dist/chunk-CMOA2ZAE.js +54 -0
- package/dist/chunk-CMOA2ZAE.js.map +1 -0
- package/dist/chunk-FU2NF5HR.js +1 -0
- package/dist/chunk-FU2NF5HR.js.map +1 -0
- package/dist/chunk-GLRJ6U7D.js +48 -0
- package/dist/chunk-GLRJ6U7D.js.map +1 -0
- package/dist/chunk-KKYI4MTP.js +54 -0
- package/dist/chunk-KKYI4MTP.js.map +1 -0
- package/dist/chunk-LVWHSYJM.js +16 -0
- package/dist/chunk-LVWHSYJM.js.map +1 -0
- package/dist/chunk-M4ZV2IGG.js +16 -0
- package/dist/chunk-M4ZV2IGG.js.map +1 -0
- package/dist/chunk-NSSO2QWC.js +63 -0
- package/dist/chunk-NSSO2QWC.js.map +1 -0
- package/dist/chunk-PV2PTVNR.js +54 -0
- package/dist/chunk-PV2PTVNR.js.map +1 -0
- package/dist/chunk-SUGQXRH7.js +51 -0
- package/dist/chunk-SUGQXRH7.js.map +1 -0
- package/dist/chunk-T5XKRD6Q.js +54 -0
- package/dist/chunk-T5XKRD6Q.js.map +1 -0
- package/dist/chunk-W32CVWDO.js +53 -0
- package/dist/chunk-W32CVWDO.js.map +1 -0
- package/dist/chunk-XXTSXGYB.js +54 -0
- package/dist/chunk-XXTSXGYB.js.map +1 -0
- package/dist/index.cjs +51 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +101 -97
- package/dist/molecules/date-picker/index.js +2 -2
- package/dist/molecules/dot-navigation.cjs +78 -0
- package/dist/molecules/dot-navigation.cjs.map +1 -0
- package/dist/molecules/dot-navigation.d.cts +17 -0
- package/dist/molecules/dot-navigation.d.ts +17 -0
- package/dist/molecules/dot-navigation.js +9 -0
- package/dist/molecules/dot-navigation.js.map +1 -0
- package/dist/molecules/expand-table/index.js +33 -33
- package/dist/molecules/expand-table/row.js +31 -31
- package/dist/molecules/index.cjs +47 -0
- package/dist/molecules/index.cjs.map +1 -1
- package/dist/molecules/index.d.cts +1 -0
- package/dist/molecules/index.d.ts +1 -0
- package/dist/molecules/index.js +43 -39
- package/dist/molecules/navigation.js +32 -32
- package/dist/utils/index.js +3 -3
- package/package.json +3 -3
- package/src/molecules/dot-navigation.tsx +65 -0
- package/src/molecules/index.ts +1 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Flex
|
|
3
|
+
} from "./chunk-25HMMI7R.js";
|
|
4
|
+
|
|
5
|
+
// src/molecules/dot-navigation.tsx
|
|
6
|
+
import { useCallback, useEffect, useState } from "react";
|
|
7
|
+
import { DotFilledIcon } from "@radix-ui/react-icons";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
function DotNavigation(props) {
|
|
10
|
+
const { dotCount, onClick, dotIndex, defaultDotIndex, onChangeDotIndex } = props;
|
|
11
|
+
const [currentDot, setCurrentDot] = useState(
|
|
12
|
+
() => {
|
|
13
|
+
var _a;
|
|
14
|
+
return (_a = defaultDotIndex != null ? defaultDotIndex : dotIndex) != null ? _a : 0;
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
const onClickDot = useCallback(
|
|
18
|
+
(i) => {
|
|
19
|
+
if (onClick) {
|
|
20
|
+
onClick(i);
|
|
21
|
+
} else {
|
|
22
|
+
setCurrentDot(i);
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
[onClick]
|
|
26
|
+
);
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
onChangeDotIndex == null ? void 0 : onChangeDotIndex(currentDot);
|
|
29
|
+
}, [currentDot, onChangeDotIndex]);
|
|
30
|
+
return /* @__PURE__ */ jsx(Flex, { children: dotCount ? Array.from({ length: dotCount }, (_, i) => i).map((_, index) => {
|
|
31
|
+
const isSelected = currentDot === index;
|
|
32
|
+
return /* @__PURE__ */ jsx(
|
|
33
|
+
DotFilledIcon,
|
|
34
|
+
{
|
|
35
|
+
opacity: isSelected ? void 0 : 0.3,
|
|
36
|
+
fill: "var(--gray-5)",
|
|
37
|
+
height: "24px",
|
|
38
|
+
onClick: () => {
|
|
39
|
+
onClickDot(index);
|
|
40
|
+
},
|
|
41
|
+
style: {
|
|
42
|
+
cursor: "pointer"
|
|
43
|
+
},
|
|
44
|
+
width: "24px"
|
|
45
|
+
},
|
|
46
|
+
index
|
|
47
|
+
);
|
|
48
|
+
}) : null });
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export {
|
|
52
|
+
DotNavigation
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=chunk-7ORFESPJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/molecules/dot-navigation.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState } from 'react';\nimport { DotFilledIcon } from '@radix-ui/react-icons';\nimport { Flex } from '../atoms/flex';\n\nexport interface DotNavigationProps {\n /** 전체 점 갯수 */\n dotCount?: number;\n /** 점 클릭 시 */\n onClick?: (index: number) => void;\n /** 현재 선택된 점 */\n dotIndex?: number;\n /** 기본 점 위치 */\n defaultDotIndex?: number;\n /** 선택된 점 변경 시 실행 */\n onChangeDotIndex?: (index: number) => void;\n}\n\nexport function DotNavigation(props: DotNavigationProps): React.ReactElement {\n const { dotCount, onClick, dotIndex, defaultDotIndex, onChangeDotIndex } =\n props;\n\n const [currentDot, setCurrentDot] = useState<number>(\n () => defaultDotIndex ?? dotIndex ?? 0\n );\n\n const onClickDot = useCallback(\n (i: number) => {\n if (onClick) {\n onClick(i);\n } else {\n setCurrentDot(i);\n }\n },\n [onClick]\n );\n\n useEffect(() => {\n onChangeDotIndex?.(currentDot);\n }, [currentDot, onChangeDotIndex]);\n\n return (\n <Flex>\n {dotCount\n ? Array.from({ length: dotCount }, (_, i) => i).map((_, index) => {\n const isSelected = currentDot === index;\n return (\n <DotFilledIcon\n opacity={isSelected ? undefined : 0.3}\n fill=\"var(--gray-5)\"\n height=\"24px\"\n // eslint-disable-next-line react/no-array-index-key -- index외의 키가 없음\n key={index}\n onClick={() => {\n onClickDot(index);\n }}\n style={{\n cursor: 'pointer',\n }}\n width=\"24px\"\n />\n );\n })\n : null}\n </Flex>\n );\n}\n"],"mappings":";;;;;AAAA,SAAgB,aAAa,WAAW,gBAAgB;AACxD,SAAS,qBAAqB;AA6ChB;AA7BP,SAAS,cAAc,OAA+C;AAC3E,QAAM,EAAE,UAAU,SAAS,UAAU,iBAAiB,iBAAiB,IACrE;AAEF,QAAM,CAAC,YAAY,aAAa,IAAI;AAAA,IAClC,MAAG;AAtBP;AAsBU,+DAAmB,aAAnB,YAA+B;AAAA;AAAA,EACvC;AAEA,QAAM,aAAa;AAAA,IACjB,CAAC,MAAc;AACb,UAAI,SAAS;AACX,gBAAQ,CAAC;AAAA,MACX,OAAO;AACL,sBAAc,CAAC;AAAA,MACjB;AAAA,IACF;AAAA,IACA,CAAC,OAAO;AAAA,EACV;AAEA,YAAU,MAAM;AACd,yDAAmB;AAAA,EACrB,GAAG,CAAC,YAAY,gBAAgB,CAAC;AAEjC,SACE,oBAAC,QACE,qBACG,MAAM,KAAK,EAAE,QAAQ,SAAS,GAAG,CAAC,GAAG,MAAM,CAAC,EAAE,IAAI,CAAC,GAAG,UAAU;AAC9D,UAAM,aAAa,eAAe;AAClC,WACE;AAAA,MAAC;AAAA;AAAA,QACC,SAAS,aAAa,SAAY;AAAA,QAClC,MAAK;AAAA,QACL,QAAO;AAAA,QAGP,SAAS,MAAM;AACb,qBAAW,KAAK;AAAA,QAClB;AAAA,QACA,OAAO;AAAA,UACL,QAAQ;AAAA,QACV;AAAA,QACA,OAAM;AAAA;AAAA,MAPD;AAAA,IAQP;AAAA,EAEJ,CAAC,IACD,MACN;AAEJ;","names":[]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Flex
|
|
3
|
+
} from "./chunk-25HMMI7R.js";
|
|
4
|
+
|
|
5
|
+
// src/molecules/dot-navigation.tsx
|
|
6
|
+
import { useCallback, useEffect, useState } from "react";
|
|
7
|
+
import { DotFilledIcon } from "@radix-ui/react-icons";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
function DotNavigation(props) {
|
|
10
|
+
const { dotCount, onClick, dotIndex, defaultDotIndex, onChangeDotIndex } = props;
|
|
11
|
+
const [currentDot, setCurrentDot] = useState(
|
|
12
|
+
() => {
|
|
13
|
+
var _a;
|
|
14
|
+
return (_a = defaultDotIndex != null ? defaultDotIndex : dotIndex) != null ? _a : 0;
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
const onClickDot = useCallback(
|
|
18
|
+
(i) => {
|
|
19
|
+
if (onClick) {
|
|
20
|
+
onClick(i);
|
|
21
|
+
} else {
|
|
22
|
+
setCurrentDot(i);
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
[onClick]
|
|
26
|
+
);
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
onChangeDotIndex == null ? void 0 : onChangeDotIndex(currentDot);
|
|
29
|
+
}, [currentDot, onChangeDotIndex]);
|
|
30
|
+
return /* @__PURE__ */ jsx(Flex, { gap: "4", children: dotCount ? Array.from({ length: dotCount }, (_, i) => i).map((_, index) => {
|
|
31
|
+
const isSelected = currentDot === index;
|
|
32
|
+
return /* @__PURE__ */ jsx(
|
|
33
|
+
DotFilledIcon,
|
|
34
|
+
{
|
|
35
|
+
color: isSelected ? void 0 : "gray",
|
|
36
|
+
height: "8px",
|
|
37
|
+
onClick: () => {
|
|
38
|
+
onClickDot(index);
|
|
39
|
+
},
|
|
40
|
+
style: {
|
|
41
|
+
cursor: "pointer"
|
|
42
|
+
},
|
|
43
|
+
width: "8px"
|
|
44
|
+
},
|
|
45
|
+
index
|
|
46
|
+
);
|
|
47
|
+
}) : null });
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export {
|
|
51
|
+
DotNavigation
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=chunk-AEXDX2VS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/molecules/dot-navigation.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState } from 'react';\nimport { DotFilledIcon } from '@radix-ui/react-icons';\nimport { Flex } from '../atoms/flex';\n\nexport interface DotNavigationProps {\n /** 전체 점 갯수 */\n dotCount?: number;\n /** 점 클릭 시 */\n onClick?: (index: number) => void;\n /** 현재 선택된 점 */\n dotIndex?: number;\n /** 기본 점 위치 */\n defaultDotIndex?: number;\n /** 선택된 점 변경 시 실행 */\n onChangeDotIndex?: (index: number) => void;\n}\n\nexport function DotNavigation(props: DotNavigationProps): React.ReactElement {\n const { dotCount, onClick, dotIndex, defaultDotIndex, onChangeDotIndex } =\n props;\n\n const [currentDot, setCurrentDot] = useState<number>(\n () => defaultDotIndex ?? dotIndex ?? 0\n );\n\n const onClickDot = useCallback(\n (i: number) => {\n if (onClick) {\n onClick(i);\n } else {\n setCurrentDot(i);\n }\n },\n [onClick]\n );\n\n useEffect(() => {\n onChangeDotIndex?.(currentDot);\n }, [currentDot, onChangeDotIndex]);\n\n return (\n <Flex gap=\"4\">\n {dotCount\n ? Array.from({ length: dotCount }, (_, i) => i).map((_, index) => {\n const isSelected = currentDot === index;\n return (\n <DotFilledIcon\n color={isSelected ? undefined : 'gray'}\n height=\"8px\"\n // eslint-disable-next-line react/no-array-index-key -- index외의 키가 없음\n key={index}\n onClick={() => {\n onClickDot(index);\n }}\n style={{\n cursor: 'pointer',\n }}\n width=\"8px\"\n />\n );\n })\n : null}\n </Flex>\n );\n}\n"],"mappings":";;;;;AAAA,SAAgB,aAAa,WAAW,gBAAgB;AACxD,SAAS,qBAAqB;AA6ChB;AA7BP,SAAS,cAAc,OAA+C;AAC3E,QAAM,EAAE,UAAU,SAAS,UAAU,iBAAiB,iBAAiB,IACrE;AAEF,QAAM,CAAC,YAAY,aAAa,IAAI;AAAA,IAClC,MAAG;AAtBP;AAsBU,+DAAmB,aAAnB,YAA+B;AAAA;AAAA,EACvC;AAEA,QAAM,aAAa;AAAA,IACjB,CAAC,MAAc;AACb,UAAI,SAAS;AACX,gBAAQ,CAAC;AAAA,MACX,OAAO;AACL,sBAAc,CAAC;AAAA,MACjB;AAAA,IACF;AAAA,IACA,CAAC,OAAO;AAAA,EACV;AAEA,YAAU,MAAM;AACd,yDAAmB;AAAA,EACrB,GAAG,CAAC,YAAY,gBAAgB,CAAC;AAEjC,SACE,oBAAC,QAAK,KAAI,KACP,qBACG,MAAM,KAAK,EAAE,QAAQ,SAAS,GAAG,CAAC,GAAG,MAAM,CAAC,EAAE,IAAI,CAAC,GAAG,UAAU;AAC9D,UAAM,aAAa,eAAe;AAClC,WACE;AAAA,MAAC;AAAA;AAAA,QACC,OAAO,aAAa,SAAY;AAAA,QAChC,QAAO;AAAA,QAGP,SAAS,MAAM;AACb,qBAAW,KAAK;AAAA,QAClB;AAAA,QACA,OAAO;AAAA,UACL,QAAQ;AAAA,QACV;AAAA,QACA,OAAM;AAAA;AAAA,MAPD;AAAA,IAQP;AAAA,EAEJ,CAAC,IACD,MACN;AAEJ;","names":[]}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Flex
|
|
3
|
+
} from "./chunk-25HMMI7R.js";
|
|
4
|
+
|
|
5
|
+
// src/molecules/dot-navigation.tsx
|
|
6
|
+
import { useCallback, useEffect, useState } from "react";
|
|
7
|
+
import { DotFilledIcon } from "@radix-ui/react-icons";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
function DotNavigation(props) {
|
|
10
|
+
const { dotCount, onClick, dotIndex, defaultDotIndex, onChangeDotIndex } = props;
|
|
11
|
+
const [currentDot, setCurrentDot] = useState(
|
|
12
|
+
() => {
|
|
13
|
+
var _a;
|
|
14
|
+
return (_a = defaultDotIndex != null ? defaultDotIndex : dotIndex) != null ? _a : 0;
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
const onClickDot = useCallback(
|
|
18
|
+
(i) => {
|
|
19
|
+
if (onClick) {
|
|
20
|
+
onClick(i);
|
|
21
|
+
} else {
|
|
22
|
+
setCurrentDot(i);
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
[onClick]
|
|
26
|
+
);
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
onChangeDotIndex == null ? void 0 : onChangeDotIndex(currentDot);
|
|
29
|
+
}, [currentDot, onChangeDotIndex]);
|
|
30
|
+
return /* @__PURE__ */ jsx(Flex, { gap: "4", children: dotCount ? Array.from({ length: dotCount }, (_, i) => i).map((_, index) => {
|
|
31
|
+
const isSelected = currentDot === index;
|
|
32
|
+
return /* @__PURE__ */ jsx(
|
|
33
|
+
DotFilledIcon,
|
|
34
|
+
{
|
|
35
|
+
color: isSelected ? void 0 : "gray",
|
|
36
|
+
height: "8px",
|
|
37
|
+
fill: "var(--gray-5)",
|
|
38
|
+
onClick: () => {
|
|
39
|
+
onClickDot(index);
|
|
40
|
+
},
|
|
41
|
+
style: {
|
|
42
|
+
cursor: "pointer"
|
|
43
|
+
},
|
|
44
|
+
width: "8px"
|
|
45
|
+
},
|
|
46
|
+
index
|
|
47
|
+
);
|
|
48
|
+
}) : null });
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export {
|
|
52
|
+
DotNavigation
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=chunk-BUWFX67O.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/molecules/dot-navigation.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState } from 'react';\nimport { DotFilledIcon } from '@radix-ui/react-icons';\nimport { Flex } from '../atoms/flex';\n\nexport interface DotNavigationProps {\n /** 전체 점 갯수 */\n dotCount?: number;\n /** 점 클릭 시 */\n onClick?: (index: number) => void;\n /** 현재 선택된 점 */\n dotIndex?: number;\n /** 기본 점 위치 */\n defaultDotIndex?: number;\n /** 선택된 점 변경 시 실행 */\n onChangeDotIndex?: (index: number) => void;\n}\n\nexport function DotNavigation(props: DotNavigationProps): React.ReactElement {\n const { dotCount, onClick, dotIndex, defaultDotIndex, onChangeDotIndex } =\n props;\n\n const [currentDot, setCurrentDot] = useState<number>(\n () => defaultDotIndex ?? dotIndex ?? 0\n );\n\n const onClickDot = useCallback(\n (i: number) => {\n if (onClick) {\n onClick(i);\n } else {\n setCurrentDot(i);\n }\n },\n [onClick]\n );\n\n useEffect(() => {\n onChangeDotIndex?.(currentDot);\n }, [currentDot, onChangeDotIndex]);\n\n return (\n <Flex gap=\"4\">\n {dotCount\n ? Array.from({ length: dotCount }, (_, i) => i).map((_, index) => {\n const isSelected = currentDot === index;\n return (\n <DotFilledIcon\n color={isSelected ? undefined : 'gray'}\n height=\"8px\"\n fill={'var(--gray-5)'}\n // eslint-disable-next-line react/no-array-index-key -- index외의 키가 없음\n key={index}\n onClick={() => {\n onClickDot(index);\n }}\n style={{\n cursor: 'pointer',\n }}\n width=\"8px\"\n />\n );\n })\n : null}\n </Flex>\n );\n}\n"],"mappings":";;;;;AAAA,SAAgB,aAAa,WAAW,gBAAgB;AACxD,SAAS,qBAAqB;AA6ChB;AA7BP,SAAS,cAAc,OAA+C;AAC3E,QAAM,EAAE,UAAU,SAAS,UAAU,iBAAiB,iBAAiB,IACrE;AAEF,QAAM,CAAC,YAAY,aAAa,IAAI;AAAA,IAClC,MAAG;AAtBP;AAsBU,+DAAmB,aAAnB,YAA+B;AAAA;AAAA,EACvC;AAEA,QAAM,aAAa;AAAA,IACjB,CAAC,MAAc;AACb,UAAI,SAAS;AACX,gBAAQ,CAAC;AAAA,MACX,OAAO;AACL,sBAAc,CAAC;AAAA,MACjB;AAAA,IACF;AAAA,IACA,CAAC,OAAO;AAAA,EACV;AAEA,YAAU,MAAM;AACd,yDAAmB;AAAA,EACrB,GAAG,CAAC,YAAY,gBAAgB,CAAC;AAEjC,SACE,oBAAC,QAAK,KAAI,KACP,qBACG,MAAM,KAAK,EAAE,QAAQ,SAAS,GAAG,CAAC,GAAG,MAAM,CAAC,EAAE,IAAI,CAAC,GAAG,UAAU;AAC9D,UAAM,aAAa,eAAe;AAClC,WACE;AAAA,MAAC;AAAA;AAAA,QACC,OAAO,aAAa,SAAY;AAAA,QAChC,QAAO;AAAA,QACP,MAAM;AAAA,QAGN,SAAS,MAAM;AACb,qBAAW,KAAK;AAAA,QAClB;AAAA,QACA,OAAO;AAAA,UACL,QAAQ;AAAA,QACV;AAAA,QACA,OAAM;AAAA;AAAA,MAPD;AAAA,IAQP;AAAA,EAEJ,CAAC,IACD,MACN;AAEJ;","names":[]}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Flex
|
|
3
|
+
} from "./chunk-25HMMI7R.js";
|
|
4
|
+
|
|
5
|
+
// src/molecules/dot-navigation.tsx
|
|
6
|
+
import { useCallback, useEffect, useState } from "react";
|
|
7
|
+
import { DotFilledIcon } from "@radix-ui/react-icons";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
function DotNavigation(props) {
|
|
10
|
+
const { dotCount, onClick, dotIndex, defaultDotIndex, onChangeDotIndex } = props;
|
|
11
|
+
const [currentDot, setCurrentDot] = useState(
|
|
12
|
+
() => {
|
|
13
|
+
var _a;
|
|
14
|
+
return (_a = defaultDotIndex != null ? defaultDotIndex : dotIndex) != null ? _a : 0;
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
const onClickDot = useCallback(
|
|
18
|
+
(i) => {
|
|
19
|
+
if (onClick) {
|
|
20
|
+
onClick(i);
|
|
21
|
+
} else {
|
|
22
|
+
setCurrentDot(i);
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
[onClick]
|
|
26
|
+
);
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
onChangeDotIndex == null ? void 0 : onChangeDotIndex(currentDot);
|
|
29
|
+
}, [currentDot, onChangeDotIndex]);
|
|
30
|
+
return /* @__PURE__ */ jsx(Flex, { gap: "4", children: dotCount ? Array.from({ length: dotCount }, (_, i) => i).map((_, index) => {
|
|
31
|
+
const isSelected = currentDot === index;
|
|
32
|
+
return /* @__PURE__ */ jsx(
|
|
33
|
+
DotFilledIcon,
|
|
34
|
+
{
|
|
35
|
+
color: isSelected ? void 0 : "gray",
|
|
36
|
+
height: "24px",
|
|
37
|
+
fill: "var(--gray-5)",
|
|
38
|
+
onClick: () => {
|
|
39
|
+
onClickDot(index);
|
|
40
|
+
},
|
|
41
|
+
style: {
|
|
42
|
+
cursor: "pointer"
|
|
43
|
+
},
|
|
44
|
+
width: "24px"
|
|
45
|
+
},
|
|
46
|
+
index
|
|
47
|
+
);
|
|
48
|
+
}) : null });
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export {
|
|
52
|
+
DotNavigation
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=chunk-CMOA2ZAE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/molecules/dot-navigation.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState } from 'react';\nimport { DotFilledIcon } from '@radix-ui/react-icons';\nimport { Flex } from '../atoms/flex';\n\nexport interface DotNavigationProps {\n /** 전체 점 갯수 */\n dotCount?: number;\n /** 점 클릭 시 */\n onClick?: (index: number) => void;\n /** 현재 선택된 점 */\n dotIndex?: number;\n /** 기본 점 위치 */\n defaultDotIndex?: number;\n /** 선택된 점 변경 시 실행 */\n onChangeDotIndex?: (index: number) => void;\n}\n\nexport function DotNavigation(props: DotNavigationProps): React.ReactElement {\n const { dotCount, onClick, dotIndex, defaultDotIndex, onChangeDotIndex } =\n props;\n\n const [currentDot, setCurrentDot] = useState<number>(\n () => defaultDotIndex ?? dotIndex ?? 0\n );\n\n const onClickDot = useCallback(\n (i: number) => {\n if (onClick) {\n onClick(i);\n } else {\n setCurrentDot(i);\n }\n },\n [onClick]\n );\n\n useEffect(() => {\n onChangeDotIndex?.(currentDot);\n }, [currentDot, onChangeDotIndex]);\n\n return (\n <Flex gap=\"4\">\n {dotCount\n ? Array.from({ length: dotCount }, (_, i) => i).map((_, index) => {\n const isSelected = currentDot === index;\n return (\n <DotFilledIcon\n color={isSelected ? undefined : 'gray'}\n height=\"24px\"\n fill=\"var(--gray-5)\"\n // eslint-disable-next-line react/no-array-index-key -- index외의 키가 없음\n key={index}\n onClick={() => {\n onClickDot(index);\n }}\n style={{\n cursor: 'pointer',\n }}\n width=\"24px\"\n />\n );\n })\n : null}\n </Flex>\n );\n}\n"],"mappings":";;;;;AAAA,SAAgB,aAAa,WAAW,gBAAgB;AACxD,SAAS,qBAAqB;AA6ChB;AA7BP,SAAS,cAAc,OAA+C;AAC3E,QAAM,EAAE,UAAU,SAAS,UAAU,iBAAiB,iBAAiB,IACrE;AAEF,QAAM,CAAC,YAAY,aAAa,IAAI;AAAA,IAClC,MAAG;AAtBP;AAsBU,+DAAmB,aAAnB,YAA+B;AAAA;AAAA,EACvC;AAEA,QAAM,aAAa;AAAA,IACjB,CAAC,MAAc;AACb,UAAI,SAAS;AACX,gBAAQ,CAAC;AAAA,MACX,OAAO;AACL,sBAAc,CAAC;AAAA,MACjB;AAAA,IACF;AAAA,IACA,CAAC,OAAO;AAAA,EACV;AAEA,YAAU,MAAM;AACd,yDAAmB;AAAA,EACrB,GAAG,CAAC,YAAY,gBAAgB,CAAC;AAEjC,SACE,oBAAC,QAAK,KAAI,KACP,qBACG,MAAM,KAAK,EAAE,QAAQ,SAAS,GAAG,CAAC,GAAG,MAAM,CAAC,EAAE,IAAI,CAAC,GAAG,UAAU;AAC9D,UAAM,aAAa,eAAe;AAClC,WACE;AAAA,MAAC;AAAA;AAAA,QACC,OAAO,aAAa,SAAY;AAAA,QAChC,QAAO;AAAA,QACP,MAAK;AAAA,QAGL,SAAS,MAAM;AACb,qBAAW,KAAK;AAAA,QAClB;AAAA,QACA,OAAO;AAAA,UACL,QAAQ;AAAA,QACV;AAAA,QACA,OAAM;AAAA;AAAA,MAPD;AAAA,IAQP;AAAA,EAEJ,CAAC,IACD,MACN;AAEJ;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=chunk-FU2NF5HR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Flex
|
|
3
|
+
} from "./chunk-25HMMI7R.js";
|
|
4
|
+
|
|
5
|
+
// src/molecules/dot-navigation.tsx
|
|
6
|
+
import { useCallback, useEffect, useState } from "react";
|
|
7
|
+
import { DotFilledIcon } from "@radix-ui/react-icons";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
function DotNavigation(props) {
|
|
10
|
+
const { dotCount, onClick, dotIndex, defaultDotIndex, onChangeDotIndex } = props;
|
|
11
|
+
const [currentDot, setCurrentDot] = useState(
|
|
12
|
+
() => {
|
|
13
|
+
var _a;
|
|
14
|
+
return (_a = defaultDotIndex != null ? defaultDotIndex : dotIndex) != null ? _a : 0;
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
const onClickDot = useCallback(
|
|
18
|
+
(i) => {
|
|
19
|
+
if (onClick) {
|
|
20
|
+
onClick(i);
|
|
21
|
+
} else {
|
|
22
|
+
setCurrentDot(i);
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
[onClick]
|
|
26
|
+
);
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
onChangeDotIndex == null ? void 0 : onChangeDotIndex(currentDot);
|
|
29
|
+
}, [currentDot, onChangeDotIndex]);
|
|
30
|
+
return /* @__PURE__ */ jsx(Flex, { gap: "4", children: dotCount ? Array.from({ length: dotCount }, (_, i) => i).map((_, index) => {
|
|
31
|
+
const isSelected = currentDot === index;
|
|
32
|
+
return /* @__PURE__ */ jsx(
|
|
33
|
+
DotFilledIcon,
|
|
34
|
+
{
|
|
35
|
+
color: isSelected ? "gray" : void 0,
|
|
36
|
+
onClick: () => {
|
|
37
|
+
onClickDot(index);
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
index
|
|
41
|
+
);
|
|
42
|
+
}) : null });
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export {
|
|
46
|
+
DotNavigation
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=chunk-GLRJ6U7D.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/molecules/dot-navigation.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState } from 'react';\nimport { DotFilledIcon } from '@radix-ui/react-icons';\nimport { Flex } from '../atoms/flex';\n\nexport interface DotNavigationProps {\n /** 전체 점 갯수 */\n dotCount?: number;\n /** 점 클릭 시 */\n onClick?: (index: number) => void;\n /** 현재 선택된 점 */\n dotIndex?: number;\n /** 기본 점 위치 */\n defaultDotIndex?: number;\n /** 선택된 점 변경 시 실행 */\n onChangeDotIndex?: (index: number) => void;\n}\n\nexport function DotNavigation(props: DotNavigationProps): React.ReactElement {\n const { dotCount, onClick, dotIndex, defaultDotIndex, onChangeDotIndex } =\n props;\n\n const [currentDot, setCurrentDot] = useState<number>(\n () => defaultDotIndex ?? dotIndex ?? 0\n );\n\n const onClickDot = useCallback(\n (i: number) => {\n if (onClick) {\n onClick(i);\n } else {\n setCurrentDot(i);\n }\n },\n [onClick]\n );\n\n useEffect(() => {\n onChangeDotIndex?.(currentDot);\n }, [currentDot, onChangeDotIndex]);\n\n return (\n <Flex gap=\"4\">\n {dotCount\n ? Array.from({ length: dotCount }, (_, i) => i).map((_, index) => {\n const isSelected = currentDot === index;\n return (\n <DotFilledIcon\n color={isSelected ? 'gray' : undefined}\n // eslint-disable-next-line react/no-array-index-key -- index외의 키가 없음\n key={index}\n onClick={() => {\n onClickDot(index);\n }}\n />\n );\n })\n : null}\n </Flex>\n );\n}\n"],"mappings":";;;;;AAAA,SAAgB,aAAa,WAAW,gBAAgB;AACxD,SAAS,qBAAqB;AA6ChB;AA7BP,SAAS,cAAc,OAA+C;AAC3E,QAAM,EAAE,UAAU,SAAS,UAAU,iBAAiB,iBAAiB,IACrE;AAEF,QAAM,CAAC,YAAY,aAAa,IAAI;AAAA,IAClC,MAAG;AAtBP;AAsBU,+DAAmB,aAAnB,YAA+B;AAAA;AAAA,EACvC;AAEA,QAAM,aAAa;AAAA,IACjB,CAAC,MAAc;AACb,UAAI,SAAS;AACX,gBAAQ,CAAC;AAAA,MACX,OAAO;AACL,sBAAc,CAAC;AAAA,MACjB;AAAA,IACF;AAAA,IACA,CAAC,OAAO;AAAA,EACV;AAEA,YAAU,MAAM;AACd,yDAAmB;AAAA,EACrB,GAAG,CAAC,YAAY,gBAAgB,CAAC;AAEjC,SACE,oBAAC,QAAK,KAAI,KACP,qBACG,MAAM,KAAK,EAAE,QAAQ,SAAS,GAAG,CAAC,GAAG,MAAM,CAAC,EAAE,IAAI,CAAC,GAAG,UAAU;AAC9D,UAAM,aAAa,eAAe;AAClC,WACE;AAAA,MAAC;AAAA;AAAA,QACC,OAAO,aAAa,SAAS;AAAA,QAG7B,SAAS,MAAM;AACb,qBAAW,KAAK;AAAA,QAClB;AAAA;AAAA,MAHK;AAAA,IAIP;AAAA,EAEJ,CAAC,IACD,MACN;AAEJ;","names":[]}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Flex
|
|
3
|
+
} from "./chunk-25HMMI7R.js";
|
|
4
|
+
|
|
5
|
+
// src/molecules/dot-navigation.tsx
|
|
6
|
+
import { useCallback, useEffect, useState } from "react";
|
|
7
|
+
import { DotFilledIcon } from "@radix-ui/react-icons";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
function DotNavigation(props) {
|
|
10
|
+
const { dotCount, onClick, dotIndex, defaultDotIndex, onChangeDotIndex } = props;
|
|
11
|
+
const [currentDot, setCurrentDot] = useState(
|
|
12
|
+
() => {
|
|
13
|
+
var _a;
|
|
14
|
+
return (_a = defaultDotIndex != null ? defaultDotIndex : dotIndex) != null ? _a : 0;
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
const onClickDot = useCallback(
|
|
18
|
+
(i) => {
|
|
19
|
+
if (onClick) {
|
|
20
|
+
onClick(i);
|
|
21
|
+
} else {
|
|
22
|
+
setCurrentDot(i);
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
[onClick]
|
|
26
|
+
);
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
onChangeDotIndex == null ? void 0 : onChangeDotIndex(currentDot);
|
|
29
|
+
}, [currentDot, onChangeDotIndex]);
|
|
30
|
+
return /* @__PURE__ */ jsx(Flex, { children: dotCount ? Array.from({ length: dotCount }, (_, i) => i).map((_, index) => {
|
|
31
|
+
const isSelected = currentDot === index;
|
|
32
|
+
return /* @__PURE__ */ jsx(
|
|
33
|
+
DotFilledIcon,
|
|
34
|
+
{
|
|
35
|
+
opacity: isSelected ? void 0 : 3,
|
|
36
|
+
fill: "var(--gray-5)",
|
|
37
|
+
height: "24px",
|
|
38
|
+
onClick: () => {
|
|
39
|
+
onClickDot(index);
|
|
40
|
+
},
|
|
41
|
+
style: {
|
|
42
|
+
cursor: "pointer"
|
|
43
|
+
},
|
|
44
|
+
width: "24px"
|
|
45
|
+
},
|
|
46
|
+
index
|
|
47
|
+
);
|
|
48
|
+
}) : null });
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export {
|
|
52
|
+
DotNavigation
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=chunk-KKYI4MTP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/molecules/dot-navigation.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState } from 'react';\nimport { DotFilledIcon } from '@radix-ui/react-icons';\nimport { Flex } from '../atoms/flex';\n\nexport interface DotNavigationProps {\n /** 전체 점 갯수 */\n dotCount?: number;\n /** 점 클릭 시 */\n onClick?: (index: number) => void;\n /** 현재 선택된 점 */\n dotIndex?: number;\n /** 기본 점 위치 */\n defaultDotIndex?: number;\n /** 선택된 점 변경 시 실행 */\n onChangeDotIndex?: (index: number) => void;\n}\n\nexport function DotNavigation(props: DotNavigationProps): React.ReactElement {\n const { dotCount, onClick, dotIndex, defaultDotIndex, onChangeDotIndex } =\n props;\n\n const [currentDot, setCurrentDot] = useState<number>(\n () => defaultDotIndex ?? dotIndex ?? 0\n );\n\n const onClickDot = useCallback(\n (i: number) => {\n if (onClick) {\n onClick(i);\n } else {\n setCurrentDot(i);\n }\n },\n [onClick]\n );\n\n useEffect(() => {\n onChangeDotIndex?.(currentDot);\n }, [currentDot, onChangeDotIndex]);\n\n return (\n <Flex>\n {dotCount\n ? Array.from({ length: dotCount }, (_, i) => i).map((_, index) => {\n const isSelected = currentDot === index;\n return (\n <DotFilledIcon\n opacity={isSelected ? undefined : 3}\n fill=\"var(--gray-5)\"\n height=\"24px\"\n // eslint-disable-next-line react/no-array-index-key -- index외의 키가 없음\n key={index}\n onClick={() => {\n onClickDot(index);\n }}\n style={{\n cursor: 'pointer',\n }}\n width=\"24px\"\n />\n );\n })\n : null}\n </Flex>\n );\n}\n"],"mappings":";;;;;AAAA,SAAgB,aAAa,WAAW,gBAAgB;AACxD,SAAS,qBAAqB;AA6ChB;AA7BP,SAAS,cAAc,OAA+C;AAC3E,QAAM,EAAE,UAAU,SAAS,UAAU,iBAAiB,iBAAiB,IACrE;AAEF,QAAM,CAAC,YAAY,aAAa,IAAI;AAAA,IAClC,MAAG;AAtBP;AAsBU,+DAAmB,aAAnB,YAA+B;AAAA;AAAA,EACvC;AAEA,QAAM,aAAa;AAAA,IACjB,CAAC,MAAc;AACb,UAAI,SAAS;AACX,gBAAQ,CAAC;AAAA,MACX,OAAO;AACL,sBAAc,CAAC;AAAA,MACjB;AAAA,IACF;AAAA,IACA,CAAC,OAAO;AAAA,EACV;AAEA,YAAU,MAAM;AACd,yDAAmB;AAAA,EACrB,GAAG,CAAC,YAAY,gBAAgB,CAAC;AAEjC,SACE,oBAAC,QACE,qBACG,MAAM,KAAK,EAAE,QAAQ,SAAS,GAAG,CAAC,GAAG,MAAM,CAAC,EAAE,IAAI,CAAC,GAAG,UAAU;AAC9D,UAAM,aAAa,eAAe;AAClC,WACE;AAAA,MAAC;AAAA;AAAA,QACC,SAAS,aAAa,SAAY;AAAA,QAClC,MAAK;AAAA,QACL,QAAO;AAAA,QAGP,SAAS,MAAM;AACb,qBAAW,KAAK;AAAA,QAClB;AAAA,QACA,OAAO;AAAA,UACL,QAAQ;AAAA,QACV;AAAA,QACA,OAAM;AAAA;AAAA,MAPD;AAAA,IAQP;AAAA,EAEJ,CAAC,IACD,MACN;AAEJ;","names":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Flex
|
|
3
|
+
} from "./chunk-25HMMI7R.js";
|
|
4
|
+
|
|
5
|
+
// src/molecules/dot-navigation.tsx
|
|
6
|
+
import { DotFilledIcon } from "@radix-ui/react-icons";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
function DotNavigation(props) {
|
|
9
|
+
const { dotCount, onClick, currentDotIndex, defaultDotIndex } = props;
|
|
10
|
+
return /* @__PURE__ */ jsx(Flex, { children: dotCount ? Array.from({ length: dotCount }, (_, i) => i).map((_, index) => /* @__PURE__ */ jsx(DotFilledIcon, {})) : null });
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export {
|
|
14
|
+
DotNavigation
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=chunk-LVWHSYJM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/molecules/dot-navigation.tsx"],"sourcesContent":["import React from 'react';\nimport { DotFilledIcon } from '@radix-ui/react-icons';\nimport { Flex } from '../atoms/flex';\n\nexport interface DotNavigationProps {\n /** 전체 점 갯수 */\n dotCount?: number;\n /** 점 클릭 시 */\n onClick?: (index: number) => void;\n /** 현재 선택된 점 */\n currentDotIndex?: number;\n /** 기본 점 위치 */\n defaultDotIndex?: number;\n}\n\nexport function DotNavigation(props: DotNavigationProps): React.ReactElement {\n const { dotCount, onClick, currentDotIndex, defaultDotIndex } = props;\n return (\n <Flex>\n {dotCount\n ? Array.from({ length: dotCount }, (_, i) => i).map((_, index) => (\n <DotFilledIcon />\n ))\n : null}\n </Flex>\n );\n}\n"],"mappings":";;;;;AACA,SAAS,qBAAqB;AAoBlB;AANL,SAAS,cAAc,OAA+C;AAC3E,QAAM,EAAE,UAAU,SAAS,iBAAiB,gBAAgB,IAAI;AAChE,SACE,oBAAC,QACE,qBACG,MAAM,KAAK,EAAE,QAAQ,SAAS,GAAG,CAAC,GAAG,MAAM,CAAC,EAAE,IAAI,CAAC,GAAG,UACpD,oBAAC,iBAAc,CAChB,IACD,MACN;AAEJ;","names":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Flex
|
|
3
|
+
} from "./chunk-25HMMI7R.js";
|
|
4
|
+
|
|
5
|
+
// src/molecules/dot-navigation.tsx
|
|
6
|
+
import { DotFilledIcon } from "@radix-ui/react-icons";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
function DotNavigation(props) {
|
|
9
|
+
const { dotCount, onClick, currentDotIndex, defaultDotIndex } = props;
|
|
10
|
+
return /* @__PURE__ */ jsx(Flex, { children: dotCount ? Array.from({ length: dotCount }, (_, i) => i).map((_, index) => /* @__PURE__ */ jsx(DotFilledIcon, {})) : null });
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export {
|
|
14
|
+
DotNavigation
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=chunk-M4ZV2IGG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/molecules/dot-navigation.tsx"],"sourcesContent":["import React from 'react';\nimport { DotFilledIcon } from '@radix-ui/react-icons';\nimport { Flex } from '../atoms/flex';\n\nexport interface DotNavigationProps {\n /** 전체 점 갯수 */\n dotCount?: number;\n /** 점 클릭 시 */\n onClick?: (index: number) => void;\n /** 현재 선택된 점 */\n currentDotIndex?: number;\n /** 기본 점 위치 */\n defaultDotIndex?: number;\n}\n\nexport function DotNavigation(props: DotNavigationProps): React.ReactElement {\n const { dotCount, onClick, currentDotIndex, defaultDotIndex } = props;\n\n return (\n <Flex>\n {dotCount\n ? Array.from({ length: dotCount }, (_, i) => i).map((_, index) => (\n <DotFilledIcon />\n ))\n : null}\n </Flex>\n );\n}\n"],"mappings":";;;;;AACA,SAAS,qBAAqB;AAqBlB;AAPL,SAAS,cAAc,OAA+C;AAC3E,QAAM,EAAE,UAAU,SAAS,iBAAiB,gBAAgB,IAAI;AAEhE,SACE,oBAAC,QACE,qBACG,MAAM,KAAK,EAAE,QAAQ,SAAS,GAAG,CAAC,GAAG,MAAM,CAAC,EAAE,IAAI,CAAC,GAAG,UACpD,oBAAC,iBAAc,CAChB,IACD,MACN;AAEJ;","names":[]}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Typo
|
|
3
|
+
} from "./chunk-O3XTRD7R.js";
|
|
4
|
+
import {
|
|
5
|
+
Button
|
|
6
|
+
} from "./chunk-AQX7DQLI.js";
|
|
7
|
+
import {
|
|
8
|
+
Flex
|
|
9
|
+
} from "./chunk-25HMMI7R.js";
|
|
10
|
+
|
|
11
|
+
// src/molecules/navigation.tsx
|
|
12
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
function Navigation({
|
|
14
|
+
items,
|
|
15
|
+
fontColor,
|
|
16
|
+
backgroundColor,
|
|
17
|
+
activeKey
|
|
18
|
+
}) {
|
|
19
|
+
return /* @__PURE__ */ jsx(
|
|
20
|
+
Flex,
|
|
21
|
+
{
|
|
22
|
+
direction: "column",
|
|
23
|
+
gap: "4",
|
|
24
|
+
pr: "3",
|
|
25
|
+
style: {
|
|
26
|
+
color: fontColor || "var(--white-a12)",
|
|
27
|
+
backgroundColor: backgroundColor || "var(--black-a12)"
|
|
28
|
+
},
|
|
29
|
+
children: items == null ? void 0 : items.map((item) => {
|
|
30
|
+
const { key, title, icon, itemRender, onClick, children } = item;
|
|
31
|
+
return /* @__PURE__ */ jsxs(Flex, { direction: "column", onClick, children: [
|
|
32
|
+
itemRender ? itemRender(item) : /* @__PURE__ */ jsxs(Flex, { align: "center", gap: "3", height: "36px", pl: "4", pr: "4", children: [
|
|
33
|
+
icon,
|
|
34
|
+
/* @__PURE__ */ jsx(Typo, { variant: "subtitle", children: title })
|
|
35
|
+
] }),
|
|
36
|
+
children == null ? void 0 : children.map((menu) => {
|
|
37
|
+
return menu.itemRender ? menu.itemRender(menu) : /* @__PURE__ */ jsx(
|
|
38
|
+
Button,
|
|
39
|
+
{
|
|
40
|
+
className: `tipp-navigation-button ${activeKey === menu.key ? "active" : ""}`,
|
|
41
|
+
ml: "37px",
|
|
42
|
+
onClick: menu.onClick,
|
|
43
|
+
size: "large",
|
|
44
|
+
style: {
|
|
45
|
+
color: "var(--white-a12)",
|
|
46
|
+
height: "32px",
|
|
47
|
+
paddingLeft: "var(--space-2)"
|
|
48
|
+
},
|
|
49
|
+
children: menu.title
|
|
50
|
+
},
|
|
51
|
+
menu.key
|
|
52
|
+
);
|
|
53
|
+
})
|
|
54
|
+
] }, key);
|
|
55
|
+
})
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export {
|
|
61
|
+
Navigation
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=chunk-NSSO2QWC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/molecules/navigation.tsx"],"sourcesContent":["import React from 'react';\nimport { Button, Flex, Typo } from '../atoms';\n\ninterface Item {\n itemRender?: (item: Item) => React.ReactNode;\n key: string;\n onClick?: () => void;\n title: string;\n icon?: React.ReactNode;\n children?: Item[];\n}\n\nexport interface NavigationProps {\n items?: Item[];\n fontColor?: string;\n backgroundColor?: string;\n activeKey?: string;\n}\n\nexport function Navigation({\n items,\n fontColor,\n backgroundColor,\n activeKey,\n}: NavigationProps): React.ReactNode {\n return (\n <Flex\n direction=\"column\"\n gap=\"4\"\n pr=\"3\"\n style={{\n color: fontColor || 'var(--white-a12)',\n backgroundColor: backgroundColor || 'var(--black-a12)',\n }}\n >\n {items?.map((item) => {\n const { key, title, icon, itemRender, onClick, children } = item;\n return (\n <Flex direction=\"column\" key={key} onClick={onClick}>\n {itemRender ? (\n itemRender(item)\n ) : (\n <Flex align=\"center\" gap=\"3\" height=\"36px\" pl=\"4\" pr=\"4\">\n {icon}\n <Typo variant=\"subtitle\">{title}</Typo>\n </Flex>\n )}\n {children?.map((menu) => {\n return menu.itemRender ? (\n menu.itemRender(menu)\n ) : (\n <Button\n className={`tipp-navigation-button ${activeKey === menu.key ? 'active' : ''}`}\n key={menu.key}\n ml=\"37px\"\n onClick={menu.onClick}\n size=\"large\"\n style={{\n color: 'var(--white-a12)',\n height: '32px',\n paddingLeft: 'var(--space-2)',\n }}\n >\n {menu.title}\n </Button>\n );\n })}\n </Flex>\n );\n })}\n </Flex>\n );\n}\n"],"mappings":";;;;;;;;;;;AA0Cc,SAEE,KAFF;AAvBP,SAAS,WAAW;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAqC;AACnC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAU;AAAA,MACV,KAAI;AAAA,MACJ,IAAG;AAAA,MACH,OAAO;AAAA,QACL,OAAO,aAAa;AAAA,QACpB,iBAAiB,mBAAmB;AAAA,MACtC;AAAA,MAEC,yCAAO,IAAI,CAAC,SAAS;AACpB,cAAM,EAAE,KAAK,OAAO,MAAM,YAAY,SAAS,SAAS,IAAI;AAC5D,eACE,qBAAC,QAAK,WAAU,UAAmB,SAChC;AAAA,uBACC,WAAW,IAAI,IAEf,qBAAC,QAAK,OAAM,UAAS,KAAI,KAAI,QAAO,QAAO,IAAG,KAAI,IAAG,KAClD;AAAA;AAAA,YACD,oBAAC,QAAK,SAAQ,YAAY,iBAAM;AAAA,aAClC;AAAA,UAED,qCAAU,IAAI,CAAC,SAAS;AACvB,mBAAO,KAAK,aACV,KAAK,WAAW,IAAI,IAEpB;AAAA,cAAC;AAAA;AAAA,gBACC,WAAW,0BAA0B,cAAc,KAAK,MAAM,WAAW,EAAE;AAAA,gBAE3E,IAAG;AAAA,gBACH,SAAS,KAAK;AAAA,gBACd,MAAK;AAAA,gBACL,OAAO;AAAA,kBACL,OAAO;AAAA,kBACP,QAAQ;AAAA,kBACR,aAAa;AAAA,gBACf;AAAA,gBAEC,eAAK;AAAA;AAAA,cAVD,KAAK;AAAA,YAWZ;AAAA,UAEJ;AAAA,aA5B4B,GA6B9B;AAAA,MAEJ;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Flex
|
|
3
|
+
} from "./chunk-25HMMI7R.js";
|
|
4
|
+
|
|
5
|
+
// src/molecules/dot-navigation.tsx
|
|
6
|
+
import { useCallback, useEffect, useState } from "react";
|
|
7
|
+
import { DotFilledIcon } from "@radix-ui/react-icons";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
function DotNavigation(props) {
|
|
10
|
+
const { dotCount, onClick, dotIndex, defaultDotIndex, onChangeDotIndex } = props;
|
|
11
|
+
const [currentDot, setCurrentDot] = useState(
|
|
12
|
+
() => {
|
|
13
|
+
var _a;
|
|
14
|
+
return (_a = defaultDotIndex != null ? defaultDotIndex : dotIndex) != null ? _a : 0;
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
const onClickDot = useCallback(
|
|
18
|
+
(i) => {
|
|
19
|
+
if (onClick) {
|
|
20
|
+
onClick(i);
|
|
21
|
+
} else {
|
|
22
|
+
setCurrentDot(i);
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
[onClick]
|
|
26
|
+
);
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
onChangeDotIndex == null ? void 0 : onChangeDotIndex(currentDot);
|
|
29
|
+
}, [currentDot, onChangeDotIndex]);
|
|
30
|
+
return /* @__PURE__ */ jsx(Flex, { children: dotCount ? Array.from({ length: dotCount }, (_, i) => i).map((_, index) => {
|
|
31
|
+
const isSelected = currentDot === index;
|
|
32
|
+
return /* @__PURE__ */ jsx(
|
|
33
|
+
DotFilledIcon,
|
|
34
|
+
{
|
|
35
|
+
color: isSelected ? void 0 : "gray",
|
|
36
|
+
fill: "var(--gray-5)",
|
|
37
|
+
height: "24px",
|
|
38
|
+
onClick: () => {
|
|
39
|
+
onClickDot(index);
|
|
40
|
+
},
|
|
41
|
+
style: {
|
|
42
|
+
cursor: "pointer"
|
|
43
|
+
},
|
|
44
|
+
width: "24px"
|
|
45
|
+
},
|
|
46
|
+
index
|
|
47
|
+
);
|
|
48
|
+
}) : null });
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export {
|
|
52
|
+
DotNavigation
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=chunk-PV2PTVNR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/molecules/dot-navigation.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState } from 'react';\nimport { DotFilledIcon } from '@radix-ui/react-icons';\nimport { Flex } from '../atoms/flex';\n\nexport interface DotNavigationProps {\n /** 전체 점 갯수 */\n dotCount?: number;\n /** 점 클릭 시 */\n onClick?: (index: number) => void;\n /** 현재 선택된 점 */\n dotIndex?: number;\n /** 기본 점 위치 */\n defaultDotIndex?: number;\n /** 선택된 점 변경 시 실행 */\n onChangeDotIndex?: (index: number) => void;\n}\n\nexport function DotNavigation(props: DotNavigationProps): React.ReactElement {\n const { dotCount, onClick, dotIndex, defaultDotIndex, onChangeDotIndex } =\n props;\n\n const [currentDot, setCurrentDot] = useState<number>(\n () => defaultDotIndex ?? dotIndex ?? 0\n );\n\n const onClickDot = useCallback(\n (i: number) => {\n if (onClick) {\n onClick(i);\n } else {\n setCurrentDot(i);\n }\n },\n [onClick]\n );\n\n useEffect(() => {\n onChangeDotIndex?.(currentDot);\n }, [currentDot, onChangeDotIndex]);\n\n return (\n <Flex>\n {dotCount\n ? Array.from({ length: dotCount }, (_, i) => i).map((_, index) => {\n const isSelected = currentDot === index;\n return (\n <DotFilledIcon\n color={isSelected ? undefined : 'gray'}\n fill=\"var(--gray-5)\"\n height=\"24px\"\n // eslint-disable-next-line react/no-array-index-key -- index외의 키가 없음\n key={index}\n onClick={() => {\n onClickDot(index);\n }}\n style={{\n cursor: 'pointer',\n }}\n width=\"24px\"\n />\n );\n })\n : null}\n </Flex>\n );\n}\n"],"mappings":";;;;;AAAA,SAAgB,aAAa,WAAW,gBAAgB;AACxD,SAAS,qBAAqB;AA6ChB;AA7BP,SAAS,cAAc,OAA+C;AAC3E,QAAM,EAAE,UAAU,SAAS,UAAU,iBAAiB,iBAAiB,IACrE;AAEF,QAAM,CAAC,YAAY,aAAa,IAAI;AAAA,IAClC,MAAG;AAtBP;AAsBU,+DAAmB,aAAnB,YAA+B;AAAA;AAAA,EACvC;AAEA,QAAM,aAAa;AAAA,IACjB,CAAC,MAAc;AACb,UAAI,SAAS;AACX,gBAAQ,CAAC;AAAA,MACX,OAAO;AACL,sBAAc,CAAC;AAAA,MACjB;AAAA,IACF;AAAA,IACA,CAAC,OAAO;AAAA,EACV;AAEA,YAAU,MAAM;AACd,yDAAmB;AAAA,EACrB,GAAG,CAAC,YAAY,gBAAgB,CAAC;AAEjC,SACE,oBAAC,QACE,qBACG,MAAM,KAAK,EAAE,QAAQ,SAAS,GAAG,CAAC,GAAG,MAAM,CAAC,EAAE,IAAI,CAAC,GAAG,UAAU;AAC9D,UAAM,aAAa,eAAe;AAClC,WACE;AAAA,MAAC;AAAA;AAAA,QACC,OAAO,aAAa,SAAY;AAAA,QAChC,MAAK;AAAA,QACL,QAAO;AAAA,QAGP,SAAS,MAAM;AACb,qBAAW,KAAK;AAAA,QAClB;AAAA,QACA,OAAO;AAAA,UACL,QAAQ;AAAA,QACV;AAAA,QACA,OAAM;AAAA;AAAA,MAPD;AAAA,IAQP;AAAA,EAEJ,CAAC,IACD,MACN;AAEJ;","names":[]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Flex
|
|
3
|
+
} from "./chunk-25HMMI7R.js";
|
|
4
|
+
|
|
5
|
+
// src/molecules/dot-navigation.tsx
|
|
6
|
+
import { useCallback, useEffect, useState } from "react";
|
|
7
|
+
import { DotFilledIcon } from "@radix-ui/react-icons";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
function DotNavigation(props) {
|
|
10
|
+
const { dotCount, onClick, dotIndex, defaultDotIndex, onChangeDotIndex } = props;
|
|
11
|
+
const [currentDot, setCurrentDot] = useState(
|
|
12
|
+
() => {
|
|
13
|
+
var _a;
|
|
14
|
+
return (_a = defaultDotIndex != null ? defaultDotIndex : dotIndex) != null ? _a : 0;
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
const onClickDot = useCallback(
|
|
18
|
+
(i) => {
|
|
19
|
+
if (onClick) {
|
|
20
|
+
onClick(i);
|
|
21
|
+
} else {
|
|
22
|
+
setCurrentDot(i);
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
[onClick]
|
|
26
|
+
);
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
onChangeDotIndex == null ? void 0 : onChangeDotIndex(currentDot);
|
|
29
|
+
}, [currentDot, onChangeDotIndex]);
|
|
30
|
+
return /* @__PURE__ */ jsx(Flex, { gap: "4", children: dotCount ? Array.from({ length: dotCount }, (_, i) => i).map((_, index) => {
|
|
31
|
+
const isSelected = currentDot === index;
|
|
32
|
+
return /* @__PURE__ */ jsx(
|
|
33
|
+
DotFilledIcon,
|
|
34
|
+
{
|
|
35
|
+
color: isSelected ? "gray" : void 0,
|
|
36
|
+
onClick: () => {
|
|
37
|
+
onClickDot(index);
|
|
38
|
+
},
|
|
39
|
+
style: {
|
|
40
|
+
cursor: "pointer"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
index
|
|
44
|
+
);
|
|
45
|
+
}) : null });
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export {
|
|
49
|
+
DotNavigation
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=chunk-SUGQXRH7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/molecules/dot-navigation.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState } from 'react';\nimport { DotFilledIcon } from '@radix-ui/react-icons';\nimport { Flex } from '../atoms/flex';\n\nexport interface DotNavigationProps {\n /** 전체 점 갯수 */\n dotCount?: number;\n /** 점 클릭 시 */\n onClick?: (index: number) => void;\n /** 현재 선택된 점 */\n dotIndex?: number;\n /** 기본 점 위치 */\n defaultDotIndex?: number;\n /** 선택된 점 변경 시 실행 */\n onChangeDotIndex?: (index: number) => void;\n}\n\nexport function DotNavigation(props: DotNavigationProps): React.ReactElement {\n const { dotCount, onClick, dotIndex, defaultDotIndex, onChangeDotIndex } =\n props;\n\n const [currentDot, setCurrentDot] = useState<number>(\n () => defaultDotIndex ?? dotIndex ?? 0\n );\n\n const onClickDot = useCallback(\n (i: number) => {\n if (onClick) {\n onClick(i);\n } else {\n setCurrentDot(i);\n }\n },\n [onClick]\n );\n\n useEffect(() => {\n onChangeDotIndex?.(currentDot);\n }, [currentDot, onChangeDotIndex]);\n\n return (\n <Flex gap=\"4\">\n {dotCount\n ? Array.from({ length: dotCount }, (_, i) => i).map((_, index) => {\n const isSelected = currentDot === index;\n return (\n <DotFilledIcon\n color={isSelected ? 'gray' : undefined}\n // eslint-disable-next-line react/no-array-index-key -- index외의 키가 없음\n key={index}\n onClick={() => {\n onClickDot(index);\n }}\n style={{\n cursor: 'pointer',\n }}\n />\n );\n })\n : null}\n </Flex>\n );\n}\n"],"mappings":";;;;;AAAA,SAAgB,aAAa,WAAW,gBAAgB;AACxD,SAAS,qBAAqB;AA6ChB;AA7BP,SAAS,cAAc,OAA+C;AAC3E,QAAM,EAAE,UAAU,SAAS,UAAU,iBAAiB,iBAAiB,IACrE;AAEF,QAAM,CAAC,YAAY,aAAa,IAAI;AAAA,IAClC,MAAG;AAtBP;AAsBU,+DAAmB,aAAnB,YAA+B;AAAA;AAAA,EACvC;AAEA,QAAM,aAAa;AAAA,IACjB,CAAC,MAAc;AACb,UAAI,SAAS;AACX,gBAAQ,CAAC;AAAA,MACX,OAAO;AACL,sBAAc,CAAC;AAAA,MACjB;AAAA,IACF;AAAA,IACA,CAAC,OAAO;AAAA,EACV;AAEA,YAAU,MAAM;AACd,yDAAmB;AAAA,EACrB,GAAG,CAAC,YAAY,gBAAgB,CAAC;AAEjC,SACE,oBAAC,QAAK,KAAI,KACP,qBACG,MAAM,KAAK,EAAE,QAAQ,SAAS,GAAG,CAAC,GAAG,MAAM,CAAC,EAAE,IAAI,CAAC,GAAG,UAAU;AAC9D,UAAM,aAAa,eAAe;AAClC,WACE;AAAA,MAAC;AAAA;AAAA,QACC,OAAO,aAAa,SAAS;AAAA,QAG7B,SAAS,MAAM;AACb,qBAAW,KAAK;AAAA,QAClB;AAAA,QACA,OAAO;AAAA,UACL,QAAQ;AAAA,QACV;AAAA;AAAA,MANK;AAAA,IAOP;AAAA,EAEJ,CAAC,IACD,MACN;AAEJ;","names":[]}
|