@empathyco/x-design-system 0.0.2-alpha.2 → 0.0.2-alpha.20

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.
@@ -0,0 +1,55 @@
1
+ @utility attach-container {
2
+ @apply xds:relative;
3
+ }
4
+
5
+ @utility attach-top-left {
6
+ @apply xds:absolute xds:top-0 xds:left-0;
7
+ transform: translate(calc(var(--xds-spacing-8, 50%) * -1), -50%);
8
+
9
+ &.xds\:badge-md {
10
+ transform: translate(calc(var(--xds-spacing-12, 50%) * -1), -50%);
11
+ }
12
+
13
+ &.xds\:badge-circle {
14
+ transform: translate(-50%, -50%);
15
+ }
16
+ }
17
+
18
+ @utility attach-top-right {
19
+ @apply xds:absolute xds:top-0 xds:right-0;
20
+ transform: translate(var(--xds-spacing-8, 50%), -50%);
21
+
22
+ &.xds\:badge-md {
23
+ transform: translate(var(--xds-spacing-12, 50%), -50%);
24
+ }
25
+
26
+ &.xds\:badge-circle {
27
+ transform: translate(50%, -50%);
28
+ }
29
+ }
30
+
31
+ @utility attach-bottom-right {
32
+ @apply xds:absolute xds:bottom-0 xds:right-0;
33
+ transform: translate(var(--xds-spacing-8, 50%), 50%);
34
+
35
+ &.xds\:badge-md {
36
+ transform: translate(var(--xds-spacing-12, 50%), 50%);
37
+ }
38
+
39
+ &.xds\:badge-circle {
40
+ transform: translate(50%, 50%);
41
+ }
42
+ }
43
+
44
+ @utility attach-bottom-left {
45
+ @apply xds:absolute xds:bottom-0 xds:left-0;
46
+ transform: translate(calc(var(--xds-spacing-8, 50%) * -1), 50%);
47
+
48
+ &.xds\:badge-md {
49
+ transform: translate(calc(var(--xds-spacing-12, 50%) * -1), 50%);
50
+ }
51
+
52
+ &.xds\:badge-circle {
53
+ transform: translate(-50%, 50%);
54
+ }
55
+ }
@@ -4,22 +4,20 @@
4
4
  @apply xds:inline-flex xds:items-center xds:justify-center xds:rounded-full;
5
5
  @apply xds:text-neutral-0 xds:bg-neutral-90;
6
6
 
7
- @apply xds:badge-md;
7
+ /* `@apply xds:badge-md;` can not be use here because cause circular dependency. */
8
+ @apply xds:h-24 xds:ps-8 xds:pe-8;
8
9
  }
9
10
 
10
11
  /* Sizes */
11
12
  @utility badge-sm {
12
- --attach-horizontal-offset: var(--xds-spacing-8);
13
13
  @apply xds:h-20 xds:ps-8 xds:pe-8;
14
14
  }
15
15
  @utility badge-md {
16
- --attach-horizontal-offset: var(--xds-spacing-12);
17
16
  @apply xds:h-24 xds:ps-12 xds:pe-12;
18
17
  }
19
18
 
20
19
  /* Circle */
21
20
  @utility badge-circle {
22
- --attach-horizontal-offset: 50%;
23
21
  @apply xds:overflow-hidden xds:whitespace-nowrap xds:p-0 xds:w-24;
24
22
 
25
23
  &.xds\:badge-sm {
@@ -30,140 +28,38 @@
30
28
  }
31
29
  }
32
30
 
