@fremtind/jkl-accordion-react
Advanced tools
Comparing version 12.1.6-alpha.0 to 12.1.6
@@ -1,2 +0,27 @@ | ||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./AccordionItem.js"),e=require("./Accordion.js");exports.AccordionItem=o.AccordionItem,exports.Accordion=e.Accordion; | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var src_exports = {}; | ||
__export(src_exports, { | ||
Accordion: () => import_Accordion.Accordion, | ||
AccordionItem: () => import_AccordionItem.AccordionItem | ||
}); | ||
module.exports = __toCommonJS(src_exports); | ||
var import_AccordionItem = require("./AccordionItem"); | ||
var import_Accordion = require("./Accordion"); | ||
//# sourceMappingURL=index.js.map |
@@ -1,3 +0,3 @@ | ||
import { Density, WithChildren } from '@fremtind/jkl-core'; | ||
import { FC } from 'react'; | ||
import { Density, WithChildren } from "@fremtind/jkl-core"; | ||
import { FC } from "react"; | ||
export interface AccordionProps extends WithChildren { | ||
@@ -4,0 +4,0 @@ className?: string; |
@@ -1,3 +0,3 @@ | ||
import { WithChildren } from '@fremtind/jkl-core'; | ||
import { default as React, FC } from 'react'; | ||
import { WithChildren } from "@fremtind/jkl-core"; | ||
import React, { FC } from "react"; | ||
export interface AccordionItemProps extends WithChildren { | ||
@@ -4,0 +4,0 @@ title: string; |
@@ -1,2 +0,49 @@ | ||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("classnames");exports.Accordion=({className:t,density:r,id:o,...a})=>e.jsx("section",{role:"group","data-testid":"jkl-accordion",className:s("jkl-accordion",t),"data-density":r,id:o,...a}); | ||
"use strict"; | ||
var __create = Object.create; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __getProtoOf = Object.getPrototypeOf; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | ||
// If the importer is in node compatibility mode or this is not an ESM | ||
// file that has been converted to a CommonJS file using a Babel- | ||
// compatible transform (i.e. "__esModule" has not been set), then set | ||
// "default" to the CommonJS "module.exports" for node compatibility. | ||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | ||
mod | ||
)); | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var Accordion_exports = {}; | ||
__export(Accordion_exports, { | ||
Accordion: () => Accordion | ||
}); | ||
module.exports = __toCommonJS(Accordion_exports); | ||
var import_classnames = __toESM(require("classnames")); | ||
var import_react = __toESM(require("react")); | ||
const Accordion = ({ className, density, id, ...rest }) => { | ||
return /* @__PURE__ */ import_react.default.createElement( | ||
"section", | ||
{ | ||
role: "group", | ||
"data-testid": "jkl-accordion", | ||
className: (0, import_classnames.default)("jkl-accordion", className), | ||
"data-density": density, | ||
id, | ||
...rest | ||
} | ||
); | ||
}; | ||
//# sourceMappingURL=Accordion.js.map |
@@ -1,2 +0,97 @@ | ||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("@fremtind/jkl-icons-react"),i=require("@fremtind/jkl-react-hooks"),r=require("classnames"),a=require("react");exports.AccordionItem=({children:c,title:n,className:s,startExpanded:o=!1,onClick:d,id:l,...m})=>{const[j,u]=a.useState(o),[k]=a.useState((()=>o)),{detailsRef:_,summaryRef:p,contentRef:x,onSummaryClick:f}=i.useAnimatedDetails({onOpenChange:(e,t)=>{u(e),d&&d(t,e)},isExpanded:k});return e.jsxs("details",{"data-testid":"jkl-accordion-item",...m,className:r("jkl-accordion-item",s),ref:_,id:l,children:[e.jsxs("summary",{"data-testid":"jkl-accordion-item__title",className:"jkl-accordion-item__title",onClick:f,ref:p,children:[n,e.jsx(t.ArrowVerticalAnimated,{variant:"inherit",className:"jkl-accordion-item__arrow",pointingDown:!j,bold:j})]}),e.jsx("div",{"data-testid":"jkl-accordion-item__content-wrapper",className:"jkl-accordion-item__content-wrapper",ref:x,children:e.jsx("div",{className:"jkl-accordion-item__content",children:c})})]})}; | ||
"use strict"; | ||
var __create = Object.create; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __getProtoOf = Object.getPrototypeOf; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | ||
// If the importer is in node compatibility mode or this is not an ESM | ||
// file that has been converted to a CommonJS file using a Babel- | ||
// compatible transform (i.e. "__esModule" has not been set), then set | ||
// "default" to the CommonJS "module.exports" for node compatibility. | ||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | ||
mod | ||
)); | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var AccordionItem_exports = {}; | ||
__export(AccordionItem_exports, { | ||
AccordionItem: () => AccordionItem | ||
}); | ||
module.exports = __toCommonJS(AccordionItem_exports); | ||
var import_jkl_icons_react = require("@fremtind/jkl-icons-react"); | ||
var import_jkl_react_hooks = require("@fremtind/jkl-react-hooks"); | ||
var import_classnames = __toESM(require("classnames")); | ||
var import_react = __toESM(require("react")); | ||
const AccordionItem = ({ | ||
children, | ||
title, | ||
className, | ||
startExpanded = false, | ||
onClick, | ||
id, | ||
...rest | ||
}) => { | ||
const [isOpen, setIsOpen] = (0, import_react.useState)(startExpanded); | ||
const [expandOnMount] = (0, import_react.useState)(() => startExpanded); | ||
const { detailsRef, summaryRef, contentRef, onSummaryClick } = (0, import_jkl_react_hooks.useAnimatedDetails)({ | ||
onOpenChange: (open, e) => { | ||
setIsOpen(open); | ||
if (onClick) { | ||
onClick(e, open); | ||
} | ||
}, | ||
isExpanded: expandOnMount | ||
}); | ||
return /* @__PURE__ */ import_react.default.createElement( | ||
"details", | ||
{ | ||
"data-testid": "jkl-accordion-item", | ||
...rest, | ||
className: (0, import_classnames.default)("jkl-accordion-item", className), | ||
ref: detailsRef, | ||
id | ||
}, | ||
/* @__PURE__ */ import_react.default.createElement( | ||
"summary", | ||
{ | ||
"data-testid": "jkl-accordion-item__title", | ||
className: "jkl-accordion-item__title", | ||
onClick: onSummaryClick, | ||
ref: summaryRef | ||
}, | ||
title, | ||
/* @__PURE__ */ import_react.default.createElement( | ||
import_jkl_icons_react.ArrowVerticalAnimated, | ||
{ | ||
variant: "inherit", | ||
className: "jkl-accordion-item__arrow", | ||
pointingDown: !isOpen, | ||
bold: isOpen | ||
} | ||
) | ||
), | ||
/* @__PURE__ */ import_react.default.createElement( | ||
"div", | ||
{ | ||
"data-testid": "jkl-accordion-item__content-wrapper", | ||
className: "jkl-accordion-item__content-wrapper", | ||
ref: contentRef | ||
}, | ||
/* @__PURE__ */ import_react.default.createElement("div", { className: "jkl-accordion-item__content" }, children) | ||
) | ||
); | ||
}; | ||
//# sourceMappingURL=AccordionItem.js.map |
@@ -1,2 +0,27 @@ | ||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./AccordionItem.js"),e=require("./Accordion.js");exports.AccordionItem=o.AccordionItem,exports.Accordion=e.Accordion; | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var src_exports = {}; | ||
__export(src_exports, { | ||
Accordion: () => import_Accordion.Accordion, | ||
AccordionItem: () => import_AccordionItem.AccordionItem | ||
}); | ||
module.exports = __toCommonJS(src_exports); | ||
var import_AccordionItem = require("./AccordionItem"); | ||
var import_Accordion = require("./Accordion"); | ||
//# sourceMappingURL=index.js.map |
@@ -1,4 +0,4 @@ | ||
export type { AccordionItemProps } from './AccordionItem'; | ||
export { AccordionItem } from './AccordionItem'; | ||
export type { AccordionProps } from './Accordion'; | ||
export { Accordion } from './Accordion'; | ||
export type { AccordionItemProps } from "./AccordionItem"; | ||
export { AccordionItem } from "./AccordionItem"; | ||
export type { AccordionProps } from "./Accordion"; | ||
export { Accordion } from "./Accordion"; |
{ | ||
"name": "@fremtind/jkl-accordion-react", | ||
"version": "12.1.6-alpha.0", | ||
"version": "12.1.6", | ||
"publishConfig": { | ||
@@ -15,2 +15,6 @@ "access": "public" | ||
"license": "MIT", | ||
"types": "./build/index.d.ts", | ||
"main": "./build/cjs/index.js", | ||
"module": "./build/esm/index.js", | ||
"browser": "./build/esm/index.js", | ||
"sideEffects": [ | ||
@@ -20,34 +24,27 @@ "*.css", | ||
], | ||
"directories": { | ||
"lib": "build" | ||
}, | ||
"files": [ | ||
"build" | ||
], | ||
"main": "./build/cjs/index.js", | ||
"module": "./build/es/index.js", | ||
"browser": "./build/es/index.js", | ||
"types": "./build/index.d.ts", | ||
"scripts": { | ||
"clean": "rimraf build/ node_modules/", | ||
"build": "vite build --config vite.build.config.mjs", | ||
"clean": "rimraf node_modules/ build/ node_modules/ ", | ||
"build:types": "tsc -p tsconfig-for-declarations.json", | ||
"build:scripts": "node ./esbuild.prod.mjs", | ||
"build": "run-s build:*", | ||
"test": "jest --testMatch '**/accordion-react/**/*.test.+(ts|tsx|js)' --config=../../jest.config.js", | ||
"dev": "vite --config vite.dev.config.ts --port 3000" | ||
"dev:js": "ESBUILD_WATCH=true node ./esbuild.dev.mjs", | ||
"dev:server": "nodemon ./dist/server.js", | ||
"dev": "run-p dev:*" | ||
}, | ||
"dependencies": { | ||
"@fremtind/jkl-accordion": "^12.0.5-alpha.0", | ||
"@fremtind/jkl-core": "^14.2.0", | ||
"@fremtind/jkl-icons-react": "^9.1.2", | ||
"@fremtind/jkl-react-hooks": "^12.1.4", | ||
"@fremtind/jkl-accordion": "^12.0.4", | ||
"@fremtind/jkl-core": "^14.2.1", | ||
"@fremtind/jkl-icons-react": "^9.1.3", | ||
"@fremtind/jkl-react-hooks": "^12.1.5", | ||
"classnames": "^2.3.2" | ||
}, | ||
"devDependencies": { | ||
"@fremtind/jkl-button": "^12.1.4", | ||
"@fremtind/jkl-expand-button": "^7.0.6", | ||
"@fremtind/jkl-icons": "^9.1.4", | ||
"@fremtind/jkl-list-react": "^10.2.3", | ||
"@rollup/plugin-terser": "^0.4.4", | ||
"@vitejs/plugin-react-swc": "^3.7.0", | ||
"glob": "^8.1.0", | ||
"rollup-plugin-node-externals": "^7.1.3", | ||
"rollup-plugin-visualizer": "^5.12.0", | ||
"vite": "^5.2.0", | ||
"vite-plugin-dts": "^4.1.0" | ||
"@fremtind/jkl-list-react": "^10.2.4" | ||
}, | ||
@@ -67,3 +64,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "d25059a1f4dbdd9b4a9b007da11d5e5293f166d4" | ||
"gitHead": "29d912072c3068e21972fad1731e20b311c061c3" | ||
} |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1
322
0
24246
20