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/dist/index.d.ts +8 -1
- package/dist/index.js +35 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +35 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/form/styles.ts +56 -0
- package/src/components/index.ts +3 -1
package/package.json
CHANGED
|
@@ -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
|
+
`
|
package/src/components/index.ts
CHANGED