33
- /* Colors */
34
- /* TODO - Look for a way to avoid hardcoded colors. Something like:
35
- @utility badge-* {
36
- background-color: --value(--xds-color-*-75);
37
- }*/
38
- @utility badge-neutral {
39
- @apply xds:bg-neutral-75;
40
- }
41
- @utility badge-lead {
42
- @apply xds:bg-lead-75;
43
- }
44
- @utility badge-auxiliary {
45
- @apply xds:bg-auxiliary-75;
46
- }
47
- @utility badge-accent {
48
- @apply xds:bg-accent-75;
49
- }
50
- @utility badge-highlight {
51
- @apply xds:bg-highlight-75;
52
- }
53
- @utility badge-success {
54
- @apply xds:bg-success-75;
55
- }
56
- @utility badge-warning {
57
- @apply xds:bg-warning-75;
58
- }
59
- @utility badge-error {
60
- @apply xds:bg-error-75;
31
+ /* Light */
32
+ @utility badge-light {
33
+ @apply xds:text-neutral-90 xds:bg-neutral-0;
61
34
  }
62
35
 
63
36
  /* Outlined */
64
37
  @utility badge-outlined {
65
38
  @apply xds:text-neutral-90 xds:bg-transparent;
66
39
  @apply xds:border-1 xds:border-neutral-90;
67
-
68
- &.xds\:badge-neutral {
69
- @apply xds:bg-transparent;
70
- @apply xds:border-neutral-50;
71
- }
72
- &.xds\:badge-lead {
73
- @apply xds:bg-transparent;
74
- @apply xds:border-lead-50;
75
- }
76
- &.xds\:badge-auxiliary {
77
- @apply xds:bg-transparent;
78
- @apply xds:border-auxiliary-50;
79
- }
80
- &.xds\:badge-accent {
81
- @apply xds:bg-transparent;
82
- @apply xds:border-accent-50;
83
- }
84
- &.xds\:badge-highlight {
85
- @apply xds:bg-transparent;
86
- @apply xds:border-highlight-50;
87
- }
88
- &.xds\:badge-success {
89
- @apply xds:bg-transparent;
90
- @apply xds:border-success-50;
91
- }
92
- &.xds\:badge-warning {
93
- @apply xds:bg-transparent;
94
- @apply xds:border-warning-50;
95
- }
96
- &.xds\:badge-error {
97
- @apply xds:bg-transparent;
98
- @apply xds:border-error-50;
99
- }
100
- }
101
-
102
- /* Light */
103
- @utility badge-light {
104
- @apply xds:text-neutral-90 xds:bg-neutral-0;
105
-
106
- &.xds\:badge-neutral {
107
- @apply xds:bg-neutral-25;
108
- }
109
- &.xds\:badge-lead {
110
- @apply xds:bg-lead-25;
111
- }
112
- &.xds\:badge-auxiliary {
113
- @apply xds:bg-auxiliary-25;
114
- }
115
- &.xds\:badge-accent {
116
- @apply xds:bg-accent-25;
117
- }
118
- &.xds\:badge-highlight {
119
- @apply xds:bg-highlight-25;
120
- }
121
- &.xds\:badge-success {
122
- @apply xds:bg-success-25;
123
- }
124
- &.xds\:badge-warning {
125
- @apply xds:bg-warning-25;
126
- }
127
- &.xds\:badge-error {
128
- @apply xds:bg-error-25;
129
- }
130
40
  }
131
41
 
132
42
  /* Bright */
133
43
  @utility badge-bright {
134
44
  @apply xds:text-neutral-90 xds:bg-transparent;
135
45
  @apply xds:border-1 xds:border-neutral-0;
46
+ }
136
47
 
137
- &.xds\:badge-neutral {
138
- @apply xds:bg-transparent;
139
- @apply xds:border-neutral-25;
140
- }
141
- &.xds\:badge-lead {
142
- @apply xds:bg-transparent;
143
- @apply xds:border-lead-25;
144
- }
145
- &.xds\:badge-auxiliary {
146
- @apply xds:bg-transparent;
147
- @apply xds:border-auxiliary-25;
148
- }
149
- &.xds\:badge-accent {
150
- @apply xds:bg-transparent;
151
- @apply xds:border-accent-25;
152
- }
153
- &.xds\:badge-highlight {
154
- @apply xds:bg-transparent;
155
- @apply xds:border-highlight-25;
156
- }
157
- &.xds\:badge-success {
158
- @apply xds:bg-transparent;
159
- @apply xds:border-success-25;
48
+ /* Colors */
49
+ @utility badge-* {
50
+ background-color: --value(--color- * -75);
51
+
52
+ &.xds\:badge-light {
53
+ background-color: --value(--color- * -25);
160
54
  }
161
- &.xds\:badge-warning {
55
+
56
+ &.xds\:badge-outlined {
162
57
  @apply xds:bg-transparent;
163
- @apply xds:border-warning-25;
58
+ border-color: --value(--color- * -50);
164
59
  }
165
- &.xds\:badge-error {
60
+
61
+ &.xds\:badge-bright {
166
62
  @apply xds:bg-transparent;
167
- @apply xds:border-error-25;
63
+ border-color: --value(--color- * -25);
168
64
  }
169
65
  }
@@ -0,0 +1,25 @@
1
+ /* Base */
2
+ @utility button-group {
3
+ @apply xds:inline-flex;
4
+ @apply xds:text-neutral-50;
5
+
6
+ /* We should only remove the left border if the button group doesn't have gap */
7
+ &:not([class*='gap']) > .xds\:button + .xds\:button {
8
+ @apply xds:border-l-0;
9
+ }
10
+
11
+ & > :not(.xds\:button-circle):first-child {
12
+ @apply xds:rounded-tl-[inherit] xds:rounded-bl-[inherit];
13
+ }
14
+
15
+ & > :not(.xds\:button-circle):last-child {
16
+ @apply xds:rounded-tr-[inherit] xds:rounded-br-[inherit];
17
+ }
18
+ }
19
+
20
+ /* Divider */
21
+ @utility button-group-divider {
22
+ @apply xds:border-l-1 xds:border-l-current;
23
+ @apply xds:my-8;
24
+ @apply xds:self-stretch;
25
+ }
@@ -0,0 +1,277 @@
1
+ /* Base */
2
+ @utility button {
3
+ @apply xds:flex xds:justify-center xds:items-center xds:content-center xds:flex-row xds:flex-nowrap;
4
+ @apply xds:border-1 xds:border-solid xds:box-border;
5
+ @apply xds:text-neutral-0 xds:bg-neutral-90 xds:border-neutral-90;
6
+ @apply xds:font-family-main xds:font-bold xds:tracking-md;
7
+ @apply xds:cursor-pointer;
8
+
9
+ /* `@apply xds:button-md;` can not be use here because cause circular dependency. */
10
+ @apply xds:min-h-40 xds:gap-8 xds:ps-16 xds:pe-16 xds:text-sm;
11
+
12
+ @variant hover-active {
13
+ @apply xds:bg-neutral-100 xds:border-neutral-100;
14
+ }
15
+
16
+ @variant selected {
17
+ @apply xds:bg-neutral-100 xds:border-neutral-100;
18
+
19
+ @variant hover-active {
20
+ @apply xds:bg-neutral-90 xds:border-neutral-90;
21
+ }
22
+ }
23
+
24
+ @variant disabled {
25
+ @apply xds:border-neutral-10 xds:bg-neutral-10 xds:text-neutral-25;
26
+ @apply xds:cursor-not-allowed;
27
+
28
+ @variant hover-active {
29
+ @apply xds:border-neutral-10 xds:bg-neutral-10 xds:text-neutral-25;
30
+ }
31
+ }
32
+ }
33
+
34
+ /* Sizes */
35
+ @utility button-sm {
36
+ @apply xds:min-h-32 xds:gap-8 xds:ps-12 xds:pe-12 xds:text-sm;
37
+ }
38
+ @utility button-md {
39
+ @apply xds:min-h-40 xds:gap-8 xds:ps-16 xds:pe-16 xds:text-sm;
40
+ }
41
+ @utility button-lg {
42
+ @apply xds:min-h-48 xds:gap-8 xds:ps-20 xds:pe-20 xds:text-md;
43
+ }
44
+ @utility button-xl {
45
+ @apply xds:min-h-56 xds:gap-8 xds:ps-24 xds:pe-24 xds:text-lg;
46
+ }
47
+
48
+ /* Layouts */
49
+ @utility button-circle {
50
+ @apply xds:aspect-square xds:ps-0 xds:pe-0 xds:rounded-full;
51
+ }
52
+ @utility button-square {
53
+ @apply xds:aspect-square xds:ps-0 xds:pe-0;
54
+ }
55
+
56
+ /* Outlined */
57
+ @utility button-outlined {
58
+ @apply xds:text-neutral-90 xds:bg-transparent;
59
+ @apply xds:border-1 xds:border-neutral-90;
60
+
61
+ @variant hover-active {
62
+ @apply xds:bg-neutral-90 xds:border-neutral-90 xds:text-neutral-0;
63
+ }
64
+
65
+ @variant selected {
66
+ @apply xds:bg-neutral-90 xds:border-neutral-90 xds:text-neutral-0;
67
+
68
+ @variant hover-active {
69
+ @apply xds:bg-transparent xds:border-neutral-90 xds:text-neutral-90;
70
+ }
71
+ }
72
+
73
+ @variant disabled {
74
+ @apply xds:border-neutral-25 xds:bg-neutral-10 xds:text-neutral-25;
75
+ @apply xds:cursor-not-allowed;
76
+
77
+ @variant hover-active {
78
+ @apply xds:border-neutral-25 xds:bg-neutral-10 xds:text-neutral-25;
79
+ }
80
+ }
81
+ }
82
+
83
+ /* Ghost */
84
+ @utility button-ghost {
85
+ @apply xds:text-neutral-90 xds:bg-transparent;
86
+ @apply xds:border-0;
87
+
88
+ @variant hover-active {
89
+ @apply xds:border-transparent xds:bg-transparent xds:text-neutral-100;
90
+ }
91
+
92
+ &:hover {
93
+ @apply xds:bg-neutral-10 xds:border-neutral-10;
94
+ }
95
+
96
+ @variant selected {
97
+ @apply xds:bg-neutral-10 xds:border-neutral-10 xds:text-neutral-90;
98
+
99
+ @variant hover-active {
100
+ @apply xds:bg-neutral-25 xds:border-neutral-25;
101
+ }
102
+ }
103
+
104
+ @variant disabled {
105
+ @apply xds:bg-transparent xds:border-0 xds:text-neutral-25 xds:cursor-not-allowed;
106
+
107
+ @variant hover-active {
108
+ @apply xds:border-0 xds:bg-transparent xds:text-neutral-25;
109
+ }
110
+ }
111
+ }
112
+
113
+ /* Tight */
114
+ @utility button-tight {
115
+ @apply xds:bg-transparent xds:border-0 xds:text-neutral-90;
116
+ @apply xds:pe-0 xds:ps-0;
117
+
118
+ @variant hover-active {
119
+ @apply xds:bg-transparent xds:border-0 xds:text-neutral-100;
120
+ }
121
+
122
+ @variant selected {
123
+ @apply xds:bg-transparent xds:border-0 xds:text-neutral-100;
124
+
125
+ @variant hover-active {
126
+ @apply xds:bg-transparent xds:border-0 xds:text-neutral-90;
127
+ }
128
+ }
129
+
130
+ @variant disabled {
131
+ @apply xds:bg-transparent xds:border-0 xds:text-neutral-25;
132
+ @apply xds:cursor-not-allowed;
133
+
134
+ @variant hover-active {
135
+ @apply xds:border-0 xds:bg-transparent xds:text-neutral-25;
136
+ }
137
+ }
138
+ }
139
+
140
+ /* Link */
141
+ @utility button-link {
142
+ @apply xds:inline-flex xds:min-h-0 xds:ps-0 xds:pe-0;
143
+ @apply xds:border-0 xds:text-neutral-90 xds:bg-transparent;
144
+ @apply xds:font-[inherit] xds:tracking-[inherit] xds:leading-[inherit] xds:underline;
145
+ font-size: inherit;
146
+ font-weight: inherit;
147
+
148
+ @variant hover-active {
149
+ @apply xds:bg-transparent xds:border-0 xds:text-neutral-100;
150
+ }
151
+
152
+ @variant selected {
153
+ @apply xds:bg-transparent xds:border-0 xds:text-neutral-100 xds:font-bold;
154
+
155
+ @variant hover-active {
156
+ @apply xds:bg-transparent xds:border-0 xds:text-neutral-90;
157
+ }
158
+ }
159
+
160
+ @variant disabled {
161
+ @apply xds:bg-transparent xds:border-0 xds:text-neutral-25;
162
+ @apply xds:cursor-not-allowed;
163
+ font-weight: inherit;
164
+
165
+ @variant hover-active {
166
+ @apply xds:border-0 xds:bg-transparent xds:text-neutral-25;
167
+ }
168
+ }
169
+ }
170
+
171
+ /* Colors */
172
+ @utility button-* {
173
+ background-color: --value(--color- * -50);
174
+ border-color: --value(--color- * -50);
175
+
176
+ @variant hover-active {
177
+ background-color: --value(--color- * -75);
178
+ border-color: --value(--color- * -75);
179
+ }
180
+
181
+ @variant selected {
182
+ background-color: --value(--color- * -75);
183
+ border-color: --value(--color- * -75);
184
+
185
+ @variant hover-active {
186
+ background-color: --value(--color- * -50);
187
+ border-color: --value(--color- * -50);
188
+ }
189
+ }
190
+
191
+ &.xds\:button-outlined {
192
+ @apply xds:bg-transparent;
193
+ border-color: --value(--color- * -50);
194
+ color: --value(--color- * -50);
195
+
196
+ @variant hover-active {
197
+ @apply xds:text-neutral-0;
198
+ background-color: --value(--color- * -50);
199
+ border-color: --value(--color- * -50);
200
+ }
201
+
202
+ @variant selected {
203
+ @apply xds:text-neutral-0;
204
+ background-color: --value(--color- * -50);
205
+ border-color: --value(--color- * -50);
206
+
207
+ @variant hover-active {
208
+ @apply xds:bg-transparent;
209
+ color: --value(--color- * -50);
210
+ }
211
+ }
212
+ }
213
+
214
+ &.xds\:button-ghost {
215
+ @apply xds:border-0 xds:bg-transparent;
216
+ color: --value(--color- * -50);
217
+
218
+ @variant hover-active {
219
+ @apply xds:border-transparent xds:bg-transparent xds:text-neutral-100;
220
+ }
221
+
222
+ &:hover {
223
+ @apply xds:bg-neutral-10 xds:border-neutral-10;
224
+ color: --value(--color- * -75);
225
+ }
226
+
227
+ @variant selected {
228
+ @apply xds:bg-neutral-10 xds:border-neutral-10;
229
+ color: --value(--color- * -75);
230
+
231
+ @variant hover-active {
232
+ @apply xds:bg-neutral-25 xds:border-neutral-25;
233
+ color: --value(--color- * -75);
234
+ }
235
+ }
236
+ }
237
+
238
+ &.xds\:button-tight {
239
+ @apply xds:border-0 xds:bg-transparent;
240
+ color: --value(--color- * -50);
241
+
242
+ @variant hover-active {
243
+ @apply xds:bg-transparent xds:border-0;
244
+ color: --value(--color- * -75);
245
+ }
246
+
247
+ @variant selected {
248
+ @apply xds:bg-transparent xds:border-0;
249
+ color: --value(--color- * -75);
250
+
251
+ @variant hover-active {
252
+ @apply xds:bg-transparent xds:border-0;
253
+ color: --value(--color- * -50);
254
+ }
255
+ }
256
+ }
257
+
258
+ &.xds\:button-link {
259
+ @apply xds:border-0 xds:bg-transparent;
260
+ color: --value(--color- * -50);
261
+
262
+ @variant hover-active {
263
+ @apply xds:bg-transparent xds:border-0;
264
+ color: --value(--color- * -75);
265
+ }
266
+
267
+ @variant selected {
268
+ @apply xds:bg-transparent xds:border-0;
269
+ color: --value(--color- * -75);
270
+
271
+ @variant hover-active {
272
+ @apply xds:bg-transparent xds:border-0;
273
+ color: --value(--color- * -50);
274
+ }
275
+ }
276
+ }
277
+ }
@@ -0,0 +1,129 @@
1
+ /* Base */
2
+ @utility filter-facet {
3
+ @apply xds:grid xds:grid-flow-col xds:box-border;
4
+ @apply xds:items-baseline-last xds:content-center xds:justify-start;
5
+ @apply xds:cursor-pointer;
6
+ @apply xds:font-family-main xds:font-regular xds:text-start xds:text-neutral-90;
7
+ @apply xds:border-b-1 xds:border-transparent;
8
+
9
+ /* `@apply xds:filter-facet-md;` can not be use here because cause circular dependency. */
10
+ @apply xds:min-h-32 xds:gap-4 xds:text-sm;
11
+
12
+ & > .xds\:icon {
13
+ @apply xds:icon-offset;
14
+ }
15
+
16
+ &:hover {
17
+ @apply xds:text-neutral-50;
18
+ }
19
+
20
+ @variant selected {
21
+ @apply xds:font-bold xds:tracking-xs xds:text-neutral-90;
22
+ }
23
+
24
+ @variant disabled {
25
+ @apply xds:text-neutral-25;
26
+ @apply xds:cursor-not-allowed;
27
+ }
28
+ }
29
+
30
+ /* Sizes */
31
+ @utility filter-facet-sm {
32
+ @apply xds:min-h-24 xds:gap-2 xds:text-sm;
33
+ }
34
+ @utility filter-facet-md {
35
+ @apply xds:min-h-32 xds:gap-4 xds:text-sm;
36
+ }
37
+ @utility filter-facet-lg {
38
+ @apply xds:min-h-48 xds:gap-12 xds:text-md;
39
+ }
40
+
41
+ /* Underline */
42
+ @utility filter-facet-underline {
43
+ &:hover {
44
+ @apply xds:border-current;
45
+
46
+ @variant disabled {
47
+ @apply xds:border-transparent;
48
+ }
49
+ }
50
+
51
+ @variant selected {
52
+ @apply xds:font-regular xds:tracking-md;
53
+ }
54
+ }
55
+
56
+ /* Ghost */
57
+ @utility filter-facet-ghost {
58
+ @apply xds:px-8;
59
+
60
+ &.xds\:filter-facet-sm {
61
+ @apply xds:px-4;
62
+ }
63
+ &.xds\:filter-facet-md {
64
+ @apply xds:px-8;
65
+ }
66
+ &.xds\:filter-facet-lg {
67
+ @apply xds:px-12;
68
+ }
69
+
70
+ &:hover {
71
+ @apply xds:bg-neutral-10 xds:text-neutral-90;
72
+ }
73
+
74
+ @variant selected {
75
+ @apply xds:font-regular xds:tracking-md xds:text-neutral-75;
76
+ }
77
+
78
+ @variant disabled {
79
+ @apply xds:border-transparent xds:text-neutral-25 xds:bg-transparent;
80
+ }
81
+ }
82
+
83
+ /* Simple */
84
+ @utility filter-facet-simple {
85
+ @apply xds:px-8;
86
+
87
+ &:hover {
88
+ @apply xds:text-neutral-90 xds:opacity-60;
89
+ }
90
+
91
+ @variant selected {
92
+ @apply xds:font-regular xds:tracking-md;
93
+
94
+ &:hover {
95
+ @apply xds:text-neutral-50;
96
+ }
97
+
98
+ @variant disabled {
99
+ @apply xds:text-neutral-25;
100
+ }
101
+ }
102
+
103
+ @variant disabled {
104
+ @apply xds:opacity-100 xds:text-neutral-25;
105
+ }
106
+ }
107
+
108
+ /* Colors */
109
+ @utility filter-facet-* {
110
+ &:hover:not(.xds\:filter-facet-ghost) {
111
+ color: --value(--color- * -50);
112
+ }
113
+
114
+ @variant selected {
115
+ color: --value(--color- * -50);
116
+ }
117
+
118
+ &.xds\:filter-facet-simple.xds\:selected {
119
+ &:hover {
120
+ color: --value(--color- * -50);
121
+ }
122
+ }
123
+
124
+ &.xds\:filter-facet-ghost {
125
+ @variant selected {
126
+ color: --value(--color- * -75);
127
+ }
128
+ }
129
+ }
@@ -0,0 +1,9 @@
1
+ /* Base */
2
+ @utility highlight-text {
3
+ @apply xds:font-bold;
4
+ }
5
+
6
+ /* Match */
7
+ @utility highlight-text-match {
8
+ @apply xds:font-regular;
9
+ }