@ttoss/layouts 0.6.1 → 0.7.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/README.md +20 -0
- package/dist/esm/index.js +18 -13
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -162,6 +162,26 @@ All components integrate seamlessly with `@ttoss/ui` theme system via `sx` prop:
|
|
|
162
162
|
</Layout.Main>
|
|
163
163
|
```
|
|
164
164
|
|
|
165
|
+
### Layout Variant Usage
|
|
166
|
+
|
|
167
|
+
The `Main` component applies `variant="layout.container"` to its internal Container, ensuring consistent layout width and padding based on your theme. Define `layout.container` in your theme for global control:
|
|
168
|
+
|
|
169
|
+
```js
|
|
170
|
+
// theme.js
|
|
171
|
+
export const theme = {
|
|
172
|
+
layout: {
|
|
173
|
+
container: {
|
|
174
|
+
maxWidth: ['100%', '1100px'],
|
|
175
|
+
minWidth: ['100%', '1100px'],
|
|
176
|
+
marginX: 'auto',
|
|
177
|
+
paddingX: '4',
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
};
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Other layout components (Header, Sidebar, Footer) also accept the `variant` prop for theme-driven customization.
|
|
184
|
+
|
|
165
185
|
## Advanced Usage
|
|
166
186
|
|
|
167
187
|
### Custom Components with displayName
|
package/dist/esm/index.js
CHANGED
|
@@ -7,7 +7,7 @@ var __name = (target, value) => __defProp(target, "name", {
|
|
|
7
7
|
});
|
|
8
8
|
|
|
9
9
|
// src/components/Layout.tsx
|
|
10
|
-
import { Box as
|
|
10
|
+
import { Box as Box8, Container as Container2 } from "@ttoss/ui";
|
|
11
11
|
|
|
12
12
|
// src/components/Footer.tsx
|
|
13
13
|
import { Box } from "@ttoss/ui";
|
|
@@ -2428,7 +2428,7 @@ var Header = /* @__PURE__ */__name(({
|
|
|
2428
2428
|
Header.displayName = "Header";
|
|
2429
2429
|
|
|
2430
2430
|
// src/components/Main.tsx
|
|
2431
|
-
import {
|
|
2431
|
+
import { Box as Box7, Container } from "@ttoss/ui";
|
|
2432
2432
|
|
|
2433
2433
|
// src/components/MainBody.tsx
|
|
2434
2434
|
import { Box as Box4 } from "@ttoss/ui";
|
|
@@ -2490,14 +2490,19 @@ MainHeader.displayName = "MainHeader";
|
|
|
2490
2490
|
|
|
2491
2491
|
// src/components/Main.tsx
|
|
2492
2492
|
var Main = /* @__PURE__ */__name(props => {
|
|
2493
|
-
return /* @__PURE__ */React.createElement(
|
|
2493
|
+
return /* @__PURE__ */React.createElement(Box7, {
|
|
2494
2494
|
variant: "layout.main",
|
|
2495
2495
|
sx: {
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
overflow: "hidden"
|
|
2496
|
+
overflowX: "auto",
|
|
2497
|
+
flex: 1
|
|
2499
2498
|
}
|
|
2500
|
-
},
|
|
2499
|
+
}, /* @__PURE__ */React.createElement(Container, {
|
|
2500
|
+
variant: "layout.container",
|
|
2501
|
+
sx: {
|
|
2502
|
+
display: "flex",
|
|
2503
|
+
flexDirection: "column"
|
|
2504
|
+
}
|
|
2505
|
+
}, props.children));
|
|
2501
2506
|
}, "Main");
|
|
2502
2507
|
Main.displayName = "Main";
|
|
2503
2508
|
Main.Header = MainHeader;
|
|
@@ -2508,7 +2513,7 @@ Main.Footer = MainFooter;
|
|
|
2508
2513
|
var Layout = /* @__PURE__ */__name(({
|
|
2509
2514
|
children
|
|
2510
2515
|
}) => {
|
|
2511
|
-
return /* @__PURE__ */React.createElement(
|
|
2516
|
+
return /* @__PURE__ */React.createElement(Box8, {
|
|
2512
2517
|
variant: "layout.layout"
|
|
2513
2518
|
}, children);
|
|
2514
2519
|
}, "Layout");
|
|
@@ -2516,10 +2521,10 @@ Layout.Header = Header;
|
|
|
2516
2521
|
Layout.Sidebar = Sidebar;
|
|
2517
2522
|
Layout.Main = Main;
|
|
2518
2523
|
Layout.Footer = Footer;
|
|
2519
|
-
Layout.Container =
|
|
2524
|
+
Layout.Container = Container2;
|
|
2520
2525
|
|
|
2521
2526
|
// src/components/SidebarCollapseLayout.tsx
|
|
2522
|
-
import { Flex as Flex3, Stack
|
|
2527
|
+
import { Flex as Flex3, Stack } from "@ttoss/ui";
|
|
2523
2528
|
|
|
2524
2529
|
// src/getSemanticElements.ts
|
|
2525
2530
|
import * as React7 from "react";
|
|
@@ -2560,7 +2565,7 @@ var SidebarCollapseLayout = /* @__PURE__ */__name(({
|
|
|
2560
2565
|
} = getSematicElements({
|
|
2561
2566
|
children
|
|
2562
2567
|
});
|
|
2563
|
-
return /* @__PURE__ */React.createElement(LayoutProvider, null, /* @__PURE__ */React.createElement(
|
|
2568
|
+
return /* @__PURE__ */React.createElement(LayoutProvider, null, /* @__PURE__ */React.createElement(Stack, {
|
|
2564
2569
|
...props,
|
|
2565
2570
|
sx: {
|
|
2566
2571
|
height: ["100vh"],
|
|
@@ -2579,7 +2584,7 @@ var SidebarCollapseLayout = /* @__PURE__ */__name(({
|
|
|
2579
2584
|
}, "SidebarCollapseLayout");
|
|
2580
2585
|
|
|
2581
2586
|
// src/components/StackedLayout.tsx
|
|
2582
|
-
import { Stack as
|
|
2587
|
+
import { Stack as Stack2 } from "@ttoss/ui";
|
|
2583
2588
|
import * as React8 from "react";
|
|
2584
2589
|
var StackedLayout = /* @__PURE__ */__name(({
|
|
2585
2590
|
children,
|
|
@@ -2592,7 +2597,7 @@ var StackedLayout = /* @__PURE__ */__name(({
|
|
|
2592
2597
|
} = getSematicElements({
|
|
2593
2598
|
children
|
|
2594
2599
|
});
|
|
2595
|
-
return /* @__PURE__ */React8.createElement(LayoutProvider, null, /* @__PURE__ */React8.createElement(
|
|
2600
|
+
return /* @__PURE__ */React8.createElement(LayoutProvider, null, /* @__PURE__ */React8.createElement(Stack2, props, header, main, footer));
|
|
2596
2601
|
}, "StackedLayout");
|
|
2597
2602
|
export { Layout, SidebarCollapseLayout, StackedLayout, useIsDesktop };
|
|
2598
2603
|
/*! Bundled license information:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/layouts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Layout components for React",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "ttoss",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"sideEffects": false,
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"react": ">=16.8.0",
|
|
28
|
-
"@ttoss/
|
|
29
|
-
"@ttoss/
|
|
28
|
+
"@ttoss/components": "^2.11.2",
|
|
29
|
+
"@ttoss/ui": "^6.3.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/jest": "^30.0.0",
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"jest": "^30.2.0",
|
|
35
35
|
"react": "^19.2.1",
|
|
36
36
|
"tsup": "^8.5.1",
|
|
37
|
-
"@ttoss/components": "^2.11.
|
|
37
|
+
"@ttoss/components": "^2.11.2",
|
|
38
38
|
"@ttoss/config": "^1.35.12",
|
|
39
|
-
"@ttoss/test-utils": "^4.0.2",
|
|
40
39
|
"@ttoss/react-icons": "^0.5.6",
|
|
41
|
-
"@ttoss/
|
|
40
|
+
"@ttoss/test-utils": "^4.0.2",
|
|
41
|
+
"@ttoss/ui": "^6.3.0"
|
|
42
42
|
},
|
|
43
43
|
"keywords": [
|
|
44
44
|
"React"
|