@shoplflow/base 0.46.9 → 0.46.11
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 +166 -97
- package/dist/index.d.cts +9 -6
- package/dist/index.d.ts +9 -6
- package/dist/index.js +167 -98
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -232,6 +232,8 @@ var getSizeBySizeVariant = (size2) => {
|
|
|
232
232
|
return "24px";
|
|
233
233
|
case "M":
|
|
234
234
|
return "32px";
|
|
235
|
+
case "ML":
|
|
236
|
+
return "40px";
|
|
235
237
|
case "L":
|
|
236
238
|
return "48px";
|
|
237
239
|
case "XL":
|
|
@@ -240,6 +242,24 @@ var getSizeBySizeVariant = (size2) => {
|
|
|
240
242
|
return "32px";
|
|
241
243
|
}
|
|
242
244
|
};
|
|
245
|
+
var getIconSizeBySizeVariant = (size2) => {
|
|
246
|
+
switch (size2) {
|
|
247
|
+
case "XS":
|
|
248
|
+
return "8px";
|
|
249
|
+
case "S":
|
|
250
|
+
return "12px";
|
|
251
|
+
case "M":
|
|
252
|
+
return "16px";
|
|
253
|
+
case "ML":
|
|
254
|
+
return "16px";
|
|
255
|
+
case "L":
|
|
256
|
+
return "20px";
|
|
257
|
+
case "XL":
|
|
258
|
+
return "24px";
|
|
259
|
+
default:
|
|
260
|
+
return "16px";
|
|
261
|
+
}
|
|
262
|
+
};
|
|
243
263
|
var StyledAvatar = styled6__default.default.picture`
|
|
244
264
|
display: flex;
|
|
245
265
|
align-items: center;
|
|
@@ -271,6 +291,12 @@ var StyledAvatarBadge = styled6__default.default.div`
|
|
|
271
291
|
height: fit-content;
|
|
272
292
|
bottom: 0;
|
|
273
293
|
right: 0;
|
|
294
|
+
> svg {
|
|
295
|
+
min-width: ${({ size: size2 }) => getIconSizeBySizeVariant(size2)};
|
|
296
|
+
min-height: ${({ size: size2 }) => getIconSizeBySizeVariant(size2)};
|
|
297
|
+
width: ${({ size: size2 }) => getIconSizeBySizeVariant(size2)};
|
|
298
|
+
height: ${({ size: size2 }) => getIconSizeBySizeVariant(size2)};
|
|
299
|
+
}
|
|
274
300
|
`;
|
|
275
301
|
|
|
276
302
|
// src/assets/mocks/AvatarNone.png
|
|
@@ -287,7 +313,7 @@ var Avatar = (_a) => {
|
|
|
287
313
|
}
|
|
288
314
|
}
|
|
289
315
|
) })),
|
|
290
|
-
/* @__PURE__ */ jsxRuntime.jsx(StyledAvatarBadge, { children: badge })
|
|
316
|
+
/* @__PURE__ */ jsxRuntime.jsx(StyledAvatarBadge, { size: rest.sizeVar, children: badge })
|
|
291
317
|
] });
|
|
292
318
|
};
|
|
293
319
|
exports.Avatar = Avatar;
|
|
@@ -297,12 +323,13 @@ exports.AvatarSizeVariants = {
|
|
|
297
323
|
XS: "XS",
|
|
298
324
|
S: "S",
|
|
299
325
|
M: "M",
|
|
326
|
+
ML: "ML",
|
|
300
327
|
L: "L",
|
|
301
328
|
XL: "XL"
|
|
302
329
|
};
|
|
303
330
|
|
|
304
331
|
// src/components/Avatar/version.ts
|
|
305
|
-
exports.AVATAR_VERSION = "2.
|
|
332
|
+
exports.AVATAR_VERSION = "2.1.1";
|
|
306
333
|
|
|
307
334
|
// src/styles/tokens.ts
|
|
308
335
|
var fontWeightRegular = "var(--font-weight-regular)";
|
|
@@ -1745,12 +1772,14 @@ var getStyleBySizeVar2 = (sizeVar) => {
|
|
|
1745
1772
|
case "M":
|
|
1746
1773
|
return react$1.css`
|
|
1747
1774
|
gap: 4px;
|
|
1775
|
+
padding: 0 12px;
|
|
1748
1776
|
min-width: 72px;
|
|
1749
1777
|
min-height: 40px;
|
|
1750
1778
|
`;
|
|
1751
1779
|
case "S":
|
|
1752
1780
|
return react$1.css`
|
|
1753
1781
|
gap: 2px;
|
|
1782
|
+
padding: 0 10px;
|
|
1754
1783
|
min-width: 54px;
|
|
1755
1784
|
min-height: 32px;
|
|
1756
1785
|
`;
|
|
@@ -1763,6 +1792,7 @@ var getStyleBySizeVar2 = (sizeVar) => {
|
|
|
1763
1792
|
default:
|
|
1764
1793
|
return react$1.css`
|
|
1765
1794
|
gap: 4px;
|
|
1795
|
+
padding: 0 12px;
|
|
1766
1796
|
min-width: 72px;
|
|
1767
1797
|
min-height: 40px;
|
|
1768
1798
|
`;
|
|
@@ -1783,8 +1813,6 @@ var StyledButton = styled6__default.default.button`
|
|
|
1783
1813
|
justify-content: center;
|
|
1784
1814
|
height: fit-content;
|
|
1785
1815
|
width: fit-content;
|
|
1786
|
-
/* gap: 4px; */
|
|
1787
|
-
padding: 0 12px;
|
|
1788
1816
|
border-radius: 6px;
|
|
1789
1817
|
cursor: pointer;
|
|
1790
1818
|
${({ styleVar, color, disabled }) => getStyleByStyleVar(styleVar, color, disabled)};
|
|
@@ -2985,7 +3013,7 @@ exports.SplitButtonStyleVariants = {
|
|
|
2985
3013
|
};
|
|
2986
3014
|
|
|
2987
3015
|
// src/components/Buttons/version.ts
|
|
2988
|
-
exports.BUTTONS_VERSION = "2.0.
|
|
3016
|
+
exports.BUTTONS_VERSION = "2.0.3";
|
|
2989
3017
|
var informationStyle = react$1.css`
|
|
2990
3018
|
background: ${exports.colorTokens.neutral400_5};
|
|
2991
3019
|
& > svg > circle {
|
|
@@ -3158,33 +3186,31 @@ var getDropdownFontSizeBySizeVar = (size2) => {
|
|
|
3158
3186
|
case "M":
|
|
3159
3187
|
return "body1_400";
|
|
3160
3188
|
case "S":
|
|
3161
|
-
return "
|
|
3189
|
+
return "body1_400";
|
|
3162
3190
|
default:
|
|
3163
3191
|
return "body1_400";
|
|
3164
3192
|
}
|
|
3165
3193
|
};
|
|
3166
3194
|
var getDropdownStyleBySizeVar = (size2) => {
|
|
3167
3195
|
switch (size2) {
|
|
3168
|
-
case "
|
|
3196
|
+
case "S":
|
|
3169
3197
|
return react$1.css`
|
|
3170
|
-
|
|
3171
|
-
padding: 8px 4px 8px 12px;
|
|
3198
|
+
padding: 0 8px;
|
|
3172
3199
|
`;
|
|
3173
3200
|
case "M":
|
|
3174
3201
|
return react$1.css`
|
|
3175
|
-
|
|
3176
|
-
gap: 4px;
|
|
3177
|
-
padding: 4px 4px 4px 12px;
|
|
3202
|
+
padding: 0 12px;
|
|
3178
3203
|
`;
|
|
3179
|
-
case "
|
|
3204
|
+
case "L":
|
|
3180
3205
|
return react$1.css`
|
|
3181
|
-
background-color:
|
|
3182
|
-
padding:
|
|
3183
|
-
|
|
3206
|
+
background-color: transparent;
|
|
3207
|
+
padding-left: 12px;
|
|
3208
|
+
padding-right: 6px;
|
|
3184
3209
|
`;
|
|
3185
3210
|
default:
|
|
3186
3211
|
return react$1.css`
|
|
3187
|
-
|
|
3212
|
+
background-color: ${exports.colorTokens.neutral0};
|
|
3213
|
+
padding: 0 8px;
|
|
3188
3214
|
`;
|
|
3189
3215
|
}
|
|
3190
3216
|
};
|
|
@@ -3193,28 +3219,12 @@ var getDisabledStyle2 = (disabled) => {
|
|
|
3193
3219
|
return react$1.css`
|
|
3194
3220
|
cursor: not-allowed;
|
|
3195
3221
|
background: ${exports.colorTokens.neutral100};
|
|
3222
|
+
svg > path {
|
|
3223
|
+
fill: ${exports.colorTokens.neutral400} !important;
|
|
3224
|
+
}
|
|
3196
3225
|
`;
|
|
3197
3226
|
}
|
|
3198
3227
|
};
|
|
3199
|
-
var getDropdownIconSizeBySizeVar = (size2) => {
|
|
3200
|
-
switch (size2) {
|
|
3201
|
-
case "S":
|
|
3202
|
-
case "L":
|
|
3203
|
-
return react$1.css`
|
|
3204
|
-
height: 24px;
|
|
3205
|
-
width: 24px;
|
|
3206
|
-
min-width: 24px;
|
|
3207
|
-
min-height: 24px;
|
|
3208
|
-
`;
|
|
3209
|
-
default:
|
|
3210
|
-
return react$1.css`
|
|
3211
|
-
height: 32px;
|
|
3212
|
-
width: 32px;
|
|
3213
|
-
min-width: 32px;
|
|
3214
|
-
min-height: 32px;
|
|
3215
|
-
`;
|
|
3216
|
-
}
|
|
3217
|
-
};
|
|
3218
3228
|
var getBorderColorByStatus = ({ isFocused, isError, isHovered, disabled, sizeVar }) => {
|
|
3219
3229
|
if (!disabled) {
|
|
3220
3230
|
if (isError) {
|
|
@@ -3259,7 +3269,17 @@ var getStyleByType = ({
|
|
|
3259
3269
|
height: ${height || "initial"};
|
|
3260
3270
|
`;
|
|
3261
3271
|
};
|
|
3262
|
-
var
|
|
3272
|
+
var getClearIconHoverStyle = (hasValue) => {
|
|
3273
|
+
if (!hasValue) {
|
|
3274
|
+
return;
|
|
3275
|
+
}
|
|
3276
|
+
return react$1.css`
|
|
3277
|
+
&:hover .dropdown-clear-icon {
|
|
3278
|
+
display: flex;
|
|
3279
|
+
}
|
|
3280
|
+
`;
|
|
3281
|
+
};
|
|
3282
|
+
var StyledDropdownButtonWrapper = styled6__default.default.div`
|
|
3263
3283
|
position: relative;
|
|
3264
3284
|
display: flex;
|
|
3265
3285
|
align-items: center;
|
|
@@ -3277,33 +3297,63 @@ var StyledDropdownButtonWrapper = styled6__default.default.label`
|
|
|
3277
3297
|
width
|
|
3278
3298
|
})};
|
|
3279
3299
|
${(props) => getButtonWrapperStyleBySizeVar(props)};
|
|
3280
|
-
|
|
3281
3300
|
${({ disabled }) => getDisabledStyle2(disabled)};
|
|
3301
|
+
|
|
3302
|
+
${({ hasValue }) => getClearIconHoverStyle(hasValue)}
|
|
3282
3303
|
`;
|
|
3283
3304
|
var StyledDropdownButton = styled6__default.default.button`
|
|
3305
|
+
position: relative;
|
|
3284
3306
|
display: flex;
|
|
3285
3307
|
flex-direction: row;
|
|
3286
3308
|
align-items: center;
|
|
3287
3309
|
justify-content: space-between;
|
|
3288
3310
|
width: 100%;
|
|
3289
3311
|
height: 100%;
|
|
3290
|
-
|
|
3291
3312
|
cursor: pointer;
|
|
3313
|
+
|
|
3292
3314
|
${({ sizeVar }) => sizeVar && getDropdownStyleBySizeVar(sizeVar)};
|
|
3293
3315
|
${({ disabled }) => getDisabledStyle2(disabled)};
|
|
3316
|
+
|
|
3317
|
+
.dropdown-clear-icon {
|
|
3318
|
+
display: none;
|
|
3319
|
+
position: absolute;
|
|
3320
|
+
right: 0;
|
|
3321
|
+
}
|
|
3294
3322
|
`;
|
|
3295
|
-
var DropdownButtonIcon = styled6__default.default
|
|
3323
|
+
var DropdownButtonIcon = styled6__default.default.div`
|
|
3296
3324
|
display: flex;
|
|
3297
3325
|
align-items: center;
|
|
3298
|
-
justify-content: center;
|
|
3299
3326
|
flex-shrink: 0;
|
|
3327
|
+
min-width: 22px;
|
|
3328
|
+
height: 100%;
|
|
3300
3329
|
|
|
3301
|
-
${({ sizeVar }) => sizeVar && getDropdownIconSizeBySizeVar(sizeVar)};
|
|
3302
3330
|
${({ disabled }) => getDisabledStyle2(disabled)};
|
|
3303
3331
|
`;
|
|
3304
3332
|
var DropdownTriggerButton = React3.forwardRef(
|
|
3305
3333
|
(_a, ref) => {
|
|
3306
|
-
var _b = _a, {
|
|
3334
|
+
var _b = _a, {
|
|
3335
|
+
width = "100%",
|
|
3336
|
+
onClick,
|
|
3337
|
+
sizeVar = "M",
|
|
3338
|
+
isError,
|
|
3339
|
+
placeholder,
|
|
3340
|
+
value,
|
|
3341
|
+
disabled,
|
|
3342
|
+
leftSource,
|
|
3343
|
+
rightSource,
|
|
3344
|
+
onClear
|
|
3345
|
+
} = _b, rest = __objRest(_b, [
|
|
3346
|
+
"width",
|
|
3347
|
+
"onClick",
|
|
3348
|
+
"sizeVar",
|
|
3349
|
+
"isError",
|
|
3350
|
+
"placeholder",
|
|
3351
|
+
"value",
|
|
3352
|
+
"disabled",
|
|
3353
|
+
"leftSource",
|
|
3354
|
+
"rightSource",
|
|
3355
|
+
"onClear"
|
|
3356
|
+
]);
|
|
3307
3357
|
const { isOpen, setIsOpen } = useDropdown();
|
|
3308
3358
|
const [isHovered, setIsHovered] = React3.useState(false);
|
|
3309
3359
|
const handleOnClick = (e) => {
|
|
@@ -3318,6 +3368,10 @@ var DropdownTriggerButton = React3.forwardRef(
|
|
|
3318
3368
|
const handleOnMouseLeave = () => {
|
|
3319
3369
|
setIsHovered(false);
|
|
3320
3370
|
};
|
|
3371
|
+
const handleOnClear = (e) => {
|
|
3372
|
+
e.stopPropagation();
|
|
3373
|
+
onClear && onClear();
|
|
3374
|
+
};
|
|
3321
3375
|
const getTextColor = ({ value: value2, disabled: disabled2 }) => {
|
|
3322
3376
|
if (disabled2) {
|
|
3323
3377
|
return "neutral350";
|
|
@@ -3328,7 +3382,8 @@ var DropdownTriggerButton = React3.forwardRef(
|
|
|
3328
3382
|
return "neutral700";
|
|
3329
3383
|
};
|
|
3330
3384
|
const LeftSourceClone = leftSource ? React3.cloneElement(leftSource, __spreadProps(__spreadValues({}, leftSource.props), { disabled })) : leftSource;
|
|
3331
|
-
|
|
3385
|
+
const RightSourceClone = rightSource ? React3.cloneElement(rightSource, __spreadProps(__spreadValues({}, rightSource.props), { disabled })) : rightSource;
|
|
3386
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3332
3387
|
StyledDropdownButtonWrapper,
|
|
3333
3388
|
{
|
|
3334
3389
|
onMouseEnter: handleOnMouseEnter,
|
|
@@ -3340,24 +3395,39 @@ var DropdownTriggerButton = React3.forwardRef(
|
|
|
3340
3395
|
isError,
|
|
3341
3396
|
sizeVar,
|
|
3342
3397
|
height: getDropdownHeightBySizeVar(sizeVar),
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
lineClamp: 1,
|
|
3353
|
-
children: placeholder
|
|
3354
|
-
}
|
|
3355
|
-
)
|
|
3356
|
-
] }),
|
|
3357
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3358
|
-
DropdownButtonIcon,
|
|
3359
|
-
{
|
|
3398
|
+
hasValue: Boolean(value),
|
|
3399
|
+
children: [
|
|
3400
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3401
|
+
StyledDropdownButton,
|
|
3402
|
+
__spreadProps(__spreadValues({
|
|
3403
|
+
ref,
|
|
3404
|
+
onClick: handleOnClick,
|
|
3405
|
+
disabled
|
|
3406
|
+
}, rest), {
|
|
3360
3407
|
sizeVar,
|
|
3408
|
+
"data-shoplflow": "Dropdown-Content-Area",
|
|
3409
|
+
children: [
|
|
3410
|
+
/* @__PURE__ */ jsxRuntime.jsxs(exports.Stack.Horizontal, { width: "100%", spacing: "spacing04", align: "center", children: [
|
|
3411
|
+
LeftSourceClone && LeftSourceClone,
|
|
3412
|
+
value || /* @__PURE__ */ jsxRuntime.jsx(
|
|
3413
|
+
exports.Text,
|
|
3414
|
+
{
|
|
3415
|
+
typography: getDropdownFontSizeBySizeVar(sizeVar),
|
|
3416
|
+
color: getTextColor({ value, disabled }),
|
|
3417
|
+
textOverflow: "ellipsis",
|
|
3418
|
+
lineClamp: 1,
|
|
3419
|
+
children: placeholder
|
|
3420
|
+
}
|
|
3421
|
+
)
|
|
3422
|
+
] }),
|
|
3423
|
+
onClear && sizeVar !== "L" && /* @__PURE__ */ jsxRuntime.jsx(exports.IconButton, { sizeVar, styleVar: "GHOST", onClick: handleOnClear, className: "dropdown-clear-icon", children: /* @__PURE__ */ jsxRuntime.jsx(exports.Icon, { iconSource: ShoplAssets.DeleteIcon, color: "neutral350", sizeVar: "S" }) })
|
|
3424
|
+
]
|
|
3425
|
+
})
|
|
3426
|
+
),
|
|
3427
|
+
RightSourceClone && /* @__PURE__ */ jsxRuntime.jsx(exports.StackContainer, { padding: "0 6px 0 0", children: RightSourceClone }),
|
|
3428
|
+
/* @__PURE__ */ jsxRuntime.jsx(DropdownButtonIcon, { sizeVar, "data-shoplflow": "Dropdown-Button-Icon-Area", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3429
|
+
framerMotion.motion.div,
|
|
3430
|
+
{
|
|
3361
3431
|
animate: {
|
|
3362
3432
|
rotate: isOpen ? 180 : 0
|
|
3363
3433
|
},
|
|
@@ -3373,8 +3443,8 @@ var DropdownTriggerButton = React3.forwardRef(
|
|
|
3373
3443
|
}
|
|
3374
3444
|
)
|
|
3375
3445
|
}
|
|
3376
|
-
)
|
|
3377
|
-
]
|
|
3446
|
+
) })
|
|
3447
|
+
]
|
|
3378
3448
|
}
|
|
3379
3449
|
);
|
|
3380
3450
|
}
|
|
@@ -5081,26 +5151,6 @@ exports.Pagination = Pagination;
|
|
|
5081
5151
|
|
|
5082
5152
|
// src/components/Pagination/version.ts
|
|
5083
5153
|
exports.PAGINATION_VERSION = "2.0.0";
|
|
5084
|
-
var getLabelStyleByStatus = (selected, disabled) => {
|
|
5085
|
-
if (disabled && selected) {
|
|
5086
|
-
return react$1.css`
|
|
5087
|
-
background-color: ${exports.colorTokens.neutral0};
|
|
5088
|
-
cursor: not-allowed;
|
|
5089
|
-
`;
|
|
5090
|
-
}
|
|
5091
|
-
if (disabled) {
|
|
5092
|
-
return react$1.css`
|
|
5093
|
-
cursor: not-allowed;
|
|
5094
|
-
opacity: 0.5;
|
|
5095
|
-
`;
|
|
5096
|
-
}
|
|
5097
|
-
if (selected) {
|
|
5098
|
-
return react$1.css`
|
|
5099
|
-
cursor: default;
|
|
5100
|
-
background-color: ${exports.colorTokens.neutral0};
|
|
5101
|
-
`;
|
|
5102
|
-
}
|
|
5103
|
-
};
|
|
5104
5154
|
var getLabelStyleBySizeVar = (sizeVar) => {
|
|
5105
5155
|
switch (sizeVar) {
|
|
5106
5156
|
case "S": {
|
|
@@ -5136,14 +5186,26 @@ var StyledToggleInner = styled6__default.default.button`
|
|
|
5136
5186
|
padding: 0 12px;
|
|
5137
5187
|
border-radius: 6px;
|
|
5138
5188
|
background-color: transparent;
|
|
5139
|
-
${({ disabled, selected }) => getLabelStyleByStatus(selected, Boolean(disabled))}
|
|
5140
5189
|
${({ sizeVar }) => getLabelStyleBySizeVar(sizeVar)}
|
|
5141
5190
|
|
|
5142
|
-
|
|
5143
|
-
|
|
5144
|
-
|
|
5145
|
-
|
|
5146
|
-
|
|
5191
|
+
&[data-selected='true'] {
|
|
5192
|
+
cursor: default;
|
|
5193
|
+
background-color: ${exports.colorTokens.neutral0};
|
|
5194
|
+
}
|
|
5195
|
+
|
|
5196
|
+
&[aria-disabled='true'] {
|
|
5197
|
+
cursor: not-allowed;
|
|
5198
|
+
opacity: 0.5;
|
|
5199
|
+
}
|
|
5200
|
+
|
|
5201
|
+
&[aria-disabled='true'][data-selected='true'] {
|
|
5202
|
+
opacity: 1;
|
|
5203
|
+
background-color: ${exports.colorTokens.neutral0};
|
|
5204
|
+
}
|
|
5205
|
+
|
|
5206
|
+
&:hover:not([aria-disabled='true']):not([data-selected='true']) {
|
|
5207
|
+
cursor: pointer;
|
|
5208
|
+
background-color: ${exports.colorTokens.neutral400_5};
|
|
5147
5209
|
}
|
|
5148
5210
|
`;
|
|
5149
5211
|
var StyledToggleInnerLabel = styled6__default.default.label`
|
|
@@ -5174,21 +5236,24 @@ var ToggleButton = (_a) => {
|
|
|
5174
5236
|
targetName,
|
|
5175
5237
|
onChange,
|
|
5176
5238
|
selectedValue,
|
|
5177
|
-
sizeVar = "S"
|
|
5239
|
+
sizeVar = "S",
|
|
5240
|
+
disabled = false
|
|
5178
5241
|
} = _b, rest = __objRest(_b, [
|
|
5179
5242
|
"fixedWidth",
|
|
5180
5243
|
"children",
|
|
5181
5244
|
"targetName",
|
|
5182
5245
|
"onChange",
|
|
5183
5246
|
"selectedValue",
|
|
5184
|
-
"sizeVar"
|
|
5247
|
+
"sizeVar",
|
|
5248
|
+
"disabled"
|
|
5185
5249
|
]);
|
|
5186
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ToggleButtonContext.Provider, { value: { fixedWidth, targetName, onChange, selectedValue, sizeVar }, children: /* @__PURE__ */ jsxRuntime.jsx(StyledToggleButton, __spreadProps(__spreadValues({ "data-shoplflow": "ToggleButton" }, rest), { children })) });
|
|
5250
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ToggleButtonContext.Provider, { value: { fixedWidth, targetName, onChange, selectedValue, sizeVar, disabled }, children: /* @__PURE__ */ jsxRuntime.jsx(StyledToggleButton, __spreadProps(__spreadValues({ "data-shoplflow": "ToggleButton", "aria-disabled": disabled }, rest), { children })) });
|
|
5187
5251
|
};
|
|
5188
5252
|
var ToggleInnerRadio = React3.forwardRef(
|
|
5189
5253
|
(_a, ref) => {
|
|
5190
|
-
var _b = _a, { label, disabled, value, id } = _b, rest = __objRest(_b, ["label", "disabled", "value", "id"]);
|
|
5191
|
-
const { fixedWidth, onChange, targetName, selectedValue, sizeVar } = useToggleButton();
|
|
5254
|
+
var _b = _a, { label, disabled: itemDisabled, value, id } = _b, rest = __objRest(_b, ["label", "disabled", "value", "id"]);
|
|
5255
|
+
const { fixedWidth, onChange, targetName, selectedValue, sizeVar, disabled: groupDisabled } = useToggleButton();
|
|
5256
|
+
const disabled = groupDisabled || itemDisabled;
|
|
5192
5257
|
const labelRef = React3.useRef(null);
|
|
5193
5258
|
let selected = false;
|
|
5194
5259
|
if (selectedValue && selectedValue === value) {
|
|
@@ -5204,12 +5269,15 @@ var ToggleInnerRadio = React3.forwardRef(
|
|
|
5204
5269
|
StyledToggleInner,
|
|
5205
5270
|
{
|
|
5206
5271
|
width: fixedWidth,
|
|
5207
|
-
disabled,
|
|
5208
|
-
selected,
|
|
5209
5272
|
sizeVar,
|
|
5210
5273
|
type: "button",
|
|
5274
|
+
"aria-disabled": disabled,
|
|
5275
|
+
"data-selected": selected,
|
|
5211
5276
|
onClick: () => {
|
|
5212
5277
|
var _a2;
|
|
5278
|
+
if (disabled) {
|
|
5279
|
+
return;
|
|
5280
|
+
}
|
|
5213
5281
|
(_a2 = labelRef == null ? void 0 : labelRef.current) == null ? void 0 : _a2.click();
|
|
5214
5282
|
},
|
|
5215
5283
|
children: [
|
|
@@ -5219,6 +5287,7 @@ var ToggleInnerRadio = React3.forwardRef(
|
|
|
5219
5287
|
checked: selected,
|
|
5220
5288
|
width: fixedWidth,
|
|
5221
5289
|
disabled,
|
|
5290
|
+
"aria-disabled": disabled,
|
|
5222
5291
|
value,
|
|
5223
5292
|
id,
|
|
5224
5293
|
type: "radio",
|
|
@@ -5252,7 +5321,7 @@ exports.ToggleButtonSizeVariants = {
|
|
|
5252
5321
|
};
|
|
5253
5322
|
|
|
5254
5323
|
// src/components/ToggleButton/version.ts
|
|
5255
|
-
exports.TOGGLE_BUTTON_VERSION = "2.0.
|
|
5324
|
+
exports.TOGGLE_BUTTON_VERSION = "2.0.1";
|
|
5256
5325
|
var SmallStyledDayDatepickerWrapper = styled6__default.default.div`
|
|
5257
5326
|
display: flex;
|
|
5258
5327
|
width: 280px;
|
package/dist/index.d.cts
CHANGED
|
@@ -280,6 +280,7 @@ declare const AvatarSizeVariants: {
|
|
|
280
280
|
readonly XS: "XS";
|
|
281
281
|
readonly S: "S";
|
|
282
282
|
readonly M: "M";
|
|
283
|
+
readonly ML: "ML";
|
|
283
284
|
readonly L: "L";
|
|
284
285
|
readonly XL: "XL";
|
|
285
286
|
};
|
|
@@ -297,7 +298,7 @@ interface AvatarOptionProps extends SizeVariantProps<AvatarSizeVariantType>, Img
|
|
|
297
298
|
declare const Avatar: ({ src, badge, fallbackUrl, ...rest }: AvatarProps) => JSX.Element;
|
|
298
299
|
|
|
299
300
|
/** @internal 컴포넌트 메타데이터: 버전 */
|
|
300
|
-
declare const AVATAR_VERSION = "2.
|
|
301
|
+
declare const AVATAR_VERSION = "2.1.1";
|
|
301
302
|
|
|
302
303
|
type StackGenericProps<T extends StringElementType = 'div'> = RenderConfigProps & StackProps & HTMLPropsWithoutRef<T>;
|
|
303
304
|
type StackComponentType = ForwardRefExoticComponent<PropsWithoutRef<StackGenericProps> & RefAttributes<HTMLElement>>;
|
|
@@ -765,7 +766,7 @@ declare const SplitButtonContext: React$1.Context<SplitButtonContextType | null>
|
|
|
765
766
|
declare const useSplitButtonContext: () => SplitButtonContextType;
|
|
766
767
|
|
|
767
768
|
/** @internal 컴포넌트 메타데이터: 버전 */
|
|
768
|
-
declare const BUTTONS_VERSION = "2.0.
|
|
769
|
+
declare const BUTTONS_VERSION = "2.0.3";
|
|
769
770
|
|
|
770
771
|
declare const CalloutTypes: {
|
|
771
772
|
readonly INFORMATION: "INFORMATION";
|
|
@@ -1022,7 +1023,7 @@ declare const dropdownSizeVariants: {
|
|
|
1022
1023
|
readonly L: "L";
|
|
1023
1024
|
};
|
|
1024
1025
|
type DropdownSizeVariantType = $Values<typeof dropdownSizeVariants>;
|
|
1025
|
-
interface DropdownTriggerButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'value'>, DisableProps,
|
|
1026
|
+
interface DropdownTriggerButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'value'>, DisableProps, LeftAndRightElementProps, SizeVariantProps<DropdownSizeVariantType> {
|
|
1026
1027
|
/**
|
|
1027
1028
|
* placeholder를 설정합니다.
|
|
1028
1029
|
*/
|
|
@@ -1033,6 +1034,7 @@ interface DropdownTriggerButtonProps extends Omit<ButtonHTMLAttributes<HTMLButto
|
|
|
1033
1034
|
* width를 설정합니다.
|
|
1034
1035
|
*/
|
|
1035
1036
|
width?: string;
|
|
1037
|
+
onClear?: () => void;
|
|
1036
1038
|
}
|
|
1037
1039
|
|
|
1038
1040
|
declare const Dropdown: {
|
|
@@ -1475,6 +1477,7 @@ interface ToggleButtonProps extends ToggleButtonOptionProps, HTMLAttributes<HTML
|
|
|
1475
1477
|
fixedWidth: number;
|
|
1476
1478
|
selectedValue?: string;
|
|
1477
1479
|
sizeVar?: ToggleButtonSizeVariantType;
|
|
1480
|
+
disabled?: boolean;
|
|
1478
1481
|
}
|
|
1479
1482
|
interface ToggleButtonOptionProps {
|
|
1480
1483
|
}
|
|
@@ -1487,12 +1490,12 @@ interface ToggleButtonInnerRadioOptionProps {
|
|
|
1487
1490
|
}
|
|
1488
1491
|
|
|
1489
1492
|
declare const ToggleButton: {
|
|
1490
|
-
({ fixedWidth, children, targetName, onChange, selectedValue, sizeVar, ...rest }: ToggleButtonProps): react_jsx_runtime.JSX.Element;
|
|
1491
|
-
InnerRadio:
|
|
1493
|
+
({ fixedWidth, children, targetName, onChange, selectedValue, sizeVar, disabled, ...rest }: ToggleButtonProps): react_jsx_runtime.JSX.Element;
|
|
1494
|
+
InnerRadio: React$1.ForwardRefExoticComponent<ToggleButtonInnerRadioProps & React$1.RefAttributes<HTMLInputElement>>;
|
|
1492
1495
|
};
|
|
1493
1496
|
|
|
1494
1497
|
/** @internal 컴포넌트 메타데이터: 버전 */
|
|
1495
|
-
declare const TOGGLE_BUTTON_VERSION = "2.0.
|
|
1498
|
+
declare const TOGGLE_BUTTON_VERSION = "2.0.1";
|
|
1496
1499
|
|
|
1497
1500
|
declare const DayDatepickerSizeVariants: {
|
|
1498
1501
|
readonly S: "S";
|
package/dist/index.d.ts
CHANGED
|
@@ -280,6 +280,7 @@ declare const AvatarSizeVariants: {
|
|
|
280
280
|
readonly XS: "XS";
|
|
281
281
|
readonly S: "S";
|
|
282
282
|
readonly M: "M";
|
|
283
|
+
readonly ML: "ML";
|
|
283
284
|
readonly L: "L";
|
|
284
285
|
readonly XL: "XL";
|
|
285
286
|
};
|
|
@@ -297,7 +298,7 @@ interface AvatarOptionProps extends SizeVariantProps<AvatarSizeVariantType>, Img
|
|
|
297
298
|
declare const Avatar: ({ src, badge, fallbackUrl, ...rest }: AvatarProps) => JSX.Element;
|
|
298
299
|
|
|
299
300
|
/** @internal 컴포넌트 메타데이터: 버전 */
|
|
300
|
-
declare const AVATAR_VERSION = "2.
|
|
301
|
+
declare const AVATAR_VERSION = "2.1.1";
|
|
301
302
|
|
|
302
303
|
type StackGenericProps<T extends StringElementType = 'div'> = RenderConfigProps & StackProps & HTMLPropsWithoutRef<T>;
|
|
303
304
|
type StackComponentType = ForwardRefExoticComponent<PropsWithoutRef<StackGenericProps> & RefAttributes<HTMLElement>>;
|
|
@@ -765,7 +766,7 @@ declare const SplitButtonContext: React$1.Context<SplitButtonContextType | null>
|
|
|
765
766
|
declare const useSplitButtonContext: () => SplitButtonContextType;
|
|
766
767
|
|
|
767
768
|
/** @internal 컴포넌트 메타데이터: 버전 */
|
|
768
|
-
declare const BUTTONS_VERSION = "2.0.
|
|
769
|
+
declare const BUTTONS_VERSION = "2.0.3";
|
|
769
770
|
|
|
770
771
|
declare const CalloutTypes: {
|
|
771
772
|
readonly INFORMATION: "INFORMATION";
|
|
@@ -1022,7 +1023,7 @@ declare const dropdownSizeVariants: {
|
|
|
1022
1023
|
readonly L: "L";
|
|
1023
1024
|
};
|
|
1024
1025
|
type DropdownSizeVariantType = $Values<typeof dropdownSizeVariants>;
|
|
1025
|
-
interface DropdownTriggerButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'value'>, DisableProps,
|
|
1026
|
+
interface DropdownTriggerButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'value'>, DisableProps, LeftAndRightElementProps, SizeVariantProps<DropdownSizeVariantType> {
|
|
1026
1027
|
/**
|
|
1027
1028
|
* placeholder를 설정합니다.
|
|
1028
1029
|
*/
|
|
@@ -1033,6 +1034,7 @@ interface DropdownTriggerButtonProps extends Omit<ButtonHTMLAttributes<HTMLButto
|
|
|
1033
1034
|
* width를 설정합니다.
|
|
1034
1035
|
*/
|
|
1035
1036
|
width?: string;
|
|
1037
|
+
onClear?: () => void;
|
|
1036
1038
|
}
|
|
1037
1039
|
|
|
1038
1040
|
declare const Dropdown: {
|
|
@@ -1475,6 +1477,7 @@ interface ToggleButtonProps extends ToggleButtonOptionProps, HTMLAttributes<HTML
|
|
|
1475
1477
|
fixedWidth: number;
|
|
1476
1478
|
selectedValue?: string;
|
|
1477
1479
|
sizeVar?: ToggleButtonSizeVariantType;
|
|
1480
|
+
disabled?: boolean;
|
|
1478
1481
|
}
|
|
1479
1482
|
interface ToggleButtonOptionProps {
|
|
1480
1483
|
}
|
|
@@ -1487,12 +1490,12 @@ interface ToggleButtonInnerRadioOptionProps {
|
|
|
1487
1490
|
}
|
|
1488
1491
|
|
|
1489
1492
|
declare const ToggleButton: {
|
|
1490
|
-
({ fixedWidth, children, targetName, onChange, selectedValue, sizeVar, ...rest }: ToggleButtonProps): react_jsx_runtime.JSX.Element;
|
|
1491
|
-
InnerRadio:
|
|
1493
|
+
({ fixedWidth, children, targetName, onChange, selectedValue, sizeVar, disabled, ...rest }: ToggleButtonProps): react_jsx_runtime.JSX.Element;
|
|
1494
|
+
InnerRadio: React$1.ForwardRefExoticComponent<ToggleButtonInnerRadioProps & React$1.RefAttributes<HTMLInputElement>>;
|
|
1492
1495
|
};
|
|
1493
1496
|
|
|
1494
1497
|
/** @internal 컴포넌트 메타데이터: 버전 */
|
|
1495
|
-
declare const TOGGLE_BUTTON_VERSION = "2.0.
|
|
1498
|
+
declare const TOGGLE_BUTTON_VERSION = "2.0.1";
|
|
1496
1499
|
|
|
1497
1500
|
declare const DayDatepickerSizeVariants: {
|
|
1498
1501
|
readonly S: "S";
|
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 { DownArrowSolidXsmallIcon, RightArrowSolidXsmallIcon, FirstPageIcon, LeftArrowIcon, RightArrowIcon, EndPageIcon, SearchIcon } from '@shoplflow/shopl-assets';
|
|
14
|
+
import { DeleteIcon, DownArrowSolidXsmallIcon, RightArrowSolidXsmallIcon, FirstPageIcon, LeftArrowIcon, RightArrowIcon, EndPageIcon, SearchIcon } 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';
|
|
@@ -205,6 +205,8 @@ var getSizeBySizeVariant = (size2) => {
|
|
|
205
205
|
return "24px";
|
|
206
206
|
case "M":
|
|
207
207
|
return "32px";
|
|
208
|
+
case "ML":
|
|
209
|
+
return "40px";
|
|
208
210
|
case "L":
|
|
209
211
|
return "48px";
|
|
210
212
|
case "XL":
|
|
@@ -213,6 +215,24 @@ var getSizeBySizeVariant = (size2) => {
|
|
|
213
215
|
return "32px";
|
|
214
216
|
}
|
|
215
217
|
};
|
|
218
|
+
var getIconSizeBySizeVariant = (size2) => {
|
|
219
|
+
switch (size2) {
|
|
220
|
+
case "XS":
|
|
221
|
+
return "8px";
|
|
222
|
+
case "S":
|
|
223
|
+
return "12px";
|
|
224
|
+
case "M":
|
|
225
|
+
return "16px";
|
|
226
|
+
case "ML":
|
|
227
|
+
return "16px";
|
|
228
|
+
case "L":
|
|
229
|
+
return "20px";
|
|
230
|
+
case "XL":
|
|
231
|
+
return "24px";
|
|
232
|
+
default:
|
|
233
|
+
return "16px";
|
|
234
|
+
}
|
|
235
|
+
};
|
|
216
236
|
var StyledAvatar = styled6.picture`
|
|
217
237
|
display: flex;
|
|
218
238
|
align-items: center;
|
|
@@ -244,6 +264,12 @@ var StyledAvatarBadge = styled6.div`
|
|
|
244
264
|
height: fit-content;
|
|
245
265
|
bottom: 0;
|
|
246
266
|
right: 0;
|
|
267
|
+
> svg {
|
|
268
|
+
min-width: ${({ size: size2 }) => getIconSizeBySizeVariant(size2)};
|
|
269
|
+
min-height: ${({ size: size2 }) => getIconSizeBySizeVariant(size2)};
|
|
270
|
+
width: ${({ size: size2 }) => getIconSizeBySizeVariant(size2)};
|
|
271
|
+
height: ${({ size: size2 }) => getIconSizeBySizeVariant(size2)};
|
|
272
|
+
}
|
|
247
273
|
`;
|
|
248
274
|
|
|
249
275
|
// src/assets/mocks/AvatarNone.png
|
|
@@ -260,7 +286,7 @@ var Avatar = (_a) => {
|
|
|
260
286
|
}
|
|
261
287
|
}
|
|
262
288
|
) })),
|
|
263
|
-
/* @__PURE__ */ jsx(StyledAvatarBadge, { children: badge })
|
|
289
|
+
/* @__PURE__ */ jsx(StyledAvatarBadge, { size: rest.sizeVar, children: badge })
|
|
264
290
|
] });
|
|
265
291
|
};
|
|
266
292
|
var Avatar_default = Avatar;
|
|
@@ -270,12 +296,13 @@ var AvatarSizeVariants = {
|
|
|
270
296
|
XS: "XS",
|
|
271
297
|
S: "S",
|
|
272
298
|
M: "M",
|
|
299
|
+
ML: "ML",
|
|
273
300
|
L: "L",
|
|
274
301
|
XL: "XL"
|
|
275
302
|
};
|
|
276
303
|
|
|
277
304
|
// src/components/Avatar/version.ts
|
|
278
|
-
var AVATAR_VERSION = "2.
|
|
305
|
+
var AVATAR_VERSION = "2.1.1";
|
|
279
306
|
|
|
280
307
|
// src/styles/tokens.ts
|
|
281
308
|
var fontWeightRegular = "var(--font-weight-regular)";
|
|
@@ -1718,12 +1745,14 @@ var getStyleBySizeVar2 = (sizeVar) => {
|
|
|
1718
1745
|
case "M":
|
|
1719
1746
|
return css`
|
|
1720
1747
|
gap: 4px;
|
|
1748
|
+
padding: 0 12px;
|
|
1721
1749
|
min-width: 72px;
|
|
1722
1750
|
min-height: 40px;
|
|
1723
1751
|
`;
|
|
1724
1752
|
case "S":
|
|
1725
1753
|
return css`
|
|
1726
1754
|
gap: 2px;
|
|
1755
|
+
padding: 0 10px;
|
|
1727
1756
|
min-width: 54px;
|
|
1728
1757
|
min-height: 32px;
|
|
1729
1758
|
`;
|
|
@@ -1736,6 +1765,7 @@ var getStyleBySizeVar2 = (sizeVar) => {
|
|
|
1736
1765
|
default:
|
|
1737
1766
|
return css`
|
|
1738
1767
|
gap: 4px;
|
|
1768
|
+
padding: 0 12px;
|
|
1739
1769
|
min-width: 72px;
|
|
1740
1770
|
min-height: 40px;
|
|
1741
1771
|
`;
|
|
@@ -1756,8 +1786,6 @@ var StyledButton = styled6.button`
|
|
|
1756
1786
|
justify-content: center;
|
|
1757
1787
|
height: fit-content;
|
|
1758
1788
|
width: fit-content;
|
|
1759
|
-
/* gap: 4px; */
|
|
1760
|
-
padding: 0 12px;
|
|
1761
1789
|
border-radius: 6px;
|
|
1762
1790
|
cursor: pointer;
|
|
1763
1791
|
${({ styleVar, color, disabled }) => getStyleByStyleVar(styleVar, color, disabled)};
|
|
@@ -2958,7 +2986,7 @@ var SplitButtonStyleVariants = {
|
|
|
2958
2986
|
};
|
|
2959
2987
|
|
|
2960
2988
|
// src/components/Buttons/version.ts
|
|
2961
|
-
var BUTTONS_VERSION = "2.0.
|
|
2989
|
+
var BUTTONS_VERSION = "2.0.3";
|
|
2962
2990
|
var informationStyle = css`
|
|
2963
2991
|
background: ${colorTokens.neutral400_5};
|
|
2964
2992
|
& > svg > circle {
|
|
@@ -3131,33 +3159,31 @@ var getDropdownFontSizeBySizeVar = (size2) => {
|
|
|
3131
3159
|
case "M":
|
|
3132
3160
|
return "body1_400";
|
|
3133
3161
|
case "S":
|
|
3134
|
-
return "
|
|
3162
|
+
return "body1_400";
|
|
3135
3163
|
default:
|
|
3136
3164
|
return "body1_400";
|
|
3137
3165
|
}
|
|
3138
3166
|
};
|
|
3139
3167
|
var getDropdownStyleBySizeVar = (size2) => {
|
|
3140
3168
|
switch (size2) {
|
|
3141
|
-
case "
|
|
3169
|
+
case "S":
|
|
3142
3170
|
return css`
|
|
3143
|
-
|
|
3144
|
-
padding: 8px 4px 8px 12px;
|
|
3171
|
+
padding: 0 8px;
|
|
3145
3172
|
`;
|
|
3146
3173
|
case "M":
|
|
3147
3174
|
return css`
|
|
3148
|
-
|
|
3149
|
-
gap: 4px;
|
|
3150
|
-
padding: 4px 4px 4px 12px;
|
|
3175
|
+
padding: 0 12px;
|
|
3151
3176
|
`;
|
|
3152
|
-
case "
|
|
3177
|
+
case "L":
|
|
3153
3178
|
return css`
|
|
3154
|
-
background-color:
|
|
3155
|
-
padding:
|
|
3156
|
-
|
|
3179
|
+
background-color: transparent;
|
|
3180
|
+
padding-left: 12px;
|
|
3181
|
+
padding-right: 6px;
|
|
3157
3182
|
`;
|
|
3158
3183
|
default:
|
|
3159
3184
|
return css`
|
|
3160
|
-
|
|
3185
|
+
background-color: ${colorTokens.neutral0};
|
|
3186
|
+
padding: 0 8px;
|
|
3161
3187
|
`;
|
|
3162
3188
|
}
|
|
3163
3189
|
};
|
|
@@ -3166,28 +3192,12 @@ var getDisabledStyle2 = (disabled) => {
|
|
|
3166
3192
|
return css`
|
|
3167
3193
|
cursor: not-allowed;
|
|
3168
3194
|
background: ${colorTokens.neutral100};
|
|
3195
|
+
svg > path {
|
|
3196
|
+
fill: ${colorTokens.neutral400} !important;
|
|
3197
|
+
}
|
|
3169
3198
|
`;
|
|
3170
3199
|
}
|
|
3171
3200
|
};
|
|
3172
|
-
var getDropdownIconSizeBySizeVar = (size2) => {
|
|
3173
|
-
switch (size2) {
|
|
3174
|
-
case "S":
|
|
3175
|
-
case "L":
|
|
3176
|
-
return css`
|
|
3177
|
-
height: 24px;
|
|
3178
|
-
width: 24px;
|
|
3179
|
-
min-width: 24px;
|
|
3180
|
-
min-height: 24px;
|
|
3181
|
-
`;
|
|
3182
|
-
default:
|
|
3183
|
-
return css`
|
|
3184
|
-
height: 32px;
|
|
3185
|
-
width: 32px;
|
|
3186
|
-
min-width: 32px;
|
|
3187
|
-
min-height: 32px;
|
|
3188
|
-
`;
|
|
3189
|
-
}
|
|
3190
|
-
};
|
|
3191
3201
|
var getBorderColorByStatus = ({ isFocused, isError, isHovered, disabled, sizeVar }) => {
|
|
3192
3202
|
if (!disabled) {
|
|
3193
3203
|
if (isError) {
|
|
@@ -3232,7 +3242,17 @@ var getStyleByType = ({
|
|
|
3232
3242
|
height: ${height || "initial"};
|
|
3233
3243
|
`;
|
|
3234
3244
|
};
|
|
3235
|
-
var
|
|
3245
|
+
var getClearIconHoverStyle = (hasValue) => {
|
|
3246
|
+
if (!hasValue) {
|
|
3247
|
+
return;
|
|
3248
|
+
}
|
|
3249
|
+
return css`
|
|
3250
|
+
&:hover .dropdown-clear-icon {
|
|
3251
|
+
display: flex;
|
|
3252
|
+
}
|
|
3253
|
+
`;
|
|
3254
|
+
};
|
|
3255
|
+
var StyledDropdownButtonWrapper = styled6.div`
|
|
3236
3256
|
position: relative;
|
|
3237
3257
|
display: flex;
|
|
3238
3258
|
align-items: center;
|
|
@@ -3250,33 +3270,63 @@ var StyledDropdownButtonWrapper = styled6.label`
|
|
|
3250
3270
|
width
|
|
3251
3271
|
})};
|
|
3252
3272
|
${(props) => getButtonWrapperStyleBySizeVar(props)};
|
|
3253
|
-
|
|
3254
3273
|
${({ disabled }) => getDisabledStyle2(disabled)};
|
|
3274
|
+
|
|
3275
|
+
${({ hasValue }) => getClearIconHoverStyle(hasValue)}
|
|
3255
3276
|
`;
|
|
3256
3277
|
var StyledDropdownButton = styled6.button`
|
|
3278
|
+
position: relative;
|
|
3257
3279
|
display: flex;
|
|
3258
3280
|
flex-direction: row;
|
|
3259
3281
|
align-items: center;
|
|
3260
3282
|
justify-content: space-between;
|
|
3261
3283
|
width: 100%;
|
|
3262
3284
|
height: 100%;
|
|
3263
|
-
|
|
3264
3285
|
cursor: pointer;
|
|
3286
|
+
|
|
3265
3287
|
${({ sizeVar }) => sizeVar && getDropdownStyleBySizeVar(sizeVar)};
|
|
3266
3288
|
${({ disabled }) => getDisabledStyle2(disabled)};
|
|
3289
|
+
|
|
3290
|
+
.dropdown-clear-icon {
|
|
3291
|
+
display: none;
|
|
3292
|
+
position: absolute;
|
|
3293
|
+
right: 0;
|
|
3294
|
+
}
|
|
3267
3295
|
`;
|
|
3268
|
-
var DropdownButtonIcon = styled6
|
|
3296
|
+
var DropdownButtonIcon = styled6.div`
|
|
3269
3297
|
display: flex;
|
|
3270
3298
|
align-items: center;
|
|
3271
|
-
justify-content: center;
|
|
3272
3299
|
flex-shrink: 0;
|
|
3300
|
+
min-width: 22px;
|
|
3301
|
+
height: 100%;
|
|
3273
3302
|
|
|
3274
|
-
${({ sizeVar }) => sizeVar && getDropdownIconSizeBySizeVar(sizeVar)};
|
|
3275
3303
|
${({ disabled }) => getDisabledStyle2(disabled)};
|
|
3276
3304
|
`;
|
|
3277
3305
|
var DropdownTriggerButton = forwardRef(
|
|
3278
3306
|
(_a, ref) => {
|
|
3279
|
-
var _b = _a, {
|
|
3307
|
+
var _b = _a, {
|
|
3308
|
+
width = "100%",
|
|
3309
|
+
onClick,
|
|
3310
|
+
sizeVar = "M",
|
|
3311
|
+
isError,
|
|
3312
|
+
placeholder,
|
|
3313
|
+
value,
|
|
3314
|
+
disabled,
|
|
3315
|
+
leftSource,
|
|
3316
|
+
rightSource,
|
|
3317
|
+
onClear
|
|
3318
|
+
} = _b, rest = __objRest(_b, [
|
|
3319
|
+
"width",
|
|
3320
|
+
"onClick",
|
|
3321
|
+
"sizeVar",
|
|
3322
|
+
"isError",
|
|
3323
|
+
"placeholder",
|
|
3324
|
+
"value",
|
|
3325
|
+
"disabled",
|
|
3326
|
+
"leftSource",
|
|
3327
|
+
"rightSource",
|
|
3328
|
+
"onClear"
|
|
3329
|
+
]);
|
|
3280
3330
|
const { isOpen, setIsOpen } = useDropdown();
|
|
3281
3331
|
const [isHovered, setIsHovered] = useState(false);
|
|
3282
3332
|
const handleOnClick = (e) => {
|
|
@@ -3291,6 +3341,10 @@ var DropdownTriggerButton = forwardRef(
|
|
|
3291
3341
|
const handleOnMouseLeave = () => {
|
|
3292
3342
|
setIsHovered(false);
|
|
3293
3343
|
};
|
|
3344
|
+
const handleOnClear = (e) => {
|
|
3345
|
+
e.stopPropagation();
|
|
3346
|
+
onClear && onClear();
|
|
3347
|
+
};
|
|
3294
3348
|
const getTextColor = ({ value: value2, disabled: disabled2 }) => {
|
|
3295
3349
|
if (disabled2) {
|
|
3296
3350
|
return "neutral350";
|
|
@@ -3301,7 +3355,8 @@ var DropdownTriggerButton = forwardRef(
|
|
|
3301
3355
|
return "neutral700";
|
|
3302
3356
|
};
|
|
3303
3357
|
const LeftSourceClone = leftSource ? cloneElement(leftSource, __spreadProps(__spreadValues({}, leftSource.props), { disabled })) : leftSource;
|
|
3304
|
-
|
|
3358
|
+
const RightSourceClone = rightSource ? cloneElement(rightSource, __spreadProps(__spreadValues({}, rightSource.props), { disabled })) : rightSource;
|
|
3359
|
+
return /* @__PURE__ */ jsxs(
|
|
3305
3360
|
StyledDropdownButtonWrapper,
|
|
3306
3361
|
{
|
|
3307
3362
|
onMouseEnter: handleOnMouseEnter,
|
|
@@ -3313,24 +3368,39 @@ var DropdownTriggerButton = forwardRef(
|
|
|
3313
3368
|
isError,
|
|
3314
3369
|
sizeVar,
|
|
3315
3370
|
height: getDropdownHeightBySizeVar(sizeVar),
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
lineClamp: 1,
|
|
3326
|
-
children: placeholder
|
|
3327
|
-
}
|
|
3328
|
-
)
|
|
3329
|
-
] }),
|
|
3330
|
-
/* @__PURE__ */ jsx(
|
|
3331
|
-
DropdownButtonIcon,
|
|
3332
|
-
{
|
|
3371
|
+
hasValue: Boolean(value),
|
|
3372
|
+
children: [
|
|
3373
|
+
/* @__PURE__ */ jsxs(
|
|
3374
|
+
StyledDropdownButton,
|
|
3375
|
+
__spreadProps(__spreadValues({
|
|
3376
|
+
ref,
|
|
3377
|
+
onClick: handleOnClick,
|
|
3378
|
+
disabled
|
|
3379
|
+
}, rest), {
|
|
3333
3380
|
sizeVar,
|
|
3381
|
+
"data-shoplflow": "Dropdown-Content-Area",
|
|
3382
|
+
children: [
|
|
3383
|
+
/* @__PURE__ */ jsxs(Stack_default.Horizontal, { width: "100%", spacing: "spacing04", align: "center", children: [
|
|
3384
|
+
LeftSourceClone && LeftSourceClone,
|
|
3385
|
+
value || /* @__PURE__ */ jsx(
|
|
3386
|
+
Text_default,
|
|
3387
|
+
{
|
|
3388
|
+
typography: getDropdownFontSizeBySizeVar(sizeVar),
|
|
3389
|
+
color: getTextColor({ value, disabled }),
|
|
3390
|
+
textOverflow: "ellipsis",
|
|
3391
|
+
lineClamp: 1,
|
|
3392
|
+
children: placeholder
|
|
3393
|
+
}
|
|
3394
|
+
)
|
|
3395
|
+
] }),
|
|
3396
|
+
onClear && sizeVar !== "L" && /* @__PURE__ */ jsx(IconButton_default, { sizeVar, styleVar: "GHOST", onClick: handleOnClear, className: "dropdown-clear-icon", children: /* @__PURE__ */ jsx(Icon_default, { iconSource: DeleteIcon, color: "neutral350", sizeVar: "S" }) })
|
|
3397
|
+
]
|
|
3398
|
+
})
|
|
3399
|
+
),
|
|
3400
|
+
RightSourceClone && /* @__PURE__ */ jsx(StackContainer_default, { padding: "0 6px 0 0", children: RightSourceClone }),
|
|
3401
|
+
/* @__PURE__ */ jsx(DropdownButtonIcon, { sizeVar, "data-shoplflow": "Dropdown-Button-Icon-Area", children: /* @__PURE__ */ jsx(
|
|
3402
|
+
motion.div,
|
|
3403
|
+
{
|
|
3334
3404
|
animate: {
|
|
3335
3405
|
rotate: isOpen ? 180 : 0
|
|
3336
3406
|
},
|
|
@@ -3346,8 +3416,8 @@ var DropdownTriggerButton = forwardRef(
|
|
|
3346
3416
|
}
|
|
3347
3417
|
)
|
|
3348
3418
|
}
|
|
3349
|
-
)
|
|
3350
|
-
]
|
|
3419
|
+
) })
|
|
3420
|
+
]
|
|
3351
3421
|
}
|
|
3352
3422
|
);
|
|
3353
3423
|
}
|
|
@@ -5054,26 +5124,6 @@ var Pagination_default = Pagination;
|
|
|
5054
5124
|
|
|
5055
5125
|
// src/components/Pagination/version.ts
|
|
5056
5126
|
var PAGINATION_VERSION = "2.0.0";
|
|
5057
|
-
var getLabelStyleByStatus = (selected, disabled) => {
|
|
5058
|
-
if (disabled && selected) {
|
|
5059
|
-
return css`
|
|
5060
|
-
background-color: ${colorTokens.neutral0};
|
|
5061
|
-
cursor: not-allowed;
|
|
5062
|
-
`;
|
|
5063
|
-
}
|
|
5064
|
-
if (disabled) {
|
|
5065
|
-
return css`
|
|
5066
|
-
cursor: not-allowed;
|
|
5067
|
-
opacity: 0.5;
|
|
5068
|
-
`;
|
|
5069
|
-
}
|
|
5070
|
-
if (selected) {
|
|
5071
|
-
return css`
|
|
5072
|
-
cursor: default;
|
|
5073
|
-
background-color: ${colorTokens.neutral0};
|
|
5074
|
-
`;
|
|
5075
|
-
}
|
|
5076
|
-
};
|
|
5077
5127
|
var getLabelStyleBySizeVar = (sizeVar) => {
|
|
5078
5128
|
switch (sizeVar) {
|
|
5079
5129
|
case "S": {
|
|
@@ -5109,14 +5159,26 @@ var StyledToggleInner = styled6.button`
|
|
|
5109
5159
|
padding: 0 12px;
|
|
5110
5160
|
border-radius: 6px;
|
|
5111
5161
|
background-color: transparent;
|
|
5112
|
-
${({ disabled, selected }) => getLabelStyleByStatus(selected, Boolean(disabled))}
|
|
5113
5162
|
${({ sizeVar }) => getLabelStyleBySizeVar(sizeVar)}
|
|
5114
5163
|
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
|
|
5118
|
-
|
|
5119
|
-
|
|
5164
|
+
&[data-selected='true'] {
|
|
5165
|
+
cursor: default;
|
|
5166
|
+
background-color: ${colorTokens.neutral0};
|
|
5167
|
+
}
|
|
5168
|
+
|
|
5169
|
+
&[aria-disabled='true'] {
|
|
5170
|
+
cursor: not-allowed;
|
|
5171
|
+
opacity: 0.5;
|
|
5172
|
+
}
|
|
5173
|
+
|
|
5174
|
+
&[aria-disabled='true'][data-selected='true'] {
|
|
5175
|
+
opacity: 1;
|
|
5176
|
+
background-color: ${colorTokens.neutral0};
|
|
5177
|
+
}
|
|
5178
|
+
|
|
5179
|
+
&:hover:not([aria-disabled='true']):not([data-selected='true']) {
|
|
5180
|
+
cursor: pointer;
|
|
5181
|
+
background-color: ${colorTokens.neutral400_5};
|
|
5120
5182
|
}
|
|
5121
5183
|
`;
|
|
5122
5184
|
var StyledToggleInnerLabel = styled6.label`
|
|
@@ -5147,21 +5209,24 @@ var ToggleButton = (_a) => {
|
|
|
5147
5209
|
targetName,
|
|
5148
5210
|
onChange,
|
|
5149
5211
|
selectedValue,
|
|
5150
|
-
sizeVar = "S"
|
|
5212
|
+
sizeVar = "S",
|
|
5213
|
+
disabled = false
|
|
5151
5214
|
} = _b, rest = __objRest(_b, [
|
|
5152
5215
|
"fixedWidth",
|
|
5153
5216
|
"children",
|
|
5154
5217
|
"targetName",
|
|
5155
5218
|
"onChange",
|
|
5156
5219
|
"selectedValue",
|
|
5157
|
-
"sizeVar"
|
|
5220
|
+
"sizeVar",
|
|
5221
|
+
"disabled"
|
|
5158
5222
|
]);
|
|
5159
|
-
return /* @__PURE__ */ jsx(ToggleButtonContext.Provider, { value: { fixedWidth, targetName, onChange, selectedValue, sizeVar }, children: /* @__PURE__ */ jsx(StyledToggleButton, __spreadProps(__spreadValues({ "data-shoplflow": "ToggleButton" }, rest), { children })) });
|
|
5223
|
+
return /* @__PURE__ */ jsx(ToggleButtonContext.Provider, { value: { fixedWidth, targetName, onChange, selectedValue, sizeVar, disabled }, children: /* @__PURE__ */ jsx(StyledToggleButton, __spreadProps(__spreadValues({ "data-shoplflow": "ToggleButton", "aria-disabled": disabled }, rest), { children })) });
|
|
5160
5224
|
};
|
|
5161
5225
|
var ToggleInnerRadio = forwardRef(
|
|
5162
5226
|
(_a, ref) => {
|
|
5163
|
-
var _b = _a, { label, disabled, value, id } = _b, rest = __objRest(_b, ["label", "disabled", "value", "id"]);
|
|
5164
|
-
const { fixedWidth, onChange, targetName, selectedValue, sizeVar } = useToggleButton();
|
|
5227
|
+
var _b = _a, { label, disabled: itemDisabled, value, id } = _b, rest = __objRest(_b, ["label", "disabled", "value", "id"]);
|
|
5228
|
+
const { fixedWidth, onChange, targetName, selectedValue, sizeVar, disabled: groupDisabled } = useToggleButton();
|
|
5229
|
+
const disabled = groupDisabled || itemDisabled;
|
|
5165
5230
|
const labelRef = useRef(null);
|
|
5166
5231
|
let selected = false;
|
|
5167
5232
|
if (selectedValue && selectedValue === value) {
|
|
@@ -5177,12 +5242,15 @@ var ToggleInnerRadio = forwardRef(
|
|
|
5177
5242
|
StyledToggleInner,
|
|
5178
5243
|
{
|
|
5179
5244
|
width: fixedWidth,
|
|
5180
|
-
disabled,
|
|
5181
|
-
selected,
|
|
5182
5245
|
sizeVar,
|
|
5183
5246
|
type: "button",
|
|
5247
|
+
"aria-disabled": disabled,
|
|
5248
|
+
"data-selected": selected,
|
|
5184
5249
|
onClick: () => {
|
|
5185
5250
|
var _a2;
|
|
5251
|
+
if (disabled) {
|
|
5252
|
+
return;
|
|
5253
|
+
}
|
|
5186
5254
|
(_a2 = labelRef == null ? void 0 : labelRef.current) == null ? void 0 : _a2.click();
|
|
5187
5255
|
},
|
|
5188
5256
|
children: [
|
|
@@ -5192,6 +5260,7 @@ var ToggleInnerRadio = forwardRef(
|
|
|
5192
5260
|
checked: selected,
|
|
5193
5261
|
width: fixedWidth,
|
|
5194
5262
|
disabled,
|
|
5263
|
+
"aria-disabled": disabled,
|
|
5195
5264
|
value,
|
|
5196
5265
|
id,
|
|
5197
5266
|
type: "radio",
|
|
@@ -5225,7 +5294,7 @@ var ToggleButtonSizeVariants = {
|
|
|
5225
5294
|
};
|
|
5226
5295
|
|
|
5227
5296
|
// src/components/ToggleButton/version.ts
|
|
5228
|
-
var TOGGLE_BUTTON_VERSION = "2.0.
|
|
5297
|
+
var TOGGLE_BUTTON_VERSION = "2.0.1";
|
|
5229
5298
|
var SmallStyledDayDatepickerWrapper = styled6.div`
|
|
5230
5299
|
display: flex;
|
|
5231
5300
|
width: 280px;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shoplflow/base",
|
|
3
|
-
"version": "0.46.
|
|
3
|
+
"version": "0.46.11",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -86,9 +86,9 @@
|
|
|
86
86
|
"react-datepicker": "^7.3.0",
|
|
87
87
|
"react-dom": "^18.2.0",
|
|
88
88
|
"simplebar-react": "^3.2.6",
|
|
89
|
-
"@shoplflow/
|
|
89
|
+
"@shoplflow/shopl-assets": "^0.12.37",
|
|
90
90
|
"@shoplflow/utils": "^0.8.0",
|
|
91
|
-
"@shoplflow/
|
|
91
|
+
"@shoplflow/hada-assets": "^0.1.10"
|
|
92
92
|
},
|
|
93
93
|
"homepage": "https://github.com/shopl/shoplflow#readme",
|
|
94
94
|
"scripts": {
|