pds-dev-kit-web 2.0.14-alpha.0 → 2.1.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/index.d.ts +4 -4
- package/dist/index.js +9 -3
- package/dist/src/common/assets/icons/line/DottedCircle.d.ts +4 -0
- package/dist/src/common/assets/icons/line/DottedCircle.js +30 -0
- package/dist/src/common/assets/icons/line/index.d.ts +1 -0
- package/dist/src/common/assets/icons/line/index.js +2 -0
- package/dist/src/common/styles/colorSet/PaletteColor_Dark.json +14 -2
- package/dist/src/common/styles/colorSet/PaletteColor_light.json +13 -1
- package/dist/src/common/styles/colorSet/UIColor.json +26 -1
- package/dist/src/common/styles/colorSet/index.d.ts +51 -2
- package/dist/src/common/styles/colorSet/index.js +2 -2
- package/dist/src/common/styles/colorSet/ui-type.d.ts +25 -0
- package/dist/src/common/types/components.d.ts +15 -0
- package/dist/src/desktop/common/components/TextFieldBase/TextFieldBase.d.ts +4 -1
- package/dist/src/desktop/common/components/TextFieldBase/TextFieldBase.js +36 -11
- package/dist/src/desktop/common/components/TextFieldBase/constants.d.ts +1 -0
- package/dist/src/desktop/common/components/TextFieldBase/constants.js +4 -0
- package/dist/src/desktop/components/BasicButtonGroup/BasicButtonGroup.d.ts +9 -0
- package/dist/src/desktop/components/BasicButtonGroup/BasicButtonGroup.js +73 -0
- package/dist/src/desktop/components/BasicButtonGroup/index.d.ts +1 -0
- package/dist/src/desktop/components/BasicButtonGroup/index.js +8 -0
- package/dist/src/desktop/components/ContextMenuItem/ContextMenuItem.d.ts +5 -3
- package/dist/src/desktop/components/ContextMenuItem/ContextMenuItem.js +15 -3
- package/dist/src/desktop/components/Dropdown/Dropdown.d.ts +9 -10
- package/dist/src/desktop/components/Dropdown/Dropdown.js +71 -26
- package/dist/src/desktop/components/IconButton/IconButton.d.ts +4 -2
- package/dist/src/desktop/components/IconButton/IconButton.js +52 -4
- package/dist/src/desktop/components/IconButton/constants.d.ts +15 -0
- package/dist/src/desktop/components/IconButton/constants.js +19 -0
- package/dist/src/desktop/components/SegmentedButtonGroup/SegmentedButtonGroup.d.ts +18 -0
- package/dist/src/desktop/components/SegmentedButtonGroup/SegmentedButtonGroup.js +143 -0
- package/dist/src/desktop/components/SegmentedButtonGroup/index.d.ts +1 -0
- package/dist/src/desktop/components/SegmentedButtonGroup/index.js +8 -0
- package/dist/src/desktop/components/Slider/Slider.d.ts +19 -0
- package/dist/src/desktop/components/Slider/Slider.js +200 -0
- package/dist/src/desktop/components/Slider/index.d.ts +1 -0
- package/dist/src/desktop/components/Slider/index.js +8 -0
- package/dist/src/desktop/components/TextField/TextField.d.ts +3 -1
- package/dist/src/desktop/components/TextField/TextField.js +5 -5
- package/dist/src/desktop/components/index.d.ts +4 -1
- package/dist/src/desktop/components/index.js +7 -1
- package/dist/src/desktop/index.d.ts +1 -1
- package/dist/src/desktop/index.js +5 -2
- package/dist/src/desktop/layout/LayoutWS/Containers/ContentsContainer/ContentsContainer.d.ts +1 -1
- package/dist/src/desktop/layout/LayoutWS/Containers/ContentsContainer/ContentsContainer.js +2 -1
- package/dist/src/desktop/layout/LayoutWS/Containers/ContentsContainer/variation/WSG.js +57 -32
- package/dist/src/desktop/layout/LayoutWS/Containers/ContentsContainer/variation/WSI.d.ts +15 -0
- package/dist/src/desktop/layout/LayoutWS/Containers/ContentsContainer/variation/WSI.js +117 -0
- package/dist/src/desktop/layout/LayoutWS/Containers/ContentsContainer/variation/index.d.ts +1 -0
- package/dist/src/desktop/layout/LayoutWS/Containers/ContentsContainer/variation/index.js +3 -1
- package/dist/src/desktop/layout/LayoutWS/ContainersBox/ContainersBox.d.ts +1 -1
- package/dist/src/mobile/common/components/TextFieldBase/TextFieldBase.d.ts +4 -1
- package/dist/src/mobile/common/components/TextFieldBase/TextFieldBase.js +35 -10
- package/dist/src/mobile/common/components/TextFieldBase/constants.d.ts +1 -0
- package/dist/src/mobile/common/components/TextFieldBase/constants.js +4 -0
- package/dist/src/mobile/components/BasicButtonGroup/BasicButtonGroup.d.ts +9 -0
- package/dist/src/mobile/components/BasicButtonGroup/BasicButtonGroup.js +73 -0
- package/dist/src/mobile/components/BasicButtonGroup/index.d.ts +1 -0
- package/dist/src/mobile/components/BasicButtonGroup/index.js +8 -0
- package/dist/src/mobile/components/ContextMenu/ContextMenu.js +1 -1
- package/dist/src/mobile/components/ContextMenuItem/ContextMenuItem.d.ts +5 -3
- package/dist/src/mobile/components/ContextMenuItem/ContextMenuItem.js +15 -3
- package/dist/src/mobile/components/Dropdown/Dropdown.d.ts +9 -10
- package/dist/src/mobile/components/Dropdown/Dropdown.js +70 -25
- package/dist/src/mobile/components/SegmentedButtonGroup/SegmentedButtonGroup.d.ts +18 -0
- package/dist/src/mobile/components/SegmentedButtonGroup/SegmentedButtonGroup.js +143 -0
- package/dist/src/mobile/components/SegmentedButtonGroup/index.d.ts +1 -0
- package/dist/src/mobile/components/SegmentedButtonGroup/index.js +8 -0
- package/dist/src/mobile/components/Slider/Slider.d.ts +19 -0
- package/dist/src/mobile/components/Slider/Slider.js +197 -0
- package/dist/src/mobile/components/Slider/index.d.ts +1 -0
- package/dist/src/mobile/components/Slider/index.js +8 -0
- package/dist/src/mobile/components/TextField/TextField.d.ts +3 -1
- package/dist/src/mobile/components/TextField/TextField.js +5 -5
- package/dist/src/mobile/components/index.d.ts +4 -1
- package/dist/src/mobile/components/index.js +7 -1
- package/dist/src/mobile/index.d.ts +1 -1
- package/dist/src/mobile/index.js +5 -1
- package/dist/src/sub/DynamicLayout/mock_storybook.js +20 -112
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/NormalType/templates/TemplateA/mobile/components/SectionContents.js +1 -1
- package/dist/src/sub/DynamicLayout/sections/MembershipSection/NormalType/templates/TemplateB/mobile/components/SectionContents.js +1 -1
- package/package.json +1 -1
- package/release-note.md +8 -7
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { PDSTextType, PDSValueOption } from '../../../common';
|
|
3
|
+
import type { DropdownValueOption } from '../../../common/types';
|
|
3
4
|
export declare type ContextMenuItemProps = {
|
|
4
|
-
option?: PDSValueOption;
|
|
5
|
+
option?: PDSValueOption | DropdownValueOption;
|
|
5
6
|
size?: 'large' | 'medium' | 'small';
|
|
6
7
|
isSelected?: boolean;
|
|
7
8
|
state?: 'normal' | 'disabled';
|
|
8
|
-
|
|
9
|
+
displayType?: 'text_only' | 'icon_only' | 'icon_text';
|
|
10
|
+
onClick?: (value: PDSValueOption | DropdownValueOption | string | number | boolean) => void;
|
|
9
11
|
/** @deprecated option 필드를 대신 사용하세요. */
|
|
10
12
|
text?: PDSTextType;
|
|
11
13
|
/** @deprecated option 필드를 대신 사용하세요. */
|
|
12
14
|
value?: string | number | boolean;
|
|
13
15
|
};
|
|
14
|
-
declare function ContextMenuItem({ option, size, isSelected, state, onClick, text, value }: ContextMenuItemProps): JSX.Element;
|
|
16
|
+
declare function ContextMenuItem({ option, size, isSelected, state, displayType, onClick, text, value }: ContextMenuItemProps): JSX.Element;
|
|
15
17
|
export default ContextMenuItem;
|
|
@@ -35,10 +35,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
35
35
|
};
|
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
37
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
var components_1 = require("../../../hybrid/components");
|
|
38
39
|
var styled_components_1 = __importStar(require("styled-components"));
|
|
39
40
|
var TextLabel_1 = require("../TextLabel");
|
|
40
41
|
function ContextMenuItem(_a) {
|
|
41
|
-
var option = _a.option, _b = _a.size, size = _b === void 0 ? 'small' : _b, _c = _a.isSelected, isSelected = _c === void 0 ? false : _c, _d = _a.state, state = _d === void 0 ? 'normal' : _d, onClick = _a.onClick, text = _a.text, value = _a.value;
|
|
42
|
+
var option = _a.option, _b = _a.size, size = _b === void 0 ? 'small' : _b, _c = _a.isSelected, isSelected = _c === void 0 ? false : _c, _d = _a.state, state = _d === void 0 ? 'normal' : _d, displayType = _a.displayType, onClick = _a.onClick, text = _a.text, value = _a.value;
|
|
42
43
|
var handleClick = function () {
|
|
43
44
|
if (state === 'disabled') {
|
|
44
45
|
return;
|
|
@@ -60,7 +61,15 @@ function ContextMenuItem(_a) {
|
|
|
60
61
|
if (state === 'disabled') {
|
|
61
62
|
textColorTheme = 'sysTextTertiary';
|
|
62
63
|
}
|
|
63
|
-
|
|
64
|
+
var getIconColorKey = function () {
|
|
65
|
+
if (state === 'disabled') {
|
|
66
|
+
return 'ui_cpnt_dropdown_display_icon_disabled';
|
|
67
|
+
}
|
|
68
|
+
return 'ui_cpnt_dropdown_display_icon_normal';
|
|
69
|
+
};
|
|
70
|
+
return ((0, jsx_runtime_1.jsxs)(S_ContextMenuItem, __assign({ "x-pds-name": "ContextMenuItem", "x-pds-element-type": "component", "x-pds-device-type": "mobile", size: size, onClick: handleClick, selected: isSelected, displayType: displayType }, { children: [(displayType === 'icon_only' || displayType === 'icon_text') &&
|
|
71
|
+
option &&
|
|
72
|
+
'iconName' in option && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(components_1.Icon, { size: size === 'small' ? 20 : 24, iconName: option.iconName, fillType: option.iconFillType, colorKey: getIconColorKey() }, void 0) }, void 0)), (displayType === 'text_only' || displayType === 'icon_text') && (option === null || option === void 0 ? void 0 : option.text) && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Spacing, { size: "spacing_b", spacingType: "width" }, void 0), (0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: option.text || text, styleTheme: "form2Regular", singleLineMode: "use", colorTheme: textColorTheme, ellipsisMode: "use", lineLimit: 1, wordBreak: "break_all" }, void 0)] }, void 0))] }), void 0));
|
|
64
73
|
}
|
|
65
74
|
var large = (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 48px;\n padding: 0 ", ";\n\n & > div {\n height: 48px;\n line-height: 48px;\n }\n"], ["\n height: 48px;\n padding: 0 ", ";\n\n & > div {\n height: 48px;\n line-height: 48px;\n }\n"])), function (_a) {
|
|
66
75
|
var theme = _a.theme;
|
|
@@ -74,11 +83,14 @@ var small = (0, styled_components_1.css)(templateObject_3 || (templateObject_3 =
|
|
|
74
83
|
var theme = _a.theme;
|
|
75
84
|
return theme.spacing.spacingD;
|
|
76
85
|
});
|
|
77
|
-
var S_ContextMenuItem = styled_components_1.default.li(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n align-items: center;\n background-color: ", ";\n box-sizing: border-box;\n display: flex;\n\n ", ";\n"], ["\n align-items: center;\n background-color: ", ";\n box-sizing: border-box;\n display: flex;\n\n ", ";\n"])), function (_a) {
|
|
86
|
+
var S_ContextMenuItem = styled_components_1.default.li(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n align-items: center;\n background-color: ", ";\n box-sizing: border-box;\n display: flex;\n\n ", ";\n ", ";\n"], ["\n align-items: center;\n background-color: ", ";\n box-sizing: border-box;\n display: flex;\n\n ", ";\n ", ";\n"])), function (_a) {
|
|
78
87
|
var theme = _a.theme, selected = _a.selected;
|
|
79
88
|
return selected
|
|
80
89
|
? theme.ui_cpnt_contextmenu_menu_base_selected
|
|
81
90
|
: theme.ui_cpnt_contextmenu_menu_base_normal;
|
|
91
|
+
}, function (_a) {
|
|
92
|
+
var displayType = _a.displayType;
|
|
93
|
+
return displayType === 'icon_only' && 'justify-content: center';
|
|
82
94
|
}, function (_a) {
|
|
83
95
|
var size = _a.size;
|
|
84
96
|
return size && { large: large, medium: medium, small: small }[size];
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { PDSTextType
|
|
3
|
-
|
|
4
|
-
state?: 'normal' | 'disabled';
|
|
5
|
-
};
|
|
2
|
+
import type { PDSTextType } from '../../../common';
|
|
3
|
+
import type { DropdownValueOption } from '../../../common/types';
|
|
6
4
|
declare type Props = {
|
|
7
5
|
colorTheme?: 'none' | 'dark' | 'white';
|
|
8
|
-
defaultValue?:
|
|
9
|
-
value?:
|
|
6
|
+
defaultValue?: DropdownValueOption;
|
|
7
|
+
value?: DropdownValueOption | null;
|
|
10
8
|
hintText?: PDSTextType;
|
|
11
9
|
maxHeightItemNumber?: number;
|
|
12
10
|
responsiveMode?: 'none' | 'use';
|
|
13
|
-
size?: 'large' | 'small';
|
|
11
|
+
size?: 'large' | 'medium' | 'small';
|
|
14
12
|
state?: 'normal' | 'read_only' | 'disabled';
|
|
15
|
-
valueArray:
|
|
13
|
+
valueArray: DropdownValueOption[];
|
|
16
14
|
customWidth?: string;
|
|
17
|
-
|
|
15
|
+
displayType?: 'text_only' | 'icon_only' | 'icon_text';
|
|
16
|
+
onChange?: (option: DropdownValueOption) => void;
|
|
18
17
|
};
|
|
19
|
-
declare function Dropdown({ colorTheme, value, defaultValue, hintText, maxHeightItemNumber, responsiveMode, size, state, valueArray, customWidth, onChange }: Props): JSX.Element;
|
|
18
|
+
declare function Dropdown({ colorTheme, value, defaultValue, hintText, maxHeightItemNumber, responsiveMode, size, state, valueArray, customWidth, displayType, onChange }: Props): JSX.Element;
|
|
20
19
|
export default Dropdown;
|
|
@@ -48,9 +48,9 @@ function Dropdown(_a) {
|
|
|
48
48
|
// selectionMode = 'single',
|
|
49
49
|
_e = _a.size,
|
|
50
50
|
// selectionMode = 'single',
|
|
51
|
-
size = _e === void 0 ? 'large' : _e, _f = _a.state, state = _f === void 0 ? 'normal' : _f, valueArray = _a.valueArray, customWidth = _a.customWidth, onChange = _a.onChange;
|
|
52
|
-
var
|
|
53
|
-
var
|
|
51
|
+
size = _e === void 0 ? 'large' : _e, _f = _a.state, state = _f === void 0 ? 'normal' : _f, valueArray = _a.valueArray, customWidth = _a.customWidth, _g = _a.displayType, displayType = _g === void 0 ? 'text_only' : _g, onChange = _a.onChange;
|
|
52
|
+
var _h = (0, react_1.useState)(false), isFocused = _h[0], setIsFocused = _h[1];
|
|
53
|
+
var _j = (0, react_1.useState)(null), selectedValue = _j[0], setSelectedValue = _j[1];
|
|
54
54
|
/**
|
|
55
55
|
* @when value 프롭의 값에 따라
|
|
56
56
|
* @expected 값이 null일 때 드롭다운을 초기화하고, 값이 있다면 해당 값으로 설정해줍니다.
|
|
@@ -96,7 +96,21 @@ function Dropdown(_a) {
|
|
|
96
96
|
onChange(option);
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
|
+
var getCustomWidth = function () {
|
|
100
|
+
if (customWidth) {
|
|
101
|
+
return customWidth;
|
|
102
|
+
}
|
|
103
|
+
if (displayType === 'icon_only') {
|
|
104
|
+
return 'auto';
|
|
105
|
+
}
|
|
106
|
+
};
|
|
99
107
|
var getIconColorKey = function () {
|
|
108
|
+
if (state === 'disabled' || state === 'read_only') {
|
|
109
|
+
return 'ui_cpnt_dropdown_display_icon_disabled';
|
|
110
|
+
}
|
|
111
|
+
return 'ui_cpnt_dropdown_display_icon_normal';
|
|
112
|
+
};
|
|
113
|
+
var getArrowIconColorKey = function () {
|
|
100
114
|
if (colorTheme === 'dark') {
|
|
101
115
|
if (state === 'disabled' || state === 'read_only') {
|
|
102
116
|
return 'ui_cpnt_dropdown_text_darktheme_disabled';
|
|
@@ -176,12 +190,9 @@ function Dropdown(_a) {
|
|
|
176
190
|
var LARGE_HEIGHT = 48;
|
|
177
191
|
return LARGE_HEIGHT * maxHeightItemNumber;
|
|
178
192
|
}, [size, maxHeightItemNumber]);
|
|
179
|
-
return ((0, jsx_runtime_1.jsxs)(S_Dropdown, __assign({ "x-pds-name": "Dropdown", "x-pds-element-type": "component", "x-pds-device-type": "mobile", className: "container", size: size, tabIndex: 0, onBlur: handleBlur, responsiveMode: responsiveMode, customWidth: customWidth }, { children: [(0, jsx_runtime_1.jsxs)(S_Select, __assign({ size: size, onClick: handleClick, isFocused: isFocused, state: state, colorTheme: colorTheme, responsiveMode: responsiveMode, customWidth: customWidth }, { children: [(0, jsx_runtime_1.
|
|
193
|
+
return ((0, jsx_runtime_1.jsxs)(S_Dropdown, __assign({ "x-pds-name": "Dropdown", "x-pds-element-type": "component", "x-pds-device-type": "mobile", className: "container", size: size, tabIndex: 0, onBlur: handleBlur, responsiveMode: responsiveMode, customWidth: customWidth, displayType: displayType }, { children: [(0, jsx_runtime_1.jsxs)(S_Select, __assign({ size: size, onClick: handleClick, isFocused: isFocused, state: state, colorTheme: colorTheme, responsiveMode: responsiveMode, customWidth: customWidth, displayType: displayType }, { children: [(0, jsx_runtime_1.jsxs)(S_TextLabel, __assign({ size: size, responsiveMode: responsiveMode, displayType: displayType }, { children: [(displayType === 'icon_only' || displayType === 'icon_text') && (selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.iconName) && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(hybrid_1.Icon, { size: size === 'small' ? 20 : 24, iconName: selectedValue.iconName, fillType: selectedValue.iconFillType, colorKey: getIconColorKey() }, void 0) }, void 0)), (displayType === 'text_only' || displayType === 'icon_text') && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: "spacing_b", spacingType: "width" }, void 0), (0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: (selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.text) || (value === null || value === void 0 ? void 0 : value.text) || (defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.text) || hintText, styleTheme: "form2Regular", singleLineMode: "use", colorTheme: getTextColorTheme(), colorOverride: getTextColorOverride(), ellipsisMode: "use", lineLimit: 1, wordBreak: "break_all" }, void 0)] }, void 0))] }), void 0), (0, jsx_runtime_1.jsx)(hybrid_1.Icon, { size: 16, fillType: "line", iconName: isFocused ? 'ic_arrow_up' : 'ic_arrow_down', colorKey: getArrowIconColorKey() }, void 0)] }), void 0), isFocused && ((0, jsx_runtime_1.jsx)(S_ContextMenuWrapper, __assign({ displayType: displayType }, { children: (0, jsx_runtime_1.jsx)(ContextMenu_1.ContextMenu, __assign({ autoWidthMode: "use", maxHeight: maxHeight, customWidth: getCustomWidth() }, { children: valueArray.map(function (el) { return ((0, jsx_runtime_1.jsx)(react_1.Fragment, { children: (0, jsx_runtime_1.jsx)(ContextMenuItem_1.ContextMenuItem, { option: el, size: size, isSelected: (selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.value) === el.value, onClick: handleClickOption, state: el.state, displayType: displayType }, void 0) }, el.value)); }) }), void 0) }), void 0))] }), void 0));
|
|
180
194
|
}
|
|
181
|
-
var S_TextLabel = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n
|
|
182
|
-
var theme = _a.theme;
|
|
183
|
-
return theme.spacing.spacingD;
|
|
184
|
-
}, function (_a) {
|
|
195
|
+
var S_TextLabel = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-items: center;\n display: flex;\n padding-right: ", ";\n\n ", ";\n"], ["\n align-items: center;\n display: flex;\n padding-right: ", ";\n\n ", ";\n"])), function (_a) {
|
|
185
196
|
var theme = _a.theme;
|
|
186
197
|
return theme.spacing.spacingB;
|
|
187
198
|
}, function (_a) {
|
|
@@ -189,29 +200,53 @@ var S_TextLabel = styled_components_1.default.div(templateObject_1 || (templateO
|
|
|
189
200
|
return size &&
|
|
190
201
|
{
|
|
191
202
|
large: large,
|
|
203
|
+
medium: medium,
|
|
192
204
|
small: small
|
|
193
205
|
}[size];
|
|
194
206
|
});
|
|
195
207
|
var large = (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n height: 48px;\n width: ", ";\n\n & > div {\n height: 48px;\n line-height: 48px;\n }\n"], ["\n height: 48px;\n width: ", ";\n\n & > div {\n height: 48px;\n line-height: 48px;\n }\n"])), function (_a) {
|
|
196
|
-
var responsiveMode = _a.responsiveMode;
|
|
197
|
-
|
|
208
|
+
var displayType = _a.displayType, responsiveMode = _a.responsiveMode;
|
|
209
|
+
if (responsiveMode === 'use') {
|
|
210
|
+
return '100%';
|
|
211
|
+
}
|
|
212
|
+
if (displayType === 'icon_only') {
|
|
213
|
+
return 'fit-content';
|
|
214
|
+
}
|
|
215
|
+
return '432px';
|
|
198
216
|
});
|
|
199
|
-
var
|
|
200
|
-
var responsiveMode = _a.responsiveMode;
|
|
201
|
-
|
|
217
|
+
var medium = (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n border-radius: 12px;\n height: 40px;\n width: ", ";\n\n & > div {\n height: 40px;\n line-height: 40px;\n }\n"], ["\n border-radius: 12px;\n height: 40px;\n width: ", ";\n\n & > div {\n height: 40px;\n line-height: 40px;\n }\n"])), function (_a) {
|
|
218
|
+
var displayType = _a.displayType, responsiveMode = _a.responsiveMode;
|
|
219
|
+
if (responsiveMode === 'use') {
|
|
220
|
+
return '100%';
|
|
221
|
+
}
|
|
222
|
+
if (displayType === 'icon_only') {
|
|
223
|
+
return 'fit-content';
|
|
224
|
+
}
|
|
225
|
+
return '188px';
|
|
202
226
|
});
|
|
203
|
-
var
|
|
227
|
+
var small = (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n border-radius: 10px;\n height: 32px;\n width: ", ";\n\n & > div {\n height: 32px;\n line-height: 32px;\n }\n"], ["\n border-radius: 10px;\n height: 32px;\n width: ", ";\n\n & > div {\n height: 32px;\n line-height: 32px;\n }\n"])), function (_a) {
|
|
228
|
+
var displayType = _a.displayType, responsiveMode = _a.responsiveMode;
|
|
229
|
+
if (responsiveMode === 'use') {
|
|
230
|
+
return '100%';
|
|
231
|
+
}
|
|
232
|
+
if (displayType === 'icon_only') {
|
|
233
|
+
return 'fit-content';
|
|
234
|
+
}
|
|
235
|
+
return '188px';
|
|
236
|
+
});
|
|
237
|
+
var S_Dropdown = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: inline-block;\n outline: none;\n position: relative;\n\n ", ";\n\n ", "\n"], ["\n display: inline-block;\n outline: none;\n position: relative;\n\n ", ";\n\n ", "\n"])), function (_a) {
|
|
204
238
|
var size = _a.size;
|
|
205
239
|
return size &&
|
|
206
240
|
{
|
|
207
241
|
large: large,
|
|
242
|
+
medium: medium,
|
|
208
243
|
small: small
|
|
209
244
|
}[size];
|
|
210
245
|
}, function (_a) {
|
|
211
246
|
var customWidth = _a.customWidth;
|
|
212
247
|
return customWidth && "width: " + customWidth + ";";
|
|
213
248
|
});
|
|
214
|
-
var colorThemeBackgroundReadOnly = (0, styled_components_1.css)(
|
|
249
|
+
var colorThemeBackgroundReadOnly = (0, styled_components_1.css)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), function (_a) {
|
|
215
250
|
var colorTheme = _a.colorTheme, theme = _a.theme;
|
|
216
251
|
switch (colorTheme) {
|
|
217
252
|
case 'dark':
|
|
@@ -222,7 +257,7 @@ var colorThemeBackgroundReadOnly = (0, styled_components_1.css)(templateObject_5
|
|
|
222
257
|
return theme.ui_cpnt_dropdown_base_disabled;
|
|
223
258
|
}
|
|
224
259
|
});
|
|
225
|
-
var colorThemeBackgroundDisabled = (0, styled_components_1.css)(
|
|
260
|
+
var colorThemeBackgroundDisabled = (0, styled_components_1.css)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), function (_a) {
|
|
226
261
|
var colorTheme = _a.colorTheme, theme = _a.theme;
|
|
227
262
|
switch (colorTheme) {
|
|
228
263
|
case 'dark':
|
|
@@ -233,7 +268,7 @@ var colorThemeBackgroundDisabled = (0, styled_components_1.css)(templateObject_6
|
|
|
233
268
|
return theme.ui_cpnt_dropdown_base_disabled;
|
|
234
269
|
}
|
|
235
270
|
});
|
|
236
|
-
var colorThemeBackgroundNormal = (0, styled_components_1.css)(
|
|
271
|
+
var colorThemeBackgroundNormal = (0, styled_components_1.css)(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), function (_a) {
|
|
237
272
|
var colorTheme = _a.colorTheme, theme = _a.theme;
|
|
238
273
|
switch (colorTheme) {
|
|
239
274
|
case 'dark':
|
|
@@ -244,7 +279,7 @@ var colorThemeBackgroundNormal = (0, styled_components_1.css)(templateObject_7 |
|
|
|
244
279
|
return theme.ui_cpnt_dropdown_base_normal;
|
|
245
280
|
}
|
|
246
281
|
});
|
|
247
|
-
var colorThemeBorderWhite = (0, styled_components_1.css)(
|
|
282
|
+
var colorThemeBorderWhite = (0, styled_components_1.css)(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), function (_a) {
|
|
248
283
|
var state = _a.state, theme = _a.theme;
|
|
249
284
|
switch (state) {
|
|
250
285
|
case 'disabled':
|
|
@@ -254,7 +289,7 @@ var colorThemeBorderWhite = (0, styled_components_1.css)(templateObject_8 || (te
|
|
|
254
289
|
return theme.ui_cpnt_dropdown_border_white_normal;
|
|
255
290
|
}
|
|
256
291
|
});
|
|
257
|
-
var colorThemeBorderDark = (0, styled_components_1.css)(
|
|
292
|
+
var colorThemeBorderDark = (0, styled_components_1.css)(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), function (_a) {
|
|
258
293
|
var state = _a.state, theme = _a.theme;
|
|
259
294
|
switch (state) {
|
|
260
295
|
case 'disabled':
|
|
@@ -264,7 +299,7 @@ var colorThemeBorderDark = (0, styled_components_1.css)(templateObject_9 || (tem
|
|
|
264
299
|
return theme.ui_cpnt_dropdown_border_darktheme_normal;
|
|
265
300
|
}
|
|
266
301
|
});
|
|
267
|
-
var borderColor = (0, styled_components_1.css)(
|
|
302
|
+
var borderColor = (0, styled_components_1.css)(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), function (_a) {
|
|
268
303
|
var state = _a.state, theme = _a.theme;
|
|
269
304
|
switch (state) {
|
|
270
305
|
case 'disabled':
|
|
@@ -275,7 +310,7 @@ var borderColor = (0, styled_components_1.css)(templateObject_10 || (templateObj
|
|
|
275
310
|
return theme.ui_cpnt_dropdown_border_normal;
|
|
276
311
|
}
|
|
277
312
|
});
|
|
278
|
-
var backgroundActiveColor = (0, styled_components_1.css)(
|
|
313
|
+
var backgroundActiveColor = (0, styled_components_1.css)(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), function (_a) {
|
|
279
314
|
var colorTheme = _a.colorTheme, theme = _a.theme;
|
|
280
315
|
switch (colorTheme) {
|
|
281
316
|
case 'none':
|
|
@@ -288,8 +323,8 @@ var backgroundActiveColor = (0, styled_components_1.css)(templateObject_11 || (t
|
|
|
288
323
|
return theme.ui_cpnt_textfield_base_pressed;
|
|
289
324
|
}
|
|
290
325
|
});
|
|
291
|
-
var normalActionColor = (0, styled_components_1.css)(
|
|
292
|
-
var S_Select = styled_components_1.default.div(
|
|
326
|
+
var normalActionColor = (0, styled_components_1.css)(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n &:active {\n background-color: ", ";\n }\n"], ["\n &:active {\n background-color: ", ";\n }\n"])), backgroundActiveColor);
|
|
327
|
+
var S_Select = styled_components_1.default.div(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n align-items: center;\n background-color: ", ";\n border: 2px solid\n ", ";\n border-radius: 14px;\n box-sizing: border-box;\n display: flex;\n justify-content: space-between;\n padding-left: ", ";\n padding-right: ", ";\n\n ", ";\n\n ", "\n\n ", "\n\n ", "\n"], ["\n align-items: center;\n background-color: ", ";\n border: 2px solid\n ", ";\n border-radius: 14px;\n box-sizing: border-box;\n display: flex;\n justify-content: space-between;\n padding-left: ", ";\n padding-right: ", ";\n\n ", ";\n\n ", "\n\n ", "\n\n ", "\n"])), function (_a) {
|
|
293
328
|
var state = _a.state;
|
|
294
329
|
switch (state) {
|
|
295
330
|
case 'disabled':
|
|
@@ -309,11 +344,18 @@ var S_Select = styled_components_1.default.div(templateObject_13 || (templateObj
|
|
|
309
344
|
case 'white':
|
|
310
345
|
return isFocused ? theme.ui_cpnt_dropdown_border_white_focus : colorThemeBorderWhite;
|
|
311
346
|
}
|
|
347
|
+
}, function (_a) {
|
|
348
|
+
var size = _a.size, theme = _a.theme;
|
|
349
|
+
return size === 'large' ? theme.spacing.spacingD : theme.spacing.spacingC;
|
|
350
|
+
}, function (_a) {
|
|
351
|
+
var size = _a.size, theme = _a.theme;
|
|
352
|
+
return size === 'large' ? theme.spacing.spacingD : theme.spacing.spacingC;
|
|
312
353
|
}, function (_a) {
|
|
313
354
|
var size = _a.size;
|
|
314
355
|
return size &&
|
|
315
356
|
{
|
|
316
357
|
large: large,
|
|
358
|
+
medium: medium,
|
|
317
359
|
small: small
|
|
318
360
|
}[size];
|
|
319
361
|
}, function (_a) {
|
|
@@ -323,9 +365,12 @@ var S_Select = styled_components_1.default.div(templateObject_13 || (templateObj
|
|
|
323
365
|
var state = _a.state;
|
|
324
366
|
return state === 'normal' && normalActionColor;
|
|
325
367
|
});
|
|
326
|
-
var S_ContextMenuWrapper = styled_components_1.default.div(
|
|
368
|
+
var S_ContextMenuWrapper = styled_components_1.default.div(templateObject_15 || (templateObject_15 = __makeTemplateObject(["\n display: block;\n margin-top: ", ";\n position: absolute;\n width: inherit;\n width: ", ";\n"], ["\n display: block;\n margin-top: ", ";\n position: absolute;\n width: inherit;\n width: ", ";\n"])), function (_a) {
|
|
327
369
|
var theme = _a.theme;
|
|
328
370
|
return theme.spacing.spacingB;
|
|
371
|
+
}, function (_a) {
|
|
372
|
+
var displayType = _a.displayType;
|
|
373
|
+
return (displayType === 'icon_only' ? '100%' : 'inherit');
|
|
329
374
|
});
|
|
330
375
|
exports.default = Dropdown;
|
|
331
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14;
|
|
376
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { FillIconNameKeys, LineIconNameKeys, PDSValueOption } from '../../../common/types';
|
|
3
|
+
declare type SegmentedButtonGroupValueOption = Pick<PDSValueOption, 'value'> & {
|
|
4
|
+
iconName: FillIconNameKeys | LineIconNameKeys;
|
|
5
|
+
iconFillType?: 'fill' | 'line';
|
|
6
|
+
state?: 'normal' | 'disabled';
|
|
7
|
+
};
|
|
8
|
+
export declare type SegmentedButtonGroupProps = {
|
|
9
|
+
size?: 'large' | 'medium' | 'small';
|
|
10
|
+
value: PDSValueOption['value'] | PDSValueOption['value'][];
|
|
11
|
+
valueArray: SegmentedButtonGroupValueOption[];
|
|
12
|
+
selectedType?: 'single' | 'multi';
|
|
13
|
+
state?: 'normal' | 'disabled';
|
|
14
|
+
onClick?: (value: PDSValueOption['value']) => void;
|
|
15
|
+
onMouseDown?: (value: PDSValueOption['value']) => void;
|
|
16
|
+
};
|
|
17
|
+
declare function SegmentedButtonGroup({ size, value, valueArray, selectedType, state, onClick, onMouseDown }: SegmentedButtonGroupProps): JSX.Element;
|
|
18
|
+
export default SegmentedButtonGroup;
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
var __assign = (this && this.__assign) || function () {
|
|
7
|
+
__assign = Object.assign || function(t) {
|
|
8
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
+
s = arguments[i];
|
|
10
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
+
t[p] = s[p];
|
|
12
|
+
}
|
|
13
|
+
return t;
|
|
14
|
+
};
|
|
15
|
+
return __assign.apply(this, arguments);
|
|
16
|
+
};
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
var components_1 = require("../../../hybrid/components");
|
|
39
|
+
var styled_components_1 = __importStar(require("styled-components"));
|
|
40
|
+
function SegmentedButtonGroup(_a) {
|
|
41
|
+
var _b = _a.size, size = _b === void 0 ? 'medium' : _b, value = _a.value, valueArray = _a.valueArray, _c = _a.selectedType, selectedType = _c === void 0 ? 'single' : _c, _d = _a.state, state = _d === void 0 ? 'normal' : _d, onClick = _a.onClick, onMouseDown = _a.onMouseDown;
|
|
42
|
+
var handleClick = function (value) {
|
|
43
|
+
if (onClick) {
|
|
44
|
+
onClick(value);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
var handleMouseDown = function (value) {
|
|
48
|
+
if (onMouseDown) {
|
|
49
|
+
onMouseDown(value);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
var checkSelection = function (currentButtonValue) {
|
|
53
|
+
if (selectedType === 'multi' && Array.isArray(value)) {
|
|
54
|
+
return value.includes(currentButtonValue);
|
|
55
|
+
}
|
|
56
|
+
return value === currentButtonValue;
|
|
57
|
+
};
|
|
58
|
+
var getIconColorKey = function (isSelected, isDisabled) {
|
|
59
|
+
if (isDisabled) {
|
|
60
|
+
return 'ui_cpnt_button_icon_disabled';
|
|
61
|
+
}
|
|
62
|
+
if (isSelected) {
|
|
63
|
+
return 'ui_cpnt_button_icon_white';
|
|
64
|
+
}
|
|
65
|
+
return 'ui_cpnt_button_icon_enabled';
|
|
66
|
+
};
|
|
67
|
+
return ((0, jsx_runtime_1.jsx)(S_SegmentedButtonGroupGroups, __assign({ "x-pds-name": "SegmentedButtonGroup", "x-pds-element-type": "component", "x-pds-device-type": "mobile", selectedType: selectedType }, { children: valueArray.map(function (_a) {
|
|
68
|
+
var currentButtonValue = _a.value, iconName = _a.iconName, _b = _a.iconFillType, iconFillType = _b === void 0 ? 'line' : _b, _c = _a.state, buttonState = _c === void 0 ? 'normal' : _c;
|
|
69
|
+
return ((0, jsx_runtime_1.jsx)(S_BasicButton, __assign({ size: size, onClick: function () { return handleClick(currentButtonValue); }, onMouseDown: function () { return handleMouseDown(currentButtonValue); }, disabled: state === 'disabled' || buttonState === 'disabled', selectedType: selectedType, isSelected: checkSelection(currentButtonValue) }, { children: (0, jsx_runtime_1.jsx)(components_1.Icon, { iconName: iconName, size: size === 'small' ? 20 : 24, iconFillType: iconFillType, colorKey: getIconColorKey(checkSelection(currentButtonValue), state === 'disabled' || buttonState === 'disabled') }, void 0) }), String(currentButtonValue)));
|
|
70
|
+
}) }), void 0));
|
|
71
|
+
}
|
|
72
|
+
var S_SegmentedButtonGroupGroups = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: max-content;\n\n & > button:not(:last-child) {\n margin-right: ", ";\n }\n"], ["\n width: max-content;\n\n & > button:not(:last-child) {\n margin-right: ", ";\n }\n"])), function (_a) {
|
|
73
|
+
var selectedType = _a.selectedType, theme = _a.theme;
|
|
74
|
+
return selectedType === 'single' && theme.spacing.spacingA;
|
|
75
|
+
});
|
|
76
|
+
var large = (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n border-radius: ", ";\n height: 48px;\n width: 48px;\n\n &:nth-child(1) {\n border-bottom-left-radius: ", ";\n border-top-left-radius: ", ";\n }\n\n &:nth-last-child(1) {\n border-bottom-right-radius: ", ";\n border-top-right-radius: ", ";\n }\n"], ["\n border-radius: ", ";\n height: 48px;\n width: 48px;\n\n &:nth-child(1) {\n border-bottom-left-radius: ", ";\n border-top-left-radius: ", ";\n }\n\n &:nth-last-child(1) {\n border-bottom-right-radius: ", ";\n border-top-right-radius: ", ";\n }\n"])), function (_a) {
|
|
77
|
+
var selectedType = _a.selectedType;
|
|
78
|
+
return selectedType === 'single' && '14px';
|
|
79
|
+
}, function (_a) {
|
|
80
|
+
var selectedType = _a.selectedType;
|
|
81
|
+
return selectedType === 'multi' && '14px';
|
|
82
|
+
}, function (_a) {
|
|
83
|
+
var selectedType = _a.selectedType;
|
|
84
|
+
return selectedType === 'multi' && '14px';
|
|
85
|
+
}, function (_a) {
|
|
86
|
+
var selectedType = _a.selectedType;
|
|
87
|
+
return selectedType === 'multi' && '14px';
|
|
88
|
+
}, function (_a) {
|
|
89
|
+
var selectedType = _a.selectedType;
|
|
90
|
+
return selectedType === 'multi' && '14px';
|
|
91
|
+
});
|
|
92
|
+
var medium = (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n border-radius: ", ";\n height: 40px;\n width: 40px;\n\n &:nth-child(1) {\n border-bottom-left-radius: ", ";\n border-top-left-radius: ", ";\n }\n\n &:nth-last-child(1) {\n border-bottom-right-radius: ", ";\n border-top-right-radius: ", ";\n }\n"], ["\n border-radius: ", ";\n height: 40px;\n width: 40px;\n\n &:nth-child(1) {\n border-bottom-left-radius: ", ";\n border-top-left-radius: ", ";\n }\n\n &:nth-last-child(1) {\n border-bottom-right-radius: ", ";\n border-top-right-radius: ", ";\n }\n"])), function (_a) {
|
|
93
|
+
var selectedType = _a.selectedType;
|
|
94
|
+
return selectedType === 'single' && '12px';
|
|
95
|
+
}, function (_a) {
|
|
96
|
+
var selectedType = _a.selectedType;
|
|
97
|
+
return selectedType === 'multi' && '12px';
|
|
98
|
+
}, function (_a) {
|
|
99
|
+
var selectedType = _a.selectedType;
|
|
100
|
+
return selectedType === 'multi' && '12px';
|
|
101
|
+
}, function (_a) {
|
|
102
|
+
var selectedType = _a.selectedType;
|
|
103
|
+
return selectedType === 'multi' && '12px';
|
|
104
|
+
}, function (_a) {
|
|
105
|
+
var selectedType = _a.selectedType;
|
|
106
|
+
return selectedType === 'multi' && '12px';
|
|
107
|
+
});
|
|
108
|
+
var small = (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n border-radius: ", ";\n height: 32px;\n width: 32px;\n\n &:nth-child(1) {\n border-bottom-left-radius: ", ";\n border-top-left-radius: ", ";\n }\n\n &:nth-last-child(1) {\n border-bottom-right-radius: ", ";\n border-top-right-radius: ", ";\n }\n"], ["\n border-radius: ", ";\n height: 32px;\n width: 32px;\n\n &:nth-child(1) {\n border-bottom-left-radius: ", ";\n border-top-left-radius: ", ";\n }\n\n &:nth-last-child(1) {\n border-bottom-right-radius: ", ";\n border-top-right-radius: ", ";\n }\n"])), function (_a) {
|
|
109
|
+
var selectedType = _a.selectedType;
|
|
110
|
+
return selectedType === 'single' && '10px';
|
|
111
|
+
}, function (_a) {
|
|
112
|
+
var selectedType = _a.selectedType;
|
|
113
|
+
return selectedType === 'multi' && '10px';
|
|
114
|
+
}, function (_a) {
|
|
115
|
+
var selectedType = _a.selectedType;
|
|
116
|
+
return selectedType === 'multi' && '10px';
|
|
117
|
+
}, function (_a) {
|
|
118
|
+
var selectedType = _a.selectedType;
|
|
119
|
+
return selectedType === 'multi' && '10px';
|
|
120
|
+
}, function (_a) {
|
|
121
|
+
var selectedType = _a.selectedType;
|
|
122
|
+
return selectedType === 'multi' && '10px';
|
|
123
|
+
});
|
|
124
|
+
var S_BasicButton = styled_components_1.default.button(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n align-items: center;\n background-color: ", ";\n border: none;\n display: inline-flex;\n justify-content: center;\n position: relative;\n\n ", ";\n\n &::before {\n background-color: transparent;\n border-radius: inherit;\n content: '';\n height: 100%;\n left: 0;\n position: absolute;\n top: 0;\n width: 100%;\n }\n\n &:hover:enabled:before {\n background-color: ", ";\n }\n\n &:active:enabled:before {\n background-color: ", ";\n }\n\n &:disabled {\n background-color: ", ";\n cursor: default;\n }\n"], ["\n align-items: center;\n background-color: ", ";\n border: none;\n display: inline-flex;\n justify-content: center;\n position: relative;\n\n ", ";\n\n &::before {\n background-color: transparent;\n border-radius: inherit;\n content: '';\n height: 100%;\n left: 0;\n position: absolute;\n top: 0;\n width: 100%;\n }\n\n &:hover:enabled:before {\n background-color: ", ";\n }\n\n &:active:enabled:before {\n background-color: ", ";\n }\n\n &:disabled {\n background-color: ", ";\n cursor: default;\n }\n"])), function (_a) {
|
|
125
|
+
var isSelected = _a.isSelected, theme = _a.theme;
|
|
126
|
+
return isSelected
|
|
127
|
+
? theme.ui_cpnt_segmentedbuttongroup_base_selected
|
|
128
|
+
: theme.ui_cpnt_segmentedbuttongroup_base_default;
|
|
129
|
+
}, function (_a) {
|
|
130
|
+
var size = _a.size;
|
|
131
|
+
return size && { large: large, medium: medium, small: small }[size];
|
|
132
|
+
}, function (_a) {
|
|
133
|
+
var theme = _a.theme;
|
|
134
|
+
return theme.ui_cpnt_segmentedbuttongroup_on_base_hover;
|
|
135
|
+
}, function (_a) {
|
|
136
|
+
var theme = _a.theme;
|
|
137
|
+
return theme.ui_cpnt_segmentedbuttongroup_on_base_pressed;
|
|
138
|
+
}, function (_a) {
|
|
139
|
+
var theme = _a.theme;
|
|
140
|
+
return theme.ui_cpnt_segmentedbuttongroup_base_disabled;
|
|
141
|
+
});
|
|
142
|
+
exports.default = SegmentedButtonGroup;
|
|
143
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as SegmentedButtonGroup } from './SegmentedButtonGroup';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.SegmentedButtonGroup = void 0;
|
|
7
|
+
var SegmentedButtonGroup_1 = require("./SegmentedButtonGroup");
|
|
8
|
+
Object.defineProperty(exports, "SegmentedButtonGroup", { enumerable: true, get: function () { return __importDefault(SegmentedButtonGroup_1).default; } });
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { PDSTextType } from '../../../common/types';
|
|
3
|
+
export declare type Props = {
|
|
4
|
+
min: number;
|
|
5
|
+
max: number;
|
|
6
|
+
step?: number;
|
|
7
|
+
name?: string;
|
|
8
|
+
defaultValue?: string | number;
|
|
9
|
+
tooltipText?: PDSTextType;
|
|
10
|
+
state?: 'normal' | 'disabled';
|
|
11
|
+
prefixText?: PDSTextType;
|
|
12
|
+
suffixText?: PDSTextType;
|
|
13
|
+
customWidth?: string;
|
|
14
|
+
responsiveMode?: 'none' | 'use';
|
|
15
|
+
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
16
|
+
onClick?: (e: React.MouseEvent<HTMLInputElement>) => void;
|
|
17
|
+
};
|
|
18
|
+
declare const _default: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<HTMLInputElement>>;
|
|
19
|
+
export default _default;
|