forstok-ui-lib 8.2.2 → 8.3.0

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": "8.2.2",
3
+ "version": "8.3.0",
4
4
  "description": "Forstok UI Components Library",
5
5
  "path": "dist",
6
6
  "main": "dist/index.js",
@@ -3678,31 +3678,45 @@ export const DropdownTitle = styled.div`
3678
3678
  font-style: normal;
3679
3679
  }
3680
3680
  `
3681
+
3681
3682
  export const DropdownList = styled.ul<{ $mode?: 'no-border' }>`
3682
3683
  ${clearList}
3683
3684
  max-height: 44vh;
3684
3685
  overflow: auto;
3685
3686
  > li {
3686
- padding: 8px 1em;
3687
3687
  border-bottom: ${({ $mode }:{ $mode?: 'no-border' }) => $mode === 'no-border' ? 'none' : '1px solid var(--pri-clr-ln)'};
3688
3688
  &:last-child {
3689
3689
  border-bottom: 0;
3690
3690
  }
3691
3691
  }
3692
+ @media only screen and (min-width: 768px) {
3693
+ padding: 8px;
3694
+ }
3692
3695
  @media only screen and (min-width: 1366px) {
3693
3696
  max-height: 50vh;
3694
3697
  }
3695
3698
  `
3696
- export const DropdownItem = styled.li<{ $mode?: 'categories' }>`
3699
+ export const DropdownItem = styled.li<{ $mode?: 'common' | 'categories', $isActive?: boolean, $isReply?: boolean }>`
3697
3700
  display: inline-grid;
3698
3701
  width: 100%;
3699
3702
  grid-gap: 10px;
3700
3703
  min-height: 48px;
3701
3704
  grid-auto-flow: row;
3705
+ cursor: pointer;
3706
+ position: relative;
3702
3707
  @media only screen and (min-width: 768px) {
3703
3708
  grid-auto-flow: column;
3704
3709
  grid-template-columns: 100px auto;
3705
3710
  }
3711
+ ${({ $mode }) => !$mode && css`
3712
+ padding: 8px .5em;
3713
+ &:first-child {
3714
+ padding-top: 4px;
3715
+ }
3716
+ &:last-child {
3717
+ padding-bottom: 4px;
3718
+ }
3719
+ `}
3706
3720
  ${({ $mode }) => $mode === 'categories' && css`
3707
3721
  grid-auto-flow: column;
3708
3722
  grid-template-columns: 22px auto;
@@ -3717,6 +3731,61 @@ export const DropdownItem = styled.li<{ $mode?: 'categories' }>`
3717
3731
  grid-template-columns: 22px auto;
3718
3732
  }
3719
3733
  `}
3734
+ ${({ $mode }) => $mode === 'common' && css`
3735
+ margin-bottom: 4px;
3736
+ color: var(--pri-clr);
3737
+ line-height: 20px;
3738
+ align-items: center;
3739
+ padding: .5rem .75rem;
3740
+ display: block;
3741
+ min-height: auto;
3742
+ border-radius: var(--nav-rd);
3743
+ &:hover {
3744
+ background-color: var(--nav-clr-bg__hvr);
3745
+ border-radius: var(--nav-rd);
3746
+ }
3747
+ &:last-child {
3748
+ margin-bottom: 0;
3749
+ }
3750
+ > label, > span {
3751
+ cursor: pointer;
3752
+ text-transform: capitalize;
3753
+ width: 100%;
3754
+ max-width: 218px;
3755
+ overflow: hidden;
3756
+ text-overflow: ellipsis;
3757
+ white-space: nowrap;
3758
+ display: block;
3759
+ }
3760
+ `}
3761
+ ${({ $mode, $isReply }) => ($mode === 'common' && $isReply) && css`
3762
+ padding-right: 1.825rem !important;
3763
+ ._refReplyIcon {
3764
+ right: 12px;
3765
+ top: 50%;
3766
+ transform: translateY(-50%);
3767
+ }
3768
+ `}
3769
+ ${({ $mode, $isActive }) => ($mode === 'common' && $isActive) && css`
3770
+ background-color: var(--nav-clr-bg__hvr);
3771
+ padding-right: 1.75em;
3772
+ &, > label, > span {
3773
+ font-weight: 500;
3774
+ }
3775
+ &:after {
3776
+ content: '✔';
3777
+ position: absolute;
3778
+ top: 50%;
3779
+ transform: translateY(-50%);
3780
+ right: 7px;
3781
+ bottom: 0;
3782
+ width: 12px;
3783
+ height: 20px;
3784
+ }
3785
+ ._refReplyIcon {
3786
+ right: 22px;
3787
+ }
3788
+ `}
3720
3789
  `
