@obosbbl/grunnmuren-react 2.0.0-canary.40 → 2.0.0-canary.41
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 +11 -11
- package/dist/index.mjs +19 -14
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { RouterProvider, ButtonProps as ButtonProps$1,
|
|
1
|
+
import { RouterProvider, ButtonProps as ButtonProps$1, LinkProps, CheckboxProps as CheckboxProps$1, CheckboxGroupProps as CheckboxGroupProps$1, ListBoxItemProps, ComboBoxProps, RadioGroupProps as RadioGroupProps$1, RadioProps as RadioProps$1, SelectProps as SelectProps$1, TextFieldProps as TextFieldProps$1, NumberFieldProps as NumberFieldProps$1, ContextValue, BreadcrumbProps as BreadcrumbProps$1, BreadcrumbsProps as BreadcrumbsProps$1, Link } from 'react-aria-components';
|
|
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
|
|
5
|
+
import { HTMLProps, Ref, ReactNode } from 'react';
|
|
6
6
|
import { VariantProps } from 'cva';
|
|
7
7
|
import { DateFormatterOptions } from 'react-aria';
|
|
8
8
|
|
|
@@ -28,18 +28,18 @@ type GrunnmurenProviderProps = {
|
|
|
28
28
|
declare function GrunnmurenProvider({ children, locale, navigate, useHref, }: GrunnmurenProviderProps): react_jsx_runtime.JSX.Element;
|
|
29
29
|
|
|
30
30
|
type AccordionProps = {
|
|
31
|
-
children:
|
|
31
|
+
children: React.ReactNode;
|
|
32
32
|
/** Additional CSS className for the element. */
|
|
33
33
|
className?: string;
|
|
34
34
|
/** Additional style properties for the element. */
|
|
35
|
-
style?:
|
|
35
|
+
style?: React.CSSProperties;
|
|
36
36
|
};
|
|
37
37
|
type AccordionItemProps = {
|
|
38
|
-
children?:
|
|
38
|
+
children?: React.ReactNode;
|
|
39
39
|
/** Additional CSS className for the element. */
|
|
40
40
|
className?: string;
|
|
41
41
|
/** Additional style properties for the element. */
|
|
42
|
-
style?:
|
|
42
|
+
style?: React.CSSProperties;
|
|
43
43
|
/** Whether the accordion is open (controlled) */
|
|
44
44
|
isOpen?: boolean;
|
|
45
45
|
/** Whether the accordion is open by default (uncontrolled) */
|
|
@@ -47,8 +47,8 @@ type AccordionItemProps = {
|
|
|
47
47
|
/** Handler that is called when the accordion's open state changes */
|
|
48
48
|
onOpenChange?: (isOpen: boolean) => void;
|
|
49
49
|
};
|
|
50
|
-
declare const _Accordion:
|
|
51
|
-
declare const _AccordionItem:
|
|
50
|
+
declare const _Accordion: react.ForwardRefExoticComponent<AccordionProps & react.RefAttributes<HTMLDivElement>>;
|
|
51
|
+
declare const _AccordionItem: react.ForwardRefExoticComponent<AccordionItemProps & react.RefAttributes<HTMLDivElement>>;
|
|
52
52
|
|
|
53
53
|
type BadgeProps = VariantProps<typeof badgeVariants> & {
|
|
54
54
|
children?: React.ReactNode;
|
|
@@ -249,7 +249,7 @@ type ButtonOrLinkProps$1 = VariantProps<typeof buttonVariants> & {
|
|
|
249
249
|
/** Additional style properties for the element. */
|
|
250
250
|
style?: React.CSSProperties;
|
|
251
251
|
};
|
|
252
|
-
type ButtonProps = (ButtonProps$1 |
|
|
252
|
+
type ButtonProps = (ButtonProps$1 | LinkProps) & ButtonOrLinkProps$1;
|
|
253
253
|
declare const _Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
|
|
254
254
|
|
|
255
255
|
type CheckboxProps = {
|
|
@@ -686,14 +686,14 @@ 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:
|
|
689
|
+
declare const Heading: (props: HeadingProps, ref: Ref<HTMLHeadingElement>) => react_jsx_runtime.JSX.Element;
|
|
690
690
|
declare const ContentContext: react.Context<ContextValue<Partial<ContentProps>, HTMLDivElement>>;
|
|
691
691
|
type ContentProps = HTMLProps<HTMLDivElement> & {
|
|
692
692
|
children: React.ReactNode;
|
|
693
693
|
/** @private Used internally for slotted components */
|
|
694
694
|
_outerWrapper?: (children: React.ReactNode) => React.ReactNode;
|
|
695
695
|
};
|
|
696
|
-
declare const Content: (props: ContentProps, ref:
|
|
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
697
|
type MediaProps = HTMLProps<HTMLDivElement> & {
|
|
698
698
|
children: React.ReactNode;
|
|
699
699
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { I18nProvider, RouterProvider, useLocale, useContextProps, Provider, Link, Button as Button$1, Text, CheckboxContext, Checkbox as Checkbox$1, Label as Label$1,
|
|
2
|
+
import { I18nProvider, RouterProvider, useLocale, useContextProps, Provider, Link, Button as Button$1, Text, CheckboxContext, Checkbox as Checkbox$1, FieldError, Label as Label$1, CheckboxGroup as CheckboxGroup$1, ListBoxItem as ListBoxItem$1, ListBox as ListBox$1, ComboBox, Group, Input, Popover, RadioGroup as RadioGroup$1, Radio as Radio$1, Select as Select$1, SelectValue, TextField as TextField$1, TextArea as TextArea$1, NumberField as NumberField$1, Breadcrumbs as Breadcrumbs$1, Breadcrumb as Breadcrumb$1 } from 'react-aria-components';
|
|
3
3
|
export { Form } from 'react-aria-components';
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
|
-
import { createContext, forwardRef, Children, useId, useState } from 'react';
|
|
6
|
-
import { cx, cva, compose } from 'cva';
|
|
7
5
|
import { ChevronDown, LoadingSpinner, Check, Close, InfoCircle, CheckCircle, Warning, CloseCircle, ChevronRight, ChevronLeft } from '@obosbbl/grunnmuren-icons-react';
|
|
8
6
|
import { useLayoutEffect } from '@react-aria/utils';
|
|
7
|
+
import { cx, cva, compose } from 'cva';
|
|
8
|
+
import { createContext, forwardRef, Children, useId, useState } from 'react';
|
|
9
9
|
import { useProgressBar, useDateFormatter } from 'react-aria';
|
|
10
10
|
|
|
11
11
|
function GrunnmurenProvider({ children, locale = 'nb', navigate, useHref }) {
|
|
@@ -29,6 +29,7 @@ function GrunnmurenProvider({ children, locale = 'nb', navigate, useHref }) {
|
|
|
29
29
|
|
|
30
30
|
const HeadingContext = /*#__PURE__*/ createContext({});
|
|
31
31
|
const Heading = (props, ref)=>{
|
|
32
|
+
// biome-ignore lint/style/noParameterAssign: fix when removing refs for React 19
|
|
32
33
|
[props, ref] = useContextProps(props, ref, HeadingContext);
|
|
33
34
|
const { children, level, className, _innerWrapper: innerWrapper, ...restProps } = props;
|
|
34
35
|
const Element = `h${level}`;
|
|
@@ -41,6 +42,7 @@ const Heading = (props, ref)=>{
|
|
|
41
42
|
};
|
|
42
43
|
const ContentContext = /*#__PURE__*/ createContext({});
|
|
43
44
|
const Content = (props, ref)=>{
|
|
45
|
+
// biome-ignore lint/style/noParameterAssign: fix when removing refs for React 19
|
|
44
46
|
[props, ref] = useContextProps(props, ref, ContentContext);
|
|
45
47
|
const { _outerWrapper: outerWrapper, ...restProps } = props;
|
|
46
48
|
const content = /*#__PURE__*/ jsx("div", {
|
|
@@ -129,6 +131,7 @@ function AccordionItem(props, ref) {
|
|
|
129
131
|
className: "flex min-h-[44px] w-full items-center justify-between gap-1.5 rounded-lg px-2 py-3.5 text-left focus-visible:outline-focus focus-visible:outline-focus-inset",
|
|
130
132
|
id: buttonId,
|
|
131
133
|
onClick: handleOpenChange,
|
|
134
|
+
type: "button",
|
|
132
135
|
children: [
|
|
133
136
|
children,
|
|
134
137
|
/*#__PURE__*/ jsx(ChevronDown, {
|
|
@@ -426,8 +429,8 @@ function CheckmarkBox() {
|
|
|
426
429
|
function Checkbox(props, ref) {
|
|
427
430
|
const { children, className, description, errorMessage, isInvalid: _isInvalid, ...restProps } = props;
|
|
428
431
|
const id = useId();
|
|
429
|
-
const descriptionId =
|
|
430
|
-
const errorMessageId =
|
|
432
|
+
const descriptionId = `desc${id}`;
|
|
433
|
+
const errorMessageId = `error${id}`;
|
|
431
434
|
const isInvalid = errorMessage != null || _isInvalid;
|
|
432
435
|
return /*#__PURE__*/ jsx("div", {
|
|
433
436
|
children: /*#__PURE__*/ jsxs(CheckboxContext.Provider, {
|
|
@@ -464,15 +467,6 @@ function Checkbox(props, ref) {
|
|
|
464
467
|
}
|
|
465
468
|
const _Checkbox = /*#__PURE__*/ forwardRef(Checkbox);
|
|
466
469
|
|
|
467
|
-
function Label(props) {
|
|
468
|
-
const { children, className, ...restProps } = props;
|
|
469
|
-
return /*#__PURE__*/ jsx(Label$1, {
|
|
470
|
-
className: cx(className, 'font-semibold leading-7'),
|
|
471
|
-
...restProps,
|
|
472
|
-
children: children
|
|
473
|
-
});
|
|
474
|
-
}
|
|
475
|
-
|
|
476
470
|
function Description(props) {
|
|
477
471
|
const { className, ...restProps } = props;
|
|
478
472
|
return /*#__PURE__*/ jsx(Text, {
|
|
@@ -493,6 +487,15 @@ function Description(props) {
|
|
|
493
487
|
});
|
|
494
488
|
}
|
|
495
489
|
|
|
490
|
+
function Label(props) {
|
|
491
|
+
const { children, className, ...restProps } = props;
|
|
492
|
+
return /*#__PURE__*/ jsx(Label$1, {
|
|
493
|
+
className: cx(className, 'font-semibold leading-7'),
|
|
494
|
+
...restProps,
|
|
495
|
+
children: children
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
|
|
496
499
|
function CheckboxGroup(props, ref) {
|
|
497
500
|
const { children, className, description, errorMessage, label, isRequired, isInvalid: _isInvalid, ...restProps } = props;
|
|
498
501
|
// the order of the conditions matter here, because providing a value for isInvalid makes the validation state "controlled",
|
|
@@ -962,6 +965,7 @@ const Alertbox = ({ children, role, className, variant = 'info', isDismissable =
|
|
|
962
965
|
className: cx('-m-2 grid h-11 w-11 place-items-center rounded-xl', 'focus-visible:outline-focus focus-visible:-outline-offset-8'),
|
|
963
966
|
onClick: close,
|
|
964
967
|
"aria-label": translations.close[locale],
|
|
968
|
+
type: "button",
|
|
965
969
|
children: /*#__PURE__*/ jsx(Close, {})
|
|
966
970
|
}),
|
|
967
971
|
isExpandable && /*#__PURE__*/ jsxs("button", {
|
|
@@ -970,6 +974,7 @@ const Alertbox = ({ children, role, className, variant = 'info', isDismissable =
|
|
|
970
974
|
onClick: ()=>setIsExpanded((prevState)=>!prevState),
|
|
971
975
|
"aria-expanded": isExpanded,
|
|
972
976
|
"aria-controls": id,
|
|
977
|
+
type: "button",
|
|
973
978
|
children: [
|
|
974
979
|
isExpanded ? translations.showLess[locale] : translations.showMore[locale],
|
|
975
980
|
/*#__PURE__*/ jsx(ChevronDown, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@obosbbl/grunnmuren-react",
|
|
3
|
-
"version": "2.0.0-canary.
|
|
3
|
+
"version": "2.0.0-canary.41",
|
|
4
4
|
"description": "Grunnmuren components in React",
|
|
5
5
|
"repository": {
|
|
6
6
|
"url": "https://github.com/code-obos/grunnmuren"
|
|
@@ -18,15 +18,15 @@
|
|
|
18
18
|
"dist"
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@obosbbl/grunnmuren-icons-react": "^2.0.0-canary.
|
|
21
|
+
"@obosbbl/grunnmuren-icons-react": "^2.0.0-canary.3",
|
|
22
22
|
"@react-aria/utils": "^3.25.1",
|
|
23
23
|
"@types/node": "^22.0.0",
|
|
24
|
-
"cva": "1.0.0-beta.
|
|
24
|
+
"cva": "1.0.0-beta.2",
|
|
25
25
|
"react-aria": "^3.35.1",
|
|
26
26
|
"react-aria-components": "^1.3.1"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"react": "^18"
|
|
29
|
+
"react": "^18 || ^19"
|
|
30
30
|
},
|
|
31
31
|
"scripts": {
|
|
32
32
|
"build": "bunchee"
|