forstok-ui-lib 5.1.16 → 5.2.3
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 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +35 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -2
- package/src/assets/stylesheets/shares.styles.ts +79 -1
- package/src/components/button/index.tsx +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "forstok-ui-lib",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.2.3",
|
|
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
|
-
"
|
|
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
|
`
|
|
@@ -16,7 +16,7 @@ type TButton = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
const ButtonComponent = ({ children, $mode, $isIndicatorArrow=false, isIndicatorArrowColor='initial', $isShown=true, $shadow=false, $isLoading=false, refContainer, $activated=false, $size, $iconLeft, ...props }: TButton) => {
|
|
19
|
-
const { disabled } = props;
|
|
19
|
+
const { type, disabled } = props;
|
|
20
20
|
const IndicatorArrowIconEl = $isIndicatorArrow ? (
|
|
21
21
|
<IndicatorsArrowIconSvg color={isIndicatorArrowColor} height='20' width='20' viewBox='0 0 20 20' aria-hidden='true' focusable='false'>
|
|
22
22
|
<path d='M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z'></path>
|
|
@@ -24,6 +24,7 @@ const ButtonComponent = ({ children, $mode, $isIndicatorArrow=false, isIndicator
|
|
|
24
24
|
) : null;
|
|
25
25
|
return (
|
|
26
26
|
<ButtonContainer
|
|
27
|
+
type={type || 'button'}
|
|
27
28
|
{...$mode && { name: $mode }}
|
|
28
29
|
$mode={$mode}
|
|
29
30
|
$isIndicatorArrow={$isIndicatorArrow ? true : false}
|