@startupjs-ui/layout 0.1.3

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/CHANGELOG.md ADDED
@@ -0,0 +1,20 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
+
6
+ ## [0.1.3](https://github.com/startupjs/startupjs-ui/compare/v0.1.2...v0.1.3) (2025-12-29)
7
+
8
+ **Note:** Version bump only for package @startupjs-ui/layout
9
+
10
+
11
+
12
+
13
+
14
+ ## [0.1.2](https://github.com/startupjs/startupjs-ui/compare/v0.1.1...v0.1.2) (2025-12-29)
15
+
16
+
17
+ ### Features
18
+
19
+ * add mdx and docs packages. Refactor docs to get rid of any @startupjs/ui usage and use startupjs-ui instead ([703c926](https://github.com/startupjs/startupjs-ui/commit/703c92636efb0421ffd11783f692fc892b74018f))
20
+ * refactor Br, Layout, Portal ([d5f4dcd](https://github.com/startupjs/startupjs-ui/commit/d5f4dcd17e834ceae95decfc1df38bda2b5a17ab))
package/README.mdx ADDED
@@ -0,0 +1,51 @@
1
+ import Div from '@startupjs-ui/div'
2
+ import Layout, { _PropsJsonSchema as LayoutPropsJsonSchema } from './index'
3
+ import Span from '@startupjs-ui/span'
4
+ import { u } from 'startupjs'
5
+ import { Sandbox } from '@startupjs-ui/docs'
6
+ import './index.mdx.cssx.styl'
7
+
8
+ # Layout
9
+
10
+ `Layout` serves as the root element of the application. It purpose is to render content within the safe area boundaries of a device. Also it displays a [StatusBar](https://reactnative.dev/docs/statusbar) for `android` & `ios` native apps.
11
+
12
+ ```jsx
13
+ import { Layout } from 'startupjs-ui'
14
+ ```
15
+
16
+
17
+ ## Simple example
18
+
19
+ ```jsx example
20
+ return (
21
+ <Layout style={{
22
+ backgroundColor: '#fff',
23
+ height: u(25),
24
+ alignItems: 'center',
25
+ justifyContent: 'center'
26
+ }}>
27
+ <Span>Layout area</Span>
28
+ </Layout>
29
+ )
30
+ ```
31
+
32
+ ## Sandbox
33
+
34
+ <Sandbox
35
+ Component={Layout}
36
+ propsJsonSchema={LayoutPropsJsonSchema}
37
+ props={{
38
+ style: {
39
+ backgroundColor: '#f1f1f1',
40
+ height: u(25),
41
+ alignItems: 'center',
42
+ justifyContent: 'center'
43
+ },
44
+ children: (
45
+ <Div styleName='child'>
46
+ <Span>Lorem ipsum</Span>
47
+ </Div>
48
+ )
49
+ }}
50
+ block
51
+ />
@@ -0,0 +1,20 @@
1
+ // ----- CONFIG: $UI.Layout
2
+
3
+ $this = merge({
4
+ bgColor: var(--color-bg-main)
5
+ }, $UI.Layout, true)
6
+
7
+ // ----- COMPONENT
8
+
9
+ .root
10
+ height 100%
11
+ background-color $this.bgColor
12
+ overflow hidden
13
+
14
+ +web()
15
+ overflow-x hidden
16
+
17
+ // ----- JS EXPORTS
18
+
19
+ :export
20
+ config: $this
package/index.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ /* eslint-disable */
2
+ // DO NOT MODIFY THIS FILE - IT IS AUTOMATICALLY GENERATED ON COMMITS.
3
+
4
+ import { type ReactNode } from 'react';
5
+ import { type StyleProp, type ViewStyle } from 'react-native';
6
+ export declare const _PropsJsonSchema: {};
7
+ export interface LayoutProps {
8
+ /** Custom styles applied to the root safe area view */
9
+ style?: StyleProp<ViewStyle>;
10
+ /** Content rendered inside layout */
11
+ children?: ReactNode;
12
+ }
13
+ declare const _default: import("react").ComponentType<LayoutProps>;
14
+ export default _default;
@@ -0,0 +1,6 @@
1
+ .child
2
+ height 15u
3
+ align-items center
4
+ justify-content center
5
+ padding 2u
6
+ background-color #00AED6
package/index.tsx ADDED
@@ -0,0 +1,29 @@
1
+ import { type ReactNode } from 'react'
2
+ import { SafeAreaView, StatusBar, type StyleProp, type ViewStyle } from 'react-native'
3
+ import { pug, observer } from 'startupjs'
4
+ import { themed } from '@startupjs-ui/core'
5
+ import STYLES from './index.cssx.styl'
6
+
7
+ const { config: { bgColor } } = STYLES
8
+
9
+ export const _PropsJsonSchema = {/* LayoutProps */}
10
+
11
+ export interface LayoutProps {
12
+ /** Custom styles applied to the root safe area view */
13
+ style?: StyleProp<ViewStyle>
14
+ /** Content rendered inside layout */
15
+ children?: ReactNode
16
+ }
17
+
18
+ function Layout ({ children }: LayoutProps): ReactNode {
19
+ return pug`
20
+ SafeAreaView.root(part='root')
21
+ StatusBar(
22
+ backgroundColor=bgColor
23
+ barStyle='dark-content'
24
+ )
25
+ = children
26
+ `
27
+ }
28
+
29
+ export default observer(themed('Layout', Layout))
package/package.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "@startupjs-ui/layout",
3
+ "version": "0.1.3",
4
+ "publishConfig": {
5
+ "access": "public"
6
+ },
7
+ "main": "index.tsx",
8
+ "types": "index.d.ts",
9
+ "type": "module",
10
+ "dependencies": {
11
+ "@startupjs-ui/core": "^0.1.3"
12
+ },
13
+ "peerDependencies": {
14
+ "react": "*",
15
+ "react-native": "*",
16
+ "startupjs": "*"
17
+ },
18
+ "gitHead": "fd964ebc3892d3dd0a6c85438c0af619cc50c3f0"
19
+ }