3721
3790
  export const DropdownAction = styled.div`
3722
3791
  padding: .8em 1em 1em;
@@ -4398,8 +4467,8 @@ export const NavChildItem = styled.div<{ $activated?: boolean, $mode?: 'counter'
4398
4467
  position: relative;
4399
4468
  grid-gap: 6px;
4400
4469
  margin-left: 1.5rem;
4401
- margin-top: .125rem;
4402
- margin-bottom: .125rem;
4470
+ margin-top: 0;
4471
+ margin-bottom: 4px;
4403
4472
  padding-top: .25rem;
4404
4473
  padding-bottom: .25rem;
4405
4474
  padding-left: .5rem;
@@ -4630,19 +4699,23 @@ export const ItemQtyLabel = styled.span`
4630
4699
  display: grid;
4631
4700
  `
4632
4701
 
4633
- export const APILabel = styled.label`
4634
- color: var(--act-clr);
4702
+ export const OptCustomLabel = styled.label<{$mode?: string}>`
4635
4703
  font-size: 10px;
4636
- text-transform: uppercase;
4704
+ text-transform: capitalize;
4637
4705
  letter-spacing: .5px;
4638
4706
  padding: 3px 5px;
4639
- background-color: #21BA45;
4640
4707
  display: block;
4641
4708
  position: absolute;
4642
4709
  right: 10px;
4643
- top: 12px;
4710
+ top: 50%;
4711
+ transform: translateY(-50%);
4644
4712
  z-index: 1;
4645
- border-radius: var(--ter-rd);
4713
+ background-color: #EFEFEF;
4714
+ border-radius: var(--nav-rd);
4715
+ color: var(--pri-clr);
4716
+ ${({ $mode }) => $mode === 'label' && css`
4717
+ transform: translateY(0);
4718
+ `}
4646
4719
  `
4647
4720
 
4648
4721
  export const TableContentWrapper = styled.div<{ $mode?: 'package' }>`
@@ -1,6 +1,6 @@
1
1
  import Image from '.'
2
2
 
3
- import { InitialContainer, APILabel } from '../../assets/stylesheets/shares.styles'
3
+ import { InitialContainer, OptCustomLabel } from '../../assets/stylesheets/shares.styles'
4
4
  import LinkComponent from '../link';
5
5
 
6
6
  import { ImageMode } from './typed'
@@ -89,7 +89,7 @@ const ImageChannelComponent = (props: TImage) => {
89
89
  ) : (
90
90
  <span className='multi-elipsis' title={defName}>
91
91
  {defName}
92
- {isAPI && <APILabel className='_refLabel'>API</APILabel>}
92
+ {isAPI && <OptCustomLabel className='_refLabel'>API</OptCustomLabel>}
93
93
  </span>
94
94
  )
95
95
  )}
@@ -45,7 +45,15 @@ export const RadioSpan = styled.span<{ $mode?: string }>`
45
45
  border: none;
46
46
  }
47
47
  `
48
- }
48
+ } else if ($mode === 'sort') {
49
+ return css`
50
+ padding-left: 0;
51
+ &:before,
52
+ &:after {
53
+ border: none;
54
+ }
55
+ `
56
+ }
49
57
  }}
50
58
  `
