musae 0.1.6 → 0.1.7

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.
@@ -0,0 +1,4 @@
1
+ import { DividerProps } from "./types";
2
+ import React from "react";
3
+ declare const Divider: (props: DividerProps) => React.JSX.Element;
4
+ export default Divider;
@@ -0,0 +1,9 @@
1
+ import React, { useMemo } from 'react';
2
+ import { StyledWrapper } from './styled.js';
3
+
4
+ const Divider = (props) => {
5
+ const hasChildren = useMemo(() => !!props.children, [props.children]);
6
+ return React.createElement(StyledWrapper, { hasChildren: hasChildren }, props.children);
7
+ };
8
+
9
+ export { Divider as default };
@@ -0,0 +1,2 @@
1
+ import Divider from "./divider";
2
+ export { Divider };
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import type { DividerRenderProps } from "./types";
3
+ export declare const StyledWrapper: import("@emotion/styled").StyledComponent<{
4
+ theme?: import("@emotion/react").Theme | undefined;
5
+ as?: import("react").ElementType<any> | undefined;
6
+ } & DividerRenderProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -0,0 +1,13 @@
1
+ import styled from '@emotion/styled';
2
+
3
+ const StyledWrapper = styled.div(({ hasChildren }) => {
4
+ if (!hasChildren) {
5
+ return {
6
+ margin: "1.5rem 0",
7
+ borderBlockStart: "1px solid rgba(5, 5, 5, 0.06)",
8
+ };
9
+ }
10
+ return {};
11
+ });
12
+
13
+ export { StyledWrapper };
@@ -0,0 +1,7 @@
1
+ import { ReactNode } from "react";
2
+ export interface DividerProps {
3
+ children: ReactNode;
4
+ }
5
+ export interface DividerRenderProps {
6
+ hasChildren: boolean;
7
+ }
package/dist/index.d.ts CHANGED
@@ -11,6 +11,8 @@ export { Button } from "./button";
11
11
  export { Switch } from "./switch";
12
12
  export { Radio, RadioGroup } from "./radio";
13
13
  export { Checkbox } from "./checkbox";
14
+ export { Row } from "./row";
15
+ export { Divider } from "./divider";
14
16
  /**
15
17
  * @description
16
18
  * hooks
package/dist/index.js CHANGED
@@ -8,4 +8,6 @@ export { default as Switch } from './switch/switch.js';
8
8
  export { default as Radio } from './radio/radio.js';
9
9
  export { default as RadioGroup } from './radio/group.js';
10
10
  export { default as Checkbox } from './checkbox/checkbox.js';
11
+ export { default as Row } from './row/row.js';
12
+ export { default as Divider } from './divider/divider.js';
11
13
  export { useMessage } from './message/hooks.js';
@@ -0,0 +1,2 @@
1
+ import Row from "./row";
2
+ export { Row };
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import type { RowProps } from "./types";
3
+ declare const Row: (props: RowProps) => React.JSX.Element;
4
+ export default Row;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { StyledWrapper } from './styled.js';
3
+
4
+ const Row = (props) => {
5
+ return React.createElement(StyledWrapper, null, props.children);
6
+ };
7
+
8
+ export { Row as default };
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ export declare const StyledWrapper: import("@emotion/styled").StyledComponent<{
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ as?: import("react").ElementType<any> | undefined;
5
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -0,0 +1,8 @@
1
+ import styled from '@emotion/styled';
2
+
3
+ const StyledWrapper = styled.div({
4
+ display: "grid",
5
+ gridTemplateColumns: "repeat(24, minmax(0, 1fr))",
6
+ });
7
+
8
+ export { StyledWrapper };
@@ -0,0 +1,4 @@
1
+ import type { ReactNode } from "react";
2
+ export interface RowProps {
3
+ children: ReactNode;
4
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "musae",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "musae-ui",
5
5
  "author": "tutu@fantufantu.com",
6
6
  "license": "MIT",