sag_components 2.0.0-beta235 → 2.0.0-beta237
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.d.ts +2 -1
- package/dist/index.esm.js +85 -96
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +85 -96
- package/dist/index.js.map +1 -1
- package/dist/types/components/OverlayDropdown/OverlayDropdown.stories.d.ts +8 -0
- package/dist/types/components/WeeksPicker/WeeksPicker.d.ts +2 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8939,27 +8939,26 @@ const IconContainer$5 = styled__default["default"].div`
|
|
|
8939
8939
|
cursor: pointer;
|
|
8940
8940
|
`;
|
|
8941
8941
|
|
|
8942
|
-
const DropdownSingleNew =
|
|
8943
|
-
|
|
8944
|
-
|
|
8945
|
-
|
|
8946
|
-
|
|
8947
|
-
|
|
8948
|
-
|
|
8949
|
-
|
|
8950
|
-
|
|
8951
|
-
|
|
8952
|
-
|
|
8953
|
-
|
|
8954
|
-
|
|
8955
|
-
|
|
8956
|
-
|
|
8957
|
-
|
|
8958
|
-
|
|
8959
|
-
|
|
8960
|
-
|
|
8961
|
-
|
|
8962
|
-
} = _ref;
|
|
8942
|
+
const DropdownSingleNew = ({
|
|
8943
|
+
label,
|
|
8944
|
+
labelEmptyValue,
|
|
8945
|
+
options,
|
|
8946
|
+
selectedValue,
|
|
8947
|
+
onChange,
|
|
8948
|
+
required,
|
|
8949
|
+
disabled,
|
|
8950
|
+
width,
|
|
8951
|
+
height,
|
|
8952
|
+
withMarginBottom = true,
|
|
8953
|
+
error,
|
|
8954
|
+
errorMessage,
|
|
8955
|
+
xIconShow,
|
|
8956
|
+
labelColor,
|
|
8957
|
+
showLabelOnTop,
|
|
8958
|
+
orderBy,
|
|
8959
|
+
placeHolder = "",
|
|
8960
|
+
elementType
|
|
8961
|
+
}) => {
|
|
8963
8962
|
const [isFocused, setIsFocused] = React$1.useState(false);
|
|
8964
8963
|
const [showOptions, setShowOptions] = React$1.useState(false);
|
|
8965
8964
|
const [showAbove, setShowAbove] = React$1.useState(false);
|
|
@@ -9464,27 +9463,26 @@ const IconContainer$4 = styled__default["default"].div`
|
|
|
9464
9463
|
cursor: pointer;
|
|
9465
9464
|
`;
|
|
9466
9465
|
|
|
9467
|
-
const DropdownMultiNew =
|
|
9468
|
-
|
|
9469
|
-
|
|
9470
|
-
|
|
9471
|
-
|
|
9472
|
-
|
|
9473
|
-
|
|
9474
|
-
|
|
9475
|
-
|
|
9476
|
-
|
|
9477
|
-
|
|
9478
|
-
|
|
9479
|
-
|
|
9480
|
-
|
|
9481
|
-
|
|
9482
|
-
|
|
9483
|
-
|
|
9484
|
-
|
|
9485
|
-
|
|
9486
|
-
|
|
9487
|
-
} = _ref;
|
|
9466
|
+
const DropdownMultiNew = ({
|
|
9467
|
+
label,
|
|
9468
|
+
labelEmptyValue,
|
|
9469
|
+
options,
|
|
9470
|
+
selectedValue,
|
|
9471
|
+
onChange,
|
|
9472
|
+
required,
|
|
9473
|
+
disabled,
|
|
9474
|
+
width,
|
|
9475
|
+
height,
|
|
9476
|
+
withMarginBottom = true,
|
|
9477
|
+
error,
|
|
9478
|
+
errorMessage,
|
|
9479
|
+
labelColor,
|
|
9480
|
+
xIconShow,
|
|
9481
|
+
checkBoxColor,
|
|
9482
|
+
showLabelOnTop,
|
|
9483
|
+
orderBy,
|
|
9484
|
+
elementType
|
|
9485
|
+
}) => {
|
|
9488
9486
|
const [isFocused, setIsFocused] = React$1.useState(false);
|
|
9489
9487
|
const [showOptions, setShowOptions] = React$1.useState(false);
|
|
9490
9488
|
const [showAbove, setShowAbove] = React$1.useState(false);
|
|
@@ -34983,18 +34981,17 @@ styled.css`
|
|
|
34983
34981
|
* • onApply(start,end) — callback, both numbers (inclusive)
|
|
34984
34982
|
* • onCancel() — callback
|
|
34985
34983
|
*/
|
|
34986
|
-
const WeeksCalendar =
|
|
34987
|
-
|
|
34988
|
-
|
|
34989
|
-
|
|
34990
|
-
|
|
34991
|
-
|
|
34992
|
-
|
|
34993
|
-
|
|
34994
|
-
|
|
34995
|
-
|
|
34996
|
-
|
|
34997
|
-
} = _ref;
|
|
34984
|
+
const WeeksCalendar = ({
|
|
34985
|
+
year,
|
|
34986
|
+
defaultStartWeek = null,
|
|
34987
|
+
defaultEndWeek = null,
|
|
34988
|
+
backgroundColor = "#066768",
|
|
34989
|
+
hoverBackgroundColor = "#E6F0F0",
|
|
34990
|
+
allowedWeekRange = null,
|
|
34991
|
+
// New prop for range restriction
|
|
34992
|
+
onApply,
|
|
34993
|
+
onCancel
|
|
34994
|
+
}) => {
|
|
34998
34995
|
// state -------------------------------------------------
|
|
34999
34996
|
const [startWeek, setStartWeek] = React$1.useState(defaultStartWeek);
|
|
35000
34997
|
const [endWeek, setEndWeek] = React$1.useState(defaultEndWeek);
|
|
@@ -35125,13 +35122,14 @@ const StyledInput$1 = styled__default["default"].input`
|
|
|
35125
35122
|
border-radius: ${props => props.borderRadius || '4px'};
|
|
35126
35123
|
border: none;
|
|
35127
35124
|
outline: none;
|
|
35125
|
+
background-color: ${props => props.isDarkerBackground ? '#F2F2F2' : 'white'} !important;
|
|
35128
35126
|
width: ${props => props.width || '90%'};
|
|
35129
35127
|
height: ${props => props.height || 'auto'};
|
|
35130
35128
|
transition: border-color 0.3s ease;
|
|
35131
35129
|
font-size: 14px;
|
|
35132
35130
|
font-weight: 400;
|
|
35133
35131
|
box-sizing: border-box;
|
|
35134
|
-
color: ${props => props.disabled ? '#
|
|
35132
|
+
color: ${props => props.disabled ? '#D0D0D0' : (props.isFocused || props.value ? props.textColor : '#757575') || '#333'};
|
|
35135
35133
|
cursor: ${props => props.disabled ? 'not-allowed' : 'text'};
|
|
35136
35134
|
`;
|
|
35137
35135
|
const StyledLabel = styled__default["default"].label`
|
|
@@ -35178,9 +35176,8 @@ const InputContainer$1 = styled__default["default"].div`
|
|
|
35178
35176
|
overflow: hidden;
|
|
35179
35177
|
width: 100%;
|
|
35180
35178
|
height: 100%;
|
|
35181
|
-
box-sizing: border-box;
|
|
35182
|
-
|
|
35183
|
-
border: 1px solid ${props => props.disabled ? '#bdbdbd' : props.error ? 'red' : '#B1B1B1'};
|
|
35179
|
+
box-sizing: border-box;
|
|
35180
|
+
border: 1px solid ${props => props.disabled ? '#D0D0D0' : props.error ? 'red' : '#B1B1B1'};
|
|
35184
35181
|
font-weight: 400;
|
|
35185
35182
|
font-size: 14px;
|
|
35186
35183
|
border-radius: 12px;
|
|
@@ -35222,6 +35219,7 @@ const WeeksPicker = _ref => {
|
|
|
35222
35219
|
withMarginBottom = true,
|
|
35223
35220
|
onChange,
|
|
35224
35221
|
selectedValue,
|
|
35222
|
+
isDarkerBackground = false,
|
|
35225
35223
|
// New props for range restriction
|
|
35226
35224
|
allowedWeekRange = null,
|
|
35227
35225
|
// { startWeek: number, endWeek: number } or null
|
|
@@ -35418,7 +35416,8 @@ const WeeksPicker = _ref => {
|
|
|
35418
35416
|
placeholder: isFocused ? placeholder : "",
|
|
35419
35417
|
disabled: disabled,
|
|
35420
35418
|
borderColor: borderColor,
|
|
35421
|
-
textColor: textColor
|
|
35419
|
+
textColor: textColor,
|
|
35420
|
+
isDarkerBackground: isDarkerBackground
|
|
35422
35421
|
}), /*#__PURE__*/React__default["default"].createElement(CalendarDiv, {
|
|
35423
35422
|
onClick: disabled ? undefined : handleToggle
|
|
35424
35423
|
}, /*#__PURE__*/React__default["default"].createElement(CalendarInOpen, {
|
|
@@ -36102,12 +36101,6 @@ const ToggleSwitchLabel = styled__default["default"].label`
|
|
|
36102
36101
|
position: relative;
|
|
36103
36102
|
cursor: pointer;
|
|
36104
36103
|
user-select: none;
|
|
36105
|
-
opacity: ${_ref => {
|
|
36106
|
-
let {
|
|
36107
|
-
disabled
|
|
36108
|
-
} = _ref;
|
|
36109
|
-
return disabled ? 0.5 : 1;
|
|
36110
|
-
}};
|
|
36111
36104
|
`;
|
|
36112
36105
|
const ToggleInput = styled__default["default"].input`
|
|
36113
36106
|
display: none;
|
|
@@ -36115,19 +36108,15 @@ const ToggleInput = styled__default["default"].input`
|
|
|
36115
36108
|
const ToggleSlider = styled__default["default"].span`
|
|
36116
36109
|
display: block;
|
|
36117
36110
|
position: relative;
|
|
36118
|
-
background: ${
|
|
36119
|
-
|
|
36120
|
-
|
|
36121
|
-
|
|
36122
|
-
} = _ref2;
|
|
36123
|
-
return checked ? disabled ? "#7bb1b0" : "#006d6a" : "#cfd8dc";
|
|
36124
|
-
}};
|
|
36111
|
+
background: ${({
|
|
36112
|
+
checked,
|
|
36113
|
+
disabled
|
|
36114
|
+
}) => checked ? "#006d6a" : disabled ? "#B1B1B1" : "#D0D0D0"};
|
|
36125
36115
|
border-radius: 999px;
|
|
36126
36116
|
transition: background 0.2s;
|
|
36127
|
-
${
|
|
36128
|
-
|
|
36129
|
-
|
|
36130
|
-
} = _ref3;
|
|
36117
|
+
${({
|
|
36118
|
+
size
|
|
36119
|
+
}) => {
|
|
36131
36120
|
switch (size) {
|
|
36132
36121
|
case "s":
|
|
36133
36122
|
return styled.css`width: 40px; height: 20px;`;
|
|
@@ -36143,13 +36132,14 @@ const ToggleSlider = styled__default["default"].span`
|
|
|
36143
36132
|
left: 3px;
|
|
36144
36133
|
top: 50%;
|
|
36145
36134
|
transform: translateY(-50%);
|
|
36146
|
-
background:
|
|
36135
|
+
background: ${({
|
|
36136
|
+
disabled
|
|
36137
|
+
}) => disabled ? "#D0D0D0" : "#fff"};
|
|
36147
36138
|
border-radius: 50%;
|
|
36148
36139
|
transition: left 0.2s, width 0.2s, height 0.2s;
|
|
36149
|
-
${
|
|
36150
|
-
|
|
36151
|
-
|
|
36152
|
-
} = _ref4;
|
|
36140
|
+
${({
|
|
36141
|
+
size
|
|
36142
|
+
}) => {
|
|
36153
36143
|
switch (size) {
|
|
36154
36144
|
case "s":
|
|
36155
36145
|
return styled.css`width: 14px; height: 14px;`;
|
|
@@ -36159,11 +36149,10 @@ const ToggleSlider = styled__default["default"].span`
|
|
|
36159
36149
|
return styled.css`width: 20px; height: 20px;`;
|
|
36160
36150
|
}
|
|
36161
36151
|
}}
|
|
36162
|
-
left: ${
|
|
36163
|
-
|
|
36164
|
-
|
|
36165
|
-
|
|
36166
|
-
} = _ref5;
|
|
36152
|
+
left: ${({
|
|
36153
|
+
checked,
|
|
36154
|
+
size
|
|
36155
|
+
}) => {
|
|
36167
36156
|
if (!checked) return "3px";
|
|
36168
36157
|
switch (size) {
|
|
36169
36158
|
case "s":
|
|
@@ -54878,7 +54867,7 @@ const DropdownContainer = styled__default["default"].div`
|
|
|
54878
54867
|
`;
|
|
54879
54868
|
const DropdownButton = styled__default["default"].button`
|
|
54880
54869
|
width: 100%;
|
|
54881
|
-
background: #fff;
|
|
54870
|
+
background: ${props => props.isDarkerBackground ? '#F2F2F2' : '#fff'};
|
|
54882
54871
|
border: 1px solid #8B8989;
|
|
54883
54872
|
border-radius: 12px;
|
|
54884
54873
|
padding: 17px;
|
|
@@ -54891,7 +54880,7 @@ const DropdownButton = styled__default["default"].button`
|
|
|
54891
54880
|
${props => props.disabled && styled.css`
|
|
54892
54881
|
color: #D0D0D0;
|
|
54893
54882
|
cursor: not-allowed;
|
|
54894
|
-
border: 1px solid #
|
|
54883
|
+
border: 1px solid #D9D9D9;
|
|
54895
54884
|
background: ${props => props.isDarkerBackground ? '#F2F2F2' : '#fff'};
|
|
54896
54885
|
`}
|
|
54897
54886
|
`;
|
|
@@ -54917,11 +54906,10 @@ const DropdownList = styled__default["default"].ul`
|
|
|
54917
54906
|
`}
|
|
54918
54907
|
`;
|
|
54919
54908
|
const SectionDiv = styled__default["default"].div`
|
|
54920
|
-
${
|
|
54921
|
-
|
|
54922
|
-
|
|
54923
|
-
|
|
54924
|
-
} = _ref;
|
|
54909
|
+
${({
|
|
54910
|
+
$showBorder,
|
|
54911
|
+
margin
|
|
54912
|
+
}) => {
|
|
54925
54913
|
switch ($showBorder) {
|
|
54926
54914
|
case 'Template Offer':
|
|
54927
54915
|
return styled.css`border-top: 1px solid #e6e2e2ff;
|
|
@@ -55001,8 +54989,8 @@ const Label$1 = styled__default["default"].label`
|
|
|
55001
54989
|
padding-inline-start: 5px;
|
|
55002
54990
|
margin-right: 10px;
|
|
55003
54991
|
z-index: 2;
|
|
55004
|
-
color: ${props => props.error ? 'red' : props.disabled ? '#
|
|
55005
|
-
background-color: ${props => props.
|
|
54992
|
+
color: ${props => props.error ? 'red' : props.disabled ? '#D0D0D0' : props.labelColor};
|
|
54993
|
+
background-color: ${props => props.isDarkerBackground ? '#F2F2F2' : props.showLabelOnTop ? 'white' : 'transparent'};
|
|
55006
54994
|
position: absolute;
|
|
55007
54995
|
top: ${props => props.isFocused || props.hasValue ? '0px' : '50%'};
|
|
55008
54996
|
left: ${props => props.isFocused || props.hasValue ? '23px' : '14px'};
|
|
@@ -55533,7 +55521,8 @@ const OverlayDropdown = _ref => {
|
|
|
55533
55521
|
labelColor: labelColor,
|
|
55534
55522
|
hasValue: hasValue,
|
|
55535
55523
|
disabled: disabled,
|
|
55536
|
-
showLabelOnTop: showLabelOnTop
|
|
55524
|
+
showLabelOnTop: showLabelOnTop,
|
|
55525
|
+
isDarkerBackground: isDarkerBackground
|
|
55537
55526
|
}, getLabel(), getRequired()), /*#__PURE__*/React__default["default"].createElement(DropdownButton, {
|
|
55538
55527
|
ref: buttonRef,
|
|
55539
55528
|
onClick: toggleDropdown,
|