@crystallize/design-system 1.16.5 → 1.16.6
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/CHANGELOG.md +6 -0
- package/dist/index.css +43 -42
- package/dist/index.d.ts +1 -1
- package/dist/index.js +324 -322
- package/dist/index.mjs +324 -322
- package/package.json +1 -1
- package/src/input-with-label/input-with-label.tsx +4 -3
- package/src/tooltip/tooltip.css +1 -1
- package/src/tooltip/tooltip.tsx +2 -2
package/package.json
CHANGED
|
@@ -4,6 +4,7 @@ import { cva, cx, VariantProps } from 'class-variance-authority';
|
|
|
4
4
|
import { Triangle } from '../iconography/triangle';
|
|
5
5
|
import { Input } from '../input';
|
|
6
6
|
import { Label } from '../label';
|
|
7
|
+
import { Tooltip } from '../tooltip';
|
|
7
8
|
|
|
8
9
|
const inputWithLabelStyles = cva(['c-input-with-label'], {
|
|
9
10
|
variants: {
|
|
@@ -45,9 +46,9 @@ export const InputWithLabel = forwardRef<InputWithLabelRef, InputWithLabelProps>
|
|
|
45
46
|
<span className="c-input-with-label-input-wrap">
|
|
46
47
|
<Input className={cx('c-input-with-label-input', className)} ref={ref} id={id} {...delegated} />
|
|
47
48
|
{!append && !errorMessage ? null : (
|
|
48
|
-
<
|
|
49
|
-
{errorMessage ? <Triangle /> : append}
|
|
50
|
-
</
|
|
49
|
+
<Tooltip content={errorMessage}>
|
|
50
|
+
<div className="c-input-with-label-append">{errorMessage ? <Triangle /> : append}</div>
|
|
51
|
+
</Tooltip>
|
|
51
52
|
)}
|
|
52
53
|
</span>
|
|
53
54
|
</Label>
|
package/src/tooltip/tooltip.css
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
.c-tooltip-content {
|
|
2
|
-
@apply select-none rounded-md bg-white px-4 py-2 text-xs font-medium italic leading-none text-gray-500-400 shadow-tooltip transition;
|
|
2
|
+
@apply z-[100] select-none rounded-md bg-white px-4 py-2 text-xs font-medium italic leading-none text-gray-500-400 shadow-tooltip transition;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
.c-tooltip-arrow {
|
package/src/tooltip/tooltip.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import * as RadixTooltip from '@radix-ui/react-tooltip';
|
|
3
3
|
|
|
4
|
-
type TooltipProps = Pick<RadixTooltip.TooltipContentProps, 'side'
|
|
4
|
+
type TooltipProps = Partial<Pick<RadixTooltip.TooltipContentProps, 'side'>> & {
|
|
5
5
|
children: ReactNode;
|
|
6
6
|
content: ReactNode;
|
|
7
7
|
delayDuration?: number;
|
|
@@ -12,7 +12,7 @@ type TooltipProps = Pick<RadixTooltip.TooltipContentProps, 'side'> & {
|
|
|
12
12
|
export function Tooltip({
|
|
13
13
|
children,
|
|
14
14
|
content,
|
|
15
|
-
side,
|
|
15
|
+
side = 'top',
|
|
16
16
|
align = 'center',
|
|
17
17
|
defaultOpen = false,
|
|
18
18
|
delayDuration = 800,
|