@danske/sapphire-react-lab 0.104.0 → 0.105.2
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 +2 -1
- package/build/cjs/index.js +729 -234
- package/build/cjs/index.js.map +1 -1
- package/build/esm/Amount/src/Amount.js +76 -0
- package/build/esm/Amount/src/Amount.js.map +1 -0
- package/build/esm/Amount/src/useGroupAmount.js +35 -0
- package/build/esm/Amount/src/useGroupAmount.js.map +1 -0
- package/build/esm/Autocomplete/src/Autocomplete.js +13 -3
- package/build/esm/Autocomplete/src/Autocomplete.js.map +1 -1
- package/build/esm/Breadcrumbs/src/BreadcrumbItemLink.js +1 -1
- package/build/esm/Breadcrumbs/src/BreadcrumbItemLink.js.map +1 -1
- package/build/esm/Filtering/src/FilterDropdown.js +8 -3
- package/build/esm/Filtering/src/FilterDropdown.js.map +1 -1
- package/build/esm/Filtering/src/SearchableSelectFilter.js +2 -1
- package/build/esm/Filtering/src/SearchableSelectFilter.js.map +1 -1
- package/build/esm/NumberField/src/NumberField.js +53 -21
- package/build/esm/NumberField/src/NumberField.js.map +1 -1
- package/build/esm/NumberField/src/StepperButton.js +8 -4
- package/build/esm/NumberField/src/StepperButton.js.map +1 -1
- package/build/esm/NumberField/src/cursorHelpers.js +55 -0
- package/build/esm/NumberField/src/cursorHelpers.js.map +1 -0
- package/build/esm/NumberField/src/formatHelpers.js +81 -0
- package/build/esm/NumberField/src/formatHelpers.js.map +1 -0
- package/build/esm/NumberField/src/keyboardHelpers.js +120 -0
- package/build/esm/NumberField/src/keyboardHelpers.js.map +1 -0
- package/build/esm/NumberField/src/useNumberFieldFormatting.js +94 -0
- package/build/esm/NumberField/src/useNumberFieldFormatting.js.map +1 -0
- package/build/esm/NumberField/src/useSapphireNumberField.js +1 -1
- package/build/esm/NumberField/src/useSapphireNumberField.js.map +1 -1
- package/build/esm/TagGroup/src/Tag.js +31 -23
- package/build/esm/TagGroup/src/Tag.js.map +1 -1
- package/build/esm/index.js +1 -0
- package/build/esm/index.js.map +1 -1
- package/build/index.d.ts +72 -7
- package/package.json +36 -36
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tag.js","sources":["../../../../src/TagGroup/src/Tag.tsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport clsx from 'clsx';\nimport { AriaButtonProps, useButton } from '@react-aria/button';\nimport { useHover } from '@react-aria/interactions';\nimport { useTag } from '@react-aria/tag';\nimport { mergeProps } from '@react-aria/utils';\nimport type { ListState } from '@react-stately/list';\nimport type { FocusableElement, Node } from '@react-types/shared';\n\nimport { Icon, useThemeCheck } from '@danske/sapphire-react';\nimport { Close, Error } from '@danske/sapphire-icons/react';\nimport styles from '@danske/sapphire-css/components/tag/tag.module.css';\nimport { FocusRing } from '@react-aria/focus';\n\nexport interface TagProps<T> {\n /**\n * Object representing the tag. Contains relevant information about the tag.\n */\n item: Node<T>;\n /**\n * State for TagGroup, returned by `useListState`\n */\n state: ListState<T>;\n /**\n * Shows error icon.\n * @default 'false'\n */\n hasError?: boolean;\n /**\n * Control whether the tag is removable or not.\n * This behavior is overridden to `false` if the tag is disabled.\n *\n * @default false\n */\n allowsRemoving?: boolean;\n}\n\nexport function Tag<T>(props: TagProps<T>): React.JSX.Element {\n useThemeCheck();\n const { hasError = false, item, state } = props;\n const ref = useRef(null);\n const {\n gridCellProps,\n isDisabled,\n isFocused,\n isPressed,\n removeButtonProps,\n rowProps: { onKeyDown, ...rowProps },\n ...otherProps\n } = useTag(props, state, ref);\n const { hoverProps, isHovered } = useHover({ isDisabled });\n /* hasAction prop is passed when onAction is present, we are using it to set the hover and action classes.\n The workaround below is made because AriaTagProps Omit's hasAction to avoid typecheck error */\n const hasAction = (otherProps as any).hasAction;\n\n return (\n <FocusRing focusRingClass={styles['is-focus']}>\n
|
|
1
|
+
{"version":3,"file":"Tag.js","sources":["../../../../src/TagGroup/src/Tag.tsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport clsx from 'clsx';\nimport { AriaButtonProps, useButton } from '@react-aria/button';\nimport { useHover } from '@react-aria/interactions';\nimport { useTag } from '@react-aria/tag';\nimport { mergeProps, mergeRefs } from '@react-aria/utils';\nimport type { ListState } from '@react-stately/list';\nimport type { FocusableElement, Node } from '@react-types/shared';\n\nimport { Icon, useThemeCheck, TooltipIfNeeded } from '@danske/sapphire-react';\nimport { Close, Error } from '@danske/sapphire-icons/react';\nimport styles from '@danske/sapphire-css/components/tag/tag.module.css';\nimport { FocusRing } from '@react-aria/focus';\n\nexport interface TagProps<T> {\n /**\n * Object representing the tag. Contains relevant information about the tag.\n */\n item: Node<T>;\n /**\n * State for TagGroup, returned by `useListState`\n */\n state: ListState<T>;\n /**\n * Shows error icon.\n * @default 'false'\n */\n hasError?: boolean;\n /**\n * Control whether the tag is removable or not.\n * This behavior is overridden to `false` if the tag is disabled.\n *\n * @default false\n */\n allowsRemoving?: boolean;\n}\n\nexport function Tag<T>(props: TagProps<T>): React.JSX.Element {\n useThemeCheck();\n const { hasError = false, item, state } = props;\n const ref = useRef<HTMLDivElement>(null);\n const {\n gridCellProps,\n isDisabled,\n isFocused,\n isPressed,\n removeButtonProps,\n rowProps: { onKeyDown, ...rowProps },\n ...otherProps\n } = useTag(props, state, ref);\n const { hoverProps, isHovered } = useHover({ isDisabled });\n /* hasAction prop is passed when onAction is present, we are using it to set the hover and action classes.\n The workaround below is made because AriaTagProps Omit's hasAction to avoid typecheck error */\n const hasAction = (otherProps as any).hasAction;\n\n return (\n <TooltipIfNeeded<HTMLDivElement> title={item.rendered}>\n {(tooltipRef, tooltipProps) => {\n const { ref: tooltipTargetRef, ...restTooltipProps } =\n tooltipProps || {};\n return (\n <FocusRing focusRingClass={styles['is-focus']}>\n <div\n ref={mergeRefs(ref, tooltipTargetRef)}\n {...mergeProps(\n {\n onKeyDown: (e: React.KeyboardEvent<FocusableElement>) => {\n /* We are removing Space key interaction and prevent default behavior to avoid isPressed prop being set\n as we do not want to apply is-active class on \"Space\" interaction when having actionable tags with onAction or link */\n if (e.key !== ' ') {\n onKeyDown?.(e);\n } else {\n e.preventDefault();\n }\n },\n },\n rowProps,\n hoverProps,\n restTooltipProps\n )}\n className={clsx(\n styles['sapphire-tag'],\n styles['js-focus'],\n styles['js-hover'],\n {\n [styles['sapphire-tag--actionable']]: hasAction,\n [styles['is-active']]: hasAction && isPressed,\n [styles['is-hover']]: hasAction && isHovered,\n [styles['is-disabled']]: isDisabled,\n }\n )}\n {...(hasError ? { 'aria-invalid': true } : {})}\n >\n <div\n {...gridCellProps}\n className={styles['sapphire-tag__content']}\n >\n {hasError && !isDisabled && <IconError />}\n <span\n ref={tooltipRef as React.Ref<HTMLSpanElement>}\n className={styles['sapphire-tag__label']}\n >\n {item.rendered}\n </span>\n {!isDisabled && props.allowsRemoving && (\n <RemoveButton {...(removeButtonProps as AriaButtonProps)} />\n )}\n </div>\n </div>\n </FocusRing>\n );\n }}\n </TooltipIfNeeded>\n );\n}\n\nfunction RemoveButton(removeButtonProps: AriaButtonProps) {\n const buttonRef = useRef(null);\n const { buttonProps } = useButton(removeButtonProps, buttonRef);\n return (\n <button\n {...buttonProps}\n className={clsx(styles['sapphire-tag__button'], styles['js-focus'])}\n >\n <Icon size=\"sm\">\n <Close />\n </Icon>\n </button>\n );\n}\n\nconst IconError = () => {\n return (\n <span className={clsx(styles['sapphire-tag__error-icon'])}>\n <Icon size=\"sm\">\n <Error />\n </Icon>\n </span>\n );\n};\n"],"names":["Error2"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCO,SAAA,GAAA,CAAgB,KAAuC,EAAA;AAC5D,EAAA,aAAA,EAAA,CAAA;AACA,EAAA,MAAM,EAAE,QAAA,GAAW,KAAO,EAAA,IAAA,EAAM,KAAU,EAAA,GAAA,KAAA,CAAA;AAC1C,EAAA,MAAM,MAAM,MAAuB,CAAA,IAAA,CAAA,CAAA;AACnC,EAQI,MAAA,EAAA,GAAA,MAAA,CAAO,KAAO,EAAA,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AA,aAAA,CAAC,QAAD,EAAA,aAAA,CAAA,cAAA,CAAA,EAAA,EACM,WADN,CAAA,EAAA;AAAA,IAEE,SAAW,EAAA,IAAA,CAAK,MAAO,CAAA,sBAAA,CAAA,EAAyB,MAAO,CAAA,UAAA,CAAA,CAAA;AAAA,GAAA,CAAA,sCAEtD,IAAD,EAAA;AAAA,IAAM,IAAK,EAAA,IAAA;AAAA,GAAA,sCACR,KAAD,EAAA,IAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA;AAMR,MAAM,YAAY,MAAM;AACtB,EAAA,2CACG,MAAD,EAAA;AAAA,IAAM,SAAA,EAAW,KAAK,MAAO,CAAA,0BAAA,CAAA,CAAA;AAAA,GAAA,sCAC1B,IAAD,EAAA;AAAA,IAAM,IAAK,EAAA,IAAA;AAAA,GAAA,sCACRA,KAAD,EAAA,IAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA;;;;"}
|
package/build/esm/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { Accordion } from './Accordion/index.js';
|
|
2
2
|
export { Alert } from './Alert/src/Alert.js';
|
|
3
|
+
export { Amount } from './Amount/src/Amount.js';
|
|
3
4
|
export { Autocomplete } from './Autocomplete/src/Autocomplete.js';
|
|
4
5
|
export { Breadcrumbs } from './Breadcrumbs/src/Breadcrumbs.js';
|
|
5
6
|
export { BreadcrumbItem } from './Breadcrumbs/src/BreadcrumbItem.js';
|
package/build/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"}
|
package/build/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import React__default, { ReactNode, ReactElement, RefObject
|
|
2
|
+
import React__default, { ReactNode, Key, ReactElement, RefObject } from 'react';
|
|
3
3
|
import * as _react_types_shared from '@react-types/shared';
|
|
4
4
|
import { DOMProps, AriaLabelingProps, FocusableRefValue, PressEvents, CollectionBase, ItemProps } from '@react-types/shared';
|
|
5
5
|
import * as _danske_sapphire_react from '@danske/sapphire-react';
|
|
6
|
-
import { GlobalDomAttributes, SapphireStyleProps, TypographyHeadingProps, ListBoxProps, ButtonProps, PopoverTriggerProps, SearchFieldPropsWithRef, IconButtonProps, ThemeVariant, FieldProps } from '@danske/sapphire-react';
|
|
6
|
+
import { GlobalDomAttributes, SapphireStyleProps, TypographyHeadingProps, TypographyBodyProps, ListBoxProps, ButtonProps, PopoverTriggerProps, SearchFieldPropsWithRef, IconButtonProps, ThemeVariant, FieldProps } from '@danske/sapphire-react';
|
|
7
7
|
import { DisclosureGroupProps, DisclosureProps, DisclosurePanelProps, BreadcrumbsProps as BreadcrumbsProps$1, BreadcrumbProps, SliderProps as SliderProps$1, SliderThumbProps, TimeValue } from 'react-aria-components';
|
|
8
8
|
import { ComboBoxProps } from '@react-types/combobox';
|
|
9
9
|
import { HoverProps, FocusWithinProps } from '@react-aria/interactions';
|
|
@@ -82,7 +82,50 @@ interface SapphireAlertProps extends GlobalDomAttributes, SapphireStyleProps {
|
|
|
82
82
|
}
|
|
83
83
|
declare function Alert({ children, title, variant, ...props }: SapphireAlertProps): React__default.JSX.Element;
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
/**
|
|
86
|
+
* Format options for currency amounts.
|
|
87
|
+
* The style is always 'currency', so only currency-related options are exposed.
|
|
88
|
+
*/
|
|
89
|
+
declare type CurrencyFormatOptions = Pick<Intl.NumberFormatOptions, 'currency' | 'currencyDisplay' | 'currencySign' | 'signDisplay' | 'minimumFractionDigits' | 'maximumFractionDigits' | 'minimumSignificantDigits' | 'maximumSignificantDigits' | 'useGrouping' | 'notation'>;
|
|
90
|
+
declare type AmountProps = {
|
|
91
|
+
/**
|
|
92
|
+
* When displaying amounts, readability and visual hierarchy are key. Use medium weight for primary emphasis to highlight amounts or regular weight for secondary emphasis.
|
|
93
|
+
*
|
|
94
|
+
* @default 'regular'
|
|
95
|
+
*/
|
|
96
|
+
emphasis?: 'primary' | 'regular';
|
|
97
|
+
/**
|
|
98
|
+
* The variant of the Amount component. `positive` shows a green color, and should be used for amounts greater than zero.
|
|
99
|
+
*
|
|
100
|
+
* @default 'neutal'
|
|
101
|
+
*/
|
|
102
|
+
variant?: 'neutal' | 'positive';
|
|
103
|
+
/**
|
|
104
|
+
* The amount value to be formatted and displayed.
|
|
105
|
+
*
|
|
106
|
+
* If displaying the sign is a requirement, ensure the value is a string that starts with '+' or '-'.
|
|
107
|
+
* Alternatively, you can use the `signDisplay` option in `formatOptions` to control the display of the sign for numeric values.
|
|
108
|
+
*/
|
|
109
|
+
value: string | number;
|
|
110
|
+
/** Currency formatting options */
|
|
111
|
+
formatOptions?: CurrencyFormatOptions;
|
|
112
|
+
} & Pick<TypographyBodyProps, 'size'> & SapphireStyleProps & GlobalDomAttributes;
|
|
113
|
+
declare const Amount: ({ emphasis, variant, formatOptions, value, size, ...props }: AmountProps) => JSX.Element;
|
|
114
|
+
|
|
115
|
+
declare type AutocompleteProps<T extends object> = GlobalDomAttributes & SapphireStyleProps & Pick<ComboBoxProps<T>, 'items' | 'children' | 'inputValue' | 'defaultInputValue' | 'onInputChange' | 'isDisabled'> & Pick<ListBoxProps<T>, 'loadingState' | 'loadingSkeletonRowsCount'> & {
|
|
116
|
+
/**
|
|
117
|
+
* This prop is badly named. It is NOT related to a selection state being
|
|
118
|
+
* changed since there is no selection state in this component.
|
|
119
|
+
*
|
|
120
|
+
* This callback simply notifies you when the user filled in the text field
|
|
121
|
+
* by selecting an option from the autocomplete dropdown. Similar to an
|
|
122
|
+
* onClick.
|
|
123
|
+
*
|
|
124
|
+
* @deprecated
|
|
125
|
+
* Use `onSuggestionSelected` instead.
|
|
126
|
+
*/
|
|
127
|
+
onSelectionChange?: Pick<ComboBoxProps<T>, 'onSelectionChange'>['onSelectionChange'];
|
|
128
|
+
onSuggestionSelected?: (key: Key) => void;
|
|
86
129
|
/**
|
|
87
130
|
* Render function for the input element.
|
|
88
131
|
* Receives props that should be spread onto the input component.
|
|
@@ -230,6 +273,10 @@ interface FilterDropdownProps extends GlobalDomAttributes, SapphireStyleProps, P
|
|
|
230
273
|
* Whether the 'Apply' button is disabled.
|
|
231
274
|
*/
|
|
232
275
|
isApplyDisabled?: boolean;
|
|
276
|
+
/**
|
|
277
|
+
* Whether the 'Clear' button is hidden.
|
|
278
|
+
*/
|
|
279
|
+
hideClearButton?: boolean;
|
|
233
280
|
/**
|
|
234
281
|
* Whether the 'Clear' button is disabled.
|
|
235
282
|
*/
|
|
@@ -253,7 +300,7 @@ interface FilterDropdownProps extends GlobalDomAttributes, SapphireStyleProps, P
|
|
|
253
300
|
/**
|
|
254
301
|
* A button with a dropdown, used for filtering UI.
|
|
255
302
|
*/
|
|
256
|
-
declare function FilterDropdown({ children, label, value, isDisabled, isApplyDisabled, isClearDisabled, isOpen: isOpenProp, applyButtonLabel, clearButtonLabel, defaultOpen, hasApplyButton, noMaxWidth, onApply, onClear, onOpenChange, buttonSize, ...props }: FilterDropdownProps): JSX.Element;
|
|
303
|
+
declare function FilterDropdown({ children, label, value, isDisabled, isApplyDisabled, isClearDisabled, isOpen: isOpenProp, applyButtonLabel, clearButtonLabel, hideClearButton, defaultOpen, hasApplyButton, noMaxWidth, onApply, onClear, onOpenChange, buttonSize, ...props }: FilterDropdownProps): JSX.Element;
|
|
257
304
|
|
|
258
305
|
interface SearchableSelectFilterProps extends GlobalDomAttributes, SapphireStyleProps, Omit<FilterDropdownProps, 'children'> {
|
|
259
306
|
/**
|
|
@@ -345,8 +392,20 @@ declare type NumberFieldRef = FocusableRefValue<HTMLInputElement, HTMLDivElement
|
|
|
345
392
|
getInputElement(): HTMLInputElement | null;
|
|
346
393
|
};
|
|
347
394
|
interface NumberFieldProps extends SapphireNumberFieldProps, PressEvents, SapphireStyleProps, GlobalDomAttributes {
|
|
348
|
-
|
|
349
|
-
|
|
395
|
+
/**
|
|
396
|
+
* A string or element to show before / after the input value.
|
|
397
|
+
*
|
|
398
|
+
* By default (`'auto'`), the component will automatically extract currency/unit symbols
|
|
399
|
+
* from the locale formatter and display them as prefix/postfix.
|
|
400
|
+
* If you provide a custom prefix or postfix, those will be used instead and
|
|
401
|
+
* the extracted symbols will be ignored.
|
|
402
|
+
*
|
|
403
|
+
* @default 'auto' - automatically extracts currency/unit symbols from locale formatter
|
|
404
|
+
*/
|
|
405
|
+
affix?: 'auto' | {
|
|
406
|
+
prefix?: ReactNode;
|
|
407
|
+
postfix?: ReactNode;
|
|
408
|
+
};
|
|
350
409
|
inputRef?: RefObject<HTMLInputElement | null>;
|
|
351
410
|
/**
|
|
352
411
|
* A note to show below the input.
|
|
@@ -380,6 +439,12 @@ interface NumberFieldProps extends SapphireNumberFieldProps, PressEvents, Sapphi
|
|
|
380
439
|
* @default false
|
|
381
440
|
*/
|
|
382
441
|
showButtons?: boolean;
|
|
442
|
+
/**
|
|
443
|
+
* Enables automatic formatting of the input value as the user types, based on the provided formatter and affix.
|
|
444
|
+
*
|
|
445
|
+
* @default false
|
|
446
|
+
*/
|
|
447
|
+
autoFormat?: boolean;
|
|
383
448
|
}
|
|
384
449
|
declare const NumberField: React__default.ForwardRefExoticComponent<NumberFieldProps & React__default.RefAttributes<NumberFieldRef>>;
|
|
385
450
|
|
|
@@ -726,4 +791,4 @@ declare const TimeField: <T extends TimeValue>(props: Pick<AriaTimeFieldProps<T>
|
|
|
726
791
|
ref?: React__default.RefObject<HTMLDivElement> | undefined;
|
|
727
792
|
}) => React__default.ReactElement;
|
|
728
793
|
|
|
729
|
-
export { _Accordion as Accordion, AccordionContext, AccordionHeadingProps, AccordionItemProps, AccordionPanelProps, AccordionProps, Alert, Autocomplete, AutocompleteProps, BreadcrumbItem, BreadcrumbItemProps, Breadcrumbs, BreadcrumbsProps, FileDropzone, FileDropzoneProps, FileTrigger, FileTriggerProps, FilterDropdown, FilterDropdownProps, Flag, FlagProps, LabeledValue, NumberField, NumberFieldProps, NumberFieldRef, ProgressIndicator, ProgressIndicatorProps, SapphireAlertProps, SearchableSelectFilter, SearchableSelectFilterProps, _Sidebar as Sidebar, SidebarBodyProps, SidebarExpandableItemProps, SidebarHeaderProps, SidebarItemProps, SidebarListProps, SidebarProps, SidebarSectionProps, _Slider as Slider, SliderProps, TagGroup, TagGroupProps, TagItem, TimeField, TimeFieldProps };
|
|
794
|
+
export { _Accordion as Accordion, AccordionContext, AccordionHeadingProps, AccordionItemProps, AccordionPanelProps, AccordionProps, Alert, Amount, AmountProps, Autocomplete, AutocompleteProps, BreadcrumbItem, BreadcrumbItemProps, Breadcrumbs, BreadcrumbsProps, FileDropzone, FileDropzoneProps, FileTrigger, FileTriggerProps, FilterDropdown, FilterDropdownProps, Flag, FlagProps, LabeledValue, NumberField, NumberFieldProps, NumberFieldRef, ProgressIndicator, ProgressIndicatorProps, SapphireAlertProps, SearchableSelectFilter, SearchableSelectFilterProps, _Sidebar as Sidebar, SidebarBodyProps, SidebarExpandableItemProps, SidebarHeaderProps, SidebarItemProps, SidebarListProps, SidebarProps, SidebarSectionProps, _Slider as Slider, SliderProps, TagGroup, TagGroupProps, TagItem, TimeField, TimeFieldProps };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@danske/sapphire-react-lab",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.105.2",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"description": "Experimental React components of the Sapphire Design System from Danske Bank A/S",
|
|
6
6
|
"exports": {
|
|
@@ -19,59 +19,59 @@
|
|
|
19
19
|
],
|
|
20
20
|
"scripts": {
|
|
21
21
|
"build": "cross-env ../../node_modules/.bin/rollup --config ../../rollup.config.js",
|
|
22
|
-
"postpublish": "
|
|
22
|
+
"postpublish": "node ../../../scripts/append-release-notes.js",
|
|
23
23
|
"prepare": "yarn run build",
|
|
24
24
|
"prepublishOnly": "yarn run build"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"@danske/sapphire-icons": "^3.1.0",
|
|
28
|
-
"@danske/sapphire-react": "^5.
|
|
28
|
+
"@danske/sapphire-react": "^5.12.0",
|
|
29
29
|
"react": ">=16.8.0",
|
|
30
30
|
"react-dom": ">=16.8.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@danske/sapphire-icons": "^3.1.0",
|
|
34
|
-
"@danske/sapphire-react": "^5.
|
|
34
|
+
"@danske/sapphire-react": "^5.13.0",
|
|
35
35
|
"@types/react-transition-group": "^4.4.5",
|
|
36
36
|
"cross-env": "^7.0.3"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@danske/sapphire-css": "^
|
|
40
|
-
"@internationalized/date": "^3.
|
|
39
|
+
"@danske/sapphire-css": "^50.1.0",
|
|
40
|
+
"@internationalized/date": "^3.11.0",
|
|
41
41
|
"@internationalized/string": "^3.2.7",
|
|
42
|
-
"@react-aria/breadcrumbs": "^3.5.
|
|
43
|
-
"@react-aria/button": "^3.14.
|
|
44
|
-
"@react-aria/collections": "^3.0.
|
|
45
|
-
"@react-aria/combobox": "^3.14.
|
|
46
|
-
"@react-aria/datepicker": "^3.
|
|
47
|
-
"@react-aria/dialog": "^3.5.
|
|
48
|
-
"@react-aria/dnd": "^3.11.
|
|
49
|
-
"@react-aria/focus": "^3.21.
|
|
50
|
-
"@react-aria/i18n": "^3.12.
|
|
51
|
-
"@react-aria/interactions": "^3.
|
|
52
|
-
"@react-aria/label": "^3.7.
|
|
53
|
-
"@react-aria/listbox": "^3.15.
|
|
54
|
-
"@react-aria/numberfield": "^3.12.
|
|
55
|
-
"@react-aria/overlays": "^3.31.
|
|
56
|
-
"@react-aria/progress": "^3.4.
|
|
57
|
-
"@react-aria/tag": "^3.
|
|
58
|
-
"@react-aria/utils": "^3.
|
|
59
|
-
"@react-aria/visually-hidden": "^3.8.
|
|
42
|
+
"@react-aria/breadcrumbs": "^3.5.31",
|
|
43
|
+
"@react-aria/button": "^3.14.4",
|
|
44
|
+
"@react-aria/collections": "^3.0.2",
|
|
45
|
+
"@react-aria/combobox": "^3.14.2",
|
|
46
|
+
"@react-aria/datepicker": "^3.16.0",
|
|
47
|
+
"@react-aria/dialog": "^3.5.33",
|
|
48
|
+
"@react-aria/dnd": "^3.11.5",
|
|
49
|
+
"@react-aria/focus": "^3.21.4",
|
|
50
|
+
"@react-aria/i18n": "^3.12.15",
|
|
51
|
+
"@react-aria/interactions": "^3.27.0",
|
|
52
|
+
"@react-aria/label": "^3.7.24",
|
|
53
|
+
"@react-aria/listbox": "^3.15.2",
|
|
54
|
+
"@react-aria/numberfield": "^3.12.4",
|
|
55
|
+
"@react-aria/overlays": "^3.31.1",
|
|
56
|
+
"@react-aria/progress": "^3.4.29",
|
|
57
|
+
"@react-aria/tag": "^3.8.0",
|
|
58
|
+
"@react-aria/utils": "^3.33.0",
|
|
59
|
+
"@react-aria/visually-hidden": "^3.8.30",
|
|
60
60
|
"@react-spectrum/utils": "^3.12.5",
|
|
61
|
-
"@react-stately/collections": "^3.12.
|
|
62
|
-
"@react-stately/combobox": "^3.12.
|
|
63
|
-
"@react-stately/datepicker": "^3.
|
|
64
|
-
"@react-stately/list": "^3.13.
|
|
65
|
-
"@react-stately/numberfield": "^3.10.
|
|
66
|
-
"@react-stately/overlays": "^3.6.
|
|
67
|
-
"@react-stately/toggle": "^3.9.
|
|
68
|
-
"@react-stately/tree": "^3.9.
|
|
61
|
+
"@react-stately/collections": "^3.12.9",
|
|
62
|
+
"@react-stately/combobox": "^3.12.2",
|
|
63
|
+
"@react-stately/datepicker": "^3.16.0",
|
|
64
|
+
"@react-stately/list": "^3.13.3",
|
|
65
|
+
"@react-stately/numberfield": "^3.10.4",
|
|
66
|
+
"@react-stately/overlays": "^3.6.22",
|
|
67
|
+
"@react-stately/toggle": "^3.9.4",
|
|
68
|
+
"@react-stately/tree": "^3.9.5",
|
|
69
69
|
"@react-stately/utils": "^3.11.0",
|
|
70
|
-
"@react-types/dialog": "^3.5.
|
|
71
|
-
"@react-types/shared": "^3.
|
|
70
|
+
"@react-types/dialog": "^3.5.23",
|
|
71
|
+
"@react-types/shared": "^3.33.0",
|
|
72
72
|
"clsx": "^1.1.1",
|
|
73
|
-
"react-aria-components": "^1.
|
|
73
|
+
"react-aria-components": "^1.15.1",
|
|
74
74
|
"react-transition-group": "^4.4.5"
|
|
75
75
|
},
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "16211b81aadc435461763b838c77f4951e9dad50"
|
|
77
77
|
}
|