draft-components 3.0.1 → 3.1.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.
@@ -2008,7 +2008,7 @@
2008
2008
  }
2009
2009
 
2010
2010
  .dc-select__native {
2011
- width: 100%;
2011
+ max-width: 100%;
2012
2012
  padding-right: calc(var(--dc-select-height) + 0.5em);
2013
2013
  padding-left: var(--dc-select-padding-x);
2014
2014
  font: inherit;
@@ -65,7 +65,7 @@
65
65
  }
66
66
 
67
67
  .dc-select__native {
68
- width: 100%;
68
+ max-width: 100%;
69
69
  padding-right: calc(var(--dc-select-height) + 0.5em);
70
70
  padding-left: var(--dc-select-padding-x);
71
71
  font: inherit;
@@ -10,5 +10,10 @@ export type SelectionControlProps = {
10
10
  label: ReactNode;
11
11
  children: JSX.Element | SelectionControlRenderFn;
12
12
  } & SelectionControlBaseProps;
13
- export declare function SelectionControl({ label, labelFor, caption, className, children, ...props }: SelectionControlProps): import("react/jsx-runtime").JSX.Element;
13
+ export declare const SelectionControl: import("react").ForwardRefExoticComponent<{
14
+ labelFor?: string | undefined;
15
+ caption?: ReactNode;
16
+ label: ReactNode;
17
+ children: JSX.Element | SelectionControlRenderFn;
18
+ } & SelectionControlBaseProps & import("react").RefAttributes<HTMLDivElement>>;
14
19
  export {};
@@ -1,12 +1,12 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { cloneElement, useId } from 'react';
2
+ import { cloneElement, forwardRef, useId } from 'react';
3
3
  import { classNames } from '../../lib/react-helpers.js';
4
4
  import { Label } from '../label/index.js';
5
5
  import { Caption } from '../caption/index.js';
6
- export function SelectionControl({ label, labelFor, caption, className, children, ...props }) {
6
+ export const SelectionControl = forwardRef(function SelectionControl({ label, labelFor, caption, className, children, ...props }, ref) {
7
7
  const defaultId = useId();
8
8
  const controlId = labelFor || defaultId;
9
- return (_jsxs("div", { ...props, className: classNames(className, {
9
+ return (_jsxs("div", { ...props, ref: ref, className: classNames(className, {
10
10
  'dc-selection-control': true,
11
11
  'dc-selection-control__with_caption': caption,
12
12
  }), children: [_jsx("div", { className: "dc-selection-control__input", children: typeof children === 'function'
@@ -14,4 +14,4 @@ export function SelectionControl({ label, labelFor, caption, className, children
14
14
  : cloneElement(children, { id: children.props.id || controlId }) }), _jsx(Label, { className: "dc-selection-control__label", htmlFor: controlId, children: label }), caption
15
15
  ? (_jsx(Caption, { className: "dc-selection-control__caption", children: caption }))
16
16
  : null] }));
17
- }
17
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "draft-components",
3
- "version": "3.0.1",
3
+ "version": "3.1.0",
4
4
  "description": "The React based UI components library.",
5
5
  "type": "module",
6
6
  "exports": {