Socket
Socket
Sign inDemoInstall

@fremtind/jkl-core

Package Overview
Dependencies
Maintainers
3
Versions
174
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fremtind/jkl-core - npm Package Compare versions

Comparing version 11.3.0 to 11.4.0

7

build/cjs/components/Label.js

@@ -55,9 +55,4 @@ "use strict";

}
return /* @__PURE__ */ import_react.default.createElement(C, {
...rest,
className: labelClassNames,
htmlFor,
"data-density": density
}, children);
return /* @__PURE__ */ import_react.default.createElement(C, { ...rest, className: labelClassNames, htmlFor, "data-density": density }, children);
};
//# sourceMappingURL=Label.js.map

12

build/cjs/components/Label.spec.js

@@ -27,5 +27,3 @@ "use strict";

it(`renders the expected class for variant ${variant}`, () => {
(0, import_react.render)(/* @__PURE__ */ import_react2.default.createElement(import_Label.Label, {
variant
}, "Hello"));
(0, import_react.render)(/* @__PURE__ */ import_react2.default.createElement(import_Label.Label, { variant }, "Hello"));
expect(import_react.screen.getByText("Hello")).toHaveClass(`jkl-label--${variant}`);

@@ -35,11 +33,7 @@ });

it("renders the expected result for compact", () => {
(0, import_react.render)(/* @__PURE__ */ import_react2.default.createElement(import_Label.Label, {
density: "compact"
}, "Hello"));
(0, import_react.render)(/* @__PURE__ */ import_react2.default.createElement(import_Label.Label, { density: "compact" }, "Hello"));
expect(import_react.screen.getByText("Hello")).toHaveAttribute("data-density", "compact");
});
it("renders the expected class for srOnly", () => {
(0, import_react.render)(/* @__PURE__ */ import_react2.default.createElement(import_Label.Label, {
srOnly: true
}, "Hello"));
(0, import_react.render)(/* @__PURE__ */ import_react2.default.createElement(import_Label.Label, { srOnly: true }, "Hello"));
expect(import_react.screen.getByText("Hello")).toHaveClass("jkl-label--sr-only");

@@ -46,0 +40,0 @@ });

@@ -32,8 +32,12 @@ "use strict";

var import_react = __toESM(require("react"));
const Link = ({ external = false, className = "", children, ...rest }) => /* @__PURE__ */ import_react.default.createElement("a", {
className: (0, import_classnames.default)("jkl-link", className, {
"jkl-link--external": external
}),
...rest
}, children);
const Link = ({ external = false, className = "", children, ...rest }) => /* @__PURE__ */ import_react.default.createElement(
"a",
{
className: (0, import_classnames.default)("jkl-link", className, {
"jkl-link--external": external
}),
...rest
},
children
);
//# sourceMappingURL=Link.js.map

@@ -32,13 +32,17 @@ "use strict";

var import_react = __toESM(require("react"));
const NavLink = ({ active = false, back = false, className, children, ...rest }) => /* @__PURE__ */ import_react.default.createElement("a", {
className: (0, import_classnames.default)(
"jkl-nav-link",
{
"jkl-nav-link--active": active,
"jkl-nav-link--back": back
},
className
),
...rest
}, children);
const NavLink = ({ active = false, back = false, className, children, ...rest }) => /* @__PURE__ */ import_react.default.createElement(
"a",
{
className: (0, import_classnames.default)(
"jkl-nav-link",
{
"jkl-nav-link--active": active,
"jkl-nav-link--back": back
},
className
),
...rest
},
children
);
//# sourceMappingURL=NavLink.js.map

@@ -32,7 +32,4 @@ "use strict";

var import_react = __toESM(require("react"));
const ScreenReaderOnly = ({ children, showOnFocus, ...rest }) => /* @__PURE__ */ import_react.default.createElement("span", {
...rest,
className: `jkl-sr-only ${showOnFocus ? "jkl-sr-only--focusable" : ""}`
}, children);
const ScreenReaderOnly = ({ children, showOnFocus, ...rest }) => /* @__PURE__ */ import_react.default.createElement("span", { ...rest, className: `jkl-sr-only ${showOnFocus ? "jkl-sr-only--focusable" : ""}` }, children);
var ScreenReaderOnly_default = ScreenReaderOnly;
//# sourceMappingURL=ScreenReaderOnly.js.map

@@ -48,20 +48,22 @@ "use strict";

