forstok-ui-lib 5.1.1 → 5.1.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/dist/index.d.ts +6 -1
- package/dist/index.js +37 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +37 -14
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/error/index.tsx +14 -0
- package/src/components/error/styles.ts +58 -0
- package/src/components/index.ts +2 -0
package/package.json
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import IconComponent from '../icon';
|
|
3
|
+
import { ErrorContainer } from './styles';
|
|
4
|
+
|
|
5
|
+
const ErrorComponent = ({ children, $mode, ...props }:{ children?: ReactNode, $mode?: string }) => {
|
|
6
|
+
return (
|
|
7
|
+
<ErrorContainer $mode={$mode} className='_refErrorContainer' {...props}>
|
|
8
|
+
<IconComponent $name='alert' $width='11px'></IconComponent>
|
|
9
|
+
{children}
|
|
10
|
+
</ErrorContainer>
|
|
11
|
+
)
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default ErrorComponent
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import styled from 'styled-components'
|
|
2
|
+
import { multiElipsis } from '../../assets/stylesheets/bases.styles';
|
|
3
|
+
|
|
4
|
+
const getErrorModifiedStyle = ({ $mode }: { $mode?: string }) => {
|
|
5
|
+
let style = ``
|
|
6
|
+
if ($mode === 'api')
|
|
7
|
+
style += `
|
|
8
|
+
color: var(--mt-clr);
|
|
9
|
+
width: auto;
|
|
10
|
+
padding: .5em .5em;
|
|
11
|
+
margin: 10px;
|
|
12
|
+
font-weight: 400;
|
|
13
|
+
`
|
|
14
|
+
else if ($mode === 'table')
|
|
15
|
+
style += `
|
|
16
|
+
font-size: 12.5px;
|
|
17
|
+
> i {
|
|
18
|
+
top: 1.5px;
|
|
19
|
+
}
|
|
20
|
+
`
|
|
21
|
+
else if ($mode === 'list')
|
|
22
|
+
style += `
|
|
23
|
+
ul {
|
|
24
|
+
margin: 0;
|
|
25
|
+
padding: 0;
|
|
26
|
+
list-style: none;
|
|
27
|
+
li {
|
|
28
|
+
font-size: 12.5px;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
`
|
|
32
|
+
return style
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export const ErrorContainer = styled.div<{ $mode?: string }>`
|
|
36
|
+
display: inline-grid !important;
|
|
37
|
+
grid-auto-flow: column !important;
|
|
38
|
+
grid-template-columns: min-content !important;
|
|
39
|
+
grid-gap: 1px !important;
|
|
40
|
+
align-items: baseline !important;
|
|
41
|
+
color: var(--err-clr);
|
|
42
|
+
align-content: center !important;
|
|
43
|
+
width: 100%;
|
|
44
|
+
text-align: left;
|
|
45
|
+
font-size: 12px;
|
|
46
|
+
line-height: 1 !important;
|
|
47
|
+
margin-top: 4px;
|
|
48
|
+
font-weight: 400;
|
|
49
|
+
position: relative;
|
|
50
|
+
padding-left: 14px;
|
|
51
|
+
${multiElipsis}
|
|
52
|
+
> i {
|
|
53
|
+
position: absolute;
|
|
54
|
+
top: 1px;
|
|
55
|
+
left: 0;
|
|
56
|
+
}
|
|
57
|
+
${getErrorModifiedStyle}
|
|
58
|
+
`
|
package/src/components/index.ts
CHANGED
|
@@ -14,6 +14,8 @@ export { default as PopupComponent } from './popup';
|
|
|
14
14
|
export { default as ReactPortalComponent } from './portal';
|
|
15
15
|
export { default as ImageComponent } from './image';
|
|
16
16
|
export { default as SelectComponent } from './select';
|
|
17
|
+
export { default as ErrorComponent } from './error';
|
|
18
|
+
|
|
17
19
|
export * from './dropdown/typed';
|
|
18
20
|
export * from './message/typed';
|
|
19
21
|
export * from './popup/typed';
|