Skip to content

Commit c9d1b1c

Browse files
committed
fixup! fixup! fixup! fixup! Create InputGroup component (#430)
1 parent 58542b8 commit c9d1b1c

File tree

4 files changed

+18
-9
lines changed

4 files changed

+18
-9
lines changed

src/lib/components/Button/Button.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ export const Button = React.forwardRef((props, ref) => {
5656
),
5757
getRootLabelVisibilityClassName(labelVisibility, styles),
5858
resolveContextOrProp(buttonGroupContext && buttonGroupContext.block, block) && styles.isRootBlock,
59-
primaryContext && styles.isRootGrouped,
59+
buttonGroupContext && styles.isRootInButtonGroup,
60+
inputGroupContext && styles.isRootInInputGroup,
6061
feedbackIcon && styles.hasRootFeedback,
6162
)}
6263
disabled={resolveContextOrProp(buttonGroupContext && buttonGroupContext.disabled, disabled) || !!feedbackIcon}

src/lib/components/Button/_base.scss

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@
7676
color: transparent;
7777
}
7878

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

8283
&:not(:first-child) {
@@ -96,8 +97,10 @@
9697
}
9798
}
9899

99-
.isRootGrouped .startCorner,
100-
.isRootGrouped .endCorner {
100+
.isRootInButtonGroup .startCorner,
101+
.isRootInInputGroup .startCorner,
102+
.isRootInButtonGroup .endCorner,
103+
.isRootInInputGroup .endCorner {
101104
z-index: map.get(settings.$group-z-indexes, button-overflowing-elements);
102105
}
103106

src/lib/components/Button/_priorities.scss

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@
135135
@include tools.button-color(flat, dark);
136136
}
137137

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

150-
.isRootPriorityFilled.isRootGrouped:not(:first-child) {
150+
.isRootPriorityFilled.isRootInButtonGroup:not(:first-child) {
151151
--rui-local-gap: #{theme.$group-filled-gap};
152152
--rui-local-separator-width: #{theme.$group-filled-separator-width};
153153
--rui-local-separator-color: #{theme.$group-filled-separator-color};
154154
}
155155

156-
.isRootPriorityFlat.isRootGrouped:not(:first-child) {
156+
.isRootPriorityFlat.isRootInButtonGroup:not(:first-child) {
157157
--rui-local-gap: #{theme.$group-flat-gap};
158158
--rui-local-separator-width: #{theme.$group-flat-separator-width};
159159
--rui-local-separator-color: #{theme.$group-flat-separator-color};
160160
}
161161

162-
.isRootPriorityOutline.isRootGrouped:not(:first-child) {
162+
.isRootPriorityOutline.isRootInButtonGroup:not(:first-child) {
163163
--rui-local-gap: #{theme.$group-outline-gap};
164164
}

src/lib/components/FormLayout/README.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import {
2727
ToolbarItem,
2828
FormLayout,
2929
FormLayoutCustomField,
30+
InputGroup,
3031
} from '../..'
3132

3233
## Basic Usage
@@ -441,6 +442,10 @@ This is a demo of all components supported by FormLayout.
441442
options={options}
442443
value={fruit}
443444
/>
445+
<InputGroup label="Promo code">
446+
<TextField label="Promo code" />
447+
<Button label="Submit" />
448+
</InputGroup>
444449
</FormLayout>
445450
</div>
446451
)

0 commit comments

Comments
 (0)