@shoplflow/base 0.45.13 → 0.45.14
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 +26 -9
- package/dist/index.d.cts +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.js +26 -9
- package/dist/styles/global.css +2 -0
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -426,7 +426,9 @@ var spacing02 = "var(--spacing02)";
|
|
|
426
426
|
var spacing04 = "var(--spacing04)";
|
|
427
427
|
var spacing06 = "var(--spacing06)";
|
|
428
428
|
var spacing08 = "var(--spacing08)";
|
|
429
|
+
var spacing10 = "var(--spacing10)";
|
|
429
430
|
var spacing12 = "var(--spacing12)";
|
|
431
|
+
var spacing14 = "var(--spacing14)";
|
|
430
432
|
var spacing16 = "var(--spacing16)";
|
|
431
433
|
var spacing20 = "var(--spacing20)";
|
|
432
434
|
var spacing24 = "var(--spacing24)";
|
|
@@ -438,7 +440,9 @@ exports.spacingTokens = {
|
|
|
438
440
|
spacing04,
|
|
439
441
|
spacing06,
|
|
440
442
|
spacing08,
|
|
443
|
+
spacing10,
|
|
441
444
|
spacing12,
|
|
445
|
+
spacing14,
|
|
442
446
|
spacing16,
|
|
443
447
|
spacing20,
|
|
444
448
|
spacing24,
|
|
@@ -3261,7 +3265,9 @@ var Dropdown = ({
|
|
|
3261
3265
|
trigger,
|
|
3262
3266
|
popper,
|
|
3263
3267
|
option = "CLICK",
|
|
3264
|
-
width = "100%"
|
|
3268
|
+
width = "100%",
|
|
3269
|
+
offset: offset4 = 4,
|
|
3270
|
+
placement
|
|
3265
3271
|
}) => {
|
|
3266
3272
|
const [triggerRef, setTriggerRef] = React3.useState(null);
|
|
3267
3273
|
const [size2, setSize] = React3.useState({ width: 0, height: 0 });
|
|
@@ -3283,8 +3289,9 @@ var Dropdown = ({
|
|
|
3283
3289
|
return /* @__PURE__ */ jsxRuntime.jsx(StyledDropdown, { "data-shoplflow": "Dropdown", width, children: /* @__PURE__ */ jsxRuntime.jsx(DropdownContext.Provider, { value: __spreadProps(__spreadValues({}, size2), { isOpen, setIsOpen, option }), children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3284
3290
|
exports.Popper,
|
|
3285
3291
|
{
|
|
3286
|
-
offset:
|
|
3287
|
-
|
|
3292
|
+
offset: offset4,
|
|
3293
|
+
placement,
|
|
3294
|
+
autoPlacement: placement ? void 0 : {
|
|
3288
3295
|
allowedPlacements: ["bottom-start", "top-start"]
|
|
3289
3296
|
},
|
|
3290
3297
|
children: [
|
|
@@ -3820,7 +3827,8 @@ var Input = React3.forwardRef(
|
|
|
3820
3827
|
rightSource,
|
|
3821
3828
|
minWidth,
|
|
3822
3829
|
gap,
|
|
3823
|
-
initIsFocused
|
|
3830
|
+
initIsFocused,
|
|
3831
|
+
rightSourceStyle
|
|
3824
3832
|
} = _b, rest = __objRest(_b, [
|
|
3825
3833
|
"onFocus",
|
|
3826
3834
|
"onBlur",
|
|
@@ -3843,7 +3851,8 @@ var Input = React3.forwardRef(
|
|
|
3843
3851
|
"rightSource",
|
|
3844
3852
|
"minWidth",
|
|
3845
3853
|
"gap",
|
|
3846
|
-
"initIsFocused"
|
|
3854
|
+
"initIsFocused",
|
|
3855
|
+
"rightSourceStyle"
|
|
3847
3856
|
]);
|
|
3848
3857
|
const [text, setText] = React3.useState("");
|
|
3849
3858
|
const [isFocused, setIsFocused] = React3.useState(Boolean(initIsFocused));
|
|
@@ -3981,7 +3990,7 @@ var Input = React3.forwardRef(
|
|
|
3981
3990
|
),
|
|
3982
3991
|
onClear && isHovered && Boolean(String(text).length > 0) && /* @__PURE__ */ jsxRuntime.jsx(ClearIconButton, { sizeVar, onClick: handleOnClear, styleVar: "GHOST", isHovered: false, children: /* @__PURE__ */ jsxRuntime.jsx(exports.Icon, { iconSource: assetFunction("DeleteIcon"), color: "neutral350" }) })
|
|
3983
3992
|
] }),
|
|
3984
|
-
!(type === "number") && (Boolean(maxLength && isFocused) || Boolean(initialType === "password") || Boolean(rightSource)) && /* @__PURE__ */ jsxRuntime.jsxs(RightElementWrapper2, { type, sizeVar, initialType, children: [
|
|
3993
|
+
!(type === "number") && (Boolean(maxLength && isFocused) || Boolean(initialType === "password") || Boolean(rightSource)) && /* @__PURE__ */ jsxRuntime.jsxs(RightElementWrapper2, { type, sizeVar, initialType, style: rightSourceStyle, children: [
|
|
3985
3994
|
maxLength && isFocused && /* @__PURE__ */ jsxRuntime.jsx(TextCounter_default, { currentLength: String(text).length, maxLength, isError }),
|
|
3986
3995
|
initialType === "password" && /* @__PURE__ */ jsxRuntime.jsx(exports.IconButton, { sizeVar, onClick: handleTogglePasswordType, styleVar: "GHOST", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3987
3996
|
exports.Icon,
|
|
@@ -6673,13 +6682,20 @@ var NumberCombobox = (_a) => {
|
|
|
6673
6682
|
sizeVar,
|
|
6674
6683
|
width,
|
|
6675
6684
|
ref: inputRef,
|
|
6676
|
-
type: "
|
|
6685
|
+
type: "text",
|
|
6686
|
+
inputMode: "numeric",
|
|
6677
6687
|
style: { textAlign: "left", paddingRight: "0px" },
|
|
6678
6688
|
className: _className,
|
|
6679
6689
|
gap: "4px",
|
|
6680
6690
|
initIsFocused: isOpen,
|
|
6681
6691
|
value,
|
|
6682
|
-
onChange
|
|
6692
|
+
onChange: (e) => {
|
|
6693
|
+
const numericValue = e.target.value.replace(/[^\d]/g, "");
|
|
6694
|
+
if (e.target.value !== numericValue) {
|
|
6695
|
+
e.target.value = numericValue;
|
|
6696
|
+
}
|
|
6697
|
+
onChange == null ? void 0 : onChange(e);
|
|
6698
|
+
},
|
|
6683
6699
|
onFocus: () => {
|
|
6684
6700
|
setIsOpen(true);
|
|
6685
6701
|
},
|
|
@@ -6726,7 +6742,8 @@ var NumberCombobox = (_a) => {
|
|
|
6726
6742
|
}
|
|
6727
6743
|
onBlur == null ? void 0 : onBlur(event);
|
|
6728
6744
|
},
|
|
6729
|
-
|
|
6745
|
+
rightSourceStyle: { padding: "4px" },
|
|
6746
|
+
rightSource: /* @__PURE__ */ jsxRuntime.jsx(exports.StackContainer.Horizontal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6730
6747
|
exports.IconButton,
|
|
6731
6748
|
{
|
|
6732
6749
|
sizeVar: "XS",
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React$1 from 'react';
|
|
3
|
-
import React__default, { ElementType, ComponentPropsWithoutRef, ReactNode, ReactElement, ImgHTMLAttributes, ForwardRefExoticComponent, PropsWithoutRef, RefAttributes,
|
|
3
|
+
import React__default, { ElementType, ComponentPropsWithoutRef, ReactNode, ReactElement, CSSProperties, ImgHTMLAttributes, ForwardRefExoticComponent, PropsWithoutRef, RefAttributes, HTMLAttributes, ComponentPropsWithRef, ButtonHTMLAttributes, InputHTMLAttributes, MouseEvent, Ref, ChangeEvent } from 'react';
|
|
4
4
|
import { $Values } from '@shoplflow/utils';
|
|
5
5
|
import { IconSource } from '@shoplflow/shopl-assets';
|
|
6
6
|
import { IconSource as IconSource$1 } from '@shoplflow/hada-assets';
|
|
@@ -97,7 +97,9 @@ declare const spacingTokens: {
|
|
|
97
97
|
spacing04: string;
|
|
98
98
|
spacing06: string;
|
|
99
99
|
spacing08: string;
|
|
100
|
+
spacing10: string;
|
|
100
101
|
spacing12: string;
|
|
102
|
+
spacing14: string;
|
|
101
103
|
spacing16: string;
|
|
102
104
|
spacing20: string;
|
|
103
105
|
spacing24: string;
|
|
@@ -269,6 +271,7 @@ interface RightElementProps {
|
|
|
269
271
|
* 텍스트를 기준으로 오른쪽에 위치할 ReactElement를 설정합니다.
|
|
270
272
|
*/
|
|
271
273
|
rightSource?: ReactElement;
|
|
274
|
+
rightSourceStyle?: CSSProperties;
|
|
272
275
|
}
|
|
273
276
|
interface LeftAndRightElementProps extends RightElementProps, LeftElementProps {
|
|
274
277
|
}
|
|
@@ -954,6 +957,8 @@ interface DropdownOptionProps {
|
|
|
954
957
|
option?: DropdownOptionVariantType;
|
|
955
958
|
width?: CSSProperties['width'];
|
|
956
959
|
disabled?: boolean;
|
|
960
|
+
placement?: Placement;
|
|
961
|
+
offset?: OffsetOptions;
|
|
957
962
|
}
|
|
958
963
|
interface DropdownContentProps extends HTMLAttributes<HTMLDivElement>, ChildrenProps {
|
|
959
964
|
/**
|
|
@@ -986,7 +991,7 @@ interface DropdownTriggerButtonProps extends Omit<ButtonHTMLAttributes<HTMLButto
|
|
|
986
991
|
}
|
|
987
992
|
|
|
988
993
|
declare const Dropdown: {
|
|
989
|
-
({ isOpen: initialIsOpen, trigger, popper, option, width, }: DropdownProps): react_jsx_runtime.JSX.Element;
|
|
994
|
+
({ isOpen: initialIsOpen, trigger, popper, option, width, offset, placement, }: DropdownProps): react_jsx_runtime.JSX.Element;
|
|
990
995
|
Button: React__default.ForwardRefExoticComponent<DropdownTriggerButtonProps & React__default.RefAttributes<HTMLButtonElement>>;
|
|
991
996
|
Content: ({ children, width: initialWidth, type, onClick, ...rest }: DropdownContentProps) => react_jsx_runtime.JSX.Element;
|
|
992
997
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React$1 from 'react';
|
|
3
|
-
import React__default, { ElementType, ComponentPropsWithoutRef, ReactNode, ReactElement, ImgHTMLAttributes, ForwardRefExoticComponent, PropsWithoutRef, RefAttributes,
|
|
3
|
+
import React__default, { ElementType, ComponentPropsWithoutRef, ReactNode, ReactElement, CSSProperties, ImgHTMLAttributes, ForwardRefExoticComponent, PropsWithoutRef, RefAttributes, HTMLAttributes, ComponentPropsWithRef, ButtonHTMLAttributes, InputHTMLAttributes, MouseEvent, Ref, ChangeEvent } from 'react';
|
|
4
4
|
import { $Values } from '@shoplflow/utils';
|
|
5
5
|
import { IconSource } from '@shoplflow/shopl-assets';
|
|
6
6
|
import { IconSource as IconSource$1 } from '@shoplflow/hada-assets';
|
|
@@ -97,7 +97,9 @@ declare const spacingTokens: {
|
|
|
97
97
|
spacing04: string;
|
|
98
98
|
spacing06: string;
|
|
99
99
|
spacing08: string;
|
|
100
|
+
spacing10: string;
|
|
100
101
|
spacing12: string;
|
|
102
|
+
spacing14: string;
|
|
101
103
|
spacing16: string;
|
|
102
104
|
spacing20: string;
|
|
103
105
|
spacing24: string;
|
|
@@ -269,6 +271,7 @@ interface RightElementProps {
|
|
|
269
271
|
* 텍스트를 기준으로 오른쪽에 위치할 ReactElement를 설정합니다.
|
|
270
272
|
*/
|
|
271
273
|
rightSource?: ReactElement;
|
|
274
|
+
rightSourceStyle?: CSSProperties;
|
|
272
275
|
}
|
|
273
276
|
interface LeftAndRightElementProps extends RightElementProps, LeftElementProps {
|
|
274
277
|
}
|
|
@@ -954,6 +957,8 @@ interface DropdownOptionProps {
|
|
|
954
957
|
option?: DropdownOptionVariantType;
|
|
955
958
|
width?: CSSProperties['width'];
|
|
956
959
|
disabled?: boolean;
|
|
960
|
+
placement?: Placement;
|
|
961
|
+
offset?: OffsetOptions;
|
|
957
962
|
}
|
|
958
963
|
interface DropdownContentProps extends HTMLAttributes<HTMLDivElement>, ChildrenProps {
|
|
959
964
|
/**
|
|
@@ -986,7 +991,7 @@ interface DropdownTriggerButtonProps extends Omit<ButtonHTMLAttributes<HTMLButto
|
|
|
986
991
|
}
|
|
987
992
|
|
|
988
993
|
declare const Dropdown: {
|
|
989
|
-
({ isOpen: initialIsOpen, trigger, popper, option, width, }: DropdownProps): react_jsx_runtime.JSX.Element;
|
|
994
|
+
({ isOpen: initialIsOpen, trigger, popper, option, width, offset, placement, }: DropdownProps): react_jsx_runtime.JSX.Element;
|
|
990
995
|
Button: React__default.ForwardRefExoticComponent<DropdownTriggerButtonProps & React__default.RefAttributes<HTMLButtonElement>>;
|
|
991
996
|
Content: ({ children, width: initialWidth, type, onClick, ...rest }: DropdownContentProps) => react_jsx_runtime.JSX.Element;
|
|
992
997
|
};
|
package/dist/index.js
CHANGED
|
@@ -399,7 +399,9 @@ var spacing02 = "var(--spacing02)";
|
|
|
399
399
|
var spacing04 = "var(--spacing04)";
|
|
400
400
|
var spacing06 = "var(--spacing06)";
|
|
401
401
|
var spacing08 = "var(--spacing08)";
|
|
402
|
+
var spacing10 = "var(--spacing10)";
|
|
402
403
|
var spacing12 = "var(--spacing12)";
|
|
404
|
+
var spacing14 = "var(--spacing14)";
|
|
403
405
|
var spacing16 = "var(--spacing16)";
|
|
404
406
|
var spacing20 = "var(--spacing20)";
|
|
405
407
|
var spacing24 = "var(--spacing24)";
|
|
@@ -411,7 +413,9 @@ var spacingTokens = {
|
|
|
411
413
|
spacing04,
|
|
412
414
|
spacing06,
|
|
413
415
|
spacing08,
|
|
416
|
+
spacing10,
|
|
414
417
|
spacing12,
|
|
418
|
+
spacing14,
|
|
415
419
|
spacing16,
|
|
416
420
|
spacing20,
|
|
417
421
|
spacing24,
|
|
@@ -3234,7 +3238,9 @@ var Dropdown = ({
|
|
|
3234
3238
|
trigger,
|
|
3235
3239
|
popper,
|
|
3236
3240
|
option = "CLICK",
|
|
3237
|
-
width = "100%"
|
|
3241
|
+
width = "100%",
|
|
3242
|
+
offset: offset4 = 4,
|
|
3243
|
+
placement
|
|
3238
3244
|
}) => {
|
|
3239
3245
|
const [triggerRef, setTriggerRef] = useState(null);
|
|
3240
3246
|
const [size2, setSize] = useState({ width: 0, height: 0 });
|
|
@@ -3256,8 +3262,9 @@ var Dropdown = ({
|
|
|
3256
3262
|
return /* @__PURE__ */ jsx(StyledDropdown, { "data-shoplflow": "Dropdown", width, children: /* @__PURE__ */ jsx(DropdownContext.Provider, { value: __spreadProps(__spreadValues({}, size2), { isOpen, setIsOpen, option }), children: /* @__PURE__ */ jsxs(
|
|
3257
3263
|
Popper_default,
|
|
3258
3264
|
{
|
|
3259
|
-
offset:
|
|
3260
|
-
|
|
3265
|
+
offset: offset4,
|
|
3266
|
+
placement,
|
|
3267
|
+
autoPlacement: placement ? void 0 : {
|
|
3261
3268
|
allowedPlacements: ["bottom-start", "top-start"]
|
|
3262
3269
|
},
|
|
3263
3270
|
children: [
|
|
@@ -3793,7 +3800,8 @@ var Input = forwardRef(
|
|
|
3793
3800
|
rightSource,
|
|
3794
3801
|
minWidth,
|
|
3795
3802
|
gap,
|
|
3796
|
-
initIsFocused
|
|
3803
|
+
initIsFocused,
|
|
3804
|
+
rightSourceStyle
|
|
3797
3805
|
} = _b, rest = __objRest(_b, [
|
|
3798
3806
|
"onFocus",
|
|
3799
3807
|
"onBlur",
|
|
@@ -3816,7 +3824,8 @@ var Input = forwardRef(
|
|
|
3816
3824
|
"rightSource",
|
|
3817
3825
|
"minWidth",
|
|
3818
3826
|
"gap",
|
|
3819
|
-
"initIsFocused"
|
|
3827
|
+
"initIsFocused",
|
|
3828
|
+
"rightSourceStyle"
|
|
3820
3829
|
]);
|
|
3821
3830
|
const [text, setText] = useState("");
|
|
3822
3831
|
const [isFocused, setIsFocused] = useState(Boolean(initIsFocused));
|
|
@@ -3954,7 +3963,7 @@ var Input = forwardRef(
|
|
|
3954
3963
|
),
|
|
3955
3964
|
onClear && isHovered && Boolean(String(text).length > 0) && /* @__PURE__ */ jsx(ClearIconButton, { sizeVar, onClick: handleOnClear, styleVar: "GHOST", isHovered: false, children: /* @__PURE__ */ jsx(Icon_default, { iconSource: assetFunction("DeleteIcon"), color: "neutral350" }) })
|
|
3956
3965
|
] }),
|
|
3957
|
-
!(type === "number") && (Boolean(maxLength && isFocused) || Boolean(initialType === "password") || Boolean(rightSource)) && /* @__PURE__ */ jsxs(RightElementWrapper2, { type, sizeVar, initialType, children: [
|
|
3966
|
+
!(type === "number") && (Boolean(maxLength && isFocused) || Boolean(initialType === "password") || Boolean(rightSource)) && /* @__PURE__ */ jsxs(RightElementWrapper2, { type, sizeVar, initialType, style: rightSourceStyle, children: [
|
|
3958
3967
|
maxLength && isFocused && /* @__PURE__ */ jsx(TextCounter_default, { currentLength: String(text).length, maxLength, isError }),
|
|
3959
3968
|
initialType === "password" && /* @__PURE__ */ jsx(IconButton_default, { sizeVar, onClick: handleTogglePasswordType, styleVar: "GHOST", children: /* @__PURE__ */ jsx(
|
|
3960
3969
|
Icon_default,
|
|
@@ -6646,13 +6655,20 @@ var NumberCombobox = (_a) => {
|
|
|
6646
6655
|
sizeVar,
|
|
6647
6656
|
width,
|
|
6648
6657
|
ref: inputRef,
|
|
6649
|
-
type: "
|
|
6658
|
+
type: "text",
|
|
6659
|
+
inputMode: "numeric",
|
|
6650
6660
|
style: { textAlign: "left", paddingRight: "0px" },
|
|
6651
6661
|
className: _className,
|
|
6652
6662
|
gap: "4px",
|
|
6653
6663
|
initIsFocused: isOpen,
|
|
6654
6664
|
value,
|
|
6655
|
-
onChange
|
|
6665
|
+
onChange: (e) => {
|
|
6666
|
+
const numericValue = e.target.value.replace(/[^\d]/g, "");
|
|
6667
|
+
if (e.target.value !== numericValue) {
|
|
6668
|
+
e.target.value = numericValue;
|
|
6669
|
+
}
|
|
6670
|
+
onChange == null ? void 0 : onChange(e);
|
|
6671
|
+
},
|
|
6656
6672
|
onFocus: () => {
|
|
6657
6673
|
setIsOpen(true);
|
|
6658
6674
|
},
|
|
@@ -6699,7 +6715,8 @@ var NumberCombobox = (_a) => {
|
|
|
6699
6715
|
}
|
|
6700
6716
|
onBlur == null ? void 0 : onBlur(event);
|
|
6701
6717
|
},
|
|
6702
|
-
|
|
6718
|
+
rightSourceStyle: { padding: "4px" },
|
|
6719
|
+
rightSource: /* @__PURE__ */ jsx(StackContainer_default.Horizontal, { children: /* @__PURE__ */ jsx(
|
|
6703
6720
|
IconButton_default,
|
|
6704
6721
|
{
|
|
6705
6722
|
sizeVar: "XS",
|
package/dist/styles/global.css
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shoplflow/base",
|
|
3
|
-
"version": "0.45.
|
|
3
|
+
"version": "0.45.14",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -99,8 +99,8 @@
|
|
|
99
99
|
"react-dom": "^18.2.0",
|
|
100
100
|
"simplebar-react": "^3.2.6",
|
|
101
101
|
"@shoplflow/hada-assets": "^0.1.10",
|
|
102
|
-
"@shoplflow/
|
|
103
|
-
"@shoplflow/
|
|
102
|
+
"@shoplflow/utils": "^0.7.2",
|
|
103
|
+
"@shoplflow/shopl-assets": "^0.12.33"
|
|
104
104
|
},
|
|
105
105
|
"homepage": "https://github.com/shopl/shoplflow#readme",
|
|
106
106
|
"scripts": {
|