@kystverket/styrbord 2.13.0 → 2.15.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/src/components/designsystemet/Details/Details.stories.d.ts +2 -4
- package/dist/src/components/designsystemet/Dialog/Dialog.d.ts +12 -0
- package/dist/src/components/designsystemet/Dialog/Dialog.stories.d.ts +4 -18
- package/dist/src/components/designsystemet/Popover/Popover.stories.d.ts +2 -5
- package/dist/src/components/kystverket/FilePreviewer/FilePreviewer.stories.d.ts +3 -0
- package/dist/src/components/kystverket/FilePreviewer/dialog/FilePreviewer-dialog.d.ts +4 -0
- package/dist/src/components/kystverket/FilePreviewer/index.d.ts +5 -0
- package/dist/src/components/kystverket/FilePreviewer/panel/FilePreviewer-panel.d.ts +17 -0
- package/dist/src/components/kystverket/SaksbehandlingShell/SaksbehandlingShell.d.ts +1 -1
- package/dist/src/components/kystverket/SaksbehandlingShell/SaksbehandlingShell.stories.d.ts +10 -0
- package/dist/src/components/kystverket/SaksbehandlingShell/SaksbehandlingShell.types.d.ts +7 -0
- package/dist/src/components/kystverket/SaksbehandlingShell/ShellSideSheet/ShellSideSheet.d.ts +4 -0
- package/dist/src/components/kystverket/SaksbehandlingShell/ShellSideSheet/ShellSideSheet.types.d.ts +27 -0
- package/dist/src/components/kystverket/Search/Search.d.ts +38 -0
- package/dist/src/components/kystverket/Search/Search.stories.d.ts +9 -0
- package/dist/src/components/kystverket/Search/Search.types.d.ts +27 -0
- package/dist/src/main.d.ts +3 -3
- package/dist/style.css +1 -1
- package/dist/style.js +2521 -2327
- package/dist/style.umd.cjs +12 -12
- package/package.json +3 -3
|
@@ -3,10 +3,8 @@ import { DetailsProps } from '~/main';
|
|
|
3
3
|
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
5
|
component: React.ForwardRefExoticComponent<DetailsProps & React.RefAttributes<HTMLDetailsElement>> & {
|
|
6
|
-
Summary:
|
|
7
|
-
|
|
8
|
-
} & React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement>>;
|
|
9
|
-
Content: React.ForwardRefExoticComponent<import("@digdir/designsystemet-react").DetailsContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
Summary: typeof import("@digdir/designsystemet-react").DetailsSummary;
|
|
7
|
+
Content: typeof import("@digdir/designsystemet-react").DetailsContent;
|
|
10
8
|
};
|
|
11
9
|
decorators: ((Story: import("storybook/internal/csf").PartialStoryFn, context: import("storybook/internal/csf").StoryContext) => React.JSX.Element)[];
|
|
12
10
|
tags: string[];
|
|
@@ -15,7 +15,19 @@ declare const DialogRoot: React.ForwardRefExoticComponent<Omit<import("@digdir/d
|
|
|
15
15
|
'max-width'?: DialogSize;
|
|
16
16
|
} & React.RefAttributes<HTMLDialogElement>>;
|
|
17
17
|
type DialogComponent = typeof DialogRoot & {
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated Will be removed in the next major version. Connect a `Button` to the dialog with
|
|
20
|
+
* `command="show-modal"` and `commandfor` set to the dialog's `id` instead.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* <Button command="show-modal" commandfor="my-dialog">Open Dialog</Button>
|
|
24
|
+
* <Dialog id="my-dialog">Content</Dialog>
|
|
25
|
+
*/
|
|
18
26
|
TriggerContext: typeof DialogTriggerContext;
|
|
27
|
+
/**
|
|
28
|
+
* @deprecated Will be removed in the next major version. Use a `Button` with `command="show-modal"` and
|
|
29
|
+
* `commandfor` set to the dialog's `id` instead.
|
|
30
|
+
*/
|
|
19
31
|
Trigger: typeof DialogTrigger;
|
|
20
32
|
Block: typeof DialogBlock;
|
|
21
33
|
};
|
|
@@ -13,23 +13,9 @@ declare const _default: {
|
|
|
13
13
|
} & {
|
|
14
14
|
'max-width'?: import("~/main").DialogSize;
|
|
15
15
|
} & React.RefAttributes<HTMLDialogElement>> & {
|
|
16
|
-
TriggerContext:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
20
|
-
Trigger: React.ForwardRefExoticComponent<Omit<Omit<import("@digdir/designsystemet-react").DefaultProps & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "command" | "commandfor" | "commandFor">, "asChild" | "loading" | "type" | "variant" | "icon" | "command" | "commandfor" | "commandFor"> & {
|
|
21
|
-
variant?: "primary" | "secondary" | "tertiary";
|
|
22
|
-
icon?: boolean;
|
|
23
|
-
loading?: boolean | import("react").ReactNode;
|
|
24
|
-
asChild?: boolean;
|
|
25
|
-
type?: import("react").ButtonHTMLAttributes<HTMLButtonElement>["type"];
|
|
26
|
-
command?: string;
|
|
27
|
-
commandfor?: string;
|
|
28
|
-
commandFor?: string;
|
|
29
|
-
} & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
30
|
-
Block: React.ForwardRefExoticComponent<{
|
|
31
|
-
asChild?: boolean;
|
|
32
|
-
} & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
TriggerContext: typeof import("@digdir/designsystemet-react").DialogTriggerContext;
|
|
17
|
+
Trigger: typeof import("@digdir/designsystemet-react").DialogTrigger;
|
|
18
|
+
Block: typeof import("@digdir/designsystemet-react").DialogBlock;
|
|
33
19
|
};
|
|
34
20
|
tags: string[];
|
|
35
21
|
parameters: {
|
|
@@ -69,7 +55,7 @@ declare const _default: {
|
|
|
69
55
|
};
|
|
70
56
|
export default _default;
|
|
71
57
|
export declare const Preview: StoryFn<typeof Dialog>;
|
|
72
|
-
export declare const
|
|
58
|
+
export declare const WithRef: StoryFn<typeof Dialog>;
|
|
73
59
|
export declare const DialogWithOpenProp: StoryFn<typeof Dialog>;
|
|
74
60
|
export declare const BackdropClosedbyAny: StoryFn<typeof Dialog>;
|
|
75
61
|
export declare const WithHeaderAndFooter: StoryFn<typeof Dialog>;
|
|
@@ -12,11 +12,8 @@ declare const _default: {
|
|
|
12
12
|
autoPlacement?: boolean;
|
|
13
13
|
asChild?: boolean;
|
|
14
14
|
} & React.RefAttributes<HTMLDivElement>> & {
|
|
15
|
-
TriggerContext:
|
|
16
|
-
|
|
17
|
-
displayName: string;
|
|
18
|
-
};
|
|
19
|
-
Trigger: React.ForwardRefExoticComponent<import("@digdir/designsystemet-react").PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
15
|
+
TriggerContext: typeof import("@digdir/designsystemet-react").PopoverTriggerContext;
|
|
16
|
+
Trigger: typeof import("@digdir/designsystemet-react").PopoverTrigger;
|
|
20
17
|
};
|
|
21
18
|
tags: string[];
|
|
22
19
|
parameters: {
|
|
@@ -6,6 +6,9 @@ declare const meta: {
|
|
|
6
6
|
Thumbnail: typeof import("./thumbnail/FilePreviewer-thumbnail").FilePreviewerThumbnail & {
|
|
7
7
|
displayName?: string;
|
|
8
8
|
};
|
|
9
|
+
Panel: typeof import("./panel/FilePreviewer-panel").FilePreviewerPanel & {
|
|
10
|
+
displayName?: string;
|
|
11
|
+
};
|
|
9
12
|
displayName?: string;
|
|
10
13
|
};
|
|
11
14
|
decorators: ((Story: import("storybook/internal/csf").PartialStoryFn, context: import("storybook/internal/csf").StoryContext) => React.JSX.Element)[];
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { FilePreviewerContext } from './FilePreviewer-context';
|
|
2
2
|
import { FilePreviewerThumbnail } from './thumbnail/FilePreviewer-thumbnail';
|
|
3
|
+
import { FilePreviewerPanel } from './panel/FilePreviewer-panel';
|
|
3
4
|
type FilePreviewerCompound = typeof FilePreviewerContext & {
|
|
4
5
|
Thumbnail: typeof FilePreviewerThumbnail & {
|
|
5
6
|
displayName?: string;
|
|
6
7
|
};
|
|
8
|
+
Panel: typeof FilePreviewerPanel & {
|
|
9
|
+
displayName?: string;
|
|
10
|
+
};
|
|
7
11
|
displayName?: string;
|
|
8
12
|
};
|
|
9
13
|
declare const FilePreviewer: FilePreviewerCompound;
|
|
10
14
|
export type { FilePreviewerContextProps as FilePreviewerProps } from './FilePreviewer-context';
|
|
11
15
|
export type { FilePreviewerThumbnailProps } from './thumbnail/FilePreviewer-thumbnail';
|
|
16
|
+
export type { FilePreviewerPanelProps } from './panel/FilePreviewer-panel';
|
|
12
17
|
export { FilePreviewer };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { FileInfo } from '../FilePreviewer.types';
|
|
3
|
+
export interface FilePreviewerPanelProps {
|
|
4
|
+
/** The file to show. When unset, `emptyContent` is shown instead. */
|
|
5
|
+
file?: FileInfo;
|
|
6
|
+
/** Shown when no file is selected. Default: a short "no file selected" text. */
|
|
7
|
+
emptyContent?: ReactNode;
|
|
8
|
+
/** Heading level of the file name. Default: `2`. */
|
|
9
|
+
headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Shows one file inline — file name, size, "open in new tab" and "download" — for use in a side
|
|
14
|
+
* panel such as `SaksbehandlingShell`'s `comparisonContent`. Unlike `FilePreviewer.Thumbnail`
|
|
15
|
+
* it does not need a surrounding `<FilePreviewer>`.
|
|
16
|
+
*/
|
|
17
|
+
export declare function FilePreviewerPanel({ file, emptyContent, headingLevel, className }: FilePreviewerPanelProps): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { SaksbehandlingShellProps } from './SaksbehandlingShell.types';
|
|
2
|
-
export declare function SaksbehandlingShell({ headerContent, caseActions, itemActions, items, selectedItemId, onSelectItemId, comparisonContent, defaultItemListOpen, defaultComparisonOpen, children, className, }: Readonly<SaksbehandlingShellProps>): React.JSX.Element;
|
|
2
|
+
export declare function SaksbehandlingShell({ headerContent, caseActions, itemActions, items, selectedItemId, onSelectItemId, comparisonContent, defaultItemListOpen, defaultComparisonOpen, comparisonOpen, onComparisonOpenChange, children, className, }: Readonly<SaksbehandlingShellProps>): React.JSX.Element;
|
|
@@ -11,3 +11,13 @@ declare const meta: {
|
|
|
11
11
|
};
|
|
12
12
|
export default meta;
|
|
13
13
|
export declare const Default: StoryFn<typeof SaksbehandlingShell>;
|
|
14
|
+
/**
|
|
15
|
+
* The shell inside a full page: it fills the viewport below the header, and the footer sits
|
|
16
|
+
* below the fold, as in an application.
|
|
17
|
+
*/
|
|
18
|
+
export declare const WithHeaderAndFooter: StoryFn<typeof SaksbehandlingShell>;
|
|
19
|
+
/**
|
|
20
|
+
* Postmottak mocked in the shell: each innsending is an item in the list, the filters sit in the
|
|
21
|
+
* toolbar as GitHub-style dropdowns, and the row actions become actions on the selected item.
|
|
22
|
+
*/
|
|
23
|
+
export declare const Postmottak: StoryFn<typeof SaksbehandlingShell>;
|
|
@@ -25,6 +25,13 @@ export interface SaksbehandlingShellProps {
|
|
|
25
25
|
defaultItemListOpen?: boolean;
|
|
26
26
|
/** Default open state of the comparison panel. Default: `false`. */
|
|
27
27
|
defaultComparisonOpen?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Controlled open state of the comparison panel, e.g. to open it when the user clicks an
|
|
30
|
+
* attachment in the main section. Use together with `onComparisonOpenChange`.
|
|
31
|
+
*/
|
|
32
|
+
comparisonOpen?: boolean;
|
|
33
|
+
/** Called when the comparison panel is opened or closed from the toolbar, Escape or backdrop. */
|
|
34
|
+
onComparisonOpenChange?: (open: boolean) => void;
|
|
28
35
|
/** Main section content for the currently selected item. */
|
|
29
36
|
children?: ReactNode;
|
|
30
37
|
className?: string;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ShellSideSheetLayoutProps, ShellSideSheetProps } from './ShellSideSheet.types';
|
|
2
|
+
export declare function ShellSideSheet({ open, onClose, placement, size, pinned, backdrop, children, className, style, 'aria-label': ariaLabel, }: Readonly<ShellSideSheetProps>): React.JSX.Element;
|
|
3
|
+
/** Flex row a pinned `ShellSideSheet` takes its width from; the rest of the row fills the remainder. */
|
|
4
|
+
export declare function ShellSideSheetLayout({ children, className, style }: Readonly<ShellSideSheetLayoutProps>): React.JSX.Element;
|
package/dist/src/components/kystverket/SaksbehandlingShell/ShellSideSheet/ShellSideSheet.types.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
export type ShellSideSheetSize = 'sm' | 'md' | 'lg' | '33%' | '40%' | '50%' | '66%';
|
|
3
|
+
export type ShellSideSheetPlacement = 'left' | 'right';
|
|
4
|
+
export interface ShellSideSheetProps {
|
|
5
|
+
open?: boolean;
|
|
6
|
+
/** Called on Escape and backdrop click while the sheet is open and not pinned. */
|
|
7
|
+
onClose?: () => void;
|
|
8
|
+
placement?: ShellSideSheetPlacement;
|
|
9
|
+
size?: ShellSideSheetSize;
|
|
10
|
+
/**
|
|
11
|
+
* When `true` the sheet is a flex child of `<ShellSideSheetLayout>` and reflows the content
|
|
12
|
+
* next to it. When `false` it overlays the content.
|
|
13
|
+
*/
|
|
14
|
+
pinned?: boolean;
|
|
15
|
+
/** Dim the content and trap focus while overlaying. Default: `true`. */
|
|
16
|
+
backdrop?: boolean;
|
|
17
|
+
/** Accessible name of the sheet. Required: the shell's sheets have no visible heading. */
|
|
18
|
+
'aria-label': string;
|
|
19
|
+
children?: ReactNode;
|
|
20
|
+
className?: string;
|
|
21
|
+
style?: CSSProperties;
|
|
22
|
+
}
|
|
23
|
+
export interface ShellSideSheetLayoutProps {
|
|
24
|
+
children?: ReactNode;
|
|
25
|
+
className?: string;
|
|
26
|
+
style?: CSSProperties;
|
|
27
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { SearchButtonProps, SearchClearProps, SearchInputProps, SearchProps } from './Search.types';
|
|
3
|
+
/**
|
|
4
|
+
* Search field with optional clear button and submit button.
|
|
5
|
+
*
|
|
6
|
+
* Styrbord's own replacement for Designsystemet's `Search`, which is deprecated and will be removed in
|
|
7
|
+
* their next major version. The API matches upstream, so existing usage keeps working.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* <Search>
|
|
11
|
+
* <Search.Input aria-label="Søk" />
|
|
12
|
+
* <Search.Clear />
|
|
13
|
+
* <Search.Button />
|
|
14
|
+
* </Search>
|
|
15
|
+
*/
|
|
16
|
+
declare function SearchRoot({ className, ...rest }: SearchProps): ReactElement;
|
|
17
|
+
/**
|
|
18
|
+
* The search field. Must be a direct child of `Search`.
|
|
19
|
+
*/
|
|
20
|
+
export declare function SearchInput({ type, placeholder, ...rest }: SearchInputProps): ReactElement;
|
|
21
|
+
/**
|
|
22
|
+
* Clears the search field. Only visible while the field has a value.
|
|
23
|
+
*
|
|
24
|
+
* Clears just the search field and fires an `input` event, so a controlled input's `onChange` runs too.
|
|
25
|
+
* Unlike a `type="reset"` button it does not reset the rest of a surrounding form.
|
|
26
|
+
*/
|
|
27
|
+
export declare function SearchClear({ onClick, 'aria-label': ariaLabel, className, ...rest }: SearchClearProps): ReactElement;
|
|
28
|
+
/**
|
|
29
|
+
* Submit button attached to the end of the search field.
|
|
30
|
+
*/
|
|
31
|
+
export declare function SearchButton({ variant, children, className, ...rest }: SearchButtonProps): ReactElement;
|
|
32
|
+
type SearchComponent = typeof SearchRoot & {
|
|
33
|
+
Input: typeof SearchInput;
|
|
34
|
+
Clear: typeof SearchClear;
|
|
35
|
+
Button: typeof SearchButton;
|
|
36
|
+
};
|
|
37
|
+
export declare const Search: SearchComponent;
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Search } from '~/main';
|
|
2
|
+
import type { Meta, StoryFn } from '@storybook/react-vite';
|
|
3
|
+
declare const _default: Meta;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Preview: StoryFn<typeof Search>;
|
|
6
|
+
export declare const Controlled: StoryFn<typeof Search>;
|
|
7
|
+
export declare const Variants: StoryFn<typeof Search>;
|
|
8
|
+
export declare const WithLabel: StoryFn<typeof Search>;
|
|
9
|
+
export declare const Form: StoryFn<typeof Search>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { HTMLAttributes, InputHTMLAttributes, Ref } from 'react';
|
|
2
|
+
import type { ButtonProps } from '~/components/designsystemet/Button/Button';
|
|
3
|
+
export type SearchProps = HTMLAttributes<HTMLDivElement> & {
|
|
4
|
+
ref?: Ref<HTMLDivElement>;
|
|
5
|
+
};
|
|
6
|
+
export type SearchInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'size'> & {
|
|
7
|
+
/**
|
|
8
|
+
* `search` shows the magnifying glass, `text` hides it.
|
|
9
|
+
* @default 'search'
|
|
10
|
+
*/
|
|
11
|
+
type?: 'search' | 'text';
|
|
12
|
+
ref?: Ref<HTMLInputElement>;
|
|
13
|
+
};
|
|
14
|
+
export type SearchClearProps = Omit<HTMLAttributes<HTMLButtonElement>, 'children'> & {
|
|
15
|
+
/**
|
|
16
|
+
* Accessible name of the clear button.
|
|
17
|
+
* @default 'Fjern tekst' (translated)
|
|
18
|
+
*/
|
|
19
|
+
'aria-label'?: string;
|
|
20
|
+
ref?: Ref<HTMLButtonElement>;
|
|
21
|
+
};
|
|
22
|
+
export type SearchButtonProps = Omit<ButtonProps, 'type'> & {
|
|
23
|
+
/**
|
|
24
|
+
* @default 'filled'
|
|
25
|
+
*/
|
|
26
|
+
variant?: ButtonProps['variant'];
|
|
27
|
+
};
|
package/dist/src/main.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export { default as DeprecatedErrorLabel, type ErrorLabelProps as DeprecatedErro
|
|
|
13
13
|
export { default as DeprecatedInputLabel, type InputLabelProps as DeprecatedInputLabelProps, } from './components/deprecated/InputLabel/inputLabel';
|
|
14
14
|
export { Details as DeprecatedDetails, type DetailsProps as DeprecatedDetailsProps, } from './components/deprecated/Details/Details';
|
|
15
15
|
export { default as DeprecatedCard, type CardProps as DeprecatedCardProps } from './components/deprecated/Card/Card';
|
|
16
|
-
export { FilePreviewer, type FilePreviewerProps } from './components/kystverket/FilePreviewer';
|
|
16
|
+
export { FilePreviewer, type FilePreviewerProps, type FilePreviewerPanelProps, } from './components/kystverket/FilePreviewer';
|
|
17
17
|
export { StyrbordTranslations } from './translations';
|
|
18
18
|
export { default as KyvDivider } from './components/kystverket/KyvDivider/KyvDivider';
|
|
19
19
|
export { PageHeading } from './components/kystverket/PageHeading/PageHeading';
|
|
@@ -46,6 +46,8 @@ export { Summary } from './components/kystverket/Summary/summary';
|
|
|
46
46
|
export type { SummaryProps, SummaryRowProps } from './components/kystverket/Summary/summary.types';
|
|
47
47
|
export { Logo } from './components/kystverket/Logo/Logo';
|
|
48
48
|
export type { LogoProps, LogoVariant } from './components/kystverket/Logo/Logo';
|
|
49
|
+
export { Search, SearchInput, SearchClear, SearchButton } from './components/kystverket/Search/Search';
|
|
50
|
+
export type { SearchProps, SearchInputProps, SearchClearProps, SearchButtonProps, } from './components/kystverket/Search/Search.types';
|
|
49
51
|
export { Footer } from './components/kystverket/Footer/Footer';
|
|
50
52
|
export type { FooterProps } from './components/kystverket/Footer/Footer';
|
|
51
53
|
export { Header } from './components/kystverket/Header/Header';
|
|
@@ -145,8 +147,6 @@ export type { PopoverProps, PopoverTriggerContextProps, PopoverTriggerProps } fr
|
|
|
145
147
|
export { Popover, PopoverTrigger, PopoverTriggerContext } from '@digdir/designsystemet-react';
|
|
146
148
|
export type { RadioProps } from '@digdir/designsystemet-react';
|
|
147
149
|
export { Radio } from '@digdir/designsystemet-react';
|
|
148
|
-
export type { SearchButtonProps, SearchClearProps, SearchInputProps, SearchProps } from '@digdir/designsystemet-react';
|
|
149
|
-
export { Search, SearchButton, SearchClear, SearchInput } from '@digdir/designsystemet-react';
|
|
150
150
|
export type { SelectOptgroupProps, SelectOptionProps } from '@digdir/designsystemet-react';
|
|
151
151
|
export { SelectOptgroup } from '@digdir/designsystemet-react';
|
|
152
152
|
export type { SkeletonProps } from '@digdir/designsystemet-react';
|