forstok-ui-lib 5.1.0 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "forstok-ui-lib",
3
- "version": "5.1.0",
3
+ "version": "5.1.2",
4
4
  "description": "Forstok UI Components Library",
5
5
  "path": "dist",
6
6
  "main": "dist/index.js",
@@ -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
+ `
@@ -1,6 +1,7 @@
1
1
  export { default as TextComponent } from './text';
2
2
  export { default as LinkComponent } from './link';
3
3
  export { default as InputComponent } from './input';
4
+ export { default as InputRefComponent } from './input/ref';
4
5
  export { default as CheckboxComponent } from './checkbox';
5
6
  export { default as ButtonComponent } from './button';
6
7
  export { default as LabelComponent } from './label';
@@ -12,6 +13,8 @@ export { default as MessageQuestionComponent } from './message/question';
12
13
  export { default as PopupComponent } from './popup';
13
14
  export { default as ReactPortalComponent } from './portal';
14
15
  export { default as ImageComponent } from './image';
16
+ export { default as SelectComponent } from './select';
17
+ export { default as ErrorComponent } from './error';
15
18
 
16
19
  export * from './dropdown/typed';
17
20
  export * from './message/typed';