@bds-web/ui 1.14.0 → 1.16.0
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/Dropdown/ui/index.d.ts.map +1 -1
- package/dist/Dropdown/ui/index.js +1 -1
- package/dist/Dropdown/ui/style.d.ts +0 -1
- package/dist/Dropdown/ui/style.d.ts.map +1 -1
- package/dist/Dropdown/ui/style.js +3 -7
- package/dist/Dropdown/utils/get-style.d.ts.map +1 -1
- package/dist/Dropdown/utils/get-style.js +0 -7
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Dropdown/ui/index.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAM/C,eAAO,MAAM,QAAQ,GAAI,uDAMtB,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Dropdown/ui/index.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAM/C,eAAO,MAAM,QAAQ,GAAI,uDAMtB,aAAa,4CAoCf,CAAC"}
|
|
@@ -8,7 +8,7 @@ import { DropdownPortal } from "./DropdownPortal";
|
|
|
8
8
|
export const Dropdown = ({ dropdownSize = "small", onSelect, options, selected, width = "auto", }) => {
|
|
9
9
|
const { isOpen, closeDropdown, toggleDropdown } = useDropdown();
|
|
10
10
|
const containerRef = useOutsideClick(isOpen, closeDropdown);
|
|
11
|
-
return (_jsxs(S.Container, { ref: containerRef, "$size": dropdownSize, "$width": width, onClick: toggleDropdown, style: { position: "relative" }, children: [_jsxs(S.SelectedItem, { children: [_jsx(S.SelectedText, { children: selected ? selected.name : "선택해주세요." }), _jsx(TriangleIcon, {})] }), _jsx(DropdownPortal, { containerRef: containerRef, isOpen: isOpen, children: _jsx(S.OptionsList, { "$
|
|
11
|
+
return (_jsxs(S.Container, { ref: containerRef, "$size": dropdownSize, "$width": width, onClick: toggleDropdown, style: { position: "relative" }, children: [_jsxs(S.SelectedItem, { children: [_jsx(S.SelectedText, { children: selected ? selected.name : "선택해주세요." }), _jsx(TriangleIcon, {})] }), _jsx(DropdownPortal, { containerRef: containerRef, isOpen: isOpen, children: _jsx(S.OptionsList, { "$isOpen": isOpen, children: options.map((option, idx) => (_jsx(S.OptionItem, { "$isSelected": selected?.value === option.value, "$size": dropdownSize, onClick: (e) => {
|
|
12
12
|
e.stopPropagation();
|
|
13
13
|
onSelect(option);
|
|
14
14
|
closeDropdown();
|
|
@@ -18,7 +18,6 @@ export declare const OptionsList: import("@emotion/styled").StyledComponent<{
|
|
|
18
18
|
theme?: import("@emotion/react").Theme;
|
|
19
19
|
as?: React.ElementType;
|
|
20
20
|
} & {
|
|
21
|
-
$size: DropdownSize;
|
|
22
21
|
$isOpen: boolean;
|
|
23
22
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, {}>;
|
|
24
23
|
export declare const OptionItem: import("@emotion/styled").StyledComponent<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../../src/Dropdown/ui/style.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAK9C,eAAO,MAAM,SAAS;;;;WAAuB,YAAY;YAAU,MAAM;
|
|
1
|
+
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../../src/Dropdown/ui/style.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAK9C,eAAO,MAAM,SAAS;;;;WAAuB,YAAY;YAAU,MAAM;yGAWxE,CAAC;AAEF,eAAO,MAAM,YAAY;;;yGAQxB,CAAC;AAEF,eAAO,MAAM,YAAY;;;2GAIxB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;aAAwB,OAAO;6GAUtD,CAAC;AAEF,eAAO,MAAM,UAAU;;;;WACd,YAAY;iBACN,OAAO;yGAerB,CAAC"}
|
|
@@ -7,6 +7,8 @@ export const Container = styled.div `
|
|
|
7
7
|
border-radius: ${shapes.large};
|
|
8
8
|
padding: 0 20px;
|
|
9
9
|
${({ $size }) => getStyle($size)};
|
|
10
|
+
box-shadow: 0 2px 4px 0px rgba(0, 0, 0, 0.05);
|
|
11
|
+
background-color: ${colors.static.white};
|
|
10
12
|
min-width: ${({ $width }) => $width};
|
|
11
13
|
cursor: pointer;
|
|
12
14
|
position: relative;
|
|
@@ -33,13 +35,7 @@ export const OptionsList = styled.ul `
|
|
|
33
35
|
overflow-y: scroll;
|
|
34
36
|
background-color: ${colors.static.white};
|
|
35
37
|
border-radius: ${shapes.large};
|
|
36
|
-
|
|
37
|
-
? `
|
|
38
|
-
border: 1px solid ${colors.greyScale[20]};
|
|
39
|
-
`
|
|
40
|
-
: `
|
|
41
|
-
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.05);
|
|
42
|
-
`};
|
|
38
|
+
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.05);
|
|
43
39
|
position: static;
|
|
44
40
|
box-sizing: border-box;
|
|
45
41
|
z-index: ${({ $isOpen }) => ($isOpen ? 100 : -1)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-style.d.ts","sourceRoot":"","sources":["../../../src/Dropdown/utils/get-style.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"get-style.d.ts","sourceRoot":"","sources":["../../../src/Dropdown/utils/get-style.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAoB9C,eAAO,MAAM,QAAQ,GAAI,MAAM,YAAY,8CAE1C,CAAA"}
|
|
@@ -1,22 +1,15 @@
|
|
|
1
1
|
import { css } from "@emotion/react";
|
|
2
|
-
import { colors } from "@bds-web/colors";
|
|
3
2
|
import { typoCss } from "@bds-web/typography";
|
|
4
3
|
const map = {
|
|
5
4
|
small: css `
|
|
6
|
-
border: 1px solid ${colors.greyScale[20]};
|
|
7
|
-
background-color: ${colors.static.white};
|
|
8
5
|
height: 28px;
|
|
9
6
|
${typoCss("Body")};
|
|
10
7
|
`,
|
|
11
8
|
medium: css `
|
|
12
|
-
box-shadow: 0 2px 4px 0px rgba(0, 0, 0, 0.05);
|
|
13
|
-
background-color: ${colors.static.white};
|
|
14
9
|
height: 36px;
|
|
15
10
|
${typoCss("Body")};
|
|
16
11
|
`,
|
|
17
12
|
large: css `
|
|
18
|
-
box-shadow: 0 2px 4px 0px rgba(0, 0, 0, 0.05);
|
|
19
|
-
background-color: ${colors.static.white};
|
|
20
13
|
height: 48px;
|
|
21
14
|
${typoCss("H4")};
|
|
22
15
|
`
|