mblabs-roccato-frontend-commons 0.0.44 → 0.0.45
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.
|
@@ -13889,7 +13889,7 @@ function jxe({
|
|
|
13889
13889
|
u ? iU[t] : rU[t],
|
|
13890
13890
|
t === "outline" && nU[e],
|
|
13891
13891
|
u ? "border-[#079455]" : "border-gray-400",
|
|
13892
|
-
o && "cursor-default"
|
|
13892
|
+
o && !u && "cursor-default opacity-50"
|
|
13893
13893
|
),
|
|
13894
13894
|
children: [
|
|
13895
13895
|
/* @__PURE__ */ v.jsx(po, { condition: t === "outline", children: /* @__PURE__ */ v.jsx(nc, { className: X(MT[e], u ? OT[t] : kT[t], "stroke-4") }) }),
|
package/package.json
CHANGED
|
@@ -89,7 +89,6 @@ describe('<CheckIcon />', () => {
|
|
|
89
89
|
|
|
90
90
|
const checkIcon = screen.getByTestId('check-icon');
|
|
91
91
|
|
|
92
|
-
// Click to check
|
|
93
92
|
fireEvent.click(checkIcon);
|
|
94
93
|
|
|
95
94
|
expect(checkIcon).toHaveClass('bg-white', 'border-3', 'border-[#079455]');
|
|
@@ -123,7 +122,6 @@ describe('<CheckIcon />', () => {
|
|
|
123
122
|
|
|
124
123
|
const checkIcon = screen.getByTestId('check-icon');
|
|
125
124
|
|
|
126
|
-
// Click to check
|
|
127
125
|
fireEvent.click(checkIcon);
|
|
128
126
|
|
|
129
127
|
expect(checkIcon).toHaveClass('bg-[#079455]', 'border-[#079455]');
|
|
@@ -150,11 +148,9 @@ describe('<CheckIcon />', () => {
|
|
|
150
148
|
|
|
151
149
|
const checkIcon = screen.getByTestId('check-icon');
|
|
152
150
|
|
|
153
|
-
// Initial state - unchecked
|
|
154
151
|
expect(checkIcon).toHaveClass('border-gray-400');
|
|
155
152
|
expect(checkIcon.querySelector('svg')).toHaveClass('text-gray-400');
|
|
156
153
|
|
|
157
|
-
// Click to check
|
|
158
154
|
fireEvent.click(checkIcon);
|
|
159
155
|
|
|
160
156
|
// Should be checked
|
|
@@ -167,11 +163,9 @@ describe('<CheckIcon />', () => {
|
|
|
167
163
|
|
|
168
164
|
const checkIcon = screen.getByTestId('check-icon');
|
|
169
165
|
|
|
170
|
-
// Click to check
|
|
171
166
|
fireEvent.click(checkIcon);
|
|
172
167
|
expect(checkIcon).toHaveClass('border-[#079455]');
|
|
173
168
|
|
|
174
|
-
// Click again to uncheck
|
|
175
169
|
fireEvent.click(checkIcon);
|
|
176
170
|
expect(checkIcon).toHaveClass('border-gray-400');
|
|
177
171
|
expect(checkIcon.querySelector('svg')).toHaveClass('text-gray-400');
|
|
@@ -182,18 +176,14 @@ describe('<CheckIcon />', () => {
|
|
|
182
176
|
|
|
183
177
|
const checkIcon = screen.getByTestId('check-icon');
|
|
184
178
|
|
|
185
|
-
// Initial - unchecked
|
|
186
179
|
expect(checkIcon).toHaveClass('bg-gray-400');
|
|
187
180
|
|
|
188
|
-
// First click - checked
|
|
189
181
|
fireEvent.click(checkIcon);
|
|
190
182
|
expect(checkIcon).toHaveClass('bg-[#079455]');
|
|
191
183
|
|
|
192
|
-
// Second click - unchecked
|
|
193
184
|
fireEvent.click(checkIcon);
|
|
194
185
|
expect(checkIcon).toHaveClass('bg-gray-400');
|
|
195
186
|
|
|
196
|
-
// Third click - checked again
|
|
197
187
|
fireEvent.click(checkIcon);
|
|
198
188
|
expect(checkIcon).toHaveClass('bg-[#079455]');
|
|
199
189
|
});
|
|
@@ -263,16 +253,11 @@ describe('<CheckIcon />', () => {
|
|
|
263
253
|
|
|
264
254
|
const checkIcon = screen.getByTestId('check-icon');
|
|
265
255
|
|
|
266
|
-
// Initial state
|
|
267
256
|
expect(checkIcon).toHaveClass('border-gray-400');
|
|
268
257
|
|
|
269
|
-
// Simulate pressing Enter
|
|
270
258
|
fireEvent.keyDown(checkIcon, { key: 'Enter', code: 'Enter' });
|
|
271
259
|
|
|
272
|
-
|
|
273
|
-
// This test documents the current behavior. You might want to add
|
|
274
|
-
// keyboard support in the future.
|
|
275
|
-
expect(checkIcon).toHaveClass('border-gray-400'); // Still unchecked
|
|
260
|
+
expect(checkIcon).toHaveClass('border-gray-400');
|
|
276
261
|
});
|
|
277
262
|
|
|
278
263
|
it('has button role implicitly', () => {
|
|
@@ -123,7 +123,7 @@ function CheckIcon ({
|
|
|
123
123
|
isChecked ? CHECKED_BG[variant] : DEFAULT_BG[variant],
|
|
124
124
|
variant === 'outline' && BORDER_SIZE[size],
|
|
125
125
|
isChecked ? 'border-[#079455]' : 'border-gray-400',
|
|
126
|
-
disabled && 'cursor-default'
|
|
126
|
+
disabled && !isChecked && 'cursor-default opacity-50'
|
|
127
127
|
)
|
|
128
128
|
}
|
|
129
129
|
>
|