@taiga-ui/styles 4.69.0 → 5.0.0-canary.0dd40e8

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 (72) hide show
  1. package/components/appearance.less +51 -0
  2. package/components/avatar.less +188 -0
  3. package/components/badge.less +128 -0
  4. package/components/block.less +118 -0
  5. package/components/button.less +135 -0
  6. package/components/checkbox.less +84 -0
  7. package/components/chip.less +131 -0
  8. package/components/comment.less +64 -0
  9. package/components/compass.less +49 -0
  10. package/components/group.less +172 -0
  11. package/components/icon.less +83 -0
  12. package/components/icons.less +79 -0
  13. package/components/label.less +51 -0
  14. package/components/like.less +67 -0
  15. package/components/link.less +69 -0
  16. package/components/message.less +33 -0
  17. package/components/notification.less +184 -0
  18. package/components/pin.less +164 -0
  19. package/components/progress-bar.less +117 -0
  20. package/components/radio.less +59 -0
  21. package/components/status.less +40 -0
  22. package/components/switch.less +103 -0
  23. package/components/textfield.less +362 -0
  24. package/components/title.less +80 -0
  25. package/components/toast.less +44 -0
  26. package/mixins/appearance.less +56 -0
  27. package/mixins/appearance.scss +57 -0
  28. package/mixins/browsers.less +23 -0
  29. package/mixins/browsers.scss +23 -0
  30. package/mixins/date-picker.less +152 -0
  31. package/mixins/miscellaneous.less +168 -0
  32. package/mixins/miscellaneous.scss +161 -0
  33. package/mixins/picker.less +200 -0
  34. package/mixins/picker.scss +199 -0
  35. package/mixins/slider.less +67 -0
  36. package/mixins/slider.scss +67 -0
  37. package/package.json +9 -2
  38. package/taiga-ui-fonts.less +4 -0
  39. package/taiga-ui-theme.less +4 -0
  40. package/theme/appearance/accent.less +14 -0
  41. package/theme/appearance/action.less +38 -0
  42. package/theme/appearance/flat.less +23 -0
  43. package/theme/appearance/floating.less +21 -0
  44. package/theme/appearance/glass.less +30 -0
  45. package/theme/appearance/outline.less +78 -0
  46. package/theme/appearance/primary.less +48 -0
  47. package/theme/appearance/secondary.less +77 -0
  48. package/theme/appearance/status.less +125 -0
  49. package/theme/appearance/table.less +68 -0
  50. package/theme/appearance/textfield.less +80 -0
  51. package/theme/appearance.less +12 -0
  52. package/theme/palette.less +161 -0
  53. package/theme/variables.less +57 -0
  54. package/utils.less +7 -0
  55. package/utils.scss +6 -0
  56. package/variables/media.less +23 -0
  57. package/variables/media.scss +23 -0
  58. package/basic/keyframes.less +0 -19
  59. package/basic/main.less +0 -80
  60. package/markup/tui-container.less +0 -64
  61. package/markup/tui-form.less +0 -145
  62. package/markup/tui-island.less +0 -200
  63. package/markup/tui-list.less +0 -136
  64. package/markup/tui-mobile-only.less +0 -5
  65. package/markup/tui-required.less +0 -13
  66. package/markup/tui-row.less +0 -139
  67. package/markup/tui-skeleton.less +0 -43
  68. package/markup/tui-space.less +0 -52
  69. package/markup/tui-table.less +0 -184
  70. package/markup/tui-text.less +0 -61
  71. package/project.json +0 -35
  72. package/taiga-ui-global.less +0 -14
