forstok-ui-lib 5.1.16 → 5.2.2

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.1.16",
3
+ "version": "5.2.2",
4
4
  "description": "Forstok UI Components Library",
5
5
  "path": "dist",
6
6
  "main": "dist/index.js",
@@ -9,7 +9,8 @@
9
9
  "scripts": {
10
10
  "test": "echo \"Error: no test specified\" && exit 1",
11
11
  "build": "rollup -c --bundleConfigAsCjs",
12
- "publish": "git add . && git commit -m 'patch' && git push origin master && npm run build && npm version patch && npm publish"
12
+ "patch": "npm run build && npm version patch && npm publish",
13
+ "master": "git add . && git commit -m 'patch' && git push origin master"
13
14
  },
14
15
  "repository": {
15
16
  "type": "git",
@@ -1,5 +1,5 @@
1
1
  import styled, { css } from 'styled-components';
2
- import { responseWidth} from './bases.styles';
2
+ import { responseWidth, formLabel} from './bases.styles';
3
3
 
4
4
  const getTabsContentModFunc = ({ $mode }:{ $mode?: string }) => {
5
5
  let style = ``
@@ -20,6 +20,46 @@ const getTabsContentModFunc = ({ $mode }:{ $mode?: string }) => {
20
20
  }
21
21
  return style
22
22
  }
23
+ const getInputGroupModFunc = ({ $mode, $required }:{ $mode?: string, $required?: boolean }) => {
24
+ let style = ``
25
+ if ($mode === 'column') {
26
+ style +=`
27
+ display: grid;
28
+ grid-auto-flow: column;
29
+ grid-template-columns: 1.1fr 2fr;
30
+ align-items: baseline;
31
+ grid-gap: 10px;
32
+ > label, > aside {
33
+ padding: 0;
34
+ margin: 0;
35
+ }
36
+ `
37
+ } else if ($mode === 'column-product') {
38
+ style +=`
39
+ > div {
40
+ display: grid;
41
+ grid-auto-flow: column;
42
+ grid-template-columns: max-content auto;
43
+ grid-gap: 10px;
44
+ ${MuteLabel} {
45
+ display: grid;
46
+ align-items: center;
47
+ }
48
+ }
49
+ `
50
+ }
51
+ if ($required) {
52
+ style +=`
53
+ > label, > aside {
54
+ &:after {
55
+ content: '*';
56
+ color: red;
57
+ }
58
+ }
59
+ `
60
+ }
61
+ return style
62
+ }
23
63
 
24
64
  export const PanelContainer = styled.section`
25
65
  position: relative;
@@ -166,4 +206,42 @@ export const InfoGroup = styled.div`
166
206
  overflow-wrap: break-word;
167
207
  word-break: break-word;
168
208
  }
209
+ `
210
+ export const MuteLabel = styled.span<{ $size?: string }>`
211
+ color: var(--mt-clr);
212
+ font-size: 12px;
213
+ word-break: break-all;
214
+ &._refWithIcon {
215
+ display: grid;
216
+ grid-auto-flow: column;
217
+ justify-content: start;
218
+ grid-gap: 4px;
219
+ * {
220
+ margin-right: 0;
221
+ }
222
+ }
223
+ ${({ $size }:{ $size?: string }) => {
224
+ if ($size === 'medium')
225
+ return css`
226
+ font-size: 13px;
227
+ line-height: 12px;
228
+ * {
229
+ margin-right: 4px;
230
+ }
231
+ `
232
+ }}
233
+ `
234
+ export const InputGroup = styled.article<{ $mode?: string, $required?: boolean }>`
235
+ > label,
236
+ > aside {
237
+ ${formLabel}
238
+ margin-bottom: 6px;
239
+ padding: 0 6px;
240
+ display: block;
241
+ font-size: 14px;
242
+ }
243
+ > div {
244
+ display: grid;
245
+ }
246
+ ${getInputGroupModFunc}
169
247
  `