51
59
 
@@ -80,6 +88,20 @@ export const RadioInput = styled.input<{ $mode?: string }>`
80
88
  }
81
89
  }
82
90
  `
91
+ } else if ($mode === 'sort') {
92
+ return css`
93
+ &:checked + ${RadioSpan} {
94
+ &:before,
95
+ &:after {
96
+ border: none;
97
+ transform: none;
98
+ background: none;
99
+ }
100
+ &:before {
101
+ width: 14px;
102
+ }
103
+ }
104
+ `
83
105
  }
84
106
  }}
85
107
  `
@@ -153,16 +153,36 @@ const SelectAllComponent = (props: TSelect) => {
153
153
  } as CSSObjectWithLabel),
154
154
  option: (provided: CSSObject, state: { isSelected: any }) => ({
155
155
  ...provided,
156
- color: state.isSelected ? '#ffffff' : '#000000',
157
- backgroundColor: state.isSelected ? '#fc5c64' : 'transparent',
156
+ width: '100%',
157
+ margin: '0 0 4px',
158
+ color: 'var(--pri-clr)',
159
+ borderRadius: 'var(--nav-rd)',
160
+ backgroundColor: state.isSelected ? 'var(--nav-clr-bg__hvr)' : 'transparent',
158
161
  cursor: 'pointer',
162
+ overflowWrap: 'break-word',
163
+ wordBreak: 'break-all',
164
+ fontWeight: state.isSelected ? 500 : 'normal',
165
+ position: 'relative',
159
166
  '&:hover': {
160
- backgroundColor: '#ec5b62',
161
- color: '#ffffff'
162
- }
167
+ backgroundColor: 'var(--nav-clr-bg__hvr)',
168
+ },
169
+ ...(state.isSelected && {
170
+ paddingRight: '1.75em',
171
+ '&:after': {
172
+ content: '"✔"',
173
+ position: 'absolute',
174
+ top: '50%',
175
+ transform: 'translateY(-50%)',
176
+ right: '7px',
177
+ bottom: '0',
178
+ width: '12px',
179
+ height: '20px'
180
+ }
181
+ })
163
182
  } as CSSObjectWithLabel),
164
183
  menu: (provided: CSSObject) => ({
165
184
  ...provided,
185
+ padding: '8px',
166
186
  borderRadius: '.75rem',
167
187
  boxShadow: '0rem .5rem 1.5rem -.5rem rgba(0, 0, 0, .05), 0rem .5rem 1rem -.25rem rgba(0, 0, 0, .05), 0rem .1875rem .375rem 0rem rgba(0, 0, 0, .05), 0rem .125rem .25rem 0rem rgba(0, 0, 0, .05), 0rem .0625rem .125rem 0rem rgba(0, 0, 0, .05), 0rem 0rem 0rem .0625rem rgba(0, 0, 0, .06)',
168
188
  border: 'none'
@@ -182,16 +182,36 @@ const SelectAsyncPaginateComponent = ({ loadOptions, ...props }: TSelect) => {
182
182
  } as CSSObjectWithLabel),
183
183
  option: (provided: CSSObject, state: OptionProps<TOption, boolean>) => ({
184
184
  ...provided,
185
- color: state.isSelected ? '#ffffff' : '#000000',
186
- backgroundColor: state.isSelected || state.isFocused ? '#fc5c64' : 'transparent',
185
+ width: '100%',
186
+ margin: '0 0 4px',
187
+ color: 'var(--pri-clr)',
188
+ borderRadius: 'var(--nav-rd)',
189
+ backgroundColor: state.isSelected || state.isFocused ? 'var(--nav-clr-bg__hvr)' : 'transparent',
187
190
  cursor: 'pointer',
191
+ overflowWrap: 'break-word',
192
+ wordBreak: 'break-all',
193
+ fontWeight: state.isSelected ? 500 : 'normal',
194
+ position: 'relative',
188
195
  '&:hover': {
189
- backgroundColor: '#ec5b62',
190
- color: '#ffffff'
191
- }
196
+ backgroundColor: 'var(--nav-clr-bg__hvr)',
197
+ },
198
+ ...(state.isSelected && {
199
+ paddingRight: '1.75em',
200
+ '&:after': {
201
+ content: '"✔"',
202
+ position: 'absolute',
203
+ top: '50%',
204
+ transform: 'translateY(-50%)',
205
+ right: '7px',
206
+ bottom: '0',
207
+ width: '12px',
208
+ height: '20px'
209
+ }
210
+ })
192
211
  } as CSSObjectWithLabel),
193
212
  menu: (provided: CSSObject) => ({
194
213
  ...provided,
214
+ padding: '8px',
195
215
  borderRadius: '.75rem',
196
216
  boxShadow: '0rem .5rem 1.5rem -.5rem rgba(0, 0, 0, .05), 0rem .5rem 1rem -.25rem rgba(0, 0, 0, .05), 0rem .1875rem .375rem 0rem rgba(0, 0, 0, .05), 0rem .125rem .25rem 0rem rgba(0, 0, 0, .05), 0rem .0625rem .125rem 0rem rgba(0, 0, 0, .05), 0rem 0rem 0rem .0625rem rgba(0, 0, 0, .06)',
197
217
  border: 'none'
@@ -249,19 +249,37 @@ const SelectComponent = ({ type, isError=false, mode, customOption, customLabel,
249
249
  option: (provided: CSSObject, state: OptionProps<TOption, typeof isMulti>) => ({
250
250
  ...provided,
251
251
  ...(!state.isDisabled && {
252
- color: state.isSelected ? '#ffffff' : '#000000',
253
- backgroundColor: state.isSelected || state.isFocused ? '#fc5c64' : 'transparent',
252
+ width: '100%',
253
+ margin: '0 0 4px',
254
+ color: 'var(--pri-clr)',
255
+ borderRadius: 'var(--nav-rd)',
256
+ backgroundColor: state.isSelected || state.isFocused ? 'var(--nav-clr-bg__hvr)' : 'transparent',
254
257
  cursor: 'pointer',
255
258
  overflowWrap: 'break-word',
256
259
  wordBreak: 'break-all',
260
+ fontWeight: state.isSelected ? 500 : 'normal',
261
+ position: 'relative',
257
262
  '&:hover': {
258
- backgroundColor: '#ec5b62',
259
- color: '#ffffff'
263
+ backgroundColor: 'var(--nav-clr-bg__hvr)',
264
+ }
265
+ }),
266
+ ...(state.isSelected && {
267
+ paddingRight: '1.75em',
268
+ '&:after': {
269
+ content: '"✔"',
270
+ position: 'absolute',
271
+ top: '50%',
272
+ transform: 'translateY(-50%)',
273
+ right: '7px',
274
+ bottom: '0',
275
+ width: '12px',
276
+ height: '20px'
260
277
  }
261
278
  })
262
279
  } as CSSObjectWithLabel),
263
280
  menu: (provided: CSSObject) => ({
264
281
  ...provided,
282
+ padding: '8px',
265
283
  borderRadius: '.75rem',
266
284
  boxShadow: '0rem .5rem 1.5rem -.5rem rgba(0, 0, 0, .05), 0rem .5rem 1rem -.25rem rgba(0, 0, 0, .05), 0rem .1875rem .375rem 0rem rgba(0, 0, 0, .05), 0rem .125rem .25rem 0rem rgba(0, 0, 0, .05), 0rem .0625rem .125rem 0rem rgba(0, 0, 0, .05), 0rem 0rem 0rem .0625rem rgba(0, 0, 0, .06)',
267
285
  border: 'none'