File tree 4 files changed +79
-1
lines changed
4 files changed +79
-1
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @beeinventor/dasiot-react-component-lib" ,
3
- "version" : " 1.4.2 " ,
3
+ "version" : " 1.5.0 " ,
4
4
"module" : " lib/index.js" ,
5
5
"types" : " lib/index.d.ts" ,
6
6
"files" : [
Original file line number Diff line number Diff line change
1
+ import React from 'react' ;
2
+ import { Meta , Story } from '@storybook/react' ;
3
+
4
+ import OrgText , { OrgTextProps } from '.' ;
5
+
6
+ export default {
7
+ title : 'Components/OrgText' ,
8
+ component : OrgText ,
9
+ argTypes : { } ,
10
+ parameters : {
11
+ backgrounds : { default : 'light' } ,
12
+ } ,
13
+ } as Meta ;
14
+
15
+ const Template : Story < OrgTextProps > = ( args ) => < OrgText { ...args } /> ;
16
+
17
+ export const Default : Story < OrgTextProps > = Template . bind ( { } ) ;
18
+
19
+ Default . args = {
20
+ orgName : 'BeeInventor' ,
21
+ } ;
22
+
23
+ export const SpecificColor : Story < OrgTextProps > = Template . bind ( { } ) ;
24
+
25
+ SpecificColor . args = {
26
+ ...Default . args ,
27
+ orgColor : '#58B99E' ,
28
+ } ;
Original file line number Diff line number Diff line change
1
+ import { styled , Box , BoxProps } from '@mui/material' ;
2
+ import React from 'react' ;
3
+
4
+ interface ContainerProps {
5
+ orgColor : string | undefined ;
6
+ }
7
+
8
+ const shouldForwardProp = ( propName : PropertyKey ) => propName !== 'orgColor' ;
9
+ const Container = styled ( Box , { shouldForwardProp } ) < ContainerProps > `
10
+ display: inline-flex;
11
+ align-items: center;
12
+ font-size: 1rem;
13
+ line-height: 1.5;
14
+ font-weight: 500;
15
+ color: ${ ( { theme } ) => theme . color . secondary . $100 } ;
16
+ padding: 4px 15px 4px 0;
17
+
18
+ & > span.org-name {
19
+ &::before {
20
+ display: inline-block;
21
+ content: '';
22
+ width: 6px;
23
+ height: 0.875rem;
24
+ background-color: ${ ( { theme, orgColor } ) =>
25
+ orgColor ? orgColor : theme . color . primary . $100 } ;
26
+ border-radius: 3px;
27
+ margin-right: 8px;
28
+ }
29
+ }
30
+ ` ;
31
+
32
+ export interface OrgTextProps extends BoxProps {
33
+ orgColor : string | undefined ;
34
+ orgName : string ;
35
+ }
36
+
37
+ const OrgText : React . FC < OrgTextProps > = ( {
38
+ orgColor,
39
+ orgName,
40
+ ...otherProps
41
+ } ) => {
42
+ return (
43
+ < Container orgColor = { orgColor } { ...otherProps } >
44
+ < span className = "org-name" > { orgName } </ span >
45
+ </ Container >
46
+ ) ;
47
+ } ;
48
+
49
+ export default OrgText ;
Original file line number Diff line number Diff line change @@ -10,3 +10,4 @@ export { default as DropdownColor } from './Dropdown/DropdownColor';
10
10
export { default as DatePicker } from './DatePicker' ;
11
11
export { default as Step } from './Step' ;
12
12
export { default as SearchTextField } from './SearchTextField' ;
13
+ export { default as OrgText } from './OrgText' ;
You can’t perform that action at this time.
0 commit comments