const restProps = hasLabel ? rest : {};
return /* @__PURE__ */ import_react.default.createElement("span", {
id,
className: componentClassName,
...restProps,
"data-density": density
}, /* @__PURE__ */ import_react.default.createElement("svg", {
className: "jkl-form-support-label__icon",
"aria-hidden": true,
viewBox: "0 0 24 24",
fill: "none",
xmlns: "http://www.w3.org/2000/svg"
}, /* @__PURE__ */ import_react.default.createElement("path", {
fillRule: "evenodd",
clipRule: "evenodd",
d: "M18.3588 20.5107L5.64157 20.5107C3.33259 20.5107 1.88917 18.0116 3.04301 16.0116L9.40163 4.98996C10.5561 2.98885 13.4443 2.98885 14.5987 4.98996L20.9574 16.0116C22.1112 18.0116 20.6678 20.5107 18.3588 20.5107ZM12.7515 13.6525L12.7515 7.63131L11.9988 7.63131L11.2462 7.63131L11.2462 13.6525L12.7515 13.6525ZM12.0012 15.0458C11.441 15.0458 10.9868 15.5 10.9868 16.0602C10.9868 16.6205 11.441 17.0747 12.0012 17.0747C12.5615 17.0747 13.0157 16.6205 13.0157 16.0602C13.0157 15.5 12.5615 15.0458 12.0012 15.0458Z",
fill: "currentColor"
})), errorLabel || helpLabel);
return /* @__PURE__ */ import_react.default.createElement("span", { id, className: componentClassName, ...restProps, "data-density": density }, /* @__PURE__ */ import_react.default.createElement(
"svg",
{
className: "jkl-form-support-label__icon",
"aria-hidden": true,
viewBox: "0 0 24 24",
fill: "none",
xmlns: "http://www.w3.org/2000/svg"
},
/* @__PURE__ */ import_react.default.createElement(
"path",
{
fillRule: "evenodd",
clipRule: "evenodd",
d: "M18.3588 20.5107L5.64157 20.5107C3.33259 20.5107 1.88917 18.0116 3.04301 16.0116L9.40163 4.98996C10.5561 2.98885 13.4443 2.98885 14.5987 4.98996L20.9574 16.0116C22.1112 18.0116 20.6678 20.5107 18.3588 20.5107ZM12.7515 13.6525L12.7515 7.63131L11.9988 7.63131L11.2462 7.63131L11.2462 13.6525L12.7515 13.6525ZM12.0012 15.0458C11.441 15.0458 10.9868 15.5 10.9868 16.0602C10.9868 16.6205 11.441 17.0747 12.0012 17.0747C12.5615 17.0747 13.0157 16.6205 13.0157 16.0602C13.0157 15.5 12.5615 15.0458 12.0012 15.0458Z",
fill: "currentColor"
}
)
), errorLabel || helpLabel);
};
//# sourceMappingURL=SupportLabel.js.map

@@ -1,4 +0,4 @@

