@digdir/designsystemet-react 1.0.0-rc.2 → 1.0.0-rc.4
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/cjs/components/Accordion/Accordion.js +1 -3
- package/dist/cjs/components/Alert/Alert.js +1 -3
- package/dist/cjs/components/Box/Box.js +1 -4
- package/dist/cjs/components/Button/Button.js +1 -5
- package/dist/cjs/components/Card/Card.js +1 -3
- package/dist/cjs/components/Chip/Group/Group.js +1 -3
- package/dist/cjs/components/Chip/Removable/Removable.js +1 -3
- package/dist/cjs/components/Chip/Toggle/Toggle.js +1 -3
- package/dist/cjs/components/DropdownMenu/DropdownMenu.js +1 -3
- package/dist/cjs/components/DropdownMenu/DropdownMenuContent.js +1 -1
- package/dist/cjs/components/HelpText/HelpText.js +1 -3
- package/dist/cjs/components/Link/Link.js +2 -2
- package/dist/cjs/components/List/ListRoot.js +1 -3
- package/dist/cjs/components/Pagination/Pagination.js +1 -3
- package/dist/cjs/components/Pagination/PaginationRoot.js +1 -3
- package/dist/cjs/components/Popover/Popover.js +1 -3
- package/dist/cjs/components/Popover/PopoverContent.js +1 -1
- package/dist/cjs/components/Spinner/Spinner.js +2 -6
- package/dist/cjs/components/Table/Table.js +1 -3
- package/dist/cjs/components/Tabs/Tabs.js +1 -3
- package/dist/cjs/components/Tag/Tag.js +1 -5
- package/dist/cjs/components/ToggleGroup/ToggleGroup.js +1 -3
- package/dist/cjs/components/Tooltip/Tooltip.js +3 -3
- package/dist/cjs/components/Typography/ErrorMessage/ErrorMessage.js +1 -3
- package/dist/cjs/components/Typography/Heading/Heading.js +1 -3
- package/dist/cjs/components/Typography/Ingress/Ingress.js +1 -3
- package/dist/cjs/components/Typography/Label/Label.js +1 -3
- package/dist/cjs/components/Typography/Paragraph/Paragraph.js +1 -3
- package/dist/cjs/components/form/Checkbox/Checkbox.js +1 -1
- package/dist/cjs/components/form/Combobox/Combobox.js +1 -3
- package/dist/cjs/components/form/Combobox/useFloatingCombobox.js +1 -1
- package/dist/cjs/components/form/Fieldset/Fieldset.js +1 -1
- package/dist/cjs/components/form/NativeSelect/NativeSelect.js +1 -1
- package/dist/cjs/components/form/NativeSelect/useNativeSelect.js +1 -3
- package/dist/cjs/components/form/Radio/Radio.js +1 -1
- package/dist/cjs/components/form/Search/useSearch.js +1 -3
- package/dist/cjs/components/form/Switch/Switch.js +1 -1
- package/dist/cjs/components/form/Textarea/Textarea.js +1 -1
- package/dist/cjs/components/form/Textarea/useTextarea.js +1 -3
- package/dist/cjs/components/form/Textfield/Textfield.js +1 -1
- package/dist/cjs/components/form/Textfield/useTextfield.js +1 -3
- package/dist/cjs/components/form/useFormField.js +4 -3
- package/dist/cjs/node_modules/@floating-ui/react/dist/floating-ui.react.js +1 -1
- package/dist/cjs/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +1 -1
- package/dist/cjs/node_modules/@floating-ui/{dom → react-dom/node_modules/@floating-ui/dom}/dist/floating-ui.dom.js +3 -3
- package/dist/esm/components/Accordion/Accordion.js +1 -3
- package/dist/esm/components/Alert/Alert.js +1 -3
- package/dist/esm/components/Box/Box.js +1 -4
- package/dist/esm/components/Button/Button.js +1 -5
- package/dist/esm/components/Card/Card.js +1 -3
- package/dist/esm/components/Chip/Group/Group.js +1 -3
- package/dist/esm/components/Chip/Removable/Removable.js +1 -3
- package/dist/esm/components/Chip/Toggle/Toggle.js +1 -3
- package/dist/esm/components/DropdownMenu/DropdownMenu.js +1 -3
- package/dist/esm/components/DropdownMenu/DropdownMenuContent.js +1 -1
- package/dist/esm/components/HelpText/HelpText.js +1 -3
- package/dist/esm/components/Link/Link.js +2 -2
- package/dist/esm/components/List/ListRoot.js +1 -3
- package/dist/esm/components/Pagination/Pagination.js +1 -3
- package/dist/esm/components/Pagination/PaginationRoot.js +1 -3
- package/dist/esm/components/Popover/Popover.js +1 -3
- package/dist/esm/components/Popover/PopoverContent.js +1 -1
- package/dist/esm/components/Spinner/Spinner.js +2 -6
- package/dist/esm/components/Table/Table.js +1 -3
- package/dist/esm/components/Tabs/Tabs.js +1 -3
- package/dist/esm/components/Tag/Tag.js +1 -5
- package/dist/esm/components/ToggleGroup/ToggleGroup.js +1 -3
- package/dist/esm/components/Tooltip/Tooltip.js +3 -3
- package/dist/esm/components/Typography/ErrorMessage/ErrorMessage.js +1 -3
- package/dist/esm/components/Typography/Heading/Heading.js +1 -3
- package/dist/esm/components/Typography/Ingress/Ingress.js +1 -3
- package/dist/esm/components/Typography/Label/Label.js +1 -3
- package/dist/esm/components/Typography/Paragraph/Paragraph.js +1 -3
- package/dist/esm/components/form/Checkbox/Checkbox.js +1 -1
- package/dist/esm/components/form/Combobox/Combobox.js +1 -3
- package/dist/esm/components/form/Combobox/useFloatingCombobox.js +1 -1
- package/dist/esm/components/form/Fieldset/Fieldset.js +1 -1
- package/dist/esm/components/form/NativeSelect/NativeSelect.js +1 -1
- package/dist/esm/components/form/NativeSelect/useNativeSelect.js +1 -3
- package/dist/esm/components/form/Radio/Radio.js +1 -1
- package/dist/esm/components/form/Search/useSearch.js +1 -3
- package/dist/esm/components/form/Switch/Switch.js +1 -1
- package/dist/esm/components/form/Textarea/Textarea.js +1 -1
- package/dist/esm/components/form/Textarea/useTextarea.js +1 -3
- package/dist/esm/components/form/Textfield/Textfield.js +1 -1
- package/dist/esm/components/form/Textfield/useTextfield.js +1 -3
- package/dist/esm/components/form/useFormField.js +4 -3
- package/dist/esm/node_modules/@floating-ui/react/dist/floating-ui.react.js +2 -2
- package/dist/esm/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +2 -2
- package/dist/esm/node_modules/@floating-ui/{dom → react-dom/node_modules/@floating-ui/dom}/dist/floating-ui.dom.js +4 -4
- package/dist/types/components/Accordion/Accordion.d.ts +8 -6
- package/dist/types/components/Accordion/Accordion.d.ts.map +1 -1
- package/dist/types/components/Alert/Alert.d.ts +2 -7
- package/dist/types/components/Alert/Alert.d.ts.map +1 -1
- package/dist/types/components/Box/Box.d.ts +4 -7
- package/dist/types/components/Box/Box.d.ts.map +1 -1
- package/dist/types/components/Button/Button.d.ts +4 -11
- package/dist/types/components/Button/Button.d.ts.map +1 -1
- package/dist/types/components/Card/Card.d.ts +2 -12
- package/dist/types/components/Card/Card.d.ts.map +1 -1
- package/dist/types/components/Chip/Group/Group.d.ts +1 -5
- package/dist/types/components/Chip/Group/Group.d.ts.map +1 -1
- package/dist/types/components/Chip/Removable/Removable.d.ts +0 -2
- package/dist/types/components/Chip/Removable/Removable.d.ts.map +1 -1
- package/dist/types/components/Chip/Toggle/Toggle.d.ts +0 -2
- package/dist/types/components/Chip/Toggle/Toggle.d.ts.map +1 -1
- package/dist/types/components/DropdownMenu/DropdownMenu.d.ts +2 -4
- package/dist/types/components/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/types/components/DropdownMenu/DropdownMenuTrigger.d.ts +2 -2
- package/dist/types/components/HelpText/HelpText.d.ts +1 -2
- package/dist/types/components/HelpText/HelpText.d.ts.map +1 -1
- package/dist/types/components/Link/Link.d.ts +0 -10
- package/dist/types/components/Link/Link.d.ts.map +1 -1
- package/dist/types/components/List/ListHeading.d.ts +1 -1
- package/dist/types/components/List/ListRoot.d.ts +2 -5
- package/dist/types/components/List/ListRoot.d.ts.map +1 -1
- package/dist/types/components/Modal/ModalTrigger.d.ts +2 -2
- package/dist/types/components/Pagination/Pagination.d.ts +2 -6
- package/dist/types/components/Pagination/Pagination.d.ts.map +1 -1
- package/dist/types/components/Pagination/PaginationRoot.d.ts +0 -2
- package/dist/types/components/Pagination/PaginationRoot.d.ts.map +1 -1
- package/dist/types/components/Popover/Popover.d.ts +2 -5
- package/dist/types/components/Popover/Popover.d.ts.map +1 -1
- package/dist/types/components/Popover/PopoverTrigger.d.ts +2 -2
- package/dist/types/components/Spinner/Spinner.d.ts +4 -8
- package/dist/types/components/Spinner/Spinner.d.ts.map +1 -1
- package/dist/types/components/Table/Table.d.ts +2 -6
- package/dist/types/components/Table/Table.d.ts.map +1 -1
- package/dist/types/components/Tabs/Tabs.d.ts +2 -6
- package/dist/types/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/types/components/Tag/Tag.d.ts +3 -6
- package/dist/types/components/Tag/Tag.d.ts.map +1 -1
- package/dist/types/components/ToggleGroup/ToggleGroup.d.ts +0 -2
- package/dist/types/components/ToggleGroup/ToggleGroup.d.ts.map +1 -1
- package/dist/types/components/Tooltip/Tooltip.d.ts +3 -24
- package/dist/types/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/types/components/Typography/ErrorMessage/ErrorMessage.d.ts +2 -6
- package/dist/types/components/Typography/ErrorMessage/ErrorMessage.d.ts.map +1 -1
- package/dist/types/components/Typography/Heading/Heading.d.ts +2 -6
- package/dist/types/components/Typography/Heading/Heading.d.ts.map +1 -1
- package/dist/types/components/Typography/Ingress/Ingress.d.ts +2 -6
- package/dist/types/components/Typography/Ingress/Ingress.d.ts.map +1 -1
- package/dist/types/components/Typography/Label/Label.d.ts +2 -5
- package/dist/types/components/Typography/Label/Label.d.ts.map +1 -1
- package/dist/types/components/Typography/Paragraph/Paragraph.d.ts +2 -6
- package/dist/types/components/Typography/Paragraph/Paragraph.d.ts.map +1 -1
- package/dist/types/components/form/Combobox/Combobox.d.ts +2 -2
- package/dist/types/components/form/Combobox/Combobox.d.ts.map +1 -1
- package/dist/types/components/form/Fieldset/useFieldset.d.ts +1 -1
- package/dist/types/components/form/NativeSelect/NativeSelect.d.ts +2 -6
- package/dist/types/components/form/NativeSelect/NativeSelect.d.ts.map +1 -1
- package/dist/types/components/form/NativeSelect/useNativeSelect.d.ts.map +1 -1
- package/dist/types/components/form/Search/Search.d.ts +2 -6
- package/dist/types/components/form/Search/Search.d.ts.map +1 -1
- package/dist/types/components/form/Search/useSearch.d.ts.map +1 -1
- package/dist/types/components/form/Switch/Switch.d.ts.map +1 -1
- package/dist/types/components/form/Textarea/Textarea.d.ts +1 -1
- package/dist/types/components/form/Textarea/useTextarea.d.ts.map +1 -1
- package/dist/types/components/form/Textfield/Textfield.d.ts +2 -6
- package/dist/types/components/form/Textfield/Textfield.d.ts.map +1 -1
- package/dist/types/components/form/Textfield/useTextfield.d.ts.map +1 -1
- package/dist/types/components/form/useFormField.d.ts +1 -4
- package/dist/types/components/form/useFormField.d.ts.map +1 -1
- package/dist/types/utilities/index.d.ts +0 -2
- package/dist/types/utilities/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/cjs/utilities/getColor.js +0 -27
- package/dist/cjs/utilities/getSize.js +0 -33
- package/dist/esm/utilities/getColor.js +0 -25
- package/dist/esm/utilities/getSize.js +0 -31
- package/dist/types/utilities/getColor.d.ts +0 -2
- package/dist/types/utilities/getColor.d.ts.map +0 -1
- package/dist/types/utilities/getSize.d.ts +0 -2
- package/dist/types/utilities/getSize.d.ts.map +0 -1
|
@@ -3,12 +3,10 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
4
|
import { clsx } from '../../../node_modules/clsx/dist/lite.js';
|
|
5
5
|
import { Slot as $5e63c961fc1ce211$export$8c6ed5c666ac1360 } from '../../../node_modules/@radix-ui/react-slot/dist/index.js';
|
|
6
|
-
import { getSize } from '../../../utilities/getSize.js';
|
|
7
6
|
|
|
8
7
|
/** Use `Paragraph` to display text with paragraph text styles. */
|
|
9
|
-
const Paragraph = forwardRef(({ className, spacing, asChild, variant, ...rest }, ref) => {
|
|
8
|
+
const Paragraph = forwardRef(({ className, spacing, size = 'md', asChild, variant, ...rest }, ref) => {
|
|
10
9
|
const Component = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360 : 'p';
|
|
11
|
-
const size = getSize(rest.size || 'md');
|
|
12
10
|
return (jsx(Component, { ref: ref, className: clsx('fds-paragraph', `fds-paragraph--${size}`, spacing && 'fds-paragraph--spacing', variant && `fds-paragraph--${variant}`, className), ...rest }));
|
|
13
11
|
});
|
|
14
12
|
Paragraph.displayName = 'Paragraph';
|
|
@@ -19,7 +19,7 @@ const Checkbox = forwardRef((props, ref) => {
|
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
]);
|
|
22
|
-
return (jsx(Paragraph, { asChild: true, size: size, children: jsxs("div", { className: clsx('fds-checkbox', `fds-checkbox--${size}`,
|
|
22
|
+
return (jsx(Paragraph, { asChild: true, size: size, children: jsxs("div", { className: clsx('fds-checkbox', `fds-checkbox--${size}`, hasError && `fds-checkbox--error`, readOnly && `fds-checkbox--readonly`, className), style: style, children: [jsx("input", { className: `fds-checkbox__input`, ref: inputRef, ...omit(['size', 'error', 'indeterminate'], rest), ...inputProps, type: 'checkbox', disabled: inputProps.disabled, "aria-checked": rest.indeterminate ? 'mixed' : inputProps.checked }), children && (jsxs(Fragment, { children: [jsx(Label, { className: `fds-checkbox__label`, htmlFor: inputProps.id, size: size, weight: 'regular', children: jsx("span", { children: children }) }), description && (jsx(Paragraph, { asChild: true, size: size, children: jsx("div", { id: descriptionId, className: `fds-checkbox__description`, children: description }) }))] }))] }) }));
|
|
23
23
|
});
|
|
24
24
|
Checkbox.displayName = 'Checkbox';
|
|
25
25
|
|
|
@@ -6,7 +6,6 @@ import { clsx } from '../../../node_modules/clsx/dist/lite.js';
|
|
|
6
6
|
import { useVirtualizer } from '../../../node_modules/@tanstack/react-virtual/dist/esm/index.js';
|
|
7
7
|
import { useFormField } from '../useFormField.js';
|
|
8
8
|
import useDebounce from '../../../utilities/useDebounce.js';
|
|
9
|
-
import { getSize } from '../../../utilities/getSize.js';
|
|
10
9
|
import useCombobox from './useCombobox.js';
|
|
11
10
|
import ComboboxInput from './internal/ComboboxInput.js';
|
|
12
11
|
import ComboboxLabel from './internal/ComboboxLabel.js';
|
|
@@ -21,8 +20,7 @@ import { Box } from '../../Box/Box.js';
|
|
|
21
20
|
import { Spinner } from '../../Spinner/Spinner.js';
|
|
22
21
|
import { omit } from '../../../utilities/objectUtils.js';
|
|
23
22
|
|
|
24
|
-
const ComboboxComponent = forwardRef(({ value, initialValue = [], onValueChange, label, hideLabel = false, description, multiple = false, disabled = false, readOnly = false, hideChips = false, clearButtonLabel = 'Fjern alt', hideClearButton = false, error, errorId, id, name, portal = true, htmlSize = 0, virtual = false, children, style, loading, loadingLabel = 'Laster...', filter, chipSrLabel = (option) => 'Slett ' + option.label, className, ...rest }, forwareddRef) => {
|
|
25
|
-
const size = getSize(rest.size || 'md');
|
|
23
|
+
const ComboboxComponent = forwardRef(({ value, initialValue = [], onValueChange, label, hideLabel = false, description, multiple = false, disabled = false, readOnly = false, hideChips = false, clearButtonLabel = 'Fjern alt', hideClearButton = false, error, errorId, id, name, portal = true, htmlSize = 0, virtual = false, children, style, size = 'md', loading, loadingLabel = 'Laster...', filter, chipSrLabel = (option) => 'Slett ' + option.label, className, ...rest }, forwareddRef) => {
|
|
26
24
|
const inputRef = useRef(null);
|
|
27
25
|
const portalRef = useRef(null);
|
|
28
26
|
const listRef = useRef([]);
|
|
@@ -3,7 +3,7 @@ import { useFloating, useRole, useDismiss, useListNavigation, useInteractions }
|
|
|
3
3
|
import { useState } from 'react';
|
|
4
4
|
import { flushSync } from 'react-dom';
|
|
5
5
|
import { useComboboxId, useComboboxIdDispatch } from './ComboboxIdContext.js';
|
|
6
|
-
import { autoUpdate, flip, size } from '../../../node_modules/@floating-ui/dom/dist/floating-ui.dom.js';
|
|
6
|
+
import { autoUpdate, flip, size } from '../../../node_modules/@floating-ui/react-dom/node_modules/@floating-ui/dom/dist/floating-ui.dom.js';
|
|
7
7
|
import { offset } from '../../../node_modules/@floating-ui/core/dist/floating-ui.core.js';
|
|
8
8
|
|
|
9
9
|
const useFloatingCombobox = ({ listRef }) => {
|
|
@@ -19,7 +19,7 @@ const Fieldset = forwardRef((props, ref) => {
|
|
|
19
19
|
size,
|
|
20
20
|
disabled: props?.disabled,
|
|
21
21
|
readOnly,
|
|
22
|
-
}, children: jsxs("fieldset", { ...fieldsetProps, className: clsx('fds-fieldset', !hideLegend && 'fds-fieldset--spacing', readOnly && 'fds-fieldset--readonly', props?.disabled
|
|
22
|
+
}, children: jsxs("fieldset", { ...fieldsetProps, className: clsx('fds-fieldset', !hideLegend && 'fds-fieldset--spacing', readOnly && 'fds-fieldset--readonly', className), disabled: props?.disabled, ref: ref, ...rest, children: [jsx(Label, { asChild: true, size: size, children: jsx("legend", { className: 'fds-fieldset__legend', children: jsxs("span", { className: clsx('fds-fieldset__legend__content', hideLegend && `fds-sr-only`), children: [readOnly && (jsx(PadlockLockedFillIcon, { className: 'fds-fieldset__readonly__icon', "aria-hidden": true })), legend] }) }) }), description && (jsx(Paragraph, { size: size, variant: 'short', asChild: true, children: jsx("div", { id: descriptionId, className: clsx('fds-fieldset__description', hideLegend && `fds-sr-only`), children: description }) })), children, jsx("div", { id: errorId, "aria-live": 'polite', "aria-relevant": 'additions removals', className: 'fds-fieldset__error-message', children: hasError && jsx(ErrorMessage, { size: size, children: error }) })] }) }));
|
|
23
23
|
});
|
|
24
24
|
Fieldset.displayName = 'Fieldset';
|
|
25
25
|
|
|
@@ -12,7 +12,7 @@ import { Paragraph } from '../../Typography/Paragraph/Paragraph.js';
|
|
|
12
12
|
const NativeSelect = forwardRef((props, ref) => {
|
|
13
13
|
const { children, disabled = false, label, description, hideLabel = false, error, className, htmlSize = 0, ...rest } = props;
|
|
14
14
|
const { selectProps, descriptionId, errorId, readOnly = false, size = 'md', } = useNativeSelect(props);
|
|
15
|
-
return (jsx(Paragraph, { asChild: true, size: size, children: jsxs("div", { className: clsx('fds-native-select--container',
|
|
15
|
+
return (jsx(Paragraph, { asChild: true, size: size, children: jsxs("div", { className: clsx('fds-native-select--container', readOnly && 'fds-native-select--readonly', error && 'fds-native-select--error'), children: [label && (jsxs(Label, { weight: 'medium', size: size, htmlFor: selectProps.id, className: clsx('fds-native-select__label', hideLabel && 'fds-sr-only'), children: [readOnly && (jsx(PadlockLockedFillIcon, { "aria-hidden": true, className: 'fds-native-select__readonly__icon' })), label] })), description && (jsx(Paragraph, { asChild: true, size: size, children: jsx("div", { id: descriptionId, className: clsx(`fds-native-select__description`, hideLabel && `fds-sr-only`), children: description }) })), jsx("div", { className: 'fds-native-select__wrapper', children: jsx("select", { disabled: disabled || readOnly, ref: ref, size: htmlSize, className: clsx('fds-native-select', `fds-native-select--${size}`, `fds-focus`, props.multiple && 'fds-native-select--multiple', className), ...omit(['size', 'error', 'errorId'], rest), ...omit(['readOnly', 'disabled'], selectProps), children: children }) }), error && (jsx("div", { id: errorId, className: 'fds-native-select__error-message', "aria-live": 'polite', "aria-relevant": 'additions removals', children: jsx(ErrorMessage, { size: size, children: error }) }))] }) }));
|
|
16
16
|
});
|
|
17
17
|
NativeSelect.displayName = 'NativeSelect';
|
|
18
18
|
|
|
@@ -2,13 +2,11 @@
|
|
|
2
2
|
import { useContext } from 'react';
|
|
3
3
|
import { useFormField } from '../useFormField.js';
|
|
4
4
|
import { FieldsetContext } from '../Fieldset/FieldsetContext.js';
|
|
5
|
-
import { getSize } from '../../../utilities/getSize.js';
|
|
6
5
|
|
|
7
6
|
/** Handles props for `NativeSelect` in context with `Fieldset` */
|
|
8
7
|
const useNativeSelect = (props) => {
|
|
9
8
|
const fieldset = useContext(FieldsetContext);
|
|
10
|
-
const { inputProps: selectProps, readOnly, ...rest } = useFormField(props, 'select');
|
|
11
|
-
const size = getSize(fieldset?.size ?? props.size ?? 'md');
|
|
9
|
+
const { inputProps: selectProps, readOnly, size = fieldset?.size ?? 'md', ...rest } = useFormField(props, 'select');
|
|
12
10
|
return {
|
|
13
11
|
...rest,
|
|
14
12
|
readOnly,
|
|
@@ -10,7 +10,7 @@ import { Label } from '../../Typography/Label/Label.js';
|
|
|
10
10
|
const Radio = forwardRef((props, ref) => {
|
|
11
11
|
const { children, description, className, style, ...rest } = props;
|
|
12
12
|
const { inputProps, descriptionId, hasError, size = 'md', readOnly, } = useRadio(props);
|
|
13
|
-
return (jsx(Paragraph, { asChild: true, size: size, children: jsxs("div", { className: clsx('fds-radio', `fds-radio--${size}`,
|
|
13
|
+
return (jsx(Paragraph, { asChild: true, size: size, children: jsxs("div", { className: clsx('fds-radio', `fds-radio--${size}`, hasError && `fds-radio--error`, readOnly && `fds-radio--readonly`, className), style: style, children: [jsx("input", { className: 'fds-radio__input', disabled: inputProps.disabled, ref: ref, ...omit(['size', 'error'], rest), ...inputProps }), children && (jsxs(Fragment, { children: [jsx(Label, { className: 'fds-radio__label', htmlFor: inputProps.id, size: size, weight: 'regular', children: jsx("span", { children: children }) }), description && (jsx(Paragraph, { asChild: true, size: size, children: jsx("div", { id: descriptionId, className: 'fds-radio__description', children: description }) }))] }))] }) }));
|
|
14
14
|
});
|
|
15
15
|
Radio.displayName = 'Radio';
|
|
16
16
|
|
|
@@ -2,13 +2,11 @@
|
|
|
2
2
|
import { useContext } from 'react';
|
|
3
3
|
import { useFormField } from '../useFormField.js';
|
|
4
4
|
import { FieldsetContext } from '../Fieldset/FieldsetContext.js';
|
|
5
|
-
import { getSize } from '../../../utilities/getSize.js';
|
|
6
5
|
|
|
7
6
|
/** Handles props for `Search` in context with `Fieldset` */
|
|
8
7
|
const useSearch = (props) => {
|
|
9
8
|
const fieldset = useContext(FieldsetContext);
|
|
10
|
-
const { inputProps, readOnly, ...rest } = useFormField(props, 'search');
|
|
11
|
-
const size = fieldset?.size ?? getSize(props.size || 'md');
|
|
9
|
+
const { inputProps, readOnly, size = fieldset?.size ?? 'md', ...rest } = useFormField(props, 'search');
|
|
12
10
|
return {
|
|
13
11
|
...rest,
|
|
14
12
|
readOnly,
|
|
@@ -11,7 +11,7 @@ import { Label } from '../../Typography/Label/Label.js';
|
|
|
11
11
|
const Switch = forwardRef((props, ref) => {
|
|
12
12
|
const { children, description, position = 'left', className, ...rest } = props;
|
|
13
13
|
const { inputProps, descriptionId, size = 'md', readOnly, } = useSwitch(props);
|
|
14
|
-
return (jsx(Paragraph, { asChild: true, size: size, children: jsxs("div", { className: clsx(`fds-switch`, `fds-switch--${size}`, inputProps.disabled && `fds-switch--disabled`, readOnly && `fds-switch--readonly`, className), children: [jsx("input", { className: `fds-switch__input`, ref: ref, ...omit(['size', 'error'], rest), ...inputProps }), jsxs(Label, { className: clsx(`fds-switch__label`, position === 'right' && `fds-switch__label--right`), htmlFor: inputProps.id, size: size, weight: 'regular', children: [jsx("span", { className: `fds-switch__track`, children: jsx("span", { className: `fds-switch__thumb` }) }), readOnly && (jsx(PadlockLockedFillIcon, { "aria-hidden": true, className: `fds-switch__readonly__icon` })), children && jsx("span", { children: children })] }), description && (jsx(Paragraph, { asChild: true, size: size, children: jsx("div", { id: descriptionId, className: `fds-switch__description`, children: description }) }))] }) }));
|
|
14
|
+
return (jsx(Paragraph, { asChild: true, size: size, children: jsxs("div", { className: clsx(`fds-switch`, `fds-switch--${size}`, inputProps.disabled && `fds-switch--disabled`, readOnly && `fds-switch--readonly`, className), children: [jsx("input", { className: `fds-switch__input`, disabled: inputProps.disabled, ref: ref, ...omit(['size', 'error'], rest), ...inputProps }), jsxs(Label, { className: clsx(`fds-switch__label`, position === 'right' && `fds-switch__label--right`), htmlFor: inputProps.id, size: size, weight: 'regular', children: [jsx("span", { className: `fds-switch__track`, children: jsx("span", { className: `fds-switch__thumb` }) }), readOnly && (jsx(PadlockLockedFillIcon, { "aria-hidden": true, className: `fds-switch__readonly__icon` })), children && jsx("span", { children: children })] }), description && (jsx(Paragraph, { asChild: true, size: size, children: jsx("div", { id: descriptionId, className: `fds-switch__description`, children: description }) }))] }) }));
|
|
15
15
|
});
|
|
16
16
|
Switch.displayName = 'Switch';
|
|
17
17
|
|
|
@@ -24,7 +24,7 @@ const Textarea = forwardRef((props, ref) => {
|
|
|
24
24
|
const characterLimitId = `${textareaProps.id}-charactercount}`;
|
|
25
25
|
const hasCharacterLimit = characterLimit != null;
|
|
26
26
|
const describedBy = clsx(textareaProps['aria-describedby'], hasCharacterLimit && characterLimitId) || undefined;
|
|
27
|
-
return (jsx(Paragraph, { asChild: true, size: size, children: jsxs("div", { style: style, className: clsx('fds-textarea', `fds-textarea--${size}`,
|
|
27
|
+
return (jsx(Paragraph, { asChild: true, size: size, children: jsxs("div", { style: style, className: clsx('fds-textarea', `fds-textarea--${size}`, hasError && `fds-textarea--error`, className), children: [label && (jsxs(Label, { size: size, weight: 'medium', htmlFor: textareaProps.id, className: clsx('fds-textarea__label', hideLabel && `fds-sr-only`), children: [readOnly && (jsx(PadlockLockedFillIcon, { "aria-hidden": true, className: 'fds-textarea__readonly-icon' })), jsx("span", { children: label })] })), description && (jsx(Paragraph, { asChild: true, size: size, children: jsx("div", { id: descriptionId, className: clsx('fds-textarea__description', hideLabel && `fds-sr-only`), children: description }) })), jsx("textarea", { className: clsx('fds-textarea__input', `fds-focus`), ref: ref, "aria-describedby": describedBy, disabled: textareaProps.disabled, readOnly: readOnly, ...omit(['size', 'error', 'errorId'], rest), ...textareaProps, onChange: (e) => {
|
|
28
28
|
textareaProps?.onChange?.(e);
|
|
29
29
|
setValue(e.target.value);
|
|
30
30
|
} }), hasCharacterLimit && (jsx(CharacterCounter, { size: size, value: value ? value.toString() : '', id: characterLimitId, ...characterLimit })), jsx("div", { className: 'fds-textarea__error-message', id: errorId, "aria-live": 'polite', "aria-relevant": 'additions removals', children: hasError && jsx(ErrorMessage, { size: size, children: props.error }) })] }) }));
|
|
@@ -2,13 +2,11 @@
|
|
|
2
2
|
import { useContext } from 'react';
|
|
3
3
|
import { useFormField } from '../useFormField.js';
|
|
4
4
|
import { FieldsetContext } from '../Fieldset/FieldsetContext.js';
|
|
5
|
-
import { getSize } from '../../../utilities/getSize.js';
|
|
6
5
|
|
|
7
6
|
/** Handles props for `Textarea` in context with `Fieldset` */
|
|
8
7
|
const useTextarea = (props) => {
|
|
9
8
|
const fieldset = useContext(FieldsetContext);
|
|
10
|
-
const { inputProps, readOnly, ...rest } = useFormField(props, 'textarea');
|
|
11
|
-
const size = fieldset?.size ?? getSize(props.size ?? 'md');
|
|
9
|
+
const { inputProps, readOnly, size = fieldset?.size ?? 'md', ...rest } = useFormField(props, 'textarea');
|
|
12
10
|
return {
|
|
13
11
|
...rest,
|
|
14
12
|
readOnly,
|
|
@@ -24,7 +24,7 @@ const Textfield = forwardRef((props, ref) => {
|
|
|
24
24
|
const characterLimitId = `textfield-charactercount-${useId()}`;
|
|
25
25
|
const hasCharacterLimit = characterLimit != null;
|
|
26
26
|
const describedBy = clsx(inputProps['aria-describedby'], hasCharacterLimit && characterLimitId) || undefined;
|
|
27
|
-
return (jsx(Paragraph, { asChild: true, size: size, children: jsxs("div", { style: style, className: clsx(`fds-textfield`, `fds-textfield--${size}`,
|
|
27
|
+
return (jsx(Paragraph, { asChild: true, size: size, children: jsxs("div", { style: style, className: clsx(`fds-textfield`, `fds-textfield--${size}`, readOnly && `fds-textfield--readonly`, hasError && `fds-textfield--error`, className), children: [label && (jsxs(Label, { size: size, weight: 'medium', htmlFor: inputProps.id, className: clsx(`fds-textfield__label`, hideLabel && `fds-sr-only`), children: [readOnly && (jsx(PadlockLockedFillIcon, { "aria-hidden": true, className: 'fds-textfield__readonly__icon' })), jsx("span", { children: label })] })), description && (jsx(Paragraph, { asChild: true, size: size, children: jsx("div", { id: descriptionId, className: clsx(`fds-textfield__description`, hideLabel && `fds-sr-only`), children: description }) })), jsxs("div", { className: 'fds-textfield__field', children: [prefix && (jsx(Paragraph, { asChild: true, size: size, variant: 'short', children: jsx("div", { className: clsx(`fds-textfield__adornment`, `fds-textfield__prefix`), "aria-hidden": 'true', children: prefix }) })), jsx("input", { className: clsx(`fds-textfield__input`, `fds-focus`, prefix && `fds-textfield__input--with-prefix`, suffix && `fds-textfield__input--with-suffix`), ref: ref, type: type, disabled: inputProps.disabled, "aria-describedby": describedBy, size: htmlSize, ...omit(['size', 'error', 'errorId'], rest), ...inputProps, onChange: (e) => {
|
|
28
28
|
inputProps?.onChange?.(e);
|
|
29
29
|
setInputValue(e.target.value);
|
|
30
30
|
} }), suffix && (jsx(Paragraph, { asChild: true, size: size, variant: 'short', children: jsx("div", { className: clsx(`fds-textfield__adornment`, `fds-textfield__suffix`), "aria-hidden": 'true', children: suffix }) }))] }), hasCharacterLimit && (jsx(CharacterCounter, { size: size, value: inputValue ? inputValue.toString() : '', id: characterLimitId, ...characterLimit })), jsx("div", { className: 'fds-textfield__error-message', id: errorId, "aria-live": 'polite', "aria-relevant": 'additions removals', children: hasError && jsx(ErrorMessage, { size: size, children: props.error }) })] }) }));
|
|
@@ -2,13 +2,11 @@
|
|
|
2
2
|
import { useContext } from 'react';
|
|
3
3
|
import { useFormField } from '../useFormField.js';
|
|
4
4
|
import { FieldsetContext } from '../Fieldset/FieldsetContext.js';
|
|
5
|
-
import { getSize } from '../../../utilities/getSize.js';
|
|
6
5
|
|
|
7
6
|
/** Handles props for `Textfield` in context with `Fieldset` */
|
|
8
7
|
const useTextfield = (props) => {
|
|
9
8
|
const fieldset = useContext(FieldsetContext);
|
|
10
|
-
const { inputProps, readOnly, ...rest } = useFormField(props, 'textfield');
|
|
11
|
-
const size = getSize(fieldset?.size ?? props.size ?? 'md');
|
|
9
|
+
const { inputProps, readOnly, size = fieldset?.size ?? 'md', ...rest } = useFormField(props, 'textfield');
|
|
12
10
|
return {
|
|
13
11
|
...rest,
|
|
14
12
|
readOnly,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useContext, useId } from 'react';
|
|
3
3
|
import { clsx } from '../../node_modules/clsx/dist/lite.js';
|
|
4
|
-
import { getSize } from '../../utilities/getSize.js';
|
|
5
4
|
import { FieldsetContext } from './Fieldset/FieldsetContext.js';
|
|
6
5
|
|
|
7
6
|
/**
|
|
@@ -13,10 +12,10 @@ const useFormField = (props, prefix) => {
|
|
|
13
12
|
const id = props.id ?? `${prefix}-${randomId}`;
|
|
14
13
|
const errorId = props.errorId ?? `${prefix}-error-${randomId}`;
|
|
15
14
|
const descriptionId = `${prefix}-description-${randomId}`;
|
|
15
|
+
const size = props.size ?? fieldset?.size ?? 'md';
|
|
16
16
|
const disabled = fieldset?.disabled || props?.disabled;
|
|
17
17
|
const readOnly = ((fieldset?.readOnly || props?.readOnly) && !disabled) || undefined;
|
|
18
18
|
const hasError = !disabled && !readOnly && !!(props.error || fieldset?.error);
|
|
19
|
-
const size = getSize(props.size || fieldset?.size || 'md');
|
|
20
19
|
return {
|
|
21
20
|
readOnly,
|
|
22
21
|
hasError,
|
|
@@ -27,7 +26,9 @@ const useFormField = (props, prefix) => {
|
|
|
27
26
|
id,
|
|
28
27
|
disabled,
|
|
29
28
|
'aria-invalid': hasError ? true : undefined,
|
|
30
|
-
'aria-describedby': clsx(props['aria-describedby'],
|
|
29
|
+
'aria-describedby': clsx(props['aria-describedby'], !!props?.description &&
|
|
30
|
+
typeof props?.description === 'string' &&
|
|
31
|
+
descriptionId, hasError && !fieldset?.error && errorId, hasError && !!fieldset?.error && fieldset?.errorId) || undefined,
|
|
31
32
|
},
|
|
32
33
|
};
|
|
33
34
|
};
|
|
@@ -8,8 +8,8 @@ export { arrow } from '../../react-dom/dist/floating-ui.react-dom.js';
|
|
|
8
8
|
import { isElement, isHTMLElement, getOverflowAncestors, getWindow, getNodeName, isLastTraversableNode, getParentNode, getComputedStyle } from '../../utils/dist/floating-ui.utils.dom.js';
|
|
9
9
|
import { tabbable, isTabbable } from '../../../tabbable/dist/index.esm.js';
|
|
10
10
|
import { createPortal } from 'react-dom';
|
|
11
|
-
import { platform } from '../../dom/dist/floating-ui.dom.js';
|
|
12
|
-
export { autoUpdate, computePosition, flip, shift, size } from '../../dom/dist/floating-ui.dom.js';
|
|
11
|
+
import { platform } from '../../react-dom/node_modules/@floating-ui/dom/dist/floating-ui.dom.js';
|
|
12
|
+
export { autoUpdate, computePosition, flip, shift, size } from '../../react-dom/node_modules/@floating-ui/dom/dist/floating-ui.dom.js';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Merges an array of refs into a single memoized callback ref or `null`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { arrow as arrow$1, computePosition } from '
|
|
3
|
-
export { autoUpdate, flip, platform, shift, size } from '
|
|
2
|
+
import { arrow as arrow$1, computePosition } from '../node_modules/@floating-ui/dom/dist/floating-ui.dom.js';
|
|
3
|
+
export { autoUpdate, flip, platform, shift, size } from '../node_modules/@floating-ui/dom/dist/floating-ui.dom.js';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { useLayoutEffect, useEffect } from 'react';
|
|
6
6
|
import * as ReactDOM from 'react-dom';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { shift as shift$1, flip as flip$1, arrow as arrow$1, size as size$1, computePosition as computePosition$1 } from '
|
|
3
|
-
export { detectOverflow, offset } from '
|
|
4
|
-
import { createCoords, rectToClientRect, round, max, min, floor } from '
|
|
5
|
-
import { getOverflowAncestors, isElement, getWindow, getComputedStyle, getDocumentElement, isHTMLElement, isWebKit, getNodeName, isOverflowElement, getNodeScroll, isTableElement, isContainingBlock, getContainingBlock, getParentNode, isLastTraversableNode } from '
|
|
2
|
+
import { shift as shift$1, flip as flip$1, arrow as arrow$1, size as size$1, computePosition as computePosition$1 } from '../../../../../core/dist/floating-ui.core.js';
|
|
3
|
+
export { detectOverflow, offset } from '../../../../../core/dist/floating-ui.core.js';
|
|
4
|
+
import { createCoords, rectToClientRect, round, max, min, floor } from '../../../../../utils/dist/floating-ui.utils.js';
|
|
5
|
+
import { getOverflowAncestors, isElement, getWindow, getComputedStyle, getDocumentElement, isHTMLElement, isWebKit, getNodeName, isOverflowElement, getNodeScroll, isTableElement, isContainingBlock, getContainingBlock, getParentNode, isLastTraversableNode } from '../../../../../utils/dist/floating-ui.utils.dom.js';
|
|
6
6
|
|
|
7
7
|
function getCssDimensions(element) {
|
|
8
8
|
const css = getComputedStyle(element);
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import type { ReactNode, HTMLAttributes } from 'react';
|
|
2
|
-
type OldColors = 'first' | 'second' | 'third';
|
|
3
2
|
export type AccordionProps = {
|
|
4
|
-
/** Accordion background color
|
|
5
|
-
|
|
3
|
+
/** Accordion background color
|
|
4
|
+
* @default neutral
|
|
5
|
+
*/
|
|
6
|
+
color?: 'brand1' | 'brand2' | 'brand3' | 'neutral' | 'subtle';
|
|
6
7
|
/** Show border */
|
|
7
8
|
border?: boolean;
|
|
8
9
|
/** Instances of `Accordion.Item` */
|
|
9
10
|
children: ReactNode;
|
|
10
11
|
} & HTMLAttributes<HTMLDivElement>;
|
|
11
12
|
export declare const Accordion: import("react").ForwardRefExoticComponent<{
|
|
12
|
-
/** Accordion background color
|
|
13
|
-
|
|
13
|
+
/** Accordion background color
|
|
14
|
+
* @default neutral
|
|
15
|
+
*/
|
|
16
|
+
color?: "neutral" | "brand1" | "brand2" | "brand3" | "subtle" | undefined;
|
|
14
17
|
/** Show border */
|
|
15
18
|
border?: boolean | undefined;
|
|
16
19
|
/** Instances of `Accordion.Item` */
|
|
17
20
|
children: ReactNode;
|
|
18
21
|
} & HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
19
|
-
export {};
|
|
20
22
|
//# sourceMappingURL=Accordion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.d.ts","sourceRoot":"","sources":["../../../../src/components/Accordion/Accordion.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Accordion.d.ts","sourceRoot":"","sources":["../../../../src/components/Accordion/Accordion.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAIvD,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,KAAK,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;IAC9D,kBAAkB;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,oCAAoC;IACpC,QAAQ,EAAE,SAAS,CAAC;CACrB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEnC,eAAO,MAAM,SAAS;IAVpB;;OAEG;;IAEH,kBAAkB;;IAElB,oCAAoC;cAC1B,SAAS;mFAkBpB,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { HTMLAttributes } from 'react';
|
|
2
2
|
type Severity = 'info' | 'warning' | 'success' | 'danger';
|
|
3
|
-
type OldAlertSizes = 'small' | 'medium' | 'large';
|
|
4
3
|
export type AlertProps = {
|
|
5
4
|
/** Sets color & icon according to severity */
|
|
6
5
|
severity?: Severity;
|
|
@@ -16,10 +15,8 @@ export type AlertProps = {
|
|
|
16
15
|
* Does not affect font size.
|
|
17
16
|
*
|
|
18
17
|
* @default md
|
|
19
|
-
*
|
|
20
|
-
* @note `small`, `medium`, `large` is deprecated
|
|
21
18
|
*/
|
|
22
|
-
size?: 'sm' | 'md' | 'lg'
|
|
19
|
+
size?: 'sm' | 'md' | 'lg';
|
|
23
20
|
} & HTMLAttributes<HTMLDivElement>;
|
|
24
21
|
export declare const Alert: import("react").ForwardRefExoticComponent<{
|
|
25
22
|
/** Sets color & icon according to severity */
|
|
@@ -36,10 +33,8 @@ export declare const Alert: import("react").ForwardRefExoticComponent<{
|
|
|
36
33
|
* Does not affect font size.
|
|
37
34
|
*
|
|
38
35
|
* @default md
|
|
39
|
-
*
|
|
40
|
-
* @note `small`, `medium`, `large` is deprecated
|
|
41
36
|
*/
|
|
42
|
-
size?: "sm" | "md" | "lg" |
|
|
37
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
43
38
|
} & HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
44
39
|
export {};
|
|
45
40
|
//# sourceMappingURL=Alert.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../../../../src/components/Alert/Alert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../../../../src/components/Alert/Alert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AA4B5C,KAAK,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE1D,MAAM,MAAM,UAAU,GAAG;IACvB,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;iCAG6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;CAC3B,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AACnC,eAAO,MAAM,KAAK;IAjBhB,8CAA8C;;IAE9C,6CAA6C;;IAE7C;;;iCAG6B;;IAE7B;;;;;OAKG;;mFA8CJ,CAAC"}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import type { HTMLAttributes } from 'react';
|
|
2
|
-
type OldShadowSizes = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
|
|
3
|
-
type OldBorderRadii = 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge' | 'xxxlarge' | 'xxxxlarge';
|
|
4
2
|
export type BoxProps = {
|
|
5
3
|
/**
|
|
6
4
|
* Shadow size of the box
|
|
7
5
|
* @default undefined
|
|
8
6
|
*/
|
|
9
|
-
shadow?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'
|
|
7
|
+
shadow?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
10
8
|
/**
|
|
11
9
|
* Border color of the box
|
|
12
10
|
* @default undefined
|
|
@@ -16,7 +14,7 @@ export type BoxProps = {
|
|
|
16
14
|
* Border radius of the box
|
|
17
15
|
* @default undefined
|
|
18
16
|
*/
|
|
19
|
-
borderRadius?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | 'full'
|
|
17
|
+
borderRadius?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | 'full';
|
|
20
18
|
/**
|
|
21
19
|
* Background color of the box
|
|
22
20
|
* @default 'default'
|
|
@@ -33,7 +31,7 @@ export declare const Box: import("react").ForwardRefExoticComponent<{
|
|
|
33
31
|
* Shadow size of the box
|
|
34
32
|
* @default undefined
|
|
35
33
|
*/
|
|
36
|
-
shadow?: "
|
|
34
|
+
shadow?: "sm" | "md" | "lg" | "xs" | "xl" | undefined;
|
|
37
35
|
/**
|
|
38
36
|
* Border color of the box
|
|
39
37
|
* @default undefined
|
|
@@ -43,7 +41,7 @@ export declare const Box: import("react").ForwardRefExoticComponent<{
|
|
|
43
41
|
* Border radius of the box
|
|
44
42
|
* @default undefined
|
|
45
43
|
*/
|
|
46
|
-
borderRadius?: "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" |
|
|
44
|
+
borderRadius?: "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "full" | undefined;
|
|
47
45
|
/**
|
|
48
46
|
* Background color of the box
|
|
49
47
|
* @default 'default'
|
|
@@ -55,5 +53,4 @@ export declare const Box: import("react").ForwardRefExoticComponent<{
|
|
|
55
53
|
*/
|
|
56
54
|
asChild?: boolean | undefined;
|
|
57
55
|
} & HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
58
|
-
export {};
|
|
59
56
|
//# sourceMappingURL=Box.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Box.d.ts","sourceRoot":"","sources":["../../../../src/components/Box/Box.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Box.d.ts","sourceRoot":"","sources":["../../../../src/components/Box/Box.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAK5C,MAAM,MAAM,QAAQ,GAAG;IACrB;;;OAGG;IACH,MAAM,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1C;;;OAGG;IACH,WAAW,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAC9C;;;OAGG;IACH,YAAY,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC;IAC1E;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAClC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEnC,eAAO,MAAM,GAAG;IA3Bd;;;OAGG;;IAEH;;;OAGG;;IAEH;;;OAGG;;IAEH;;;OAGG;;IAEH;;;OAGG;;mFAoCJ,CAAC"}
|
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
import type { ButtonHTMLAttributes } from 'react';
|
|
2
|
-
type OldButtonSizes = 'small' | 'medium' | 'large';
|
|
3
|
-
type OldColors = 'first' | 'second' | 'success';
|
|
4
2
|
export type ButtonProps = {
|
|
5
3
|
/** Specify which variant to use */
|
|
6
4
|
variant?: 'primary' | 'secondary' | 'tertiary';
|
|
7
5
|
/** Specify which color palette to use
|
|
8
6
|
* @default accent
|
|
9
|
-
* @note `first`, `second`, `success` is deprecated
|
|
10
7
|
*/
|
|
11
|
-
color?: 'accent' | 'neutral' | 'danger'
|
|
8
|
+
color?: 'accent' | 'neutral' | 'danger';
|
|
12
9
|
/**
|
|
13
10
|
* Size
|
|
14
11
|
* @default md
|
|
15
|
-
* @note `small`, `medium`, `large` is deprecated
|
|
16
12
|
*/
|
|
17
|
-
size?: 'sm' | 'md' | 'lg'
|
|
13
|
+
size?: 'sm' | 'md' | 'lg';
|
|
18
14
|
/** If `Button` should fill full width of its container */
|
|
19
15
|
fullWidth?: boolean;
|
|
20
16
|
/** Toggle icon only styling, pass icon as children
|
|
@@ -35,15 +31,13 @@ export declare const Button: import("react").ForwardRefExoticComponent<{
|
|
|
35
31
|
variant?: "primary" | "secondary" | "tertiary" | undefined;
|
|
36
32
|
/** Specify which color palette to use
|
|
37
33
|
* @default accent
|
|
38
|
-
* @note `first`, `second`, `success` is deprecated
|
|
39
34
|
*/
|
|
40
|
-
color?: "accent" | "neutral" |
|
|
35
|
+
color?: "accent" | "neutral" | "danger" | undefined;
|
|
41
36
|
/**
|
|
42
37
|
* Size
|
|
43
38
|
* @default md
|
|
44
|
-
* @note `small`, `medium`, `large` is deprecated
|
|
45
39
|
*/
|
|
46
|
-
size?: "sm" | "md" | "lg" |
|
|
40
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
47
41
|
/** If `Button` should fill full width of its container */
|
|
48
42
|
fullWidth?: boolean | undefined;
|
|
49
43
|
/** Toggle icon only styling, pass icon as children
|
|
@@ -56,5 +50,4 @@ export declare const Button: import("react").ForwardRefExoticComponent<{
|
|
|
56
50
|
*/
|
|
57
51
|
asChild?: boolean | undefined;
|
|
58
52
|
} & ButtonHTMLAttributes<HTMLButtonElement> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
59
|
-
export {};
|
|
60
53
|
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAIlD,MAAM,MAAM,WAAW,GAAG;IACxB,mCAAmC;IACnC,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,UAAU,CAAC;IAC/C;;OAEG;IACH,KAAK,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;IACxC;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,0DAA0D;IAC1D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AAE5C;;GAEG;AACH,eAAO,MAAM,MAAM;IA3BjB,mCAAmC;;IAEnC;;OAEG;;IAEH;;;OAGG;;IAEH,0DAA0D;;IAE1D;;OAEG;;IAEH;;;OAGG;;+FA6CJ,CAAC"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import type { ReactNode, HTMLAttributes } from 'react';
|
|
2
|
-
type OldColors = 'first' | 'second' | 'third';
|
|
3
2
|
export type CardProps = {
|
|
4
3
|
/**
|
|
5
4
|
* Changes background & border color
|
|
6
5
|
* @default neutral
|
|
7
6
|
*/
|
|
8
|
-
color?: 'neutral' | 'subtle' | 'brand1' | 'brand2' | 'brand3'
|
|
7
|
+
color?: 'neutral' | 'subtle' | 'brand1' | 'brand2' | 'brand3';
|
|
9
8
|
/**
|
|
10
9
|
* Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
11
10
|
* @default false
|
|
@@ -18,17 +17,13 @@ export type CardProps = {
|
|
|
18
17
|
isLink?: boolean;
|
|
19
18
|
/** Instances of `Card.Header`, `Card.Content`, `Card.Footer` or other React nodes like `Divider` */
|
|
20
19
|
children: ReactNode;
|
|
21
|
-
/**
|
|
22
|
-
* @deprecated Use `asChild` and `isLink={true}` instead
|
|
23
|
-
*/
|
|
24
|
-
href?: never;
|
|
25
20
|
} & HTMLAttributes<HTMLDivElement>;
|
|
26
21
|
export declare const Card: import("react").ForwardRefExoticComponent<{
|
|
27
22
|
/**
|
|
28
23
|
* Changes background & border color
|
|
29
24
|
* @default neutral
|
|
30
25
|
*/
|
|
31
|
-
color?: "neutral" | "brand1" | "brand2" | "brand3" | "subtle" |
|
|
26
|
+
color?: "neutral" | "brand1" | "brand2" | "brand3" | "subtle" | undefined;
|
|
32
27
|
/**
|
|
33
28
|
* Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
34
29
|
* @default false
|
|
@@ -41,10 +36,5 @@ export declare const Card: import("react").ForwardRefExoticComponent<{
|
|
|
41
36
|
isLink?: boolean | undefined;
|
|
42
37
|
/** Instances of `Card.Header`, `Card.Content`, `Card.Footer` or other React nodes like `Divider` */
|
|
43
38
|
children: ReactNode;
|
|
44
|
-
/**
|
|
45
|
-
* @deprecated Use `asChild` and `isLink={true}` instead
|
|
46
|
-
*/
|
|
47
|
-
href?: undefined;
|
|
48
39
|
} & HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
49
|
-
export {};
|
|
50
40
|
//# sourceMappingURL=Card.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../../src/components/Card/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../../src/components/Card/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAKvD,MAAM,MAAM,SAAS,GAAG;IACtB;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAC9D;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,oGAAoG;IACpG,QAAQ,EAAE,SAAS,CAAC;CACrB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEnC,eAAO,MAAM,IAAI;IAnBf;;;OAGG;;IAEH;;;OAGG;;IAEH;;;OAGG;;IAEH,oGAAoG;cAC1F,SAAS;mFAuBpB,CAAC"}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import type { HTMLAttributes } from 'react';
|
|
2
|
-
type OldChipSizes = 'small' | 'medium' | 'large';
|
|
3
2
|
export type ChipGroupContext = {
|
|
4
|
-
size?: 'sm' | 'md' | 'lg'
|
|
3
|
+
size?: 'sm' | 'md' | 'lg';
|
|
5
4
|
};
|
|
6
5
|
export declare const ChipGroupContext: import("react").Context<ChipGroupContext | null>;
|
|
7
6
|
export type ChipGroupProps = {
|
|
8
7
|
/**
|
|
9
8
|
* Changes Chip size and gap between chips.
|
|
10
9
|
* @default md
|
|
11
|
-
* @note `small`, `medium`, `large` is deprecated
|
|
12
10
|
*/
|
|
13
11
|
size?: ChipGroupContext['size'];
|
|
14
12
|
} & HTMLAttributes<HTMLUListElement>;
|
|
@@ -16,9 +14,7 @@ export declare const Group: import("react").ForwardRefExoticComponent<{
|
|
|
16
14
|
/**
|
|
17
15
|
* Changes Chip size and gap between chips.
|
|
18
16
|
* @default md
|
|
19
|
-
* @note `small`, `medium`, `large` is deprecated
|
|
20
17
|
*/
|
|
21
18
|
size?: ChipGroupContext['size'];
|
|
22
19
|
} & HTMLAttributes<HTMLUListElement> & import("react").RefAttributes<HTMLUListElement>>;
|
|
23
|
-
export {};
|
|
24
20
|
//# sourceMappingURL=Group.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Group.d.ts","sourceRoot":"","sources":["../../../../../src/components/Chip/Group/Group.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Group.d.ts","sourceRoot":"","sources":["../../../../../src/components/Chip/Group/Group.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAI5C,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,gBAAgB,kDAA+C,CAAC;AAE7E,MAAM,MAAM,cAAc,GAAG;IAC3B;;;OAGG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;CACjC,GAAG,cAAc,CAAC,gBAAgB,CAAC,CAAC;AAErC,eAAO,MAAM,KAAK;IAPhB;;;OAGG;WACI,gBAAgB,CAAC,MAAM,CAAC;uFAyBhC,CAAC"}
|
|
@@ -4,7 +4,6 @@ export type RemovableChipProps = {
|
|
|
4
4
|
/**
|
|
5
5
|
* Changes Chip size and gap between chips.
|
|
6
6
|
* @default 'md'
|
|
7
|
-
* @note `small`, `medium`, `large` is deprecated
|
|
8
7
|
*/
|
|
9
8
|
size?: ChipGroupContext['size'];
|
|
10
9
|
} & ButtonHTMLAttributes<HTMLButtonElement>;
|
|
@@ -12,7 +11,6 @@ export declare const RemovableChip: import("react").ForwardRefExoticComponent<{
|
|
|
12
11
|
/**
|
|
13
12
|
* Changes Chip size and gap between chips.
|
|
14
13
|
* @default 'md'
|
|
15
|
-
* @note `small`, `medium`, `large` is deprecated
|
|
16
14
|
*/
|
|
17
15
|
size?: ChipGroupContext['size'];
|
|
18
16
|
} & ButtonHTMLAttributes<HTMLButtonElement> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Removable.d.ts","sourceRoot":"","sources":["../../../../../src/components/Chip/Removable/Removable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAMlD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"Removable.d.ts","sourceRoot":"","sources":["../../../../../src/components/Chip/Removable/Removable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAMlD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;;OAGG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;CACjC,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AAE5C,eAAO,MAAM,aAAa;IAPxB;;;OAGG;WACI,gBAAgB,CAAC,MAAM,CAAC;+FAsChC,CAAC"}
|
|
@@ -8,7 +8,6 @@ export type ToggleChipProps = {
|
|
|
8
8
|
/**
|
|
9
9
|
* Changes Chip size and gap between chips.
|
|
10
10
|
* @default 'md'
|
|
11
|
-
* @note `small`, `medium`, `large` is deprecated
|
|
12
11
|
*/
|
|
13
12
|
size?: ChipGroupContext['size'];
|
|
14
13
|
/**
|
|
@@ -24,7 +23,6 @@ export declare const ToggleChip: import("react").ForwardRefExoticComponent<{
|
|
|
24
23
|
/**
|
|
25
24
|
* Changes Chip size and gap between chips.
|
|
26
25
|
* @default 'md'
|
|
27
|
-
* @note `small`, `medium`, `large` is deprecated
|
|
28
26
|
*/
|
|
29
27
|
size?: ChipGroupContext['size'];
|
|
30
28
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toggle.d.ts","sourceRoot":"","sources":["../../../../../src/components/Chip/Toggle/Toggle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAMlD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"Toggle.d.ts","sourceRoot":"","sources":["../../../../../src/components/Chip/Toggle/Toggle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAMlD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAChC;;SAEK;IACL,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AAE5C,eAAO,MAAM,UAAU;IAfrB;;OAEG;;IAEH;;;OAGG;WACI,gBAAgB,CAAC,MAAM,CAAC;IAC/B;;SAEK;;+FAmDN,CAAC"}
|