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

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,72 @@
1
+ /* Base */
2
+ @utility icon {
3
+ @apply xds:flex xds:flex-none xds:items-center xds:justify-center;
4
+ @apply xds:aspect-square xds:w-auto xds:font-family-icon;
5
+ vector-effect: non-scaling-stroke;
6
+
7
+ /* `@apply xds:icon-md;` can not be use here because cause circular dependency. */
8
+ @apply xds:h-16 xds:text-[14px];
9
+ }
10
+
11
+ /* Offset */
12
+ /* This utility can be used like:
13
+ * @utility suggestion {
14
+ * & .xds\:icon {
15
+ * @apply xds:icon-offset;
16
+ * }
17
+ * }
18
+ */
19
+ @utility icon-offset {
20
+ --iconVerticalOffset: calc(50% - 0.5ex - 1px);
21
+ font-size: initial;
22
+ transform: translateY(var(--iconVerticalOffset, 0));
23
+ margin-top: calc(var(--iconVerticalOffset) * -1);
24
+ }
25
+
26
+ /* Sizes */
27
+ @utility icon-sm {
28
+ @apply xds:h-8;
29
+ @apply xds:text-[7px];
30
+ }
31
+ @utility icon-md {
32
+ @apply xds:h-16;
33
+ @apply xds:text-[14px];
34
+ }
35
+ @utility icon-lg {
36
+ @apply xds:h-24;
37
+ @apply xds:text-[20px];
38
+ }
39
+ @utility icon-xl {
40
+ @apply xds:h-32;
41
+ @apply xds:text-[28px];
42
+ }
43
+
44
+ /* Sharp */
45
+ @utility icon-sharp {
46
+ & > * {
47
+ stroke-linecap: square;
48
+ stroke-linejoin: miter;
49
+ }
50
+ }
51
+
52
+ /* Stroke width */
53
+ @utility icon-stroke-width-* {
54
+ & > * {
55
+ stroke-width: --value(--stroke-width-*);
56
+ }
57
+ }
58
+
59
+ /* Colors */
60
+ @utility icon-* {
61
+ color: --value(--color-*);
62
+ }
63
+
64
+ /* Background colors */
65
+ @utility icon-bg-* {
66
+ & > [stroke='#fff'] {
67
+ stroke: --value(--color-*);
68
+ }
69
+ & > [fill='#fff'] {
70
+ fill: --value(--color-*);
71
+ }
72
+ }
@@ -1 +1,17 @@
1
+ @import './attach.css';
1
2
  @import './badge.css';
