draft-components 1.1.2 → 1.2.1
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.
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
const react = require('react');
|
|
4
5
|
const reactHelpers = require('../../lib/react-helpers.cjs');
|
|
5
6
|
|
|
6
|
-
function Tag({ isRounded = false, variant = 'tinted', fill = 'gray', size = 'md', className, children, ...props }) {
|
|
7
|
-
return (jsxRuntime.jsx("strong", { ...props, className: reactHelpers.classNames(className, 'dc-tag', {
|
|
7
|
+
const Tag = react.forwardRef(function Tag({ isRounded = false, variant = 'tinted', fill = 'gray', size = 'md', className, children, ...props }, ref) {
|
|
8
|
+
return (jsxRuntime.jsx("strong", { ...props, ref: ref, className: reactHelpers.classNames(className, 'dc-tag', {
|
|
8
9
|
[`dc-tag_${variant}`]: variant,
|
|
9
10
|
[`dc-tag_${fill}`]: fill,
|
|
10
11
|
[`dc-tag_${size}`]: size,
|
|
11
12
|
'dc-tag_rounded': isRounded,
|
|
12
13
|
}), children: children }));
|
|
13
|
-
}
|
|
14
|
+
});
|
|
14
15
|
|
|
15
16
|
exports.Tag = Tag;
|
package/css/draft-components.css
CHANGED
|
@@ -1713,7 +1713,10 @@
|
|
|
1713
1713
|
--dc-checkbox-focus-ring-color: var(--dc-focus-ring-color);
|
|
1714
1714
|
|
|
1715
1715
|
color-scheme: light;
|
|
1716
|
-
|
|
1716
|
+
position: relative;
|
|
1717
|
+
display: inline-block;
|
|
1718
|
+
width: var(--dc-checkbox-size);
|
|
1719
|
+
height: var(--dc-checkbox-size);
|
|
1717
1720
|
}
|
|
1718
1721
|
|
|
1719
1722
|
.dc-checkbox__input {
|
|
@@ -1725,15 +1728,15 @@
|
|
|
1725
1728
|
|
|
1726
1729
|
.dc-checkbox__check {
|
|
1727
1730
|
font-size: 16px;
|
|
1728
|
-
position:
|
|
1731
|
+
position: absolute;
|
|
1729
1732
|
display: inline-flex;
|
|
1730
1733
|
cursor: pointer;
|
|
1731
1734
|
flex: none;
|
|
1732
1735
|
align-items: center;
|
|
1733
1736
|
justify-content: center;
|
|
1734
1737
|
box-sizing: border-box;
|
|
1735
|
-
width:
|
|
1736
|
-
height:
|
|
1738
|
+
width: 100%;
|
|
1739
|
+
height: 100%;
|
|
1737
1740
|
transition: opacity 0.2s;
|
|
1738
1741
|
vertical-align: middle;
|
|
1739
1742
|
border: 1px solid var(--dc-checkbox-border-color);
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
2
3
|
import { classNames } from '../../lib/react-helpers.js';
|
|
3
4
|
|
|
4
|
-
function Tag({ isRounded = false, variant = 'tinted', fill = 'gray', size = 'md', className, children, ...props }) {
|
|
5
|
-
return (jsx("strong", { ...props, className: classNames(className, 'dc-tag', {
|
|
5
|
+
const Tag = forwardRef(function Tag({ isRounded = false, variant = 'tinted', fill = 'gray', size = 'md', className, children, ...props }, ref) {
|
|
6
|
+
return (jsx("strong", { ...props, ref: ref, className: classNames(className, 'dc-tag', {
|
|
6
7
|
[`dc-tag_${variant}`]: variant,
|
|
7
8
|
[`dc-tag_${fill}`]: fill,
|
|
8
9
|
[`dc-tag_${size}`]: size,
|
|
9
10
|
'dc-tag_rounded': isRounded,
|
|
10
11
|
}), children: children }));
|
|
11
|
-
}
|
|
12
|
+
});
|
|
12
13
|
|
|
13
14
|
export { Tag };
|
package/package.json
CHANGED
|
@@ -9,5 +9,10 @@ export type TagProps = {
|
|
|
9
9
|
fill?: TagFill;
|
|
10
10
|
size?: TagSize;
|
|
11
11
|
} & TagBaseProps;
|
|
12
|
-
export declare
|
|
12
|
+
export declare const Tag: import("react").ForwardRefExoticComponent<{
|
|
13
|
+
isRounded?: boolean | undefined;
|
|
14
|
+
variant?: TagVariant | undefined;
|
|
15
|
+
fill?: TagFill | undefined;
|
|
16
|
+
size?: TagSize | undefined;
|
|
17
|
+
} & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & import("react").RefAttributes<HTMLElement>>;
|
|
13
18
|
export {};
|