Skip to content

Commit

Permalink
update all usages of StudioProperty.Button to have icon vertially ali…
Browse files Browse the repository at this point in the history
…gned with label and value
  • Loading branch information
standeren committed Jan 16, 2025
1 parent 957851e commit be3ffd9
Show file tree
Hide file tree
Showing 10 changed files with 8 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,7 @@
.propertyButton.withoutNegativeMargin {
margin: 0;
}

.definedValue {
color: var(--fds-semantic-text-neutral-default);
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const StudioPropertyButton = forwardRef<HTMLButtonElement, StudioPropertyButtonP
compact && classes.compact,
readOnly && classes.readOnly,
withoutNegativeMargin && classes.withoutNegativeMargin,
givenIcon && hasValue && classes.definedValue,
givenClass,
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ export const EditActions = (): React.ReactElement => {
<StudioProperty.Button
onClick={onNewActionAddClicked}
property={t('process_editor.configuration_panel_actions_add_new')}
size='small'
/>
</>
);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { StudioProperty } from '@studio/components';
import { useTranslation } from 'react-i18next';
import { LinkIcon } from '@studio/icons';
import { SelectDataTypes } from './SelectDataTypes';
import classes from './EditDataTypes.module.css';
import { useBpmnContext } from '../../../../contexts/BpmnContext';

export type EditDataTypesProps = {
Expand All @@ -27,19 +26,12 @@ export const EditDataTypes = ({
setDataModelSelectVisible(false);
}, [bpmnDetails.id]);

const definedValueWithLinkIcon = (
<span className={classes.definedValue}>
<LinkIcon /> {existingDataTypeForTask}
</span>
);

return (
<>
{!existingDataTypeForTask && !dataModelSelectVisible ? (
<StudioProperty.Button
onClick={() => setDataModelSelectVisible(true)}
property={t('process_editor.configuration_panel_set_data_model_link')}
size='small'
icon={<LinkIcon />}
/>
) : dataModelSelectVisible ? (
Expand All @@ -55,9 +47,10 @@ export const EditDataTypes = ({
aria-label={t('process_editor.configuration_panel_set_data_model', {
dataModelName: existingDataTypeForTask,
})}
icon={<LinkIcon />}
onClick={() => setDataModelSelectVisible(true)}
property={t('process_editor.configuration_panel_set_data_model_label')}
value={definedValueWithLinkIcon}
value={existingDataTypeForTask}
/>
)}
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ export const EditUniqueFromSignaturesInDataTypes = () => {
property={t(
'process_editor.configuration_panel_set_unique_from_signatures_in_data_types_link',
)}
size='small'
icon={<PersonPencilIcon />}
/>
) : isSelectVisible ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export const CustomReceiptContent = (): React.ReactElement => {
return (
<StudioProperty.Button
onClick={openCustomReceiptFields}
size='small'
property={t('process_editor.configuration_panel_custom_receipt_create_your_own_button')}
className={classes.createButton}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

.button {
margin: var(--fds-spacing-1);
align-items: center;
padding-left: 0;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
.error {
background-color: var(--fds-semantic-surface-danger-subtle);
}

.linkIcon {
color: var(--fds-semantic-text-neutral-default);
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const DefinedBinding = ({
onClick={onClick}
property={label}
title={title}
icon={<LinkIcon className={classes.linkIcon} />}
icon={<LinkIcon />}
value={currentDataModelField}
/>
);
Expand Down

0 comments on commit be3ffd9

Please sign in to comment.