@norges-domstoler/dds-components 22.5.0 → 22.6.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.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { Dispatch, SetStateAction, RefObject, ReactNode, ComponentPropsWithRef, ElementType, CSSProperties, Ref, ComponentPropsWithoutRef, HTMLAttributes, SVGAttributes, JSX, ButtonHTMLAttributes, ComponentProps, InputHTMLAttributes, MouseEventHandler, DependencyList, RefCallback, ChangeEvent, KeyboardEvent as KeyboardEvent$1, AnchorHTMLAttributes, LabelHTMLAttributes, AriaRole, FocusEvent, ForwardedRef, ForwardRefExoticComponent, MouseEvent as MouseEvent$1, ReactElement } from 'react';
2
+ import { Dispatch, SetStateAction, RefObject, ReactNode, ComponentPropsWithRef, HTMLAttributes, Ref, CSSProperties, ElementType, ComponentPropsWithoutRef, SVGAttributes, JSX, ButtonHTMLAttributes, ComponentProps, InputHTMLAttributes, MouseEventHandler, DependencyList, RefCallback, ChangeEvent, KeyboardEvent as KeyboardEvent$1, AnchorHTMLAttributes, LabelHTMLAttributes, AriaRole, FocusEvent, ForwardedRef, ForwardRefExoticComponent, MouseEvent as MouseEvent$1, ReactElement } from 'react';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as CSS from 'csstype';
5
5
  import { Property, StandardProperties } from 'csstype';
@@ -4246,6 +4246,12 @@ interface RemoteFile {
4246
4246
  url: string;
4247
4247
  }
4248
4248
  type FileList = Array<File | RemoteFile>;
4249
+ type UploadStatus = 'uploading' | 'success' | 'error';
4250
+ interface UploadInfo {
4251
+ uploadStatus?: UploadStatus;
4252
+ errorMessage?: string;
4253
+ }
4254
+ type FileStatusMap = Map<string, UploadInfo>;
4249
4255
 
