@taiga-ui/styles 4.75.0 → 5.0.0-canary.1e78a8a

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 (73) hide show
  1. package/components/appearance.less +51 -0
  2. package/components/avatar.less +193 -0
  3. package/components/badge.less +127 -0
  4. package/components/block.less +118 -0
  5. package/components/button.less +140 -0
  6. package/components/checkbox.less +84 -0
  7. package/components/chip.less +131 -0
  8. package/components/comment.less +63 -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 +181 -0
  18. package/components/pin.less +166 -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 +104 -0
  23. package/components/textfield.less +362 -0
  24. package/components/title.less +80 -0
  25. package/components/toast.less +46 -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/date-picker.scss +152 -0
  32. package/mixins/hitbox.less +17 -0
  33. package/mixins/hitbox.scss +17 -0
  34. package/mixins/miscellaneous.less +171 -0
  35. package/mixins/miscellaneous.scss +164 -0
  36. package/mixins/slider.less +67 -0
  37. package/mixins/slider.scss +67 -0
  38. package/package.json +9 -2
  39. package/taiga-ui-fonts.less +4 -0
  40. package/taiga-ui-theme.less +4 -0
  41. package/theme/appearance/accent.less +14 -0
  42. package/theme/appearance/action.less +38 -0
  43. package/theme/appearance/flat.less +23 -0
  44. package/theme/appearance/floating.less +21 -0
  45. package/theme/appearance/glass.less +30 -0
  46. package/theme/appearance/outline.less +78 -0
  47. package/theme/appearance/primary.less +48 -0
  48. package/theme/appearance/secondary.less +77 -0
  49. package/theme/appearance/status.less +125 -0
  50. package/theme/appearance/table.less +67 -0
  51. package/theme/appearance/textfield.less +80 -0
  52. package/theme/appearance.less +12 -0
  53. package/theme/palette.less +161 -0
  54. package/theme/variables.less +71 -0
  55. package/utils.less +7 -0
  56. package/utils.scss +7 -0
  57. package/variables/media.less +23 -0
  58. package/variables/media.scss +23 -0
  59. package/basic/keyframes.less +0 -19
  60. package/basic/main.less +0 -80
  61. package/markup/tui-container.less +0 -64
  62. package/markup/tui-form.less +0 -145
  63. package/markup/tui-island.less +0 -200
  64. package/markup/tui-list.less +0 -136
  65. package/markup/tui-mobile-only.less +0 -5
  66. package/markup/tui-required.less +0 -13
  67. package/markup/tui-row.less +0 -139
  68. package/markup/tui-skeleton.less +0 -43
  69. package/markup/tui-space.less +0 -52
  70. package/markup/tui-table.less +0 -184
  71. package/markup/tui-text.less +0 -61
  72. package/project.json +0 -35
  73. package/taiga-ui-global.less +0 -14
