Skip to content

Commit

Permalink
Merge pull request #28 from dhis2/update-upstreams
Browse files Browse the repository at this point in the history
Update upstreams
  • Loading branch information
varl authored Apr 20, 2020
2 parents 9188293 + de0a157 commit fbd392e
Show file tree
Hide file tree
Showing 13 changed files with 251 additions and 66 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# [5.0.0-alpha.5](https://github.com/dhis2/ui/compare/v5.0.0-alpha.4...v5.0.0-alpha.5) (2020-04-16)


### Code Refactoring

* layers and overlay components ([24ead4c](https://github.com/dhis2/ui/commit/24ead4c31a650cfedf3221a5086baf911ea1e544))
Expand Down
15 changes: 9 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
"name": "root",
"version": "5.0.0-alpha.5",
"repository": "[email protected]:dhis2/ui.git",
"repository": {
"type": "git",
"url": "https://github.com/dhis2/ui.git"
},
"author": "Viktor Varland <[email protected]>",
"license": "BSD-3-Clause",
"private": true,
Expand Down Expand Up @@ -45,21 +48,21 @@
"watch:widgets": "yarn build:widgets --watch --dev"
},
"devDependencies": {
"@dhis2/cli-app-scripts": "^3.2.5",
"@dhis2/cli-style": "^6.0.0",
"@dhis2/cli-app-scripts": "^3.2.9",
"@dhis2/cli-style": "^7.0.0",
"@dhis2/cli-utils-cypress": "^1.0.2",
"@dhis2/cli-utils-docsite": "^1.3.0",
"@storybook/addons": "^5.3.9",
"@storybook/components": "^5.3.14",
"@storybook/csf": "^0.0.1",
"@storybook/preset-create-react-app": "^1.5.2",
"@storybook/react": "^5.3.14",
"@storybook/preset-create-react-app": "^2.1.1",
"@storybook/react": "^5.3.17",
"@wertarbyte/react-props-md-table": "^1.1.1",
"concurrently": "^5.1.0",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.2",
"react": "16.8",
"react-dev-utils": "^10.2.0",
"react-dev-utils": "^10.2.1",
"react-docgen": "^5.3.0",
"react-dom": "16.8",
"styled-jsx": "^3.2.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/constants/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"build": "d2-app-scripts build"
},
"dependencies": {
"@dhis2/prop-types": "^1.5.0"
"@dhis2/prop-types": "^1.6.4"
},
"files": [
"build"
Expand Down
2 changes: 1 addition & 1 deletion packages/forms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"react-dom": "^16.8"
},
"dependencies": {
"@dhis2/prop-types": "^1.5",
"@dhis2/prop-types": "^1.6.4",
"@dhis2/ui-core": "5.0.0-alpha.5",
"@dhis2/ui-widgets": "5.0.0-alpha.5",
"classnames": "^2.2.6",
Expand Down
27 changes: 27 additions & 0 deletions packages/icons/src/Cancel--outline.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React from 'react'
import propTypes from '@dhis2/prop-types'

export function CancelOutline({ className }) {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 16 16"
className={className}
>
<path d="M11.2928932,3.29289322 L12.7071068,4.70710678 L9.41389322,7.99989322 L12.7071068,11.2928932 L11.2928932,12.7071068 L7.99989322,9.41389322 L4.70710678,12.7071068 L3.29289322,11.2928932 L6.58589322,7.99989322 L3.29289322,4.70710678 L4.70710678,3.29289322 L7.99989322,6.58589322 L11.2928932,3.29289322 Z" />

<style jsx>{`
svg {
fill: inherit;
height: 16px;
width: 16px;
vertical-align: middle;
pointer-events: none;
}
`}</style>
</svg>
)
}
CancelOutline.propTypes = {
className: propTypes.string,
}
1 change: 1 addition & 0 deletions packages/icons/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ export * from './Single.js'
export * from './Status.js'
export * from './Switch.js'
export * from './Upload.js'
export * from './Cancel--outline.js'
39 changes: 39 additions & 0 deletions packages/widgets/i18n/zh_CN.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Translators:
# 晓东 林 <[email protected]>, 2020
#
msgid ""
msgstr ""
"Project-Id-Version: i18next-conv\n"
"POT-Creation-Date: 2020-02-18T13:19:29.126Z\n"
"PO-Revision-Date: 2019-08-12 21:09+0000\n"
"Last-Translator: 晓东 林 <[email protected]>, 2020\n"
"Language-Team: Chinese (China) (https://www.transifex.com/hisp-uio/teams/100509/zh_CN/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: zh_CN\n"
"Plural-Forms: nplurals=1; plural=0;\n"

msgid "Search apps"
msgstr "搜索APP"

msgid "Edit profile"
msgstr "编辑基本信息"

msgid "Settings"
msgstr "设置"

msgid "Account"
msgstr "账号"

msgid "Help"
msgstr "帮助"

msgid "About DHIS2"
msgstr "关于DHIS2"

msgid "Logout"
msgstr "退出"

msgid "Something went wrong with loading the children."
msgstr "载入下属资源出错"
2 changes: 1 addition & 1 deletion packages/widgets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"dependencies": {
"@dhis2/app-runtime": "^2.1.0",
"@dhis2/d2-i18n": "^1",
"@dhis2/prop-types": "^1.5",
"@dhis2/prop-types": "^1.6.4",
"@dhis2/ui-constants": "5.0.0-alpha.5",
"@dhis2/ui-core": "5.0.0-alpha.5",
"@dhis2/ui-icons": "5.0.0-alpha.5",
Expand Down
10 changes: 10 additions & 0 deletions packages/widgets/src/Chip/Chip.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { Remove } from './Remove.js'
*/
const Chip = ({
selected,
dense,
disabled,
dragging,
overflow,
Expand All @@ -36,6 +37,7 @@ const Chip = ({
}}
className={cx(className, {
selected,
dense,
disabled,
dragging,
})}
Expand All @@ -60,6 +62,12 @@ const Chip = ({
color: ${colors.grey900};
}
.dense {
height: 24px;
font-size: 13px;
line-height: 15px;
}
span:hover {
background-color: ${colors.grey300};
}
Expand Down Expand Up @@ -110,6 +118,7 @@ Chip.defaultProps = {
* @prop {function} [onClick]
* @prop {function} [onRemove]
* @prop {boolean} [selected]
* @prop {boolean} [dense]
* @prop {boolean} [disabled]
* @prop {boolean} [dragging]
* @prop {boolean} [overflow]
Expand All @@ -119,6 +128,7 @@ Chip.propTypes = {
children: propTypes.string,
className: propTypes.string,
dataTest: propTypes.string,
dense: propTypes.bool,
disabled: propTypes.bool,
dragging: propTypes.bool,
icon: propTypes.element,
Expand Down
8 changes: 8 additions & 0 deletions packages/widgets/src/Chip/Chip.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ storiesOf('Component/Widget/Chip', module)
</Chip>
))

.add('Dense', () => <Chip dense>I am dense</Chip>)

.add('Dense removeable', () => (
<Chip dense onRemove={onRemove}>
Removeable and dense
</Chip>
))

const Globe = () => (
<svg role="img" viewBox="0 0 24 24" height="100px" width="100px">
<title>LGTM icon</title>
Expand Down
27 changes: 15 additions & 12 deletions packages/widgets/src/Chip/Remove.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,34 @@ import React from 'react'
import propTypes from '@dhis2/prop-types'
import { css, resolve } from 'styled-jsx/css'

import { Cancel } from '@dhis2/ui-icons'
import { CancelOutline } from '@dhis2/ui-icons'
import { colors } from '@dhis2/ui-constants'

const containerStyle = css`
span {
display: block;
height: 18px;
width: 18px;
display: flex;
justify-content: center;
align-items: center;
height: 20px;
width: 20px;
margin-right: 4px;
border-radius: 12px;
margin-left: -8px;
}
span:hover {
background: ${colors.grey400};
}
`

const removeIcon = resolve`
svg {
color: ${colors.grey700};
height: 18px;
width: 18px;
fill: ${colors.grey600};
height: 16px;
width: 16px;
cursor: pointer;
opacity: 1;
pointer-events: all;
}
svg:hover {
opacity: 0.82;
}
`

export const Remove = ({ onRemove, dataTest }) => {
Expand All @@ -42,7 +45,7 @@ export const Remove = ({ onRemove, dataTest }) => {
}}
data-test={dataTest}
>
<Cancel className={removeIcon.className} />
<CancelOutline className={removeIcon.className} />
{removeIcon.styles}

<style jsx>{containerStyle}</style>
Expand Down
1 change: 1 addition & 0 deletions packages/widgets/src/MultiSelect/SelectionList.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const SelectionList = ({ selected, onChange, disabled, options }) => (
onRemove={onRemove}
disabled={isDisabled}
overflow
dense
>
{selectedOption.props.label}
</Chip>
Expand Down
Loading

0 comments on commit fbd392e

Please sign in to comment.