@kystverket/styrbord 2.7.1 → 2.8.1

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.
@@ -0,0 +1,4 @@
1
+ declare const FileIcon: ({ file }: {
2
+ file: string;
3
+ }) => React.JSX.Element;
4
+ export default FileIcon;
@@ -1,7 +1,7 @@
1
1
  import type { StoryFn } from '@storybook/react-vite';
2
2
  declare const meta: {
3
3
  title: string;
4
- component: ({ material, indicator, indicatorPosition, className, size, title, background, }: import("~/main").MaterialIconProps) => React.JSX.Element;
4
+ component: ({ material, file, indicator, indicatorPosition, className, size, title, background, }: import("~/main").IconProps) => React.JSX.Element;
5
5
  decorators: ((Story: import("storybook/internal/csf").PartialStoryFn, context: import("storybook/internal/csf").StoryContext) => React.JSX.Element)[];
6
6
  tags: string[];
7
7
  argTypes: {};
@@ -10,3 +10,6 @@ export default meta;
10
10
  export declare const IconShowcase: StoryFn;
11
11
  export declare const IconSizing: StoryFn;
12
12
  export declare const IconIndicator: StoryFn;
13
+ export declare const IconFile: StoryFn<{
14
+ file: string;
15
+ }>;
@@ -1,8 +1,7 @@
1
1
  import type { StyrbordPaletteColor, StyrbordSemanticColor } from '@kystverket/styrbord-tokens/colors';
2
- import { IconId } from './icon.types';
2
+ import { FileIconId, IconId } from './icon.types';
3
3
  type IconSize = '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
4
- export interface MaterialIconProps {
5
- material: IconId;
4
+ interface IconBaseProps {
6
5
  indicator?: IconId;
7
6
  indicatorPosition?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
8
7
  className?: string;
@@ -10,5 +9,15 @@ export interface MaterialIconProps {
10
9
  title?: string;
11
10
  background?: StyrbordPaletteColor | StyrbordSemanticColor;
12
11
  }
13
- declare const Icon: ({ material, indicator, indicatorPosition, className, size, title, background, }: MaterialIconProps) => React.JSX.Element;
12
+ export interface MaterialIconProps extends IconBaseProps {
13
+ material: IconId;
14
+ file?: never;
15
+ }
16
+ export interface FileIconProps extends IconBaseProps {
17
+ /** A preset file type, or any short text (e.g. `docx`) to print on the label. */
18
+ file: FileIconId | (string & {});
19
+ material?: never;
20
+ }
21
+ export type IconProps = MaterialIconProps | FileIconProps;
22
+ declare const Icon: ({ material, file, indicator, indicatorPosition, className, size, title, background, }: IconProps) => React.JSX.Element;
14
23
  export default Icon;
@@ -1,2 +1,4 @@
1
1
  export declare const iconIdList: readonly ["add_box", "add_location_alt", "add_location", "add_notes", "add", "adjust", "air", "alternate_email", "anchor", "apps", "archive", "arrow_back", "arrow_downward", "arrow_forward", "arrow_right_alt", "arrow_upward", "article", "assignment", "attach_email", "attach_file", "autorenew", "backspace", "backup", "book_4", "bottom_panel_close", "bottom_panel_open", "cached", "calendar_month", "change_history", "chat_add_on", "chat_bubble", "chat", "check_circle", "check", "chevron_left", "chevron_right", "circle", "close", "cloud_alert", "cloud_done", "code_blocks", "comment", "compare_arrows", "compare", "content_copy", "conversation", "copy_all", "cycle", "dark_mode", "data_table", "delete_history", "delete", "description", "difference", "directions_boat", "directory_sync", "distance", "document_search", "domain", "download", "drafts", "edit_document", "edit_location_alt", "edit_location", "edit_square", "edit", "error", "event", "explore_nearby", "explore", "export_notes", "exposure_zero", "favorite", "file_map_stack", "file_map", "file_save", "folder_check_2", "folder_match", "folder_off", "folder_open", "folder_supervised", "folder", "format_align_center", "format_align_justify", "format_align_left", "format_align_right", "format_bold", "format_italic", "format_list_bulleted", "format_list_numbered", "format_size", "forum", "forward_to_inbox", "forward", "globe_uk", "groups", "history_off", "history_toggle_off", "history", "image", "inbox", "info_i", "info", "keep_off", "keep", "keyboard_arrow_down", "keyboard_arrow_up", "language", "layers", "left_panel_close", "left_panel_open", "light_mode", "lightbulb", "link", "location_chip", "lock", "login", "logout", "mail_shield", "mail", "manage_history", "manage_search", "map_pin_heart", "map", "mark_as_unread", "mark_chat_read", "mark_chat_unread", "mark_email_read", "mark_email_unread", "match_case", "menu_open", "menu", "mode_cool", "more_vert", "move_to_inbox", "move", "note_stack_add", "note_stack", "notification_add", "numbers", "open_in_new", "pan_zoom", "pending_actions", "person_add", "person_pin_circle", "person_pin", "person", "photo_camera", "picture_as_pdf", "pin_drop", "pin_history", "question_exchange", "radio_button_checked", "radio_button_unchecked", "redo", "reply_all", "reply", "right_panel_close", "right_panel_open", "sailing", "save", "schedule", "send_and_archive", "send", "settings_input_antenna", "settings", "severe_cold", "sort", "source_environment", "splitscreen_landscape", "stacked_email", "stylus", "sync", "text_compare", "text_snippet", "timeline", "top_panel_close", "top_panel_open", "tsunami", "undo", "unknown_document", "upload", "vertical_align_bottom", "vertical_align_top", "video_library", "videocam", "view_list", "visibility", "vital_signs", "warning", "water", "waves", "zoom_in_map", "zoom_out_map"];
2
2
  export type IconId = (typeof iconIdList)[number];
3
+ export declare const fileIconIdList: readonly ["csv", "docx", "geojson", "html", "jpeg", "json", "markdown", "mpeg", "pdf", "png", "pptx", "tiff", "txt", "xls", "xlsx", "yaml", "zip"];
4
+ export type FileIconId = (typeof fileIconIdList)[number];
@@ -32,8 +32,8 @@ export { default as KyvSpinner } from './components/kystverket/KyvSpinner/KyvSpi
32
32
  export type { KyvSpinnerProps } from './components/kystverket/KyvSpinner/KyvSpinner';
33
33
  export { default as LabelContent, type LabelContentProps } from './components/kystverket/LabelContent/labelContent';
34
34
  export { default as Icon } from './components/kystverket/Icon/icon';
35
- export type { IconId } from './components/kystverket/Icon/icon.types';
36
- export type { MaterialIconProps } from './components/kystverket/Icon/icon';
35
+ export type { IconId, FileIconId } from './components/kystverket/Icon/icon.types';
36
+ export type { MaterialIconProps, FileIconProps, IconProps } from './components/kystverket/Icon/icon';
37
37
  export * from './components/kystverket/Image/svgImage';
38
38
  export { default as Skillingsbuoye } from './components/kystverket/Skillingsbuoye/skillingsbuoye';
39
39
  export { Accent, Typography } from './components/kystverket/Typography/typography';