ywana-core8 0.0.278 → 0.0.279

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": "ywana-core8",
3
- "version": "0.0.278",
3
+ "version": "0.0.279",
4
4
  "description": "ywana-core8",
5
5
  "author": "Ernesto Roldan Garcia",
6
6
  "license": "MIT",
package/src/site/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './site'
2
2
  export * from './siteContext'
3
3
  export * from './page'
4
- export * from './dialog'
4
+ export * from './dialog'
5
+ export * from './view'
@@ -0,0 +1,41 @@
1
+ .view {
2
+ flex: 1;
3
+ border: solid 1px rgb(200,200,200);;
4
+ display: flex;
5
+ flex-direction: column;
6
+ }
7
+
8
+ .view>header {
9
+ width: 100%;
10
+ display: flex;
11
+ align-items: center;
12
+ background-color: rgb(200,200,200);
13
+ }
14
+
15
+ .view>header>label {
16
+ flex: 1;
17
+ }
18
+
19
+ .view>nav {
20
+ display: flex;
21
+ flex-direction: ;
22
+ align-items: center;
23
+ justify-content: flex-end;
24
+ background-color: rgb(230,230,230);
25
+ }
26
+
27
+ .view>nav>* {
28
+ border-radius: 0px !important;
29
+ }
30
+
31
+ .view>main {
32
+ flex: 1;
33
+ height: 100%;
34
+ }
35
+
36
+ .view>footer {
37
+ width: 100%;
38
+ display: flex;
39
+ align-items: center;
40
+ background-color: rgb(230,230,230);
41
+ }
@@ -0,0 +1,35 @@
1
+ import React, { useState } from 'react'
2
+ import { Icon, MenuIcon } from '../html'
3
+ import './view.css'
4
+
5
+ /**
6
+ * View
7
+ */
8
+ export const View = (props) => {
9
+
10
+ const { icon, title, toolbar, menu, info, onClose, canCollapse = false, children } = props
11
+ const [open, setOpen] = useState(true)
12
+
13
+ function toggle() {
14
+ setOpen(!open)
15
+ }
16
+
17
+ function close() {
18
+ if (onClose) onClose()
19
+ }
20
+
21
+ return (
22
+ <div className='view'>
23
+ <header>
24
+ {canCollapse ? <Icon icon="expand_more" size="small" clickable action={toggle} /> : null}
25
+ {icon ? <Icon icon={icon} size="small" /> : null}
26
+ {title ? <label>{title}</label> : null}
27
+ {menu ? <MenuIcon align="alignRight">{menu}</MenuIcon> : null}
28
+ {onClose ? <Icon icon="close" size="small" clickable action={close} /> : null}
29
+ </header>
30
+ {toolbar ? <nav>{toolbar}</nav> : null}
31
+ {open ? <main>{children}</main> : null}
32
+ {info ? <footer>{info}</footer> : null}
33
+ </div>
34
+ )
35
+ }
@@ -0,0 +1,41 @@
1
+ import React, { useState } from 'react'
2
+ import { Icon, MenuItem, Chip } from '../html'
3
+ import { View } from './view'
4
+
5
+ const ViewTest = (prop) => {
6
+
7
+ function close() {
8
+ alert('close view')
9
+ }
10
+
11
+ const menu = [
12
+ <MenuItem key="option1" label="option1" action={() => alert('1')} />
13
+ ]
14
+
15
+ const toolbar = [
16
+ <Icon key="action1" icon="person" clickable size="small"/>,
17
+ <Icon key="action2 " icon="people" clickable size="small"/>
18
+ ]
19
+
20
+ const info = [
21
+ <Chip label="Info1" />,
22
+ <Chip label="Info2" />,
23
+ <Chip label="Info3" />
24
+ ]
25
+
26
+ return (
27
+ <div style={{ padding: "1rem", height: "20rem" }}>
28
+ <View
29
+ canCollapse={true}
30
+ icon="star"
31
+ title="Title"
32
+ menu={menu}
33
+ onClose={close}
34
+ toolbar={toolbar}
35
+ info={info}
36
+ >
37
+ hola
38
+ </View>
39
+ </div>
40
+ )
41
+ }
@@ -49,7 +49,7 @@ const UploadIcon = ({ icon = "folder_open", resumable }) => {
49
49
  resumable.assignBrowse(iconElement.current)
50
50
  console.log('uploadicon')
51
51
  }
52
- }, [])
52
+ }, [iconElement])
53
53
 
54
54
  return (
55
55
  <div className="upload-icon" ref={iconElement}>
@@ -23,7 +23,7 @@ export const UploadDialog = ({ label, target, accept, onSuccess, onClose }) => {
23
23
 
24
24
  const actions = (
25
25
  <Fragment>
26
- <Button label="CLOSE" action={() => onAction("CLOSE")} />
26
+ <Button label="CERRAR" action={() => onAction("CLOSE")} />
27
27
  </Fragment>
28
28
  )
29
29