pds-dev-kit-web 0.5.10 → 0.5.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.d.ts +2 -2
- package/dist/src/common/index.d.ts +2 -5
- package/dist/src/common/services/i18n/resources/en.json +83 -27
- package/dist/src/common/services/i18n/resources/es.json +69 -13
- package/dist/src/common/services/i18n/resources/index.d.ts +228 -4
- package/dist/src/common/services/i18n/resources/jp.json +69 -13
- package/dist/src/common/services/i18n/resources/ko.json +69 -13
- package/dist/src/common/styles/colorSet/UIColor.json +1 -1
- package/dist/src/common/styles/colorSet/index.d.ts +55 -55
- package/dist/src/common/styles/colorSet/index.js +2 -2
- package/dist/src/common/types/index.d.ts +5 -0
- package/dist/src/common/types/index.js +17 -0
- package/dist/src/common/types/styled-components.d.ts +3 -0
- package/dist/src/common/types/text.d.ts +2 -0
- package/dist/src/common/types/text.js +2 -0
- package/dist/src/desktop/common/components/TextFieldBase/TextFieldBase.d.ts +3 -9
- package/dist/src/desktop/common/components/TextFieldBase/TextFieldBase.js +10 -9
- package/dist/src/desktop/components/Card/Card.d.ts +3 -2
- package/dist/src/desktop/components/Card/Card.js +1 -7
- package/dist/src/desktop/components/Checkbox/Checkbox.d.ts +2 -2
- package/dist/src/desktop/components/Chip/Chip.d.ts +2 -5
- package/dist/src/desktop/components/Chip/Chip.js +6 -1
- package/dist/src/desktop/components/ContextMenuItem/ContextMenuItem.d.ts +2 -1
- package/dist/src/desktop/components/DesktopHeaderBar/DesktopHeaderBar.d.ts +5 -5
- package/dist/src/desktop/components/DesktopHeaderBar/DesktopHeaderBar.js +13 -3
- package/dist/src/desktop/components/DesktopTabBar/DesktopTabBar.d.ts +3 -2
- package/dist/src/desktop/components/DesktopTabBar/DesktopTabBar.js +2 -2
- package/dist/src/desktop/components/EditApplyTextField/EditApplyTextField.d.ts +3 -7
- package/dist/src/desktop/components/EditApplyTextField/EditApplyTextField.js +8 -7
- package/dist/src/desktop/components/FilterBar/FilterBar.d.ts +2 -5
- package/dist/src/desktop/components/FloatingActionButton/FloatingActionButton.d.ts +2 -5
- package/dist/src/desktop/components/FloatingActionButton/FloatingActionButton.js +12 -2
- package/dist/src/desktop/components/Hero/Hero.d.ts +3 -2
- package/dist/src/desktop/components/IconButton/IconButton.d.ts +1 -6
- package/dist/src/desktop/components/IconButton/IconButton.js +14 -4
- package/dist/src/desktop/components/MainButton/MainButton.d.ts +2 -5
- package/dist/src/desktop/components/MainButton/MainButton.js +11 -1
- package/dist/src/desktop/components/Radio/Radio.d.ts +2 -1
- package/dist/src/desktop/components/Radio/Radio.js +6 -1
- package/dist/src/desktop/components/ReactionButton/ReactionButton.d.ts +2 -1
- package/dist/src/desktop/components/Select/Select.d.ts +2 -1
- package/dist/src/desktop/components/StatusBlock/StatusBlock.d.ts +2 -1
- package/dist/src/desktop/components/TextButton/TextButton.d.ts +2 -1
- package/dist/src/desktop/components/TextButton/TextButton.js +6 -1
- package/dist/src/desktop/components/TextField/TextField.d.ts +3 -8
- package/dist/src/desktop/components/TextField/TextField.js +13 -2
- package/dist/src/desktop/components/TextLabel/TextLabel.d.ts +2 -4
- package/dist/src/desktop/components/UploadIconButton/UploadIconButton.js +6 -1
- package/dist/src/desktop/components/UploadMainButton/UploadMainButton.d.ts +2 -2
- package/dist/src/desktop/components/UploadMainButton/UploadMainButton.js +6 -1
- package/dist/src/desktop/components/UploadTextButton/UploadTextButton.d.ts +2 -1
- package/dist/src/desktop/components/UploadTextButton/UploadTextButton.js +6 -1
- package/dist/src/desktop/components/UserDesktopNavBar/UserDesktopNavBar.d.ts +4 -3
- package/dist/src/desktop/components/UserDesktopNavBar/UserDesktopNavBar.js +23 -14
- package/dist/src/desktop/components/UserDesktopTabBar/UserDesktopTabBar.d.ts +2 -1
- package/dist/src/desktop/components/UserDesktopTabBar/UserDesktopTabBar.js +2 -2
- package/dist/src/mobile/common/components/TextFieldBase/TextFieldBase.d.ts +3 -9
- package/dist/src/mobile/common/components/TextFieldBase/TextFieldBase.js +10 -9
- package/dist/src/mobile/components/BlogTextField/BlogTextField.d.ts +3 -8
- package/dist/src/mobile/components/BlogTextField/BlogTextField.js +1 -0
- package/dist/src/mobile/components/Card/Card.d.ts +3 -2
- package/dist/src/mobile/components/Card/Card.js +1 -7
- package/dist/src/mobile/components/Checkbox/Checkbox.d.ts +2 -2
- package/dist/src/mobile/components/Chip/Chip.d.ts +2 -5
- package/dist/src/mobile/components/Chip/Chip.js +11 -6
- package/dist/src/mobile/components/ContextMenuItem/ContextMenuItem.d.ts +2 -1
- package/dist/src/mobile/components/IconButton/IconButton.d.ts +2 -2
- package/dist/src/mobile/components/IconButton/IconButton.js +12 -2
- package/dist/src/mobile/components/MainButton/MainButton.d.ts +4 -7
- package/dist/src/mobile/components/MainButton/MainButton.js +12 -2
- package/dist/src/mobile/components/MobileHeaderBar/MobileHeaderBar.d.ts +2 -2
- package/dist/src/mobile/components/MobileHeaderBar/MobileHeaderBar.js +18 -3
- package/dist/src/mobile/components/MobileTabBar/MobileTabBar.d.ts +2 -1
- package/dist/src/mobile/components/MobileTabBar/MobileTabBar.js +3 -3
- package/dist/src/mobile/components/Radio/Radio.d.ts +2 -1
- package/dist/src/mobile/components/Radio/Radio.js +6 -1
- package/dist/src/mobile/components/ReactionButton/ReactionButton.d.ts +4 -3
- package/dist/src/mobile/components/ReactionButton/ReactionButton.js +5 -5
- package/dist/src/mobile/components/Select/Select.d.ts +2 -1
- package/dist/src/mobile/components/StatusBlock/StatusBlock.d.ts +2 -1
- package/dist/src/mobile/components/TextButton/TextButton.d.ts +2 -1
- package/dist/src/mobile/components/TextButton/TextButton.js +6 -1
- package/dist/src/mobile/components/TextField/TextField.d.ts +3 -8
- package/dist/src/mobile/components/TextField/TextField.js +13 -2
- package/dist/src/mobile/components/TextLabel/TextLabel.d.ts +2 -4
- package/dist/src/mobile/components/UploadIconButton/UploadIconButton.js +6 -1
- package/dist/src/mobile/components/UploadMainButton/UploadMainButton.d.ts +2 -2
- package/dist/src/mobile/components/UploadMainButton/UploadMainButton.js +6 -1
- package/dist/src/mobile/components/UploadTextButton/UploadTextButton.d.ts +2 -1
- package/dist/src/mobile/components/UploadTextButton/UploadTextButton.js +6 -1
- package/dist/src/mobile/layout/LayoutMF/Containers/ContentsContainer/variation/MFA.js +1 -1
- package/dist/src/mobile/layout/LayoutMF/Containers/ContentsContainer/variation/MFB.js +2 -2
- package/dist/src/mobile/layout/LayoutMF/Containers/ContentsContainer/variation/MFD.js +1 -1
- package/dist/src/mobile/layout/LayoutMF/Containers/ContentsContainer/variation/MFE.js +2 -2
- package/dist/src/mobile/layout/LayoutMM/Containers/ContentsContainer/variation/MMA.js +1 -1
- package/dist/src/mobile/layout/LayoutMM/Containers/ContentsContainer/variation/MMB.js +1 -1
- package/dist/src/mobile/layout/LayoutMP/Containers/ContentsContainer/variation/MPA.js +1 -1
- package/dist/src/mobile/layout/LayoutMP/Containers/ContentsContainer/variation/MPB.js +1 -1
- package/dist/src/mobile/layout/LayoutMP/Containers/ContentsContainer/variation/MPC.js +2 -2
- package/dist/src/mobile/layout/LayoutMP/Containers/ContentsContainer/variation/MPD.js +1 -1
- package/dist/src/mobile/layout/LayoutMP/Containers/ContentsContainer/variation/MPE.js +1 -1
- package/dist/src/mobile/layout/LayoutMP/Containers/ContentsContainer/variation/MPF.js +2 -2
- package/dist/src/mobile/layout/LayoutMS/Containers/ContentsContainer/variation/MSA.js +1 -1
- package/dist/src/mobile/layout/LayoutMS/Containers/ContentsContainer/variation/MSB.js +1 -1
- package/dist/src/mobile/layout/LayoutMS/Containers/ContentsContainer/variation/MSC.js +2 -2
- package/dist/src/mobile/layout/LayoutMS/Containers/ContentsContainer/variation/MSD.js +1 -1
- package/dist/src/mobile/layout/LayoutMS/Containers/ContentsContainer/variation/MSE.js +1 -1
- package/dist/src/mobile/layout/LayoutMS/Containers/ContentsContainer/variation/MSF.js +2 -2
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Path } from 'react-hook-form';
|
|
3
|
-
import { IFormValues } from '../../../common
|
|
3
|
+
import { IFormValues, PDSTextType } from '../../../common';
|
|
4
4
|
declare type CheckboxProps = {
|
|
5
|
-
text?:
|
|
5
|
+
text?: PDSTextType;
|
|
6
6
|
fontWeight?: 'bold' | 'regular';
|
|
7
7
|
state?: 'normal' | 'disabled';
|
|
8
8
|
name: Path<IFormValues>;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import
|
|
3
|
-
import lineIcons from '../../../common/assets/icons/line';
|
|
4
|
-
export declare type FillIconNameKeys = keyof typeof fillIcons;
|
|
5
|
-
export declare type LineIconNameKeys = keyof typeof lineIcons;
|
|
2
|
+
import { FillIconNameKeys, LineIconNameKeys, PDSTextType } from '../../../common';
|
|
6
3
|
declare type DisplayType = 'category_choice' | 'filter_single' | 'filter_multi' | 'removable' | 'label' | 'time' | 'information';
|
|
7
4
|
export declare type ChipProps = {
|
|
8
5
|
displayType?: DisplayType;
|
|
9
|
-
text?:
|
|
6
|
+
text?: PDSTextType;
|
|
10
7
|
filterIconMode?: 'none' | 'left';
|
|
11
8
|
iconFillType?: 'line' | 'fill';
|
|
12
9
|
iconName?: FillIconNameKeys | LineIconNameKeys;
|
|
@@ -18,6 +18,11 @@ function Chip(_a) {
|
|
|
18
18
|
onClickChip();
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
|
+
var handleClickXMarkIcon = function () {
|
|
22
|
+
if (onClickXMarkIcon) {
|
|
23
|
+
onClickXMarkIcon();
|
|
24
|
+
}
|
|
25
|
+
};
|
|
21
26
|
var chipType = function () {
|
|
22
27
|
switch (displayType) {
|
|
23
28
|
case 'category_choice':
|
|
@@ -39,7 +44,7 @@ function Chip(_a) {
|
|
|
39
44
|
case 'removable':
|
|
40
45
|
return (react_1.default.createElement(S_RemovableChip, { onClick: handleClick },
|
|
41
46
|
react_1.default.createElement(TextLabel_1.TextLabel, { text: text, styleTheme: "caption1Regular", btnMode: "use", colorTheme: "sysTextSecondary" }),
|
|
42
|
-
react_1.default.createElement(S_XIconWrapper, { onClick:
|
|
47
|
+
react_1.default.createElement(S_XIconWrapper, { onClick: handleClickXMarkIcon },
|
|
43
48
|
react_1.default.createElement(Icon_1.Icon, { size: 12, iconName: "ic_xmark", fillType: "line", colorKey: "ui_cpnt_chip_fill_icon_inactive" }))));
|
|
44
49
|
default:
|
|
45
50
|
return (react_1.default.createElement(S_FilterSingleChip, { isActive: chipId === activeChipId, onClick: handleClick },
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { FillIconNameKeys, LineIconNameKeys } from '../../../common';
|
|
2
|
+
import { FillIconNameKeys, LineIconNameKeys, PDSTextType } from '../../../common';
|
|
3
3
|
declare const defaultProps: {
|
|
4
4
|
size: "large" | "xlarge";
|
|
5
5
|
leftDisplayType: "text" | "icon" | "back";
|
|
@@ -8,9 +8,9 @@ declare const defaultProps: {
|
|
|
8
8
|
};
|
|
9
9
|
declare type DefaultProps = Readonly<typeof defaultProps>;
|
|
10
10
|
declare type OptionalProps = {
|
|
11
|
-
text?:
|
|
11
|
+
text?: PDSTextType;
|
|
12
12
|
iconName?: FillIconNameKeys | LineIconNameKeys;
|
|
13
|
-
mBtnText?:
|
|
13
|
+
mBtnText?: PDSTextType;
|
|
14
14
|
onClickLeftBtn?: () => void;
|
|
15
15
|
onClickRightBtn?: () => void;
|
|
16
16
|
};
|
|
@@ -19,7 +19,7 @@ declare type Complete<T> = {
|
|
|
19
19
|
};
|
|
20
20
|
declare type TextType = {
|
|
21
21
|
leftDisplayType: 'text';
|
|
22
|
-
text:
|
|
22
|
+
text: PDSTextType;
|
|
23
23
|
};
|
|
24
24
|
declare type IconType = {
|
|
25
25
|
leftDisplayType: 'icon';
|
|
@@ -32,7 +32,7 @@ declare type CloseType = {
|
|
|
32
32
|
} & Complete<Pick<OptionalProps, 'onClickRightBtn'>>;
|
|
33
33
|
declare type MBtnType = {
|
|
34
34
|
rightBtnMode: 'mbtn';
|
|
35
|
-
mBtnText:
|
|
35
|
+
mBtnText: PDSTextType;
|
|
36
36
|
} & Complete<Pick<OptionalProps, 'onClickRightBtn'>>;
|
|
37
37
|
declare type DesktopHeaderBarProps = OptionalProps & (TextType | IconType | BackType | CloseType | MBtnType) & Partial<DefaultProps>;
|
|
38
38
|
declare function DesktopHeaderBar({ text, size, leftDisplayType, iconName, rightBtnMode, mBtnText, dividerType, onClickLeftBtn, onClickRightBtn }: DesktopHeaderBarProps): JSX.Element;
|
|
@@ -21,6 +21,16 @@ var defaultProps = {
|
|
|
21
21
|
};
|
|
22
22
|
function DesktopHeaderBar(_a) {
|
|
23
23
|
var text = _a.text, _b = _a.size, size = _b === void 0 ? 'xlarge' : _b, _c = _a.leftDisplayType, leftDisplayType = _c === void 0 ? 'text' : _c, iconName = _a.iconName, _d = _a.rightBtnMode, rightBtnMode = _d === void 0 ? 'none' : _d, mBtnText = _a.mBtnText, _e = _a.dividerType, dividerType = _e === void 0 ? 'none' : _e, onClickLeftBtn = _a.onClickLeftBtn, onClickRightBtn = _a.onClickRightBtn;
|
|
24
|
+
var handleClickLeftBtn = function () {
|
|
25
|
+
if (onClickLeftBtn) {
|
|
26
|
+
onClickLeftBtn();
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
var handleClickRightBtn = function () {
|
|
30
|
+
if (onClickRightBtn) {
|
|
31
|
+
onClickRightBtn();
|
|
32
|
+
}
|
|
33
|
+
};
|
|
24
34
|
var leftDisplayMode = function () {
|
|
25
35
|
switch (leftDisplayType) {
|
|
26
36
|
case 'icon': {
|
|
@@ -29,7 +39,7 @@ function DesktopHeaderBar(_a) {
|
|
|
29
39
|
react_1.default.createElement(hybrid_1.Spacing, { size: "spacing_c", spacingType: "width" })));
|
|
30
40
|
}
|
|
31
41
|
case 'back': {
|
|
32
|
-
return (react_1.default.createElement(IconButton_1.IconButton, { iconSize: 24, baseSize: "large", fillType: "fill", iconFillType: "line", iconName: "ic_arrow_left", onClick:
|
|
42
|
+
return (react_1.default.createElement(IconButton_1.IconButton, { iconSize: 24, baseSize: "large", fillType: "fill", iconFillType: "line", iconName: "ic_arrow_left", onClick: handleClickLeftBtn, iconColorKey: "ui_cpnt_button_icon_enabled", baseColorKey: "ui_cpnt_button_fill_base_transparent" }));
|
|
33
43
|
}
|
|
34
44
|
case 'text': {
|
|
35
45
|
return;
|
|
@@ -39,11 +49,11 @@ function DesktopHeaderBar(_a) {
|
|
|
39
49
|
var rightButtonMode = function () {
|
|
40
50
|
switch (rightBtnMode) {
|
|
41
51
|
case 'close': {
|
|
42
|
-
return (react_1.default.createElement(IconButton_1.IconButton, { fillType: "fill", baseSize: "large", iconSize: 24, shapeType: "rectangle", iconName: "ic_xmark", iconFillType: "line", onClick:
|
|
52
|
+
return (react_1.default.createElement(IconButton_1.IconButton, { fillType: "fill", baseSize: "large", iconSize: 24, shapeType: "rectangle", iconName: "ic_xmark", iconFillType: "line", onClick: handleClickRightBtn, iconColorKey: "ui_cpnt_button_icon_enabled", baseColorKey: "ui_cpnt_button_fill_base_transparent" }));
|
|
43
53
|
}
|
|
44
54
|
case 'mbtn': {
|
|
45
55
|
return (react_1.default.createElement(react_1.default.Fragment, null, size === 'xlarge' && (react_1.default.createElement(S_MainButtonWrapper, null,
|
|
46
|
-
react_1.default.createElement(MainButton_1.MainButton, { text: mBtnText, size: "small", fillType: "line", onClick:
|
|
56
|
+
react_1.default.createElement(MainButton_1.MainButton, { text: mBtnText, size: "small", fillType: "line", onClick: handleClickRightBtn })))));
|
|
47
57
|
}
|
|
48
58
|
case 'none': {
|
|
49
59
|
return;
|
|
@@ -29,7 +29,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
29
29
|
var react_1 = __importDefault(require("react"));
|
|
30
30
|
var react_router_dom_1 = require("react-router-dom");
|
|
31
31
|
var styled_components_1 = __importStar(require("styled-components"));
|
|
32
|
-
var
|
|
32
|
+
var hybrid_1 = require("../../../hybrid");
|
|
33
33
|
var TextLabel_1 = require("../TextLabel");
|
|
34
34
|
function DesktopTabBar(_a) {
|
|
35
35
|
var textArray = _a.textArray, _b = _a.styleTheme, styleTheme = _b === void 0 ? 'main' : _b;
|
|
@@ -59,7 +59,7 @@ function DesktopTabBar(_a) {
|
|
|
59
59
|
textLabel(value, false),
|
|
60
60
|
value.subArray && pathname.includes(value.path) && (react_1.default.createElement(S_SubTabBox, null, value.subArray.map(function (subValue) { return (react_1.default.createElement(S_SubWrapper, { key: subValue.path }, textLabel(subValue, true))); }))))); }),
|
|
61
61
|
textArray.map(function (value) { return value.subArray && pathname.includes(value.path) && react_1.default.createElement(S_SubBackground, null); })),
|
|
62
|
-
react_1.default.createElement(
|
|
62
|
+
react_1.default.createElement(hybrid_1.Divider, { direction: "horizontal" })));
|
|
63
63
|
}
|
|
64
64
|
var S_TabWrapper = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n ", "\n"], ["\n position: relative;\n ", "\n"])), function (_a) {
|
|
65
65
|
var styleTheme = _a.styleTheme;
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Path } from 'react-hook-form';
|
|
3
|
-
import
|
|
4
|
-
import lineIcons from '../../../common/assets/icons/line';
|
|
5
|
-
import { IFormValues } from '../../../common/types/form';
|
|
6
|
-
export declare type FillIconNameKeys = keyof typeof fillIcons;
|
|
7
|
-
export declare type LineIconNameKeys = keyof typeof lineIcons;
|
|
3
|
+
import { PDSTextType, IFormValues } from '../../../common';
|
|
8
4
|
export declare type EditApplyTextFieldProps = {
|
|
9
5
|
name: Path<IFormValues>;
|
|
10
|
-
hintText?:
|
|
11
|
-
defaultText?:
|
|
6
|
+
hintText?: PDSTextType;
|
|
7
|
+
defaultText?: PDSTextType;
|
|
12
8
|
validation?: {
|
|
13
9
|
[key: string]: any;
|
|
14
10
|
};
|
|
@@ -31,12 +31,13 @@ var styled_components_1 = __importStar(require("styled-components"));
|
|
|
31
31
|
var components_1 = require("../../common/components");
|
|
32
32
|
var IconButton_1 = require("../IconButton");
|
|
33
33
|
function EditApplyTextField(_a) {
|
|
34
|
-
var
|
|
34
|
+
var _b;
|
|
35
|
+
var name = _a.name, hintText = _a.hintText, defaultText = _a.defaultText, validation = _a.validation, _c = _a.preventBlankMode, preventBlankMode = _c === void 0 ? 'none' : _c, _d = _a.size, size = _d === void 0 ? 'large' : _d, _e = _a.textLineType, textLineType = _e === void 0 ? 'single' : _e, _f = _a.multiRows, multiRows = _f === void 0 ? 8 : _f, _g = _a.autoMinRows, autoMinRows = _g === void 0 ? 8 : _g, autoMaxRows = _a.autoMaxRows, _h = _a.inputType, inputType = _h === void 0 ? 'text' : _h, _j = _a.state, state = _j === void 0 ? 'normal' : _j, max = _a.max, maxLength = _a.maxLength, min = _a.min, onBlur = _a.onBlur, onChange = _a.onChange, onFocus = _a.onFocus, onTarget = _a.onTarget;
|
|
35
36
|
var t = (0, react_i18next_1.useTranslation)('translation').t;
|
|
36
|
-
var
|
|
37
|
-
var
|
|
38
|
-
var
|
|
39
|
-
var
|
|
37
|
+
var _k = (0, react_hook_form_1.useFormContext)(), register = _k.register, setValue = _k.setValue, trigger = _k.trigger, watch = _k.watch, errors = _k.formState.errors;
|
|
38
|
+
var _l = (0, react_1.useState)(false), isFocused = _l[0], setIsFocused = _l[1];
|
|
39
|
+
var _m = (0, react_1.useState)(false), isOpen = _m[0], setIsOpen = _m[1];
|
|
40
|
+
var _o = (0, react_1.useState)(), prevValue = _o[0], setPrevValue = _o[1];
|
|
40
41
|
var currentValue = watch(name);
|
|
41
42
|
var validateOnChange = register(name, validation).onChange;
|
|
42
43
|
var isError = Object.keys(errors).some(function (error) { return error === name; });
|
|
@@ -121,7 +122,7 @@ function EditApplyTextField(_a) {
|
|
|
121
122
|
isOpen === true && (react_1.default.createElement(S_ButtonBox, null,
|
|
122
123
|
react_1.default.createElement(IconButton_1.IconButton, { iconName: "ic_xmark", fillType: "fill", baseSize: "small", iconSize: 16, shapeType: "circular", shadow: "visible", iconColorKey: "ui_cpnt_button_icon_enabled", baseColorKey: "ui_cpnt_button_fill_base_white", onMouseDown: handleCancel }),
|
|
123
124
|
react_1.default.createElement(IconButton_1.IconButton, { iconName: "ic_check", fillType: "fill", baseSize: "small", iconSize: 16, shapeType: "circular", shadow: "visible", iconColorKey: "ui_cpnt_button_icon_on_primary", baseColorKey: "ui_cpnt_button_fill_base_primary", onMouseDown: handleSubmit, state: isError === true ? 'disabled' : 'normal' })))),
|
|
124
|
-
errors[name] && react_1.default.createElement(S_Error, { isFocused: isFocused }, t(errors[name].message)))));
|
|
125
|
+
((_b = errors[name]) === null || _b === void 0 ? void 0 : _b.message) && (react_1.default.createElement(S_Error, { isFocused: isFocused }, t(errors[name].message))))));
|
|
125
126
|
}
|
|
126
127
|
var S_EditApplyTextFieldWrapper = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: ", ";\n"], ["\n width: ", ";\n"])), function (_a) {
|
|
127
128
|
var size = _a.size;
|
|
@@ -211,7 +212,7 @@ var S_S_TextFieldBaseWrapper = styled_components_1.default.div(templateObject_10
|
|
|
211
212
|
disabled: disabled
|
|
212
213
|
}[state];
|
|
213
214
|
});
|
|
214
|
-
var S_Error = styled_components_1.default.div(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n color: ", ";\n font-size: ", ";\n font-weight: ", ";\n line-height: ", ";\n margin-top: ", ";\n margin-right: ", ";\n"], ["\n color: ", ";\n font-size: ", ";\n font-weight: ", ";\n line-height: ", ";\n margin-top: ", ";\n margin-right: ", ";\n"])), function (_a) {
|
|
215
|
+
var S_Error = styled_components_1.default.div(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n color: ", ";\n font-size: ", ";\n font-weight: ", ";\n line-height: ", ";\n margin-top: ", ";\n margin-right: ", ";\n text-align: left;\n"], ["\n color: ", ";\n font-size: ", ";\n font-weight: ", ";\n line-height: ", ";\n margin-top: ", ";\n margin-right: ", ";\n text-align: left;\n"])), function (_a) {
|
|
215
216
|
var theme = _a.theme;
|
|
216
217
|
return theme.ui_cpnt_textfield_text_error;
|
|
217
218
|
}, function (_a) {
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import
|
|
3
|
-
import lineIcons from '../../../common/assets/icons/line';
|
|
4
|
-
export declare type FillIconNameKeys = keyof typeof fillIcons;
|
|
5
|
-
export declare type LineIconNameKeys = keyof typeof lineIcons;
|
|
2
|
+
import { PDSTextType } from '../../../common';
|
|
6
3
|
declare type ChipProps = {
|
|
7
4
|
text: string;
|
|
8
5
|
path: string;
|
|
@@ -10,7 +7,7 @@ declare type ChipProps = {
|
|
|
10
7
|
export declare type FilterBarProps = {
|
|
11
8
|
displayType: 'chips' | 'searchfield' | 'filterchips_searchfield';
|
|
12
9
|
textArray: ChipProps[];
|
|
13
|
-
hintText?:
|
|
10
|
+
hintText?: PDSTextType;
|
|
14
11
|
activeChipId?: string | number;
|
|
15
12
|
name?: string;
|
|
16
13
|
onClickChip?: (activeChipId: string | number) => void;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import
|
|
3
|
-
import lineIcons from '../../../common/assets/icons/line';
|
|
4
|
-
export declare type FillIconNameKeys = keyof typeof fillIcons;
|
|
5
|
-
export declare type LineIconNameKeys = keyof typeof lineIcons;
|
|
2
|
+
import { FillIconNameKeys, LineIconNameKeys, PDSTextType } from '../../../common';
|
|
6
3
|
export declare type FloatingActionButtonProps = {
|
|
7
|
-
text?:
|
|
4
|
+
text?: PDSTextType;
|
|
8
5
|
displayType?: 'icon_only' | 'text_only' | 'icon_text';
|
|
9
6
|
size?: 'xlarge' | 'large';
|
|
10
7
|
fontWeight?: 'bold' | 'regular';
|
|
@@ -39,6 +39,16 @@ var TextLabel_1 = require("../TextLabel");
|
|
|
39
39
|
// state?: 'normal' | 'disabled';
|
|
40
40
|
function FloatingActionButton(_a) {
|
|
41
41
|
var text = _a.text, _b = _a.displayType, displayType = _b === void 0 ? 'icon_text' : _b, _c = _a.size, size = _c === void 0 ? 'large' : _c, fontWeight = _a.fontWeight, _d = _a.iconFillType, iconFillType = _d === void 0 ? 'line' : _d, iconName = _a.iconName, _e = _a.colorTheme, colorTheme = _e === void 0 ? 'none' : _e, _f = _a.state, state = _f === void 0 ? 'normal' : _f, onClick = _a.onClick, onMouseDown = _a.onMouseDown;
|
|
42
|
+
var handleClick = function () {
|
|
43
|
+
if (onClick) {
|
|
44
|
+
onClick();
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
var handleMouseDown = function () {
|
|
48
|
+
if (onMouseDown) {
|
|
49
|
+
onMouseDown();
|
|
50
|
+
}
|
|
51
|
+
};
|
|
42
52
|
var iconColor = function () {
|
|
43
53
|
if (state === 'disabled') {
|
|
44
54
|
return 'ui_cpnt_button_icon_disabled';
|
|
@@ -46,9 +56,9 @@ function FloatingActionButton(_a) {
|
|
|
46
56
|
return 'ui_cpnt_button_icon_on_primary';
|
|
47
57
|
};
|
|
48
58
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
49
|
-
displayType === 'icon_only' && (react_1.default.createElement(S_ButtonIconOnly, { size: size, fontWeight: fontWeight, colorTheme: colorTheme, state: state, disabled: state === 'disabled', onClick:
|
|
59
|
+
displayType === 'icon_only' && (react_1.default.createElement(S_ButtonIconOnly, { size: size, fontWeight: fontWeight, colorTheme: colorTheme, state: state, disabled: state === 'disabled', onClick: handleClick, onMouseDown: handleMouseDown },
|
|
50
60
|
react_1.default.createElement(hybrid_1.Icon, { iconName: iconName, size: size === 'large' ? 20 : 24, colorKey: iconColor(), fillType: iconFillType }))),
|
|
51
|
-
displayType !== 'icon_only' && (react_1.default.createElement(S_Button, { size: size, fontWeight: fontWeight, colorTheme: colorTheme, state: state, disabled: state === 'disabled', onClick:
|
|
61
|
+
displayType !== 'icon_only' && (react_1.default.createElement(S_Button, { size: size, fontWeight: fontWeight, colorTheme: colorTheme, state: state, disabled: state === 'disabled', onClick: handleClick, onMouseDown: handleMouseDown },
|
|
52
62
|
displayType === 'text_only' && (react_1.default.createElement(TextLabel_1.TextLabel, { text: text, styleTheme: "body1Bold", btnMode: "use", colorTheme: state === 'disabled' ? 'sysTextTertiary' : 'usrTextBrandOnPrimary', colorOverride: state === 'disabled' ? 'ui_cpnt_button_text_darktheme_disabled' : undefined })),
|
|
53
63
|
displayType === 'icon_text' && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
54
64
|
react_1.default.createElement(hybrid_1.Icon, { iconName: iconName, size: 20, colorKey: iconColor(), fillType: iconFillType }),
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { PDSTextType } from '../../../common';
|
|
2
3
|
export declare type HeroProps = {
|
|
3
|
-
heroText:
|
|
4
|
-
leadText?:
|
|
4
|
+
heroText: PDSTextType;
|
|
5
|
+
leadText?: PDSTextType;
|
|
5
6
|
leadTextColorTheme?: 'normal' | 'emphasis';
|
|
6
7
|
};
|
|
7
8
|
declare function Hero({ heroText, leadText, leadTextColorTheme }: HeroProps): JSX.Element;
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import
|
|
3
|
-
import lineIcons from '../../../common/assets/icons/line';
|
|
4
|
-
import { uiColors } from '../../../common/styles/ui-colors';
|
|
5
|
-
export declare type FillIconNameKeys = keyof typeof fillIcons;
|
|
6
|
-
export declare type LineIconNameKeys = keyof typeof lineIcons;
|
|
7
|
-
export declare type UiColors = keyof typeof uiColors;
|
|
2
|
+
import { FillIconNameKeys, LineIconNameKeys, UiColors } from '../../../common';
|
|
8
3
|
export declare type IconButtonProps = {
|
|
9
4
|
fillType?: 'fill' | 'line';
|
|
10
5
|
shapeType?: 'circular' | 'rectangle';
|
|
@@ -28,10 +28,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
var react_1 = __importDefault(require("react"));
|
|
30
30
|
var styled_components_1 = __importStar(require("styled-components"));
|
|
31
|
-
var
|
|
31
|
+
var common_1 = require("../../../common");
|
|
32
32
|
var hybrid_1 = require("../../../hybrid");
|
|
33
33
|
function IconButton(_a) {
|
|
34
34
|
var _b = _a.fillType, fillType = _b === void 0 ? 'fill' : _b, _c = _a.shapeType, shapeType = _c === void 0 ? 'rectangle' : _c, _d = _a.baseSize, baseSize = _d === void 0 ? 'small' : _d, baseColorKey = _a.baseColorKey, borderColorKey = _a.borderColorKey, _e = _a.iconSize, iconSize = _e === void 0 ? 24 : _e, _f = _a.iconFillType, iconFillType = _f === void 0 ? 'line' : _f, iconName = _a.iconName, iconColorKey = _a.iconColorKey, _g = _a.shadow, shadow = _g === void 0 ? 'hidden' : _g, _h = _a.colorTheme, colorTheme = _h === void 0 ? 'none' : _h, _j = _a.type, type = _j === void 0 ? 'button' : _j, _k = _a.state, state = _k === void 0 ? 'normal' : _k, onClick = _a.onClick, onMouseDown = _a.onMouseDown;
|
|
35
|
+
var handleClick = function () {
|
|
36
|
+
if (onClick) {
|
|
37
|
+
onClick();
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
var handleMouseDown = function () {
|
|
41
|
+
if (onMouseDown) {
|
|
42
|
+
onMouseDown();
|
|
43
|
+
}
|
|
44
|
+
};
|
|
35
45
|
var iconStateColorObj = {
|
|
36
46
|
fill: 'ui_cpnt_button_icon_on_primary',
|
|
37
47
|
line: 'ui_cpnt_button_icon_enabled'
|
|
@@ -52,7 +62,7 @@ function IconButton(_a) {
|
|
|
52
62
|
}
|
|
53
63
|
return iconStateColorObj[fillType];
|
|
54
64
|
};
|
|
55
|
-
return (react_1.default.createElement(S_IconButton, { fillType: fillType, shapeType: shapeType, baseSize: baseSize, baseColorKey: baseColorKey, borderColorKey: borderColorKey, shadow: shadow, colorTheme: colorTheme, type: type, state: state, disabled: state === 'disabled', onClick:
|
|
65
|
+
return (react_1.default.createElement(S_IconButton, { fillType: fillType, shapeType: shapeType, baseSize: baseSize, baseColorKey: baseColorKey, borderColorKey: borderColorKey, shadow: shadow, colorTheme: colorTheme, type: type, state: state, disabled: state === 'disabled', onClick: handleClick, onMouseDown: handleMouseDown },
|
|
56
66
|
react_1.default.createElement(hybrid_1.Icon, { iconName: iconName, size: iconSize, colorKey: IconColorSelect(), fillType: iconFillType })));
|
|
57
67
|
}
|
|
58
68
|
var fillDisabled = (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: ", ";\n"], ["\n background-color: ", ";\n"])), function (_a) {
|
|
@@ -63,7 +73,7 @@ var fillDisabled = (0, styled_components_1.css)(templateObject_1 || (templateObj
|
|
|
63
73
|
});
|
|
64
74
|
var fill = (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-color: ", ";\n\n &:hover:enabled {\n ", "\n }\n\n &:active:enabled {\n ", "\n }\n\n ", ";\n"], ["\n background-color: ", ";\n\n &:hover:enabled {\n ", "\n }\n\n &:active:enabled {\n ", "\n }\n\n ", ";\n"])), function (_a) {
|
|
65
75
|
var theme = _a.theme, baseColorKey = _a.baseColorKey;
|
|
66
|
-
return baseColorKey ?
|
|
76
|
+
return baseColorKey ? common_1.uiColors[baseColorKey] : theme.ui_cpnt_button_fill_base_primary;
|
|
67
77
|
}, function (_a) {
|
|
68
78
|
var theme = _a.theme, baseColorKey = _a.baseColorKey;
|
|
69
79
|
return baseColorKey === 'ui_cpnt_button_fill_base_transparent'
|
|
@@ -90,7 +100,7 @@ var line = (0, styled_components_1.css)(templateObject_4 || (templateObject_4 =
|
|
|
90
100
|
return theme.ui_cpnt_button_line_base_default;
|
|
91
101
|
}, function (_a) {
|
|
92
102
|
var theme = _a.theme, borderColorKey = _a.borderColorKey;
|
|
93
|
-
return borderColorKey ?
|
|
103
|
+
return borderColorKey ? common_1.uiColors[borderColorKey] : theme.ui_cpnt_button_line_border_enabled;
|
|
94
104
|
}, function (_a) {
|
|
95
105
|
var colorTheme = _a.colorTheme;
|
|
96
106
|
switch (colorTheme) {
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import
|
|
3
|
-
import lineIcons from '../../../common/assets/icons/line';
|
|
4
|
-
export declare type FillIconNameKeys = keyof typeof fillIcons;
|
|
5
|
-
export declare type LineIconNameKeys = keyof typeof lineIcons;
|
|
2
|
+
import { FillIconNameKeys, LineIconNameKeys, PDSTextType } from '../../../common';
|
|
6
3
|
export declare type MainButtonProps = {
|
|
7
|
-
text?:
|
|
4
|
+
text?: PDSTextType;
|
|
8
5
|
fillType?: 'fill' | 'line';
|
|
9
6
|
size?: 'large' | 'medium' | 'small' | 'xsmall' | 'rlarge';
|
|
10
7
|
fontWeight?: 'bold' | 'regular';
|
|
@@ -38,6 +38,16 @@ var TextLabel_1 = require("../TextLabel");
|
|
|
38
38
|
// shadow?: 'hidden' | 'visible';
|
|
39
39
|
function MainButton(_a) {
|
|
40
40
|
var text = _a.text, _b = _a.fillType, fillType = _b === void 0 ? 'fill' : _b, _c = _a.size, size = _c === void 0 ? 'large' : _c, fontWeight = _a.fontWeight, _d = _a.iconMode, iconMode = _d === void 0 ? 'none' : _d, _e = _a.iconFillType, iconFillType = _e === void 0 ? 'line' : _e, iconName = _a.iconName, _f = _a.colorTheme, colorTheme = _f === void 0 ? 'none' : _f, _g = _a.type, type = _g === void 0 ? 'button' : _g, _h = _a.state, state = _h === void 0 ? 'normal' : _h, onClick = _a.onClick, onMouseDown = _a.onMouseDown;
|
|
41
|
+
var handleClick = function () {
|
|
42
|
+
if (onClick) {
|
|
43
|
+
onClick();
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
var handleMouseDown = function () {
|
|
47
|
+
if (onMouseDown) {
|
|
48
|
+
onMouseDown();
|
|
49
|
+
}
|
|
50
|
+
};
|
|
41
51
|
var textStyle = {
|
|
42
52
|
rlarge: 'body1Bold',
|
|
43
53
|
large: 'body1Bold',
|
|
@@ -84,7 +94,7 @@ function MainButton(_a) {
|
|
|
84
94
|
}
|
|
85
95
|
return iconFillTypeColorObj[fillType];
|
|
86
96
|
};
|
|
87
|
-
return (react_1.default.createElement(S_Button, { fillType: fillType, size: size, fontWeight: fontWeight, colorTheme: colorTheme, type: type, state: state, disabled: state === 'disabled', onClick:
|
|
97
|
+
return (react_1.default.createElement(S_Button, { fillType: fillType, size: size, fontWeight: fontWeight, colorTheme: colorTheme, type: type, state: state, disabled: state === 'disabled', onClick: handleClick, onMouseDown: handleMouseDown },
|
|
88
98
|
size !== 'xsmall' && iconMode === 'left' && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
89
99
|
react_1.default.createElement(hybrid_1.Icon, { iconName: iconName, size: size === 'large' || size === 'rlarge' ? 20 : 16, colorKey: iconColor(), fillType: iconFillType }),
|
|
90
100
|
react_1.default.createElement(hybrid_1.Spacing, { size: size === 'large' || size === 'rlarge' ? 'spacing_b' : 'spacing_a', spacingType: "width" }))),
|
|
@@ -13,6 +13,11 @@ var hybrid_1 = require("../../../hybrid");
|
|
|
13
13
|
var TextLabel_1 = require("../TextLabel");
|
|
14
14
|
function Radio(_a) {
|
|
15
15
|
var text = _a.text, _b = _a.fontWeight, fontWeight = _b === void 0 ? 'regular' : _b, _c = _a.state, state = _c === void 0 ? 'normal' : _c, _d = _a.checked, checked = _d === void 0 ? false : _d, name = _a.name, value = _a.value, onChange = _a.onChange;
|
|
16
|
+
var handleChange = function (e) {
|
|
17
|
+
if (onChange) {
|
|
18
|
+
onChange(e);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
16
21
|
var icon = function () {
|
|
17
22
|
switch (state) {
|
|
18
23
|
case 'normal': {
|
|
@@ -32,7 +37,7 @@ function Radio(_a) {
|
|
|
32
37
|
react_1.default.createElement(TextLabel_1.TextLabel, { text: text, styleTheme: fontWeight === 'regular' ? 'body2Regular' : 'body2Bold', colorOverride: state === 'normal'
|
|
33
38
|
? 'ui_cpnt_selcontrols_text_default'
|
|
34
39
|
: 'ui_cpnt_selcontrols_text_disabled' })),
|
|
35
|
-
react_1.default.createElement("input", { hidden: true, id: value, type: "radio", name: name, value: value, checked: checked, color: value, onChange:
|
|
40
|
+
react_1.default.createElement("input", { hidden: true, id: value, type: "radio", name: name, value: value, checked: checked, color: value, onChange: handleChange, disabled: state === 'disabled' })));
|
|
36
41
|
}
|
|
37
42
|
var S_Label = styled_components_1.default.label(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-items: center;\n cursor: pointer;\n display: flex;\n height: 24px;\n"], ["\n align-items: center;\n cursor: pointer;\n display: flex;\n height: 24px;\n"])));
|
|
38
43
|
var S_OverrideIconWrapper = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n align-items: center;\n display: flex;\n position: relative;\n"], ["\n align-items: center;\n display: flex;\n position: relative;\n"])));
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { PDSTextType } from '../../../common';
|
|
2
3
|
export declare type ReactionButtonProps = {
|
|
3
|
-
text:
|
|
4
|
+
text: PDSTextType;
|
|
4
5
|
iconName?: 'ic_thumb_up' | 'ic_heart' | 'ic_thumb_down' | 'ic_reply';
|
|
5
6
|
status?: 'default' | 'select';
|
|
6
7
|
colorTheme?: 'none' | 'dark';
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { PDSTextType } from '../../../common';
|
|
2
3
|
declare type Value = {
|
|
3
4
|
text: string;
|
|
4
5
|
value: string | number;
|
|
5
6
|
};
|
|
6
7
|
declare type SelectProps = {
|
|
7
|
-
hintText?:
|
|
8
|
+
hintText?: PDSTextType;
|
|
8
9
|
defaultValue?: Value;
|
|
9
10
|
valueArray: Value[];
|
|
10
11
|
size?: 'large' | 'medium' | 'small' | 'rlarge';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { PDSTextType } from '../../../common';
|
|
2
3
|
export declare type StatusBlockProps = {
|
|
3
|
-
text?:
|
|
4
|
+
text?: PDSTextType;
|
|
4
5
|
size?: 'large' | 'medium' | 'small';
|
|
5
6
|
state?: 'basic' | 'standby' | 'proceeding' | 'cancel' | 'end' | 'error';
|
|
6
7
|
width?: number | 'responsive';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { PDSTextType } from '../../../common';
|
|
2
3
|
export declare type TextButtonProps = {
|
|
3
|
-
text?:
|
|
4
|
+
text?: PDSTextType;
|
|
4
5
|
size?: 'rlarge' | 'large' | 'medium' | 'small' | 'xsmall';
|
|
5
6
|
fontWeight?: 'bold' | 'regular';
|
|
6
7
|
type?: 'submit' | 'reset' | 'button';
|
|
@@ -55,6 +55,11 @@ var TextLabel_1 = require("../TextLabel");
|
|
|
55
55
|
// colorTheme?: 'none';
|
|
56
56
|
function TextButton(_a) {
|
|
57
57
|
var text = _a.text, _b = _a.size, size = _b === void 0 ? 'large' : _b, fontWeight = _a.fontWeight, _c = _a.type, type = _c === void 0 ? 'button' : _c, _d = _a.state, state = _d === void 0 ? 'normal' : _d, onClick = _a.onClick, rest = __rest(_a, ["text", "size", "fontWeight", "type", "state", "onClick"]);
|
|
58
|
+
var handleClick = function () {
|
|
59
|
+
if (onClick) {
|
|
60
|
+
onClick();
|
|
61
|
+
}
|
|
62
|
+
};
|
|
58
63
|
var textStyle = {
|
|
59
64
|
rlarge: 'body1Bold',
|
|
60
65
|
large: 'body1Bold',
|
|
@@ -62,7 +67,7 @@ function TextButton(_a) {
|
|
|
62
67
|
small: 'caption1Bold',
|
|
63
68
|
xsmall: 'caption1Regular'
|
|
64
69
|
};
|
|
65
|
-
return (react_1.default.createElement(S_Button, __assign({}, rest, { size: size, onClick:
|
|
70
|
+
return (react_1.default.createElement(S_Button, __assign({}, rest, { size: size, onClick: handleClick, type: type, fontWeight: fontWeight, disabled: state === 'disabled' }),
|
|
66
71
|
react_1.default.createElement(TextLabel_1.TextLabel, { text: text, styleTheme: textStyle[size], colorTheme: state === 'disabled' ? 'sysTextTertiary' : 'usrTextBrandPrimary', btnMode: "use" })));
|
|
67
72
|
}
|
|
68
73
|
var large = (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 48px;\n ", ";\n"], ["\n height: 48px;\n ", ";\n"])), function (_a) {
|
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
import { TFunctionResult } from 'i18next';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import { Path } from 'react-hook-form';
|
|
4
|
-
import
|
|
5
|
-
import lineIcons from '../../../common/assets/icons/line';
|
|
6
|
-
import { IFormValues } from '../../../common/types/form';
|
|
7
|
-
export declare type FillIconNameKeys = keyof typeof fillIcons;
|
|
8
|
-
export declare type LineIconNameKeys = keyof typeof lineIcons;
|
|
3
|
+
import { FillIconNameKeys, IFormValues, LineIconNameKeys, PDSTextType } from '../../../common';
|
|
9
4
|
export declare type TextFieldProps = {
|
|
10
5
|
name: Path<IFormValues>;
|
|
11
|
-
hintText?:
|
|
12
|
-
defaultText?:
|
|
6
|
+
hintText?: PDSTextType;
|
|
7
|
+
defaultText?: PDSTextType;
|
|
13
8
|
validation?: {
|
|
14
9
|
[key: string]: any;
|
|
15
10
|
};
|
|
@@ -23,6 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
/* eslint-disable react/jsx-no-bind */
|
|
26
27
|
var react_1 = __importStar(require("react"));
|
|
27
28
|
var react_hook_form_1 = require("react-hook-form");
|
|
28
29
|
var react_i18next_1 = require("react-i18next");
|
|
@@ -47,6 +48,16 @@ function TextField(_a) {
|
|
|
47
48
|
var _q = (0, react_hook_form_1.useFormContext)(), register = _q.register, trigger = _q.trigger, errors = _q.formState.errors;
|
|
48
49
|
var _r = register(name, validation), validateOnChange = _r.onChange, validateOnBlur = _r.onBlur;
|
|
49
50
|
var isError = Object.keys(errors).some(function (error) { return error === name; });
|
|
51
|
+
var handleClickIBtn1 = function () {
|
|
52
|
+
if (onClickIBtn1) {
|
|
53
|
+
onClickIBtn1();
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
var handleClickIBtn2 = function () {
|
|
57
|
+
if (onClickIBtn2) {
|
|
58
|
+
onClickIBtn2();
|
|
59
|
+
}
|
|
60
|
+
};
|
|
50
61
|
function handleFocus() {
|
|
51
62
|
if (state !== 'read_only') {
|
|
52
63
|
setIsFocused(true);
|
|
@@ -98,12 +109,12 @@ function TextField(_a) {
|
|
|
98
109
|
{
|
|
99
110
|
none: iconThemeColorNoneObj[state],
|
|
100
111
|
dark: iconThemeColorDarkObj[state]
|
|
101
|
-
}[colorTheme], iconFillType: iBtn2IconFillType === 'fill' ? 'fill' : 'line', state: state === 'disabled' ? 'disabled' : 'normal', onClick:
|
|
112
|
+
}[colorTheme], iconFillType: iBtn2IconFillType === 'fill' ? 'fill' : 'line', state: state === 'disabled' ? 'disabled' : 'normal', onClick: handleClickIBtn2 })),
|
|
102
113
|
iBtn1IconName && (react_1.default.createElement(IconButton_1.IconButton, { iconName: iBtn1IconName, baseSize: "small", shapeType: "rectangle", baseColorKey: "ui_cpnt_button_fill_base_transparent", iconSize: size === 'large' || size === 'rlarge' ? 20 : 16, iconColorKey: colorTheme &&
|
|
103
114
|
{
|
|
104
115
|
none: iconThemeColorNoneObj[state],
|
|
105
116
|
dark: iconThemeColorDarkObj[state]
|
|
106
|
-
}[colorTheme], iconFillType: iBtn1IconFillType === 'fill' ? 'fill' : 'line', state: state === 'disabled' ? 'disabled' : 'normal', onClick:
|
|
117
|
+
}[colorTheme], iconFillType: iBtn1IconFillType === 'fill' ? 'fill' : 'line', state: state === 'disabled' ? 'disabled' : 'normal', onClick: handleClickIBtn1 })))));
|
|
107
118
|
}
|
|
108
119
|
};
|
|
109
120
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
import { uiColors } from '../../../common';
|
|
4
|
-
export declare type UiColors = keyof typeof uiColors;
|
|
2
|
+
import { PDSTextType, UiColors } from '../../../common';
|
|
5
3
|
export declare type TextLabelProps = {
|
|
6
|
-
text:
|
|
4
|
+
text: PDSTextType;
|
|
7
5
|
textAlign?: 'left' | 'center' | 'right';
|
|
8
6
|
styleTheme?: 'displayBold' | 'headingBold' | 'leadParaBold' | 'leadParaRegular' | 'subTitleBold' | 'subTitleRegular' | 'body1Bold' | 'body1Regular' | 'body2Bold' | 'body2Regular' | 'caption1Bold' | 'caption1Regular' | 'caption2Bold' | 'caption2Regular' | 'form1Regular' | 'form2Regular' | 'blog1Regular';
|
|
9
7
|
colorOverride?: UiColors;
|
|
@@ -33,6 +33,11 @@ var hybrid_1 = require("../../../hybrid");
|
|
|
33
33
|
var types_1 = require("./types");
|
|
34
34
|
function UploadIconButton(_a) {
|
|
35
35
|
var _b = _a.fillType, fillType = _b === void 0 ? 'fill' : _b, _c = _a.shapeType, shapeType = _c === void 0 ? 'rectangle' : _c, _d = _a.baseSize, baseSize = _d === void 0 ? 'small' : _d, baseColorKey = _a.baseColorKey, borderColorKey = _a.borderColorKey, _e = _a.iconSize, iconSize = _e === void 0 ? 24 : _e, _f = _a.iconFillType, iconFillType = _f === void 0 ? 'line' : _f, _g = _a.iconName, iconName = _g === void 0 ? 'ic_upload' : _g, iconColorKey = _a.iconColorKey, _h = _a.shadow, shadow = _h === void 0 ? 'hidden' : _h, _j = _a.colorTheme, colorTheme = _j === void 0 ? 'none' : _j, _k = _a.state, state = _k === void 0 ? 'normal' : _k, _l = _a.accept, accept = _l === void 0 ? '*' : _l, _m = _a.multipleMode, multipleMode = _m === void 0 ? 'none' : _m, onClick = _a.onClick;
|
|
36
|
+
var handleClick = function (e) {
|
|
37
|
+
if (onClick) {
|
|
38
|
+
onClick(e);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
36
41
|
var IconColorSelect = function () {
|
|
37
42
|
if (state === 'disabled') {
|
|
38
43
|
return 'ui_cpnt_button_icon_disabled';
|
|
@@ -46,7 +51,7 @@ function UploadIconButton(_a) {
|
|
|
46
51
|
return types_1.iconStateColors[fillType];
|
|
47
52
|
};
|
|
48
53
|
return (react_1.default.createElement(S_UploadIconButton, { fillType: fillType, shapeType: shapeType, baseSize: baseSize, baseColorKey: baseColorKey, borderColorKey: borderColorKey, shadow: shadow, colorTheme: colorTheme, isDisabled: state === 'disabled' },
|
|
49
|
-
react_1.default.createElement("input", { type: "file", hidden: true, disabled: state === 'disabled', accept: accept, multiple: multipleMode === 'use', onChange:
|
|
54
|
+
react_1.default.createElement("input", { type: "file", hidden: true, disabled: state === 'disabled', accept: accept, multiple: multipleMode === 'use', onChange: handleClick }),
|
|
50
55
|
react_1.default.createElement(hybrid_1.Icon, { iconName: iconName, size: iconSize, colorKey: IconColorSelect(), fillType: iconFillType })));
|
|
51
56
|
}
|
|
52
57
|
var fillDisabled = (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: ", ";\n"], ["\n background-color: ", ";\n"])), function (_a) {
|