@ultraviolet/ui 1.8.4 → 1.10.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/dist/index.d.ts CHANGED
@@ -14,7 +14,6 @@ import { ReactDatePickerProps } from 'react-datepicker';
14
14
  import { Serie, LineSvgProps } from '@nivo/line';
15
15
  import { ScaleSpec } from '@nivo/scales';
16
16
  import { PopoverStateReturn } from 'reakit/Popover';
17
- import { DialogProps, DialogStateReturn } from 'reakit/Dialog';
18
17
  import Select, { OptionProps, Props, CommonProps as CommonProps$1, GroupBase } from 'react-select';
19
18
  import { ToastOptions } from 'react-toastify';
20
19
 
@@ -1083,8 +1082,15 @@ declare const Carousel: {
1083
1082
 
1084
1083
  type CheckboxProps = {
1085
1084
  error?: string | ReactNode;
1085
+ /**
1086
+ * @deprecated Size prop is deprecated and will be removed in next major update.
1087
+ */
1086
1088
  size?: number;
1089
+ /**
1090
+ * @deprecated Progress prop is deprecated and will be removed in next major update.
1091
+ */
1087
1092
  progress?: boolean;
1093
+ helper?: ReactNode;
1088
1094
  disabled?: boolean;
1089
1095
  checked?: boolean | 'indeterminate';
1090
1096
  className?: string;
@@ -1394,86 +1400,47 @@ type PasswordStrengthMeterProps$1 = {
1394
1400
  };
1395
1401
  declare const Meter: ({ strength, title, value, className, "data-testid": dataTestId, id, }: PasswordStrengthMeterProps$1) => JSX.Element;
1396
1402
 
1397
- declare const MODAL_WIDTH: {
1398
- large: number;
1399
- medium: number;
1400
- small: number;
1401
- xsmall: number;
1402
- xxsmall: number;
1403
- };
1404
- type ModalWidth = keyof typeof MODAL_WIDTH;
1405
- declare const MODAL_PLACEMENT: {
1406
- bottom: string;
1407
- 'bottom-left': string;
1408
- 'bottom-right': string;
1409
- center: string;
1410
- left: string;
1411
- right: string;
1412
- top: string;
1413
- 'top-left': string;
1414
- 'top-right': string;
1415
- };
1416
- type ModalPlacement = keyof typeof MODAL_PLACEMENT;
1417
- declare const MODAL_ANIMATION: {
1418
- fold: {
1419
- enter: _emotion_react.Keyframes;
1420
- leave: _emotion_react.Keyframes;
1421
- };
1422
- scaleBack: {
1423
- enter: _emotion_react.Keyframes;
1424
- leave: _emotion_react.Keyframes;
1425
- };
1426
- scaleUp: {
1427
- enter: _emotion_react.Keyframes;
1428
- leave: _emotion_react.Keyframes;
1429
- };
1430
- sketch: {
1431
- enter: _emotion_react.Keyframes;
1432
- leave: _emotion_react.Keyframes;
1433
- };
1434
- slideBottom: {
1435
- enter: _emotion_react.Keyframes;
1436
- leave: _emotion_react.Keyframes;
1437
- };
1438
- slideLeft: {
1439
- enter: _emotion_react.Keyframes;
1440
- leave: _emotion_react.Keyframes;
1441
- };
1442
- slideRight: {
1443
- enter: _emotion_react.Keyframes;
1444
- leave: _emotion_react.Keyframes;
1445
- };
1446
- slideTop: {
1447
- enter: _emotion_react.Keyframes;
1448
- leave: _emotion_react.Keyframes;
1449
- };
1450
- zoom: {
1451
- enter: _emotion_react.Keyframes;
1452
- leave: _emotion_react.Keyframes;
1453
- };
1403
+ type ModalSize = 'large' | 'medium' | 'small' | 'xsmall' | 'xxsmall';
1404
+ type ModalPlacement = 'bottom' | 'bottom-left' | 'bottom-right' | 'center' | 'top' | 'top-left' | 'top-right' | 'right' | 'left';
1405
+ type ModalState = {
1406
+ onOpen: () => void;
1407
+ onClose: () => void;
1408
+ toggle: () => void;
1409
+ visible: boolean;
1410
+ modalId: string;
1454
1411
  };
1455
- type ModalAnimation = keyof typeof MODAL_ANIMATION;
1456
- type DisclosureParam = ((dialog?: Partial<DialogStateReturn>) => ReactElement<ButtonHTMLAttributes<HTMLButtonElement>>) | ReactElement<ButtonHTMLAttributes<HTMLButtonElement>>;
1457
- type ModalProps = Partial<Pick<DialogProps, 'animated' | 'id' | 'hideOnEsc' | 'hideOnClickOutside' | 'preventBodyScroll'>> & {
1458
- animation?: ModalAnimation;
1412
+
1413
+ type ModalProps = {
1414
+ id?: string;
1415
+ hideOnEsc?: boolean;
1416
+ hideOnClickOutside?: boolean;
1417
+ preventBodyScroll?: boolean;
1459
1418
  ariaLabel?: string;
1460
- bordered?: boolean;
1461
- customDialogBackdropStyles?: JSX.IntrinsicAttributes['css'];
1462
- customDialogStyles?: JSX.IntrinsicAttributes['css'];
1463
- disclosure?: DisclosureParam;
1464
- height?: string;
1419
+ disclosure?: ReactNode | ((state: ModalState) => ReactNode);
1465
1420
  isClosable?: boolean;
1466
- modal?: boolean;
1467
1421
  onClose?: () => void;
1468
1422
  onBeforeClose?: () => Promise<void> | void;
1469
1423
  opened?: boolean;
1470
1424
  placement?: ModalPlacement;
1471
- width?: ModalWidth;
1472
- children: ReactNode | ((args: DialogStateReturn) => ReactNode);
1425
+ size?: ModalSize;
1426
+ /**
1427
+ * @deprecated You should use size prop instead
1428
+ */
1429
+ width?: ModalSize;
1430
+ children: ReactNode | ((args: ModalState) => ReactNode);
1473
1431
  className?: string;
1474
1432
  'data-testid'?: string;
1433
+ backdropClassName?: string;
1434
+ /**
1435
+ * @deprecated You should use backdropClassName instead
1436
+ */
1437
+ customDialogBackdropStyles?: react__default.JSX.IntrinsicAttributes['css'];
1438
+ /**
1439
+ * @deprecated You should use className instead
1440
+ */
1441
+ customDialogStyles?: react__default.JSX.IntrinsicAttributes['css'];
1475
1442
  };
1476
- declare const Modal: react.MemoExoticComponent<({ animated, animation, ariaLabel, id, bordered, children, customDialogBackdropStyles, customDialogStyles, disclosure, height, hideOnClickOutside, hideOnEsc, isClosable, modal, onClose, onBeforeClose, opened, placement, preventBodyScroll, width, className, "data-testid": dataTestId, }: ModalProps) => _emotion_react_jsx_runtime.JSX.Element>;
1443
+ declare const Modal: ({ ariaLabel, id, children, disclosure, hideOnClickOutside, hideOnEsc, isClosable, onClose, onBeforeClose, opened, placement, preventBodyScroll, size, className, "data-testid": dataTestId, backdropClassName, width, customDialogStyles, customDialogBackdropStyles, }: ModalProps) => _emotion_react_jsx_runtime.JSX.Element;
1477
1444
 
1478
1445
  type NoticeProps = {
1479
1446
  children: ReactNode;
@@ -1692,7 +1659,7 @@ type ProgressBarProps = {
1692
1659
  declare const ProgressBar: ({ progress, value, sentiment, className, "data-testid": dataTestId, }: ProgressBarProps) => _emotion_react_jsx_runtime.JSX.Element;
1693
1660
 
1694
1661
  type RadioProps = {
1695
- error?: string | ReactNode;
1662
+ error?: ReactNode;
1696
1663
  checked?: boolean;
1697
1664
  value: string | number;
1698
1665
  helper?: ReactNode;
@@ -2322,6 +2289,7 @@ type ToggleProps = {
2322
2289
  size?: 'large' | 'small';
2323
2290
  labelPosition?: 'left' | 'right';
2324
2291
  label?: ReactNode;
2292
+ helper?: ReactNode;
2325
2293
  disabled?: boolean;
2326
2294
  className?: string;
2327
2295
  required?: boolean;
@@ -2362,6 +2330,21 @@ type VerificationCodeProps = {
2362
2330
  };
2363
2331
  declare const VerificationCode: ({ disabled, className, error, fields, initialValue, inputId, inputStyle, onChange, onComplete, placeholder, required, type, "data-testid": dataTestId, "aria-label": ariaLabel, }: VerificationCodeProps) => JSX.Element;
2364
2332
 
2333
+ type RadioGroupRadioProps = Omit<ComponentProps<typeof Radio>, 'onChange' | 'checked' | 'required'>;
2334
+ type RadioGroupProps = {
2335
+ legend: string;
2336
+ value: string | number;
2337
+ className?: string;
2338
+ helper?: ReactNode;
2339
+ error?: ReactNode;
2340
+ direction?: 'row' | 'column';
2341
+ children: ReactNode;
2342
+ } & Required<Pick<InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'name'>> & Pick<InputHTMLAttributes<HTMLInputElement>, 'required'>;
2343
+ declare const RadioGroup: {
2344
+ ({ legend, value, className, helper, error, direction, children, onChange, name, required, }: RadioGroupProps): _emotion_react_jsx_runtime.JSX.Element;
2345
+ Radio: ({ onFocus, onBlur, disabled, error, name, value, label, helper, className, autoFocus, onKeyDown, "data-testid": dataTestId, }: RadioGroupRadioProps) => _emotion_react_jsx_runtime.JSX.Element;
2346
+ };
2347
+
2365
2348
  declare const getUUID: (prefix?: string) => string;
2366
2349
 
2367
2350
  declare const bounce: _emotion_react.Keyframes;
@@ -2405,4 +2388,4 @@ declare const down: (size: ScreenSize, rules: string) => string;
2405
2388
 
2406
2389
  declare const normalize: () => string;
2407
2390
 
2408
- export { ActionBar, Alert, Avatar, Badge, Banner, BarChart, BarStack, Breadcrumbs, Breakpoint, Bullet, Button, Card, Carousel, Checkbox, CopyButton, DateInput, EmptyState, Expandable, LineChart, Link, List, Loader, Menu, Meter, Modal, Notice, NumberInput, Pagination, PasswordCheck, PasswordStrengthMeter, PieChart, Popover, ProgressBar, Radio, Row, SCWUITheme, SelectInput, SelectableCard, Separator, Skeleton, Snippet, Stack, Status, StepList, Stepper, SwitchButton, Table, Tabs, Tag, TagInput, TagList, Text, TextInput, TimeInput, ToastContainer, Toggle, Tooltip, VerificationCode, bounce, down, extendTheme, fadeIn, fadeOut, flash, getUUID, normalize, ping, pulse, quickScaleDown, scaleBack, scaleDown, scaleForward, scaleUp, sketchIn, sketchOut, slideDownLarge, slideFromBottom, slideFromLeft, slideFromRight, slideFromTop, slideToBottom, slideToLeft, slideToRight, slideToTop, slideUpLarge, toast, unfoldIn, unfoldOut, up, zoomIn, zoomOut };
2391
+ export { ActionBar, Alert, Avatar, Badge, Banner, BarChart, BarStack, Breadcrumbs, Breakpoint, Bullet, Button, Card, Carousel, Checkbox, CopyButton, DateInput, EmptyState, Expandable, LineChart, Link, List, Loader, Menu, Meter, Modal, Notice, NumberInput, Pagination, PasswordCheck, PasswordStrengthMeter, PieChart, Popover, ProgressBar, Radio, RadioGroup, Row, SCWUITheme, SelectInput, SelectableCard, Separator, Skeleton, Snippet, Stack, Status, StepList, Stepper, SwitchButton, Table, Tabs, Tag, TagInput, TagList, Text, TextInput, TimeInput, ToastContainer, Toggle, Tooltip, VerificationCode, bounce, down, extendTheme, fadeIn, fadeOut, flash, getUUID, normalize, ping, pulse, quickScaleDown, scaleBack, scaleDown, scaleForward, scaleUp, sketchIn, sketchOut, slideDownLarge, slideFromBottom, slideFromLeft, slideFromRight, slideFromTop, slideToBottom, slideToLeft, slideToRight, slideToTop, slideUpLarge, toast, unfoldIn, unfoldOut, up, zoomIn, zoomOut };