3
+ @import './button-group.css';
4
+ @import './button.css';
5
+ @import './filter-facet.css';
6
+ @import './highlight.css';
7
+ @import './icon.css';
8
+ @import './input-group.css';
9
+ @import './input.css';
10
+ @import './picture.css';
11
+ @import './progress-bar.css';
12
+ @import './scroll.css';
13
+ @import './sliding-panel.css';
14
+ @import './suggestion-group.css';
15
+ @import './suggestion.css';
16
+ @import './tag.css';
17
+ @import './typography.css';
@@ -0,0 +1,202 @@
1
+ /* Base */
2
+ @utility input-group {
3
+ @apply xds:input;
4
+ @apply xds:flex xds:flex-row xds:flex-nowrap xds:content-center xds:items-center;
5
+ @apply xds:gap-8 xds:overflow-hidden xds:ps-0 xds:pe-0;
6
+ @apply xds:border-neutral-25 xds:bg-neutral-10 xds:text-neutral-50;
7
+
8
+ & > :first-child:not(.xds\:input-group-button-primary) {
9
+ @apply xds:ms-16;
10
+ }
11
+ & > :last-child:not(.xds\:input-group-button-primary) {
12
+ @apply xds:me-16;
13
+ }
14
+
15
+ & > .xds\:input,
16
+ & > input {
17
+ @apply xds:min-w-0 xds:flex-1 xds:border-0 xds:p-0;
18
+ @apply xds:bg-transparent xds:text-inherit xds:outline-none;
19
+ }
20
+ }
21
+
22
+ /* Sizes */
23
+ @utility input-group-sm {
24
+ @apply xds:input-sm;
25
+
26
+ & > .xds\:input-group-button {
27
+ @apply xds:text-xs;
28
+ }
29
+
30
+ & > .xds\:input-group-button-primary {
31
+ @apply xds:text-sm;
32
+ }
33
+
34
+ & > .xds\:input-group-button-rectangle {
35
+ @apply xds:ps-12 xds:pe-12;
36
+ }
37
+ }
38
+ @utility input-group-md {
39
+ @apply xds:input-md;
40
+
41
+ & > .xds\:input-group-button {
42
+ @apply xds:text-sm;
43
+ }
44
+
45
+ & > .xds\:input-group-button-primary {
46
+ @apply xds:text-sm;
47
+ }
48
+
49
+ & > .xds\:input-group-button-rectangle {
50
+ @apply xds:ps-16 xds:pe-16;
51
+ }
52
+ }
53
+ @utility input-group-lg {
54
+ @apply xds:input-lg;
55
+
56
+ & > .xds\:input-group-button {
57
+ @apply xds:text-sm;
58
+ }
59
+
60
+ & > .xds\:input-group-button-primary {
61
+ @apply xds:text-md;
62
+ }
63
+
64
+ & > .xds\:input-group-button-rectangle {
65
+ @apply xds:ps-20 xds:pe-20;
66
+ }
67
+ }
68
+
69
+ /* Line */
70
+ @utility input-group-line {
71
+ @apply xds:input-line;
72
+
73
+ @variant disabled {
74
+ @apply xds:bg-none;
75
+ }
76
+
77
+ & > .xds\:input-group-button {
78
+ @apply xds:h-32;
79
+ }
80
+
81
+ &.xds\:input-group-sm {
82
+ @apply xds:pb-4;
83
+
84
+ & > .xds\:input-group-button {
85
+ @apply xds:h-28;
86
+ }
87
+ }
88
+
89
+ & > .xds\:input-group-button-primary:first-child {
90
+ @apply xds:border-s;
91
+ }
92
+
93
+ & > .xds\:input-group-button-primary:first-child {
94
+ @apply xds:border-e;
95
+ }
96
+ }
97
+
98
+ /* Input Group Button */
99
+ @utility input-group-button {
100
+ @apply xds:button;
101
+ @apply xds:aspect-square xds:h-full xds:p-0;
102
+ @apply xds:text-sm xds:font-regular;
103
+ @apply xds:border-transparent xds:bg-transparent xds:text-neutral-50;
104
+
105
+ @variant hover-active-focus {
106
+ @apply xds:border-transparent xds:bg-transparent xds:text-neutral-75;
107
+ }
108
+
109
+ @variant disabled {
110
+ @apply xds:border-neutral-10 xds:bg-neutral-10 xds:text-neutral-25;
111
+ }
112
+ }
113
+
114
+ /* Input Group Primary Button */
115
+ @utility input-group-button-primary {
116
+ @apply xds:border-0 xds:border-l-1 xds:border-neutral-90 xds:bg-neutral-90 xds:text-neutral-0;
117
+
118
+ @variant hover-active-focus {
119
+ @apply xds:border-neutral-75 xds:bg-neutral-75;
120
+ }
121
+
122
+ &:first-child {
123
+ @apply xds:ms-0 xds:border-s-0;
124
+ }
125
+
126
+ &:last-child {
127
+ @apply xds:me-0 xds:border-e-0;
128
+ }
129
+ }
130
+
131
+ /* Input Group Rectangle Button */
132
+ @utility input-group-button-rectangle {
133
+ @apply xds:aspect-auto xds:ps-16 xds:pe-16;
134
+ }
135
+
136
+ /* Input Group Outlined Button */
137
+ @utility input-group-button-outlined {
138
+ @apply xds:border-neutral-90 xds:bg-neutral-0 xds:text-neutral-90;
139
+
140
+ @variant hover-active-focus {
141
+ @apply xds:border-neutral-90 xds:bg-neutral-90 xds:text-neutral-0;
142
+ }
143
+ }
144
+
145
+ /* Input Group Ghost Button */
146
+ @utility input-group-button-ghost {
147
+ @apply xds:border-transparent xds:bg-transparent xds:text-neutral-90;
148
+
149
+ @variant hover-active-focus {
150
+ @apply xds:border-neutral-10 xds:bg-neutral-10 xds:text-neutral-90;
151
+ }
152
+ }
153
+
154
+ /* Input Group Colors */
155
+ @utility input-group-* {
156
+ border-color: --value(--color-*-50);
157
+
158
+ @variant focus {
159
+ border-color: --value(--color-*-75);
160
+ }
161
+
162
+ &.xds\:input-group-line {
163
+ background-image: linear-gradient(--value(--color-*-50), --value(--color-*-50));
164
+
165
+ @variant focus {
166
+ box-shadow: 0 2px 0 -0.5px --value(--color-*-25);
167
+ }
168
+ }
169
+
170
+ & > .xds\:input-group-button-primary {
171
+ @apply xds:text-neutral-0;
172
+ background-color: --value(--color-*-50);
173
+ border-color: --value(--color-*-50);
174
+
175
+ @variant hover-active-focus {
176
+ background-color: --value(--color-*-75);
177
+ border-color: --value(--color-*-75);
178
+ }
179
+ }
180
+
181
+ & > .xds\:input-group-button-outlined {
182
+ @apply xds:border-y-0 xds:bg-neutral-0;
183
+ border-color: --value(--color-*-50);
184
+ color: --value(--color-*-50);
185
+
186
+ @variant hover-active-focus {
187
+ @apply xds:text-neutral-0;
188
+ background-color: --value(--color-*-50);
189
+ border-color: --value(--color-*-50);
190
+ }
191
+ }
192
+
193
+ & > .xds\:input-group-button-ghost {
194
+ @apply xds:border-transparent xds:bg-transparent;
195
+ color: --value(--color-*-50);
196
+
197
+ @variant hover-active-focus {
198
+ @apply xds:border-neutral-10 xds:bg-neutral-10;
199
+ color: --value(--color-*-75);
200
+ }
201
+ }
202
+ }
@@ -0,0 +1,82 @@
1
+ /* Base */
2
+ @utility input {
3
+ @apply xds:cursor-text xds:ps-16 xds:pe-16 xds:font-regular xds:text-ellipsis;
4
+ @apply xds:border-1 xds:border-neutral-90;
5
+ @apply xds:bg-neutral-0 xds:text-neutral-90;
6
+
7
+ /* `@apply xds:input-md;` can not be use here because cause circular dependency. */
8
+ @apply xds:h-40 xds:text-md;
9
+
10
+ &:hover {
11
+ @apply xds:border-neutral-50;
12
+ }
13
+
14
+ @variant focus {
15
+ @apply xds:border-neutral-50 xds:outline-2 xds:outline-neutral-25;
16
+ }
17
+
18
+ @variant disabled {
19
+ @apply xds:border-neutral-25 xds:bg-neutral-10 xds:text-neutral-50;
20
+ @apply xds:cursor-not-allowed;
21
+ }
22
+
23
+ &::placeholder {
24
+ @apply xds:font-family-main xds:font-regular xds:text-neutral-50;
25
+ }
26
+ }
27
+
28
+ /* Sizes */
29
+ @utility input-sm {
30
+ @apply xds:h-32 xds:text-sm;
31
+ }
32
+
33
+ @utility input-md {
34
+ @apply xds:h-40 xds:text-base;
35
+ }
36
+
37
+ @utility input-lg {
38
+ @apply xds:h-48 xds:text-base;
39
+ }
40
+
41
+ /* Line */
42
+ @utility input-line {
43
+ @apply xds:border-0 xds:border-b-neutral-90;
44
+ @apply xds:bg-size-[100%_1px] xds:bg-bottom xds:bg-no-repeat;
45
+ background-image: linear-gradient(var(--xds-color-neutral-90), var(--xds-color-neutral-90));
46
+
47
+ &:hover {
48
+ @apply xds:bg-size-[100%_2px];
49
+ }
50
+
51
+ @variant focus {
52
+ @apply xds:bg-size-[100%_2px] xds:text-neutral-90 xds:outline-none;
53
+ @apply xds:shadow-[0_2px_0_-0.5px] xds:shadow-neutral-25;
54
+ }
55
+
56
+ @variant disabled {
57
+ @apply xds:bg-neutral-10;
58
+ background-image: linear-gradient(var(--xds-color-neutral-25), var(--xds-color-neutral-25));
59
+ }
60
+ }
61
+
62
+ /* Colors */
63
+ @utility input-* {
64
+ border-color: --value(--color-*-50);
65
+
66
+ &.xds\:input-line {
67
+ background-image: linear-gradient(--value(--color-*-50), --value(--color-*-50));
68
+
69
+ @variant focus {
70
+ box-shadow: 0 2px 0 -0.5px --value(--color-*-25);
71
+ }
72
+ }
73
+
74
+ &:hover {
75
+ border-color: --value(--color-*-75);
76
+ }
77
+
78
+ @variant focus {
79
+ border-color: --value(--color-*-75);
80
+ outline-color: --value(--color-*-25);
81
+ }
82
+ }
@@ -0,0 +1,31 @@
1
+ /* Base */
2
+ @utility picture {
3
+ @apply xds:block xds:aspect-ratio-default xds:overflow-hidden;
4
+ }
5
+
6
+ /* Image */
7
+ @utility picture-image {
8
+ @apply xds:aspect-ratio-default xds:h-full xds:w-full xds:object-contain;
9
+ }
10
+
11
+ /* Zoom */
12
+ @utility picture-zoom {
13
+ & > .xds\:picture-image {
14
+ @apply xds:transition-transform xds:duration-300 xds:ease-out;
15
+
16
+ &:hover {
17
+ @apply xds:scale-110;
18
+ }
19
+ }
20
+ }
21
+
22
+ /* Overlay */
23
+ @utility picture-overlay {
24
+ &:hover {
25
+ @apply xds:mix-blend-multiply;
26
+ }
27
+
28
+ & > .xds\:picture-image:hover {
29
+ mask-image: linear-gradient(to top, transparent 20%, var(--xds-color-neutral-100));
30
+ }
31
+ }
@@ -0,0 +1,30 @@
1
+ /* Base */
2
+ @utility progress-bar {
3
+ @apply xds:rounded-sm;
4
+ @apply xds:inline-block;
5
+ @apply xds:bg-neutral-25;
6
+ @apply xds:overflow-hidden;
7
+
8
+ /* `@apply xds:progress-bar-md;` can not be use here because cause circular dependency. */
9
+ @apply xds:h-4;
10
+
11
+ & > .xds\:progress-bar-fill {
12
+ @apply xds:h-full;
13
+ @apply xds:bg-neutral-50;
14
+ }
15
+ }
16
+
17
+ /* Sizes */
18
+ @utility progress-bar-md {
19
+ @apply xds:h-4;
20
+ }
21
+ @utility progress-bar-lg {
22
+ @apply xds:h-8;
23
+ }
24
+
25
+ /* Colors */
26
+ @utility progress-bar-* {
27
+ & > .xds\:progress-bar-fill {
28
+ background-color: --value(--color-*-50);
29
+ }
30
+ }
@@ -0,0 +1,28 @@
1
+ /* Base */
2
+ @utility scroll {
3
+ @apply xds:min-h-0 xds:overflow-y-scroll;
4
+
5
+ @media (hover: hover) and (pointer: fine) {
6
+ &:hover {
7
+ --xds-color-thumb-scroll-bar: var(--xds-color-thumb-scroll-bar-hover);
8
+ }
9
+
10
+ /* Firefox */
11
+ scrollbar-width: auto;
12
+ scrollbar-color: var(--xds-color-thumb-scroll-bar) var(--xds-color-background-scroll-bar);
13
+
14
+ /* WebKit */
15
+ &::-webkit-scrollbar {
16
+ @apply xds:w-4.25;
17
+ }
18
+
19
+ &::-webkit-scrollbar-thumb {
20
+ @apply xds:bg-thumb-scroll-bar xds:bg-clip-content;
21
+ @apply xds:rounded-3xl xds:border-4 xds:border-transparent;
22
+ }
23
+
24
+ &::-webkit-scrollbar-track {
25
+ @apply xds:bg-background-scroll-bar;
26
+ }
27
+ }
28
+ }
@@ -0,0 +1,140 @@
1
+ /* Base */
2
+ @utility sliding-panel {
3
+ @apply xds:relative xds:flex xds:flex-row xds:flex-nowrap xds:items-center;
4
+ }
5
+
6
+ /* Fade */
7
+ @utility sliding-panel-fade {
8
+ --xds-sliding-panel-fade-spacing: var(--xds-spacing-80);
9
+ mask: linear-gradient(
10
+ to right,
11
+ transparent calc(0.43 * var(--xds-sliding-panel-fade-spacing)),
12
+ rgba(0, 0, 0, 0.8) calc(0.67 * var(--xds-sliding-panel-fade-spacing)),
13
+ black var(--xds-sliding-panel-fade-spacing),
14
+ rgba(0, 0, 0, 0.8) calc(100% - 0.67 * var(--xds-sliding-panel-fade-spacing)),
15
+ transparent calc(100% - 0.43 * var(--xds-sliding-panel-fade-spacing))
16
+ );
17
+ }
18
+
19
+ /* Fade Sizes */
20
+ @utility sliding-panel-fade-sm {
21
+ @apply xds:sliding-panel-fade;
22
+ --xds-sliding-panel-fade-spacing: var(--xds-spacing-40);
23
+ }
24
+ @utility sliding-panel-fade-md {
25
+ @apply xds:sliding-panel-fade;
26
+ --xds-sliding-panel-fade-spacing: var(--xds-spacing-80);
27
+ }
28
+ @utility sliding-panel-fade-lg {
29
+ @apply xds:sliding-panel-fade;
30
+ --xds-sliding-panel-fade-spacing: var(--xds-spacing-160);
31
+ }
32
+
33
+ /* Buttons */
34
+ @utility sliding-panel-button {
35
+ @apply xds:button;
36
+ @apply xds:absolute xds:z-1;
37
+ @apply xds:translate-x-0 xds:transition-all xds:duration-200 xds:ease-out;
38
+ }
39
+
40
+ @utility sliding-panel-button-left {
41
+ @apply xds:left-0;
42
+ }
43
+
44
+ @utility sliding-panel-button-right {
45
+ @apply xds:right-0;
46
+ }
47
+
48
+ /* Buttons on hover */
49
+ @utility sliding-panel-show-buttons-on-hover {
50
+ & > .xds\:sliding-panel-button-left {
51
+ @apply xds:opacity-0;
52
+ }
53
+
54
+ & > .xds\:sliding-panel-button-right {
55
+ @apply xds:opacity-0;
56
+ }
57
+
58
+ &:hover {
59
+ &:not(.xds\:sliding-panel-at-start) > .xds\:sliding-panel-button-left,
60
+ &:not(.xds\:sliding-panel-at-end) > .xds\:sliding-panel-button-right {
61
+ @apply xds:pointer-events-auto xds:opacity-100;
62
+ }
63
+ }
64
+ }
65
+
66
+ /* Button positions */
67
+ @utility sliding-panel-buttons-center {
68
+ & > .xds\:sliding-panel-button-left {
69
+ @apply xds:-translate-x-1/2;
70
+ }
71
+
72
+ & > .xds\:sliding-panel-button-right {
73
+ @apply xds:translate-x-1/2;
74
+ }
75
+ }
76
+
77
+ @utility sliding-panel-buttons-outside {
78
+ & > .xds\:sliding-panel-button-left {
79
+ @apply xds:-translate-x-full;
80
+ }
81
+
82
+ & > .xds\:sliding-panel-button-right {
83
+ @apply xds:translate-x-full;
84
+ }
85
+ }
86
+
87
+ /* Fade positions */
88
+ @utility sliding-panel-fade-position {
89
+ --xds-sliding-panel-fade-spacing: var(--xds-spacing-80);
90
+ --xds-sliding-panel-fade-direction: to left;
91
+ mask: linear-gradient(
92
+ var(--xds-sliding-panel-fade-direction),
93
+ transparent calc(0.43 * var(--xds-sliding-panel-fade-spacing)),
94
+ rgba(0, 0, 0, 0.8) calc(0.67 * var(--xds-sliding-panel-fade-spacing)),
95
+ black var(--xds-sliding-panel-fade-spacing)
96
+ );
97
+ }
98
+ @utility sliding-panel-at-start {
99
+ & > .xds\:sliding-panel-button-left {
100
+ @apply xds:pointer-events-none xds:opacity-0;
101
+ }
102
+
103
+ & > .xds\:sliding-panel-fade-sm {
104
+ @apply xds:sliding-panel-fade-position;
105
+ --xds-spacing-sliding-fade: var(--xds-spacing-40);
106
+ }
107
+ & > .xds\:sliding-panel-fade,
108
+ & > .xds\:sliding-panel-fade-md {
109
+ @apply xds:sliding-panel-fade-position;
110
+ }
111
+ & > .xds\:sliding-panel-fade-lg {
112
+ @apply xds:sliding-panel-fade-position;
113
+ --xds-spacing-sliding-fade: var(--xds-spacing-160);
114
+ }
115
+
116
+ &.xds\:sliding-panel-at-end > .xds\:sliding-panel-fade {
117
+ mask: none;
118
+ }
119
+ }
120
+ @utility sliding-panel-at-end {
121
+ & > .xds\:sliding-panel-button-right {
122
+ @apply xds:pointer-events-none xds:opacity-0;
123
+ }
124
+
125
+ & > .xds\:sliding-panel-fade-sm {
126
+ @apply xds:sliding-panel-fade-position;
127
+ --xds-spacing-sliding-fade: var(--xds-spacing-40);
128
+ --xds-sliding-panel-fade-direction: to right;
129
+ }
130
+ & > .xds\:sliding-panel-fade,
131
+ & > .xds\:sliding-panel-fade-md {
132
+ @apply xds:sliding-panel-fade-position;
133
+ --xds-sliding-panel-fade-direction: to right;
134
+ }
135
+ & > .xds\:sliding-panel-fade-lg {
136
+ @apply xds:sliding-panel-fade-position;
137
+ --xds-spacing-sliding-fade: var(--xds-spacing-160);
138
+ --xds-sliding-panel-fade-direction: to right;
139
+ }
140
+ }