@obosbbl/grunnmuren-react 3.2.0 → 3.2.1
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.mjs
CHANGED
|
@@ -350,6 +350,11 @@ const translations$1 = {
|
|
|
350
350
|
nb: 'Neste',
|
|
351
351
|
sv: 'Nästa',
|
|
352
352
|
en: 'Next'
|
|
353
|
+
},
|
|
354
|
+
externalLink: {
|
|
355
|
+
nb: '(ekstern lenke)',
|
|
356
|
+
sv: '(extern länk)',
|
|
357
|
+
en: '(external link)'
|
|
353
358
|
}
|
|
354
359
|
};
|
|
355
360
|
|
|
@@ -477,12 +482,29 @@ const Avatar = ({ src, alt = '', className, onError, loading = 'lazy', ...rest }
|
|
|
477
482
|
});
|
|
478
483
|
};
|
|
479
484
|
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
485
|
+
const _LinkContext = /*#__PURE__*/ createContext({});
|
|
486
|
+
const Link = ({ ref: _ref, ..._props })=>{
|
|
487
|
+
const [props, ref] = useContextProps(_props, _ref, _LinkContext);
|
|
488
|
+
const { className, _innerWrapper, children: _children, ...restProps } = props;
|
|
489
|
+
const locale = _useLocale();
|
|
490
|
+
const externalLinkSR = props.rel?.includes('external') ? /*#__PURE__*/ jsx("span", {
|
|
491
|
+
className: "sr-only",
|
|
492
|
+
children: translations$1.externalLink[locale]
|
|
493
|
+
}) : null;
|
|
494
|
+
const reactNodeChildren = /*#__PURE__*/ jsxs(Fragment, {
|
|
495
|
+
children: [
|
|
496
|
+
_children,
|
|
497
|
+
externalLinkSR
|
|
498
|
+
]
|
|
499
|
+
});
|
|
500
|
+
const children = _innerWrapper ? _innerWrapper({
|
|
501
|
+
...restProps,
|
|
502
|
+
children: typeof _children === 'function' ? (values)=>_children(values) : reactNodeChildren
|
|
503
|
+
}) : reactNodeChildren;
|
|
484
504
|
return /*#__PURE__*/ jsx(Link$1, {
|
|
485
505
|
...restProps,
|
|
506
|
+
ref: ref,
|
|
507
|
+
"data-slot": "link",
|
|
486
508
|
className: cx(className, 'inline-flex cursor-pointer items-center gap-1 font-medium hover:no-underline focus-visible:outline-current focus-visible:outline-focus-offset [&>svg]:shrink-0 [&>svg]:transition-transform'),
|
|
487
509
|
children: children
|
|
488
510
|
});
|
|
@@ -1926,50 +1948,61 @@ const Hero = ({ variant, className, children, ...rest })=>{
|
|
|
1926
1948
|
});
|
|
1927
1949
|
};
|
|
1928
1950
|
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1951
|
+
// Sets the correct icons for each link in the link list
|
|
1952
|
+
const _LinkProvider = ({ children })=>/*#__PURE__*/ jsx(Provider, {
|
|
1953
|
+
values: [
|
|
1954
|
+
[
|
|
1955
|
+
_LinkContext,
|
|
1956
|
+
{
|
|
1957
|
+
_innerWrapper: ({ children, download, rel })=>(values)=>{
|
|
1958
|
+
let Icon = ArrowRight;
|
|
1959
|
+
if (download) {
|
|
1960
|
+
Icon = Download;
|
|
1961
|
+
} else if (rel?.includes('external')) {
|
|
1962
|
+
Icon = LinkExternal;
|
|
1963
|
+
}
|
|
1964
|
+
return /*#__PURE__*/ jsxs(Fragment, {
|
|
1965
|
+
children: [
|
|
1966
|
+
typeof children === 'function' ? children({
|
|
1967
|
+
...values,
|
|
1968
|
+
defaultChildren: null
|
|
1969
|
+
}) : children,
|
|
1970
|
+
/*#__PURE__*/ jsx(Icon, {})
|
|
1971
|
+
]
|
|
1972
|
+
});
|
|
1973
|
+
}
|
|
1974
|
+
}
|
|
1975
|
+
]
|
|
1976
|
+
],
|
|
1977
|
+
children: children
|
|
1944
1978
|
});
|
|
1945
|
-
}
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
iconTransition = cx('group-hover:motion-safe:-translate-y-0.5 group-hover:motion-safe:translate-x-0.5');
|
|
1954
|
-
Icon = LinkExternal;
|
|
1955
|
-
}
|
|
1956
|
-
return /*#__PURE__*/ jsx("li", {
|
|
1957
|
-
// Creates divider lines that works in any grid layout and with the focus ring
|
|
1958
|
-
className: "after:-top-px relative p-0.75 after:absolute after:right-0 after:left-0 after:h-px after:w-full after:bg-gray-light",
|
|
1959
|
-
children: /*#__PURE__*/ jsxs(Link, {
|
|
1960
|
-
...restProps,
|
|
1961
|
-
className: cx(className, 'group paragraph flex w-full cursor-pointer justify-between gap-x-2 py-3.5 font-medium no-underline focus-visible:outline-focus'),
|
|
1962
|
-
children: [
|
|
1963
|
-
/*#__PURE__*/ jsx("span", {
|
|
1964
|
-
children: children
|
|
1965
|
-
}),
|
|
1966
|
-
/*#__PURE__*/ jsx(Icon, {
|
|
1967
|
-
className: iconTransition
|
|
1968
|
-
})
|
|
1979
|
+
const LinkListContainer = ({ className, ...restProps })=>// Dual providers makes for easier typing and more readable code
|
|
1980
|
+
/*#__PURE__*/ jsx(Provider, {
|
|
1981
|
+
values: [
|
|
1982
|
+
[
|
|
1983
|
+
HeadingContext,
|
|
1984
|
+
{
|
|
1985
|
+
size: 'm'
|
|
1986
|
+
}
|
|
1969
1987
|
]
|
|
1988
|
+
],
|
|
1989
|
+
children: /*#__PURE__*/ jsx(_LinkProvider, {
|
|
1990
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
1991
|
+
className: cx(className, 'link-list-container'),
|
|
1992
|
+
...restProps
|
|
1993
|
+
})
|
|
1970
1994
|
})
|
|
1971
1995
|
});
|
|
1972
|
-
|
|
1996
|
+
const LinkList = (props)=>/*#__PURE__*/ jsx(_LinkProvider, {
|
|
1997
|
+
children: /*#__PURE__*/ jsx("ul", {
|
|
1998
|
+
...props,
|
|
1999
|
+
"data-slot": "link-list"
|
|
2000
|
+
})
|
|
2001
|
+
});
|
|
2002
|
+
const LinkListItem = (props)=>/*#__PURE__*/ jsx("li", {
|
|
2003
|
+
...props,
|
|
2004
|
+
"data-slot": "link-list-item"
|
|
2005
|
+
});
|
|
1973
2006
|
|
|
1974
2007
|
const DialogTrigger = (props)=>/*#__PURE__*/ jsx(DialogTrigger$1, {
|
|
1975
2008
|
...props
|
|
@@ -2831,4 +2864,4 @@ const VideoLoop = ({ src, format, alt, className })=>{
|
|
|
2831
2864
|
});
|
|
2832
2865
|
};
|
|
2833
2866
|
|
|
2834
|
-
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, 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, LinkList as UNSAFE_LinkList, LinkListItem as UNSAFE_LinkListItem, Modal as UNSAFE_Modal, 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, _useLocale as useLocale };
|
|
2867
|
+
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, 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, LinkList as UNSAFE_LinkList, LinkListContainer as UNSAFE_LinkListContainer, LinkListItem as UNSAFE_LinkListItem, Modal as UNSAFE_Modal, 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 };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@obosbbl/grunnmuren-react",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"description": "Grunnmuren components in React",
|
|
5
5
|
"repository": {
|
|
6
6
|
"url": "https://github.com/code-obos/grunnmuren"
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
"@react-aria/utils": "^3.29.1",
|
|
25
25
|
"@react-stately/form": "^3.1.5",
|
|
26
26
|
"@react-stately/utils": "^3.10.7",
|
|
27
|
-
"@types/node": "^24.0.0",
|
|
28
27
|
"cva": "^1.0.0-0",
|
|
29
28
|
"react-aria": "^3.41.1",
|
|
30
29
|
"react-aria-components": "^1.10.1",
|
|
@@ -35,7 +34,8 @@
|
|
|
35
34
|
"react": "^19"
|
|
36
35
|
},
|
|
37
36
|
"devDependencies": {
|
|
38
|
-
"
|
|
37
|
+
"@types/node": "^24.0.0",
|
|
38
|
+
"tailwindcss": "4.1.17"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
41
|
"build": "bunchee"
|