@shoplflow/base 0.46.17 → 0.46.18
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/index.cjs +96 -23
- package/dist/index.d.cts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +97 -24
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -5459,7 +5459,7 @@ var SmallStyledDayDatepickerWrapper = styled6__default.default.div`
|
|
|
5459
5459
|
&__day-names {
|
|
5460
5460
|
width: 100%;
|
|
5461
5461
|
height: 18px;
|
|
5462
|
-
margin: 8px 0 0;
|
|
5462
|
+
margin: 8px 0 8px 0;
|
|
5463
5463
|
display: flex;
|
|
5464
5464
|
justify-content: space-between;
|
|
5465
5465
|
align-items: center;
|
|
@@ -5860,8 +5860,7 @@ var Header = styled6__default.default.div`
|
|
|
5860
5860
|
gap: 8px;
|
|
5861
5861
|
`;
|
|
5862
5862
|
var Month = styled6__default.default.p`
|
|
5863
|
-
|
|
5864
|
-
color: ${exports.colorTokens.neutral700};
|
|
5863
|
+
display: flex;
|
|
5865
5864
|
cursor: pointer;
|
|
5866
5865
|
`;
|
|
5867
5866
|
var DatePickerWrapper = styled6__default.default.div`
|
|
@@ -6013,6 +6012,7 @@ var YearStepper = ({
|
|
|
6013
6012
|
changeYear,
|
|
6014
6013
|
minDate,
|
|
6015
6014
|
maxDate,
|
|
6015
|
+
sizeVar = "M",
|
|
6016
6016
|
className
|
|
6017
6017
|
}) => {
|
|
6018
6018
|
const [isOpen, setIsOpen] = utils.useOutsideClick({
|
|
@@ -6029,10 +6029,17 @@ var YearStepper = ({
|
|
|
6029
6029
|
exports.IconButton,
|
|
6030
6030
|
{
|
|
6031
6031
|
styleVar: "GHOST",
|
|
6032
|
-
sizeVar: "S",
|
|
6032
|
+
sizeVar: sizeVar === "S" ? "XS" : "S",
|
|
6033
6033
|
onClick: decreaseYear,
|
|
6034
6034
|
disabled: prevYearButtonDisabled || date.getFullYear() === startYear,
|
|
6035
|
-
|
|
6035
|
+
iconSizeVar: sizeVar === "S" ? "XS" : "S",
|
|
6036
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6037
|
+
exports.Icon,
|
|
6038
|
+
{
|
|
6039
|
+
iconSource: sizeVar === "S" ? ShoplAssets.LeftArrowXsmallIcon : ShoplAssets.LeftArrowIcon,
|
|
6040
|
+
color: prevYearButtonDisabled ? "neutral200" : "neutral700"
|
|
6041
|
+
}
|
|
6042
|
+
)
|
|
6036
6043
|
}
|
|
6037
6044
|
),
|
|
6038
6045
|
/* @__PURE__ */ jsxRuntime.jsxs(exports.Popper, { placement: "bottom", middlewares: [core.flip(), core.shift({ padding: 5 })], children: [
|
|
@@ -6044,7 +6051,7 @@ var YearStepper = ({
|
|
|
6044
6051
|
event.stopPropagation();
|
|
6045
6052
|
setIsOpen((prev) => !prev);
|
|
6046
6053
|
},
|
|
6047
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(exports.Text, { typography: "title1_700", children: `${date.getFullYear()}` })
|
|
6054
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(exports.Text, { typography: sizeVar === "M" ? "title1_700" : "body1_700", children: `${date.getFullYear()}` })
|
|
6048
6055
|
}
|
|
6049
6056
|
) }),
|
|
6050
6057
|
/* @__PURE__ */ jsxRuntime.jsx(exports.Popper.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -6066,10 +6073,17 @@ var YearStepper = ({
|
|
|
6066
6073
|
exports.IconButton,
|
|
6067
6074
|
{
|
|
6068
6075
|
styleVar: "GHOST",
|
|
6069
|
-
sizeVar: "S",
|
|
6076
|
+
sizeVar: sizeVar === "S" ? "XS" : "S",
|
|
6070
6077
|
onClick: increaseYear,
|
|
6071
6078
|
disabled: nextYearButtonDisabled || date.getFullYear() === endYear,
|
|
6072
|
-
|
|
6079
|
+
iconSizeVar: sizeVar === "S" ? "XS" : "S",
|
|
6080
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6081
|
+
exports.Icon,
|
|
6082
|
+
{
|
|
6083
|
+
iconSource: sizeVar === "S" ? ShoplAssets.RightArrowXsmallIcon : ShoplAssets.RightArrowIcon,
|
|
6084
|
+
color: nextYearButtonDisabled ? "neutral200" : "neutral700"
|
|
6085
|
+
}
|
|
6086
|
+
)
|
|
6073
6087
|
}
|
|
6074
6088
|
)
|
|
6075
6089
|
] });
|
|
@@ -6697,42 +6711,98 @@ var getEachWeekAreaStyle = (props) => {
|
|
|
6697
6711
|
`;
|
|
6698
6712
|
}
|
|
6699
6713
|
};
|
|
6714
|
+
var getWeekContainerStyleBySizeVar = (sizeVar) => {
|
|
6715
|
+
if (sizeVar === "S") {
|
|
6716
|
+
return react$1.css`
|
|
6717
|
+
width: 280px;
|
|
6718
|
+
max-width: 280px;
|
|
6719
|
+
gap: 8px;
|
|
6720
|
+
padding: 16px;
|
|
6721
|
+
`;
|
|
6722
|
+
}
|
|
6723
|
+
return react$1.css`
|
|
6724
|
+
width: 400px;
|
|
6725
|
+
max-width: 400px;
|
|
6726
|
+
gap: 16px;
|
|
6727
|
+
padding: 16px 24px 24px;
|
|
6728
|
+
`;
|
|
6729
|
+
};
|
|
6730
|
+
var getWeekAreaStyleBySizeVar = (sizeVar) => {
|
|
6731
|
+
if (sizeVar === "S") {
|
|
6732
|
+
return react$1.css`
|
|
6733
|
+
grid-row-gap: 0;
|
|
6734
|
+
background-color: ${exports.colorTokens.neutral100};
|
|
6735
|
+
`;
|
|
6736
|
+
}
|
|
6737
|
+
return react$1.css`
|
|
6738
|
+
grid-row-gap: 8px;
|
|
6739
|
+
background-color: ${exports.colorTokens.neutral0};
|
|
6740
|
+
`;
|
|
6741
|
+
};
|
|
6742
|
+
var getEachWeekAreaStyleBySizeVar = (sizeVar) => {
|
|
6743
|
+
if (sizeVar === "S") {
|
|
6744
|
+
return react$1.css`
|
|
6745
|
+
height: 32px;
|
|
6746
|
+
`;
|
|
6747
|
+
}
|
|
6748
|
+
return react$1.css`
|
|
6749
|
+
height: 48px;
|
|
6750
|
+
`;
|
|
6751
|
+
};
|
|
6752
|
+
var getEachWeekDateStyleBySizeVar = (sizeVar) => {
|
|
6753
|
+
if (sizeVar === "S") {
|
|
6754
|
+
return react$1.css`
|
|
6755
|
+
width: 100%;
|
|
6756
|
+
height: 32px;
|
|
6757
|
+
font-size: 12px;
|
|
6758
|
+
line-height: 16px;
|
|
6759
|
+
border-radius: 0;
|
|
6760
|
+
`;
|
|
6761
|
+
}
|
|
6762
|
+
return react$1.css`
|
|
6763
|
+
width: 48px;
|
|
6764
|
+
height: 48px;
|
|
6765
|
+
font-size: 14px;
|
|
6766
|
+
line-height: 48px;
|
|
6767
|
+
border-radius: 50%;
|
|
6768
|
+
`;
|
|
6769
|
+
};
|
|
6700
6770
|
var WeekContainer = styled6__default.default.div`
|
|
6701
6771
|
display: flex;
|
|
6702
6772
|
flex-direction: column;
|
|
6703
|
-
|
|
6704
|
-
|
|
6705
|
-
gap: 16px;
|
|
6706
|
-
padding: 16px 24px 24px;
|
|
6773
|
+
|
|
6774
|
+
${({ sizeVar }) => getWeekContainerStyleBySizeVar(sizeVar)}
|
|
6707
6775
|
`;
|
|
6708
6776
|
var WeekArea = styled6__default.default.div`
|
|
6709
6777
|
width: 100%;
|
|
6710
6778
|
display: grid;
|
|
6711
6779
|
grid-template-columns: repeat(7, 1fr);
|
|
6712
|
-
|
|
6780
|
+
border-radius: 4px;
|
|
6781
|
+
overflow: hidden;
|
|
6782
|
+
|
|
6783
|
+
${({ sizeVar }) => getWeekAreaStyleBySizeVar(sizeVar)}
|
|
6713
6784
|
`;
|
|
6714
6785
|
var EachWeekArea = styled6__default.default.div`
|
|
6715
6786
|
width: 100%;
|
|
6716
|
-
height: 48px;
|
|
6717
6787
|
display: flex;
|
|
6718
6788
|
justify-content: center;
|
|
6719
6789
|
align-items: center;
|
|
6720
6790
|
position: relative;
|
|
6721
6791
|
|
|
6792
|
+
${({ sizeVar }) => getEachWeekAreaStyleBySizeVar(sizeVar)}
|
|
6722
6793
|
${(props) => getEachWeekAreaStyle(props)}
|
|
6723
6794
|
`;
|
|
6724
6795
|
var EachWeekDate = styled6__default.default.div`
|
|
6725
|
-
|
|
6726
|
-
|
|
6796
|
+
display: flex;
|
|
6797
|
+
justify-content: center;
|
|
6798
|
+
align-items: center;
|
|
6727
6799
|
text-align: center;
|
|
6728
|
-
font-size: 14px;
|
|
6729
|
-
line-height: 48px;
|
|
6730
6800
|
padding: 0;
|
|
6731
|
-
border-radius: 50%;
|
|
6732
6801
|
cursor: pointer;
|
|
6733
6802
|
position: absolute;
|
|
6734
6803
|
z-index: 10;
|
|
6735
6804
|
|
|
6805
|
+
${({ sizeVar }) => getEachWeekDateStyleBySizeVar(sizeVar)}
|
|
6736
6806
|
${(props) => getEachDateStyle3(props)}
|
|
6737
6807
|
`;
|
|
6738
6808
|
function getWeeksInYear(year) {
|
|
@@ -6757,7 +6827,8 @@ var WeekDatepicker = ({
|
|
|
6757
6827
|
initEndDate,
|
|
6758
6828
|
minDate,
|
|
6759
6829
|
maxDate,
|
|
6760
|
-
onlySingleWeek
|
|
6830
|
+
onlySingleWeek,
|
|
6831
|
+
sizeVar = "M"
|
|
6761
6832
|
}) => {
|
|
6762
6833
|
const year = initStartDate ? dateFns.getISOWeekYear(initStartDate) : dateFns.getISOWeekYear(/* @__PURE__ */ new Date());
|
|
6763
6834
|
const [currentDate, setCurrentDate] = React.useState(new Date(year, 5, 5));
|
|
@@ -6824,10 +6895,11 @@ var WeekDatepicker = ({
|
|
|
6824
6895
|
});
|
|
6825
6896
|
}
|
|
6826
6897
|
};
|
|
6827
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(WeekContainer, { children: [
|
|
6898
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(WeekContainer, { sizeVar, children: [
|
|
6828
6899
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6829
6900
|
YearStepper_default,
|
|
6830
6901
|
{
|
|
6902
|
+
sizeVar,
|
|
6831
6903
|
date: currentDate,
|
|
6832
6904
|
decreaseYear: () => {
|
|
6833
6905
|
setCurrentDate(new Date(currentDate.getFullYear() - 1, currentDate.getMonth(), currentDate.getDate()));
|
|
@@ -6844,7 +6916,7 @@ var WeekDatepicker = ({
|
|
|
6844
6916
|
}
|
|
6845
6917
|
}
|
|
6846
6918
|
),
|
|
6847
|
-
/* @__PURE__ */ jsxRuntime.jsx(WeekArea, { children: Years.map((each, index) => {
|
|
6919
|
+
/* @__PURE__ */ jsxRuntime.jsx(WeekArea, { sizeVar, children: Years.map((each, index) => {
|
|
6848
6920
|
const currentYear = currentDate.getFullYear();
|
|
6849
6921
|
const currentWeek = Number(each);
|
|
6850
6922
|
const isStart = currentYear === (selectedStartWeekAndYear == null ? void 0 : selectedStartWeekAndYear[1]) && currentWeek === (selectedStartWeekAndYear == null ? void 0 : selectedStartWeekAndYear[0]);
|
|
@@ -6901,6 +6973,7 @@ var WeekDatepicker = ({
|
|
|
6901
6973
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6902
6974
|
EachWeekArea,
|
|
6903
6975
|
{
|
|
6976
|
+
sizeVar,
|
|
6904
6977
|
inRange,
|
|
6905
6978
|
isStart,
|
|
6906
6979
|
isReady,
|
|
@@ -6912,7 +6985,7 @@ var WeekDatepicker = ({
|
|
|
6912
6985
|
}
|
|
6913
6986
|
clickWeek(Number(each), currentDate.getFullYear());
|
|
6914
6987
|
},
|
|
6915
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(EachWeekDate, { inRange, isStart, isEnd, disabled, children: [
|
|
6988
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(EachWeekDate, { sizeVar, inRange, isStart, isEnd, disabled, children: [
|
|
6916
6989
|
"W",
|
|
6917
6990
|
each
|
|
6918
6991
|
] })
|
package/dist/index.d.cts
CHANGED
|
@@ -1581,6 +1581,10 @@ type WeekDatepickerProps = {
|
|
|
1581
1581
|
* 하나의 주만 선택 여부
|
|
1582
1582
|
*/
|
|
1583
1583
|
onlySingleWeek?: boolean;
|
|
1584
|
+
/**
|
|
1585
|
+
* 사이즈 - 기본값: M
|
|
1586
|
+
*/
|
|
1587
|
+
sizeVar?: 'S' | 'M';
|
|
1584
1588
|
};
|
|
1585
1589
|
type WeekDatepickerStyleType = {
|
|
1586
1590
|
inRange: boolean;
|
|
@@ -1589,7 +1593,7 @@ type WeekDatepickerStyleType = {
|
|
|
1589
1593
|
disabled: boolean;
|
|
1590
1594
|
};
|
|
1591
1595
|
|
|
1592
|
-
declare const WeekDatepicker: ({ handleWeekClick, initStartDate, initEndDate, minDate, maxDate, onlySingleWeek, }: WeekDatepickerProps) => react_jsx_runtime.JSX.Element;
|
|
1596
|
+
declare const WeekDatepicker: ({ handleWeekClick, initStartDate, initEndDate, minDate, maxDate, onlySingleWeek, sizeVar, }: WeekDatepickerProps) => react_jsx_runtime.JSX.Element;
|
|
1593
1597
|
|
|
1594
1598
|
type YearSelectProps = {
|
|
1595
1599
|
optionList: Array<{
|
package/dist/index.d.ts
CHANGED
|
@@ -1581,6 +1581,10 @@ type WeekDatepickerProps = {
|
|
|
1581
1581
|
* 하나의 주만 선택 여부
|
|
1582
1582
|
*/
|
|
1583
1583
|
onlySingleWeek?: boolean;
|
|
1584
|
+
/**
|
|
1585
|
+
* 사이즈 - 기본값: M
|
|
1586
|
+
*/
|
|
1587
|
+
sizeVar?: 'S' | 'M';
|
|
1584
1588
|
};
|
|
1585
1589
|
type WeekDatepickerStyleType = {
|
|
1586
1590
|
inRange: boolean;
|
|
@@ -1589,7 +1593,7 @@ type WeekDatepickerStyleType = {
|
|
|
1589
1593
|
disabled: boolean;
|
|
1590
1594
|
};
|
|
1591
1595
|
|
|
1592
|
-
declare const WeekDatepicker: ({ handleWeekClick, initStartDate, initEndDate, minDate, maxDate, onlySingleWeek, }: WeekDatepickerProps) => react_jsx_runtime.JSX.Element;
|
|
1596
|
+
declare const WeekDatepicker: ({ handleWeekClick, initStartDate, initEndDate, minDate, maxDate, onlySingleWeek, sizeVar, }: WeekDatepickerProps) => react_jsx_runtime.JSX.Element;
|
|
1593
1597
|
|
|
1594
1598
|
type YearSelectProps = {
|
|
1595
1599
|
optionList: Array<{
|
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import { FloatingPortal, autoUpdate, offset, autoPlacement } from '@floating-ui/
|
|
|
11
11
|
export { arrow, flip, hide, inline, offset, shift, size } from '@floating-ui/react';
|
|
12
12
|
import { useFloating } from '@floating-ui/react-dom';
|
|
13
13
|
import * as ShoplAssets from '@shoplflow/shopl-assets';
|
|
14
|
-
import { DeleteIcon, DownArrowSolidXsmallIcon, RightArrowSolidXsmallIcon, FirstPageIcon, LeftArrowIcon, RightArrowIcon, EndPageIcon, SearchIcon } from '@shoplflow/shopl-assets';
|
|
14
|
+
import { DeleteIcon, DownArrowSolidXsmallIcon, RightArrowSolidXsmallIcon, FirstPageIcon, LeftArrowIcon, RightArrowIcon, EndPageIcon, SearchIcon, LeftArrowXsmallIcon, RightArrowXsmallIcon } from '@shoplflow/shopl-assets';
|
|
15
15
|
import { shift, flip, offset as offset$1 } from '@floating-ui/core';
|
|
16
16
|
import * as HadaAssets from '@shoplflow/hada-assets';
|
|
17
17
|
import DatePicker2 from 'react-datepicker';
|
|
@@ -5432,7 +5432,7 @@ var SmallStyledDayDatepickerWrapper = styled6.div`
|
|
|
5432
5432
|
&__day-names {
|
|
5433
5433
|
width: 100%;
|
|
5434
5434
|
height: 18px;
|
|
5435
|
-
margin: 8px 0 0;
|
|
5435
|
+
margin: 8px 0 8px 0;
|
|
5436
5436
|
display: flex;
|
|
5437
5437
|
justify-content: space-between;
|
|
5438
5438
|
align-items: center;
|
|
@@ -5833,8 +5833,7 @@ var Header = styled6.div`
|
|
|
5833
5833
|
gap: 8px;
|
|
5834
5834
|
`;
|
|
5835
5835
|
var Month = styled6.p`
|
|
5836
|
-
|
|
5837
|
-
color: ${colorTokens.neutral700};
|
|
5836
|
+
display: flex;
|
|
5838
5837
|
cursor: pointer;
|
|
5839
5838
|
`;
|
|
5840
5839
|
var DatePickerWrapper = styled6.div`
|
|
@@ -5986,6 +5985,7 @@ var YearStepper = ({
|
|
|
5986
5985
|
changeYear,
|
|
5987
5986
|
minDate,
|
|
5988
5987
|
maxDate,
|
|
5988
|
+
sizeVar = "M",
|
|
5989
5989
|
className
|
|
5990
5990
|
}) => {
|
|
5991
5991
|
const [isOpen, setIsOpen] = useOutsideClick({
|
|
@@ -6002,10 +6002,17 @@ var YearStepper = ({
|
|
|
6002
6002
|
IconButton_default,
|
|
6003
6003
|
{
|
|
6004
6004
|
styleVar: "GHOST",
|
|
6005
|
-
sizeVar: "S",
|
|
6005
|
+
sizeVar: sizeVar === "S" ? "XS" : "S",
|
|
6006
6006
|
onClick: decreaseYear,
|
|
6007
6007
|
disabled: prevYearButtonDisabled || date.getFullYear() === startYear,
|
|
6008
|
-
|
|
6008
|
+
iconSizeVar: sizeVar === "S" ? "XS" : "S",
|
|
6009
|
+
children: /* @__PURE__ */ jsx(
|
|
6010
|
+
Icon_default,
|
|
6011
|
+
{
|
|
6012
|
+
iconSource: sizeVar === "S" ? LeftArrowXsmallIcon : LeftArrowIcon,
|
|
6013
|
+
color: prevYearButtonDisabled ? "neutral200" : "neutral700"
|
|
6014
|
+
}
|
|
6015
|
+
)
|
|
6009
6016
|
}
|
|
6010
6017
|
),
|
|
6011
6018
|
/* @__PURE__ */ jsxs(Popper_default, { placement: "bottom", middlewares: [flip(), shift({ padding: 5 })], children: [
|
|
@@ -6017,7 +6024,7 @@ var YearStepper = ({
|
|
|
6017
6024
|
event.stopPropagation();
|
|
6018
6025
|
setIsOpen((prev) => !prev);
|
|
6019
6026
|
},
|
|
6020
|
-
children: /* @__PURE__ */ jsx(Text_default, { typography: "title1_700", children: `${date.getFullYear()}` })
|
|
6027
|
+
children: /* @__PURE__ */ jsx(Text_default, { typography: sizeVar === "M" ? "title1_700" : "body1_700", children: `${date.getFullYear()}` })
|
|
6021
6028
|
}
|
|
6022
6029
|
) }),
|
|
6023
6030
|
/* @__PURE__ */ jsx(Popper_default.Portal, { children: /* @__PURE__ */ jsx(
|
|
@@ -6039,10 +6046,17 @@ var YearStepper = ({
|
|
|
6039
6046
|
IconButton_default,
|
|
6040
6047
|
{
|
|
6041
6048
|
styleVar: "GHOST",
|
|
6042
|
-
sizeVar: "S",
|
|
6049
|
+
sizeVar: sizeVar === "S" ? "XS" : "S",
|
|
6043
6050
|
onClick: increaseYear,
|
|
6044
6051
|
disabled: nextYearButtonDisabled || date.getFullYear() === endYear,
|
|
6045
|
-
|
|
6052
|
+
iconSizeVar: sizeVar === "S" ? "XS" : "S",
|
|
6053
|
+
children: /* @__PURE__ */ jsx(
|
|
6054
|
+
Icon_default,
|
|
6055
|
+
{
|
|
6056
|
+
iconSource: sizeVar === "S" ? RightArrowXsmallIcon : RightArrowIcon,
|
|
6057
|
+
color: nextYearButtonDisabled ? "neutral200" : "neutral700"
|
|
6058
|
+
}
|
|
6059
|
+
)
|
|
6046
6060
|
}
|
|
6047
6061
|
)
|
|
6048
6062
|
] });
|
|
@@ -6670,42 +6684,98 @@ var getEachWeekAreaStyle = (props) => {
|
|
|
6670
6684
|
`;
|
|
6671
6685
|
}
|
|
6672
6686
|
};
|
|
6687
|
+
var getWeekContainerStyleBySizeVar = (sizeVar) => {
|
|
6688
|
+
if (sizeVar === "S") {
|
|
6689
|
+
return css`
|
|
6690
|
+
width: 280px;
|
|
6691
|
+
max-width: 280px;
|
|
6692
|
+
gap: 8px;
|
|
6693
|
+
padding: 16px;
|
|
6694
|
+
`;
|
|
6695
|
+
}
|
|
6696
|
+
return css`
|
|
6697
|
+
width: 400px;
|
|
6698
|
+
max-width: 400px;
|
|
6699
|
+
gap: 16px;
|
|
6700
|
+
padding: 16px 24px 24px;
|
|
6701
|
+
`;
|
|
6702
|
+
};
|
|
6703
|
+
var getWeekAreaStyleBySizeVar = (sizeVar) => {
|
|
6704
|
+
if (sizeVar === "S") {
|
|
6705
|
+
return css`
|
|
6706
|
+
grid-row-gap: 0;
|
|
6707
|
+
background-color: ${colorTokens.neutral100};
|
|
6708
|
+
`;
|
|
6709
|
+
}
|
|
6710
|
+
return css`
|
|
6711
|
+
grid-row-gap: 8px;
|
|
6712
|
+
background-color: ${colorTokens.neutral0};
|
|
6713
|
+
`;
|
|
6714
|
+
};
|
|
6715
|
+
var getEachWeekAreaStyleBySizeVar = (sizeVar) => {
|
|
6716
|
+
if (sizeVar === "S") {
|
|
6717
|
+
return css`
|
|
6718
|
+
height: 32px;
|
|
6719
|
+
`;
|
|
6720
|
+
}
|
|
6721
|
+
return css`
|
|
6722
|
+
height: 48px;
|
|
6723
|
+
`;
|
|
6724
|
+
};
|
|
6725
|
+
var getEachWeekDateStyleBySizeVar = (sizeVar) => {
|
|
6726
|
+
if (sizeVar === "S") {
|
|
6727
|
+
return css`
|
|
6728
|
+
width: 100%;
|
|
6729
|
+
height: 32px;
|
|
6730
|
+
font-size: 12px;
|
|
6731
|
+
line-height: 16px;
|
|
6732
|
+
border-radius: 0;
|
|
6733
|
+
`;
|
|
6734
|
+
}
|
|
6735
|
+
return css`
|
|
6736
|
+
width: 48px;
|
|
6737
|
+
height: 48px;
|
|
6738
|
+
font-size: 14px;
|
|
6739
|
+
line-height: 48px;
|
|
6740
|
+
border-radius: 50%;
|
|
6741
|
+
`;
|
|
6742
|
+
};
|
|
6673
6743
|
var WeekContainer = styled6.div`
|
|
6674
6744
|
display: flex;
|
|
6675
6745
|
flex-direction: column;
|
|
6676
|
-
|
|
6677
|
-
|
|
6678
|
-
gap: 16px;
|
|
6679
|
-
padding: 16px 24px 24px;
|
|
6746
|
+
|
|
6747
|
+
${({ sizeVar }) => getWeekContainerStyleBySizeVar(sizeVar)}
|
|
6680
6748
|
`;
|
|
6681
6749
|
var WeekArea = styled6.div`
|
|
6682
6750
|
width: 100%;
|
|
6683
6751
|
display: grid;
|
|
6684
6752
|
grid-template-columns: repeat(7, 1fr);
|
|
6685
|
-
|
|
6753
|
+
border-radius: 4px;
|
|
6754
|
+
overflow: hidden;
|
|
6755
|
+
|
|
6756
|
+
${({ sizeVar }) => getWeekAreaStyleBySizeVar(sizeVar)}
|
|
6686
6757
|
`;
|
|
6687
6758
|
var EachWeekArea = styled6.div`
|
|
6688
6759
|
width: 100%;
|
|
6689
|
-
height: 48px;
|
|
6690
6760
|
display: flex;
|
|
6691
6761
|
justify-content: center;
|
|
6692
6762
|
align-items: center;
|
|
6693
6763
|
position: relative;
|
|
6694
6764
|
|
|
6765
|
+
${({ sizeVar }) => getEachWeekAreaStyleBySizeVar(sizeVar)}
|
|
6695
6766
|
${(props) => getEachWeekAreaStyle(props)}
|
|
6696
6767
|
`;
|
|
6697
6768
|
var EachWeekDate = styled6.div`
|
|
6698
|
-
|
|
6699
|
-
|
|
6769
|
+
display: flex;
|
|
6770
|
+
justify-content: center;
|
|
6771
|
+
align-items: center;
|
|
6700
6772
|
text-align: center;
|
|
6701
|
-
font-size: 14px;
|
|
6702
|
-
line-height: 48px;
|
|
6703
6773
|
padding: 0;
|
|
6704
|
-
border-radius: 50%;
|
|
6705
6774
|
cursor: pointer;
|
|
6706
6775
|
position: absolute;
|
|
6707
6776
|
z-index: 10;
|
|
6708
6777
|
|
|
6778
|
+
${({ sizeVar }) => getEachWeekDateStyleBySizeVar(sizeVar)}
|
|
6709
6779
|
${(props) => getEachDateStyle3(props)}
|
|
6710
6780
|
`;
|
|
6711
6781
|
function getWeeksInYear(year) {
|
|
@@ -6730,7 +6800,8 @@ var WeekDatepicker = ({
|
|
|
6730
6800
|
initEndDate,
|
|
6731
6801
|
minDate,
|
|
6732
6802
|
maxDate,
|
|
6733
|
-
onlySingleWeek
|
|
6803
|
+
onlySingleWeek,
|
|
6804
|
+
sizeVar = "M"
|
|
6734
6805
|
}) => {
|
|
6735
6806
|
const year = initStartDate ? getISOWeekYear(initStartDate) : getISOWeekYear(/* @__PURE__ */ new Date());
|
|
6736
6807
|
const [currentDate, setCurrentDate] = useState(new Date(year, 5, 5));
|
|
@@ -6797,10 +6868,11 @@ var WeekDatepicker = ({
|
|
|
6797
6868
|
});
|
|
6798
6869
|
}
|
|
6799
6870
|
};
|
|
6800
|
-
return /* @__PURE__ */ jsxs(WeekContainer, { children: [
|
|
6871
|
+
return /* @__PURE__ */ jsxs(WeekContainer, { sizeVar, children: [
|
|
6801
6872
|
/* @__PURE__ */ jsx(
|
|
6802
6873
|
YearStepper_default,
|
|
6803
6874
|
{
|
|
6875
|
+
sizeVar,
|
|
6804
6876
|
date: currentDate,
|
|
6805
6877
|
decreaseYear: () => {
|
|
6806
6878
|
setCurrentDate(new Date(currentDate.getFullYear() - 1, currentDate.getMonth(), currentDate.getDate()));
|
|
@@ -6817,7 +6889,7 @@ var WeekDatepicker = ({
|
|
|
6817
6889
|
}
|
|
6818
6890
|
}
|
|
6819
6891
|
),
|
|
6820
|
-
/* @__PURE__ */ jsx(WeekArea, { children: Years.map((each, index) => {
|
|
6892
|
+
/* @__PURE__ */ jsx(WeekArea, { sizeVar, children: Years.map((each, index) => {
|
|
6821
6893
|
const currentYear = currentDate.getFullYear();
|
|
6822
6894
|
const currentWeek = Number(each);
|
|
6823
6895
|
const isStart = currentYear === (selectedStartWeekAndYear == null ? void 0 : selectedStartWeekAndYear[1]) && currentWeek === (selectedStartWeekAndYear == null ? void 0 : selectedStartWeekAndYear[0]);
|
|
@@ -6874,6 +6946,7 @@ var WeekDatepicker = ({
|
|
|
6874
6946
|
return /* @__PURE__ */ jsx(
|
|
6875
6947
|
EachWeekArea,
|
|
6876
6948
|
{
|
|
6949
|
+
sizeVar,
|
|
6877
6950
|
inRange,
|
|
6878
6951
|
isStart,
|
|
6879
6952
|
isReady,
|
|
@@ -6885,7 +6958,7 @@ var WeekDatepicker = ({
|
|
|
6885
6958
|
}
|
|
6886
6959
|
clickWeek(Number(each), currentDate.getFullYear());
|
|
6887
6960
|
},
|
|
6888
|
-
children: /* @__PURE__ */ jsxs(EachWeekDate, { inRange, isStart, isEnd, disabled, children: [
|
|
6961
|
+
children: /* @__PURE__ */ jsxs(EachWeekDate, { sizeVar, inRange, isStart, isEnd, disabled, children: [
|
|
6889
6962
|
"W",
|
|
6890
6963
|
each
|
|
6891
6964
|
] })
|