@@ -0,0 +1,23 @@
1
+ .firefox-only(@ruleset) {
2
+ @supports (-moz-appearance: none) {
3
+ @ruleset();
4
+ }
5
+ }
6
+
7
+ .safari-only(@ruleset) {
8
+ @supports (-webkit-hyphens: none) {
9
+ @ruleset();
10
+ }
11
+ }
12
+
13
+ .ios-only(@ruleset) {
14
+ @supports (-webkit-touch-callout: none) {
15
+ @ruleset();
16
+ }
17
+ }
18
+
19
+ .chrome-only(@ruleset) {
20
+ @supports (not (-moz-appearance: none)) and (not (-webkit-hyphens: none)) {
21
+ @ruleset();
22
+ }
23
+ }
@@ -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-typography-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
+ inset-inline-end: -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
+ inset-inline-start: -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,152 @@
1
+ @import 'miscellaneous';
2
+
3
+ @mixin date-picker {
4
+ .t-row {
5
+ display: flex;
6
+ justify-content: flex-start;
7
+ font: var(--tui-typography-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
+ @include 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
+ inset-inline-end: -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
+ inset-inline-start: -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,17 @@
1
+ @import '../variables/media.less';
2
+
3
+ .tui-hitbox(@size) {
4
+ @media @tui-mobile {
5
+ position: relative;
6
+ overflow: visible;
7
+
8
+ &::after {
9
+ content: '';
10
+ position: absolute;
11
+ display: block !important;
12
+ inline-size: max(100%, @size);
13
+ block-size: max(100%, @size);
14
+ background: transparent;
15
+ }
16
+ }
17
+ }
@@ -0,0 +1,17 @@
1
+ @import '../variables/media';
2
+
3
+ @mixin hitbox($size) {
4
+ @media ($tui-mobile) {
5
+ position: relative;
6
+ overflow: visible;
7
+
8
+ &::after {
9
+ content: '';
10
+ position: absolute;
11
+ display: block !important;
12
+ inline-size: max(100%, $size);
13
+ block-size: max(100%, $size);
14
+ background: transparent;
15
+ }
16
+ }
17
+ }
@@ -0,0 +1,171 @@
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
+ // TODO: rename to center-horizontal
10
+ // centering with translate
11
+ .center-left() {
12
+ position: absolute;
13
+ // stylelint-disable-next-line
14
+ left: 50%;
15
+ transform: translate(-50%, 0);
16
+ }
17
+
18
+ // TODO: rename to center-vertical
19
+ .center-top() {
20
+ position: absolute;
21
+ // stylelint-disable-next-line
22
+ top: 50%;
23
+ transform: translate(0, -50%);
24
+ }
25
+
26
+ .center-all() {
27
+ position: absolute;
28
+ inset: 50% auto auto 50%;
29
+ transform: translate(-50%, -50%);
30
+ }
31
+
32
+ //.fullsize
33
+ // @deprecated TODO remove in 5.0 in favor of inset: 0
34
+ .fullsize(@position: absolute, @mode: height) {
35
+ position: @position;
36
+ inset-block-start: 0;
37
+ inset-inline-start: 0;
38
+
39
+ & when (@mode = height) {
40
+ inline-size: 100%;
41
+ block-size: 100%;
42
+ }
43
+
44
+ & when (@mode = inset) {
45
+ inset-block-end: 0;
46
+ inset-inline-end: 0;
47
+ }
48
+ }
49
+
50
+ .button-clear() {
51
+ appearance: none;
52
+ padding: 0;
53
+ border: 0;
54
+ background: none;
55
+ font: inherit;
56
+ line-height: inherit;
57
+ text-decoration: none;
58
+ }
59
+
60
+ .button-base() {
61
+ .button-clear();
62
+
63
+ position: relative;
64
+ display: inline-flex;
65
+ align-items: center;
66
+ flex-shrink: 0;
67
+ box-sizing: border-box;
68
+ white-space: nowrap;
69
+ overflow: hidden;
70
+ vertical-align: middle;
71
+ max-inline-size: 100%;
72
+ // StackBlitz changes "0rem" to "0" breaking calc
73
+ gap: calc(var(--t-gap, ~'0rem') - 2 * var(--t-margin, 0rem));
74
+
75
+ > img,
76
+ > tui-icon,
77
+ > [tuiAvatar],
78
+ > tui-badge,
79
+ > [tuiBadge],
80
+ > [tuiRadio],
81
+ > [tuiSwitch],
82
+ > [tuiCheckbox],
83
+ &[tuiIcons]::before,
84
+ &[tuiIcons]::after {
85
+ margin: var(--t-margin);
86
+ }
87
+ }
88
+
89
+ // TODO remove @speed in 5.0
90
+ // transition
91
+ .transition(@param: all, @speed: var(--tui-duration, 300ms)) {
92
+ transition-property: @param;
93
+ transition-duration: @speed;
94
+ transition-timing-function: ease-in-out;
95
+ }
96
+
97
+ // gradient
98
+ .gradient(@start-color, @end-color, @angle: 45deg) {
99
+ background-image: linear-gradient(@angle, @start-color 0%, @end-color 100%);
100
+ }
101
+
102
+ // typical properties for text overflow with ellipsis
103
+ .text-overflow(@type: nowrap) {
104
+ white-space: @type;
105
+ overflow: hidden;
106
+ text-overflow: ellipsis;
107
+ }
108
+
109
+ .scrollbar-hidden() {
110
+ /* stylelint-disable*/
111
+ scrollbar-width: none;
112
+ -ms-overflow-style: none;
113
+ /* stylelint-enable*/
114
+
115
+ &::-webkit-scrollbar,
116
+ &::-webkit-scrollbar-thumb {
117
+ display: none;
118
+ }
119
+ }
120
+
121
+ // hide an element visually without hiding it from screen readers
122
+ .sr-only() {
123
+ position: absolute;
124
+ clip: rect(1px, 1px, 1px, 1px);
125
+ clip-path: inset(50%);
126
+ block-size: 1px;
127
+ inline-size: 1px;
128
+ margin: -1px;
129
+ overflow: hidden;
130
+ padding: 0;
131
+ }
132
+
133
+ // prevent scrolling to focused element on IOS
134
+ .tui-prevent-ios-scroll() {
135
+ .ios-only({
136
+ &:focus {
137
+ animation: tuiPreventIOSScroll 0.001s;
138
+ }
139
+ });
140
+
141
+ @keyframes tuiPreventIOSScroll {
142
+ 0% {
143
+ opacity: 0;
144
+ }
145
+
146
+ 100% {
147
+ opacity: 1;
148
+ }
149
+ }
150
+ }
151
+
152
+ .text-truncate() {
153
+ .text-overflow();
154
+
155
+ flex: 1;
156
+ min-inline-size: 0;
157
+ max-inline-size: max-content;
158
+ }
159
+
160
+ .tui-line-clamp(@count: 3) {
161
+ display: -webkit-box;
162
+ -webkit-box-orient: block-axis;
163
+ -webkit-line-clamp: @count;
164
+ line-clamp: @count;
165
+ overflow: hidden;
166
+ text-overflow: ellipsis;
167
+ }
168
+
169
+ .tui-mask(@x, @y, @r) {
170
+ mask: radial-gradient(circle at @x @y, transparent @r, black @r);
171
+ }