Skip to content

Commit

Permalink
fixup! fixup! fixup! fixup! Create InputGroup component (#430)
Browse files Browse the repository at this point in the history
  • Loading branch information
dacerondrej committed Mar 3, 2023
1 parent 58542b8 commit c9d1b1c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/lib/components/Button/Button.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ export const Button = React.forwardRef((props, ref) => {
),
getRootLabelVisibilityClassName(labelVisibility, styles),
resolveContextOrProp(buttonGroupContext && buttonGroupContext.block, block) && styles.isRootBlock,
primaryContext && styles.isRootGrouped,
buttonGroupContext && styles.isRootInButtonGroup,
inputGroupContext && styles.isRootInInputGroup,
feedbackIcon && styles.hasRootFeedback,
)}
disabled={resolveContextOrProp(buttonGroupContext && buttonGroupContext.disabled, disabled) || !!feedbackIcon}
Expand Down
9 changes: 6 additions & 3 deletions src/lib/components/Button/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@
color: transparent;
}

.isRootGrouped {
.isRootInButtonGroup,
.isRootInInputGroup {
z-index: map.get(settings.$group-z-indexes, button);

&:not(:first-child) {
Expand All @@ -96,8 +97,10 @@
}
}

.isRootGrouped .startCorner,
.isRootGrouped .endCorner {
.isRootInButtonGroup .startCorner,
.isRootInInputGroup .startCorner,
.isRootInButtonGroup .endCorner,
.isRootInInputGroup .endCorner {
z-index: map.get(settings.$group-z-indexes, button-overflowing-elements);
}

Expand Down
10 changes: 5 additions & 5 deletions src/lib/components/Button/_priorities.scss
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@
@include tools.button-color(flat, dark);
}

.isRootPriorityFilled.isRootGrouped:not(:first-child)::before,
.isRootPriorityFlat.isRootGrouped:not(:first-child)::before {
.isRootPriorityFilled.isRootInButtonGroup:not(:first-child)::before,
.isRootPriorityFlat.isRootInButtonGroup:not(:first-child)::before {
content: "";
position: absolute;
top: calc(-1 * #{theme.$border-width});
Expand All @@ -147,18 +147,18 @@
transform: translateX(calc(-0.5 * var(--rui-local-gap) - 50%));
}

.isRootPriorityFilled.isRootGrouped:not(:first-child) {
.isRootPriorityFilled.isRootInButtonGroup:not(:first-child) {
--rui-local-gap: #{theme.$group-filled-gap};
--rui-local-separator-width: #{theme.$group-filled-separator-width};
--rui-local-separator-color: #{theme.$group-filled-separator-color};
}

.isRootPriorityFlat.isRootGrouped:not(:first-child) {
.isRootPriorityFlat.isRootInButtonGroup:not(:first-child) {
--rui-local-gap: #{theme.$group-flat-gap};
--rui-local-separator-width: #{theme.$group-flat-separator-width};
--rui-local-separator-color: #{theme.$group-flat-separator-color};
}

.isRootPriorityOutline.isRootGrouped:not(:first-child) {
.isRootPriorityOutline.isRootInButtonGroup:not(:first-child) {
--rui-local-gap: #{theme.$group-outline-gap};
}
5 changes: 5 additions & 0 deletions src/lib/components/FormLayout/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
ToolbarItem,
FormLayout,
FormLayoutCustomField,
InputGroup,
} from '../..'

## Basic Usage
Expand Down Expand Up @@ -441,6 +442,10 @@ This is a demo of all components supported by FormLayout.
options={options}
value={fruit}
/>
<InputGroup label="Promo code">
<TextField label="Promo code" />
<Button label="Submit" />
</InputGroup>
</FormLayout>
</div>
)
Expand Down

0 comments on commit c9d1b1c

Please sign in to comment.