import { FC } from "react";
import { Density, LabelVariant } from "../index";
import { WithChildren } from "../types";
import { type CSSProperties, type FC } from "react";
import type { WithChildren, LabelVariant } from "../types";
import type { Density } from "../utils";
export interface LabelProps extends WithChildren {

@@ -12,3 +12,4 @@ id?: string;

className?: string;
style?: CSSProperties;
}
export declare const Label: FC<LabelProps>;
import { FC } from "react";
import { WithChildren } from "../types";
import type { WithChildren } from "../types";
export interface ScreenReaderOnlyProps extends WithChildren {

@@ -4,0 +4,0 @@ showOnFocus?: boolean;

@@ -1,3 +0,3 @@

import { FC, type ReactNode } from "react";
import { Density } from "../utils";
import { type FC, type ReactNode } from "react";
import { type Density } from "../utils";
export interface SupportLabelProps {

@@ -4,0 +4,0 @@ /**

@@ -26,8 +26,3 @@ import classNames from "classnames";

}
return /* @__PURE__ */ React.createElement(C, {
...rest,
className: labelClassNames,
htmlFor,
"data-density": density
}, children);
return /* @__PURE__ */ React.createElement(C, { ...rest, className: labelClassNames, htmlFor, "data-density": density }, children);
};

@@ -34,0 +29,0 @@ export {

@@ -8,5 +8,3 @@ import { render, screen } from "@testing-library/react";

it(`renders the expected class for variant ${variant}`, () => {
render(/* @__PURE__ */ React.createElement(Label, {
variant
}, "Hello"));
render(/* @__PURE__ */ React.createElement(Label, { variant }, "Hello"));
expect(screen.getByText("Hello")).toHaveClass(`jkl-label--${variant}`);

@@ -16,11 +14,7 @@ });

it("renders the expected result for compact", () => {
render(/* @__PURE__ */ React.createElement(Label, {
density: "compact"
}, "Hello"));
render(/* @__PURE__ */ React.createElement(Label, { density: "compact" }, "Hello"));
expect(screen.getByText("Hello")).toHaveAttribute("data-density", "compact");
});
it("renders the expected class for srOnly", () => {
render(/* @__PURE__ */ React.createElement(Label, {
srOnly: true
}, "Hello"));
render(/* @__PURE__ */ React.createElement(Label, { srOnly: true }, "Hello"));
expect(screen.getByText("Hello")).toHaveClass("jkl-label--sr-only");

@@ -27,0 +21,0 @@ });

import cn from "classnames";
import React from "react";
const Link = ({ external = false, className = "", children, ...rest }) => /* @__PURE__ */ React.createElement("a", {
className: cn("jkl-link", className, {
"jkl-link--external": external
}),
...rest
}, children);
const Link = ({ external = false, className = "", children, ...rest }) => /* @__PURE__ */ React.createElement(
"a",
{
className: cn("jkl-link", className, {
"jkl-link--external": external
}),
...rest
},
children
);
export {

@@ -10,0 +14,0 @@ Link

import cn from "classnames";
import React from "react";
const NavLink = ({ active = false, back = false, className, children, ...rest }) => /* @__PURE__ */ React.createElement("a", {
className: cn(
"jkl-nav-link",
{
"jkl-nav-link--active": active,
"jkl-nav-link--back": back
},
className
),
...rest
}, children);
const NavLink = ({ active = false, back = false, className, children, ...rest }) => /* @__PURE__ */ React.createElement(
"a",
{
className: cn(
"jkl-nav-link",
{
"jkl-nav-link--active": active,
"jkl-nav-link--back": back
},
className
),
...rest
},
children
);
export {

@@ -15,0 +19,0 @@ NavLink

import React from "react";
const ScreenReaderOnly = ({ children, showOnFocus, ...rest }) => /* @__PURE__ */ React.createElement("span", {
...rest,
className: `jkl-sr-only ${showOnFocus ? "jkl-sr-only--focusable" : ""}`
}, children);
const ScreenReaderOnly = ({ children, showOnFocus, ...rest }) => /* @__PURE__ */ React.createElement("span", { ...rest, className: `jkl-sr-only ${showOnFocus ? "jkl-sr-only--focusable" : ""}` }, children);
var ScreenReaderOnly_default = ScreenReaderOnly;

@@ -7,0 +4,0 @@ export {

@@ -19,19 +19,21 @@ import cn from "classnames";

const restProps = hasLabel ? rest : {};
return /* @__PURE__ */ React.createElement("span", {
id,
className: componentClassName,
...restProps,
"data-density": density
}, /* @__PURE__ */ React.createElement("svg", {
className: "jkl-form-support-label__icon",
"aria-hidden": true,
viewBox: "0 0 24 24",
fill: "none",
xmlns: "http://www.w3.org/2000/svg"
}, /* @__PURE__ */ React.createElement("path", {
fillRule: "evenodd",
clipRule: "evenodd",
d: "M18.3588 20.5107L5.64157 20.5107C3.33259 20.5107 1.88917 18.0116 3.04301 16.0116L9.40163 4.98996C10.5561 2.98885 13.4443 2.98885 14.5987 4.98996L20.9574 16.0116C22.1112 18.0116 20.6678 20.5107 18.3588 20.5107ZM12.7515 13.6525L12.7515 7.63131L11.9988 7.63131L11.2462 7.63131L11.2462 13.6525L12.7515 13.6525ZM12.0012 15.0458C11.441 15.0458 10.9868 15.5 10.9868 16.0602C10.9868 16.6205 11.441 17.0747 12.0012 17.0747C12.5615 17.0747 13.0157 16.6205 13.0157 16.0602C13.0157 15.5 12.5615 15.0458 12.0012 15.0458Z",
fill: "currentColor"
})), errorLabel || helpLabel);
return /* @__PURE__ */ React.createElement("span", { id, className: componentClassName, ...restProps, "data-density": density }, /* @__PURE__ */ React.createElement(
"svg",
{
className: "jkl-form-support-label__icon",
"aria-hidden": true,
viewBox: "0 0 24 24",
fill: "none",
xmlns: "http://www.w3.org/2000/svg"
},
/* @__PURE__ */ React.createElement(
"path",
{
fillRule: "evenodd",
clipRule: "evenodd",
d: "M18.3588 20.5107L5.64157 20.5107C3.33259 20.5107 1.88917 18.0116 3.04301 16.0116L9.40163 4.98996C10.5561 2.98885 13.4443 2.98885 14.5987 4.98996L20.9574 16.0116C22.1112 18.0116 20.6678 20.5107 18.3588 20.5107ZM12.7515 13.6525L12.7515 7.63131L11.9988 7.63131L11.2462 7.63131L11.2462 13.6525L12.7515 13.6525ZM12.0012 15.0458C11.441 15.0458 10.9868 15.5 10.9868 16.0602C10.9868 16.6205 11.441 17.0747 12.0012 17.0747C12.5615 17.0747 13.0157 16.6205 13.0157 16.0602C13.0157 15.5 12.5615 15.0458 12.0012 15.0458Z",
fill: "currentColor"
}
)
), errorLabel || helpLabel);
};

@@ -38,0 +40,0 @@ export {

@@ -25,3 +25,3 @@ import { ReactNode } from "react";

export interface WithChildren {
children: ReactNode;
children: ReactNode | ReactNode[];
}

@@ -42,3 +42,3 @@ /**

export interface WithOptionalChildren {
children?: ReactNode;
children?: ReactNode | ReactNode[];
}
{
"name": "@fremtind/jkl-core",
"version": "11.3.0",
"version": "11.4.0",
"publishConfig": {

@@ -56,3 +56,3 @@ "access": "public"

},
"gitHead": "ad1ac154a240d948926587b99299b35eea9261d0"
"gitHead": "29109154dc78ca2dd912fc7a469978be0efd7910"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc