@jsenv/navi 0.6.0 → 0.6.2
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/jsenv_navi.js +88 -60
- package/package.json +1 -1
- package/src/components/field/button.jsx +25 -15
- package/src/components/field/input_checkbox.jsx +2 -2
- package/src/components/field/input_radio.jsx +2 -2
- package/src/components/field/input_textual.jsx +2 -2
- package/src/components/layout/spacing.jsx +63 -44
- package/src/components/text/text.jsx +15 -2
package/dist/jsenv_navi.js
CHANGED
|
@@ -18593,60 +18593,75 @@ const parseStyleString = (styleString) => {
|
|
|
18593
18593
|
return style;
|
|
18594
18594
|
};
|
|
18595
18595
|
|
|
18596
|
-
const
|
|
18597
|
-
|
|
18598
|
-
|
|
18599
|
-
|
|
18600
|
-
|
|
18601
|
-
|
|
18602
|
-
|
|
18603
|
-
|
|
18604
|
-
|
|
18605
|
-
|
|
18606
|
-
|
|
18607
|
-
|
|
18608
|
-
|
|
18609
|
-
|
|
18610
|
-
|
|
18611
|
-
|
|
18596
|
+
const consumeSpacingProps = props => {
|
|
18597
|
+
const consume = name => {
|
|
18598
|
+
if (Object.hasOwn(props, name)) {
|
|
18599
|
+
const value = props[name];
|
|
18600
|
+
delete props[name];
|
|
18601
|
+
return value;
|
|
18602
|
+
}
|
|
18603
|
+
return undefined;
|
|
18604
|
+
};
|
|
18605
|
+
const margin = consume("margin");
|
|
18606
|
+
const marginX = consume("marginX");
|
|
18607
|
+
const marginY = consume("marginY");
|
|
18608
|
+
const marginLeft = consume("marginLeft");
|
|
18609
|
+
const marginRight = consume("marginRight");
|
|
18610
|
+
const marginTop = consume("marginTop");
|
|
18611
|
+
const marginBottom = consume("marginBottom");
|
|
18612
18612
|
const style = {};
|
|
18613
18613
|
if (margin !== undefined) {
|
|
18614
18614
|
style.margin = margin;
|
|
18615
18615
|
}
|
|
18616
|
-
|
|
18617
|
-
|
|
18618
|
-
|
|
18619
|
-
|
|
18620
|
-
|
|
18621
|
-
|
|
18622
|
-
|
|
18623
|
-
if (
|
|
18624
|
-
style.marginRight =
|
|
18625
|
-
}
|
|
18626
|
-
if (
|
|
18627
|
-
style.marginTop =
|
|
18628
|
-
}
|
|
18629
|
-
|
|
18630
|
-
|
|
18631
|
-
|
|
18616
|
+
if (marginLeft !== undefined) {
|
|
18617
|
+
style.marginLeft = marginLeft;
|
|
18618
|
+
} else if (marginX !== undefined) {
|
|
18619
|
+
style.marginLeft = marginX;
|
|
18620
|
+
}
|
|
18621
|
+
if (marginRight !== undefined) {
|
|
18622
|
+
style.marginRight = marginRight;
|
|
18623
|
+
} else if (marginX !== undefined) {
|
|
18624
|
+
style.marginRight = marginX;
|
|
18625
|
+
}
|
|
18626
|
+
if (marginTop !== undefined) {
|
|
18627
|
+
style.marginTop = marginTop;
|
|
18628
|
+
} else if (marginY !== undefined) {
|
|
18629
|
+
style.marginTop = marginY;
|
|
18630
|
+
}
|
|
18631
|
+
if (marginBottom !== undefined) {
|
|
18632
|
+
style.marginBottom = marginBottom;
|
|
18633
|
+
} else if (marginY !== undefined) {
|
|
18634
|
+
style.marginBottom = marginY;
|
|
18635
|
+
}
|
|
18636
|
+
const padding = consume("padding");
|
|
18637
|
+
const paddingX = consume("paddingX");
|
|
18638
|
+
const paddingY = consume("paddingY");
|
|
18639
|
+
const paddingLeft = consume("paddingLeft");
|
|
18640
|
+
const paddingRight = consume("paddingRight");
|
|
18641
|
+
const paddingTop = consume("paddingTop");
|
|
18642
|
+
const paddingBottom = consume("paddingBottom");
|
|
18632
18643
|
if (padding !== undefined) {
|
|
18633
18644
|
style.padding = padding;
|
|
18634
18645
|
}
|
|
18635
|
-
|
|
18636
|
-
|
|
18637
|
-
|
|
18638
|
-
|
|
18639
|
-
if (effectivePaddingLeft !== undefined) {
|
|
18640
|
-
style.paddingLeft = effectivePaddingLeft;
|
|
18646
|
+
if (paddingLeft !== undefined) {
|
|
18647
|
+
style.paddingLeft = paddingLeft;
|
|
18648
|
+
} else if (paddingX !== undefined) {
|
|
18649
|
+
style.paddingLeft = paddingX;
|
|
18641
18650
|
}
|
|
18642
|
-
if (
|
|
18643
|
-
style.paddingRight =
|
|
18651
|
+
if (paddingRight !== undefined) {
|
|
18652
|
+
style.paddingRight = paddingRight;
|
|
18653
|
+
} else if (paddingX !== undefined) {
|
|
18654
|
+
style.paddingRight = paddingX;
|
|
18644
18655
|
}
|
|
18645
|
-
if (
|
|
18646
|
-
style.paddingTop =
|
|
18656
|
+
if (paddingTop !== undefined) {
|
|
18657
|
+
style.paddingTop = paddingTop;
|
|
18658
|
+
} else if (paddingY !== undefined) {
|
|
18659
|
+
style.paddingTop = paddingY;
|
|
18647
18660
|
}
|
|
18648
|
-
if (
|
|
18649
|
-
style.paddingBottom =
|
|
18661
|
+
if (paddingBottom !== undefined) {
|
|
18662
|
+
style.paddingBottom = paddingBottom;
|
|
18663
|
+
} else if (paddingY !== undefined) {
|
|
18664
|
+
style.paddingBottom = paddingY;
|
|
18650
18665
|
}
|
|
18651
18666
|
return style;
|
|
18652
18667
|
};
|
|
@@ -18655,8 +18670,9 @@ const Spacing = ({
|
|
|
18655
18670
|
children,
|
|
18656
18671
|
...rest
|
|
18657
18672
|
}) => {
|
|
18658
|
-
const styleForSpacing =
|
|
18673
|
+
const styleForSpacing = consumeSpacingProps(rest);
|
|
18659
18674
|
return jsx("div", {
|
|
18675
|
+
...rest,
|
|
18660
18676
|
style: withPropsStyle(styleForSpacing, style),
|
|
18661
18677
|
children: children
|
|
18662
18678
|
});
|
|
@@ -20217,7 +20233,7 @@ const NaviCheckbox = ({
|
|
|
20217
20233
|
...(accentColor ? {
|
|
20218
20234
|
"--accent-color": accentColor
|
|
20219
20235
|
} : {}),
|
|
20220
|
-
...
|
|
20236
|
+
...consumeSpacingProps(rest)
|
|
20221
20237
|
}, style);
|
|
20222
20238
|
return jsxs("div", {
|
|
20223
20239
|
...rest,
|
|
@@ -20642,7 +20658,7 @@ const NaviRadio = ({
|
|
|
20642
20658
|
...(accentColor ? {
|
|
20643
20659
|
"--accent-color": accentColor
|
|
20644
20660
|
} : {}),
|
|
20645
|
-
...
|
|
20661
|
+
...consumeSpacingProps(rest)
|
|
20646
20662
|
}, style);
|
|
20647
20663
|
return jsxs("span", {
|
|
20648
20664
|
...rest,
|
|
@@ -20863,7 +20879,7 @@ const InputTextualBasic = forwardRef((props, ref) => {
|
|
|
20863
20879
|
const innerStyle = withPropsStyle({
|
|
20864
20880
|
width,
|
|
20865
20881
|
height,
|
|
20866
|
-
...
|
|
20882
|
+
...consumeSpacingProps(rest)
|
|
20867
20883
|
}, style);
|
|
20868
20884
|
const inputTextual = jsx("input", {
|
|
20869
20885
|
...rest,
|
|
@@ -21544,11 +21560,6 @@ const Button = forwardRef((props, ref) => {
|
|
|
21544
21560
|
WithActionInsideForm: ButtonWithActionInsideForm
|
|
21545
21561
|
});
|
|
21546
21562
|
});
|
|
21547
|
-
const alignXMapping = {
|
|
21548
|
-
start: undefined,
|
|
21549
|
-
center: "center",
|
|
21550
|
-
end: "flex-end"
|
|
21551
|
-
};
|
|
21552
21563
|
const ButtonBasic = forwardRef((props, ref) => {
|
|
21553
21564
|
const contextLoading = useContext(LoadingContext);
|
|
21554
21565
|
const contextLoadingElement = useContext(LoadingElementContext);
|
|
@@ -21585,15 +21596,23 @@ const ButtonBasic = forwardRef((props, ref) => {
|
|
|
21585
21596
|
} else {
|
|
21586
21597
|
buttonChildren = children;
|
|
21587
21598
|
}
|
|
21588
|
-
const
|
|
21589
|
-
|
|
21590
|
-
|
|
21591
|
-
|
|
21599
|
+
const innerClassName = withPropsClassName(appearance === "navi" ? "navi_button" : undefined, className);
|
|
21600
|
+
const innerStyle = withPropsStyle({
|
|
21601
|
+
...consumeSpacingProps(rest),
|
|
21602
|
+
...(alignX === "start" ? {} : alignX === "center" ? {
|
|
21603
|
+
alignSelf: "center",
|
|
21604
|
+
marginLeft: "auto",
|
|
21605
|
+
marginRight: "auto"
|
|
21606
|
+
} : {
|
|
21607
|
+
alignSelf: "end",
|
|
21608
|
+
marginLeft: "auto"
|
|
21609
|
+
})
|
|
21610
|
+
}, style);
|
|
21592
21611
|
return jsx("button", {
|
|
21593
21612
|
...rest,
|
|
21594
21613
|
ref: innerRef,
|
|
21595
|
-
className:
|
|
21596
|
-
style:
|
|
21614
|
+
className: innerClassName,
|
|
21615
|
+
style: innerStyle,
|
|
21597
21616
|
disabled: innerDisabled,
|
|
21598
21617
|
"data-discrete": discrete ? "" : undefined,
|
|
21599
21618
|
"data-readonly": innerReadOnly ? "" : undefined,
|
|
@@ -28034,6 +28053,7 @@ const Text = ({
|
|
|
28034
28053
|
italic,
|
|
28035
28054
|
underline,
|
|
28036
28055
|
style,
|
|
28056
|
+
alignX,
|
|
28037
28057
|
...rest
|
|
28038
28058
|
}) => {
|
|
28039
28059
|
const innerStyle = withPropsStyle({
|
|
@@ -28041,7 +28061,15 @@ const Text = ({
|
|
|
28041
28061
|
fontWeight: bold ? "bold" : undefined,
|
|
28042
28062
|
fontStyle: italic ? "italic" : undefined,
|
|
28043
28063
|
textDecoration: underline ? "underline" : undefined,
|
|
28044
|
-
...
|
|
28064
|
+
...consumeSpacingProps(rest),
|
|
28065
|
+
...(alignX === "start" ? {} : alignX === "center" ? {
|
|
28066
|
+
alignSelf: "center",
|
|
28067
|
+
marginLeft: "auto",
|
|
28068
|
+
marginRight: "auto"
|
|
28069
|
+
} : {
|
|
28070
|
+
alignSelf: "end",
|
|
28071
|
+
marginLeft: "auto"
|
|
28072
|
+
})
|
|
28045
28073
|
}, style);
|
|
28046
28074
|
return jsx("span", {
|
|
28047
28075
|
...rest,
|
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@ import { FormActionContext } from "../action_execution/form_context.js";
|
|
|
14
14
|
import { renderActionableComponent } from "../action_execution/render_actionable_component.jsx";
|
|
15
15
|
import { useAction } from "../action_execution/use_action.js";
|
|
16
16
|
import { useExecuteAction } from "../action_execution/use_execute_action.js";
|
|
17
|
-
import {
|
|
17
|
+
import { consumeSpacingProps } from "../layout/spacing.jsx";
|
|
18
18
|
import { LoaderBackground } from "../loader/loader_background.jsx";
|
|
19
19
|
import { withPropsClassName } from "../props_composition/with_props_class_name.js";
|
|
20
20
|
import { withPropsStyle } from "../props_composition/with_props_style.js";
|
|
@@ -197,11 +197,6 @@ export const Button = forwardRef((props, ref) => {
|
|
|
197
197
|
});
|
|
198
198
|
});
|
|
199
199
|
|
|
200
|
-
const alignXMapping = {
|
|
201
|
-
start: undefined,
|
|
202
|
-
center: "center",
|
|
203
|
-
end: "flex-end",
|
|
204
|
-
};
|
|
205
200
|
const ButtonBasic = forwardRef((props, ref) => {
|
|
206
201
|
const contextLoading = useContext(LoadingContext);
|
|
207
202
|
const contextLoadingElement = useContext(LoadingElementContext);
|
|
@@ -241,20 +236,35 @@ const ButtonBasic = forwardRef((props, ref) => {
|
|
|
241
236
|
buttonChildren = children;
|
|
242
237
|
}
|
|
243
238
|
|
|
244
|
-
const
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
239
|
+
const innerClassName = withPropsClassName(
|
|
240
|
+
appearance === "navi" ? "navi_button" : undefined,
|
|
241
|
+
className,
|
|
242
|
+
);
|
|
243
|
+
const innerStyle = withPropsStyle(
|
|
244
|
+
{
|
|
245
|
+
...consumeSpacingProps(rest),
|
|
246
|
+
...(alignX === "start"
|
|
247
|
+
? {}
|
|
248
|
+
: alignX === "center"
|
|
249
|
+
? {
|
|
250
|
+
alignSelf: "center",
|
|
251
|
+
marginLeft: "auto",
|
|
252
|
+
marginRight: "auto",
|
|
253
|
+
}
|
|
254
|
+
: {
|
|
255
|
+
alignSelf: "end",
|
|
256
|
+
marginLeft: "auto",
|
|
257
|
+
}),
|
|
258
|
+
},
|
|
259
|
+
style,
|
|
260
|
+
);
|
|
248
261
|
|
|
249
262
|
return (
|
|
250
263
|
<button
|
|
251
264
|
{...rest}
|
|
252
265
|
ref={innerRef}
|
|
253
|
-
className={
|
|
254
|
-
|
|
255
|
-
className,
|
|
256
|
-
)}
|
|
257
|
-
style={withPropsStyle(innerStyle, style)}
|
|
266
|
+
className={innerClassName}
|
|
267
|
+
style={innerStyle}
|
|
258
268
|
disabled={innerDisabled}
|
|
259
269
|
data-discrete={discrete ? "" : undefined}
|
|
260
270
|
data-readonly={innerReadOnly ? "" : undefined}
|
|
@@ -13,7 +13,7 @@ import { useConstraints } from "../../validation/hooks/use_constraints.js";
|
|
|
13
13
|
import { renderActionableComponent } from "../action_execution/render_actionable_component.jsx";
|
|
14
14
|
import { useActionBoundToOneParam } from "../action_execution/use_action.js";
|
|
15
15
|
import { useExecuteAction } from "../action_execution/use_execute_action.js";
|
|
16
|
-
import {
|
|
16
|
+
import { consumeSpacingProps } from "../layout/spacing.jsx";
|
|
17
17
|
import {
|
|
18
18
|
LoadableInlineElement,
|
|
19
19
|
LoaderBackground,
|
|
@@ -336,7 +336,7 @@ const NaviCheckbox = ({
|
|
|
336
336
|
const innerStyle = withPropsStyle(
|
|
337
337
|
{
|
|
338
338
|
...(accentColor ? { "--accent-color": accentColor } : {}),
|
|
339
|
-
...
|
|
339
|
+
...consumeSpacingProps(rest),
|
|
340
340
|
},
|
|
341
341
|
style,
|
|
342
342
|
);
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
|
|
9
9
|
import { useConstraints } from "../../validation/hooks/use_constraints.js";
|
|
10
10
|
import { renderActionableComponent } from "../action_execution/render_actionable_component.jsx";
|
|
11
|
-
import {
|
|
11
|
+
import { consumeSpacingProps } from "../layout/spacing.jsx";
|
|
12
12
|
import {
|
|
13
13
|
LoadableInlineElement,
|
|
14
14
|
LoaderBackground,
|
|
@@ -375,7 +375,7 @@ const NaviRadio = ({
|
|
|
375
375
|
const innerStyle = withPropsStyle(
|
|
376
376
|
{
|
|
377
377
|
...(accentColor ? { "--accent-color": accentColor } : {}),
|
|
378
|
-
...
|
|
378
|
+
...consumeSpacingProps(rest),
|
|
379
379
|
},
|
|
380
380
|
style,
|
|
381
381
|
);
|
|
@@ -31,7 +31,7 @@ import { useConstraints } from "../../validation/hooks/use_constraints.js";
|
|
|
31
31
|
import { renderActionableComponent } from "../action_execution/render_actionable_component.jsx";
|
|
32
32
|
import { useActionBoundToOneParam } from "../action_execution/use_action.js";
|
|
33
33
|
import { useExecuteAction } from "../action_execution/use_execute_action.js";
|
|
34
|
-
import {
|
|
34
|
+
import { consumeSpacingProps } from "../layout/spacing.jsx";
|
|
35
35
|
import { LoadableInlineElement } from "../loader/loader_background.jsx";
|
|
36
36
|
import { withPropsClassName } from "../props_composition/with_props_class_name.js";
|
|
37
37
|
import { withPropsStyle } from "../props_composition/with_props_style.js";
|
|
@@ -203,7 +203,7 @@ const InputTextualBasic = forwardRef((props, ref) => {
|
|
|
203
203
|
{
|
|
204
204
|
width,
|
|
205
205
|
height,
|
|
206
|
-
...
|
|
206
|
+
...consumeSpacingProps(rest),
|
|
207
207
|
},
|
|
208
208
|
style,
|
|
209
209
|
);
|
|
@@ -1,68 +1,87 @@
|
|
|
1
1
|
import { withPropsStyle } from "../props_composition/with_props_style.js";
|
|
2
2
|
|
|
3
|
-
export const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const style = {};
|
|
3
|
+
export const consumeSpacingProps = (props) => {
|
|
4
|
+
const consume = (name) => {
|
|
5
|
+
if (Object.hasOwn(props, name)) {
|
|
6
|
+
const value = props[name];
|
|
7
|
+
delete props[name];
|
|
8
|
+
return value;
|
|
9
|
+
}
|
|
10
|
+
return undefined;
|
|
11
|
+
};
|
|
12
|
+
const margin = consume("margin");
|
|
13
|
+
const marginX = consume("marginX");
|
|
14
|
+
const marginY = consume("marginY");
|
|
15
|
+
const marginLeft = consume("marginLeft");
|
|
16
|
+
const marginRight = consume("marginRight");
|
|
17
|
+
const marginTop = consume("marginTop");
|
|
18
|
+
const marginBottom = consume("marginBottom");
|
|
20
19
|
|
|
20
|
+
const style = {};
|
|
21
21
|
if (margin !== undefined) {
|
|
22
22
|
style.margin = margin;
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
if (effectiveMarginLeft !== undefined) {
|
|
30
|
-
style.marginLeft = effectiveMarginLeft;
|
|
24
|
+
if (marginLeft !== undefined) {
|
|
25
|
+
style.marginLeft = marginLeft;
|
|
26
|
+
} else if (marginX !== undefined) {
|
|
27
|
+
style.marginLeft = marginX;
|
|
31
28
|
}
|
|
32
|
-
if (
|
|
33
|
-
style.marginRight =
|
|
29
|
+
if (marginRight !== undefined) {
|
|
30
|
+
style.marginRight = marginRight;
|
|
31
|
+
} else if (marginX !== undefined) {
|
|
32
|
+
style.marginRight = marginX;
|
|
34
33
|
}
|
|
35
|
-
if (
|
|
36
|
-
style.marginTop =
|
|
34
|
+
if (marginTop !== undefined) {
|
|
35
|
+
style.marginTop = marginTop;
|
|
36
|
+
} else if (marginY !== undefined) {
|
|
37
|
+
style.marginTop = marginY;
|
|
37
38
|
}
|
|
38
|
-
if (
|
|
39
|
-
style.marginBottom =
|
|
39
|
+
if (marginBottom !== undefined) {
|
|
40
|
+
style.marginBottom = marginBottom;
|
|
41
|
+
} else if (marginY !== undefined) {
|
|
42
|
+
style.marginBottom = marginY;
|
|
40
43
|
}
|
|
41
44
|
|
|
45
|
+
const padding = consume("padding");
|
|
46
|
+
const paddingX = consume("paddingX");
|
|
47
|
+
const paddingY = consume("paddingY");
|
|
48
|
+
const paddingLeft = consume("paddingLeft");
|
|
49
|
+
const paddingRight = consume("paddingRight");
|
|
50
|
+
const paddingTop = consume("paddingTop");
|
|
51
|
+
const paddingBottom = consume("paddingBottom");
|
|
52
|
+
|
|
42
53
|
if (padding !== undefined) {
|
|
43
54
|
style.padding = padding;
|
|
44
55
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
if (effectivePaddingLeft !== undefined) {
|
|
50
|
-
style.paddingLeft = effectivePaddingLeft;
|
|
56
|
+
if (paddingLeft !== undefined) {
|
|
57
|
+
style.paddingLeft = paddingLeft;
|
|
58
|
+
} else if (paddingX !== undefined) {
|
|
59
|
+
style.paddingLeft = paddingX;
|
|
51
60
|
}
|
|
52
|
-
if (
|
|
53
|
-
style.paddingRight =
|
|
61
|
+
if (paddingRight !== undefined) {
|
|
62
|
+
style.paddingRight = paddingRight;
|
|
63
|
+
} else if (paddingX !== undefined) {
|
|
64
|
+
style.paddingRight = paddingX;
|
|
54
65
|
}
|
|
55
|
-
if (
|
|
56
|
-
style.paddingTop =
|
|
66
|
+
if (paddingTop !== undefined) {
|
|
67
|
+
style.paddingTop = paddingTop;
|
|
68
|
+
} else if (paddingY !== undefined) {
|
|
69
|
+
style.paddingTop = paddingY;
|
|
57
70
|
}
|
|
58
|
-
if (
|
|
59
|
-
style.paddingBottom =
|
|
71
|
+
if (paddingBottom !== undefined) {
|
|
72
|
+
style.paddingBottom = paddingBottom;
|
|
73
|
+
} else if (paddingY !== undefined) {
|
|
74
|
+
style.paddingBottom = paddingY;
|
|
60
75
|
}
|
|
61
76
|
|
|
62
77
|
return style;
|
|
63
78
|
};
|
|
64
79
|
|
|
65
80
|
export const Spacing = ({ style, children, ...rest }) => {
|
|
66
|
-
const styleForSpacing =
|
|
67
|
-
return
|
|
81
|
+
const styleForSpacing = consumeSpacingProps(rest);
|
|
82
|
+
return (
|
|
83
|
+
<div {...rest} style={withPropsStyle(styleForSpacing, style)}>
|
|
84
|
+
{children}
|
|
85
|
+
</div>
|
|
86
|
+
);
|
|
68
87
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { consumeSpacingProps } from "../layout/spacing.jsx";
|
|
2
2
|
import { withPropsStyle } from "../props_composition/with_props_style.js";
|
|
3
3
|
|
|
4
4
|
import.meta.css = /* css */ `
|
|
@@ -31,6 +31,7 @@ export const Text = ({
|
|
|
31
31
|
italic,
|
|
32
32
|
underline,
|
|
33
33
|
style,
|
|
34
|
+
alignX,
|
|
34
35
|
...rest
|
|
35
36
|
}) => {
|
|
36
37
|
const innerStyle = withPropsStyle(
|
|
@@ -39,7 +40,19 @@ export const Text = ({
|
|
|
39
40
|
fontWeight: bold ? "bold" : undefined,
|
|
40
41
|
fontStyle: italic ? "italic" : undefined,
|
|
41
42
|
textDecoration: underline ? "underline" : undefined,
|
|
42
|
-
...
|
|
43
|
+
...consumeSpacingProps(rest),
|
|
44
|
+
...(alignX === "start"
|
|
45
|
+
? {}
|
|
46
|
+
: alignX === "center"
|
|
47
|
+
? {
|
|
48
|
+
alignSelf: "center",
|
|
49
|
+
marginLeft: "auto",
|
|
50
|
+
marginRight: "auto",
|
|
51
|
+
}
|
|
52
|
+
: {
|
|
53
|
+
alignSelf: "end",
|
|
54
|
+
marginLeft: "auto",
|
|
55
|
+
}),
|
|
43
56
|
},
|
|
44
57
|
style,
|
|
45
58
|
);
|