@dtdot/lego 2.0.0-12 → 2.0.0-13

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,7 @@
1
+ import React from 'react';
2
+ export interface ControlLineProps {
3
+ children: React.ReactNode;
4
+ variant?: 'action' | 'spaced';
5
+ }
6
+ declare const ControlLine: ({ children, variant }: ControlLineProps) => JSX.Element | null;
7
+ export default ControlLine;
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+ import styled from 'styled-components';
3
+ const ActionContainer = styled.div `
4
+ display: flex;
5
+ width: 100%;
6
+
7
+ > :first-child {
8
+ flex-grow: 1;
9
+ padding-right: 3px;
10
+ }
11
+ `;
12
+ const SpacedContainer = styled.div `
13
+ display: flex;
14
+
15
+ > * {
16
+ flex-grow: 1;
17
+ padding-right: 3px;
18
+ }
19
+
20
+ > *:last-child {
21
+ padding-right: 0;
22
+ }
23
+ `;
24
+ const ControlLine = ({ children, variant = 'action' }) => {
25
+ if (variant === 'action') {
26
+ return React.createElement(ActionContainer, null, children);
27
+ }
28
+ if (variant === 'spaced') {
29
+ return React.createElement(SpacedContainer, null, children);
30
+ }
31
+ return null;
32
+ };
33
+ export default ControlLine;
@@ -10,7 +10,7 @@ import { ControlStyles } from '../../shared/ControlStyles';
10
10
  import useFormNode, { getValue } from '../Form/useFormNode.hook';
11
11
  const InputContainer = styled.div `
12
12
  position: relative;
13
- margin: 2px 0;
13
+ border-radius: 2px;
14
14
 
15
15
  background-color: ${(props) => props.theme.colours.controlBackground};
16
16
  `;
package/build/index.d.ts CHANGED
@@ -12,6 +12,7 @@ export { default as Card } from './components/Card/Card.component';
12
12
  export { default as CardGroup } from './components/Card/CardGroup.component';
13
13
  export { default as Checklist } from './components/Checklist/Checklist.component';
14
14
  export { default as ControlGroup } from './components/ControlGroup/ControlGroup.component';
15
+ export { default as ControlLine } from './components/ControlLine/ControlLine.component';
15
16
  export { default as FancyCheckbox } from './components/FancyCheckbox/FancyCheckbox.component';
16
17
  export { default as Form } from './components/Form/Form.component';
17
18
  export { default as Notification } from './components/Notification/Notification.component';
package/build/index.js CHANGED
@@ -12,6 +12,7 @@ export { default as Card } from './components/Card/Card.component';
12
12
  export { default as CardGroup } from './components/Card/CardGroup.component';
13
13
  export { default as Checklist } from './components/Checklist/Checklist.component';
14
14
  export { default as ControlGroup } from './components/ControlGroup/ControlGroup.component';
15
+ export { default as ControlLine } from './components/ControlLine/ControlLine.component';
15
16
  export { default as FancyCheckbox } from './components/FancyCheckbox/FancyCheckbox.component';
16
17
  export { default as Form } from './components/Form/Form.component';
17
18
  export { default as Notification } from './components/Notification/Notification.component';
@@ -16,7 +16,7 @@ export const ControlStyles = css `
16
16
  color: ${(props) => getThemeControlColours(props.theme).font};
17
17
  background-color: ${(props) => getThemeControlColours(props.theme).background};
18
18
 
19
- border: 1px solid ${(props) => getThemeControlColours(props.theme).border};
19
+ border: 1px solid ${(props) => getThemeControlColours(props.theme).background};
20
20
  border-radius: 2px;
21
21
 
22
22
  &:hover {
@@ -35,9 +35,11 @@ const darkTheme = {
35
35
  faintBorder: '#cccccc1f',
36
36
  controlBackground: '#5e6167',
37
37
  controlBackgroundDisabled: '#47494d',
38
- controlBorder: '#565656',
38
+ controlBorder: '#595b5e',
39
+ // controlBorder: '#565656',
39
40
  controlBorderFocus: '#4289de',
40
- controlBorderHover: '#4a4949',
41
+ controlBorderHover: '#686c74',
42
+ // controlBorderHover: '#4a4949',
41
43
  controlPlaceholder: '#949494',
42
44
  controlDescriptionColour: '#cbcbcb',
43
45
  uploadBackground: '#5e6167',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dtdot/lego",
3
- "version": "2.0.0-12",
3
+ "version": "2.0.0-13",
4
4
  "description": "Some reusable components for building my applications",
5
5
  "main": "build/index.js",
6
6
  "scripts": {