@kystverket/styrbord 2.0.3 → 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.
- package/README.md +4 -0
- package/dist/src/components/kystverket/Header/Header.d.ts +2 -1
- package/dist/src/components/kystverket/Logo/Logo.d.ts +5 -2
- package/dist/src/components/kystverket/Logo/Logo.stories.d.ts +4 -0
- package/dist/src/components/kystverket/SideSheet/ResizeHandle/ResizeHandle.d.ts +16 -0
- package/dist/src/components/kystverket/SideSheet/SideSheet.stories.d.ts +2 -0
- package/dist/src/components/kystverket/SideSheet/SideSheet.types.d.ts +8 -0
- package/dist/style.css +1 -1
- package/dist/style.js +3010 -2849
- package/dist/style.umd.cjs +9 -9
- package/package.json +3 -4
package/README.md
CHANGED
|
@@ -15,6 +15,10 @@ Alle komponentene og typene i Designsystemet er tilgjengelig i Styrbord med føl
|
|
|
15
15
|
- Komponenter merket med 🌈 i menyen er uendret fra Designsystemet.
|
|
16
16
|
- Komponenter merket med 🌈+⚓ i menyen er Designsystem-komponenter som er utvidet med Kystverkets behov. Bruk og egenskap skal i stor grad overlappe.
|
|
17
17
|
|
|
18
|
+
## Migrere fra 1.x?
|
|
19
|
+
|
|
20
|
+
Mat KI-agenten med [v2.md](Versjon 2 - Endringer). Den vil da klare å migrere det meste uten problemer. Testet med Claude Code med Opus 5.5.
|
|
21
|
+
|
|
18
22
|
## Versjonering
|
|
19
23
|
|
|
20
24
|
- Prosjektet følger semantisk versjonering (`major.minor.patch`).
|
|
@@ -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 = '
|
|
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`.
|