@obosbbl/grunnmuren-react 3.3.4 → 3.4.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/__stories__/form-validation.stories.cjs +70 -56
- package/dist/__stories__/form-validation.stories.js +71 -57
- package/dist/__stories__/layout.stories.cjs +32 -12
- package/dist/__stories__/layout.stories.js +32 -12
- package/dist/index.d.mts +116 -32
- package/dist/index.mjs +595 -482
- package/package.json +5 -2
package/dist/index.d.mts
CHANGED
|
@@ -2,10 +2,11 @@ import { DisclosureProps as DisclosureProps$1, ButtonProps as ButtonProps$1, Lin
|
|
|
2
2
|
export { ListBoxItemProps as ComboboxItemProps, DisclosureGroup, DisclosureGroupProps, Form, Group, LabelProps, ListBoxItemProps as SelectItemProps } from 'react-aria-components';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import * as react from 'react';
|
|
5
|
-
import { RefAttributes, HTMLAttributes, HTMLProps, ComponentProps, Ref,
|
|
5
|
+
import { RefAttributes, HTMLAttributes, HTMLProps, ComponentProps, Ref, ReactNode, RefObject, Dispatch, SetStateAction, JSX } from 'react';
|
|
6
6
|
import * as cva from 'cva';
|
|
7
7
|
import { VariantProps } from 'cva';
|
|
8
8
|
import { DisclosureState } from 'react-stately';
|
|
9
|
+
import { EmblaViewportRefType } from 'embla-carousel-react';
|
|
9
10
|
import { DateFormatterOptions } from 'react-aria';
|
|
10
11
|
import { FormValidationProps } from '@react-stately/form';
|
|
11
12
|
|
|
@@ -95,19 +96,12 @@ declare const Alertbox: ({ children, role, className, icon, variant, isDismissab
|
|
|
95
96
|
type AvatarProps = ComponentProps<'img'>;
|
|
96
97
|
declare const Avatar: ({ src, alt, className, onError, loading, ...rest }: AvatarProps) => react_jsx_runtime.JSX.Element;
|
|
97
98
|
|
|
98
|
-
type LinkProps = LinkProps$1 & React.RefAttributes<HTMLAnchorElement> & {
|
|
99
|
-
/** @private Used internally for slotted components */
|
|
100
|
-
_innerWrapper?: (props: LinkProps$1) => LinkProps['children'];
|
|
101
|
-
};
|
|
102
|
-
declare const _LinkContext: react.Context<ContextValue<Partial<LinkProps>, HTMLAnchorElement>>;
|
|
103
|
-
declare const Link: ({ ref: _ref, ..._props }: LinkProps) => react_jsx_runtime.JSX.Element;
|
|
104
|
-
|
|
105
99
|
type ButtonOrLinkProps$1 = {
|
|
106
100
|
children?: React.ReactNode;
|
|
107
101
|
/** Additional CSS className for the element. */
|
|
108
102
|
className?: string;
|
|
109
103
|
/** Determines whether to use an anchor or a button for the Backlink */
|
|
110
|
-
href?: LinkProps['href'];
|
|
104
|
+
href?: LinkProps$1['href'];
|
|
111
105
|
/** To add a permanent underline on the link (not only on hover)
|
|
112
106
|
* @default false
|
|
113
107
|
*/
|
|
@@ -115,7 +109,7 @@ type ButtonOrLinkProps$1 = {
|
|
|
115
109
|
/** Ref to the element. */
|
|
116
110
|
ref?: Ref<HTMLAnchorElement | HTMLButtonElement>;
|
|
117
111
|
};
|
|
118
|
-
type BacklinkProps = (ButtonProps$1 | LinkProps) & ButtonOrLinkProps$1;
|
|
112
|
+
type BacklinkProps = (ButtonProps$1 | LinkProps$1) & ButtonOrLinkProps$1;
|
|
119
113
|
declare function Backlink(props: BacklinkProps): react_jsx_runtime.JSX.Element;
|
|
120
114
|
|
|
121
115
|
type BadgeProps = VariantProps<typeof badgeVariants> & {
|
|
@@ -137,6 +131,34 @@ declare const badgeVariants: (props?: ({
|
|
|
137
131
|
})) | undefined) => string;
|
|
138
132
|
declare function Badge(props: BadgeProps): react_jsx_runtime.JSX.Element;
|
|
139
133
|
|
|
134
|
+
declare const _LinkContext: react.Context<ContextValue<Partial<LinkProps>, HTMLAnchorElement>>;
|
|
135
|
+
declare const linkVariants: (props?: (((VariantProps<(props?: ({
|
|
136
|
+
animateIcon?: "right" | "left" | "down" | "up" | "up-right" | undefined;
|
|
137
|
+
} & ({
|
|
138
|
+
class?: cva.ClassValue;
|
|
139
|
+
className?: never;
|
|
140
|
+
} | {
|
|
141
|
+
class?: never;
|
|
142
|
+
className?: cva.ClassValue;
|
|
143
|
+
})) | undefined) => string> & VariantProps<(props?: ({
|
|
144
|
+
class?: cva.ClassValue;
|
|
145
|
+
className?: never;
|
|
146
|
+
} | {
|
|
147
|
+
class?: never;
|
|
148
|
+
className?: cva.ClassValue;
|
|
149
|
+
}) | undefined) => string>) | undefined) & ({
|
|
150
|
+
class?: cva.ClassValue;
|
|
151
|
+
className?: never;
|
|
152
|
+
} | {
|
|
153
|
+
class?: never;
|
|
154
|
+
className?: cva.ClassValue;
|
|
155
|
+
})) | undefined) => string;
|
|
156
|
+
type LinkProps = VariantProps<typeof linkVariants> & LinkProps$1 & React.RefAttributes<HTMLAnchorElement> & {
|
|
157
|
+
/** @private Used internally for slotted components */
|
|
158
|
+
_innerWrapper?: (props: LinkProps$1) => LinkProps['children'];
|
|
159
|
+
};
|
|
160
|
+
declare const Link: ({ ref: _ref, animateIcon, ..._props }: LinkProps) => react_jsx_runtime.JSX.Element;
|
|
161
|
+
|
|
140
162
|
type BreadcrumbProps = {
|
|
141
163
|
/** Additional CSS className for the element. */
|
|
142
164
|
className?: string;
|
|
@@ -163,7 +185,15 @@ declare function Breadcrumbs(props: BreadcrumbsProps): react_jsx_runtime.JSX.Ele
|
|
|
163
185
|
/**
|
|
164
186
|
* Figma: https://www.figma.com/file/9OvSg0ZXI5E1eQYi7AWiWn/Grunnmuren-2.0-%E2%94%82-Designsystem?node-id=30%3A2574&mode=dev
|
|
165
187
|
*/
|
|
166
|
-
declare const buttonVariants: (props?: ({
|
|
188
|
+
declare const buttonVariants: (props?: (((VariantProps<(props?: ({
|
|
189
|
+
animateIcon?: "right" | "left" | "down" | "up" | "up-right" | undefined;
|
|
190
|
+
} & ({
|
|
191
|
+
class?: cva.ClassValue;
|
|
192
|
+
className?: never;
|
|
193
|
+
} | {
|
|
194
|
+
class?: never;
|
|
195
|
+
className?: cva.ClassValue;
|
|
196
|
+
})) | undefined) => string> & VariantProps<(props?: ({
|
|
167
197
|
variant?: "primary" | "secondary" | "tertiary" | undefined;
|
|
168
198
|
color?: "blue" | "mint" | "white" | undefined;
|
|
169
199
|
isIconOnly?: boolean | undefined;
|
|
@@ -174,6 +204,12 @@ declare const buttonVariants: (props?: ({
|
|
|
174
204
|
} | {
|
|
175
205
|
class?: never;
|
|
176
206
|
className?: cva.ClassValue;
|
|
207
|
+
})) | undefined) => string>) | undefined) & ({
|
|
208
|
+
class?: cva.ClassValue;
|
|
209
|
+
className?: never;
|
|
210
|
+
} | {
|
|
211
|
+
class?: never;
|
|
212
|
+
className?: cva.ClassValue;
|
|
177
213
|
})) | undefined) => string;
|
|
178
214
|
type ButtonOrLinkProps = VariantProps<typeof buttonVariants> & {
|
|
179
215
|
children?: React.ReactNode;
|
|
@@ -214,35 +250,79 @@ type CardLinkProps = (Omit<LinkProps$1, 'href'> & Required<Pick<LinkProps$1, 'hr
|
|
|
214
250
|
*/
|
|
215
251
|
declare const CardLink: ({ className: _className, href, ...restProps }: CardLinkProps) => react_jsx_runtime.JSX.Element;
|
|
216
252
|
|
|
217
|
-
type CarouselProps = Omit<HTMLProps<HTMLDivElement>, 'onChange'> & {
|
|
218
|
-
|
|
219
|
-
|
|
253
|
+
type CarouselProps = Omit<HTMLProps<HTMLDivElement>, 'onChange' | 'onSelect'> & {
|
|
254
|
+
children?: React.ReactNode;
|
|
255
|
+
/**
|
|
256
|
+
* Alignment of the items relative to the carousel viewport.
|
|
257
|
+
* @default 'center'
|
|
258
|
+
*/
|
|
259
|
+
align?: 'start' | 'center' | 'end';
|
|
260
|
+
/** Delay in milliseconds between each automatic transition of the carousel. Any interaction with the carousel will immediately stop the autoplay. */
|
|
261
|
+
autoPlayDelay?: number;
|
|
262
|
+
/**
|
|
263
|
+
* The initial snapped index of the carousel.
|
|
264
|
+
* @default 0
|
|
265
|
+
*/
|
|
266
|
+
initialIndex?: number;
|
|
267
|
+
/**
|
|
268
|
+
* Whether the carousel infinitely loops.
|
|
269
|
+
* @default false
|
|
270
|
+
*/
|
|
271
|
+
loop?: boolean;
|
|
272
|
+
/**
|
|
273
|
+
* Orientation of the carousel.
|
|
274
|
+
* @default 'horizontal'
|
|
275
|
+
*/
|
|
276
|
+
orientation?: 'horizontal' | 'vertical';
|
|
277
|
+
/**
|
|
278
|
+
* Callback invoked when the snapped index changes.
|
|
279
|
+
*/
|
|
280
|
+
onSelect?: (index: number) => void;
|
|
220
281
|
/**
|
|
221
|
-
* Callback
|
|
222
|
-
* The argument to the callback is an object containing `index` of the new item scrolled into view and the `id` of that item (if set on the `<CarouselItem>`)
|
|
223
|
-
* It also provides `prevIndex` which is the index of the previous item that was in view
|
|
224
|
-
* And `prevId`, which is the id of the previous item that was in view (if set on the `<CarouselItem>`)
|
|
225
|
-
* @param item { index: number; id?: string; prevIndex: number; prevId?: string }
|
|
282
|
+
* Callback invoked after the carousel scrolling "settles". Think of this as the debounced version of `onSelect`.
|
|
226
283
|
*/
|
|
227
|
-
|
|
284
|
+
onSettled?: (index: number) => void;
|
|
285
|
+
/**
|
|
286
|
+
* Whether the carousel should scroll with regular mouse/trackpad scroll gestures, in addition to swipe gestures.
|
|
287
|
+
* @default false
|
|
288
|
+
*/
|
|
289
|
+
scrollGestures?: boolean;
|
|
228
290
|
};
|
|
229
|
-
declare const Carousel: ({
|
|
291
|
+
declare const Carousel: ({ autoPlayDelay, align, children, initialIndex, orientation, onSelect, onSettled, loop, scrollGestures, ref, ...rest }: CarouselProps) => react_jsx_runtime.JSX.Element;
|
|
292
|
+
type CarouselContextValue = {
|
|
293
|
+
slidesInView: number[];
|
|
294
|
+
orientation: 'horizontal' | 'vertical';
|
|
295
|
+
/**
|
|
296
|
+
* @private
|
|
297
|
+
*/
|
|
298
|
+
'~emblaRef': EmblaViewportRefType | null;
|
|
299
|
+
};
|
|
300
|
+
declare const CarouselContext: react.Context<CarouselContextValue>;
|
|
301
|
+
type CarouselItemsContainer = HTMLProps<HTMLDivElement> & {
|
|
302
|
+
children: React.ReactNode;
|
|
303
|
+
};
|
|
304
|
+
declare const CarouselItemsContainer: ({ children, className, ...rest }: CarouselItemsContainer) => react_jsx_runtime.JSX.Element;
|
|
230
305
|
type CarouselItemsProps = HTMLProps<HTMLDivElement> & {
|
|
231
306
|
/** The <CarouselItem/> components to be displayed within the carousel. */
|
|
232
307
|
children: React.ReactNode;
|
|
233
308
|
};
|
|
234
309
|
declare const CarouselItems: ({ className, children }: CarouselItemsProps) => react_jsx_runtime.JSX.Element;
|
|
310
|
+
type CarouselControlsProps = HTMLProps<HTMLDivElement> & {
|
|
311
|
+
/** The <CarouselItem/> components to be displayed within the carousel. */
|
|
312
|
+
children: React.ReactNode;
|
|
313
|
+
};
|
|
314
|
+
/**
|
|
315
|
+
* This is internal for now, but we will expose it in the future when we support more flexible positioning of prev/next and other actions.
|
|
316
|
+
* It is used to render the prev/next buttons in the carousel for now.
|
|
317
|
+
*/
|
|
318
|
+
declare const CarouselControls: ({ children, className, ...rest }: CarouselControlsProps) => react_jsx_runtime.JSX.Element;
|
|
319
|
+
type CarouselButtonProps = ButtonProps & {
|
|
320
|
+
slot: 'next' | 'prev';
|
|
321
|
+
};
|
|
322
|
+
declare const CarouselButton: ({ className, isIconOnly, slot, ...rest }: CarouselButtonProps) => react_jsx_runtime.JSX.Element;
|
|
235
323
|
type CarouselItemProps = HTMLProps<HTMLDivElement> & {
|
|
236
324
|
/** The component/components to display as the <CarouselItem/>. */
|
|
237
|
-
children:
|
|
238
|
-
};
|
|
239
|
-
type CarouselItem = Pick<CarouselItemProps, 'id'> & {
|
|
240
|
-
/** The index of the item that is currently in view */
|
|
241
|
-
index: number;
|
|
242
|
-
/** The index of the previous item that was in view */
|
|
243
|
-
prevIndex: number;
|
|
244
|
-
/** The id of the previous item that was in view */
|
|
245
|
-
prevId?: CarouselItemProps['id'];
|
|
325
|
+
children: React.ReactNode;
|
|
246
326
|
};
|
|
247
327
|
declare const CarouselItem: ({ className, children, ...rest }: CarouselItemProps) => react_jsx_runtime.JSX.Element;
|
|
248
328
|
|
|
@@ -422,6 +502,10 @@ declare function GrunnmurenProvider({ children, locale, navigate, useHref, }: Gr
|
|
|
422
502
|
type HeroProps = HTMLProps<HTMLDivElement> & VariantProps<typeof variants> & {
|
|
423
503
|
children: React.ReactNode;
|
|
424
504
|
};
|
|
505
|
+
type HeroContextValue = {
|
|
506
|
+
variant: HeroProps['variant'];
|
|
507
|
+
};
|
|
508
|
+
declare const HeroContext: react.Context<HeroContextValue | null>;
|
|
425
509
|
declare const variants: (props?: ({
|
|
426
510
|
variant?: "standard" | "full-bleed" | "two-column" | undefined;
|
|
427
511
|
} & ({
|
|
@@ -758,5 +842,5 @@ type VideoLoopProps = {
|
|
|
758
842
|
};
|
|
759
843
|
declare const VideoLoop: ({ src, format, alt, className }: VideoLoopProps) => react_jsx_runtime.JSX.Element;
|
|
760
844
|
|
|
761
|
-
export { Accordion, AccordionItem, Alertbox, Avatar, Backlink, Badge, Breadcrumb, Breadcrumbs, Button, ButtonContext, Caption, Card, CardLink, Checkbox, CheckboxGroup, Combobox, ListBoxHeader as ComboboxHeader, ListBoxItem as ComboboxItem, ListBoxSection as ComboboxSection, Content, ContentContext, DateFormatter, Description, Disclosure, DisclosureButton, DisclosurePanel, DisclosureStateContext, ErrorMessage, Footer, GrunnmurenProvider, Heading, HeadingContext, Label, LinkList, LinkListContainer, LinkListItem, Media, MediaContext, NumberField, Radio, RadioGroup, Select, ListBoxHeader as SelectHeader, ListBoxItem as SelectItem, ListBoxSection as SelectSection, Tag, TagGroup, TagList, TextArea, TextField, Carousel as UNSAFE_Carousel, CarouselItem as UNSAFE_CarouselItem, CarouselItems as UNSAFE_CarouselItems, Dialog as UNSAFE_Dialog, DialogTrigger as UNSAFE_DialogTrigger, FileUpload as UNSAFE_FileUpload, Hero as UNSAFE_Hero, Link as UNSAFE_Link, Modal as UNSAFE_Modal, ProgressBar as UNSAFE_ProgressBar, ProgressBarValueText as UNSAFE_ProgressBarValueText, Tab as UNSAFE_Tab, TabList as UNSAFE_TabList, TabPanel as UNSAFE_TabPanel, Table as UNSAFE_Table, TableBody as UNSAFE_TableBody, TableCell as UNSAFE_TableCell, TableColumn as UNSAFE_TableColumn, TableColumnResizer as UNSAFE_TableColumnResizer, TableContainer as UNSAFE_TableContainer, TableHeader as UNSAFE_TableHeader, TableRow as UNSAFE_TableRow, Tabs as UNSAFE_Tabs, VideoLoop, _LinkContext, _useLocale as useLocale };
|
|
762
|
-
export type { AccordionItemProps, AccordionProps, Props as AlertboxProps, AvatarProps, BacklinkProps, BadgeProps, BreadcrumbProps, BreadcrumbsProps, ButtonProps, CaptionProps, CardLinkProps, CardProps, CheckboxGroupProps, CheckboxProps, ComboboxProps, ContentProps, DateFormatterProps, DescriptionProps, DisclosureButtonProps, DisclosurePanelProps, DisclosureProps, ErrorMessageProps, FooterProps, GrunnmurenProviderProps, HeadingProps, LinkListContainerProps, LinkListItemProps, LinkListProps, Locale, MediaProps, NumberFieldProps, RadioGroupProps, RadioProps, SelectProps, TagGroupProps, TagListProps, TagProps, TextAreaProps, TextFieldProps, CarouselItemProps as UNSAFE_CarouselItemProps, CarouselItemsProps as UNSAFE_CarouselItemsProps, CarouselProps as UNSAFE_CarouselProps, DialogProps as UNSAFE_DialogProps, DialogTriggerProps as UNSAFE_DialogTriggerProps, FileUploadProps as UNSAFE_FileUploadProps, HeroProps as UNSAFE_HeroProps, LinkProps as UNSAFE_LinkProps, ModalProps as UNSAFE_ModalProps, ProgressBarProps as UNSAFE_ProgressBarProps, ProgressBarValueTextProps as UNSAFE_ProgressBarValueTextProps, TabListProps as UNSAFE_TabListProps, TabPanelProps as UNSAFE_TabPanelProps, TabProps as UNSAFE_TabProps, TableBodyProps as UNSAFE_TableBodyProps, TableCellProps as UNSAFE_TableCellProps, TableColumnProps as UNSAFE_TableColumnProps, TableColumnResizerProps as UNSAFE_TableColumnResizerProps, TableContainerProps as UNSAFE_TableContainerProps, TableHeaderProps as UNSAFE_TableHeaderProps, TableProps as UNSAFE_TableProps, TableRowProps as UNSAFE_TableRowProps, TabsProps as UNSAFE_TabsProps };
|
|
845
|
+
export { Accordion, AccordionItem, Alertbox, Avatar, Backlink, Badge, Breadcrumb, Breadcrumbs, Button, ButtonContext, Caption, Card, CardLink, Checkbox, CheckboxGroup, Combobox, ListBoxHeader as ComboboxHeader, ListBoxItem as ComboboxItem, ListBoxSection as ComboboxSection, Content, ContentContext, DateFormatter, Description, Disclosure, DisclosureButton, DisclosurePanel, DisclosureStateContext, ErrorMessage, Footer, GrunnmurenProvider, Heading, HeadingContext, Label, LinkList, LinkListContainer, LinkListItem, Media, MediaContext, NumberField, Radio, RadioGroup, Select, ListBoxHeader as SelectHeader, ListBoxItem as SelectItem, ListBoxSection as SelectSection, Tag, TagGroup, TagList, TextArea, TextField, Carousel as UNSAFE_Carousel, CarouselButton as UNSAFE_CarouselButton, CarouselContext as UNSAFE_CarouselContext, CarouselControls as UNSAFE_CarouselControls, CarouselItem as UNSAFE_CarouselItem, CarouselItems as UNSAFE_CarouselItems, CarouselItemsContainer as UNSAFE_CarouselItemsContainer, CarouselItemsContainer as UNSAFE_CarouselItemsContainerProps, Dialog as UNSAFE_Dialog, DialogTrigger as UNSAFE_DialogTrigger, FileUpload as UNSAFE_FileUpload, Hero as UNSAFE_Hero, HeroContext as UNSAFE_HeroContext, Link as UNSAFE_Link, Modal as UNSAFE_Modal, ProgressBar as UNSAFE_ProgressBar, ProgressBarValueText as UNSAFE_ProgressBarValueText, Tab as UNSAFE_Tab, TabList as UNSAFE_TabList, TabPanel as UNSAFE_TabPanel, Table as UNSAFE_Table, TableBody as UNSAFE_TableBody, TableCell as UNSAFE_TableCell, TableColumn as UNSAFE_TableColumn, TableColumnResizer as UNSAFE_TableColumnResizer, TableContainer as UNSAFE_TableContainer, TableHeader as UNSAFE_TableHeader, TableRow as UNSAFE_TableRow, Tabs as UNSAFE_Tabs, VideoLoop, _LinkContext, _useLocale as useLocale };
|
|
846
|
+
export type { AccordionItemProps, AccordionProps, Props as AlertboxProps, AvatarProps, BacklinkProps, BadgeProps, BreadcrumbProps, BreadcrumbsProps, ButtonProps, CaptionProps, CardLinkProps, CardProps, CheckboxGroupProps, CheckboxProps, ComboboxProps, ContentProps, DateFormatterProps, DescriptionProps, DisclosureButtonProps, DisclosurePanelProps, DisclosureProps, ErrorMessageProps, FooterProps, GrunnmurenProviderProps, HeadingProps, LinkListContainerProps, LinkListItemProps, LinkListProps, Locale, MediaProps, NumberFieldProps, RadioGroupProps, RadioProps, SelectProps, TagGroupProps, TagListProps, TagProps, TextAreaProps, TextFieldProps, CarouselButtonProps as UNSAFE_CarouselButtonProps, CarouselContextValue as UNSAFE_CarouselContextValue, CarouselControlsProps as UNSAFE_CarouselControlsProps, CarouselItemProps as UNSAFE_CarouselItemProps, CarouselItemsProps as UNSAFE_CarouselItemsProps, CarouselProps as UNSAFE_CarouselProps, DialogProps as UNSAFE_DialogProps, DialogTriggerProps as UNSAFE_DialogTriggerProps, FileUploadProps as UNSAFE_FileUploadProps, HeroContextValue as UNSAFE_HeroContextValue, HeroProps as UNSAFE_HeroProps, LinkProps as UNSAFE_LinkProps, ModalProps as UNSAFE_ModalProps, ProgressBarProps as UNSAFE_ProgressBarProps, ProgressBarValueTextProps as UNSAFE_ProgressBarValueTextProps, TabListProps as UNSAFE_TabListProps, TabPanelProps as UNSAFE_TabPanelProps, TabProps as UNSAFE_TabProps, TableBodyProps as UNSAFE_TableBodyProps, TableCellProps as UNSAFE_TableCellProps, TableColumnProps as UNSAFE_TableColumnProps, TableColumnResizerProps as UNSAFE_TableColumnResizerProps, TableContainerProps as UNSAFE_TableContainerProps, TableHeaderProps as UNSAFE_TableHeaderProps, TableProps as UNSAFE_TableProps, TableRowProps as UNSAFE_TableRowProps, TabsProps as UNSAFE_TabsProps };
|