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 10.1.0 to 11.0.0

build/cjs/utils/density.js

6

build/cjs/components/Label.js

@@ -34,3 +34,3 @@ "use strict";

variant = "small",
forceCompact,
density,
srOnly,

@@ -45,3 +45,2 @@ children,

[`jkl-label--${variant}`]: variant,
"jkl-label--compact": forceCompact,
"jkl-label--sr-only": srOnly

@@ -61,5 +60,6 @@ });

className: labelClassNames,
htmlFor
htmlFor,
"data-density": density
}, children);
};
//# sourceMappingURL=Label.js.map

@@ -33,7 +33,7 @@ "use strict";

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

@@ -40,0 +40,0 @@ it("renders the expected class for srOnly", () => {

@@ -36,3 +36,3 @@ "use strict";

errorLabel,
forceCompact,
density,
className,

@@ -44,3 +44,2 @@ srOnly,

const componentClassName = hasLabel ? (0, import_classnames.default)("jkl-form-support-label", className, {
"jkl-form-support-label--compact": forceCompact,
"jkl-form-support-label--error": errorLabel,

@@ -54,3 +53,4 @@ "jkl-form-support-label--help": !errorLabel,

className: componentClassName,
...restProps
...restProps,
"data-density": density
}, /* @__PURE__ */ import_react.default.createElement("svg", {

@@ -57,0 +57,0 @@ className: "jkl-form-support-label__icon",

@@ -29,6 +29,8 @@ "use strict";

exit: "ease-in",
easeInBounceOut: "cubic-bezier(0, 0, 0.375, 1.17)"
easeInBounceOut: "cubic-bezier(0, 0, 0.375, 1.17)",
focus: "cubic-bezier(0.6, 0.2, 0.35, 1)"
});
const timings = Object.freeze({
energetic: "75ms",
snappy: "100ms",
productive: "150ms",

@@ -35,0 +37,0 @@ expressive: "250ms",

import { FC } from "react";
import { LabelVariant } from "../index";
import { Density, LabelVariant } from "../index";
import { WithChildren } from "../types";

@@ -7,3 +7,3 @@ export interface LabelProps extends WithChildren {

variant?: LabelVariant;
forceCompact?: boolean;
density?: Density;
srOnly?: boolean;

@@ -10,0 +10,0 @@ standAlone?: boolean;

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

@@ -28,3 +29,3 @@ /**

* errorLabel={errorLabel}
* forceCompact={forceCompact}
* density={density}
* />

@@ -38,3 +39,3 @@ * </div>

errorLabel?: string;
forceCompact?: boolean;
density?: Density;
className?: string;

@@ -41,0 +42,0 @@ srOnly?: boolean;

@@ -5,3 +5,3 @@ import classNames from "classnames";

variant = "small",
forceCompact,
density,
srOnly,

@@ -16,3 +16,2 @@ children,

[`jkl-label--${variant}`]: variant,
"jkl-label--compact": forceCompact,
"jkl-label--sr-only": srOnly

@@ -32,3 +31,4 @@ });

className: labelClassNames,
htmlFor
htmlFor,
"data-density": density
}, children);

@@ -35,0 +35,0 @@ };

@@ -14,7 +14,7 @@ import { render, screen } from "@testing-library/react";

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

@@ -21,0 +21,0 @@ it("renders the expected class for srOnly", () => {

@@ -7,3 +7,3 @@ import cn from "classnames";

errorLabel,
forceCompact,
density,
className,

@@ -15,3 +15,2 @@ srOnly,

const componentClassName = hasLabel ? cn("jkl-form-support-label", className, {
"jkl-form-support-label--compact": forceCompact,
"jkl-form-support-label--error": errorLabel,

@@ -25,3 +24,4 @@ "jkl-form-support-label--help": !errorLabel,

className: componentClassName,
...restProps
...restProps,
"data-density": density
}, /* @__PURE__ */ React.createElement("svg", {

@@ -28,0 +28,0 @@ className: "jkl-form-support-label__icon",

@@ -5,6 +5,8 @@ const easings = Object.freeze({

exit: "ease-in",
easeInBounceOut: "cubic-bezier(0, 0, 0.375, 1.17)"
easeInBounceOut: "cubic-bezier(0, 0, 0.375, 1.17)",
focus: "cubic-bezier(0.6, 0.2, 0.35, 1)"
});
const timings = Object.freeze({
energetic: "75ms",
snappy: "100ms",
productive: "150ms",

@@ -11,0 +13,0 @@ expressive: "250ms",

export type { Easing, Timing } from "./utils";
export { initTabListener, getValuePair, breakpoints, timings, easings } from "./utils";
export type { Density } from "./utils";
export type { LabelProps, LinkProps, NavLinkProps, ScreenReaderOnlyProps, SupportLabelProps } from "./components";
export { Label, Link, NavLink, ScreenReaderOnly, SupportLabel } from "./components";
export type { DataTestAutoId, LabelVariant, ValuePair, WithChildren, WithOptionalChildren } from "./types";
export type { ColorScheme, DataTestAutoId, LabelVariant, ValuePair, WithChildren, WithOptionalChildren } from "./types";

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

export declare type LabelVariant = "small" | "medium" | "large";
export declare type ColorScheme = "light" | "dark";
export declare type ValuePair = {

@@ -8,0 +9,0 @@ value: string;

export { initTabListener } from "./tabListener";
export { getValuePair } from "./getValuePair";
export { breakpoints } from "./breakpoints";
export type { Density } from "./density";
export type { Timing, Easing } from "./motion";
export { timings, easings } from "./motion";

@@ -7,2 +7,3 @@ export declare type Easing = keyof typeof easings;

easeInBounceOut: "cubic-bezier(0, 0, 0.375, 1.17)";
focus: "cubic-bezier(0.6, 0.2, 0.35, 1)";
}>;

@@ -12,2 +13,3 @@ export declare type Timing = keyof typeof timings;

energetic: "75ms";
snappy: "100ms";
productive: "150ms";

@@ -14,0 +16,0 @@ expressive: "250ms";

{
"name": "@fremtind/jkl-core",
"version": "10.1.0",
"version": "11.0.0",
"publishConfig": {

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

},
"gitHead": "38fdb174d241566022023fa3bc75196312f62707"
"gitHead": "a223b8f8d61c99d9adb16415cd8888f5a418b1ea"
}

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

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