@shoplflow/base 0.30.2 → 0.30.4
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 +62 -57
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +62 -57
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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, CSSProperties, HTMLAttributes, ComponentPropsWithRef, InputHTMLAttributes, MouseEvent, Ref } from 'react';
|
|
3
|
+
import React__default, { ElementType, ComponentPropsWithoutRef, ReactNode, ReactElement, ImgHTMLAttributes, ForwardRefExoticComponent, PropsWithoutRef, RefAttributes, CSSProperties, HTMLAttributes, ComponentPropsWithRef, ButtonHTMLAttributes, InputHTMLAttributes, MouseEvent, Ref } 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';
|
|
@@ -851,7 +851,7 @@ declare const dropdownSizeVariants: {
|
|
|
851
851
|
readonly M: "M";
|
|
852
852
|
};
|
|
853
853
|
declare type DropdownSizeVariantType = $Values<typeof dropdownSizeVariants>;
|
|
854
|
-
interface DropdownButtonProps extends
|
|
854
|
+
interface DropdownButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'value'>, DisableProps, LeftElementProps, SizeVariantProps<DropdownSizeVariantType> {
|
|
855
855
|
/**
|
|
856
856
|
* placeholder를 설정합니다.
|
|
857
857
|
*/
|
|
@@ -1068,7 +1068,7 @@ interface SelectInputButtonOptionProps extends Omit<HTMLAttributes<HTMLLabelElem
|
|
|
1068
1068
|
|
|
1069
1069
|
declare const SelectInputButton: ({ disabled, isSelected, onMouseEnter, onMouseLeave, onClick, onClear, value, placeholder, label, width, rightSource, ...rest }: SelectInputButtonProps) => react_jsx_runtime.JSX.Element;
|
|
1070
1070
|
|
|
1071
|
-
interface MinusBoxProps extends MinusBoxOptionProps, Omit<
|
|
1071
|
+
interface MinusBoxProps extends MinusBoxOptionProps, Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onClick' | 'color'> {
|
|
1072
1072
|
}
|
|
1073
1073
|
interface MinusBoxOptionProps {
|
|
1074
1074
|
/**
|
|
@@ -1090,15 +1090,15 @@ declare const CheckboxStyleVariants: {
|
|
|
1090
1090
|
declare type CheckboxStyleVariantType = $Values<typeof CheckboxStyleVariants>;
|
|
1091
1091
|
interface CheckboxProps extends CheckboxOptionProps {
|
|
1092
1092
|
}
|
|
1093
|
-
interface CheckboxOptionProps extends StyleVariantProps<CheckboxStyleVariantType>, SelectedProps, DefaultSelectedProps, DisableProps,
|
|
1093
|
+
interface CheckboxOptionProps extends StyleVariantProps<CheckboxStyleVariantType>, SelectedProps, DefaultSelectedProps, DisableProps, Omit<InputHTMLAttributes<HTMLInputElement>, 'onMouseLeave' | 'onMouseEnter'>, Pick<ButtonHTMLAttributes<HTMLButtonElement>, 'onMouseLeave' | 'onMouseEnter'> {
|
|
1094
1094
|
}
|
|
1095
1095
|
|
|
1096
1096
|
declare const CHECKBOX_SYMBOL_KEY: unique symbol;
|
|
1097
|
-
declare const Checkbox:
|
|
1097
|
+
declare const Checkbox: React__default.ForwardRefExoticComponent<CheckboxProps & React__default.RefAttributes<HTMLInputElement>>;
|
|
1098
1098
|
|
|
1099
1099
|
interface RadioProps extends RadioOptionProps {
|
|
1100
1100
|
}
|
|
1101
|
-
interface RadioOptionProps extends SelectedProps, DefaultSelectedProps, DisableProps,
|
|
1101
|
+
interface RadioOptionProps extends SelectedProps, DefaultSelectedProps, DisableProps, ButtonHTMLAttributes<HTMLButtonElement> {
|
|
1102
1102
|
}
|
|
1103
1103
|
|
|
1104
1104
|
declare const RADIO_SYMBOL_KEY: unique symbol;
|
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, CSSProperties, HTMLAttributes, ComponentPropsWithRef, InputHTMLAttributes, MouseEvent, Ref } from 'react';
|
|
3
|
+
import React__default, { ElementType, ComponentPropsWithoutRef, ReactNode, ReactElement, ImgHTMLAttributes, ForwardRefExoticComponent, PropsWithoutRef, RefAttributes, CSSProperties, HTMLAttributes, ComponentPropsWithRef, ButtonHTMLAttributes, InputHTMLAttributes, MouseEvent, Ref } 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';
|
|
@@ -851,7 +851,7 @@ declare const dropdownSizeVariants: {
|
|
|
851
851
|
readonly M: "M";
|
|
852
852
|
};
|
|
853
853
|
declare type DropdownSizeVariantType = $Values<typeof dropdownSizeVariants>;
|
|
854
|
-
interface DropdownButtonProps extends
|
|
854
|
+
interface DropdownButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'value'>, DisableProps, LeftElementProps, SizeVariantProps<DropdownSizeVariantType> {
|
|
855
855
|
/**
|
|
856
856
|
* placeholder를 설정합니다.
|
|
857
857
|
*/
|
|
@@ -1068,7 +1068,7 @@ interface SelectInputButtonOptionProps extends Omit<HTMLAttributes<HTMLLabelElem
|
|
|
1068
1068
|
|
|
1069
1069
|
declare const SelectInputButton: ({ disabled, isSelected, onMouseEnter, onMouseLeave, onClick, onClear, value, placeholder, label, width, rightSource, ...rest }: SelectInputButtonProps) => react_jsx_runtime.JSX.Element;
|
|
1070
1070
|
|
|
1071
|
-
interface MinusBoxProps extends MinusBoxOptionProps, Omit<
|
|
1071
|
+
interface MinusBoxProps extends MinusBoxOptionProps, Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onClick' | 'color'> {
|
|
1072
1072
|
}
|
|
1073
1073
|
interface MinusBoxOptionProps {
|
|
1074
1074
|
/**
|
|
@@ -1090,15 +1090,15 @@ declare const CheckboxStyleVariants: {
|
|
|
1090
1090
|
declare type CheckboxStyleVariantType = $Values<typeof CheckboxStyleVariants>;
|
|
1091
1091
|
interface CheckboxProps extends CheckboxOptionProps {
|
|
1092
1092
|
}
|
|
1093
|
-
interface CheckboxOptionProps extends StyleVariantProps<CheckboxStyleVariantType>, SelectedProps, DefaultSelectedProps, DisableProps,
|
|
1093
|
+
interface CheckboxOptionProps extends StyleVariantProps<CheckboxStyleVariantType>, SelectedProps, DefaultSelectedProps, DisableProps, Omit<InputHTMLAttributes<HTMLInputElement>, 'onMouseLeave' | 'onMouseEnter'>, Pick<ButtonHTMLAttributes<HTMLButtonElement>, 'onMouseLeave' | 'onMouseEnter'> {
|
|
1094
1094
|
}
|
|
1095
1095
|
|
|
1096
1096
|
declare const CHECKBOX_SYMBOL_KEY: unique symbol;
|
|
1097
|
-
declare const Checkbox:
|
|
1097
|
+
declare const Checkbox: React__default.ForwardRefExoticComponent<CheckboxProps & React__default.RefAttributes<HTMLInputElement>>;
|
|
1098
1098
|
|
|
1099
1099
|
interface RadioProps extends RadioOptionProps {
|
|
1100
1100
|
}
|
|
1101
|
-
interface RadioOptionProps extends SelectedProps, DefaultSelectedProps, DisableProps,
|
|
1101
|
+
interface RadioOptionProps extends SelectedProps, DefaultSelectedProps, DisableProps, ButtonHTMLAttributes<HTMLButtonElement> {
|
|
1102
1102
|
}
|
|
1103
1103
|
|
|
1104
1104
|
declare const RADIO_SYMBOL_KEY: unique symbol;
|
package/dist/index.js
CHANGED
|
@@ -2358,7 +2358,14 @@ var getStylesByStyleVariant = (styleVariant, isSelected, isHovered) => {
|
|
|
2358
2358
|
return "";
|
|
2359
2359
|
}
|
|
2360
2360
|
};
|
|
2361
|
-
var
|
|
2361
|
+
var StyledCheckHiddenInput = styled6.input`
|
|
2362
|
+
position: absolute;
|
|
2363
|
+
width: 0;
|
|
2364
|
+
height: 0;
|
|
2365
|
+
opacity: 0;
|
|
2366
|
+
visibility: hidden;
|
|
2367
|
+
`;
|
|
2368
|
+
var StyledCheckbox = styled6.label`
|
|
2362
2369
|
display: flex;
|
|
2363
2370
|
align-items: center;
|
|
2364
2371
|
justify-content: center;
|
|
@@ -2383,62 +2390,60 @@ var Container3 = styled6.button`
|
|
|
2383
2390
|
background-color: transparent;
|
|
2384
2391
|
`;
|
|
2385
2392
|
var CHECKBOX_SYMBOL_KEY = Symbol("SHOPLFLOW_CHECKBOX");
|
|
2386
|
-
var Checkbox = (
|
|
2387
|
-
|
|
2388
|
-
defaultSelected,
|
|
2389
|
-
isSelected,
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
);
|
|
2441
|
-
};
|
|
2393
|
+
var Checkbox = forwardRef(
|
|
2394
|
+
(_a, ref) => {
|
|
2395
|
+
var _b = _a, { defaultSelected, isSelected, disabled, onMouseEnter, onMouseLeave, styleVar = "PRIMARY", id } = _b, rest = __objRest(_b, ["defaultSelected", "isSelected", "disabled", "onMouseEnter", "onMouseLeave", "styleVar", "id"]);
|
|
2396
|
+
const [selected, toggleSelected] = useOnToggle(isSelected, defaultSelected);
|
|
2397
|
+
const [isHovered, toggleHovered] = useState(false);
|
|
2398
|
+
const handleMouseLeave = (e) => {
|
|
2399
|
+
toggleHovered(false);
|
|
2400
|
+
onMouseLeave && onMouseLeave(e);
|
|
2401
|
+
};
|
|
2402
|
+
const handleMouseEnter = (e) => {
|
|
2403
|
+
toggleHovered(true);
|
|
2404
|
+
onMouseEnter && onMouseEnter(e);
|
|
2405
|
+
};
|
|
2406
|
+
const handleClick = () => {
|
|
2407
|
+
if (disabled) {
|
|
2408
|
+
return;
|
|
2409
|
+
}
|
|
2410
|
+
toggleSelected();
|
|
2411
|
+
};
|
|
2412
|
+
return /* @__PURE__ */ jsxs(
|
|
2413
|
+
Container3,
|
|
2414
|
+
{
|
|
2415
|
+
onClick: handleClick,
|
|
2416
|
+
onMouseLeave: handleMouseLeave,
|
|
2417
|
+
onMouseEnter: handleMouseEnter,
|
|
2418
|
+
disabled,
|
|
2419
|
+
type: "button",
|
|
2420
|
+
"data-shoplflow": "Checkbox",
|
|
2421
|
+
children: [
|
|
2422
|
+
/* @__PURE__ */ jsx(StyledCheckHiddenInput, __spreadProps(__spreadValues({ type: "checkbox", disabled, id }, rest), { ref })),
|
|
2423
|
+
/* @__PURE__ */ jsx(
|
|
2424
|
+
StyledCheckbox,
|
|
2425
|
+
{
|
|
2426
|
+
styleVar,
|
|
2427
|
+
htmlFor: "id",
|
|
2428
|
+
isHovered,
|
|
2429
|
+
isSelected: selected,
|
|
2430
|
+
disabled,
|
|
2431
|
+
children: /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "8", viewBox: "0 0 12 8", fill: "none", children: /* @__PURE__ */ jsx(
|
|
2432
|
+
"path",
|
|
2433
|
+
{
|
|
2434
|
+
fillRule: "evenodd",
|
|
2435
|
+
clipRule: "evenodd",
|
|
2436
|
+
d: "M9.78822 0.297596C10.1761 -0.0955083 10.8093 -0.0997053 11.2024 0.288222C11.5653 0.646308 11.5968 1.21334 11.2943 1.60765L11.2118 1.7024L5.31714 7.7024C4.95248 8.07193 4.37282 8.09687 3.97909 7.77976L3.88476 7.69335L0.779404 4.42669C0.396475 4.02871 0.408672 3.39567 0.806647 3.01274C1.17401 2.65926 1.74167 2.64247 2.12801 2.95499L2.2206 3.03998L4.614 5.567L9.78822 0.297596Z",
|
|
2437
|
+
fill: "white"
|
|
2438
|
+
}
|
|
2439
|
+
) })
|
|
2440
|
+
}
|
|
2441
|
+
)
|
|
2442
|
+
]
|
|
2443
|
+
}
|
|
2444
|
+
);
|
|
2445
|
+
}
|
|
2446
|
+
);
|
|
2442
2447
|
Checkbox[CHECKBOX_SYMBOL_KEY] = true;
|
|
2443
2448
|
var Checkbox_default = Checkbox;
|
|
2444
2449
|
|