@daeryun/dr_components 1.1.28 → 1.1.30

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.
@@ -7,5 +7,6 @@ declare const AreaImage: (props: {
7
7
  src: string;
8
8
  };
9
9
  isGroup: boolean;
10
+ alt?: string;
10
11
  }) => React.JSX.Element;
11
12
  export default AreaImage;
@@ -3,10 +3,11 @@ import React from 'react';
3
3
  import Link from 'next/link';
4
4
  import Image from 'next/image';
5
5
  const AreaImage = (props) => {
6
+ var _a;
6
7
  const { area, isGroup } = props;
7
8
  return area.name === '' ? (<div className={`relative aspect-square text-white max-md:h-full max-md:w-full`}></div>) : (<Link href={area.src !== '' ? (isGroup ? `/map/${area.src}` : `https://www.daeryunlaw.com/map/${area.src}`) : ''} target={isGroup ? '' : '_blank'} aria-label={'오시는길 ' + area.name + '사무소'} className={(area.src != '' ? 'cursor-pointer' : 'pointer-events-none cursor-default ') + ' group'}>
8
9
  <div aria-label={area.name} className={`relative flex aspect-square items-center justify-center text-white max-md:h-full max-md:w-full`}>
9
- <Image src={`https://d1tgonli21s4df.cloudfront.net/main_new/${area.url}`} alt={''} draggable={'false'} fill className={'object-cover'} sizes={'100%'}/>
10
+ <Image src={`https://d1tgonli21s4df.cloudfront.net/main_new/${area.url}`} alt={(_a = props.alt) !== null && _a !== void 0 ? _a : ''} draggable={'false'} fill className={'object-cover'} sizes={'100%'}/>
10
11
 
11
12
  <div className={'absolute h-full w-full bg-black bg-opacity-50 p-[13px] opacity-0 transition-[opacity] group-hover:opacity-100 max-3xl:p-[10px] max-xxl:p-[10px] max-xl:p-[7px] max-lg:p-[6px] '} aria-label={area.name}>
12
13
  <div className={'flex h-full w-full items-center justify-center border border-solid border-white'}>
@@ -4,7 +4,11 @@ import React, { useState } from 'react';
4
4
  import Link from 'next/link';
5
5
  import Image from 'next/image';
6
6
 
7
- const AreaImage = (props: { area: { name: string; desc: string; url: string; src: string }; isGroup: boolean }) => {
7
+ const AreaImage = (props: {
8
+ area: { name: string; desc: string; url: string; src: string };
9
+ isGroup: boolean;
10
+ alt?: string;
11
+ }) => {
8
12
  const { area, isGroup } = props;
9
13
 
10
14
  return area.name === '' ? (
@@ -22,7 +26,7 @@ const AreaImage = (props: { area: { name: string; desc: string; url: string; src
22
26
  >
23
27
  <Image
24
28
  src={`https://d1tgonli21s4df.cloudfront.net/main_new/${area.url}`}
25
- alt={''}
29
+ alt={props.alt ?? ''}
26
30
  draggable={'false'}
27
31
  fill
28
32
  className={'object-cover'}
@@ -3,10 +3,12 @@ import 'swiper/css';
3
3
  import 'swiper/css/grid';
4
4
  import 'swiper/css/pagination';
5
5
  import 'swiper/swiper-bundle.css';
6
+ import { IMapAlt } from '../common/types/map';
6
7
  declare const MapFix: (props: {
7
8
  selectRegion: string;
8
9
  mapFixOpen: boolean;
9
10
  isGroup?: boolean;
10
11
  setMapFixOpen: any;
12
+ mapAltList?: IMapAlt[];
11
13
  }) => React.JSX.Element;
12
14
  export default MapFix;
@@ -14,7 +14,7 @@ import { SwiperSlide } from 'swiper/react';
14
14
  import Link from 'next/link';
15
15
  import { usePathname, useRouter } from 'next/navigation';
16
16
  const MapFix = (props) => {
17
- const { selectRegion, mapFixOpen, isGroup = true, setMapFixOpen } = props;
17
+ const { selectRegion, mapFixOpen, isGroup = true, setMapFixOpen, mapAltList } = props;
18
18
  const router = useRouter();
19
19
  const pathname = usePathname();
20
20
  const [mapAreas, setMapAreas] = useState([]);
@@ -66,8 +66,8 @@ const MapFix = (props) => {
66
66
  useEffect(() => {
67
67
  setMapFixOpen(false);
68
68
  }, [pathname]);
69
- return (<div ref={divRef} className={'overflow-hidden rounded-t-[10px] bg-[#fff] shadow-[0px_-3px_6px_#00000029] transition-[transform,height] duration-700 ease-linear md:hidden ' +
70
- (mapFixOpen ? ' h-[400px] translate-y-0 ' : ' z-0 h-[0px] translate-y-[500px] ')}>
69
+ return (<div ref={divRef} className={'fixed bottom-[70px] z-[99] w-full overflow-hidden rounded-t-[10px] bg-[#fff] shadow-[0px_-3px_6px_#00000029] transition-[transform,height] duration-700 ease-linear md:hidden ' +
70
+ (mapFixOpen ? ' h-[400px] translate-y-0 ' : ' h-[0px] translate-y-[500px] ')}>
71
71
  <div className={'relative flex h-full w-full flex-col justify-between px-[30px] pb-10 pt-[30px] md:hidden '}>
72
72
  <span>
73
73
  <Image src={OnlineIcon} width={54} height={54} alt={'지도 레이어 팝업 닫기'} className={'absolute right-5 top-5 h-[15px] w-[15px] cursor-pointer'} draggable={false} onClick={() => {
@@ -81,8 +81,9 @@ const MapFix = (props) => {
81
81
  {mapAreas && mapAreas.length > 0 ? ([...Array(Math.ceil(mapAreas.length / 6))].map((_, wrapperIndex) => {
82
82
  return (<SwiperSlide className={'mb-[5px] mr-[5px] !grid !grid-cols-3 !gap-[5px]'} key={wrapperIndex}>
83
83
  {[...Array(6)].map((_, areaIndex) => {
84
+ var _a;
84
85
  const index = wrapperIndex * 6 + areaIndex;
85
- return mapAreas[index] ? (<AreaImage area={mapAreas[index]} key={areaIndex} isGroup={isGroup}/>) : (<></>);
86
+ return mapAreas[index] ? (<AreaImage area={mapAreas[index]} key={areaIndex} isGroup={isGroup} alt={(_a = mapAltList === null || mapAltList === void 0 ? void 0 : mapAltList.filter((i) => i.key === mapAreas[index].src).map((item) => item.keyword).join(',')) !== null && _a !== void 0 ? _a : ''}/>) : (<></>);
86
87
  })}
87
88
  </SwiperSlide>);
88
89
  })) : (<></>)}
@@ -14,9 +14,16 @@ import 'swiper/swiper-bundle.css';
14
14
  import { SwiperSlide } from 'swiper/react';
15
15
  import Link from 'next/link';
16
16
  import { usePathname, useRouter } from 'next/navigation';
17
+ import { IMapAlt } from '../common/types/map';
17
18
 
18
- const MapFix = (props: { selectRegion: string; mapFixOpen: boolean; isGroup?: boolean; setMapFixOpen: any }) => {
19
- const { selectRegion, mapFixOpen, isGroup = true, setMapFixOpen } = props;
19
+ const MapFix = (props: {
20
+ selectRegion: string;
21
+ mapFixOpen: boolean;
22
+ isGroup?: boolean;
23
+ setMapFixOpen: any;
24
+ mapAltList?: IMapAlt[];
25
+ }) => {
26
+ const { selectRegion, mapFixOpen, isGroup = true, setMapFixOpen, mapAltList } = props;
20
27
  const router = useRouter();
21
28
  const pathname = usePathname();
22
29
 
@@ -82,8 +89,8 @@ const MapFix = (props: { selectRegion: string; mapFixOpen: boolean; isGroup?: bo
82
89
  <div
83
90
  ref={divRef}
84
91
  className={
85
- 'overflow-hidden rounded-t-[10px] bg-[#fff] shadow-[0px_-3px_6px_#00000029] transition-[transform,height] duration-700 ease-linear md:hidden ' +
86
- (mapFixOpen ? ' h-[400px] translate-y-0 ' : ' z-0 h-[0px] translate-y-[500px] ')
92
+ 'fixed bottom-[70px] z-[99] w-full overflow-hidden rounded-t-[10px] bg-[#fff] shadow-[0px_-3px_6px_#00000029] transition-[transform,height] duration-700 ease-linear md:hidden ' +
93
+ (mapFixOpen ? ' h-[400px] translate-y-0 ' : ' h-[0px] translate-y-[500px] ')
87
94
  }
88
95
  >
89
96
  <div
@@ -123,6 +130,10 @@ const MapFix = (props: { selectRegion: string; mapFixOpen: boolean; isGroup?: bo
123
130
  area={mapAreas[index]}
124
131
  key={areaIndex}
125
132
  isGroup={isGroup}
133
+ alt={mapAltList
134
+ ?.filter((i) => i.key === mapAreas[index].src)
135
+ .map((item) => item.keyword)
136
+ .join(',') ?? ''}
126
137
  />
127
138
  ) : (
128
139
  <></>
@@ -3,12 +3,14 @@ import 'swiper/css';
3
3
  import 'swiper/css/navigation';
4
4
  import 'swiper/css/pagination';
5
5
  import { IInitialDataTypes } from '../common';
6
- declare const MapSection: ({ initialData, selectRegion, setSelectRegion, setMapFixOpen, Title, isGroup }: {
6
+ import { IMapAlt } from '../common/types/map';
7
+ declare const MapSection: ({ initialData, selectRegion, setSelectRegion, setMapFixOpen, Title, isGroup, mapAltList }: {
7
8
  initialData: IInitialDataTypes;
8
9
  selectRegion: string;
9
10
  setSelectRegion: any;
10
11
  setMapFixOpen: any;
11
12
  Title: React.ReactNode;
12
13
  isGroup?: boolean;
14
+ mapAltList?: IMapAlt[];
13
15
  }) => React.JSX.Element;
14
16
  export default MapSection;
@@ -11,7 +11,7 @@ import AreaImage from '../MapFix/AreaImage';
11
11
  import { newNapArea } from '../common';
12
12
  import Map from './Map';
13
13
  import Link from 'next/link';
14
- const MapSection = ({ initialData, selectRegion, setSelectRegion, setMapFixOpen, Title, isGroup = true }) => {
14
+ const MapSection = ({ initialData, selectRegion, setSelectRegion, setMapFixOpen, Title, isGroup = true, mapAltList }) => {
15
15
  const router = useRouter();
16
16
  const { width } = useBrowser();
17
17
  const [mapAreas, setMapAreas] = useState([]);
@@ -45,7 +45,8 @@ const MapSection = ({ initialData, selectRegion, setSelectRegion, setMapFixOpen,
45
45
 
46
46
  <div className={'grid grid-cols-4 gap-3 max-lg:gap-2 max-md2:gap-1'} tabIndex={-1} aria-label={selectRegion + ' 선택됨.'}>
47
47
  {mapAreas && mapAreas.length > 0 ? (mapAreas.map((area, index) => {
48
- return <AreaImage key={index} area={area} isGroup={isGroup}/>;
48
+ var _a;
49
+ return (<AreaImage key={index} area={area} isGroup={isGroup} alt={(_a = mapAltList === null || mapAltList === void 0 ? void 0 : mapAltList.filter(i => i.key === area.src).map(item => item.keyword).join(',')) !== null && _a !== void 0 ? _a : ''}/>);
49
50
  })) : (<></>)}
50
51
  </div>
51
52
  </div>
@@ -12,6 +12,7 @@ import AreaImage from '../MapFix/AreaImage';
12
12
  import { IInitialDataTypes, newNapArea } from '../common';
13
13
  import Map from './Map';
14
14
  import Link from 'next/link';
15
+ import { IMapAlt } from '../common/types/map';
15
16
 
16
17
  const MapSection = ({
17
18
  initialData,
@@ -19,7 +20,8 @@ const MapSection = ({
19
20
  setSelectRegion,
20
21
  setMapFixOpen,
21
22
  Title,
22
- isGroup = true
23
+ isGroup = true,
24
+ mapAltList
23
25
  }: {
24
26
  initialData: IInitialDataTypes;
25
27
  selectRegion: string;
@@ -27,6 +29,7 @@ const MapSection = ({
27
29
  setMapFixOpen: any;
28
30
  Title: React.ReactNode;
29
31
  isGroup?: boolean;
32
+ mapAltList?: IMapAlt[];
30
33
  }) => {
31
34
  const router = useRouter();
32
35
 
@@ -106,7 +109,19 @@ const MapSection = ({
106
109
  >
107
110
  {mapAreas && mapAreas.length > 0 ? (
108
111
  mapAreas.map((area, index) => {
109
- return <AreaImage key={index} area={area} isGroup={isGroup} />;
112
+ return (
113
+ <AreaImage
114
+ key={index}
115
+ area={area}
116
+ isGroup={isGroup}
117
+ alt={
118
+ mapAltList
119
+ ?.filter(i => i.key === area.src)
120
+ .map(item => item.keyword)
121
+ .join(',') ?? ''
122
+ }
123
+ />
124
+ );
110
125
  })
111
126
  ) : (
112
127
  <></>
@@ -31,3 +31,8 @@ export interface IOfficeListTypes {
31
31
  modified_br_name?: string | null;
32
32
  br_code?: string | null;
33
33
  }
34
+ export interface IMapAlt {
35
+ office_code: string;
36
+ keyword: string;
37
+ key: string;
38
+ }
@@ -32,3 +32,9 @@ export interface IOfficeListTypes {
32
32
  modified_br_name?: string | null;
33
33
  br_code?: string | null;
34
34
  }
35
+
36
+ export interface IMapAlt {
37
+ office_code: string
38
+ keyword: string
39
+ key: string
40
+ }
@@ -123,8 +123,10 @@ const RightTextItem = ({ item, consult_step, index }) => {
123
123
  </div>
124
124
  <ul className="flex flex-col text-[18px] leading-[1.8] max-xl:gap-[3px] max-xl:text-[16px] max-xl:leading-[1.4]">
125
125
  {li.list.slice(1, -1).map((l, l_index) => {
126
- return (<li key={l_index} className={'flex gap-[13px] max-xl:gap-[10px]'}>
127
- <span>•</span>
126
+ return (<li key={l_index} className={'flex gap-[13px] max-xl:gap-[10px] ' +
127
+ (l_index === 1 ? 'mb-4' : '')}>
128
+ {l_index % 2 === 0 ? (<span>•</span>) : (<span className={'pl-5 max-xl:pl-4'}>→</span>)}
129
+
128
130
  {l}
129
131
  </li>);
130
132
  })}
@@ -258,9 +258,17 @@ const RightTextItem = ({
258
258
  return (
259
259
  <li
260
260
  key={l_index}
261
- className={'flex gap-[13px] max-xl:gap-[10px]'}
261
+ className={
262
+ 'flex gap-[13px] max-xl:gap-[10px] ' +
263
+ (l_index === 1 ? 'mb-4' : '')
264
+ }
262
265
  >
263
- <span>•</span>
266
+ {l_index % 2 === 0 ? (
267
+ <span>•</span>
268
+ ) : (
269
+ <span className={'pl-5 max-xl:pl-4'}>→</span>
270
+ )}
271
+
264
272
  {l}
265
273
  </li>
266
274
  );
@@ -962,6 +962,10 @@ html {
962
962
  bottom: 60px;
963
963
  }
964
964
 
965
+ .bottom-\[70px\] {
966
+ bottom: 70px;
967
+ }
968
+
965
969
  .bottom-\[80px\] {
966
970
  bottom: 80px;
967
971
  }
@@ -7262,6 +7266,10 @@ html {
7262
7266
  padding-left: 1rem;
7263
7267
  }
7264
7268
 
7269
+ .pl-5 {
7270
+ padding-left: 1.25rem;
7271
+ }
7272
+
7265
7273
  .pl-8 {
7266
7274
  padding-left: 2rem;
7267
7275
  }
@@ -12695,6 +12703,10 @@ body {
12695
12703
  padding-bottom: 50px;
12696
12704
  }
12697
12705
 
12706
+ .max-xl\:pl-4 {
12707
+ padding-left: 1rem;
12708
+ }
12709
+
12698
12710
  .max-xl\:pl-\[11px\] {
12699
12711
  padding-left: 11px;
12700
12712
  }