@obosbbl/grunnmuren-react 2.0.0-canary.36 → 2.0.0-canary.37
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 +17 -17
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -105,7 +105,7 @@ function AccordionItem(props, ref) {
|
|
|
105
105
|
};
|
|
106
106
|
return /*#__PURE__*/ jsx("div", {
|
|
107
107
|
...restProps,
|
|
108
|
-
className: cx('
|
|
108
|
+
className: cx('relative px-2', className),
|
|
109
109
|
ref: ref,
|
|
110
110
|
"data-open": isOpen,
|
|
111
111
|
children: /*#__PURE__*/ jsx(Provider, {
|
|
@@ -121,7 +121,7 @@ function AccordionItem(props, ref) {
|
|
|
121
121
|
"aria-controls": contentId,
|
|
122
122
|
"aria-expanded": isOpen,
|
|
123
123
|
// Use outline with offset as focus indicator, this does not cover the left mint border on the expanded content and works with or without a background color on the accordion container
|
|
124
|
-
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
|
|
124
|
+
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",
|
|
125
125
|
id: buttonId,
|
|
126
126
|
onClick: handleOpenChange,
|
|
127
127
|
children: [
|
|
@@ -198,7 +198,7 @@ const _Badge = /*#__PURE__*/ forwardRef(Badge);
|
|
|
198
198
|
* Figma: https://www.figma.com/file/9OvSg0ZXI5E1eQYi7AWiWn/Grunnmuren-2.0-%E2%94%82-Designsystem?node-id=30%3A2574&mode=dev
|
|
199
199
|
*/ const buttonVariants = cva({
|
|
200
200
|
base: [
|
|
201
|
-
'inline-flex min-h-[44px] cursor-pointer items-center justify-center whitespace-nowrap rounded-lg font-medium transition-
|
|
201
|
+
'inline-flex min-h-[44px] cursor-pointer items-center justify-center whitespace-nowrap rounded-lg font-medium transition-colors duration-200 focus-visible:outline-focus-offset'
|
|
202
202
|
],
|
|
203
203
|
variants: {
|
|
204
204
|
/**
|
|
@@ -214,9 +214,9 @@ const _Badge = /*#__PURE__*/ forwardRef(Badge);
|
|
|
214
214
|
* Adjusts the color of the button for usage on different backgrounds.
|
|
215
215
|
* @default green
|
|
216
216
|
*/ color: {
|
|
217
|
-
green: 'focus-visible:
|
|
218
|
-
mint: 'focus-visible:
|
|
219
|
-
white: 'focus-visible:
|
|
217
|
+
green: 'focus-visible:outline-focus',
|
|
218
|
+
mint: 'focus-visible:outline-focus focus-visible:outline-mint',
|
|
219
|
+
white: 'focus-visible:outline-focus focus-visible:outline-white'
|
|
220
220
|
},
|
|
221
221
|
/**
|
|
222
222
|
* When the button is without text, but with a single icon.
|
|
@@ -340,15 +340,15 @@ const input = cva({
|
|
|
340
340
|
'box-content min-h-6 py-2.5',
|
|
341
341
|
'rounded-md text-base font-normal leading-6 placeholder-[#727070] outline-none ring-1 ring-black',
|
|
342
342
|
// invalid styles
|
|
343
|
-
'group-data-[invalid]:ring-
|
|
343
|
+
'group-data-[invalid]:ring-focus group-data-[invalid]:ring-red',
|
|
344
344
|
// Fix invisible ring on safari: https://github.com/tailwindlabs/tailwindcss.com/issues/1135
|
|
345
345
|
'appearance-none'
|
|
346
346
|
],
|
|
347
347
|
variants: {
|
|
348
348
|
// Focus rings. Can either be :focus or :focus-visible based on the needs of the particular component.
|
|
349
349
|
focusModifier: {
|
|
350
|
-
focus: 'focus:ring-
|
|
351
|
-
visible: 'data-[focus-visible]:ring-
|
|
350
|
+
focus: 'focus:ring-focus group-data-[invalid]:focus:ring',
|
|
351
|
+
visible: 'data-[focus-visible]:ring-focus group-data-[invalid]:data-[focus-visible]:ring'
|
|
352
352
|
},
|
|
353
353
|
isGrouped: {
|
|
354
354
|
false: 'px-3',
|
|
@@ -361,8 +361,8 @@ const input = cva({
|
|
|
361
361
|
}
|
|
362
362
|
});
|
|
363
363
|
const inputGroup = cx([
|
|
364
|
-
'inline-flex items-center gap-3 overflow-hidden rounded-md bg-white px-3 text-base ring-1 ring-black focus-within:ring-
|
|
365
|
-
'group-data-[invalid]:ring-
|
|
364
|
+
'inline-flex items-center gap-3 overflow-hidden rounded-md bg-white px-3 text-base ring-1 ring-black focus-within:ring-focus',
|
|
365
|
+
'group-data-[invalid]:ring-focus group-data-[invalid]:ring-red group-data-[invalid]:focus-within:ring'
|
|
366
366
|
]);
|
|
367
367
|
const dropdown = {
|
|
368
368
|
popover: cx('min-w-[--trigger-width] overflow-y-auto rounded-md border border-black bg-white shadow data-[entering]:animate-in data-[exiting]:animate-out data-[entering]:fade-in data-[exiting]:fade-out'),
|
|
@@ -398,7 +398,7 @@ function CheckmarkBox() {
|
|
|
398
398
|
// selected
|
|
399
399
|
'group-data-[selected]:!border-green group-data-[selected]:!bg-green',
|
|
400
400
|
// focus
|
|
401
|
-
'group-data-[focus-visible]:
|
|
401
|
+
'group-data-[focus-visible]:outline-focus-offset',
|
|
402
402
|
// hovered
|
|
403
403
|
'group-data-[hovered]:border-green group-data-[hovered]:group-data-[invalid]:border-red group-data-[hovered]:bg-green-lightest group-data-[hovered]:group-data-[invalid]:bg-red-light',
|
|
404
404
|
// invalid - The border is 1 px thicker when invalid. We don't actually want to change the border width, as that causes the element's size to change
|
|
@@ -635,7 +635,7 @@ const defaultClasses = cx([
|
|
|
635
635
|
// hover
|
|
636
636
|
'data-[hovered]:before:border-green data-[hovered]:before:bg-green-lightest data-[hovered]:data-[invalid]:before:bg-red-light',
|
|
637
637
|
// focus
|
|
638
|
-
'data-[focus-visible]:before:ring
|
|
638
|
+
'data-[focus-visible]:before:ring-focus-offset',
|
|
639
639
|
// invalid - The border is 1 px thicker when invalid. We don't actually want to change the border width, as that causes the element's size to change
|
|
640
640
|
// so we use an inner outline to artifically pad the border
|
|
641
641
|
'data-[invalid]:before:outline-solid data-[invalid]:before:border-red data-[invalid]:data-[selected]:before:!bg-red data-[invalid]:before:outline data-[invalid]:before:outline-[3px] data-[invalid]:before:outline-offset-[-3px] data-[invalid]:before:outline-red'
|
|
@@ -946,14 +946,14 @@ const Alertbox = ({ children, role, className, variant = 'info', isDismissable =
|
|
|
946
946
|
/*#__PURE__*/ jsx(Icon, {}),
|
|
947
947
|
firstChild,
|
|
948
948
|
isDismissable && /*#__PURE__*/ jsx("button", {
|
|
949
|
-
className: cx('-m-2 grid h-11 w-11 place-items-center rounded-xl', 'focus-visible:outline-
|
|
949
|
+
className: cx('-m-2 grid h-11 w-11 place-items-center rounded-xl', 'focus-visible:outline-focus focus-visible:-outline-offset-8'),
|
|
950
950
|
onClick: close,
|
|
951
951
|
"aria-label": translations.close[locale],
|
|
952
952
|
children: /*#__PURE__*/ jsx(Close, {})
|
|
953
953
|
}),
|
|
954
954
|
isExpandable && /*#__PURE__*/ jsxs("button", {
|
|
955
955
|
className: cx('relative col-span-full row-start-2 -my-3 inline-flex max-w-fit cursor-pointer items-center gap-1 py-3 text-sm leading-6', // Focus styles:
|
|
956
|
-
'outline-none after:absolute after:bottom-3 after:left-0 after:right-0 after:h-0
|
|
956
|
+
'outline-none after:absolute after:bottom-3 after:left-0 after:right-0 after:h-0', 'focus-visible:after:h-[2px] focus-visible:after:bg-black'),
|
|
957
957
|
onClick: ()=>setIsExpanded((prevState)=>!prevState),
|
|
958
958
|
"aria-expanded": isExpanded,
|
|
959
959
|
"aria-controls": id,
|
|
@@ -995,7 +995,7 @@ function Breadcrumb(props, ref) {
|
|
|
995
995
|
href ? /*#__PURE__*/ jsx(Link, {
|
|
996
996
|
href: href,
|
|
997
997
|
// use outline instead of ring for focus marker that can be offset without creating a white background between the focus marker and the element content
|
|
998
|
-
className: "rounded-sm
|
|
998
|
+
className: "rounded-sm data-[focus-visible]:focus-visible:outline-focus focus:outline-none group-last:no-underline",
|
|
999
999
|
children: children
|
|
1000
1000
|
}) : children,
|
|
1001
1001
|
/*#__PURE__*/ jsx(ChevronRight, {
|
|
@@ -1013,7 +1013,7 @@ function Backlink(props, ref) {
|
|
|
1013
1013
|
const { className, children, withUnderline, ...restProps } = props;
|
|
1014
1014
|
const Component = isLinkProps(props) ? Link : Button$1;
|
|
1015
1015
|
return /*#__PURE__*/ jsxs(Component, {
|
|
1016
|
-
className: cx(className, 'group flex max-w-fit cursor-pointer items-center gap-3 rounded-md p-2.5 no-underline focus
|
|
1016
|
+
className: cx(className, 'group flex max-w-fit cursor-pointer items-center gap-3 rounded-md p-2.5 no-underline focus-visible:outline-focus'),
|
|
1017
1017
|
...restProps,
|
|
1018
1018
|
// @ts-expect-error ignore the type of the ref here
|
|
1019
1019
|
ref: ref,
|