@jsenv/navi 0.9.1 → 0.9.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.
@@ -22296,6 +22296,7 @@ const FormBasic = forwardRef((props, ref) => {
22296
22296
  const {
22297
22297
  readOnly,
22298
22298
  loading,
22299
+ style,
22299
22300
  children,
22300
22301
  ...rest
22301
22302
  } = props;
@@ -22312,9 +22313,14 @@ const FormBasic = forwardRef((props, ref) => {
22312
22313
  loading
22313
22314
  };
22314
22315
  }, [loading]);
22316
+ const {
22317
+ all
22318
+ } = useLayoutStyle(rest);
22319
+ const innerStyle = withPropsStyle(all, style);
22315
22320
  return jsx("form", {
22316
22321
  ...rest,
22317
22322
  ref: innerRef,
22323
+ style: innerStyle,
22318
22324
  onReset: e => {
22319
22325
  // browser would empty all fields to their default values (likely empty/unchecked)
22320
22326
  // we want to reset to the last known external state instead
@@ -28230,12 +28236,13 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
28230
28236
  }
28231
28237
  `;
28232
28238
  const Text = ({
28233
- children,
28234
28239
  color,
28235
28240
  bold,
28236
28241
  italic,
28237
28242
  underline,
28243
+ size,
28238
28244
  style,
28245
+ children,
28239
28246
  ...rest
28240
28247
  }) => {
28241
28248
  const {
@@ -28246,6 +28253,7 @@ const Text = ({
28246
28253
  color,
28247
28254
  fontWeight: bold ? "bold" : undefined,
28248
28255
  fontStyle: italic ? "italic" : undefined,
28256
+ fontSize: size,
28249
28257
  textDecoration: underline ? "underline" : undefined
28250
28258
  }, style);
28251
28259
  return jsx("span", {
@@ -28255,23 +28263,21 @@ const Text = ({
28255
28263
  children: children
28256
28264
  });
28257
28265
  };
28258
- const alignYMapping = {
28259
- start: "flex-start",
28260
- center: "center",
28261
- end: "flex-end"
28262
- };
28263
28266
  const Icon = ({
28264
- alignY,
28267
+ color,
28268
+ size,
28265
28269
  style,
28266
28270
  children,
28267
28271
  ...rest
28268
28272
  }) => {
28269
- const innerStyle = {
28270
- ...style
28271
- };
28272
- if (alignY !== "center") {
28273
- innerStyle["--align-y"] = alignYMapping[alignY];
28274
- }
28273
+ const {
28274
+ all
28275
+ } = useLayoutStyle(rest);
28276
+ const innerStyle = withPropsStyle({
28277
+ ...all,
28278
+ color,
28279
+ fontSize: size
28280
+ }, style);
28275
28281
  return jsx("span", {
28276
28282
  ...rest,
28277
28283
  className: "navi_icon",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/navi",
3
- "version": "0.9.1",
3
+ "version": "0.9.2",
4
4
  "description": "Library of components including navigation to create frontend applications",
5
5
  "repository": {
6
6
  "type": "git",
@@ -25,6 +25,8 @@ import {
25
25
  import { renderActionableComponent } from "../action_execution/render_actionable_component.jsx";
26
26
  import { useActionBoundToOneParam } from "../action_execution/use_action.js";
27
27
  import { useExecuteAction } from "../action_execution/use_execute_action.js";
28
+ import { useLayoutStyle } from "../layout/use_layout_style.js";
29
+ import { withPropsStyle } from "../props_composition/with_props_style.js";
28
30
  import { collectFormElementValues } from "./collect_form_element_values.js";
29
31
  import {
30
32
  useActionEvents,
@@ -75,7 +77,7 @@ export const Form = forwardRef((props, ref) => {
75
77
 
76
78
  const FormBasic = forwardRef((props, ref) => {
77
79
  const uiStateController = useContext(UIStateControllerContext);
78
- const { readOnly, loading, children, ...rest } = props;
80
+ const { readOnly, loading, style, children, ...rest } = props;
79
81
  const innerRef = useRef();
80
82
  useImperativeHandle(ref, () => innerRef.current);
81
83
 
@@ -90,10 +92,14 @@ const FormBasic = forwardRef((props, ref) => {
90
92
  return { loading };
91
93
  }, [loading]);
92
94
 
95
+ const { all } = useLayoutStyle(rest);
96
+ const innerStyle = withPropsStyle(all, style);
97
+
93
98
  return (
94
99
  <form
95
100
  {...rest}
96
101
  ref={innerRef}
102
+ style={innerStyle}
97
103
  onReset={(e) => {
98
104
  // browser would empty all fields to their default values (likely empty/unchecked)
99
105
  // we want to reset to the last known external state instead
@@ -25,12 +25,13 @@ import.meta.css = /* css */ `
25
25
  `;
26
26
 
27
27
  export const Text = ({
28
- children,
29
28
  color,
30
29
  bold,
31
30
  italic,
32
31
  underline,
32
+ size,
33
33
  style,
34
+ children,
34
35
  ...rest
35
36
  }) => {
36
37
  const { all } = useLayoutStyle(rest);
@@ -40,6 +41,7 @@ export const Text = ({
40
41
  color,
41
42
  fontWeight: bold ? "bold" : undefined,
42
43
  fontStyle: italic ? "italic" : undefined,
44
+ fontSize: size,
43
45
  textDecoration: underline ? "underline" : undefined,
44
46
  },
45
47
  style,
@@ -52,16 +54,16 @@ export const Text = ({
52
54
  );
53
55
  };
54
56
 
55
- const alignYMapping = {
56
- start: "flex-start",
57
- center: "center",
58
- end: "flex-end",
59
- };
60
- export const Icon = ({ alignY, style, children, ...rest }) => {
61
- const innerStyle = { ...style };
62
- if (alignY !== "center") {
63
- innerStyle["--align-y"] = alignYMapping[alignY];
64
- }
57
+ export const Icon = ({ color, size, style, children, ...rest }) => {
58
+ const { all } = useLayoutStyle(rest);
59
+ const innerStyle = withPropsStyle(
60
+ {
61
+ ...all,
62
+ color,
63
+ fontSize: size,
64
+ },
65
+ style,
66
+ );
65
67
 
66
68
  return (
67
69
  <span {...rest} className="navi_icon" style={innerStyle}>