4250
4256
  type FileUploaderHookProps = {
4251
4257
  /**Dersom komponenten skal styres internt. Utgangspunktet for filene som har blitt lastet opp. */
@@ -4286,6 +4292,14 @@ type FileUploaderProps = {
4286
4292
  withDragAndDrop?: boolean;
4287
4293
  /**Om listen med opplastede filer skal skjules. Brukes kun hvis listen blir vist på egen måte. */
4288
4294
  hideFileList?: boolean;
4295
+ /** Map som lar konsumenten styre info om opplasting på hver fil: status og feilmelding. Bruker `deriveId` prop som nøkkel. Statusinfo vises i fillisten. */
4296
+ fileStatusMap?: Map<string, UploadInfo>;
4297
+ /** Funksjon som genererer en ID for hver fil. Brukes som nøkkel i `fileStatusMap` prop for å kunne mappe status på opplasting av hver fil og vise det i fillisten. */
4298
+ deriveId?: (file: File | RemoteFile) => string;
4299
+ /**
4300
+ * Funksjon som lar brukeren prøve å laste opp en fil på nytt ved opplastlingfeil. Brukes sammen med `deriveId` og `fileStatusMap` props.
4301
+ */
4302
+ onRetry?: (fileId: string) => void;
4289
4303
  } & Pick<ResponsiveProps, 'width'> & Partial<FileUploaderHookProps> & Omit<ComponentPropsWithRef<'div'>, 'onChange' | 'id'> & Pick<InputProps, 'tip' | 'label' | 'afterLabelContent'>;
4290
4304
  declare const FileUploader: {
4291
4305
  (props: FileUploaderProps): react_jsx_runtime.JSX.Element;
@@ -5489,4 +5503,4 @@ declare const VisuallyHidden: {
5489
5503
  displayName: string;
5490
5504
  };
5491
5505
 
5492
- export { Accordion, AccordionBody, type AccordionBodyProps, type AccordionConfig, AccordionContextProvider, AccordionHeader, type AccordionHeaderProps, type AccordionProps, type AccordionState, AddTabButton, type AddTabButtonProps, AddressShieldedIcon, AgreementIcon, AnimatedChevronUpDownIcon, type AnimatedChevronUpDownIconStates, AppsIcon, ArchiveIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon, AttachmentIcon, BORDER_COLORS, BORDER_RADII, BackLink, type BackLinkProps, Backdrop, BarChartBoxedIcon, BarChartIcon, type BaseComponentProps, type BaseComponentPropsWithChildren, type BaseItemProps, type BaseLabelProps, type BaseTypographyProps, BlockIcon, BookIcon, type BorderColor, type BorderRadius, Box, type BoxProps, Breadcrumb, type BreadcrumbProps, Breadcrumbs, type BreadcrumbsProps, type Breakpoint, BriefcaseIcon, BuildIcon, BuildingIcon, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, type ButtonPurpose, type ButtonSize, Calendar, CalendarIcon, CalendarMonthIcon, type CalendarProps, CalendarViewDayIcon, CalendarViewMonthIcon, CalendarViewWeekIcon, CallIcon, type Callback, Caption, type CaptionProps, Card, CardExpandable, CardExpandableBody, type CardExpandableBodyProps, CardExpandableHeader, type CardExpandableHeaderProps, type CardExpandableProps, type CardProps, CardSelectable, CardSelectableGroup, type CardSelectableGroupProps, type CardSelectableProps, CaringIcon, ChatIcon, CheckCircledIcon, CheckIcon, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxPickedHTMLAttributes, type CheckboxProps, ChecklistIcon, ChevronDownIcon, ChevronFirstIcon, ChevronLastIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, Chip, ChipGroup, type ChipGroupProps, type ChipProps, CircleFilledIcon, CircleIcon, CloseCircledIcon, CloseIcon, CloseSmallIcon, CloudIcon, CollapseIcon, CollapsibleTable, type CollapsibleTableProps, CollapsibleRow as CollapsibleTableRow, type ColumnsOccupied, CommentIcon, Contrast, type ContrastProps, CookieBanner, CookieBannerCheckbox, type CookieBannerCheckboxProps, type CookieBannerProps, CopyIcon, CourtIcon, DETAIL_LIST_SIZES, DatePicker, type DatePickerProps, DateRangeIcon, DdsProvider, type DdsProviderProps, type DdsTheme, DeathsIcon, DescriptionList, type DescriptionListAppearance, DescriptionListDesc, type DescriptionListDescProps, DescriptionListGroup, type DescriptionListGroupProps, type DescriptionListProps, DescriptionListTerm, type DescriptionListTermProps, DetailList, DetailListDesc, type DetailListDescProps, type DetailListProps, DetailListRow, type DetailListRowProps, type DetailListSize, DetailListTerm, type DetailListTermProps, type Direction$1 as Direction, Divider, type DividerColor, type DividerProps, DoubleChevronLeftIcon, DoubleChevronRightIcon, DownloadDoneIcon, DownloadIcon, DragHandleIcon, Drawer, DrawerGroup, type DrawerGroupProps, type DrawerPlacement, type DrawerProps, type DrawerSize, DropdownHeader, DropdownItem, type DropdownItemButtonProps, type DropdownItemCustomProps, type DropdownItemProps, ELEVATIONS, EditAltIcon, EditIcon, ElementAs, type Elevation, EmptyContent, type EmptyContentProps, ErrorIcon, ErrorSummary, ErrorSummaryItem, type ErrorSummaryItemProps, type ErrorSummaryProps, ExclaimIcon, ExpandIcon, type ExtractStrict, FacebookIcon, FamilyIcon, FavStar, type FavStarProps, Feedback, FeedbackIcon, type FeedbackProps, Fieldset, FieldsetGroup, type FieldsetGroupProps, type FieldsetProps, FileAddIcon, FileIcon, type FileList, FileShieldedIcon, FileTextIcon, FileUploader, type FileUploaderAccept, type FileUploaderProps, FilterIcon, FilterListIcon, FindInPageIcon, FlagFilledIcon, FlagIcon, FlickrIcon, type FloatingStyles, FloppyDiskIcon, FolderAddIcon, FolderIcon, FolderShieldedIcon, Footer, FooterLeft, type FooterLeftProps, FooterList, FooterListGroup, type FooterListGroupProps, FooterListHeader, type FooterListHeaderProps, type FooterListProps, FooterLogo, type FooterLogoProps, type FooterProps, FooterSocialsGroup, type FooterSocialsGroupProps, FooterSocialsList, type FooterSocialsListProps, FormSummary, FormSummaryEditButton, FormSummaryEmptyValue, FormSummaryError, FormSummaryField, FormSummaryFields, FormSummaryHeader, FormSummaryHeading, FormSummaryLabel, type FormSummaryProps, FormSummaryValue, FullscreenExitIcon, FullscreenIcon, GavelIcon, GlobalMessage, type GlobalMessageProps, type GlobalMessagePurpose, Grid, GridChild, type GridChildProps, type GridProps, GroupIcon, GuardianIcon, HStack, type HStackProps, Heading, type HeadingLevel, type HeadingProps, HelpFilledIcon, HelpIcon, HelpSimpleIcon, HiddenInput, HomeIcon, HourglassEmptyIcon, type HyphenTypographyType, Icon, type IconPosition, type IconProps, type IconSize, ImageIcon, InfoIcon, InlineButton, type InlineButtonProps, InlineEditInput, type InlineEditInputProps, InlineEditSelect, type InlineEditSelectProps, InlineEditTextArea, type InlineEditTextAreaProps, type InlineElement, InputMessage, type InputMessageProps, type InputMessageType, InstagramIcon, InternalHeader, type InternalHeaderProps, JordskifterettIcon, JordskiftesakIcon, KeyIcon, L_MESSAGE_PURPOSES, Label, type LabelProps, LagmannsrettIcon, LanguageIcon, type Layout, Legend, type LegendProps, LineChartIcon, Link, LinkIcon, LinkOffIcon, type LinkProps, LinkedInIcon, List, ListAltIcon, ListIcon, ListItem, type ListItemProps, type ListProps, type ListType, type ListTypographyType, LocalMessage, type LocalMessageLayout, type LocalMessageProps, type LocalMessagePurpose, LocationIcon, LocationOffIcon, LockFilledIcon, LockIcon, LockOpenIcon, LoginIcon, LogoutIcon, MailIcon, MailOpenIcon, MapIcon, MenuIcon, MinusCircledIcon, MinusIcon, Modal, ModalActions, type ModalActionsProps, ModalBody, type ModalBodyProps, type ModalProps, MoonIcon, MoreHorizontalIcon, MoreVerticalIcon, NativeSelect, type NativeSelectProps, NotarialIcon, NotebookPenIcon, NotificationsIcon, NotificationsOffIcon, type Nullable, OnlineMeetingIcon, OpenExternalIcon, type OtherTypographyType, OverflowMenu, OverflowMenuButton, type OverflowMenuButtonProps, OverflowMenuDivider, OverflowMenuGroup, type OverflowMenuGroupProps, OverflowMenuLink, type OverflowMenuLinkProps, OverflowMenuList, OverflowMenuListHeader, type OverflowMenuProps, OverflowMenuSpan, type OverflowMenuSpanProps, OverflowMenuToggle, type OverflowMenuToggleProps, Pagination, type PaginationOption, type PaginationProps, PanelLeftIcon, Paper, type PaperBackground, type PaperBorder, type PaperBorderRadius, type PaperElevation, PaperPlaneIcon, type PaperProps, Paragraph, type ParagraphProps, PayoutIcon, PdfIcon, PersonAddIcon, PersonIcon, PersonShieldedIcon, PhoneInput, type PhoneInputProps, type PhoneInputValue, PinIcon, type Placement, PlusCircledIcon, PlusIcon, type PolymorphicBaseComponentProps, type PolymorphicProps, Popover, PopoverGroup, type PopoverGroupProps, type PopoverProps, type PopoverSizeProps, PowerOfAttorneyIcon, PrintIcon, ProgressBar, type ProgressBarProps, type ProgressBarSize, ProgressTracker, ProgressTrackerItem, type ProgressTrackerItemProps, type ProgressTrackerProps, PublishIcon, type Purpose, QuestionAnswerIcon, RadioButton, RadioButtonGroup, type RadioButtonGroupProps, type RadioButtonProps, type RadioValue, type Rating, ReceiptIcon, RedoIcon, RefreshIcon, type RemoteFile, ReplayIcon, type ResponsiveProps, type ResponsiveStackProps, RowsIcon, ScaleIcon, ScreenSize, Search, SearchAutocompleteWrapper, type SearchAutocompleteWrapperProps, type SearchButtonProps, type SearchData, SearchIcon, type SearchProps, type SearchSize, SearchSuggestions, type SearchSuggestionsProps, SectionIcon, Select, type SelectForwardRefType, type SelectOption, type SelectProps, SettingsIcon, ShowHide, type ShowHideProps, type Size, Skeleton, type SkeletonAppearance, type SkeletonProps, SkipToContent, type SkipToContentProps, SmsIcon, type SortOrder, type SpacingScale, Spinner, type SpinnerProps, SplitButton, type SplitButtonPrimaryActionProps, type SplitButtonProps, type SplitButtonPurpose, type SplitButtonSecondaryActionsProps, StarFilledIcon, StarHalfFilledIcon, StarIcon, type StaticTypographyType, StickyNoteIcon, StylelessButton, type StylelessButtonProps, StylelessList, type StylelessListProps, StylelessOList, type StylelessOListProps, SunIcon, SupportIcon, type SvgIcon, type SvgProps, SyncIcon, Tab, TabList, type TabListProps, TabPanel, type TabPanelProps, TabPanels, type TabPanelsProps, type TabProps, type TabSize, Table, Body as TableBody, type TableBodyProps, Cell as TableCell, type TableCellLayout, type TableCellProps, type TableCellType, Foot as TableFoot, type TableFootProps, Head as TableHead, type TableHeadProps, type TableProps, Row as TableRow, type TableRowProps, type TableRowType, type TableSize, SortCell as TableSortCell, type TableSortCellProps, TableWrapper, Tabs, type TabsProps, Tag, type TagAppearance, type TagProps, type TagPurpose, type TextAffixProps, TextArea, type TextAreaProps, TextInput, type TextInputProps, TextOverflowEllipsisInner, TextOverflowEllipsisWrapper, ThumbDownFilledIcon, ThumbDownIcon, ThumbUpFilledIcon, ThumbUpIcon, TimeIcon, TimePicker, type TimePickerProps, TingrettIcon, TipIcon, Toggle, ToggleBar, type ToggleBarProps, type ToggleBarSize, type ToggleBarValue, ToggleButton, ToggleButtonGroup, type ToggleButtonGroupProps, type ToggleButtonProps, type ToggleProps, ToggleRadio, type ToggleRadioProps, type ToggleSize, Tooltip, type TooltipProps, TrashIcon, TrendingDownIcon, TrendingUpIcon, Typography, type TypographyAnchorType, type TypographyBodyLongType, type TypographyBodyShortType, type TypographyBodyType, type TypographyComponentProps, type TypographyHeadingType, type TypographyLabelType, type TypographyLeadType, type TypographyProps, type TypographyType, UndoIcon, UnfoldLessIcon, UnfoldMoreIcon, UploadIcon, type UseAccordionBodyProps, type UseAccordionHeaderProps, type UseControllableGroupStateProps, type UseControllableStateProps, type UseFloatPositionOptions, VStack, type VStackProps, VisibilityOffIcon, VisibilityOnIcon, VisuallyHidden, type VisuallyHiddenProps, WarningIcon, WebexIcon, type WeightedSearchData, type WithRequiredIf, XIcon, ZoomInIcon, ZoomOutIcon, calendarDateToNativeDate, cn, countryOptions, createPurposes, createSelectOptions, createSizes, dateValueToNativeDate, focusVisible, focusVisibleInset, focusVisibleTransitionValue, getBaseHTMLProps, getColorCn, getElementType, getLiteralScreenSize, getTypographyCn, handleElementWithBackdropMount, handleElementWithBackdropUnmount, hideInput, index as icons, inheritLinkStyling, inlineElements, isAnchorTypographyProps, isBorderColor, isBorderRadius, isCaption, isElevation, isHeading, isInlineElement, isKeyboardEvent, isLegend, isPaperBackground, nativeDateToCalendarDate, nativeDateToDateValue, nativeDateToTime, normalizeButton, outlineInset, outlineOffset, removeButtonStyling, removeListStyling, renderInputMessage, scrollbarStyling, typographyTypes, useAccordion, useAccordionContext, useCallbackRef, useCombinedRef, useControllableGroupState, useControllableState, useFloatPosition, useFocusTrap, useIsMounted, useMountTransition, useOnClickOutside, useOnKeyDown, useReturnFocusOnBlur, useRoveFocus, useScreenSize, useTheme, useWindowResize };
5506
+ export { Accordion, AccordionBody, type AccordionBodyProps, type AccordionConfig, AccordionContextProvider, AccordionHeader, type AccordionHeaderProps, type AccordionProps, type AccordionState, AddTabButton, type AddTabButtonProps, AddressShieldedIcon, AgreementIcon, AnimatedChevronUpDownIcon, type AnimatedChevronUpDownIconStates, AppsIcon, ArchiveIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon, AttachmentIcon, BORDER_COLORS, BORDER_RADII, BackLink, type BackLinkProps, Backdrop, BarChartBoxedIcon, BarChartIcon, type BaseComponentProps, type BaseComponentPropsWithChildren, type BaseItemProps, type BaseLabelProps, type BaseTypographyProps, BlockIcon, BookIcon, type BorderColor, type BorderRadius, Box, type BoxProps, Breadcrumb, type BreadcrumbProps, Breadcrumbs, type BreadcrumbsProps, type Breakpoint, BriefcaseIcon, BuildIcon, BuildingIcon, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, type ButtonPurpose, type ButtonSize, Calendar, CalendarIcon, CalendarMonthIcon, type CalendarProps, CalendarViewDayIcon, CalendarViewMonthIcon, CalendarViewWeekIcon, CallIcon, type Callback, Caption, type CaptionProps, Card, CardExpandable, CardExpandableBody, type CardExpandableBodyProps, CardExpandableHeader, type CardExpandableHeaderProps, type CardExpandableProps, type CardProps, CardSelectable, CardSelectableGroup, type CardSelectableGroupProps, type CardSelectableProps, CaringIcon, ChatIcon, CheckCircledIcon, CheckIcon, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxPickedHTMLAttributes, type CheckboxProps, ChecklistIcon, ChevronDownIcon, ChevronFirstIcon, ChevronLastIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, Chip, ChipGroup, type ChipGroupProps, type ChipProps, CircleFilledIcon, CircleIcon, CloseCircledIcon, CloseIcon, CloseSmallIcon, CloudIcon, CollapseIcon, CollapsibleTable, type CollapsibleTableProps, CollapsibleRow as CollapsibleTableRow, type ColumnsOccupied, CommentIcon, Contrast, type ContrastProps, CookieBanner, CookieBannerCheckbox, type CookieBannerCheckboxProps, type CookieBannerProps, CopyIcon, CourtIcon, DETAIL_LIST_SIZES, DatePicker, type DatePickerProps, DateRangeIcon, DdsProvider, type DdsProviderProps, type DdsTheme, DeathsIcon, DescriptionList, type DescriptionListAppearance, DescriptionListDesc, type DescriptionListDescProps, DescriptionListGroup, type DescriptionListGroupProps, type DescriptionListProps, DescriptionListTerm, type DescriptionListTermProps, DetailList, DetailListDesc, type DetailListDescProps, type DetailListProps, DetailListRow, type DetailListRowProps, type DetailListSize, DetailListTerm, type DetailListTermProps, type Direction$1 as Direction, Divider, type DividerColor, type DividerProps, DoubleChevronLeftIcon, DoubleChevronRightIcon, DownloadDoneIcon, DownloadIcon, DragHandleIcon, Drawer, DrawerGroup, type DrawerGroupProps, type DrawerPlacement, type DrawerProps, type DrawerSize, DropdownHeader, DropdownItem, type DropdownItemButtonProps, type DropdownItemCustomProps, type DropdownItemProps, ELEVATIONS, EditAltIcon, EditIcon, ElementAs, type Elevation, EmptyContent, type EmptyContentProps, ErrorIcon, ErrorSummary, ErrorSummaryItem, type ErrorSummaryItemProps, type ErrorSummaryProps, ExclaimIcon, ExpandIcon, type ExtractStrict, FacebookIcon, FamilyIcon, FavStar, type FavStarProps, Feedback, FeedbackIcon, type FeedbackProps, Fieldset, FieldsetGroup, type FieldsetGroupProps, type FieldsetProps, FileAddIcon, FileIcon, type FileList, FileShieldedIcon, type FileStatusMap, FileTextIcon, FileUploader, type FileUploaderAccept, type FileUploaderProps, FilterIcon, FilterListIcon, FindInPageIcon, FlagFilledIcon, FlagIcon, FlickrIcon, type FloatingStyles, FloppyDiskIcon, FolderAddIcon, FolderIcon, FolderShieldedIcon, Footer, FooterLeft, type FooterLeftProps, FooterList, FooterListGroup, type FooterListGroupProps, FooterListHeader, type FooterListHeaderProps, type FooterListProps, FooterLogo, type FooterLogoProps, type FooterProps, FooterSocialsGroup, type FooterSocialsGroupProps, FooterSocialsList, type FooterSocialsListProps, FormSummary, FormSummaryEditButton, FormSummaryEmptyValue, FormSummaryError, FormSummaryField, FormSummaryFields, FormSummaryHeader, FormSummaryHeading, FormSummaryLabel, type FormSummaryProps, FormSummaryValue, FullscreenExitIcon, FullscreenIcon, GavelIcon, GlobalMessage, type GlobalMessageProps, type GlobalMessagePurpose, Grid, GridChild, type GridChildProps, type GridProps, GroupIcon, GuardianIcon, HStack, type HStackProps, Heading, type HeadingLevel, type HeadingProps, HelpFilledIcon, HelpIcon, HelpSimpleIcon, HiddenInput, HomeIcon, HourglassEmptyIcon, type HyphenTypographyType, Icon, type IconPosition, type IconProps, type IconSize, ImageIcon, InfoIcon, InlineButton, type InlineButtonProps, InlineEditInput, type InlineEditInputProps, InlineEditSelect, type InlineEditSelectProps, InlineEditTextArea, type InlineEditTextAreaProps, type InlineElement, InputMessage, type InputMessageProps, type InputMessageType, InstagramIcon, InternalHeader, type InternalHeaderProps, JordskifterettIcon, JordskiftesakIcon, KeyIcon, L_MESSAGE_PURPOSES, Label, type LabelProps, LagmannsrettIcon, LanguageIcon, type Layout, Legend, type LegendProps, LineChartIcon, Link, LinkIcon, LinkOffIcon, type LinkProps, LinkedInIcon, List, ListAltIcon, ListIcon, ListItem, type ListItemProps, type ListProps, type ListType, type ListTypographyType, LocalMessage, type LocalMessageLayout, type LocalMessageProps, type LocalMessagePurpose, LocationIcon, LocationOffIcon, LockFilledIcon, LockIcon, LockOpenIcon, LoginIcon, LogoutIcon, MailIcon, MailOpenIcon, MapIcon, MenuIcon, MinusCircledIcon, MinusIcon, Modal, ModalActions, type ModalActionsProps, ModalBody, type ModalBodyProps, type ModalProps, MoonIcon, MoreHorizontalIcon, MoreVerticalIcon, NativeSelect, type NativeSelectProps, NotarialIcon, NotebookPenIcon, NotificationsIcon, NotificationsOffIcon, type Nullable, OnlineMeetingIcon, OpenExternalIcon, type OtherTypographyType, OverflowMenu, OverflowMenuButton, type OverflowMenuButtonProps, OverflowMenuDivider, OverflowMenuGroup, type OverflowMenuGroupProps, OverflowMenuLink, type OverflowMenuLinkProps, OverflowMenuList, OverflowMenuListHeader, type OverflowMenuProps, OverflowMenuSpan, type OverflowMenuSpanProps, OverflowMenuToggle, type OverflowMenuToggleProps, Pagination, type PaginationOption, type PaginationProps, PanelLeftIcon, Paper, type PaperBackground, type PaperBorder, type PaperBorderRadius, type PaperElevation, PaperPlaneIcon, type PaperProps, Paragraph, type ParagraphProps, PayoutIcon, PdfIcon, PersonAddIcon, PersonIcon, PersonShieldedIcon, PhoneInput, type PhoneInputProps, type PhoneInputValue, PinIcon, type Placement, PlusCircledIcon, PlusIcon, type PolymorphicBaseComponentProps, type PolymorphicProps, Popover, PopoverGroup, type PopoverGroupProps, type PopoverProps, type PopoverSizeProps, PowerOfAttorneyIcon, PrintIcon, ProgressBar, type ProgressBarProps, type ProgressBarSize, ProgressTracker, ProgressTrackerItem, type ProgressTrackerItemProps, type ProgressTrackerProps, PublishIcon, type Purpose, QuestionAnswerIcon, RadioButton, RadioButtonGroup, type RadioButtonGroupProps, type RadioButtonProps, type RadioValue, type Rating, ReceiptIcon, RedoIcon, RefreshIcon, type RemoteFile, ReplayIcon, type ResponsiveProps, type ResponsiveStackProps, RowsIcon, ScaleIcon, ScreenSize, Search, SearchAutocompleteWrapper, type SearchAutocompleteWrapperProps, type SearchButtonProps, type SearchData, SearchIcon, type SearchProps, type SearchSize, SearchSuggestions, type SearchSuggestionsProps, SectionIcon, Select, type SelectForwardRefType, type SelectOption, type SelectProps, SettingsIcon, ShowHide, type ShowHideProps, type Size, Skeleton, type SkeletonAppearance, type SkeletonProps, SkipToContent, type SkipToContentProps, SmsIcon, type SortOrder, type SpacingScale, Spinner, type SpinnerProps, SplitButton, type SplitButtonPrimaryActionProps, type SplitButtonProps, type SplitButtonPurpose, type SplitButtonSecondaryActionsProps, StarFilledIcon, StarHalfFilledIcon, StarIcon, type StaticTypographyType, StickyNoteIcon, StylelessButton, type StylelessButtonProps, StylelessList, type StylelessListProps, StylelessOList, type StylelessOListProps, SunIcon, SupportIcon, type SvgIcon, type SvgProps, SyncIcon, Tab, TabList, type TabListProps, TabPanel, type TabPanelProps, TabPanels, type TabPanelsProps, type TabProps, type TabSize, Table, Body as TableBody, type TableBodyProps, Cell as TableCell, type TableCellLayout, type TableCellProps, type TableCellType, Foot as TableFoot, type TableFootProps, Head as TableHead, type TableHeadProps, type TableProps, Row as TableRow, type TableRowProps, type TableRowType, type TableSize, SortCell as TableSortCell, type TableSortCellProps, TableWrapper, Tabs, type TabsProps, Tag, type TagAppearance, type TagProps, type TagPurpose, type TextAffixProps, TextArea, type TextAreaProps, TextInput, type TextInputProps, TextOverflowEllipsisInner, TextOverflowEllipsisWrapper, ThumbDownFilledIcon, ThumbDownIcon, ThumbUpFilledIcon, ThumbUpIcon, TimeIcon, TimePicker, type TimePickerProps, TingrettIcon, TipIcon, Toggle, ToggleBar, type ToggleBarProps, type ToggleBarSize, type ToggleBarValue, ToggleButton, ToggleButtonGroup, type ToggleButtonGroupProps, type ToggleButtonProps, type ToggleProps, ToggleRadio, type ToggleRadioProps, type ToggleSize, Tooltip, type TooltipProps, TrashIcon, TrendingDownIcon, TrendingUpIcon, Typography, type TypographyAnchorType, type TypographyBodyLongType, type TypographyBodyShortType, type TypographyBodyType, type TypographyComponentProps, type TypographyHeadingType, type TypographyLabelType, type TypographyLeadType, type TypographyProps, type TypographyType, UndoIcon, UnfoldLessIcon, UnfoldMoreIcon, UploadIcon, type UploadInfo, type UploadStatus, type UseAccordionBodyProps, type UseAccordionHeaderProps, type UseControllableGroupStateProps, type UseControllableStateProps, type UseFloatPositionOptions, VStack, type VStackProps, VisibilityOffIcon, VisibilityOnIcon, VisuallyHidden, type VisuallyHiddenProps, WarningIcon, WebexIcon, type WeightedSearchData, type WithRequiredIf, XIcon, ZoomInIcon, ZoomOutIcon, calendarDateToNativeDate, cn, countryOptions, createPurposes, createSelectOptions, createSizes, dateValueToNativeDate, focusVisible, focusVisibleInset, focusVisibleTransitionValue, getBaseHTMLProps, getColorCn, getElementType, getLiteralScreenSize, getTypographyCn, handleElementWithBackdropMount, handleElementWithBackdropUnmount, hideInput, index as icons, inheritLinkStyling, inlineElements, isAnchorTypographyProps, isBorderColor, isBorderRadius, isCaption, isElevation, isHeading, isInlineElement, isKeyboardEvent, isLegend, isPaperBackground, nativeDateToCalendarDate, nativeDateToDateValue, nativeDateToTime, normalizeButton, outlineInset, outlineOffset, removeButtonStyling, removeListStyling, renderInputMessage, scrollbarStyling, typographyTypes, useAccordion, useAccordionContext, useCallbackRef, useCombinedRef, useControllableGroupState, useControllableState, useFloatPosition, useFocusTrap, useIsMounted, useMountTransition, useOnClickOutside, useOnKeyDown, useReturnFocusOnBlur, useRoveFocus, useScreenSize, useTheme, useWindowResize };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { Dispatch, SetStateAction, RefObject, ReactNode, ComponentPropsWithRef, ElementType, CSSProperties, Ref, ComponentPropsWithoutRef, HTMLAttributes, SVGAttributes, JSX, ButtonHTMLAttributes, ComponentProps, InputHTMLAttributes, MouseEventHandler, DependencyList, RefCallback, ChangeEvent, KeyboardEvent as KeyboardEvent$1, AnchorHTMLAttributes, LabelHTMLAttributes, AriaRole, FocusEvent, ForwardedRef, ForwardRefExoticComponent, MouseEvent as MouseEvent$1, ReactElement } from 'react';
2
+ import { Dispatch, SetStateAction, RefObject, ReactNode, ComponentPropsWithRef, HTMLAttributes, Ref, CSSProperties, ElementType, ComponentPropsWithoutRef, SVGAttributes, JSX, ButtonHTMLAttributes, ComponentProps, InputHTMLAttributes, MouseEventHandler, DependencyList, RefCallback, ChangeEvent, KeyboardEvent as KeyboardEvent$1, AnchorHTMLAttributes, LabelHTMLAttributes, AriaRole, FocusEvent, ForwardedRef, ForwardRefExoticComponent, MouseEvent as MouseEvent$1, ReactElement } from 'react';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as CSS from 'csstype';
5
5
  import { Property, StandardProperties } from 'csstype';
@@ -4246,6 +4246,12 @@ interface RemoteFile {
4246
4246
  url: string;
4247
4247
  }
4248
4248
  type FileList = Array<File | RemoteFile>;
4249
+ type UploadStatus = 'uploading' | 'success' | 'error';
4250
+ interface UploadInfo {
4251
+ uploadStatus?: UploadStatus;
4252
+ errorMessage?: string;
4253
+ }
4254
+ type FileStatusMap = Map<string, UploadInfo>;
4249
4255
 
4250
4256
  type FileUploaderHookProps = {
4251
4257
  /**Dersom komponenten skal styres internt. Utgangspunktet for filene som har blitt lastet opp. */
@@ -4286,6 +4292,14 @@ type FileUploaderProps = {
4286
4292
  withDragAndDrop?: boolean;
4287
4293
  /**Om listen med opplastede filer skal skjules. Brukes kun hvis listen blir vist på egen måte. */
4288
4294
  hideFileList?: boolean;
4295
+ /** Map som lar konsumenten styre info om opplasting på hver fil: status og feilmelding. Bruker `deriveId` prop som nøkkel. Statusinfo vises i fillisten. */
4296
+ fileStatusMap?: Map<string, UploadInfo>;
4297
+ /** Funksjon som genererer en ID for hver fil. Brukes som nøkkel i `fileStatusMap` prop for å kunne mappe status på opplasting av hver fil og vise det i fillisten. */
4298
+ deriveId?: (file: File | RemoteFile) => string;
4299
+ /**
4300
+ * Funksjon som lar brukeren prøve å laste opp en fil på nytt ved opplastlingfeil. Brukes sammen med `deriveId` og `fileStatusMap` props.
4301
+ */
4302
+ onRetry?: (fileId: string) => void;
4289
4303
  } & Pick<ResponsiveProps, 'width'> & Partial<FileUploaderHookProps> & Omit<ComponentPropsWithRef<'div'>, 'onChange' | 'id'> & Pick<InputProps, 'tip' | 'label' | 'afterLabelContent'>;
4290
4304
  declare const FileUploader: {
4291
4305
  (props: FileUploaderProps): react_jsx_runtime.JSX.Element;
@@ -5489,4 +5503,4 @@ declare const VisuallyHidden: {
5489
5503
  displayName: string;
5490
5504
  };
5491
5505
 
5492
- export { Accordion, AccordionBody, type AccordionBodyProps, type AccordionConfig, AccordionContextProvider, AccordionHeader, type AccordionHeaderProps, type AccordionProps, type AccordionState, AddTabButton, type AddTabButtonProps, AddressShieldedIcon, AgreementIcon, AnimatedChevronUpDownIcon, type AnimatedChevronUpDownIconStates, AppsIcon, ArchiveIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon, AttachmentIcon, BORDER_COLORS, BORDER_RADII, BackLink, type BackLinkProps, Backdrop, BarChartBoxedIcon, BarChartIcon, type BaseComponentProps, type BaseComponentPropsWithChildren, type BaseItemProps, type BaseLabelProps, type BaseTypographyProps, BlockIcon, BookIcon, type BorderColor, type BorderRadius, Box, type BoxProps, Breadcrumb, type BreadcrumbProps, Breadcrumbs, type BreadcrumbsProps, type Breakpoint, BriefcaseIcon, BuildIcon, BuildingIcon, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, type ButtonPurpose, type ButtonSize, Calendar, CalendarIcon, CalendarMonthIcon, type CalendarProps, CalendarViewDayIcon, CalendarViewMonthIcon, CalendarViewWeekIcon, CallIcon, type Callback, Caption, type CaptionProps, Card, CardExpandable, CardExpandableBody, type CardExpandableBodyProps, CardExpandableHeader, type CardExpandableHeaderProps, type CardExpandableProps, type CardProps, CardSelectable, CardSelectableGroup, type CardSelectableGroupProps, type CardSelectableProps, CaringIcon, ChatIcon, CheckCircledIcon, CheckIcon, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxPickedHTMLAttributes, type CheckboxProps, ChecklistIcon, ChevronDownIcon, ChevronFirstIcon, ChevronLastIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, Chip, ChipGroup, type ChipGroupProps, type ChipProps, CircleFilledIcon, CircleIcon, CloseCircledIcon, CloseIcon, CloseSmallIcon, CloudIcon, CollapseIcon, CollapsibleTable, type CollapsibleTableProps, CollapsibleRow as CollapsibleTableRow, type ColumnsOccupied, CommentIcon, Contrast, type ContrastProps, CookieBanner, CookieBannerCheckbox, type CookieBannerCheckboxProps, type CookieBannerProps, CopyIcon, CourtIcon, DETAIL_LIST_SIZES, DatePicker, type DatePickerProps, DateRangeIcon, DdsProvider, type DdsProviderProps, type DdsTheme, DeathsIcon, DescriptionList, type DescriptionListAppearance, DescriptionListDesc, type DescriptionListDescProps, DescriptionListGroup, type DescriptionListGroupProps, type DescriptionListProps, DescriptionListTerm, type DescriptionListTermProps, DetailList, DetailListDesc, type DetailListDescProps, type DetailListProps, DetailListRow, type DetailListRowProps, type DetailListSize, DetailListTerm, type DetailListTermProps, type Direction$1 as Direction, Divider, type DividerColor, type DividerProps, DoubleChevronLeftIcon, DoubleChevronRightIcon, DownloadDoneIcon, DownloadIcon, DragHandleIcon, Drawer, DrawerGroup, type DrawerGroupProps, type DrawerPlacement, type DrawerProps, type DrawerSize, DropdownHeader, DropdownItem, type DropdownItemButtonProps, type DropdownItemCustomProps, type DropdownItemProps, ELEVATIONS, EditAltIcon, EditIcon, ElementAs, type Elevation, EmptyContent, type EmptyContentProps, ErrorIcon, ErrorSummary, ErrorSummaryItem, type ErrorSummaryItemProps, type ErrorSummaryProps, ExclaimIcon, ExpandIcon, type ExtractStrict, FacebookIcon, FamilyIcon, FavStar, type FavStarProps, Feedback, FeedbackIcon, type FeedbackProps, Fieldset, FieldsetGroup, type FieldsetGroupProps, type FieldsetProps, FileAddIcon, FileIcon, type FileList, FileShieldedIcon, FileTextIcon, FileUploader, type FileUploaderAccept, type FileUploaderProps, FilterIcon, FilterListIcon, FindInPageIcon, FlagFilledIcon, FlagIcon, FlickrIcon, type FloatingStyles, FloppyDiskIcon, FolderAddIcon, FolderIcon, FolderShieldedIcon, Footer, FooterLeft, type FooterLeftProps, FooterList, FooterListGroup, type FooterListGroupProps, FooterListHeader, type FooterListHeaderProps, type FooterListProps, FooterLogo, type FooterLogoProps, type FooterProps, FooterSocialsGroup, type FooterSocialsGroupProps, FooterSocialsList, type FooterSocialsListProps, FormSummary, FormSummaryEditButton, FormSummaryEmptyValue, FormSummaryError, FormSummaryField, FormSummaryFields, FormSummaryHeader, FormSummaryHeading, FormSummaryLabel, type FormSummaryProps, FormSummaryValue, FullscreenExitIcon, FullscreenIcon, GavelIcon, GlobalMessage, type GlobalMessageProps, type GlobalMessagePurpose, Grid, GridChild, type GridChildProps, type GridProps, GroupIcon, GuardianIcon, HStack, type HStackProps, Heading, type HeadingLevel, type HeadingProps, HelpFilledIcon, HelpIcon, HelpSimpleIcon, HiddenInput, HomeIcon, HourglassEmptyIcon, type HyphenTypographyType, Icon, type IconPosition, type IconProps, type IconSize, ImageIcon, InfoIcon, InlineButton, type InlineButtonProps, InlineEditInput, type InlineEditInputProps, InlineEditSelect, type InlineEditSelectProps, InlineEditTextArea, type InlineEditTextAreaProps, type InlineElement, InputMessage, type InputMessageProps, type InputMessageType, InstagramIcon, InternalHeader, type InternalHeaderProps, JordskifterettIcon, JordskiftesakIcon, KeyIcon, L_MESSAGE_PURPOSES, Label, type LabelProps, LagmannsrettIcon, LanguageIcon, type Layout, Legend, type LegendProps, LineChartIcon, Link, LinkIcon, LinkOffIcon, type LinkProps, LinkedInIcon, List, ListAltIcon, ListIcon, ListItem, type ListItemProps, type ListProps, type ListType, type ListTypographyType, LocalMessage, type LocalMessageLayout, type LocalMessageProps, type LocalMessagePurpose, LocationIcon, LocationOffIcon, LockFilledIcon, LockIcon, LockOpenIcon, LoginIcon, LogoutIcon, MailIcon, MailOpenIcon, MapIcon, MenuIcon, MinusCircledIcon, MinusIcon, Modal, ModalActions, type ModalActionsProps, ModalBody, type ModalBodyProps, type ModalProps, MoonIcon, MoreHorizontalIcon, MoreVerticalIcon, NativeSelect, type NativeSelectProps, NotarialIcon, NotebookPenIcon, NotificationsIcon, NotificationsOffIcon, type Nullable, OnlineMeetingIcon, OpenExternalIcon, type OtherTypographyType, OverflowMenu, OverflowMenuButton, type OverflowMenuButtonProps, OverflowMenuDivider, OverflowMenuGroup, type OverflowMenuGroupProps, OverflowMenuLink, type OverflowMenuLinkProps, OverflowMenuList, OverflowMenuListHeader, type OverflowMenuProps, OverflowMenuSpan, type OverflowMenuSpanProps, OverflowMenuToggle, type OverflowMenuToggleProps, Pagination, type PaginationOption, type PaginationProps, PanelLeftIcon, Paper, type PaperBackground, type PaperBorder, type PaperBorderRadius, type PaperElevation, PaperPlaneIcon, type PaperProps, Paragraph, type ParagraphProps, PayoutIcon, PdfIcon, PersonAddIcon, PersonIcon, PersonShieldedIcon, PhoneInput, type PhoneInputProps, type PhoneInputValue, PinIcon, type Placement, PlusCircledIcon, PlusIcon, type PolymorphicBaseComponentProps, type PolymorphicProps, Popover, PopoverGroup, type PopoverGroupProps, type PopoverProps, type PopoverSizeProps, PowerOfAttorneyIcon, PrintIcon, ProgressBar, type ProgressBarProps, type ProgressBarSize, ProgressTracker, ProgressTrackerItem, type ProgressTrackerItemProps, type ProgressTrackerProps, PublishIcon, type Purpose, QuestionAnswerIcon, RadioButton, RadioButtonGroup, type RadioButtonGroupProps, type RadioButtonProps, type RadioValue, type Rating, ReceiptIcon, RedoIcon, RefreshIcon, type RemoteFile, ReplayIcon, type ResponsiveProps, type ResponsiveStackProps, RowsIcon, ScaleIcon, ScreenSize, Search, SearchAutocompleteWrapper, type SearchAutocompleteWrapperProps, type SearchButtonProps, type SearchData, SearchIcon, type SearchProps, type SearchSize, SearchSuggestions, type SearchSuggestionsProps, SectionIcon, Select, type SelectForwardRefType, type SelectOption, type SelectProps, SettingsIcon, ShowHide, type ShowHideProps, type Size, Skeleton, type SkeletonAppearance, type SkeletonProps, SkipToContent, type SkipToContentProps, SmsIcon, type SortOrder, type SpacingScale, Spinner, type SpinnerProps, SplitButton, type SplitButtonPrimaryActionProps, type SplitButtonProps, type SplitButtonPurpose, type SplitButtonSecondaryActionsProps, StarFilledIcon, StarHalfFilledIcon, StarIcon, type StaticTypographyType, StickyNoteIcon, StylelessButton, type StylelessButtonProps, StylelessList, type StylelessListProps, StylelessOList, type StylelessOListProps, SunIcon, SupportIcon, type SvgIcon, type SvgProps, SyncIcon, Tab, TabList, type TabListProps, TabPanel, type TabPanelProps, TabPanels, type TabPanelsProps, type TabProps, type TabSize, Table, Body as TableBody, type TableBodyProps, Cell as TableCell, type TableCellLayout, type TableCellProps, type TableCellType, Foot as TableFoot, type TableFootProps, Head as TableHead, type TableHeadProps, type TableProps, Row as TableRow, type TableRowProps, type TableRowType, type TableSize, SortCell as TableSortCell, type TableSortCellProps, TableWrapper, Tabs, type TabsProps, Tag, type TagAppearance, type TagProps, type TagPurpose, type TextAffixProps, TextArea, type TextAreaProps, TextInput, type TextInputProps, TextOverflowEllipsisInner, TextOverflowEllipsisWrapper, ThumbDownFilledIcon, ThumbDownIcon, ThumbUpFilledIcon, ThumbUpIcon, TimeIcon, TimePicker, type TimePickerProps, TingrettIcon, TipIcon, Toggle, ToggleBar, type ToggleBarProps, type ToggleBarSize, type ToggleBarValue, ToggleButton, ToggleButtonGroup, type ToggleButtonGroupProps, type ToggleButtonProps, type ToggleProps, ToggleRadio, type ToggleRadioProps, type ToggleSize, Tooltip, type TooltipProps, TrashIcon, TrendingDownIcon, TrendingUpIcon, Typography, type TypographyAnchorType, type TypographyBodyLongType, type TypographyBodyShortType, type TypographyBodyType, type TypographyComponentProps, type TypographyHeadingType, type TypographyLabelType, type TypographyLeadType, type TypographyProps, type TypographyType, UndoIcon, UnfoldLessIcon, UnfoldMoreIcon, UploadIcon, type UseAccordionBodyProps, type UseAccordionHeaderProps, type UseControllableGroupStateProps, type UseControllableStateProps, type UseFloatPositionOptions, VStack, type VStackProps, VisibilityOffIcon, VisibilityOnIcon, VisuallyHidden, type VisuallyHiddenProps, WarningIcon, WebexIcon, type WeightedSearchData, type WithRequiredIf, XIcon, ZoomInIcon, ZoomOutIcon, calendarDateToNativeDate, cn, countryOptions, createPurposes, createSelectOptions, createSizes, dateValueToNativeDate, focusVisible, focusVisibleInset, focusVisibleTransitionValue, getBaseHTMLProps, getColorCn, getElementType, getLiteralScreenSize, getTypographyCn, handleElementWithBackdropMount, handleElementWithBackdropUnmount, hideInput, index as icons, inheritLinkStyling, inlineElements, isAnchorTypographyProps, isBorderColor, isBorderRadius, isCaption, isElevation, isHeading, isInlineElement, isKeyboardEvent, isLegend, isPaperBackground, nativeDateToCalendarDate, nativeDateToDateValue, nativeDateToTime, normalizeButton, outlineInset, outlineOffset, removeButtonStyling, removeListStyling, renderInputMessage, scrollbarStyling, typographyTypes, useAccordion, useAccordionContext, useCallbackRef, useCombinedRef, useControllableGroupState, useControllableState, useFloatPosition, useFocusTrap, useIsMounted, useMountTransition, useOnClickOutside, useOnKeyDown, useReturnFocusOnBlur, useRoveFocus, useScreenSize, useTheme, useWindowResize };
5506
+ export { Accordion, AccordionBody, type AccordionBodyProps, type AccordionConfig, AccordionContextProvider, AccordionHeader, type AccordionHeaderProps, type AccordionProps, type AccordionState, AddTabButton, type AddTabButtonProps, AddressShieldedIcon, AgreementIcon, AnimatedChevronUpDownIcon, type AnimatedChevronUpDownIconStates, AppsIcon, ArchiveIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon, AttachmentIcon, BORDER_COLORS, BORDER_RADII, BackLink, type BackLinkProps, Backdrop, BarChartBoxedIcon, BarChartIcon, type BaseComponentProps, type BaseComponentPropsWithChildren, type BaseItemProps, type BaseLabelProps, type BaseTypographyProps, BlockIcon, BookIcon, type BorderColor, type BorderRadius, Box, type BoxProps, Breadcrumb, type BreadcrumbProps, Breadcrumbs, type BreadcrumbsProps, type Breakpoint, BriefcaseIcon, BuildIcon, BuildingIcon, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, type ButtonPurpose, type ButtonSize, Calendar, CalendarIcon, CalendarMonthIcon, type CalendarProps, CalendarViewDayIcon, CalendarViewMonthIcon, CalendarViewWeekIcon, CallIcon, type Callback, Caption, type CaptionProps, Card, CardExpandable, CardExpandableBody, type CardExpandableBodyProps, CardExpandableHeader, type CardExpandableHeaderProps, type CardExpandableProps, type CardProps, CardSelectable, CardSelectableGroup, type CardSelectableGroupProps, type CardSelectableProps, CaringIcon, ChatIcon, CheckCircledIcon, CheckIcon, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxPickedHTMLAttributes, type CheckboxProps, ChecklistIcon, ChevronDownIcon, ChevronFirstIcon, ChevronLastIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, Chip, ChipGroup, type ChipGroupProps, type ChipProps, CircleFilledIcon, CircleIcon, CloseCircledIcon, CloseIcon, CloseSmallIcon, CloudIcon, CollapseIcon, CollapsibleTable, type CollapsibleTableProps, CollapsibleRow as CollapsibleTableRow, type ColumnsOccupied, CommentIcon, Contrast, type ContrastProps, CookieBanner, CookieBannerCheckbox, type CookieBannerCheckboxProps, type CookieBannerProps, CopyIcon, CourtIcon, DETAIL_LIST_SIZES, DatePicker, type DatePickerProps, DateRangeIcon, DdsProvider, type DdsProviderProps, type DdsTheme, DeathsIcon, DescriptionList, type DescriptionListAppearance, DescriptionListDesc, type DescriptionListDescProps, DescriptionListGroup, type DescriptionListGroupProps, type DescriptionListProps, DescriptionListTerm, type DescriptionListTermProps, DetailList, DetailListDesc, type DetailListDescProps, type DetailListProps, DetailListRow, type DetailListRowProps, type DetailListSize, DetailListTerm, type DetailListTermProps, type Direction$1 as Direction, Divider, type DividerColor, type DividerProps, DoubleChevronLeftIcon, DoubleChevronRightIcon, DownloadDoneIcon, DownloadIcon, DragHandleIcon, Drawer, DrawerGroup, type DrawerGroupProps, type DrawerPlacement, type DrawerProps, type DrawerSize, DropdownHeader, DropdownItem, type DropdownItemButtonProps, type DropdownItemCustomProps, type DropdownItemProps, ELEVATIONS, EditAltIcon, EditIcon, ElementAs, type Elevation, EmptyContent, type EmptyContentProps, ErrorIcon, ErrorSummary, ErrorSummaryItem, type ErrorSummaryItemProps, type ErrorSummaryProps, ExclaimIcon, ExpandIcon, type ExtractStrict, FacebookIcon, FamilyIcon, FavStar, type FavStarProps, Feedback, FeedbackIcon, type FeedbackProps, Fieldset, FieldsetGroup, type FieldsetGroupProps, type FieldsetProps, FileAddIcon, FileIcon, type FileList, FileShieldedIcon, type FileStatusMap, FileTextIcon, FileUploader, type FileUploaderAccept, type FileUploaderProps, FilterIcon, FilterListIcon, FindInPageIcon, FlagFilledIcon, FlagIcon, FlickrIcon, type FloatingStyles, FloppyDiskIcon, FolderAddIcon, FolderIcon, FolderShieldedIcon, Footer, FooterLeft, type FooterLeftProps, FooterList, FooterListGroup, type FooterListGroupProps, FooterListHeader, type FooterListHeaderProps, type FooterListProps, FooterLogo, type FooterLogoProps, type FooterProps, FooterSocialsGroup, type FooterSocialsGroupProps, FooterSocialsList, type FooterSocialsListProps, FormSummary, FormSummaryEditButton, FormSummaryEmptyValue, FormSummaryError, FormSummaryField, FormSummaryFields, FormSummaryHeader, FormSummaryHeading, FormSummaryLabel, type FormSummaryProps, FormSummaryValue, FullscreenExitIcon, FullscreenIcon, GavelIcon, GlobalMessage, type GlobalMessageProps, type GlobalMessagePurpose, Grid, GridChild, type GridChildProps, type GridProps, GroupIcon, GuardianIcon, HStack, type HStackProps, Heading, type HeadingLevel, type HeadingProps, HelpFilledIcon, HelpIcon, HelpSimpleIcon, HiddenInput, HomeIcon, HourglassEmptyIcon, type HyphenTypographyType, Icon, type IconPosition, type IconProps, type IconSize, ImageIcon, InfoIcon, InlineButton, type InlineButtonProps, InlineEditInput, type InlineEditInputProps, InlineEditSelect, type InlineEditSelectProps, InlineEditTextArea, type InlineEditTextAreaProps, type InlineElement, InputMessage, type InputMessageProps, type InputMessageType, InstagramIcon, InternalHeader, type InternalHeaderProps, JordskifterettIcon, JordskiftesakIcon, KeyIcon, L_MESSAGE_PURPOSES, Label, type LabelProps, LagmannsrettIcon, LanguageIcon, type Layout, Legend, type LegendProps, LineChartIcon, Link, LinkIcon, LinkOffIcon, type LinkProps, LinkedInIcon, List, ListAltIcon, ListIcon, ListItem, type ListItemProps, type ListProps, type ListType, type ListTypographyType, LocalMessage, type LocalMessageLayout, type LocalMessageProps, type LocalMessagePurpose, LocationIcon, LocationOffIcon, LockFilledIcon, LockIcon, LockOpenIcon, LoginIcon, LogoutIcon, MailIcon, MailOpenIcon, MapIcon, MenuIcon, MinusCircledIcon, MinusIcon, Modal, ModalActions, type ModalActionsProps, ModalBody, type ModalBodyProps, type ModalProps, MoonIcon, MoreHorizontalIcon, MoreVerticalIcon, NativeSelect, type NativeSelectProps, NotarialIcon, NotebookPenIcon, NotificationsIcon, NotificationsOffIcon, type Nullable, OnlineMeetingIcon, OpenExternalIcon, type OtherTypographyType, OverflowMenu, OverflowMenuButton, type OverflowMenuButtonProps, OverflowMenuDivider, OverflowMenuGroup, type OverflowMenuGroupProps, OverflowMenuLink, type OverflowMenuLinkProps, OverflowMenuList, OverflowMenuListHeader, type OverflowMenuProps, OverflowMenuSpan, type OverflowMenuSpanProps, OverflowMenuToggle, type OverflowMenuToggleProps, Pagination, type PaginationOption, type PaginationProps, PanelLeftIcon, Paper, type PaperBackground, type PaperBorder, type PaperBorderRadius, type PaperElevation, PaperPlaneIcon, type PaperProps, Paragraph, type ParagraphProps, PayoutIcon, PdfIcon, PersonAddIcon, PersonIcon, PersonShieldedIcon, PhoneInput, type PhoneInputProps, type PhoneInputValue, PinIcon, type Placement, PlusCircledIcon, PlusIcon, type PolymorphicBaseComponentProps, type PolymorphicProps, Popover, PopoverGroup, type PopoverGroupProps, type PopoverProps, type PopoverSizeProps, PowerOfAttorneyIcon, PrintIcon, ProgressBar, type ProgressBarProps, type ProgressBarSize, ProgressTracker, ProgressTrackerItem, type ProgressTrackerItemProps, type ProgressTrackerProps, PublishIcon, type Purpose, QuestionAnswerIcon, RadioButton, RadioButtonGroup, type RadioButtonGroupProps, type RadioButtonProps, type RadioValue, type Rating, ReceiptIcon, RedoIcon, RefreshIcon, type RemoteFile, ReplayIcon, type ResponsiveProps, type ResponsiveStackProps, RowsIcon, ScaleIcon, ScreenSize, Search, SearchAutocompleteWrapper, type SearchAutocompleteWrapperProps, type SearchButtonProps, type SearchData, SearchIcon, type SearchProps, type SearchSize, SearchSuggestions, type SearchSuggestionsProps, SectionIcon, Select, type SelectForwardRefType, type SelectOption, type SelectProps, SettingsIcon, ShowHide, type ShowHideProps, type Size, Skeleton, type SkeletonAppearance, type SkeletonProps, SkipToContent, type SkipToContentProps, SmsIcon, type SortOrder, type SpacingScale, Spinner, type SpinnerProps, SplitButton, type SplitButtonPrimaryActionProps, type SplitButtonProps, type SplitButtonPurpose, type SplitButtonSecondaryActionsProps, StarFilledIcon, StarHalfFilledIcon, StarIcon, type StaticTypographyType, StickyNoteIcon, StylelessButton, type StylelessButtonProps, StylelessList, type StylelessListProps, StylelessOList, type StylelessOListProps, SunIcon, SupportIcon, type SvgIcon, type SvgProps, SyncIcon, Tab, TabList, type TabListProps, TabPanel, type TabPanelProps, TabPanels, type TabPanelsProps, type TabProps, type TabSize, Table, Body as TableBody, type TableBodyProps, Cell as TableCell, type TableCellLayout, type TableCellProps, type TableCellType, Foot as TableFoot, type TableFootProps, Head as TableHead, type TableHeadProps, type TableProps, Row as TableRow, type TableRowProps, type TableRowType, type TableSize, SortCell as TableSortCell, type TableSortCellProps, TableWrapper, Tabs, type TabsProps, Tag, type TagAppearance, type TagProps, type TagPurpose, type TextAffixProps, TextArea, type TextAreaProps, TextInput, type TextInputProps, TextOverflowEllipsisInner, TextOverflowEllipsisWrapper, ThumbDownFilledIcon, ThumbDownIcon, ThumbUpFilledIcon, ThumbUpIcon, TimeIcon, TimePicker, type TimePickerProps, TingrettIcon, TipIcon, Toggle, ToggleBar, type ToggleBarProps, type ToggleBarSize, type ToggleBarValue, ToggleButton, ToggleButtonGroup, type ToggleButtonGroupProps, type ToggleButtonProps, type ToggleProps, ToggleRadio, type ToggleRadioProps, type ToggleSize, Tooltip, type TooltipProps, TrashIcon, TrendingDownIcon, TrendingUpIcon, Typography, type TypographyAnchorType, type TypographyBodyLongType, type TypographyBodyShortType, type TypographyBodyType, type TypographyComponentProps, type TypographyHeadingType, type TypographyLabelType, type TypographyLeadType, type TypographyProps, type TypographyType, UndoIcon, UnfoldLessIcon, UnfoldMoreIcon, UploadIcon, type UploadInfo, type UploadStatus, type UseAccordionBodyProps, type UseAccordionHeaderProps, type UseControllableGroupStateProps, type UseControllableStateProps, type UseFloatPositionOptions, VStack, type VStackProps, VisibilityOffIcon, VisibilityOnIcon, VisuallyHidden, type VisuallyHiddenProps, WarningIcon, WebexIcon, type WeightedSearchData, type WithRequiredIf, XIcon, ZoomInIcon, ZoomOutIcon, calendarDateToNativeDate, cn, countryOptions, createPurposes, createSelectOptions, createSizes, dateValueToNativeDate, focusVisible, focusVisibleInset, focusVisibleTransitionValue, getBaseHTMLProps, getColorCn, getElementType, getLiteralScreenSize, getTypographyCn, handleElementWithBackdropMount, handleElementWithBackdropUnmount, hideInput, index as icons, inheritLinkStyling, inlineElements, isAnchorTypographyProps, isBorderColor, isBorderRadius, isCaption, isElevation, isHeading, isInlineElement, isKeyboardEvent, isLegend, isPaperBackground, nativeDateToCalendarDate, nativeDateToDateValue, nativeDateToTime, normalizeButton, outlineInset, outlineOffset, removeButtonStyling, removeListStyling, renderInputMessage, scrollbarStyling, typographyTypes, useAccordion, useAccordionContext, useCallbackRef, useCombinedRef, useControllableGroupState, useControllableState, useFloatPosition, useFocusTrap, useIsMounted, useMountTransition, useOnClickOutside, useOnKeyDown, useReturnFocusOnBlur, useRoveFocus, useScreenSize, useTheme, useWindowResize };
package/dist/index.js CHANGED
@@ -9153,8 +9153,12 @@ var File2 = (props) => {
9153
9153
  file: stateFile,
9154
9154
  removeFile,
9155
9155
  isValid,
9156
+ uploadStatus,
9157
+ errorMessage,
9156
9158
  disabled,
9157
- readOnly
9159
+ readOnly,
9160
+ onRetry,
9161
+ fileId
9158
9162
  } = props;
9159
9163
  const [fileUrl, setFileUrl] = (0, import_react60.useState)();
9160
9164
  (0, import_react60.useEffect)(() => {
@@ -9165,63 +9169,109 @@ var File2 = (props) => {
9165
9169
  setFileUrl(url);
9166
9170
  return () => URL.revokeObjectURL(url);
9167
9171
  }
9168
- }, [stateFile.file]);
9172
+ }, [stateFile.file, stateFile.url]);
9169
9173
  const errorsList = stateFile.errors.map((e, errorIndex) => ({
9170
9174
  id: derivativeIdGenerator(parentId, `file-${index}-error-${errorIndex}`),
9171
9175
  message: e
9172
9176
  }));
9177
+ if (errorMessage)
9178
+ errorsList.push({
9179
+ id: derivativeIdGenerator(
9180
+ parentId,
9181
+ `file-${index}-error-${errorsList.length}`
9182
+ ),
9183
+ message: errorMessage
9184
+ });
9173
9185
  const inactive = disabled || readOnly;
9186
+ let displayStatus;
9187
+ if (!isValid) displayStatus = "invalid";
9188
+ else if (uploadStatus) displayStatus = uploadStatus;
9189
+ else displayStatus = "valid";
9190
+ const isInvalid = displayStatus === "invalid";
9191
+ const hasError = displayStatus === "error" || isInvalid;
9192
+ const hasRetry = displayStatus === "error" && onRetry;
9193
+ let statusIndicator;
9194
+ switch (displayStatus) {
9195
+ case "uploading":
9196
+ statusIndicator = /* @__PURE__ */ (0, import_jsx_runtime279.jsx)(Spinner, { size: "var(--dds-size-icon-component)" });
9197
+ break;
9198
+ case "success":
9199
+ case "valid":
9200
+ statusIndicator = /* @__PURE__ */ (0, import_jsx_runtime279.jsx)(
9201
+ Icon,
9202
+ {
9203
+ icon: CheckCircledIcon,
9204
+ iconSize: "component",
9205
+ className: FileUploader_default[`file__icon--valid`]
9206
+ }
9207
+ );
9208
+ break;
9209
+ case "invalid":
9210
+ case "error":
9211
+ statusIndicator = /* @__PURE__ */ (0, import_jsx_runtime279.jsx)(
9212
+ Icon,
9213
+ {
9214
+ icon: ErrorIcon,
9215
+ iconSize: "component",
9216
+ className: FileUploader_default[`file__icon--invalid`]
9217
+ }
9218
+ );
9219
+ break;
9220
+ }
9174
9221
  return /* @__PURE__ */ (0, import_jsx_runtime279.jsxs)("li", { children: [
9175
9222
  /* @__PURE__ */ (0, import_jsx_runtime279.jsxs)(
9176
9223
  Paper,
9177
9224
  {
9178
- display: "flex",
9179
- alignItems: "center",
9180
- justifyContent: "space-between",
9181
- gap: "x0.75",
9182
9225
  marginBlock: "x0.5 0",
9183
9226
  padding: "x0.5 x1",
9184
- border: disabled ? "border-subtle" : isValid ? "border-default" : "border-danger",
9227
+ border: disabled ? "border-subtle" : !hasError ? "border-default" : "border-danger",
9185
9228
  background: inactive ? "surface-field-disabled" : "surface-subtle",
9186
- className: cn(!isValid && FileUploader_default["file--invalid"]),
9229
+ className: cn(hasError && FileUploader_default["file--invalid"]),
9187
9230
  children: [
9188
- /* @__PURE__ */ (0, import_jsx_runtime279.jsx)(
9189
- Typography,
9190
- {
9191
- as: "span",
9192
- color: disabled ? "text-subtle" : readOnly ? "text-medium" : void 0,
9193
- className: cn(FileUploader_default.file__name),
9194
- children: fileUrl ? /* @__PURE__ */ (0, import_jsx_runtime279.jsx)(Link, { href: fileUrl, target: "_blank", children: stateFile.name }) : stateFile.name
9195
- }
9196
- ),
9197
- !inactive && /* @__PURE__ */ (0, import_jsx_runtime279.jsxs)(import_jsx_runtime279.Fragment, { children: [
9231
+ /* @__PURE__ */ (0, import_jsx_runtime279.jsxs)(HStack, { alignItems: "center", justifyContent: "space-between", gap: "x0.75", children: [
9198
9232
  /* @__PURE__ */ (0, import_jsx_runtime279.jsx)(
9199
- Icon,
9233
+ Typography,
9200
9234
  {
9201
- icon: isValid ? CheckCircledIcon : ErrorIcon,
9202
- iconSize: "component",
9203
- className: FileUploader_default[`file__icon--${isValid ? "valid" : "invalid"}`]
9235
+ as: "span",
9236
+ color: disabled ? "text-subtle" : readOnly ? "text-medium" : void 0,
9237
+ className: cn(FileUploader_default.file__name),
9238
+ children: fileUrl ? /* @__PURE__ */ (0, import_jsx_runtime279.jsx)(Link, { href: fileUrl, target: "_blank", children: stateFile.name }) : stateFile.name
9204
9239
  }
9205
9240
  ),
9206
- /* @__PURE__ */ (0, import_jsx_runtime279.jsx)(
9207
- Button,
9208
- {
9209
- size: "xsmall",
9210
- purpose: "tertiary",
9211
- type: "button",
9212
- onClick: removeFile,
9213
- icon: CloseIcon,
9214
- "aria-label": t(texts16.removeFile(stateFile.name)),
9215
- htmlProps: {
9216
- "aria-invalid": !isValid ? true : void 0,
9217
- "aria-errormessage": !isValid ? t(texts16.invalidFile) : void 0,
9218
- "aria-describedby": spaceSeparatedIdListGenerator(
9219
- errorsList.map((e) => e.id)
9220
- )
9241
+ !inactive && /* @__PURE__ */ (0, import_jsx_runtime279.jsxs)(import_jsx_runtime279.Fragment, { children: [
9242
+ statusIndicator,
9243
+ /* @__PURE__ */ (0, import_jsx_runtime279.jsx)(
9244
+ Button,
9245
+ {
9246
+ size: "xsmall",
9247
+ purpose: "tertiary",
9248
+ type: "button",
9249
+ onClick: removeFile,
9250
+ icon: CloseIcon,
9251
+ "aria-label": t(texts16.removeFile(stateFile.name)),
9252
+ htmlProps: {
9253
+ "aria-invalid": !isValid ? true : void 0,
9254
+ "aria-errormessage": !isValid ? t(texts16.invalidFile) : void 0,
9255
+ "aria-describedby": spaceSeparatedIdListGenerator(
9256
+ errorsList.map((e) => e.id)
9257
+ )
9258
+ }
9221
9259
  }
9222
- }
9223
- )
9224
- ] })
9260
+ )
9261
+ ] })
9262
+ ] }),
9263
+ hasRetry && /* @__PURE__ */ (0, import_jsx_runtime279.jsx)(
9264
+ Box,
9265
+ {
9266
+ as: Button,
9267
+ marginBlock: "x0.75 0",
9268
+ size: "small",
9269
+ purpose: "secondary",
9270
+ onClick: () => onRetry(fileId),
9271
+ icon: RefreshIcon,
9272
+ children: t(texts16.tryAgain)
9273
+ }
9274
+ )
9225
9275
  ]
9226
9276
  }
9227
9277
  ),
@@ -9242,6 +9292,14 @@ var texts16 = createTexts({
9242
9292
  nn: "Ugyldig fil",
9243
9293
  en: "Invalid file",
9244
9294
  se: "F\xE1mohis fiila"
9295
+ },
9296
+ tryAgain: {
9297
+ nb: "Pr\xF8v igjen",
9298
+ no: "Pr\xF8v igjen",
9299
+ nn: "Pr\xF8v igjen",
9300
+ en: "Try again",
9301
+ // TODO: oversettelse
9302
+ se: "Pr\xF8v igjen"
9245
9303
  }
9246
9304
  });
9247
9305
 
@@ -9600,6 +9658,9 @@ var FileUploader = (props) => {
9600
9658
  hideFileList,
9601
9659
  className,
9602
9660
  afterLabelContent,
9661
+ fileStatusMap,
9662
+ deriveId,
9663
+ onRetry,
9603
9664
  ...rest
9604
9665
  } = props;
9605
9666
  const { t } = useTranslation();
@@ -9635,19 +9696,35 @@ var FileUploader = (props) => {
9635
9696
  const inputId = derivativeIdGenerator(uniqueId, "input");
9636
9697
  const fileListId = derivativeIdGenerator(uniqueId, "file-list");
9637
9698
  const fileListNameId = derivativeIdGenerator(uniqueId, "file-list-name");
9638
- const fileListElements = stateFiles.map((stateFile, index) => /* @__PURE__ */ (0, import_jsx_runtime280.jsx)(
9639
- File2,
9640
- {
9641
- parentId: uniqueId,
9642
- index,
9643
- file: stateFile,
9644
- isValid: stateFile.errors.length === 0,
9645
- removeFile: () => removeFile(stateFile),
9646
- disabled,
9647
- readOnly
9648
- },
9649
- stateFile.name
9650
- ));
9699
+ function toPublicFile(sf) {
9700
+ if (sf.file) return sf.file;
9701
+ if (sf.url) return { name: sf.name, url: sf.url };
9702
+ return null;
9703
+ }
9704
+ const fileListElements = stateFiles.map((stateFile, index) => {
9705
+ var _a, _b, _c;
9706
+ const pf = toPublicFile(stateFile);
9707
+ const id2 = deriveId ? pf ? deriveId(pf) : stateFile.name : (_a = stateFile.url) != null ? _a : stateFile.name;
9708
+ const uploadStatus = (_b = fileStatusMap == null ? void 0 : fileStatusMap.get(id2)) == null ? void 0 : _b.uploadStatus;
9709
+ const errorMessage2 = (_c = fileStatusMap == null ? void 0 : fileStatusMap.get(id2)) == null ? void 0 : _c.errorMessage;
9710
+ return /* @__PURE__ */ (0, import_jsx_runtime280.jsx)(
9711
+ File2,
9712
+ {
9713
+ parentId: uniqueId,
9714
+ index,
9715
+ file: stateFile,
9716
+ isValid: stateFile.errors.length === 0,
9717
+ removeFile: () => removeFile(stateFile),
9718
+ disabled,
9719
+ readOnly,
9720
+ uploadStatus,
9721
+ errorMessage: errorMessage2,
9722
+ fileId: id2,
9723
+ onRetry
9724
+ },
9725
+ stateFile.name
9726
+ );
9727
+ });
9651
9728
  const rootErrorsList = rootErrors.map((e, index) => ({
9652
9729
  id: derivativeIdGenerator(uniqueId, `error-${index}`),
9653
9730
  message: e