@jsenv/navi 0.7.3 → 0.9.0
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 +406 -289
- package/package.json +1 -1
- package/src/components/field/button.jsx +4 -11
- package/src/components/field/input_checkbox.jsx +3 -2
- package/src/components/field/input_radio.jsx +3 -2
- package/src/components/field/input_textual.jsx +8 -13
- package/src/components/layout/demos/demo_flex.html +304 -172
- package/src/components/layout/demos/demo_use_layout_style.html +226 -0
- package/src/components/layout/demos/demo_use_layout_style_buttons.html +260 -0
- package/src/components/layout/demos/demo_use_layout_style_text.html +514 -0
- package/src/components/layout/flex.jsx +27 -72
- package/src/components/layout/layout_context.jsx +3 -0
- package/src/components/layout/spacing.jsx +12 -90
- package/src/components/layout/use_layout_style.js +229 -0
- package/src/components/link/link.jsx +13 -2
- package/src/components/text/text.jsx +3 -15
package/package.json
CHANGED
|
@@ -14,8 +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 {
|
|
18
|
-
import { consumeSpacingProps } from "../layout/spacing.jsx";
|
|
17
|
+
import { useLayoutStyle } from "../layout/use_layout_style.js";
|
|
19
18
|
import { LoaderBackground } from "../loader/loader_background.jsx";
|
|
20
19
|
import { withPropsClassName } from "../props_composition/with_props_class_name.js";
|
|
21
20
|
import { withPropsStyle } from "../props_composition/with_props_style.js";
|
|
@@ -89,6 +88,7 @@ import.meta.css = /* css */ `
|
|
|
89
88
|
.navi_button_content {
|
|
90
89
|
position: relative;
|
|
91
90
|
display: inline-flex;
|
|
91
|
+
width: 100%;
|
|
92
92
|
padding-top: var(--padding-y);
|
|
93
93
|
padding-right: var(--padding-x);
|
|
94
94
|
padding-bottom: var(--padding-y);
|
|
@@ -212,8 +212,6 @@ const ButtonBasic = forwardRef((props, ref) => {
|
|
|
212
212
|
|
|
213
213
|
// visual
|
|
214
214
|
appearance = "navi",
|
|
215
|
-
alignX,
|
|
216
|
-
alignY,
|
|
217
215
|
discrete,
|
|
218
216
|
className,
|
|
219
217
|
style,
|
|
@@ -242,13 +240,8 @@ const ButtonBasic = forwardRef((props, ref) => {
|
|
|
242
240
|
appearance === "navi" ? "navi_button" : undefined,
|
|
243
241
|
className,
|
|
244
242
|
);
|
|
245
|
-
const
|
|
246
|
-
|
|
247
|
-
...consumeSpacingProps(rest),
|
|
248
|
-
...useConsumAlignProps({ alignX, alignY }),
|
|
249
|
-
},
|
|
250
|
-
style,
|
|
251
|
-
);
|
|
243
|
+
const { all } = useLayoutStyle(rest);
|
|
244
|
+
const innerStyle = withPropsStyle(all, style);
|
|
252
245
|
|
|
253
246
|
return (
|
|
254
247
|
<button
|
|
@@ -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 { useLayoutStyle } from "../layout/use_layout_style.js";
|
|
17
17
|
import {
|
|
18
18
|
LoadableInlineElement,
|
|
19
19
|
LoaderBackground,
|
|
@@ -333,10 +333,11 @@ const NaviCheckbox = ({
|
|
|
333
333
|
return initCustomField(ref.current, inputRef.current);
|
|
334
334
|
}, []);
|
|
335
335
|
|
|
336
|
+
const { all } = useLayoutStyle(rest);
|
|
336
337
|
const innerStyle = withPropsStyle(
|
|
337
338
|
{
|
|
339
|
+
...all,
|
|
338
340
|
...(accentColor ? { "--accent-color": accentColor } : {}),
|
|
339
|
-
...consumeSpacingProps(rest),
|
|
340
341
|
},
|
|
341
342
|
style,
|
|
342
343
|
);
|
|
@@ -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 { useLayoutStyle } from "../layout/use_layout_style.js";
|
|
12
12
|
import {
|
|
13
13
|
LoadableInlineElement,
|
|
14
14
|
LoaderBackground,
|
|
@@ -372,10 +372,11 @@ const NaviRadio = ({
|
|
|
372
372
|
return initCustomField(ref.current, inputRef.current);
|
|
373
373
|
}, []);
|
|
374
374
|
|
|
375
|
+
const { all } = useLayoutStyle(rest);
|
|
375
376
|
const innerStyle = withPropsStyle(
|
|
376
377
|
{
|
|
378
|
+
...all,
|
|
377
379
|
...(accentColor ? { "--accent-color": accentColor } : {}),
|
|
378
|
-
...consumeSpacingProps(rest),
|
|
379
380
|
},
|
|
380
381
|
style,
|
|
381
382
|
);
|
|
@@ -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 { useLayoutStyle } from "../layout/use_layout_style.js";
|
|
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";
|
|
@@ -88,6 +88,8 @@ import.meta.css = /* css */ `
|
|
|
88
88
|
--color: currentColor;
|
|
89
89
|
--color-readonly: color-mix(in srgb, currentColor 60%, transparent);
|
|
90
90
|
--color-disabled: var(--color-readonly);
|
|
91
|
+
|
|
92
|
+
width: 100%;
|
|
91
93
|
color: var(--color);
|
|
92
94
|
|
|
93
95
|
background-color: var(--background-color);
|
|
@@ -170,8 +172,6 @@ const InputTextualBasic = forwardRef((props, ref) => {
|
|
|
170
172
|
// visual
|
|
171
173
|
appearance = "navi",
|
|
172
174
|
accentColor,
|
|
173
|
-
width,
|
|
174
|
-
height,
|
|
175
175
|
className,
|
|
176
176
|
style,
|
|
177
177
|
|
|
@@ -199,14 +199,8 @@ const InputTextualBasic = forwardRef((props, ref) => {
|
|
|
199
199
|
appearance === "navi" ? "navi_input" : undefined,
|
|
200
200
|
className,
|
|
201
201
|
);
|
|
202
|
-
const
|
|
203
|
-
|
|
204
|
-
width,
|
|
205
|
-
height,
|
|
206
|
-
...consumeSpacingProps(rest),
|
|
207
|
-
},
|
|
208
|
-
style,
|
|
209
|
-
);
|
|
202
|
+
const { margin, padding, alignment, expansion } = useLayoutStyle(rest);
|
|
203
|
+
const innerStyle = withPropsStyle(padding, style);
|
|
210
204
|
const inputTextual = (
|
|
211
205
|
<input
|
|
212
206
|
{...rest}
|
|
@@ -254,11 +248,12 @@ const InputTextualBasic = forwardRef((props, ref) => {
|
|
|
254
248
|
<LoadableInlineElement
|
|
255
249
|
loading={innerLoading}
|
|
256
250
|
style={{
|
|
251
|
+
...margin,
|
|
252
|
+
...alignment,
|
|
253
|
+
...expansion,
|
|
257
254
|
"--accent-color": accentColor || "light-dark(#355fcc, #4476ff)",
|
|
258
255
|
}}
|
|
259
256
|
color="var(--accent-color)"
|
|
260
|
-
width={width}
|
|
261
|
-
height={height}
|
|
262
257
|
inset={-1}
|
|
263
258
|
>
|
|
264
259
|
{inputTextual}
|