draft-components 1.1.1 → 1.2.0

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/README.md CHANGED
@@ -7,12 +7,7 @@
7
7
 
8
8
  The React based UI components library.
9
9
 
10
- <a href="https://draft-components.netlify.app">
11
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
12
- <path d="M1.58051 1.53345L2.07511 14.7122C2.09077 15.1296 2.42396 15.4653 2.84126 15.484L13.5561 15.9652C13.5681 15.9658 13.5801 15.966 13.5921 15.966C14.0355 15.966 14.3948 15.6067 14.3948 15.1633V0.802758C14.3948 0.786055 14.3943 0.769356 14.3933 0.752685C14.3656 0.310212 13.9845 -0.026064 13.542 0.0015905L12.6607 0.056674L12.7251 1.89911C12.7274 1.9652 12.6757 2.02065 12.6096 2.02296C12.5813 2.02395 12.5535 2.01487 12.5313 1.99735L11.9376 1.5297L11.2348 2.06286C11.1821 2.10283 11.107 2.09251 11.067 2.03982C11.0502 2.01765 11.0416 1.9903 11.0428 1.96248L11.118 0.153093L2.33261 0.70218C1.89791 0.729349 1.56418 1.09821 1.58051 1.53345ZM11.4601 5.96107C11.1777 6.18045 9.07404 6.33013 9.07404 6.01782C9.1185 4.82611 8.58497 4.77387 8.28856 4.77387C8.00697 4.77387 7.53272 4.85899 7.53272 5.49741C7.53272 6.14798 8.22578 6.51526 9.03926 6.94635C10.1949 7.55874 11.5935 8.29992 11.5935 10.1649C11.5935 11.9525 10.1411 12.94 8.28856 12.94C6.37674 12.94 4.70602 12.1665 4.89471 9.48481C4.96881 9.1699 7.39935 9.24475 7.39935 9.48481C7.3697 10.5914 7.62164 10.9169 8.25892 10.9169C8.74799 10.9169 8.9703 10.6473 8.9703 10.1933C8.9703 9.50626 8.24818 9.10084 7.41747 8.63444C6.29269 8.00294 4.96881 7.25965 4.96881 5.55415C4.96881 3.85171 6.13962 2.71675 8.22928 2.71675C10.3189 2.71675 11.4601 3.83432 11.4601 5.96107Z" />
13
- </svg>
14
- <span>Storybook</span>
15
- </a>
10
+ [![storybook](https://shields.io/badge/-Storybook-ff4785?logo=storybook&logoColor=white&style=for-the-badge)](https://draft-components.netlify.app)
16
11
 
17
12
  ## Peer dependencies
18
13
 
@@ -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;
@@ -1501,7 +1501,7 @@
1501
1501
  font-family: var(--dc-primary-font);
1502
1502
  font-size: var(--dc-select-font-size);
1503
1503
  font-weight: 400;
1504
- line-height: 1;
1504
+ line-height: 1.25;
1505
1505
  color: var(--dc-select-text-color);
1506
1506
  position: relative;
1507
1507
  display: inline-flex;
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "draft-components",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "description": "The React based UI components library.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -50,7 +50,7 @@
50
50
  "bugs": {
51
51
  "url": "https://github.com/alexzimakov/draft-components/issues"
52
52
  },
53
- "homepage": "https://alexzimakov.github.io/draft-components",
53
+ "homepage": "https://draft-components.netlify.app",
54
54
  "peerDependencies": {
55
55
  "react": ">= 18",
56
56
  "react-dom": ">= 18"
@@ -9,5 +9,10 @@ export type TagProps = {
9
9
  fill?: TagFill;
10
10
  size?: TagSize;
11
11
  } & TagBaseProps;
12
- export declare function Tag({ isRounded, variant, fill, size, className, children, ...props }: TagProps): JSX.Element;
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 {};