@kystverket/styrbord 2.14.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/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 +2 -2
- package/dist/style.css +1 -1
- package/dist/style.js +1565 -1520
- 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: {
|
|
@@ -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
|
@@ -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';
|