@ttoss/layouts 0.3.4 → 0.3.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttoss/layouts",
3
- "version": "0.3.4",
3
+ "version": "0.3.6",
4
4
  "description": "Layout components for React",
5
5
  "author": "ttoss",
6
6
  "contributors": [
@@ -25,7 +25,7 @@
25
25
  "sideEffects": false,
26
26
  "peerDependencies": {
27
27
  "react": ">=16.8.0",
28
- "@ttoss/ui": "^5.0.4"
28
+ "@ttoss/ui": "^5.0.6"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/jest": "^29.5.13",
@@ -33,9 +33,9 @@
33
33
  "jest": "^29.7.0",
34
34
  "react": "^18.3.1",
35
35
  "tsup": "^8.3.0",
36
- "@ttoss/config": "^1.32.10",
37
- "@ttoss/test-utils": "^2.1.14",
38
- "@ttoss/ui": "^5.0.4"
36
+ "@ttoss/config": "^1.33.0",
37
+ "@ttoss/test-utils": "^2.1.15",
38
+ "@ttoss/ui": "^5.0.6"
39
39
  },
40
40
  "keywords": [
41
41
  "React"
package/dist/esm/index.js DELETED
@@ -1,118 +0,0 @@
1
- /** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
2
-
3
- // src/components/BaseLayout.tsx
4
- import { Box } from "@ttoss/ui";
5
- import { jsx } from "react/jsx-runtime";
6
- var BaseLayout = props => {
7
- return /* @__PURE__ */jsx(Box, {
8
- ...props,
9
- children: props.children
10
- });
11
- };
12
-
13
- // src/components/Layout.tsx
14
- import { Container } from "@ttoss/ui";
15
-
16
- // src/components/Footer.tsx
17
- import { Box as Box2 } from "@ttoss/ui";
18
- import { jsx as jsx2 } from "react/jsx-runtime";
19
- var Footer = props => {
20
- return /* @__PURE__ */jsx2(Box2, {
21
- variant: "layout.footer",
22
- ...props,
23
- as: "footer",
24
- children: props.children
25
- });
26
- };
27
- Footer.displayName = "Footer";
28
-
29
- // src/components/Header.tsx
30
- import { Box as Box3 } from "@ttoss/ui";
31
- import { jsx as jsx3 } from "react/jsx-runtime";
32
- var Header = props => {
33
- return /* @__PURE__ */jsx3(Box3, {
34
- variant: "layout.header",
35
- ...props,
36
- as: "header",
37
- children: props.children
38
- });
39
- };
40
- Header.displayName = "Header";
41
-
42
- // src/components/Main.tsx
43
- import { Box as Box4 } from "@ttoss/ui";
44
- import { jsx as jsx4 } from "react/jsx-runtime";
45
- var Main = props => {
46
- return /* @__PURE__ */jsx4(Box4, {
47
- variant: "layout.main",
48
- ...props,
49
- as: "main",
50
- children: props.children
51
- });
52
- };
53
- Main.displayName = "Main";
54
-
55
- // src/components/Layout.tsx
56
- import { jsx as jsx5 } from "react/jsx-runtime";
57
- var Layout = ({
58
- children,
59
- ...props
60
- }) => {
61
- return /* @__PURE__ */jsx5(BaseLayout, {
62
- variant: "layout.layout",
63
- ...props,
64
- children
65
- });
66
- };
67
- Layout.Header = Header;
68
- Layout.Main = Main;
69
- Layout.Footer = Footer;
70
- Layout.Container = Container;
71
-
72
- // src/getSemanticElements.ts
73
- import * as React from "react";
74
- var semanticComponents = {
75
- Header: "header",
76
- Footer: "footer",
77
- Main: "main"
78
- };
79
- var getSematicElements = ({
80
- children
81
- }) => {
82
- const semanticElements = {};
83
- React.Children.forEach(children, child => {
84
- const displayName = child?.type?.displayName;
85
- if (!displayName) {
86
- return;
87
- }
88
- if (semanticComponents[displayName]) {
89
- semanticElements[semanticComponents[displayName]] = child;
90
- }
91
- });
92
- return semanticElements;
93
- };
94
-
95
- // src/components/StackedLayout.tsx
96
- import { jsxs } from "react/jsx-runtime";
97
- var StackedLayout = ({
98
- children,
99
- ...props
100
- }) => {
101
- const {
102
- header,
103
- main,
104
- footer
105
- } = getSematicElements({
106
- children
107
- });
108
- return /* @__PURE__ */jsxs(BaseLayout, {
109
- ...props,
110
- sx: {
111
- display: "flex",
112
- flexDirection: "column",
113
- ...props.sx
114
- },
115
- children: [header, main, footer]
116
- });
117
- };
118
- export { Footer, Header, Layout, Main, StackedLayout };
package/dist/index.d.ts DELETED
@@ -1,42 +0,0 @@
1
- import * as react from 'react';
2
- import * as react_jsx_runtime from 'react/jsx-runtime';
3
- import { BoxProps } from '@ttoss/ui';
4
-
5
- type BaseLayoutProps = BoxProps;
6
-
7
- type LayoutProps = BaseLayoutProps;
8
- declare const Layout: {
9
- ({ children, ...props }: LayoutProps): react_jsx_runtime.JSX.Element;
10
- Header: {
11
- (props: BoxProps): react_jsx_runtime.JSX.Element;
12
- displayName: string;
13
- };
14
- Main: {
15
- (props: BoxProps): react_jsx_runtime.JSX.Element;
16
- displayName: string;
17
- };
18
- Footer: {
19
- (props: BoxProps): react_jsx_runtime.JSX.Element;
20
- displayName: string;
21
- };
22
- Container: react.ForwardRefExoticComponent<BoxProps & react.RefAttributes<HTMLDivElement>>;
23
- };
24
-
25
- declare const Header: {
26
- (props: BoxProps): react_jsx_runtime.JSX.Element;
27
- displayName: string;
28
- };
29
-
30
- declare const Footer: {
31
- (props: BoxProps): react_jsx_runtime.JSX.Element;
32
- displayName: string;
33
- };
34
-
35
- declare const Main: {
36
- (props: BoxProps): react_jsx_runtime.JSX.Element;
37
- displayName: string;
38
- };
39
-
40
- declare const StackedLayout: ({ children, ...props }: BaseLayoutProps) => react_jsx_runtime.JSX.Element;
41
-
42
- export { Footer, Header, Layout, Main, StackedLayout };