@itcase/ui 1.0.5 → 1.0.7

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.
Files changed (55) hide show
  1. package/dist/components/Avatar.js +56 -31
  2. package/dist/components/{Counter.js → Badge.js} +7 -7
  3. package/dist/components/Button.js +59 -54
  4. package/dist/components/Cell.js +21 -17
  5. package/dist/components/Checkbox.js +74 -22
  6. package/dist/components/Chips.js +2 -20
  7. package/dist/components/Divider.js +17 -1
  8. package/dist/components/Dropdown.js +195 -66
  9. package/dist/components/Grid.js +70 -33
  10. package/dist/components/Group.js +17 -1
  11. package/dist/components/Icon.js +45 -26
  12. package/dist/components/Image.js +3 -3
  13. package/dist/components/Input.js +19 -2
  14. package/dist/components/Label.js +11 -3
  15. package/dist/components/Logo.js +36 -12
  16. package/dist/components/MenuItem.js +11 -2
  17. package/dist/components/Modal.js +219 -41
  18. package/dist/components/Profile.js +10 -4
  19. package/dist/components/RadioButton.js +78 -26
  20. package/dist/components/Scrollbar.js +4 -4
  21. package/dist/components/Search.js +12 -9
  22. package/dist/components/Segmented.js +5 -3
  23. package/dist/components/Select.js +2 -2
  24. package/dist/components/Switch.js +2 -1
  25. package/dist/components/Tab.js +312 -0
  26. package/dist/components/Text.js +1 -3
  27. package/dist/components/Textarea.js +9 -1
  28. package/dist/components/Tile.js +43 -115
  29. package/dist/css/components/Avatar/Avatar.css +23 -10
  30. package/dist/css/components/Badge/Badge.css +55 -0
  31. package/dist/css/components/Button/Button.css +19 -8
  32. package/dist/css/components/Checkbox/Checkbox.css +60 -63
  33. package/dist/css/components/Chips/Chips.css +25 -7
  34. package/dist/css/components/Dropdown/Dropdown.css +21 -18
  35. package/dist/css/components/Fader/Fader.css +0 -1
  36. package/dist/css/components/Grid/Grid.css +5 -0
  37. package/dist/css/components/Grid/css/__row/grid__row.css +5 -0
  38. package/dist/css/components/Icon/Icon.css +4 -4
  39. package/dist/css/components/Input/Input.css +6 -0
  40. package/dist/css/components/List/List.css +3 -3
  41. package/dist/css/components/Logo/Logo.css +23 -0
  42. package/dist/css/components/{Popup/Popup.css → Modal/Modal.css} +5 -4
  43. package/dist/css/components/RadioButton/RadioButton.css +60 -59
  44. package/dist/css/components/Segmented/Segmented.css +97 -0
  45. package/dist/css/components/Switch/Switch.css +56 -46
  46. package/dist/css/components/Tab/Tab.css +49 -0
  47. package/dist/css/components/Tile/Tile.css +27 -10
  48. package/dist/css/styles/border-color/border-color.css +2 -2
  49. package/dist/css/styles/border-type/border-type.css +13 -0
  50. package/dist/css/styles/border-width/border-width.css +7 -0
  51. package/dist/css/styles/justify-content/justify-content.css +7 -0
  52. package/dist/hooks/styleAttributes.js +1 -1
  53. package/package.json +2 -1
  54. package/dist/components/Popup.js +0 -255
  55. package/dist/css/components/Counter/Counter.css +0 -55
@@ -127,15 +127,15 @@
127
127
  }
