@obosbbl/grunnmuren-react 2.0.0-canary.41 → 2.0.0-canary.44
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/index.d.mts +10 -10
- package/dist/index.mjs +12 -4
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ import { RouterProvider, ButtonProps as ButtonProps$1, LinkProps, CheckboxProps
|
|
|
2
2
|
export { ListBoxItemProps as ComboboxItemProps, Form, 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 { HTMLProps,
|
|
5
|
+
import { HTMLProps, ReactNode } from 'react';
|
|
6
6
|
import { VariantProps } from 'cva';
|
|
7
7
|
import { DateFormatterOptions } from 'react-aria';
|
|
8
8
|
|
|
@@ -686,14 +686,12 @@ type HeadingProps = HTMLProps<HTMLHeadingElement> & {
|
|
|
686
686
|
_innerWrapper?: (children: React.ReactNode) => React.ReactNode;
|
|
687
687
|
};
|
|
688
688
|
declare const HeadingContext: react.Context<ContextValue<Partial<HeadingProps>, HTMLHeadingElement>>;
|
|
689
|
-
declare const Heading: (props: HeadingProps, ref: Ref<HTMLHeadingElement>) => react_jsx_runtime.JSX.Element;
|
|
690
689
|
declare const ContentContext: react.Context<ContextValue<Partial<ContentProps>, HTMLDivElement>>;
|
|
691
690
|
type ContentProps = HTMLProps<HTMLDivElement> & {
|
|
692
691
|
children: React.ReactNode;
|
|
693
692
|
/** @private Used internally for slotted components */
|
|
694
693
|
_outerWrapper?: (children: React.ReactNode) => React.ReactNode;
|
|
695
694
|
};
|
|
696
|
-
declare const Content: (props: ContentProps, ref: Ref<HTMLDivElement>) => string | number | bigint | boolean | Iterable<react.ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<react.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
|
|
697
695
|
type MediaProps = HTMLProps<HTMLDivElement> & {
|
|
698
696
|
children: React.ReactNode;
|
|
699
697
|
};
|
|
@@ -702,6 +700,8 @@ type FooterProps = HTMLProps<HTMLDivElement> & {
|
|
|
702
700
|
children: React.ReactNode;
|
|
703
701
|
};
|
|
704
702
|
declare const Footer: (props: FooterProps) => react_jsx_runtime.JSX.Element;
|
|
703
|
+
declare const _Heading: react.ForwardRefExoticComponent<Omit<HeadingProps, "ref"> & react.RefAttributes<HTMLHeadingElement>>;
|
|
704
|
+
declare const _Content: react.ForwardRefExoticComponent<Omit<ContentProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
705
705
|
|
|
706
706
|
type BreadcrumbProps = {
|
|
707
707
|
/** Additional CSS className for the element. */
|
|
@@ -811,13 +811,13 @@ declare const cardVariants: (props?: ({
|
|
|
811
811
|
} | null | undefined;
|
|
812
812
|
})) | undefined) => string;
|
|
813
813
|
declare const Card: ({ children, className: _className, variant, ...restProps }: CardProps) => react_jsx_runtime.JSX.Element;
|
|
814
|
-
type
|
|
815
|
-
|
|
816
|
-
children: React.ReactNode;
|
|
817
|
-
};
|
|
818
|
-
type CardLinkProps = {
|
|
814
|
+
type CardLinkWrapperProps = {
|
|
815
|
+
children?: React.ReactNode;
|
|
819
816
|
className?: string;
|
|
820
|
-
} &
|
|
817
|
+
} & {
|
|
818
|
+
[K in keyof Omit<LinkProps, 'className' | 'children'>]?: never;
|
|
819
|
+
};
|
|
820
|
+
type CardLinkProps = (Omit<LinkProps, 'href'> & Required<Pick<LinkProps, 'href'>>) | CardLinkWrapperProps;
|
|
821
821
|
/**
|
|
822
822
|
* A component that creates a clickable area on a card.
|
|
823
823
|
* It can be used either as a wrapper around a link or as a standalone link.
|
|
@@ -837,4 +837,4 @@ type DateFormatterProps = {
|
|
|
837
837
|
*/
|
|
838
838
|
declare const DateFormatter: ({ options: _options, value, children: render, }: DateFormatterProps) => ReactNode;
|
|
839
839
|
|
|
840
|
-
export { _Accordion as Accordion, _AccordionItem as AccordionItem, type AccordionItemProps, type AccordionProps, Alertbox, type Props as AlertboxProps, _Backlink as Backlink, type BacklinkProps, _Badge as Badge, type BadgeProps, _Breadcrumb as Breadcrumb, type BreadcrumbProps, _Breadcrumbs as Breadcrumbs, type BreadcrumbsProps, _Button as Button, type ButtonProps, Card, CardLink, type CardLinkProps, type CardProps, _Checkbox as Checkbox, _CheckboxGroup as CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, _Combobox as Combobox, ListBoxItem as ComboboxItem, type ComboboxProps, Content, ContentContext, type ContentProps, DateFormatter, type DateFormatterProps, Footer, type FooterProps, GrunnmurenProvider, type GrunnmurenProviderProps, Heading, HeadingContext, type HeadingProps, type Locale, Media, type MediaProps, _NumberField as NumberField, type NumberFieldProps, _Radio as Radio, _RadioGroup as RadioGroup, type RadioGroupProps, type RadioProps, _Select as Select, ListBoxItem as SelectItem, type SelectProps, _TextArea as TextArea, type TextAreaProps, _TextField as TextField, type TextFieldProps, _useLocale as useLocale };
|
|
840
|
+
export { _Accordion as Accordion, _AccordionItem as AccordionItem, type AccordionItemProps, type AccordionProps, Alertbox, type Props as AlertboxProps, _Backlink as Backlink, type BacklinkProps, _Badge as Badge, type BadgeProps, _Breadcrumb as Breadcrumb, type BreadcrumbProps, _Breadcrumbs as Breadcrumbs, type BreadcrumbsProps, _Button as Button, type ButtonProps, Card, CardLink, type CardLinkProps, type CardProps, _Checkbox as Checkbox, _CheckboxGroup as CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, _Combobox as Combobox, ListBoxItem as ComboboxItem, type ComboboxProps, _Content as Content, ContentContext, type ContentProps, DateFormatter, type DateFormatterProps, Footer, type FooterProps, GrunnmurenProvider, type GrunnmurenProviderProps, _Heading as Heading, HeadingContext, type HeadingProps, type Locale, Media, type MediaProps, _NumberField as NumberField, type NumberFieldProps, _Radio as Radio, _RadioGroup as RadioGroup, type RadioGroupProps, type RadioProps, _Select as Select, ListBoxItem as SelectItem, type SelectProps, _TextArea as TextArea, type TextAreaProps, _TextField as TextField, type TextFieldProps, _useLocale as useLocale };
|
package/dist/index.mjs
CHANGED
|
@@ -59,6 +59,8 @@ const Footer = (props)=>/*#__PURE__*/ jsx("div", {
|
|
|
59
59
|
...props,
|
|
60
60
|
"data-slot": "footer"
|
|
61
61
|
});
|
|
62
|
+
const _Heading = /*#__PURE__*/ forwardRef(Heading);
|
|
63
|
+
const _Content = /*#__PURE__*/ forwardRef(Content);
|
|
62
64
|
|
|
63
65
|
function Accordion(props, ref) {
|
|
64
66
|
const { children, className, ...restProps } = props;
|
|
@@ -1061,6 +1063,8 @@ const cardVariants = cva({
|
|
|
1061
1063
|
'[&_[data-slot="heading"]]:leading-6',
|
|
1062
1064
|
'[&_[data-slot="heading"]]:w-fit',
|
|
1063
1065
|
'[&_[data-slot="heading"]]:text-pretty',
|
|
1066
|
+
'[&_[data-slot="heading"]]:hyphens-auto',
|
|
1067
|
+
'[&_[data-slot="heading"]]:[word-break:break-word]',
|
|
1064
1068
|
// **** Content ****
|
|
1065
1069
|
'[&_[data-slot="content"]]:grid [&_[data-slot="content"]]:auto-rows-max [&_[data-slot="content"]]:gap-y-4',
|
|
1066
1070
|
// **** Media ****
|
|
@@ -1086,7 +1090,11 @@ const cardVariants = cva({
|
|
|
1086
1090
|
'[&_[data-slot="heading"]_[data-slot="card-link"]]:transition-colors',
|
|
1087
1091
|
'[&_[data-slot="heading"]_[data-slot="card-link"]:hover]:border-b-current',
|
|
1088
1092
|
// Mimic heading styles for the card link if placed in the heading slot. This is necessary to make the custom underline align with the link text
|
|
1089
|
-
'[&_[data-slot="heading"]_[data-slot="card-link"]]:heading-s
|
|
1093
|
+
'[&_[data-slot="heading"]_[data-slot="card-link"]]:heading-s',
|
|
1094
|
+
'[&_[data-slot="heading"]_[data-slot="card-link"]]:leading-6',
|
|
1095
|
+
'[&_[data-slot="heading"]_[data-slot="card-link"]]:text-pretty',
|
|
1096
|
+
'[&_[data-slot="heading"]_[data-slot="card-link"]]:hyphens-auto',
|
|
1097
|
+
'[&_[data-slot="heading"]_[data-slot="card-link"]]:[word-break:break-word]',
|
|
1090
1098
|
// **** Fail-safe for interactive elements ****
|
|
1091
1099
|
// Make interactive elements clickable by themselves, while the rest of the card is clickable as a whole
|
|
1092
1100
|
// The card is made clickable by a pseudo-element on the heading that covers the entire card
|
|
@@ -1180,9 +1188,9 @@ const cardLinkVariants = cva({
|
|
|
1180
1188
|
// because it still renders with role="link" and tabindex="0" which makes it focusable.
|
|
1181
1189
|
// So we need to render a div instead.
|
|
1182
1190
|
/*#__PURE__*/ jsx("div", {
|
|
1191
|
+
...restProps,
|
|
1183
1192
|
"data-slot": "card-link",
|
|
1184
|
-
className: className
|
|
1185
|
-
...restProps
|
|
1193
|
+
className: className
|
|
1186
1194
|
});
|
|
1187
1195
|
};
|
|
1188
1196
|
|
|
@@ -1201,4 +1209,4 @@ const cardLinkVariants = cva({
|
|
|
1201
1209
|
return render ? render(formatted) : formatted;
|
|
1202
1210
|
};
|
|
1203
1211
|
|
|
1204
|
-
export { _Accordion as Accordion, _AccordionItem as AccordionItem, Alertbox, _Backlink as Backlink, _Badge as Badge, _Breadcrumb as Breadcrumb, _Breadcrumbs as Breadcrumbs, _Button as Button, Card, CardLink, _Checkbox as Checkbox, _CheckboxGroup as CheckboxGroup, _Combobox as Combobox, ListBoxItem as ComboboxItem, Content, ContentContext, DateFormatter, Footer, GrunnmurenProvider, Heading, HeadingContext, Media, _NumberField as NumberField, _Radio as Radio, _RadioGroup as RadioGroup, _Select as Select, ListBoxItem as SelectItem, _TextArea as TextArea, _TextField as TextField, _useLocale as useLocale };
|
|
1212
|
+
export { _Accordion as Accordion, _AccordionItem as AccordionItem, Alertbox, _Backlink as Backlink, _Badge as Badge, _Breadcrumb as Breadcrumb, _Breadcrumbs as Breadcrumbs, _Button as Button, Card, CardLink, _Checkbox as Checkbox, _CheckboxGroup as CheckboxGroup, _Combobox as Combobox, ListBoxItem as ComboboxItem, _Content as Content, ContentContext, DateFormatter, Footer, GrunnmurenProvider, _Heading as Heading, HeadingContext, Media, _NumberField as NumberField, _Radio as Radio, _RadioGroup as RadioGroup, _Select as Select, ListBoxItem as SelectItem, _TextArea as TextArea, _TextField as TextField, _useLocale as useLocale };
|