@tpzdsp/next-toolkit 1.12.1 → 1.12.3
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.
- package/package.json +1 -1
- package/src/assets/styles/globals.css +5 -1
- package/src/components/form/Input.tsx +1 -1
- package/src/components/select/Select.tsx +1 -2
- package/src/components/select/SelectSkeleton.test.tsx +1 -1
- package/src/components/select/SelectSkeleton.tsx +2 -2
- package/src/components/select/common.ts +2 -3
package/package.json
CHANGED
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
/* Component-specific styles */
|
|
46
46
|
@layer components {
|
|
47
47
|
.focus-yellow {
|
|
48
|
-
@apply focus:border-
|
|
48
|
+
@apply focus:border-focus focus:outline focus:outline-2 focus:outline-focus;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
.library-button {
|
|
@@ -83,6 +83,10 @@
|
|
|
83
83
|
top: calc(calc(var(--border) + var(--shadow)) * -1);
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
+
|
|
87
|
+
.input-height {
|
|
88
|
+
@apply h-[38px];
|
|
89
|
+
}
|
|
86
90
|
}
|
|
87
91
|
|
|
88
92
|
/* Utilities */
|
|
@@ -14,7 +14,7 @@ export const Input = ({ hasError, className, ...props }: InputProps) => {
|
|
|
14
14
|
<input
|
|
15
15
|
{...props}
|
|
16
16
|
className={cn(
|
|
17
|
-
'rounded-md border p-1 disabled:opacity-60 disabled:bg-gray-100',
|
|
17
|
+
'rounded-md border p-1 disabled:opacity-60 disabled:bg-gray-100 input-height focus-yellow',
|
|
18
18
|
hasError ? 'border-error' : '',
|
|
19
19
|
className,
|
|
20
20
|
)}
|
|
@@ -13,7 +13,7 @@ import type {
|
|
|
13
13
|
} from 'react-select';
|
|
14
14
|
import { components, default as ReactSelect } from 'react-select';
|
|
15
15
|
|
|
16
|
-
import { SELECT_CONTAINER_CLASSES, SELECT_CONTROL_CLASSES
|
|
16
|
+
import { SELECT_CONTAINER_CLASSES, SELECT_CONTROL_CLASSES } from './common';
|
|
17
17
|
import { cn } from '../../utils';
|
|
18
18
|
|
|
19
19
|
// extends the react-select props with some of our own
|
|
@@ -30,7 +30,6 @@ const getClassNames = <Option, IsMulti extends boolean, Group extends GroupBase<
|
|
|
30
30
|
control: (props) =>
|
|
31
31
|
cn(
|
|
32
32
|
SELECT_CONTROL_CLASSES,
|
|
33
|
-
SELECT_MIN_HEIGHT,
|
|
34
33
|
props.isDisabled ? '!cursor-not-allowed bg-gray-100' : 'bg-white',
|
|
35
34
|
props.isFocused
|
|
36
35
|
? 'shadow-[0px_0px_0px_theme(borderWidth.form)_theme(colors.focus)] border-focus'
|
|
@@ -70,7 +70,7 @@ describe('SelectSkeleton', () => {
|
|
|
70
70
|
expect(containerElement.tagName).toBe('DIV');
|
|
71
71
|
});
|
|
72
72
|
|
|
73
|
-
it('should apply SELECT_CONTROL_CLASSES
|
|
73
|
+
it('should apply SELECT_CONTROL_CLASSES to control element', () => {
|
|
74
74
|
const { container } = render(<SelectSkeleton />);
|
|
75
75
|
|
|
76
76
|
const controlElement = container.firstChild?.firstChild as HTMLElement;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SELECT_CONTAINER_CLASSES, SELECT_CONTROL_CLASSES
|
|
1
|
+
import { SELECT_CONTAINER_CLASSES, SELECT_CONTROL_CLASSES } from './common';
|
|
2
2
|
import type { ExtendProps } from '../../types';
|
|
3
3
|
import { cn } from '../../utils';
|
|
4
4
|
|
|
@@ -12,7 +12,7 @@ export type SelectSkeletonProps = ExtendProps<'div', Props>;
|
|
|
12
12
|
export const SelectSkeleton = ({ className, ...props }: SelectSkeletonProps = {}) => {
|
|
13
13
|
return (
|
|
14
14
|
<div className={cn(SELECT_CONTAINER_CLASSES, className)} {...props}>
|
|
15
|
-
<div className={cn(SELECT_CONTROL_CLASSES,
|
|
15
|
+
<div className={cn(SELECT_CONTROL_CLASSES, 'p-2')}>
|
|
16
16
|
<div
|
|
17
17
|
className="w-full h-full bg-gray-100 animate-pulse rounded-md col-span-2"
|
|
18
18
|
aria-label="Loading options"
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export const
|
|
2
|
-
export const SELECT_CONTAINER_CLASSES = 'w-full h-max select-none !pointer-events-auto';
|
|
1
|
+
export const SELECT_CONTAINER_CLASSES = 'w-full select-none !pointer-events-auto input-height';
|
|
3
2
|
export const SELECT_CONTROL_CLASSES =
|
|
4
|
-
'
|
|
3
|
+
'p-1 !grid gap-4 grid-cols-[1fr_min-content] w-full border rounded-md input-height';
|