128
128
  .icon {
129
129
  &_type {
130
- &_with-counter {
130
+ &_with-badge {
131
131
  position: relative;
132
132
  ^^&__link,
133
133
  ^^&__item {
134
134
  text-decoration: none;
135
135
  @each $size in 14, 16, 24, 32, 40, 56, 60, 72 {
136
136
  &^^^&_size_$(size) {
137
- & .counter {
138
- transform: translate(var(--icon-size-$(size)-counter-position));
137
+ & .badge {
138
+ transform: translate(var(--icon-size-$(size)-badge-position));
139
139
  }
140
140
  }
141
141
  }
@@ -145,5 +145,5 @@
145
145
  }
146
146
  :root {
147
147
  --icon-transition: all 0.2s ease 0s;
148
- --icon-size-24-counter-position: 12px, 12px;
148
+ --icon-size-24-badge-position: 12px, 12px;
149
149
  }
@@ -28,6 +28,12 @@
28
28
  border-radius: 4px;
29
29
  position: relative;
30
30
  }
31
+ &_underline {
32
+ position: relative;
33
+ border-left: none !important;
34
+ border-right: none !important;
35
+ border-top: none !important;
36
+ }
31
37
  }
32
38
  }
33
39
  .input {
@@ -95,13 +95,13 @@
95
95
  }
96
96
  .list {
97
97
  &_style_number {
98
- counter-reset: number-counter;
98
+ badge-reset: number-badge;
99
99
  & li {
100
100
  position: relative;
101
- counter-increment: number-counter;
101
+ badge-increment: number-badge;
102
102
  padding: 0 0 0 1.5em;
103
103
  &::before {
104
- content: counter(number-counter) '. ';
104
+ content: badge(number-badge) '. ';
105
105
  position: absolute;
106
106
  left: 0;
107
107
  top: 0;
@@ -8,6 +8,18 @@
8
8
  }
9
9
  }
10
10
  }
11
+ .logo {
12
+ &_size {
13
+ @each $size in s, m, l {
14
+ &_$(size) {
15
+ ^^&__image {
16
+ width: var(--logo-size-$(size)-width);
17
+ height: var(--logo-size-$(size)-height);
18
+ }
19
+ }
20
+ }
21
+ }
22
+ }
11
23
  .logo {
12
24
  @each $val in stretch, flex-start, flex-end, center, baseline, auto {
13
25
  &_align-items_$(val) {
@@ -15,3 +27,14 @@
15
27
  }
16
28
  }
17
29
  }
30
+ :root {
31
+ --logo-size-l-width: 240px;
32
+ --logo-size-l-height: 90px;
33
+
34
+ --logo-size-m-width: 200px;
35
+ --logo-size-m-height: 75px;
36
+
37
+ --logo-size-s-width: 140px;
38
+ --logo-size-s-height: 52px;
39
+ }
40
+
@@ -1,4 +1,4 @@
1
- .popup {
1
+ .modal {
2
2
  width: 100%;
3
3
  min-height: 100%;
4
4
  position: fixed;
@@ -15,12 +15,13 @@
15
15
  display: flex;
16
16
  }
17
17
  }
18
- .popup-content {
18
+ .modal-content {
19
19
  width: 100%;
20
- max-width: var(--popup-max-width);
20
+ max-width: var(--modal-max-width);
21
21
  border-radius: 8px;
22
22
  position: relative;
23
- @mixin elevation-8;
23
+ height: 200px;
24
+ width: 200px;
24
25
  &__close {
25
26
  position: absolute;
26
27
  top: 8px;
@@ -1,40 +1,60 @@
1
1
  .radio-button {
2
- position: relative;
3
- cursor: pointer;
4
- font-size: 0;
5
- line-height: 0;
6
- display: flex;
7
- min-height: 16px;
8
- min-width: 16px;
9
- &__button {
2
+ display: grid;
3
+ grid-template-columns: auto 1fr;
4
+ grid-template-rows: auto auto;
5
+ column-gap: 4px;
6
+ &__item {
7
+ position: relative;
10
8
  cursor: pointer;
11
- appearance: none;
12
- border: 0;
13
- margin: 0;
14
9
  font-size: 0;
15
10
  line-height: 0;
16
- position: absolute;
17
- left: 0;
18
- top: 0;
19
- width: 100%;
20
- height: 100%;
21
- z-index: 3;
22
- }
23
- &__bg {
24
- flex: 1;
25
11
  display: flex;
26
- z-index: 1;
27
- }
28
- &__mark {
29
- height: calc(100% - 6px);
30
- width: calc(100% - 6px);
31
- position: absolute;
32
- z-index: 2;
33
- left: 50%;
34
- top: 50%;
35
- transform: translate(-50%, -50%);
36
- display: none;
37
- border-radius: 50%;
12
+ min-height: 16px;
13
+ min-width: 16px;
14
+ grid-row-start: span 2;
15
+ align-self: start;
16
+ ^&__input {
17
+ cursor: pointer;
18
+ appearance: none;
19
+ border: 0;
20
+ margin: 0;
21
+ font-size: 0;
22
+ line-height: 0;
23
+ position: absolute;
24
+ left: 0;
25
+ top: 0;
26
+ width: 100%;
27
+ height: 100%;
28
+ z-index: 3;
29
+ }
30
+ ^&__state {
31
+ flex: 1;
32
+ display: flex;
33
+ z-index: 1;
34
+ &_shape {
35
+ &_rounded {
36
+ border-radius: 4px;
37
+ position: relative;
38
+ overflow: hidden;
39
+ }
40
+ &_circular {
41
+ border-radius: 50%;
42
+ position: relative;
43
+ overflow: hidden;
44
+ }
45
+ }
46
+ }
47
+ ^&__state-checkmark {
48
+ height: calc(100% - 6px);
49
+ width: calc(100% - 6px);
50
+ position: absolute;
51
+ z-index: 2;
52
+ left: 50%;
53
+ top: 50%;
54
+ transform: translate(-50%, -50%);
55
+ display: none;
56
+ border-radius: 50%;
57
+ }
38
58
  }
39
59
  }
40
60
  .radio-button {
@@ -52,39 +72,20 @@
52
72
  }
53
73
  }
54
74
  .radio-button {
55
- &_fill {
56
- &_checked {
57
- @each $type in accent, primary, secondary, tertiary, surface, success, error {
58
- &_$(type) {
59
- @each $color in primary, secondary, tertiary, quaternary, quinary, senary, accent, disabled, hover {
60
- &-$(color) {
61
- & ^^^^&__button {
62
- &:checked {
63
- & + ^^^^^^&__bg {
64
- background: var(--color-$(type)-$(color));
65
- }
66
- }
67
- }
68
- }
69
- }
70
- }
71
- }
72
- }
73
- }
74
- }
75
- .radio-button {
76
- &_fill {
77
- &_checkmark {
75
+ &_checkmark {
76
+ &_fill {
78
77
  @each $type in accent, primary, secondary, tertiary, surface, success, error {
79
78
  &_$(type) {
80
79
  &-item {
81
80
  @each $color in primary, secondary, tertiary, quaternary, quinary, senary, accent, disabled, hover {
82
81
  &-$(color) {
83
- & ^^^^^&__button {
82
+ & ^^^^^&__input {
84
83
  &:checked {
85
- & ~ ^^^^^^^&__mark {
86
- display: block;
87
- background: var(--color-$(type)-item-$(color));
84
+ & ~ ^^^^^^^&__state {
85
+ &-checkmark {
86
+ display: block;
87
+ background: var(--color-$(type)-item-$(color));
88
+ }
88
89
  }
89
90
  }
90
91
  }
@@ -0,0 +1,97 @@
1
+ .segmented {
2
+ display: flex;
3
+ align-items: center;
4
+ border: solid 1px red;
5
+ &__wrapper {
6
+ border: solid 1px var(--color-surface-border-tertiary);
7
+ border-radius: 8px;
8
+ ^&__list {
9
+ margin: 2px;
10
+ position: relative;
11
+ display: flex;
12
+ &::before {
13
+ width: var(--segmented-active-width);
14
+ height: 100%;
15
+ background: #438ffe;
16
+ padding: 8px 0;
17
+ border-radius: 8px;
18
+ position: absolute;
19
+ content: '';
20
+ display: block;
21
+ box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 3px 1px rgba(0, 0, 0, 0.04);
22
+ left: var(--segmented-active-x-pos);
23
+ top: 0;
24
+ z-index: 1;
25
+ transition: left 0.3s ease, width 0.3s ease;
26
+ }
27
+ ^^&__item {
28
+ min-width: 104px;
29
+ padding: 8px 24px;
30
+ position: relative;
31
+ display: flex;
32
+ &::after {
33
+ width: 1px;
34
+ height: 100%;
35
+ background: var(--color-surface-border-tertiary);
36
+ content: '';
37
+ display: block;
38
+ top: 0;
39
+ transform: translate(24px, 0);
40
+ }
41
+ &:last-child {
42
+ &::after {
43
+ display: none;
44
+ }
45
+ }
46
+ &_state_active {
47
+ & label {
48
+ color: #fff;
49
+ }
50
+ }
51
+ & input {
52
+ width: 100%;
53
+ height: 100%;
54
+ position: absolute;
55
+ left: 0;
56
+ top: 0;
57
+ right: 0;
58
+ bottom: 0;
59
+ z-index: 2;
60
+ opacity: 0%;
61
+ cursor: pointer;
62
+ }
63
+ & label {
64
+ text-align: center;
65
+ position: relative;
66
+ display: block;
67
+ z-index: 3;
68
+ transition: color 0.5s ease;
69
+ cursor: pointer;
70
+ @mixin text-l;
71
+ }
72
+ }
73
+ }
74
+ }
75
+ &__range {
76
+ margin: 0 0 0 24px;
77
+ border: solid 1px var(--color-surface-border-tertiary);
78
+ border-radius: 8px;
79
+ position: relative;
80
+ &-value {
81
+ text-align: center;
82
+ padding: 10px 24px;
83
+ border-radius: 8px;
84
+ cursor: pointer;
85
+ @mixin text-l;
86
+ &_state_active {
87
+ color: #fff;
88
+ background: #438ffe;
89
+ }
90
+ }
91
+ ^&__modal {
92
+ position: absolute;
93
+ left: 0;
94
+ top: 0;
95
+ }
96
+ }
97
+ }
@@ -1,53 +1,63 @@
1
1
  .switch {
2
2
  position: relative;
3
- min-width: 52px;
4
- height: 100%;
5
- border-radius: 50px;
6
- cursor: pointer;
7
- transition: 0.4s;
8
- min-height: 32px;
9
- overflow: hidden;
10
- display: flex;
11
- &__checkbox {
12
- position: absolute;
13
- width: 100%;
14
- height: 100%;
15
- left: 0;
16
- top: 0;
17
- cursor: pointer;
18
- appearance: none;
19
- border: 0;
20
- margin: 0;
21
- z-index: 2;
22
- &:checked {
23
- & + .switch__bg {
24
- background: var(--color-accent-primary);
3
+ }
4
+ .switch {
5
+ &_size {
6
+ &_normal {
7
+ position: relative;
8
+ min-width: 52px;
9
+ height: 100%;
10
+ border-radius: 50px;
11
+ cursor: pointer;
12
+ transition: 0.4s;
13
+ min-height: 32px;
14
+ overflow: hidden;
15
+ display: flex;
16
+ ^^&__checkbox {
17
+ position: absolute;
18
+ width: 100%;
19
+ height: 100%;
20
+ left: 0;
21
+ top: 0;
22
+ cursor: pointer;
23
+ appearance: none;
24
+ border: 0;
25
+ margin: 0;
26
+ z-index: 2;
27
+ &:checked {
28
+ & + .switch__bg {
29
+ background: var(--color-accent-primary);
30
+ }
31
+ & ~ .switch__toggle {
32
+ left: 100%;
33
+ margin: 0 0 0 -3px;
34
+ background: var(--color-accent-item-primary);
35
+ transform: translate(-100%, -50%);
36
+ }
37
+ }
38
+ }
39
+ ^^&__bg {
40
+ width: 100%;
41
+ flex: 1;
42
+ background: var(--color-surface-tertiary);
43
+ transition: all 0.25s;
25
44
  }
26
- & ~ .switch__toggle {
27
- left: 100%;
28
- margin: 0 0 0 -3px;
29
- background: var(--color-accent-item-primary);
30
- transform: translate(-100%, -50%);
45
+ ^^&__toggle {
46
+ box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
47
+ height: calc(100% - 6px);
48
+ position: absolute;
49
+ aspect-ratio: 1/1;
50
+ top: 50%;
51
+ transform: translate(3px, -50%);
52
+ left: 0;
53
+ background: #fff;
54
+ border-radius: 50%;
55
+ box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
56
+ transition: all 0.25s;
31
57
  }
32
58
  }
33
- }
34
- &__bg {
35
- width: 100%;
36
- flex: 1;
37
- background: var(--color-surface-tertiary);
38
- transition: all 0.25s;
39
- }
40
- &__toggle {
41
- box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
42
- height: calc(100% - 6px);
43
- position: absolute;
44
- aspect-ratio: 1/1;
45
- top: 50%;
46
- transform: translate(3px, -50%);
47
- left: 0;
48
- background: #fff;
49
- border-radius: 50%;
50
- box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
51
- transition: all 0.25s;
59
+ &_compact {
60
+ border: solid 1px red;
61
+ }
52
62
  }
53
63
  }
@@ -0,0 +1,49 @@
1
+ .tab {
2
+ &__label {
3
+ display: flex;
4
+ align-items: center;
5
+ align-content: center;
6
+ }
7
+ }
8
+ .tab {
9
+ @each $val in flex-start, flex-end, center, space-between, space-around, space-evenly {
10
+ &_justify-content_$(val) {
11
+ & > a {
12
+ justify-content: $(val);
13
+ }
14
+ }
15
+ }
16
+ }
17
+ .tab {
18
+ &_shape {
19
+ &_rounded {
20
+ border-radius: 12px;
21
+ }
22
+ &_circular {
23
+ border-radius: 50%;
24
+ }
25
+ }
26
+ }
27
+ .tab {
28
+ &_size {
29
+ @each $size in normal, compact {
30
+ &_$(size) {
31
+ ^^&__label {
32
+ padding: var(--tab-size-$(size)-padding);
33
+ gap: var(--tab-size-$(size)-gap);
34
+ }
35
+ }
36
+ }
37
+ }
38
+ }
39
+ .tab-group {
40
+ position: relative;
41
+ }
42
+ :root {
43
+ --tab-size-normal-padding: 10px;
44
+ --tab-size-normal-gap: 10px;
45
+
46
+ --tab-size-compact-padding: 10px;
47
+ --tab-size-compact-gap: 10px;
48
+ }
49
+
@@ -1,14 +1,6 @@
1
1
  .tile {
2
-
3
- }
4
- .tile {
5
- &_type {
6
- &_icon {
7
- padding: 16px;
8
- ^^&__icon {
9
- margin: 0 0 16px 0;
10
- }
11
- }
2
+ &__wrapper {
3
+ position: relative;
12
4
  }
13
5
  }
14
6
  .tile {
@@ -21,3 +13,28 @@
21
13
  }
22
14
  }
23
15
  }
16
+ .tile {
17
+ &_size {
18
+ @each $size in normal, compact {
19
+ &_$(size) {
20
+ padding: var(--tile-size-$(size)-padding);
21
+ min-width: var(--tile-size-$(size)-min-width);
22
+ & ^^&__wrapper {
23
+ display: flex;
24
+ flex-flow: column;
25
+ gap: var(--tile-size-$(size)-gap);
26
+ }
27
+ }
28
+ }
29
+ }
30
+ }
31
+ .tile {
32
+ &_type {
33
+ &_icon {
34
+ padding: 16px;
35
+ ^^&__icon {
36
+ margin: 0 0 16px 0;
37
+ }
38
+ }
39
+ }
40
+ }
@@ -2,7 +2,7 @@
2
2
  @each $type in accent, primary, secondary, tertiary, surface, success, error {
3
3
  &_$(type) {
4
4
  &-border {
5
- @each $color in primary, secondary, tertiary, quaternary, quinary, senary, accent, disabled, hover {
5
+ @each $color in primary, secondary, tertiary, quaternary, quinary, senary, accent, active, disabled, hover {
6
6
  &-$(color) {
7
7
  border-width: 1px;
8
8
  border-style: solid;
@@ -14,7 +14,7 @@
14
14
  &_hover {
15
15
  &_$(type) {
16
16
  &-border {
17
- @each $color in primary, secondary, tertiary, quaternary, quinary, senary, accent, disabled, hover {
17
+ @each $color in primary, secondary, tertiary, quaternary, quinary, senary, accent, active, disabled, hover {
18
18
  &-$(color) {
19
19
  &:hover {
20
20
  border-color: var(--color-$(type)-border-$(color));
@@ -0,0 +1,13 @@
1
+ .border {
2
+ &_type {
3
+ &_outline {
4
+ border-style: solid;
5
+ }
6
+ &_solid {
7
+ border-style: solid;
8
+ }
9
+ &_none {
10
+ border: none;
11
+ }
12
+ }
13
+ }
@@ -0,0 +1,7 @@
1
+ .border-width {
2
+ @each $width in 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 {
3
+ &_$(width) {
4
+ border-width: $(width)px ;
5
+ }
6
+ }
7
+ }
@@ -0,0 +1,7 @@
1
+ .justify-content {
2
+ @each $val in flexStart, flexEnd, spaceBetween, spaceAround, spaceEvenly, flex-start, flex-end, center, space-between, space-around, space-evenly {
3
+ &_$(val) {
4
+ justify-content: $(val);
5
+ }
6
+ }
7
+ }
@@ -28,6 +28,6 @@ var styleAttributes = [
28
28
  /**
29
29
  * Grid
30
30
  */
31
- 'gridTemplateColumns', 'gridArea', 'gridAutoColumns', 'gridAutoFlow', 'gridAutoRows', 'gridTemplate', 'gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'];
31
+ 'gridTemplateColumns', 'gridArea', 'gridAutoColumns', 'gridAutoFlow', 'gridAutoRows', 'gridTemplate', 'gridTemplateAreas', 'gridTemplateRows'];
32
32
 
33
33
  exports.default = styleAttributes;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itcase/ui",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "UI components (Modal, Loader, Popup, etc)",
5
5
  "keywords": [
6
6
  "Modal",
@@ -85,6 +85,7 @@
85
85
  "eslint-plugin-prettier": "^4.2.1",
86
86
  "eslint-plugin-promise": "^6.1.1",
87
87
  "eslint-plugin-react": "^7.32.2",
88
+ "eslint-plugin-react-hooks": "^4.6.0",
88
89
  "eslint-plugin-standard": "^5.0.0",
89
90
  "husky": "^8.0.3",
90
91
  "lint-staged": "^13.2.3",