@kystverket/styrbord 2.0.4 → 2.2.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.
@@ -24,6 +24,7 @@ export interface HeaderProps {
24
24
  title?: string;
25
25
  url: string;
26
26
  variant?: LogoVariant;
27
+ product?: string;
27
28
  };
28
29
  applications?: HeaderApplication[];
29
30
  links?: HeaderLinkItem[];
@@ -44,5 +45,5 @@ type HeaderProfile = {
44
45
  };
45
46
  export declare const nameToInitials: (name?: string) => string;
46
47
  export declare function MainLinkItem(props: HeaderLinkItemWithOnClick): React.JSX.Element;
47
- export declare function Header({ logo: { title, variant, url }, links, slots, width, profile, applications, loginHandler, logoutHandler, }: HeaderProps): React.JSX.Element;
48
+ export declare function Header({ logo: { title, variant, product, url }, links, slots, width, profile, applications, loginHandler, logoutHandler, }: Readonly<HeaderProps>): React.JSX.Element;
48
49
  export {};
@@ -1,9 +1,12 @@
1
- export type LogoVariant = 'blue-horizontal' | 'datakatalog' | 'fyr' | 'hais' | 'pfsa' | 'saksbehandling' | 'selvbetjening' | 'white-horizontal' | 'white-vertical';
1
+ export type LogoVariant = 'horizontal' | 'vertical' | 'symbol' | 'horizontal-en' | 'vertical-en';
2
+ export type LogoColor = 'blue' | 'white' | 'black';
2
3
  export interface LogoProps {
3
4
  className?: string;
5
+ color?: LogoColor;
4
6
  variant?: LogoVariant;
7
+ product?: string;
5
8
  alt?: string;
6
9
  height?: number;
7
10
  width?: number;
8
11
  }
9
- export declare function Logo({ className, variant, alt, height, width }: LogoProps): React.JSX.Element;
12
+ export declare function Logo({ product, className, color, variant, alt, height, width, }: Readonly<LogoProps>): React.JSX.Element;
@@ -12,10 +12,14 @@ type Story = StoryObj<typeof meta>;
12
12
  export declare const Default: Story;
13
13
  export declare const OnlyWidth: Story;
14
14
  export declare const OnlyHeight: Story;
15
+ export declare const EnglishVertical: Story;
16
+ export declare const EnglishHorizontal: Story;
15
17
  export declare const White: Story;
18
+ export declare const Black: Story;
16
19
  export declare const Datakatalog: Story;
17
20
  export declare const Fyr: Story;
18
21
  export declare const Hais: Story;
19
22
  export declare const Pfsa: Story;
20
23
  export declare const Saksbehandling: Story;
21
24
  export declare const Selvbetjening: Story;
25
+ export declare const SelvbetjeningEnglish: Story;
@@ -0,0 +1,16 @@
1
+ import type { SideSheetPlacement } from '~/components/kystverket/SideSheet/SideSheet.types';
2
+ interface ResizeHandleProps {
3
+ sheetRef: React.RefObject<HTMLElement | null>;
4
+ placement: SideSheetPlacement;
5
+ pinned: boolean;
6
+ onResize: (width: number) => void;
7
+ onResizingChange: (resizing: boolean) => void;
8
+ onReset: () => void;
9
+ }
10
+ /**
11
+ * Draggable edge for `SideSheet allowResize`. Follows the WAI-ARIA window splitter pattern: a
12
+ * focusable `separator` whose value is the sheet's width in pixels, adjustable with the arrow
13
+ * keys (Shift for bigger steps) and Home/End. Double-click resets to the `size` prop.
14
+ */
15
+ export declare function ResizeHandle({ sheetRef, placement, pinned, onResize, onResizingChange, onReset, }: Readonly<ResizeHandleProps>): React.JSX.Element;
16
+ export {};
@@ -26,6 +26,7 @@ declare const _default: {
26
26
  onClose?: (() => void) | undefined;
27
27
  placement?: import("~/main").SideSheetPlacement | undefined;
28
28
  size?: import("~/main").SideSheetSize | undefined;
29
+ allowResize?: boolean | undefined;
29
30
  pinnable?: boolean | undefined;
30
31
  pinned?: boolean | undefined;
31
32
  onPinnedChange?: ((pinned: boolean) => void) | undefined;
@@ -50,6 +51,7 @@ export declare const OpenInNewWindow: StoryFn<typeof SideSheet>;
50
51
  export declare const WithBackButton: StoryFn<typeof SideSheet>;
51
52
  export declare const WithActionsScrollbarDividers: StoryFn<typeof SideSheet>;
52
53
  export declare const Pinnable: StoryFn<typeof SideSheet>;
54
+ export declare const Resizable: StoryFn<typeof SideSheet>;
53
55
  export declare const LeftPlacement: StoryFn<typeof SideSheet>;
54
56
  export declare const SmallSize: StoryFn<typeof SideSheet>;
55
57
  export declare const LargeSize: StoryFn<typeof SideSheet>;
@@ -6,6 +6,14 @@ export interface SideSheetProps {
6
6
  onClose?: () => void;
7
7
  placement?: SideSheetPlacement;
8
8
  size?: SideSheetSize;
9
+ /**
10
+ * Let the user change the sheet's width by dragging the edge facing the page, or with the
11
+ * arrow keys when the handle has focus. `size` is the starting width, and double-clicking the
12
+ * handle goes back to it. The width is kept while the sheet is mounted and starts over when
13
+ * `size` changes. Hidden on phones, where the sheet is full width.
14
+ * Default: `false`.
15
+ */
16
+ allowResize?: boolean;
9
17
  /**
10
18
  * Show a pin button in the header that lets the user toggle overlay/push.
11
19
  * Default: `false`.