forstok-ui-lib 5.0.0 → 5.0.1

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": "forstok-ui-lib",
3
- "version": "5.0.0",
3
+ "version": "5.0.1",
4
4
  "description": "Forstok UI Components Library",
5
5
  "path": "dist",
6
6
  "main": "dist/index.js",
@@ -0,0 +1,56 @@
1
+ import styled, { css } from 'styled-components'
2
+
3
+ const PartialFormContainerStyles = css`
4
+ display: grid;
5
+ grid-row-gap: 12px;
6
+ grid-column-gap: 16px;
7
+ width: 100%;
8
+ margin-bottom: 12px;
9
+ align-items: start;
10
+ `
11
+
12
+ const getFormContainerModifiedStyles = ({ name }:{ name?: string }) => {
13
+ let style = ``
14
+ if (name === 'invoiceForm') {
15
+ style += `
16
+ grid-gap: 15px;
17
+ `
18
+ }
19
+ return style
20
+ }
21
+
22
+ const getInnerFormContainerModifiedStyles =({ $width }:{ $width?: string | number }) => {
23
+ let style = ``
24
+ if ($width) {
25
+ style += `
26
+ @media (min-width: 768px) {
27
+ width: ${$width};
28
+ }
29
+ `
30
+ }
31
+ return style
32
+ }
33
+
34
+ export const FormContainer = styled.form.attrs((props: { name?: string; autoComplete?: string }) => ({
35
+ name: props.name || 'form',
36
+ autoComplete: props.autoComplete || 'off'
37
+ }))<{ name?: string }>`
38
+ display: inline-grid;
39
+ grid-auto-flow: row;
40
+ grid-gap: 25px;
41
+ width: 100%;
42
+ height: 100%;
43
+ [class*='singleValue'] {
44
+ width: 100%;
45
+ color: var(--inp-clr);
46
+ ._refLabel {
47
+ top: 5.5px;
48
+ right: 0;
49
+ }
50
+ }
51
+ ${getFormContainerModifiedStyles}
52
+ `
53
+ export const SingleFormContainer = styled.section<{ $width?: string | number }>`
54
+ ${PartialFormContainerStyles}
55
+ ${getInnerFormContainerModifiedStyles}
56
+ `
@@ -14,4 +14,6 @@ export { default as ReactPortalComponent } from './portal';
14
14
 
15
15
  export * from './dropdown/typed';
16
16
  export * from './message/typed';
17
- export * from './popup/typed';
17
+ export * from './popup/typed';
18
+
19
+ export * from './form/styles';