@jsenv/navi 0.10.1 → 0.11.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 +13858 -23295
- package/dist/jsenv_navi.js.map +1281 -0
- package/package.json +5 -7
- package/index.js +0 -122
- package/src/action_private_properties.js +0 -11
- package/src/action_proxy_test.html +0 -353
- package/src/action_run_states.js +0 -5
- package/src/actions.js +0 -1401
- package/src/browser_integration/browser_integration.js +0 -216
- package/src/browser_integration/document_back_and_forward.js +0 -17
- package/src/browser_integration/document_loading_signal.js +0 -100
- package/src/browser_integration/document_state_signal.js +0 -9
- package/src/browser_integration/document_url_signal.js +0 -9
- package/src/browser_integration/use_is_visited.js +0 -19
- package/src/browser_integration/via_history.js +0 -232
- package/src/browser_integration/via_navigation.js +0 -168
- package/src/components/action_execution/form_context.js +0 -5
- package/src/components/action_execution/render_actionable_component.jsx +0 -29
- package/src/components/action_execution/use_action.js +0 -99
- package/src/components/action_execution/use_execute_action.js +0 -177
- package/src/components/action_execution/use_run_on_mount.js +0 -9
- package/src/components/action_renderer.jsx +0 -125
- package/src/components/callout/callout.js +0 -990
- package/src/components/callout/callout_demo.html +0 -201
- package/src/components/callout/test_dynamic_positioning.html +0 -161
- package/src/components/callout/test_html_document_iframe.html +0 -182
- package/src/components/demos/0_button_demo.html +0 -707
- package/src/components/demos/10_column_reordering_debug.html +0 -277
- package/src/components/demos/11_table_selection_debug.html +0 -432
- package/src/components/demos/1_checkbox_demo.html +0 -754
- package/src/components/demos/2_input_textual_demo.html +0 -286
- package/src/components/demos/3_radio_demo.html +0 -874
- package/src/components/demos/4_select_demo.html +0 -100
- package/src/components/demos/5_list_scrollable_demo.html +0 -153
- package/src/components/demos/6_tablist_demo.html +0 -77
- package/src/components/demos/7_table_selection_demo.html +0 -176
- package/src/components/demos/8_table_fixed_headers_demo.html +0 -584
- package/src/components/demos/9_table_column_drag_demo.html +0 -325
- package/src/components/demos/action/0_button_demo.html +0 -204
- package/src/components/demos/action/10_shortcuts_demo.html +0 -189
- package/src/components/demos/action/11_nested_shortcuts_demo.xhtml +0 -401
- package/src/components/demos/action/1_input_text_demo.html +0 -876
- package/src/components/demos/action/2_form_multiple.html +0 -303
- package/src/components/demos/action/3_details_demo.html +0 -203
- package/src/components/demos/action/4_input_checkbox_demo.html +0 -731
- package/src/components/demos/action/5_input_checkbox_state_demo.html +0 -270
- package/src/components/demos/action/6_checkbox_list_demo.html +0 -341
- package/src/components/demos/action/7_radio_list_demo.html +0 -357
- package/src/components/demos/action/8_editable_demo.html +0 -431
- package/src/components/demos/action/9_link_demo.html +0 -194
- package/src/components/demos/demo.md +0 -0
- package/src/components/demos/route/basic/basic.html +0 -14
- package/src/components/demos/route/basic/basic_route_demo.jsx +0 -224
- package/src/components/demos/route/multi/multi.html +0 -14
- package/src/components/demos/route/multi/multi_route_demo.jsx +0 -277
- package/src/components/demos/ui_transition/0_action_renderer_ui_transition_demo.html +0 -695
- package/src/components/demos/ui_transition/1_nested_ui_transition_demo.html +0 -429
- package/src/components/demos/ui_transition/2_height_transition_test.html +0 -295
- package/src/components/details/details.jsx +0 -245
- package/src/components/details/summary_marker.jsx +0 -141
- package/src/components/edition/editable.jsx +0 -186
- package/src/components/error_boundary_context.js +0 -9
- package/src/components/field/README.md +0 -247
- package/src/components/field/button.jsx +0 -429
- package/src/components/field/checkbox_list.jsx +0 -185
- package/src/components/field/collect_form_element_values.js +0 -82
- package/src/components/field/custom_field.js +0 -106
- package/src/components/field/form.jsx +0 -209
- package/src/components/field/input.jsx +0 -16
- package/src/components/field/input_checkbox.jsx +0 -434
- package/src/components/field/input_radio.jsx +0 -432
- package/src/components/field/input_textual.jsx +0 -389
- package/src/components/field/label.jsx +0 -46
- package/src/components/field/radio_list.jsx +0 -183
- package/src/components/field/select.jsx +0 -256
- package/src/components/field/use_action_events.js +0 -132
- package/src/components/field/use_form_events.js +0 -59
- package/src/components/field/use_ui_state_controller.js +0 -506
- package/src/components/item_tracker/README.md +0 -461
- package/src/components/item_tracker/use_isolated_item_tracker.jsx +0 -209
- package/src/components/item_tracker/use_isolated_item_tracker_demo.html +0 -148
- package/src/components/item_tracker/use_isolated_item_tracker_demo.jsx +0 -460
- package/src/components/item_tracker/use_item_tracker.jsx +0 -143
- package/src/components/item_tracker/use_item_tracker_demo.html +0 -207
- package/src/components/item_tracker/use_item_tracker_demo.jsx +0 -216
- package/src/components/keyboard_shortcuts/active_keyboard_shortcuts.jsx +0 -87
- package/src/components/keyboard_shortcuts/aria_key_shortcuts.js +0 -61
- package/src/components/keyboard_shortcuts/keyboard_key_meta.js +0 -17
- package/src/components/keyboard_shortcuts/keyboard_shortcuts.js +0 -371
- package/src/components/keyboard_shortcuts/os.js +0 -9
- package/src/components/layout/demos/demo_flex.html +0 -638
- package/src/components/layout/demos/demo_layout_style_buttons.html +0 -351
- package/src/components/layout/demos/demo_layout_style_input.html +0 -226
- package/src/components/layout/demos/demo_layout_style_text.html +0 -514
- package/src/components/layout/flex.jsx +0 -109
- package/src/components/layout/layout_context.jsx +0 -3
- package/src/components/layout/spacing.jsx +0 -20
- package/src/components/layout/use_layout_style.js +0 -249
- package/src/components/link/link.jsx +0 -267
- package/src/components/link/link_with_icon.jsx +0 -52
- package/src/components/loader/loader_background.jsx +0 -372
- package/src/components/loader/loading_spinner.jsx +0 -68
- package/src/components/loader/network_speed.js +0 -83
- package/src/components/loader/rectangle_loading.jsx +0 -244
- package/src/components/props_composition/demos/demo_with_props_style.html +0 -81
- package/src/components/props_composition/with_props_class_name.js +0 -37
- package/src/components/props_composition/with_props_style.js +0 -26
- package/src/components/route.jsx +0 -19
- package/src/components/selection/selection.jsx +0 -1583
- package/src/components/svg/font_sized_svg.jsx +0 -59
- package/src/components/svg/icon_and_text.jsx +0 -21
- package/src/components/svg/svg_mask_overlay.jsx +0 -105
- package/src/components/table/drag/table_drag.jsx +0 -506
- package/src/components/table/resize/table_resize.jsx +0 -650
- package/src/components/table/resize/table_size.js +0 -43
- package/src/components/table/selection/table_selection.js +0 -106
- package/src/components/table/selection/table_selection.jsx +0 -203
- package/src/components/table/sticky/sticky_group.js +0 -354
- package/src/components/table/sticky/table_sticky.js +0 -25
- package/src/components/table/sticky/table_sticky.jsx +0 -501
- package/src/components/table/table.jsx +0 -721
- package/src/components/table/table_css.js +0 -211
- package/src/components/table/table_ui.jsx +0 -49
- package/src/components/table/use_cells_and_columns.js +0 -90
- package/src/components/table/use_object_array_to_cells.js +0 -46
- package/src/components/table/z_indexes.js +0 -23
- package/src/components/tablist/tablist.jsx +0 -99
- package/src/components/text/demos/demo_text_and_icon.html +0 -421
- package/src/components/text/overflow.jsx +0 -15
- package/src/components/text/text.jsx +0 -83
- package/src/components/text/text_and_count.jsx +0 -28
- package/src/components/ui_transition.jsx +0 -128
- package/src/components/use_auto_focus.js +0 -94
- package/src/components/use_batch_during_render.js +0 -33
- package/src/components/use_debounce_true.js +0 -31
- package/src/components/use_dependencies_diff.js +0 -35
- package/src/components/use_focus_group.js +0 -20
- package/src/components/use_initial_value.js +0 -78
- package/src/components/use_is_visited.js +0 -19
- package/src/components/use_ref_array.js +0 -38
- package/src/components/use_signal_sync.js +0 -50
- package/src/components/use_stable_callback.js +0 -68
- package/src/components/use_state_array.js +0 -47
- package/src/docs/actions.md +0 -250
- package/src/docs/demos/resource/action_status.jsx +0 -42
- package/src/docs/demos/resource/demo.md +0 -1
- package/src/docs/demos/resource/resource_demo_0.html +0 -84
- package/src/docs/demos/resource/resource_demo_10_post_gc.html +0 -364
- package/src/docs/demos/resource/resource_demo_11_describe_many.html +0 -362
- package/src/docs/demos/resource/resource_demo_2.html +0 -173
- package/src/docs/demos/resource/resource_demo_3_filtered_users.html +0 -415
- package/src/docs/demos/resource/resource_demo_4_details.html +0 -284
- package/src/docs/demos/resource/resource_demo_5_renderer_lazy.html +0 -115
- package/src/docs/demos/resource/resource_demo_6_gc.html +0 -217
- package/src/docs/demos/resource/resource_demo_7_child_gc.html +0 -240
- package/src/docs/demos/resource/resource_demo_8_proxy_gc.html +0 -319
- package/src/docs/demos/resource/resource_demo_9_describe_one.html +0 -472
- package/src/docs/demos/resource/tata.jsx +0 -3
- package/src/docs/demos/resource/toto.jsx +0 -3
- package/src/docs/demos/user_nav/user_nav.html +0 -12
- package/src/docs/demos/user_nav/user_nav.jsx +0 -330
- package/src/docs/resource_dependencies.md +0 -103
- package/src/docs/resource_with_params.md +0 -80
- package/src/navi_css_vars.js +0 -14
- package/src/notes.md +0 -34
- package/src/route/route.js +0 -596
- package/src/route/route.xtest.html +0 -228
- package/src/store/array_signal_store.js +0 -537
- package/src/store/local_storage_signal.js +0 -17
- package/src/store/resource_graph.js +0 -1304
- package/src/store/tests/resource_graph_autoreload_demo.html +0 -12
- package/src/store/tests/resource_graph_autoreload_demo.jsx +0 -964
- package/src/store/tests/resource_graph_dependencies.test_manual.js +0 -95
- package/src/store/value_in_local_storage.js +0 -187
- package/src/symbol_object_signal.js +0 -1
- package/src/use_action_data.js +0 -10
- package/src/use_action_status.js +0 -47
- package/src/utils/add_many_event_listeners.js +0 -15
- package/src/utils/array_add_remove.js +0 -61
- package/src/utils/array_signal.js +0 -15
- package/src/utils/compare_two_js_values.js +0 -172
- package/src/utils/execute_with_cleanup.js +0 -21
- package/src/utils/get_caller_info.js +0 -85
- package/src/utils/is_signal.js +0 -20
- package/src/utils/js_value_weak_map.js +0 -162
- package/src/utils/js_value_weak_map_demo.html +0 -690
- package/src/utils/merge_two_js_values.js +0 -53
- package/src/utils/stringify_for_display.js +0 -131
- package/src/utils/weak_effect.js +0 -48
- package/src/validation/constraints/confirm_constraint.js +0 -14
- package/src/validation/constraints/create_unique_value_constraint.js +0 -27
- package/src/validation/constraints/native_constraints.js +0 -338
- package/src/validation/constraints/readonly_constraint.js +0 -41
- package/src/validation/constraints/same_as_constraint.js +0 -42
- package/src/validation/constraints/single_space_constraint.js +0 -13
- package/src/validation/custom_constraint_validation.js +0 -793
- package/src/validation/custom_message.js +0 -18
- package/src/validation/demos/browser_style.png +0 -0
- package/src/validation/demos/demo_same_as_constraint.html +0 -259
- package/src/validation/demos/form_validation_demo.html +0 -142
- package/src/validation/demos/form_validation_demo_preact.html +0 -87
- package/src/validation/demos/form_validation_native_popover_demo.html +0 -168
- package/src/validation/demos/form_validation_vs_native_demo.html +0 -172
- package/src/validation/hooks/use_constraints.js +0 -23
- package/src/validation/hooks/use_custom_validation_ref.js +0 -73
- package/src/validation/hooks/use_validation_message.js +0 -19
- package/src/validation/input_change_effect.js +0 -106
|
@@ -1,351 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8" />
|
|
5
|
-
<title>useLayoutStyle Demo - Buttons</title>
|
|
6
|
-
<style>
|
|
7
|
-
.demo-container {
|
|
8
|
-
margin-bottom: 30px;
|
|
9
|
-
padding: 20px;
|
|
10
|
-
background: #f8f9fa;
|
|
11
|
-
border-radius: 8px;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.demo-box {
|
|
15
|
-
min-width: 60px;
|
|
16
|
-
padding: 10px;
|
|
17
|
-
text-align: center;
|
|
18
|
-
background: #e3f2fd;
|
|
19
|
-
border: 1px solid #90caf9;
|
|
20
|
-
border-radius: 4px;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.visual-container {
|
|
24
|
-
margin: 10px 0;
|
|
25
|
-
padding: 10px;
|
|
26
|
-
background: #fff3e0;
|
|
27
|
-
border: 2px dashed #ff9800;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
h3 {
|
|
31
|
-
margin-top: 0;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/* Helper to visualize the container boundaries */
|
|
35
|
-
.bounded {
|
|
36
|
-
width: 400px;
|
|
37
|
-
height: 100px;
|
|
38
|
-
padding: 10px;
|
|
39
|
-
background: #f0f4ff;
|
|
40
|
-
border: 1px solid #6366f1;
|
|
41
|
-
}
|
|
42
|
-
</style>
|
|
43
|
-
</head>
|
|
44
|
-
<body>
|
|
45
|
-
<div id="app"></div>
|
|
46
|
-
<script type="module" jsenv-type="module/jsx">
|
|
47
|
-
/* eslint-disable no-unused-vars */
|
|
48
|
-
import { render } from "preact";
|
|
49
|
-
import { FlexRow, FlexColumn, Input, Button } from "@jsenv/navi";
|
|
50
|
-
|
|
51
|
-
const DemoBox = ({ children, ...props }) => (
|
|
52
|
-
<div className="demo-box" {...props}>
|
|
53
|
-
{children}
|
|
54
|
-
</div>
|
|
55
|
-
);
|
|
56
|
-
|
|
57
|
-
const Demo = () => {
|
|
58
|
-
return (
|
|
59
|
-
<div style={{ padding: "20px", fontFamily: "system-ui, sans-serif" }}>
|
|
60
|
-
<h1>useLayoutStyle Demo - Button Elements</h1>
|
|
61
|
-
<p>
|
|
62
|
-
Testing spacing (margin/padding), alignment, and expand behavior
|
|
63
|
-
specifically with Button components in various layout contexts.
|
|
64
|
-
</p>
|
|
65
|
-
|
|
66
|
-
<div className="demo-container">
|
|
67
|
-
<h3>1. Button ExpandX - Horizontal Expansion Only</h3>
|
|
68
|
-
<div className="visual-container">
|
|
69
|
-
<h4>In FlexRow (grows horizontally)</h4>
|
|
70
|
-
<FlexRow gap="10px">
|
|
71
|
-
<Button>Fixed</Button>
|
|
72
|
-
<Button expandX>ExpandX Button</Button>
|
|
73
|
-
<Button>Fixed</Button>
|
|
74
|
-
</FlexRow>
|
|
75
|
-
|
|
76
|
-
<h4>In FlexColumn (takes full width)</h4>
|
|
77
|
-
<FlexColumn gap="10px" style={{ height: "150px" }}>
|
|
78
|
-
<Button>Normal Width</Button>
|
|
79
|
-
<Button expandX>Full Width Button</Button>
|
|
80
|
-
<Button>Normal Width</Button>
|
|
81
|
-
</FlexColumn>
|
|
82
|
-
</div>
|
|
83
|
-
</div>
|
|
84
|
-
|
|
85
|
-
<div className="demo-container">
|
|
86
|
-
<h3>2. Button ExpandY - Vertical Expansion Only</h3>
|
|
87
|
-
<div className="visual-container">
|
|
88
|
-
<h4>In FlexRow (takes full height)</h4>
|
|
89
|
-
<FlexRow gap="10px" style={{ height: "100px" }}>
|
|
90
|
-
<Button>Normal Height</Button>
|
|
91
|
-
<Button expandY>Full Height Button</Button>
|
|
92
|
-
<Button>Normal Height</Button>
|
|
93
|
-
</FlexRow>
|
|
94
|
-
|
|
95
|
-
<h4>In FlexColumn (grows vertically)</h4>
|
|
96
|
-
<FlexColumn gap="10px" style={{ height: "200px" }}>
|
|
97
|
-
<Button>Fixed</Button>
|
|
98
|
-
<Button expandY>ExpandY Button</Button>
|
|
99
|
-
<Button>Fixed</Button>
|
|
100
|
-
</FlexColumn>
|
|
101
|
-
</div>
|
|
102
|
-
</div>
|
|
103
|
-
|
|
104
|
-
<div className="demo-container">
|
|
105
|
-
<h3>3. Button ExpandX + ExpandY - Both Axes</h3>
|
|
106
|
-
<div className="visual-container">
|
|
107
|
-
<h4>In FlexRow (grows horizontally, full height)</h4>
|
|
108
|
-
<FlexRow gap="10px" style={{ height: "80px" }}>
|
|
109
|
-
<Button>Fixed</Button>
|
|
110
|
-
<Button expandX expandY>
|
|
111
|
-
Both Axes
|
|
112
|
-
</Button>
|
|
113
|
-
<Button>Fixed</Button>
|
|
114
|
-
</FlexRow>
|
|
115
|
-
|
|
116
|
-
<h4>In FlexColumn (full width, grows vertically)</h4>
|
|
117
|
-
<FlexColumn gap="10px" style={{ height: "150px" }}>
|
|
118
|
-
<Button>Fixed</Button>
|
|
119
|
-
<Button expandX expandY>
|
|
120
|
-
Both Axes
|
|
121
|
-
</Button>
|
|
122
|
-
<Button>Fixed</Button>
|
|
123
|
-
</FlexColumn>
|
|
124
|
-
</div>
|
|
125
|
-
</div>
|
|
126
|
-
|
|
127
|
-
<div className="demo-container">
|
|
128
|
-
<h3>4. Precise Control Comparison</h3>
|
|
129
|
-
<div className="visual-container">
|
|
130
|
-
<FlexColumn gap="15px">
|
|
131
|
-
<div>
|
|
132
|
-
<h4>FlexRow with different expansions</h4>
|
|
133
|
-
<FlexRow
|
|
134
|
-
gap="10px"
|
|
135
|
-
style={{
|
|
136
|
-
height: "60px",
|
|
137
|
-
background: "#f8f9fa",
|
|
138
|
-
padding: "10px",
|
|
139
|
-
}}
|
|
140
|
-
>
|
|
141
|
-
<Button>No Expand</Button>
|
|
142
|
-
<Button expandX>ExpandX Only</Button>
|
|
143
|
-
<Button expandY>ExpandY Only</Button>
|
|
144
|
-
<Button expandX expandY>
|
|
145
|
-
Both
|
|
146
|
-
</Button>
|
|
147
|
-
</FlexRow>
|
|
148
|
-
</div>
|
|
149
|
-
|
|
150
|
-
<div>
|
|
151
|
-
<h4>FlexColumn with different expansions</h4>
|
|
152
|
-
<FlexColumn
|
|
153
|
-
gap="10px"
|
|
154
|
-
style={{
|
|
155
|
-
height: "200px",
|
|
156
|
-
background: "#f8f9fa",
|
|
157
|
-
padding: "10px",
|
|
158
|
-
}}
|
|
159
|
-
>
|
|
160
|
-
<Button>No Expand</Button>
|
|
161
|
-
<Button expandX>ExpandX Only</Button>
|
|
162
|
-
<Button expandY>ExpandY Only</Button>
|
|
163
|
-
<Button expandX expandY>
|
|
164
|
-
Both
|
|
165
|
-
</Button>
|
|
166
|
-
</FlexColumn>
|
|
167
|
-
</div>
|
|
168
|
-
</FlexColumn>
|
|
169
|
-
</div>
|
|
170
|
-
</div>
|
|
171
|
-
|
|
172
|
-
<div className="demo-container">
|
|
173
|
-
<h3>5. Outside Flex Context</h3>
|
|
174
|
-
<div className="visual-container">
|
|
175
|
-
<div
|
|
176
|
-
style={{
|
|
177
|
-
width: "300px",
|
|
178
|
-
height: "150px",
|
|
179
|
-
border: "1px solid #ccc",
|
|
180
|
-
padding: "10px",
|
|
181
|
-
}}
|
|
182
|
-
>
|
|
183
|
-
<Button>Normal Button</Button>
|
|
184
|
-
<br />
|
|
185
|
-
<br />
|
|
186
|
-
<Button expandX>ExpandX (full width)</Button>
|
|
187
|
-
<br />
|
|
188
|
-
<br />
|
|
189
|
-
<Button expandY>ExpandY (full height)</Button>
|
|
190
|
-
<br />
|
|
191
|
-
<br />
|
|
192
|
-
<Button expandX expandY>
|
|
193
|
-
Both (full width & height)
|
|
194
|
-
</Button>
|
|
195
|
-
</div>
|
|
196
|
-
</div>
|
|
197
|
-
</div>
|
|
198
|
-
|
|
199
|
-
<div className="demo-container">
|
|
200
|
-
<h3>6. Multiple Expand Buttons</h3>
|
|
201
|
-
<div className="visual-container">
|
|
202
|
-
<FlexRow gap="10px">
|
|
203
|
-
<Button expandX>ExpandX 1</Button>
|
|
204
|
-
<Button expandX>ExpandX 2</Button>
|
|
205
|
-
<Button expandX>ExpandX 3</Button>
|
|
206
|
-
</FlexRow>
|
|
207
|
-
</div>
|
|
208
|
-
</div>
|
|
209
|
-
|
|
210
|
-
<div className="demo-container">
|
|
211
|
-
<h3>7. Button Spacing - Margins</h3>
|
|
212
|
-
<div className="visual-container">
|
|
213
|
-
<FlexColumn gap="5px">
|
|
214
|
-
<Button margin="10px">Margin All Sides</Button>
|
|
215
|
-
<Button marginX="20px">MarginX Only</Button>
|
|
216
|
-
<Button marginY="15px">MarginY Only</Button>
|
|
217
|
-
<Button marginLeft="30px">MarginLeft Only</Button>
|
|
218
|
-
<Button marginRight="25px">MarginRight Only</Button>
|
|
219
|
-
</FlexColumn>
|
|
220
|
-
</div>
|
|
221
|
-
</div>
|
|
222
|
-
|
|
223
|
-
<div className="demo-container">
|
|
224
|
-
<h3>6. Button Spacing - Padding</h3>
|
|
225
|
-
<div className="visual-container">
|
|
226
|
-
<FlexColumn gap="5px">
|
|
227
|
-
<Button>Default Padding</Button>
|
|
228
|
-
<Button padding="20px">Extra Padding</Button>
|
|
229
|
-
<Button paddingX="30px">PaddingX Only</Button>
|
|
230
|
-
<Button paddingY="15px">PaddingY Only</Button>
|
|
231
|
-
<Button paddingLeft="25px">PaddingLeft Only</Button>
|
|
232
|
-
</FlexColumn>
|
|
233
|
-
</div>
|
|
234
|
-
</div>
|
|
235
|
-
|
|
236
|
-
<div className="demo-container">
|
|
237
|
-
<h3>8. Button AlignX Test: FlexRow + alignX="end"</h3>
|
|
238
|
-
<div className="visual-container">
|
|
239
|
-
<div className="bounded">
|
|
240
|
-
<FlexRow gap="10px" style={{ height: "100%" }}>
|
|
241
|
-
<Button>Default</Button>
|
|
242
|
-
<Button alignX="end">Pushed to End</Button>
|
|
243
|
-
</FlexRow>
|
|
244
|
-
</div>
|
|
245
|
-
</div>
|
|
246
|
-
</div>
|
|
247
|
-
|
|
248
|
-
<div className="demo-container">
|
|
249
|
-
<h3>9. Combined Spacing and ExpandX</h3>
|
|
250
|
-
<div className="visual-container">
|
|
251
|
-
<FlexRow gap="10px">
|
|
252
|
-
<Button>Label</Button>
|
|
253
|
-
<Button expandX marginY="5px" paddingX="20px">
|
|
254
|
-
Margin + Padding + ExpandX
|
|
255
|
-
</Button>
|
|
256
|
-
<Button>End</Button>
|
|
257
|
-
</FlexRow>
|
|
258
|
-
</div>
|
|
259
|
-
</div>
|
|
260
|
-
|
|
261
|
-
<div className="demo-container">
|
|
262
|
-
<h3>10. Button Toolbar Layout</h3>
|
|
263
|
-
<div className="visual-container">
|
|
264
|
-
<FlexRow gap="10px">
|
|
265
|
-
<Button>New</Button>
|
|
266
|
-
<Button>Open</Button>
|
|
267
|
-
<Button>Save</Button>
|
|
268
|
-
<Button expandX>Status Message Area</Button>
|
|
269
|
-
<Button alignX="end">Settings</Button>
|
|
270
|
-
</FlexRow>
|
|
271
|
-
</div>
|
|
272
|
-
</div>
|
|
273
|
-
|
|
274
|
-
<div className="demo-container">
|
|
275
|
-
<h3>11. Button Group with Various Alignments</h3>
|
|
276
|
-
<div className="visual-container">
|
|
277
|
-
<FlexColumn gap="10px">
|
|
278
|
-
<FlexRow gap="10px">
|
|
279
|
-
<Button>Start</Button>
|
|
280
|
-
<Button alignX="center">Center</Button>
|
|
281
|
-
<Button alignX="end">End</Button>
|
|
282
|
-
</FlexRow>
|
|
283
|
-
|
|
284
|
-
<FlexRow gap="10px">
|
|
285
|
-
<Button expandX>Primary Action</Button>
|
|
286
|
-
<Button>Cancel</Button>
|
|
287
|
-
</FlexRow>
|
|
288
|
-
|
|
289
|
-
<FlexRow gap="10px" alignX="end">
|
|
290
|
-
<Button>Back</Button>
|
|
291
|
-
<Button>Next</Button>
|
|
292
|
-
</FlexRow>
|
|
293
|
-
</FlexColumn>
|
|
294
|
-
</div>
|
|
295
|
-
</div>
|
|
296
|
-
|
|
297
|
-
<div className="demo-container">
|
|
298
|
-
<h3>12. Card Layout with Button Actions</h3>
|
|
299
|
-
<div className="visual-container">
|
|
300
|
-
<div
|
|
301
|
-
style={{
|
|
302
|
-
border: "1px solid #ddd",
|
|
303
|
-
borderRadius: "8px",
|
|
304
|
-
padding: "20px",
|
|
305
|
-
width: "350px",
|
|
306
|
-
}}
|
|
307
|
-
>
|
|
308
|
-
<h4 style={{ margin: "0 0 10px 0" }}>Card Title</h4>
|
|
309
|
-
<p style={{ margin: "0 0 20px 0", color: "#666" }}>
|
|
310
|
-
This is some card content that describes the item or action.
|
|
311
|
-
</p>
|
|
312
|
-
|
|
313
|
-
<FlexRow gap="10px">
|
|
314
|
-
<Button expandX>Primary Action</Button>
|
|
315
|
-
<Button alignX="end">More</Button>
|
|
316
|
-
</FlexRow>
|
|
317
|
-
</div>
|
|
318
|
-
</div>
|
|
319
|
-
</div>
|
|
320
|
-
|
|
321
|
-
<div className="demo-container">
|
|
322
|
-
<h3>13. Navigation Button Layout</h3>
|
|
323
|
-
<div className="visual-container">
|
|
324
|
-
<FlexColumn gap="15px">
|
|
325
|
-
<FlexRow gap="10px">
|
|
326
|
-
<Button>Home</Button>
|
|
327
|
-
<Button expandX>Current Page Title</Button>
|
|
328
|
-
<Button alignX="end">Profile</Button>
|
|
329
|
-
</FlexRow>
|
|
330
|
-
|
|
331
|
-
<FlexRow gap="10px" alignX="center">
|
|
332
|
-
<Button marginX="5px">Tab 1</Button>
|
|
333
|
-
<Button marginX="5px">Tab 2</Button>
|
|
334
|
-
<Button marginX="5px">Tab 3</Button>
|
|
335
|
-
</FlexRow>
|
|
336
|
-
|
|
337
|
-
<FlexRow gap="10px" alignX="space-between">
|
|
338
|
-
<Button>Previous</Button>
|
|
339
|
-
<Button>Next</Button>
|
|
340
|
-
</FlexRow>
|
|
341
|
-
</FlexColumn>
|
|
342
|
-
</div>
|
|
343
|
-
</div>
|
|
344
|
-
</div>
|
|
345
|
-
);
|
|
346
|
-
};
|
|
347
|
-
|
|
348
|
-
render(<Demo />, document.getElementById("app"));
|
|
349
|
-
</script>
|
|
350
|
-
</body>
|
|
351
|
-
</html>
|
|
@@ -1,226 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8" />
|
|
5
|
-
<title>useLayoutStyle Demo</title>
|
|
6
|
-
<style>
|
|
7
|
-
.demo-container {
|
|
8
|
-
margin-bottom: 30px;
|
|
9
|
-
padding: 20px;
|
|
10
|
-
background: #f8f9fa;
|
|
11
|
-
border-radius: 8px;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.demo-box {
|
|
15
|
-
min-width: 60px;
|
|
16
|
-
padding: 10px;
|
|
17
|
-
text-align: center;
|
|
18
|
-
background: #e3f2fd;
|
|
19
|
-
border: 1px solid #90caf9;
|
|
20
|
-
border-radius: 4px;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.visual-container {
|
|
24
|
-
margin: 10px 0;
|
|
25
|
-
padding: 10px;
|
|
26
|
-
background: #fff3e0;
|
|
27
|
-
border: 2px dashed #ff9800;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
h3 {
|
|
31
|
-
margin-top: 0;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/* Helper to visualize the container boundaries */
|
|
35
|
-
.bounded {
|
|
36
|
-
width: 400px;
|
|
37
|
-
height: 100px;
|
|
38
|
-
padding: 10px;
|
|
39
|
-
background: #f0f4ff;
|
|
40
|
-
border: 1px solid #6366f1;
|
|
41
|
-
}
|
|
42
|
-
</style>
|
|
43
|
-
</head>
|
|
44
|
-
<body>
|
|
45
|
-
<div id="app"></div>
|
|
46
|
-
<script type="module" jsenv-type="module/jsx">
|
|
47
|
-
/* eslint-disable no-unused-vars */
|
|
48
|
-
import { render } from "preact";
|
|
49
|
-
import { FlexRow, FlexColumn, Input, Button } from "@jsenv/navi";
|
|
50
|
-
|
|
51
|
-
const DemoBox = ({ children, ...props }) => (
|
|
52
|
-
<div className="demo-box" {...props}>
|
|
53
|
-
{children}
|
|
54
|
-
</div>
|
|
55
|
-
);
|
|
56
|
-
|
|
57
|
-
const Demo = () => {
|
|
58
|
-
return (
|
|
59
|
-
<div style={{ padding: "20px", fontFamily: "system-ui, sans-serif" }}>
|
|
60
|
-
<h1>useLayoutStyle Demo - Input Elements</h1>
|
|
61
|
-
<p>
|
|
62
|
-
Testing spacing (margin/padding), alignment, and expand behavior
|
|
63
|
-
specifically with Input components in various layout contexts.
|
|
64
|
-
</p>
|
|
65
|
-
|
|
66
|
-
<div className="demo-container">
|
|
67
|
-
<h3>1. Input with Expand in FlexRow</h3>
|
|
68
|
-
<div className="visual-container">
|
|
69
|
-
<FlexRow gap="10px">
|
|
70
|
-
<Button>Start</Button>
|
|
71
|
-
<Input placeholder="Expanding input" expandX />
|
|
72
|
-
<Button>End</Button>
|
|
73
|
-
</FlexRow>
|
|
74
|
-
</div>
|
|
75
|
-
</div>
|
|
76
|
-
|
|
77
|
-
<div className="demo-container">
|
|
78
|
-
<h3>2. Input with Expand in FlexColumn</h3>
|
|
79
|
-
<div className="visual-container">
|
|
80
|
-
<FlexColumn gap="10px" style={{ height: "200px" }}>
|
|
81
|
-
<Input placeholder="Fixed input" />
|
|
82
|
-
<Input placeholder="Expanding input (height)" expandY />
|
|
83
|
-
<Input placeholder="Fixed input" />
|
|
84
|
-
</FlexColumn>
|
|
85
|
-
</div>
|
|
86
|
-
</div>
|
|
87
|
-
|
|
88
|
-
<div className="demo-container">
|
|
89
|
-
<h3>3. Input with Expand outside Flex context</h3>
|
|
90
|
-
<div className="visual-container">
|
|
91
|
-
<div
|
|
92
|
-
style={{
|
|
93
|
-
width: "300px",
|
|
94
|
-
border: "1px solid #ccc",
|
|
95
|
-
padding: "10px",
|
|
96
|
-
}}
|
|
97
|
-
>
|
|
98
|
-
<Input placeholder="Normal input" />
|
|
99
|
-
<br />
|
|
100
|
-
<br />
|
|
101
|
-
<Input
|
|
102
|
-
placeholder="Expanding input (should take full width)"
|
|
103
|
-
expand
|
|
104
|
-
/>
|
|
105
|
-
</div>
|
|
106
|
-
</div>
|
|
107
|
-
</div>
|
|
108
|
-
|
|
109
|
-
<div className="demo-container">
|
|
110
|
-
<h3>4. Multiple Expand Elements</h3>
|
|
111
|
-
<div className="visual-container">
|
|
112
|
-
<FlexRow gap="10px">
|
|
113
|
-
<Input placeholder="Expand 1" expand />
|
|
114
|
-
<Input placeholder="Expand 2" expand />
|
|
115
|
-
<Input placeholder="Expand 3" expand />
|
|
116
|
-
</FlexRow>
|
|
117
|
-
</div>
|
|
118
|
-
</div>
|
|
119
|
-
|
|
120
|
-
<div className="demo-container">
|
|
121
|
-
<h3>5. Basic Spacing - Input with margins</h3>
|
|
122
|
-
<div className="visual-container">
|
|
123
|
-
<Input placeholder="Default input" margin="10px" />
|
|
124
|
-
<Input placeholder="MarginX only" marginX="20px" />
|
|
125
|
-
<Input placeholder="MarginY only" marginY="15px" />
|
|
126
|
-
</div>
|
|
127
|
-
</div>
|
|
128
|
-
|
|
129
|
-
<div className="demo-container">
|
|
130
|
-
<h3>6. Input with Padding</h3>
|
|
131
|
-
<div className="visual-container">
|
|
132
|
-
<Input placeholder="Default padding" />
|
|
133
|
-
<Input placeholder="Extra padding" padding="20px" />
|
|
134
|
-
<Input placeholder="PaddingX only" paddingX="30px" />
|
|
135
|
-
</div>
|
|
136
|
-
</div>
|
|
137
|
-
|
|
138
|
-
<div className="demo-container">
|
|
139
|
-
<h3>7. Directional Margins and Padding</h3>
|
|
140
|
-
<div className="visual-container">
|
|
141
|
-
<FlexColumn gap="5px">
|
|
142
|
-
<Input placeholder="marginLeft: 20px" marginLeft="20px" />
|
|
143
|
-
<Input placeholder="marginRight: 30px" marginRight="30px" />
|
|
144
|
-
<Input
|
|
145
|
-
placeholder="marginTop: 15px, marginBottom: 25px"
|
|
146
|
-
marginTop="15px"
|
|
147
|
-
marginBottom="25px"
|
|
148
|
-
/>
|
|
149
|
-
<Input placeholder="paddingLeft: 25px" paddingLeft="25px" />
|
|
150
|
-
</FlexColumn>
|
|
151
|
-
</div>
|
|
152
|
-
</div>
|
|
153
|
-
|
|
154
|
-
<div className="demo-container">
|
|
155
|
-
<h3>8. AlignX Test: FlexRow + alignX="end"</h3>
|
|
156
|
-
<div className="visual-container">
|
|
157
|
-
<div className="bounded">
|
|
158
|
-
<FlexRow gap="10px" style={{ height: "100%" }}>
|
|
159
|
-
<Input placeholder="Default" />
|
|
160
|
-
<Input placeholder="Pushed to end" alignX="end" />
|
|
161
|
-
</FlexRow>
|
|
162
|
-
</div>
|
|
163
|
-
</div>
|
|
164
|
-
</div>
|
|
165
|
-
|
|
166
|
-
<div className="demo-container">
|
|
167
|
-
<h3>9. Combined Spacing and Expand</h3>
|
|
168
|
-
<div className="visual-container">
|
|
169
|
-
<FlexRow gap="10px">
|
|
170
|
-
<Button>Label</Button>
|
|
171
|
-
<Input
|
|
172
|
-
placeholder="Margin + Expand"
|
|
173
|
-
expand
|
|
174
|
-
marginY="5px"
|
|
175
|
-
paddingX="15px"
|
|
176
|
-
/>
|
|
177
|
-
<Button>Action</Button>
|
|
178
|
-
</FlexRow>
|
|
179
|
-
</div>
|
|
180
|
-
</div>
|
|
181
|
-
|
|
182
|
-
<div className="demo-container">
|
|
183
|
-
<h3>10. Complex Layout: Form with Expand</h3>
|
|
184
|
-
<div className="visual-container">
|
|
185
|
-
<FlexColumn gap="15px">
|
|
186
|
-
<FlexRow gap="10px">
|
|
187
|
-
<label style={{ minWidth: "80px", alignSelf: "center" }}>
|
|
188
|
-
Name:
|
|
189
|
-
</label>
|
|
190
|
-
<Input placeholder="Enter your name" expand />
|
|
191
|
-
</FlexRow>
|
|
192
|
-
|
|
193
|
-
<FlexRow gap="10px">
|
|
194
|
-
<label style={{ minWidth: "80px", alignSelf: "center" }}>
|
|
195
|
-
Email:
|
|
196
|
-
</label>
|
|
197
|
-
<Input placeholder="Enter your email" expand />
|
|
198
|
-
<Button>Verify</Button>
|
|
199
|
-
</FlexRow>
|
|
200
|
-
|
|
201
|
-
<FlexRow gap="10px">
|
|
202
|
-
<label style={{ minWidth: "80px", alignSelf: "center" }}>
|
|
203
|
-
Message:
|
|
204
|
-
</label>
|
|
205
|
-
<Input
|
|
206
|
-
placeholder="Enter your message"
|
|
207
|
-
expand
|
|
208
|
-
paddingY="10px"
|
|
209
|
-
/>
|
|
210
|
-
</FlexRow>
|
|
211
|
-
|
|
212
|
-
<FlexRow gap="10px" alignX="end">
|
|
213
|
-
<Button>Cancel</Button>
|
|
214
|
-
<Button>Submit</Button>
|
|
215
|
-
</FlexRow>
|
|
216
|
-
</FlexColumn>
|
|
217
|
-
</div>
|
|
218
|
-
</div>
|
|
219
|
-
</div>
|
|
220
|
-
);
|
|
221
|
-
};
|
|
222
|
-
|
|
223
|
-
render(<Demo />, document.getElementById("app"));
|
|
224
|
-
</script>
|
|
225
|
-
</body>
|
|
226
|
-
</html>
|