@jsenv/navi 0.9.0 → 0.9.1
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 +28 -8
- package/package.json +1 -1
- package/src/components/layout/demos/{demo_use_layout_style_buttons.html → demo_layout_style_buttons.html} +117 -26
- package/src/components/layout/demos/{demo_use_layout_style.html → demo_layout_style_input.html} +2 -2
- package/src/components/layout/use_layout_style.js +28 -8
- /package/src/components/layout/demos/{demo_use_layout_style_text.html → demo_layout_style_text.html} +0 -0
package/dist/jsenv_navi.js
CHANGED
|
@@ -18611,7 +18611,8 @@ const FlexDirectionContext = createContext();
|
|
|
18611
18611
|
* @param {string|number} [props.paddingBottom] - Bottom padding
|
|
18612
18612
|
* @param {"start"|"center"|"end"|"stretch"} [props.alignX] - Horizontal alignment
|
|
18613
18613
|
* @param {"start"|"center"|"end"|"stretch"} [props.alignY] - Vertical alignment
|
|
18614
|
-
* @param {boolean} [props.
|
|
18614
|
+
* @param {boolean} [props.expandX] - Whether element should expand horizontally to fill available space
|
|
18615
|
+
* @param {boolean} [props.expandY] - Whether element should expand vertically to fill available space
|
|
18615
18616
|
* @returns {Object} Object with categorized styles: { margin, padding, alignment, expansion, all }
|
|
18616
18617
|
*/
|
|
18617
18618
|
const useLayoutStyle = (props) => {
|
|
@@ -18776,13 +18777,32 @@ const useLayoutStyle = (props) => {
|
|
|
18776
18777
|
{
|
|
18777
18778
|
const expand = props.expand;
|
|
18778
18779
|
delete props.expand;
|
|
18779
|
-
|
|
18780
|
-
|
|
18781
|
-
|
|
18782
|
-
|
|
18783
|
-
|
|
18784
|
-
|
|
18785
|
-
|
|
18780
|
+
|
|
18781
|
+
{
|
|
18782
|
+
const expandX = props.expandX || expand;
|
|
18783
|
+
delete props.expandX;
|
|
18784
|
+
if (expandX) {
|
|
18785
|
+
if (flexDirection === "row") {
|
|
18786
|
+
expansionStyle.flexGrow = 1; // Grow horizontally in row
|
|
18787
|
+
} else if (flexDirection === "column") {
|
|
18788
|
+
expansionStyle.width = "100%"; // Take full width in column
|
|
18789
|
+
} else {
|
|
18790
|
+
expansionStyle.width = "100%"; // Take full width outside flex
|
|
18791
|
+
}
|
|
18792
|
+
}
|
|
18793
|
+
}
|
|
18794
|
+
|
|
18795
|
+
{
|
|
18796
|
+
const expandY = props.expandY || expand;
|
|
18797
|
+
delete props.expandY;
|
|
18798
|
+
if (expandY) {
|
|
18799
|
+
if (flexDirection === "row") {
|
|
18800
|
+
expansionStyle.height = "100%"; // Take full height in row
|
|
18801
|
+
} else if (flexDirection === "column") {
|
|
18802
|
+
expansionStyle.flexGrow = 1; // Grow vertically in column
|
|
18803
|
+
} else {
|
|
18804
|
+
expansionStyle.height = "100%"; // Take full height outside flex
|
|
18805
|
+
}
|
|
18786
18806
|
}
|
|
18787
18807
|
}
|
|
18788
18808
|
}
|
package/package.json
CHANGED
|
@@ -64,33 +64,118 @@
|
|
|
64
64
|
</p>
|
|
65
65
|
|
|
66
66
|
<div className="demo-container">
|
|
67
|
-
<h3>1. Button
|
|
67
|
+
<h3>1. Button ExpandX - Horizontal Expansion Only</h3>
|
|
68
68
|
<div className="visual-container">
|
|
69
|
+
<h4>In FlexRow (grows horizontally)</h4>
|
|
69
70
|
<FlexRow gap="10px">
|
|
70
71
|
<Button>Fixed</Button>
|
|
71
|
-
<Button
|
|
72
|
+
<Button expandX>ExpandX Button</Button>
|
|
72
73
|
<Button>Fixed</Button>
|
|
73
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>
|
|
74
82
|
</div>
|
|
75
83
|
</div>
|
|
76
84
|
|
|
77
85
|
<div className="demo-container">
|
|
78
|
-
<h3>2. Button
|
|
86
|
+
<h3>2. Button ExpandY - Vertical Expansion Only</h3>
|
|
79
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>
|
|
80
96
|
<FlexColumn gap="10px" style={{ height: "200px" }}>
|
|
81
|
-
<Button>Fixed
|
|
82
|
-
<Button
|
|
83
|
-
<Button>Fixed
|
|
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>
|
|
84
168
|
</FlexColumn>
|
|
85
169
|
</div>
|
|
86
170
|
</div>
|
|
87
171
|
|
|
88
172
|
<div className="demo-container">
|
|
89
|
-
<h3>
|
|
173
|
+
<h3>5. Outside Flex Context</h3>
|
|
90
174
|
<div className="visual-container">
|
|
91
175
|
<div
|
|
92
176
|
style={{
|
|
93
177
|
width: "300px",
|
|
178
|
+
height: "150px",
|
|
94
179
|
border: "1px solid #ccc",
|
|
95
180
|
padding: "10px",
|
|
96
181
|
}}
|
|
@@ -98,26 +183,32 @@
|
|
|
98
183
|
<Button>Normal Button</Button>
|
|
99
184
|
<br />
|
|
100
185
|
<br />
|
|
101
|
-
<Button
|
|
102
|
-
|
|
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)
|
|
103
194
|
</Button>
|
|
104
195
|
</div>
|
|
105
196
|
</div>
|
|
106
197
|
</div>
|
|
107
198
|
|
|
108
199
|
<div className="demo-container">
|
|
109
|
-
<h3>
|
|
200
|
+
<h3>6. Multiple Expand Buttons</h3>
|
|
110
201
|
<div className="visual-container">
|
|
111
202
|
<FlexRow gap="10px">
|
|
112
|
-
<Button
|
|
113
|
-
<Button
|
|
114
|
-
<Button
|
|
203
|
+
<Button expandX>ExpandX 1</Button>
|
|
204
|
+
<Button expandX>ExpandX 2</Button>
|
|
205
|
+
<Button expandX>ExpandX 3</Button>
|
|
115
206
|
</FlexRow>
|
|
116
207
|
</div>
|
|
117
208
|
</div>
|
|
118
209
|
|
|
119
210
|
<div className="demo-container">
|
|
120
|
-
<h3>
|
|
211
|
+
<h3>7. Button Spacing - Margins</h3>
|
|
121
212
|
<div className="visual-container">
|
|
122
213
|
<FlexColumn gap="5px">
|
|
123
214
|
<Button margin="10px">Margin All Sides</Button>
|
|
@@ -143,7 +234,7 @@
|
|
|
143
234
|
</div>
|
|
144
235
|
|
|
145
236
|
<div className="demo-container">
|
|
146
|
-
<h3>
|
|
237
|
+
<h3>8. Button AlignX Test: FlexRow + alignX="end"</h3>
|
|
147
238
|
<div className="visual-container">
|
|
148
239
|
<div className="bounded">
|
|
149
240
|
<FlexRow gap="10px" style={{ height: "100%" }}>
|
|
@@ -155,12 +246,12 @@
|
|
|
155
246
|
</div>
|
|
156
247
|
|
|
157
248
|
<div className="demo-container">
|
|
158
|
-
<h3>
|
|
249
|
+
<h3>9. Combined Spacing and ExpandX</h3>
|
|
159
250
|
<div className="visual-container">
|
|
160
251
|
<FlexRow gap="10px">
|
|
161
252
|
<Button>Label</Button>
|
|
162
|
-
<Button
|
|
163
|
-
Margin + Padding +
|
|
253
|
+
<Button expandX marginY="5px" paddingX="20px">
|
|
254
|
+
Margin + Padding + ExpandX
|
|
164
255
|
</Button>
|
|
165
256
|
<Button>End</Button>
|
|
166
257
|
</FlexRow>
|
|
@@ -168,20 +259,20 @@
|
|
|
168
259
|
</div>
|
|
169
260
|
|
|
170
261
|
<div className="demo-container">
|
|
171
|
-
<h3>
|
|
262
|
+
<h3>10. Button Toolbar Layout</h3>
|
|
172
263
|
<div className="visual-container">
|
|
173
264
|
<FlexRow gap="10px">
|
|
174
265
|
<Button>New</Button>
|
|
175
266
|
<Button>Open</Button>
|
|
176
267
|
<Button>Save</Button>
|
|
177
|
-
<Button
|
|
268
|
+
<Button expandX>Status Message Area</Button>
|
|
178
269
|
<Button alignX="end">Settings</Button>
|
|
179
270
|
</FlexRow>
|
|
180
271
|
</div>
|
|
181
272
|
</div>
|
|
182
273
|
|
|
183
274
|
<div className="demo-container">
|
|
184
|
-
<h3>
|
|
275
|
+
<h3>11. Button Group with Various Alignments</h3>
|
|
185
276
|
<div className="visual-container">
|
|
186
277
|
<FlexColumn gap="10px">
|
|
187
278
|
<FlexRow gap="10px">
|
|
@@ -191,7 +282,7 @@
|
|
|
191
282
|
</FlexRow>
|
|
192
283
|
|
|
193
284
|
<FlexRow gap="10px">
|
|
194
|
-
<Button
|
|
285
|
+
<Button expandX>Primary Action</Button>
|
|
195
286
|
<Button>Cancel</Button>
|
|
196
287
|
</FlexRow>
|
|
197
288
|
|
|
@@ -204,7 +295,7 @@
|
|
|
204
295
|
</div>
|
|
205
296
|
|
|
206
297
|
<div className="demo-container">
|
|
207
|
-
<h3>
|
|
298
|
+
<h3>12. Card Layout with Button Actions</h3>
|
|
208
299
|
<div className="visual-container">
|
|
209
300
|
<div
|
|
210
301
|
style={{
|
|
@@ -220,7 +311,7 @@
|
|
|
220
311
|
</p>
|
|
221
312
|
|
|
222
313
|
<FlexRow gap="10px">
|
|
223
|
-
<Button
|
|
314
|
+
<Button expandX>Primary Action</Button>
|
|
224
315
|
<Button alignX="end">More</Button>
|
|
225
316
|
</FlexRow>
|
|
226
317
|
</div>
|
|
@@ -228,12 +319,12 @@
|
|
|
228
319
|
</div>
|
|
229
320
|
|
|
230
321
|
<div className="demo-container">
|
|
231
|
-
<h3>
|
|
322
|
+
<h3>13. Navigation Button Layout</h3>
|
|
232
323
|
<div className="visual-container">
|
|
233
324
|
<FlexColumn gap="15px">
|
|
234
325
|
<FlexRow gap="10px">
|
|
235
326
|
<Button>Home</Button>
|
|
236
|
-
<Button
|
|
327
|
+
<Button expandX>Current Page Title</Button>
|
|
237
328
|
<Button alignX="end">Profile</Button>
|
|
238
329
|
</FlexRow>
|
|
239
330
|
|
package/src/components/layout/demos/{demo_use_layout_style.html → demo_layout_style_input.html}
RENAMED
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
<div className="visual-container">
|
|
69
69
|
<FlexRow gap="10px">
|
|
70
70
|
<Button>Start</Button>
|
|
71
|
-
<Input placeholder="Expanding input"
|
|
71
|
+
<Input placeholder="Expanding input" expandX />
|
|
72
72
|
<Button>End</Button>
|
|
73
73
|
</FlexRow>
|
|
74
74
|
</div>
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
<div className="visual-container">
|
|
80
80
|
<FlexColumn gap="10px" style={{ height: "200px" }}>
|
|
81
81
|
<Input placeholder="Fixed input" />
|
|
82
|
-
<Input placeholder="Expanding input (height)"
|
|
82
|
+
<Input placeholder="Expanding input (height)" expandY />
|
|
83
83
|
<Input placeholder="Fixed input" />
|
|
84
84
|
</FlexColumn>
|
|
85
85
|
</div>
|
|
@@ -35,7 +35,8 @@ import { FlexDirectionContext } from "./layout_context.jsx";
|
|
|
35
35
|
* @param {string|number} [props.paddingBottom] - Bottom padding
|
|
36
36
|
* @param {"start"|"center"|"end"|"stretch"} [props.alignX] - Horizontal alignment
|
|
37
37
|
* @param {"start"|"center"|"end"|"stretch"} [props.alignY] - Vertical alignment
|
|
38
|
-
* @param {boolean} [props.
|
|
38
|
+
* @param {boolean} [props.expandX] - Whether element should expand horizontally to fill available space
|
|
39
|
+
* @param {boolean} [props.expandY] - Whether element should expand vertically to fill available space
|
|
39
40
|
* @returns {Object} Object with categorized styles: { margin, padding, alignment, expansion, all }
|
|
40
41
|
*/
|
|
41
42
|
export const useLayoutStyle = (props) => {
|
|
@@ -200,13 +201,32 @@ export const useLayoutStyle = (props) => {
|
|
|
200
201
|
expand: {
|
|
201
202
|
const expand = props.expand;
|
|
202
203
|
delete props.expand;
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
204
|
+
|
|
205
|
+
expandX: {
|
|
206
|
+
const expandX = props.expandX || expand;
|
|
207
|
+
delete props.expandX;
|
|
208
|
+
if (expandX) {
|
|
209
|
+
if (flexDirection === "row") {
|
|
210
|
+
expansionStyle.flexGrow = 1; // Grow horizontally in row
|
|
211
|
+
} else if (flexDirection === "column") {
|
|
212
|
+
expansionStyle.width = "100%"; // Take full width in column
|
|
213
|
+
} else {
|
|
214
|
+
expansionStyle.width = "100%"; // Take full width outside flex
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
expandY: {
|
|
220
|
+
const expandY = props.expandY || expand;
|
|
221
|
+
delete props.expandY;
|
|
222
|
+
if (expandY) {
|
|
223
|
+
if (flexDirection === "row") {
|
|
224
|
+
expansionStyle.height = "100%"; // Take full height in row
|
|
225
|
+
} else if (flexDirection === "column") {
|
|
226
|
+
expansionStyle.flexGrow = 1; // Grow vertically in column
|
|
227
|
+
} else {
|
|
228
|
+
expansionStyle.height = "100%"; // Take full height outside flex
|
|
229
|
+
}
|
|
210
230
|
}
|
|
211
231
|
}
|
|
212
232
|
}
|
/package/src/components/layout/demos/{demo_use_layout_style_text.html → demo_layout_style_text.html}
RENAMED
|
File without changes
|