@@ -0,0 +1,23 @@
1
+ @mixin firefox-only {
2
+ @supports (-moz-appearance: none) {
3
+ @content;
4
+ }
5
+ }
6
+
7
+ @mixin safari-only {
8
+ @supports (-webkit-hyphens: none) {
9
+ @content;
10
+ }
11
+ }
12
+
13
+ @mixin ios-only {
14
+ @supports (-webkit-touch-callout: none) {
15
+ @content;
16
+ }
17
+ }
18
+
19
+ @mixin chrome-only {
20
+ @supports (not (-moz-appearance: none)) and (not (-webkit-hyphens: none)) {
21
+ @content;
22
+ }
23
+ }
@@ -0,0 +1,152 @@
1
+ @import 'miscellaneous.less';
2
+
3
+ .date-picker() {
4
+ .t-row {
5
+ display: flex;
6
+ justify-content: flex-start;
7
+ font: var(--tui-font-body-m);
8
+
9
+ &:first-child {
10
+ justify-content: flex-end;
11
+ }
12
+
13
+ &:last-child {
14
+ justify-content: flex-start;
15
+ }
16
+ }
17
+
18
+ .t-cell {
19
+ position: relative;
20
+ display: flex;
21
+ align-items: center;
22
+ justify-content: center;
23
+ line-height: 2rem;
24
+ isolation: isolate;
25
+ cursor: pointer;
26
+ overflow: hidden;
27
+ border: 0.125rem solid transparent;
28
+ box-sizing: border-box;
29
+ mask: linear-gradient(
30
+ transparent calc(50% - 1rem),
31
+ #000 calc(50% - 1rem),
32
+ #000 calc(50% + 1rem),
33
+ transparent calc(50% + 1rem)
34
+ );
35
+
36
+ &:first-child {
37
+ border-inline-start-color: transparent !important;
38
+ }
39
+
40
+ &:last-child {
41
+ border-inline-end-color: transparent !important;
42
+ }
43
+
44
+ &::before,
45
+ &::after {
46
+ .fullsize(absolute, inset);
47
+
48
+ content: '';
49
+ z-index: -1;
50
+ border-radius: var(--tui-radius-m);
51
+ }
52
+
53
+ &::after {
54
+ mask:
55
+ url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 32"><path d="M0.2856 0L0.6763 0C2.9265 0 4.9876 1.259 6.0147 3.2611L10.2442 11.5048C11.5301 14.0113 11.5683 16.9754 10.3472 19.5141L5.9766 28.6007C4.9772 30.6786 2.8754 32 0.5696 32H0.285645V0Z"></path></svg>')
56
+ right/0.75rem 100% no-repeat,
57
+ linear-gradient(#000, #000) left/calc(100% - 0.7rem) 100% no-repeat;
58
+ }
59
+
60
+ &[data-range]::before {
61
+ background: var(--tui-background-neutral-1);
62
+ }
63
+
64
+ :host._picking &[data-range]::before {
65
+ background: var(--tui-background-neutral-1-hover);
66
+ }
67
+
68
+ &[data-range='middle'] {
69
+ border-color: var(--tui-background-neutral-1);
70
+
71
+ :host._picking & {
72
+ border-color: var(--tui-background-neutral-1-hover);
73
+ }
74
+
75
+ &:not(:first-child)::before {
76
+ border-top-left-radius: 0;
77
+ border-bottom-left-radius: 0;
78
+ }
79
+
80
+ &:not(:last-child)::before {
81
+ border-top-right-radius: 0;
82
+ border-bottom-right-radius: 0;
83
+ }
84
+ }
85
+
86
+ &[data-range='start'] {
87
+ border-inline-end-color: var(--tui-background-neutral-1);
88
+ color: var(--tui-text-primary-on-accent-1);
89
+
90
+ :host._picking & {
91
+ border-inline-end-color: var(--tui-background-neutral-1-hover);
92
+ }
93
+
94
+ &:not(:last-child)::before {
95
+ right: -1rem;
96
+ }
97
+
98
+ &::after {
99
+ background: var(--tui-background-accent-1);
100
+ }
101
+ }
102
+
103
+ &[data-range='end'] {
104
+ border-inline-start-color: var(--tui-background-neutral-1);
105
+ color: var(--tui-text-primary-on-accent-1);
106
+
107
+ :host._picking & {
108
+ border-inline-start-color: var(--tui-background-neutral-1-hover);
109
+ }
110
+
111
+ &:not(:first-child)::before {
112
+ left: -1rem;
113
+ }
114
+
115
+ &::after {
116
+ background: var(--tui-background-accent-1);
117
+ transform: scale(-1, 1);
118
+ }
119
+ }
120
+
121
+ &[data-range='active'] {
122
+ color: var(--tui-text-primary-on-accent-1);
123
+
124
+ &::after {
125
+ background: var(--tui-background-accent-1);
126
+ mask: none;
127
+ }
128
+ }
129
+
130
+ &_disabled {
131
+ opacity: var(--tui-disabled-opacity);
132
+ pointer-events: none;
133
+ }
134
+
135
+ &_today {
136
+ text-decoration: underline;
137
+ text-underline-offset: 0.25rem;
138
+ }
139
+
140
+ @media @tui-mouse {
141
+ &:hover:not([data-range='start']):not([data-range='end'])::before {
142
+ background: var(--tui-background-neutral-1-hover);
143
+ }
144
+
145
+ &[data-range='start']:hover::after,
146
+ &[data-range='end']:hover::after,
147
+ &[data-range='active']:hover::after {
148
+ background: var(--tui-background-accent-1-hover);
149
+ }
150
+ }
151
+ }
152
+ }
@@ -0,0 +1,168 @@
1
+ @import 'browsers.less';
2
+
3
+ .interactive(@ruleset) {
4
+ &:is(a, button, select, textarea, input, label, .tui-interactive):not(:disabled) {
5
+ @ruleset();
6
+ }
7
+ }
8
+
9
+ // centering with translate
10
+ .center-left() {
11
+ position: absolute;
12
+ left: 50%;
13
+ transform: translate(-50%, 0);
14
+ }
15
+
16
+ .center-top() {
17
+ position: absolute;
18
+ top: 50%;
19
+ transform: translate(0, -50%);
20
+ }
21
+
22
+ .center-all() {
23
+ position: absolute;
24
+ top: 50%;
25
+ left: 50%;
26
+ transform: translate(-50%, -50%);
27
+ }
28
+
29
+ //.fullsize
30
+ // @deprecated TODO remove in 5.0 in favor of inset: 0
31
+ .fullsize(@position: absolute, @mode: height) {
32
+ position: @position;
33
+ top: 0;
34
+ left: 0;
35
+
36
+ & when (@mode = height) {
37
+ inline-size: 100%;
38
+ block-size: 100%;
39
+ }
40
+
41
+ & when (@mode = inset) {
42
+ bottom: 0;
43
+ right: 0;
44
+ }
45
+ }
46
+
47
+ .button-clear() {
48
+ appearance: none;
49
+ padding: 0;
50
+ border: 0;
51
+ background: none;
52
+ font: inherit;
53
+ line-height: inherit;
54
+ text-decoration: none;
55
+ }
56
+
57
+ .button-base() {
58
+ .button-clear();
59
+
60
+ position: relative;
61
+ display: inline-flex;
62
+ align-items: center;
63
+ flex-shrink: 0;
64
+ box-sizing: border-box;
65
+ white-space: nowrap;
66
+ overflow: hidden;
67
+ vertical-align: middle;
68
+ max-inline-size: 100%;
69
+ // StackBlitz changes "0rem" to "0" breaking calc
70
+ gap: calc(var(--t-gap, ~'0rem') - 2 * var(--t-margin, 0rem));
71
+
72
+ > img,
73
+ > tui-icon,
74
+ > [tuiAvatar],
75
+ > tui-badge,
76
+ > [tuiBadge],
77
+ > [tuiRadio],
78
+ > [tuiSwitch],
79
+ > [tuiCheckbox],
80
+ &[tuiIcons]::before,
81
+ &[tuiIcons]::after {
82
+ margin: var(--t-margin);
83
+ }
84
+ }
85
+
86
+ // TODO remove @speed in 5.0
87
+ // transition
88
+ .transition(@param: all, @speed: var(--tui-duration, 300ms)) {
89
+ transition-property: @param;
90
+ transition-duration: @speed;
91
+ transition-timing-function: ease-in-out;
92
+ }
93
+
94
+ // gradient
95
+ .gradient(@start-color, @end-color, @angle: 45deg) {
96
+ background-image: linear-gradient(@angle, @start-color 0%, @end-color 100%);
97
+ }
98
+
99
+ // typical properties for text overflow with ellipsis
100
+ .text-overflow(@type: nowrap) {
101
+ white-space: @type;
102
+ overflow: hidden;
103
+ text-overflow: ellipsis;
104
+ }
105
+
106
+ .scrollbar-hidden() {
107
+ /* stylelint-disable*/
108
+ scrollbar-width: none;
109
+ -ms-overflow-style: none;
110
+ /* stylelint-enable*/
111
+
112
+ &::-webkit-scrollbar,
113
+ &::-webkit-scrollbar-thumb {
114
+ display: none;
115
+ }
116
+ }
117
+
118
+ // hide an element visually without hiding it from screen readers
119
+ .sr-only() {
120
+ position: absolute;
121
+ clip: rect(1px, 1px, 1px, 1px);
122
+ clip-path: inset(50%);
123
+ block-size: 1px;
124
+ inline-size: 1px;
125
+ margin: -1px;
126
+ overflow: hidden;
127
+ padding: 0;
128
+ }
129
+
130
+ // prevent scrolling to focused element on IOS
131
+ .tui-prevent-ios-scroll() {
132
+ .ios-only({
133
+ &:focus {
134
+ animation: tuiPreventIOSScroll 0.001s;
135
+ }
136
+ });
137
+
138
+ @keyframes tuiPreventIOSScroll {
139
+ 0% {
140
+ opacity: 0;
141
+ }
142
+
143
+ 100% {
144
+ opacity: 1;
145
+ }
146
+ }
147
+ }
148
+
149
+ .text-truncate() {
150
+ .text-overflow();
151
+
152
+ flex: 1;
153
+ min-inline-size: 0;
154
+ max-inline-size: max-content;
155
+ }
156
+
157
+ .tui-line-clamp(@count: 3) {
158
+ display: -webkit-box;
159
+ -webkit-box-orient: block-axis;
160
+ -webkit-line-clamp: @count;
161
+ line-clamp: @count;
162
+ overflow: hidden;
163
+ text-overflow: ellipsis;
164
+ }
165
+
166
+ .tui-mask(@x, @y, @r) {
167
+ mask: radial-gradient(circle at @x @y, transparent @r, black @r);
168
+ }
@@ -0,0 +1,161 @@
1
+ @import 'browsers';
2
+
3
+ @mixin interactive {
4
+ &:is(a, button, select, textarea, input, label, .tui-interactive):not(:disabled) {
5
+ @content;
6
+ }
7
+ }
8
+
9
+ // centering with translate
10
+ @mixin center-left() {
11
+ position: absolute;
12
+ left: 50%;
13
+ transform: translate(-50%, 0);
14
+ }
15
+
16
+ @mixin center-top() {
17
+ position: absolute;
18
+ top: 50%;
19
+ transform: translate(0, -50%);
20
+ }
21
+
22
+ @mixin center-all() {
23
+ position: absolute;
24
+ top: 50%;
25
+ left: 50%;
26
+ transform: translate(-50%, -50%);
27
+ }
28
+
29
+ //.fullsize
30
+ @mixin fullsize($position: absolute, $mode: height) {
31
+ position: $position;
32
+ top: 0;
33
+ left: 0;
34
+
35
+ @if ($mode == height) {
36
+ width: 100%;
37
+ height: 100%;
38
+ }
39
+
40
+ @if ($mode == inset) {
41
+ bottom: 0;
42
+ right: 0;
43
+ }
44
+ }
45
+
46
+ @mixin button-clear() {
47
+ appearance: none;
48
+ padding: 0;
49
+ border: 0;
50
+ background: none;
51
+ font-size: inherit;
52
+ line-height: inherit;
53
+ }
54
+
55
+ @mixin button-base() {
56
+ @include button-clear();
57
+
58
+ position: relative;
59
+ display: inline-flex;
60
+ align-items: center;
61
+ flex-shrink: 0;
62
+ box-sizing: border-box;
63
+ white-space: nowrap;
64
+ overflow: hidden;
65
+ vertical-align: middle;
66
+ max-width: 100%;
67
+ gap: calc(var(--t-gap) - 2 * var(--t-margin));
68
+
69
+ > img,
70
+ > tui-icon,
71
+ > [tuiAvatar],
72
+ > tui-badge,
73
+ > [tuiBadge],
74
+ > [tuiRadio],
75
+ > [tuiSwitch],
76
+ > [tuiCheckbox],
77
+ &[tuiIcons]:before,
78
+ &[tuiIcons]:after {
79
+ margin: var(--t-margin);
80
+ }
81
+ }
82
+
83
+ // transition
84
+ @mixin transition($param: all, $speed: var(--tui-duration, 300ms)) {
85
+ transition-property: $param;
86
+ transition-duration: $speed;
87
+ transition-timing-function: ease-in-out;
88
+ }
89
+
90
+ // gradient
91
+ @mixin gradient($start-color, $end-color, $angle: 45deg) {
92
+ background-image: linear-gradient($angle, $start-color 0%, $end-color 100%);
93
+ }
94
+
95
+ // typical properties for text overflow with ellipsis
96
+ @mixin text-overflow($type: nowrap) {
97
+ white-space: $type;
98
+ overflow: hidden;
99
+ text-overflow: ellipsis;
100
+ }
101
+
102
+ @mixin scrollbar-hidden() {
103
+ /* stylelint-disable*/
104
+ scrollbar-width: none;
105
+ -ms-overflow-style: none;
106
+ /* stylelint-enable*/
107
+
108
+ &::-webkit-scrollbar,
109
+ &::-webkit-scrollbar-thumb {
110
+ display: none;
111
+ }
112
+ }
113
+
114
+ // hide an element visually without hiding it from screen readers
115
+ @mixin sr-only() {
116
+ position: absolute;
117
+ clip: rect(1px, 1px, 1px, 1px);
118
+ clip-path: inset(50%);
119
+ height: 1px;
120
+ width: 1px;
121
+ margin: -1px;
122
+ overflow: hidden;
123
+ padding: 0;
124
+ }
125
+
126
+ // prevent scrolling to focused element on IOS
127
+ @mixin tui-prevent-ios-scroll() {
128
+ &:focus {
129
+ animation: tuiPreventIOSScroll 0.001s;
130
+ }
131
+
132
+ @keyframes tuiPreventIOSScroll {
133
+ 0% {
134
+ opacity: 0;
135
+ }
136
+
137
+ 100% {
138
+ opacity: 1;
139
+ }
140
+ }
141
+ }
142
+
143
+ @mixin text-truncate() {
144
+ @include text-overflow();
145
+ flex: 1;
146
+ min-inline-size: 0;
147
+ max-inline-size: max-content;
148
+ }
149
+
150
+ @mixin tui-line-clamp($count: 3) {
151
+ display: -webkit-box;
152
+ -webkit-box-orient: vertical;
153
+ -webkit-line-clamp: $count;
154
+ line-clamp: $count;
155
+ overflow: hidden;
156
+ text-overflow: ellipsis;
157
+ }
158
+
159
+ @mixin tui-mask($x, $y, $r) {
160
+ mask: radial-gradient(circle at $x $y, transparent $r, black $r);
161
+ }
@@ -0,0 +1,200 @@
1
+ @import 'miscellaneous.less';
2
+
3
+ // @deprecated
4
+ .picker(@itemSize) {
5
+ :host {
6
+ display: block;
7
+ font: var(--tui-font-body-m);
8
+ }
9
+
10
+ .t-row {
11
+ position: relative;
12
+ display: flex;
13
+ justify-content: space-between;
14
+ block-size: 2.25rem;
15
+ isolation: isolate;
16
+ }
17
+
18
+ .t-item {
19
+ position: relative;
20
+ flex: 1;
21
+ line-height: 2rem;
22
+ border-radius: var(--tui-radius-m);
23
+
24
+ &::before,
25
+ &::after {
26
+ .fullsize(absolute, inset);
27
+
28
+ content: '';
29
+ z-index: -1;
30
+ border-radius: var(--tui-radius-m);
31
+ }
32
+
33
+ &::after {
34
+ border-radius: 0.5rem;
35
+ }
36
+ }
37
+
38
+ .t-cell {
39
+ position: relative;
40
+ display: flex;
41
+ align-items: center;
42
+ justify-content: center;
43
+ inline-size: @itemSize;
44
+ text-align: center;
45
+ outline: none;
46
+ cursor: pointer;
47
+ background-clip: content-box;
48
+ box-sizing: border-box;
49
+ border: 0.125rem solid transparent;
50
+
51
+ &::before {
52
+ content: '';
53
+ position: absolute;
54
+ top: 0;
55
+ left: 0;
56
+ right: 0;
57
+ bottom: 0;
58
+ z-index: -1;
59
+ border-radius: var(--tui-radius-m);
60
+ }
61
+
62
+ &_today::after {
63
+ .center-left();
64
+
65
+ content: '';
66
+ bottom: 0.3125rem;
67
+ block-size: 0.125rem;
68
+ inline-size: 0.75rem;
69
+ border-radius: 0.375rem;
70
+ background: var(--tui-text-primary);
71
+ }
72
+
73
+ &_interval {
74
+ &::before {
75
+ background: var(--tui-background-base-alt);
76
+
77
+ :host._single & {
78
+ background: var(--tui-background-neutral-1-hover);
79
+ }
80
+ }
81
+
82
+ &:not(:last-child)::before {
83
+ right: -0.1875rem;
84
+ border-top-right-radius: 0;
85
+ border-bottom-right-radius: 0;
86
+ }
87
+
88
+ &:not([data-range='start']):not(:first-child)::before {
89
+ border-top-left-radius: 0;
90
+ border-bottom-left-radius: 0;
91
+ }
92
+
93
+ &:last-child:first-child::before {
94
+ right: 0;
95
+ }
96
+
97
+ &:first-child > .t-item {
98
+ border-top-left-radius: var(--tui-radius-m);
99
+ border-bottom-left-radius: var(--tui-radius-m);
100
+ }
101
+
102
+ &:last-child > .t-item {
103
+ border-top-right-radius: var(--tui-radius-m);
104
+ border-bottom-right-radius: var(--tui-radius-m);
105
+ }
106
+
107
+ & > .t-item {
108
+ border-radius: 0;
109
+ }
110
+ }
111
+
112
+ &[data-range] {
113
+ &::after {
114
+ background: var(--tui-text-primary-on-accent-1);
115
+ }
116
+
117
+ & > .t-item {
118
+ color: var(--tui-text-primary-on-accent-1);
119
+
120
+ &::before,
121
+ &::after {
122
+ background: var(--tui-background-accent-1);
123
+ }
124
+ }
125
+
126
+ &:hover > .t-item::before,
127
+ &:hover > .t-item::after {
128
+ background: var(--tui-background-accent-1-hover);
129
+ }
130
+
131
+ &:active > .t-item::before,
132
+ &:active > .t-item::after {
133
+ background: var(--tui-background-accent-1-pressed);
134
+ }
135
+ }
136
+
137
+ &[data-range='end'] {
138
+ &::before {
139
+ background: var(--tui-background-base-alt);
140
+
141
+ :host._single & {
142
+ background: var(--tui-background-neutral-1-hover);
143
+ }
144
+ }
145
+
146
+ &:not(:first-child)::before {
147
+ border-top-left-radius: 0;
148
+ border-bottom-left-radius: 0;
149
+ }
150
+ }
151
+
152
+ &[data-range='end'] > .t-item {
153
+ &::before {
154
+ left: 0.625rem;
155
+ border-top-left-radius: 0;
156
+ border-bottom-left-radius: 0;
157
+ }
158
+
159
+ &::after {
160
+ left: -2rem;
161
+ right: 100%;
162
+ transform: translateX(1.6rem) scaleY(0.83) scaleX(0.5) rotate(45deg);
163
+ }
164
+ }
165
+
166
+ &[data-range='start'] > .t-item {
167
+ &::before {
168
+ right: 0.625rem;
169
+ border-top-right-radius: 0;
170
+ border-bottom-right-radius: 0;
171
+ }
172
+
173
+ &::after {
174
+ left: 100%;
175
+ right: -2rem;
176
+ transform: translateX(-1.6rem) scaleY(0.83) scaleX(0.5) rotate(45deg);
177
+ }
178
+ }
179
+
180
+ &[data-range='single'] > .t-item::after {
181
+ display: none;
182
+ }
183
+
184
+ &_disabled {
185
+ pointer-events: none;
186
+
187
+ & > .t-item {
188
+ opacity: 0.36;
189
+ }
190
+ }
191
+
192
+ &:hover:not([data-range]) > .t-item {
193
+ background: var(--tui-background-neutral-1-hover);
194
+ }
195
+
196
+ &:active:not([data-range]) > .t-item {
197
+ background: var(--tui-background-neutral-1-pressed);
198
+ }
199
+ }
200
+ }