tycho-components 0.0.18-SNAPSHOT-7 → 0.0.18-SNAPSHOT-8

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.
@@ -96,8 +96,7 @@ export default function AppEditable({ translation, fields, item, save, group, cl
96
96
  return null;
97
97
  }
98
98
  };
99
- const getTranslation = (field) => field.translation ? field.translation : translation;
100
99
  return (_jsx(_Fragment, { children: fields.map((field, idx) => (_jsxs("div", { className: `editable-container ${className || ''}`, children: [_jsxs("div", { className: "title", children: [_jsxs("h6", { children: [field.title
101
100
  ? field.title
102
- : t(`${getTranslation(field)}:${group || ''}.field.${field.name}`), field.required && _jsx("span", { children: "*" })] }), field.tooltip && (_jsx(FontAwesomeIcon, { icon: faQuestionCircle, className: "info", title: t(`${getTranslation(field)}:${group || ''}.tooltip.${field.name}`) }))] }), renderField(field)] }, idx))) }));
101
+ : t(`${translation}:${group || ''}.field.${field.name}`), field.required && _jsx("span", { children: "*" })] }), field.tooltip && (_jsx(FontAwesomeIcon, { icon: faQuestionCircle, className: "info", title: t(`${translation}:${group || ''}.tooltip.${field.name}`) }))] }), renderField(field)] }, idx))) }));
103
102
  }
@@ -4,8 +4,8 @@ import { useTranslation } from 'react-i18next';
4
4
  import { Button, Icon } from 'tycho-storybook';
5
5
  import './style.scss';
6
6
  export default function AppModalConfirm({ title, subtitle, onClose, onConfirm, closeLabel, confirmLabel, }) {
7
- const { t } = useTranslation('header');
8
- return (_jsx(Modal, { open: true, children: _jsxs(Box, { className: "modal-container modal-remove", sx: style, children: [_jsxs("div", { className: "body", children: [_jsx(Icon, { name: "warning", size: "large", filled: true }), _jsxs("div", { className: "texts", children: [_jsx("span", { className: "title", children: title }), _jsx("span", { className: "subtitle", children: subtitle })] })] }), _jsxs("div", { className: "footer", children: [_jsx(Button, { onClick: onClose, text: closeLabel || t('modal.button.cancel'), mode: "tonal" }), _jsx(Button, { onClick: onConfirm, text: confirmLabel || t('modal.button.confirm') })] })] }) }));
7
+ const { t } = useTranslation('common');
8
+ return (_jsx(Modal, { open: true, children: _jsxs(Box, { className: "modal-container modal-confirm", sx: style, children: [_jsxs("div", { className: "body", children: [_jsx(Icon, { name: "warning", size: "large", filled: true }), _jsxs("div", { className: "texts", children: [_jsx("span", { className: "title", children: title }), _jsx("span", { className: "subtitle", children: subtitle })] })] }), _jsxs("div", { className: "footer", children: [_jsx(Button, { onClick: onClose, text: closeLabel || t('button.cancel'), mode: "tonal" }), _jsx(Button, { onClick: onConfirm, text: confirmLabel || t('button.confirm') })] })] }) }));
9
9
  }
10
10
  const style = {
11
11
  position: 'absolute',
@@ -5,7 +5,7 @@ import { Button, Icon } from 'tycho-storybook';
5
5
  import './style.scss';
6
6
  export default function AppModalRemove({ title, subtitle, onClose, onConfirm, }) {
7
7
  const { t } = useTranslation('common');
8
- return (_jsx(Modal, { open: true, children: _jsxs(Box, { className: "modal-container modal-remove", sx: modalRemoveStyle, children: [_jsx("div", { className: "body", children: _jsxs("div", { className: "line", children: [_jsx(Icon, { name: "warning", size: "large", filled: true }), _jsxs("div", { className: "texts", children: [_jsx("span", { className: "title", children: title }), _jsx("span", { className: "subtitle", children: subtitle })] })] }) }), _jsxs("div", { className: "footer", children: [_jsx(Button, { onClick: onClose, text: t('button.cancel'), mode: "tonal" }), _jsx(Button, { onClick: onConfirm, text: t('button.confirm') })] })] }) }));
8
+ return (_jsx(Modal, { open: true, children: _jsxs(Box, { className: "modal-container modal-remove", sx: modalRemoveStyle, children: [_jsxs("div", { className: "body", children: [_jsx(Icon, { name: "warning", size: "large", filled: true }), _jsxs("div", { className: "texts", children: [_jsx("span", { className: "title", children: title }), _jsx("span", { className: "subtitle", children: subtitle })] })] }), _jsxs("div", { className: "footer", children: [_jsx(Button, { onClick: onClose, text: t('button.cancel'), mode: "tonal" }), _jsx(Button, { onClick: onConfirm, text: t('button.confirm') })] })] }) }));
9
9
  }
10
10
  export const modalRemoveStyle = {
11
11
  position: 'absolute',
@@ -35,32 +35,28 @@
35
35
  padding: var(--spacing-200) var(--spacing-200) var(--spacing-150);
36
36
  }
37
37
 
38
- &.modal-remove {
38
+ &.modal-remove,
39
+ &.modal-confirm {
39
40
  .body {
40
41
  display: flex;
41
- flex-direction: column;
42
+ gap: 16px;
42
43
 
43
- > .line {
44
+ > .ds-icon {
45
+ color: var(--icon-warning);
46
+ }
47
+
48
+ .texts {
44
49
  display: flex;
45
- gap: 16px;
50
+ flex-direction: column;
46
51
 
47
- > .ds-icon {
48
- color: var(--icon-warning);
52
+ > .title {
53
+ @include subtitle-medium-2;
54
+ color: var(--text-primary);
49
55
  }
50
56
 
51
- .texts {
52
- display: flex;
53
- flex-direction: column;
54
-
55
- > .title {
56
- @include subtitle-medium-2;
57
- color: var(--text-primary);
58
- }
59
-
60
- > .subtitle {
61
- @include body-medium-1;
62
- color: var(--text-secondary);
63
- }
57
+ > .subtitle {
58
+ @include body-medium-1;
59
+ color: var(--text-secondary);
64
60
  }
65
61
  }
66
62
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tycho-components",
3
3
  "private": false,
4
- "version": "0.0.18-SNAPSHOT-7",
4
+ "version": "0.0.18-SNAPSHOT-8",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {