@fremtind/jokul 0.57.6 → 0.57.8
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/build/build-stats.html +1 -1
- package/build/cjs/components/file-input/File.cjs +1 -1
- package/build/cjs/components/file-input/File.cjs.map +1 -1
- package/build/cjs/components/icon/stories/Icons.stories.cjs +1 -1
- package/build/cjs/components/loader/stories/Skeleton.stories.cjs +1 -1
- package/build/cjs/components/logo/stories/Logo.stories.cjs +2 -0
- package/build/cjs/components/logo/stories/Logo.stories.cjs.map +1 -0
- package/build/cjs/components/logo/stories/Logo.stories.d.cts +12 -0
- package/build/cjs/components/logo/stories/LogoStamp.stories.cjs +2 -0
- package/build/cjs/components/logo/stories/LogoStamp.stories.cjs.map +1 -0
- package/build/cjs/components/logo/stories/LogoStamp.stories.d.cts +12 -0
- package/build/cjs/components/text-area/stories/TextArea.stories.cjs +2 -0
- package/build/cjs/components/text-area/stories/TextArea.stories.cjs.map +1 -0
- package/build/cjs/components/text-area/stories/TextArea.stories.d.cts +12 -0
- package/build/cjs/components/toggle-switch/stories/ToggleSwitch.stories.cjs +2 -0
- package/build/cjs/components/toggle-switch/stories/ToggleSwitch.stories.cjs.map +1 -0
- package/build/cjs/components/toggle-switch/stories/ToggleSwitch.stories.d.cts +15 -0
- package/build/es/components/file-input/File.js +1 -1
- package/build/es/components/file-input/File.js.map +1 -1
- package/build/es/components/icon/stories/Icons.stories.js +1 -1
- package/build/es/components/logo/stories/Logo.stories.d.ts +12 -0
- package/build/es/components/logo/stories/Logo.stories.js +2 -0
- package/build/es/components/logo/stories/Logo.stories.js.map +1 -0
- package/build/es/components/logo/stories/LogoStamp.stories.d.ts +12 -0
- package/build/es/components/logo/stories/LogoStamp.stories.js +2 -0
- package/build/es/components/logo/stories/LogoStamp.stories.js.map +1 -0
- package/build/es/components/text-area/stories/TextArea.stories.d.ts +12 -0
- package/build/es/components/text-area/stories/TextArea.stories.js +2 -0
- package/build/es/components/text-area/stories/TextArea.stories.js.map +1 -0
- package/build/es/components/toggle-switch/stories/ToggleSwitch.stories.d.ts +15 -0
- package/build/es/components/toggle-switch/stories/ToggleSwitch.stories.js +2 -0
- package/build/es/components/toggle-switch/stories/ToggleSwitch.stories.js.map +1 -0
- package/build/style.css +1 -1
- package/package.json +2 -2
- package/styles/components/button/button.css +3 -3
- package/styles/components/button/button.min.css +1 -1
- package/styles/components/checkbox/checkbox.css +4 -4
- package/styles/components/checkbox/checkbox.min.css +1 -1
- package/styles/components/checkbox-panel/checkbox-panel.css +2 -2
- package/styles/components/checkbox-panel/checkbox-panel.min.css +1 -1
- package/styles/components/countdown/countdown.css +2 -2
- package/styles/components/countdown/countdown.min.css +1 -1
- package/styles/components/feedback/feedback.css +2 -2
- package/styles/components/feedback/feedback.min.css +1 -1
- package/styles/components/input-group/input-group.css +2 -2
- package/styles/components/input-group/input-group.min.css +1 -1
- package/styles/components/loader/loader.css +6 -6
- package/styles/components/loader/loader.min.css +1 -1
- package/styles/components/loader/skeleton-loader.css +5 -5
- package/styles/components/loader/skeleton-loader.min.css +1 -1
- package/styles/components/message/message.css +2 -2
- package/styles/components/message/message.min.css +1 -1
- package/styles/components/progress-bar/progress-bar.css +1 -1
- package/styles/components/progress-bar/progress-bar.min.css +1 -1
- package/styles/components/radio-button/radio-button.css +2 -2
- package/styles/components/radio-button/radio-button.min.css +1 -1
- package/styles/components/radio-panel/radio-panel.css +2 -2
- package/styles/components/radio-panel/radio-panel.min.css +1 -1
- package/styles/components/system-message/system-message.css +2 -2
- package/styles/components/system-message/system-message.min.css +1 -1
- package/styles/components/toast/toast.css +4 -4
- package/styles/components/toast/toast.min.css +1 -1
- package/styles/styles.css +39 -39
- package/styles/styles.min.css +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("../../../clsx-E3yX_9sL.cjs"),i=require("react");require("../icon/Icon.cjs"),require("../icon/icons/animated/ArrowVerticalAnimated.cjs"),require("../icon/icons/animated/ArrowHorizontalAnimated.cjs"),require("../icon/icons/animated/PlusRemoveAnimated.cjs"),require("../icon/icons/ArrowDownIcon.cjs"),require("../icon/icons/ArrowLeftIcon.cjs"),require("../icon/icons/ArrowNorthEastIcon.cjs"),require("../icon/icons/ArrowRightIcon.cjs"),require("../icon/icons/ArrowUpIcon.cjs"),require("../icon/icons/CalendarIcon.cjs"),require("../icon/icons/CheckIcon.cjs"),require("../icon/icons/ChevronDownIcon.cjs"),require("../icon/icons/ChevronLeftIcon.cjs"),require("../icon/icons/ChevronRightIcon.cjs"),require("../icon/icons/ChevronUpIcon.cjs"),require("../icon/icons/CloseIcon.cjs"),require("../icon/icons/CopyIcon.cjs"),require("../icon/icons/DotsIcon.cjs"),require("../icon/icons/DragIcon.cjs"),require("../icon/icons/ErrorIcon.cjs"),require("../icon/icons/GreenCheckIcon.cjs"),require("../icon/icons/HamburgerIcon.cjs"),require("../icon/icons/InfoIcon.cjs"),require("../icon/icons/LinkIcon.cjs"),require("../icon/icons/MinusIcon.cjs"),require("../icon/icons/OpenInNewIcon.cjs"),require("../icon/icons/PenIcon.cjs"),require("../icon/icons/PlusIcon.cjs"),require("../icon/icons/QuestionIcon.cjs"),require("../icon/icons/RedCrossIcon.cjs"),require("../icon/icons/SearchIcon.cjs");const n=require("../icon/icons/SuccessIcon.cjs");require("../icon/icons/ThumbDownIcon.cjs"),require("../icon/icons/ThumbUpIcon.cjs");const r=require("../icon/icons/TrashCanIcon.cjs");require("../icon/icons/WarningIcon.cjs");const o=require("../icon-button/IconButton.cjs"),s=require("../input-group/SupportLabel.cjs"),l=require("../../utilities/formatters/bytes/formatBytes.cjs"),t=require("./internal/fileInputContext.cjs"),a=require("./internal/Thumbnail.cjs");exports.File=u=>{const{children:j,className:q,fileName:p,fileType:I,fileSize:d,path:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("../../../clsx-E3yX_9sL.cjs"),i=require("react");require("../icon/Icon.cjs"),require("../icon/icons/animated/ArrowVerticalAnimated.cjs"),require("../icon/icons/animated/ArrowHorizontalAnimated.cjs"),require("../icon/icons/animated/PlusRemoveAnimated.cjs"),require("../icon/icons/ArrowDownIcon.cjs"),require("../icon/icons/ArrowLeftIcon.cjs"),require("../icon/icons/ArrowNorthEastIcon.cjs"),require("../icon/icons/ArrowRightIcon.cjs"),require("../icon/icons/ArrowUpIcon.cjs"),require("../icon/icons/CalendarIcon.cjs"),require("../icon/icons/CheckIcon.cjs"),require("../icon/icons/ChevronDownIcon.cjs"),require("../icon/icons/ChevronLeftIcon.cjs"),require("../icon/icons/ChevronRightIcon.cjs"),require("../icon/icons/ChevronUpIcon.cjs"),require("../icon/icons/CloseIcon.cjs"),require("../icon/icons/CopyIcon.cjs"),require("../icon/icons/DotsIcon.cjs"),require("../icon/icons/DragIcon.cjs"),require("../icon/icons/ErrorIcon.cjs"),require("../icon/icons/GreenCheckIcon.cjs"),require("../icon/icons/HamburgerIcon.cjs"),require("../icon/icons/InfoIcon.cjs"),require("../icon/icons/LinkIcon.cjs"),require("../icon/icons/MinusIcon.cjs"),require("../icon/icons/OpenInNewIcon.cjs"),require("../icon/icons/PenIcon.cjs"),require("../icon/icons/PlusIcon.cjs"),require("../icon/icons/QuestionIcon.cjs"),require("../icon/icons/RedCrossIcon.cjs"),require("../icon/icons/SearchIcon.cjs");const n=require("../icon/icons/SuccessIcon.cjs");require("../icon/icons/ThumbDownIcon.cjs"),require("../icon/icons/ThumbUpIcon.cjs");const r=require("../icon/icons/TrashCanIcon.cjs");require("../icon/icons/WarningIcon.cjs");const o=require("../icon-button/IconButton.cjs"),s=require("../input-group/SupportLabel.cjs"),l=require("../../utilities/formatters/bytes/formatBytes.cjs"),t=require("./internal/fileInputContext.cjs"),a=require("./internal/Thumbnail.cjs");exports.File=u=>{const{children:j,className:q,fileName:p,fileType:I,fileSize:d,path:h,file:m,supportLabel:f,supportLabelType:b,state:x,onRemove:_,...k}=u,w=`jkl-file-preview-${i.useId()}`,C=w+"-support",v=t.useFileInputContext(),g=h?"a":"div",y="error"===b||"warning"===b,N="success"===b,T=e.jsxs("div",{id:w,className:c.clsx(q,"jkl-file"),...k,children:[e.jsxs(g,{className:c.clsx("jkl-file__content",{"jkl-file__content--error":"error"===b,"jkl-file__content--warning":"warning"===b}),href:h,target:h?"_blank":void 0,children:[e.jsx(a.Thumbnail,{fileName:p,fileType:I,file:m,path:h,state:x,children:j}),e.jsxs("div",{children:[e.jsx("p",{className:"jkl-file__name",children:p}),e.jsxs("p",{className:"jkl-file__description",children:[e.jsx("span",{children:l.formatBytes(d)}),y||N?N?e.jsx(n.SuccessIcon,{variant:"small","aria-label":"Filen ble lastet opp uten feil","aria-hidden":!1}):null:e.jsx(s.SupportLabel,{className:"jkl-file__support-label jkl-body",id:C,label:f,labelType:b})]}),f&&y&&e.jsx(s.SupportLabel,{className:"jkl-file__support-label",id:C,label:f,labelType:b})]})]}),_&&e.jsx(o.IconButton,{className:"jkl-file__delete",onClick:_,title:`Fjern ${p}`,children:e.jsx(r.TrashCanIcon,{})})]});return v?e.jsx("li",{children:T}):T};
|
|
2
2
|
//# sourceMappingURL=File.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"File.cjs","sources":["../../../../src/components/file-input/File.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React, {\n type ComponentProps,\n type FC,\n type MouseEvent,\n useId,\n} from \"react\";\nimport { TrashCanIcon, SuccessIcon } from \"../../components/icon/index.js\";\nimport { IconButton } from \"../../components/icon-button/IconButton.js\";\nimport { SupportLabel } from \"../../components/input-group/SupportLabel.js\";\nimport { formatBytes } from \"../../utilities/formatters/bytes/formatBytes.js\";\nimport { useFileInputContext } from \"./internal/fileInputContext.js\";\nimport { Thumbnail } from \"./internal/Thumbnail.js\";\nimport type { FileInputFileState } from \"./types.js\";\n\nexport type FileProps = {\n fileName: string;\n fileType: string;\n fileSize: number;\n path?: string;\n file?: File;\n supportLabel?: string;\n supportLabelType?: \"help\" | \"error\" | \"warning\" | \"success\";\n state?: FileInputFileState;\n onRemove?: (e: MouseEvent<HTMLButtonElement>) => void;\n};\n\nexport const File: FC<FileProps & ComponentProps<\"div\">> = (props) => {\n const {\n children,\n className,\n fileName,\n fileType,\n fileSize,\n path,\n file,\n supportLabel,\n supportLabelType,\n state,\n onRemove,\n ...rest\n } = props;\n\n const id = `jkl-file-preview-${useId()}`;\n const supportId = id + \"-support\";\n\n const context = useFileInputContext();\n\n const Component = path ? \"a\" : \"div\";\n\n const hasErrorOrWarning =\n supportLabelType === \"error\" || supportLabelType === \"warning\";\n const hasSuccess = supportLabelType === \"success\";\n\n const renderFeedbackElement = () => {\n if (!hasErrorOrWarning && !hasSuccess) {\n return (\n <SupportLabel\n className=\"jkl-file__support-label jkl-body\"\n id={supportId}\n label={supportLabel}\n labelType={supportLabelType}\n />\n );\n }\n\n if (hasSuccess)\n return (\n <SuccessIcon\n variant=\"small\"\n aria-label=\"Filen ble lastet opp uten feil\"\n />\n );\n\n return null;\n };\n\n const fileComponent = (\n <div id={id} className={clsx(className, \"jkl-file\")} {...rest}>\n <Component\n className={clsx(\"jkl-file__content\", {\n \"jkl-file__content--error\": supportLabelType === \"error\",\n \"jkl-file__content--warning\":\n supportLabelType === \"warning\",\n })}\n href={path}\n target={path ? \"_blank\" : undefined}\n >\n <Thumbnail\n fileName={fileName}\n fileType={fileType}\n file={file}\n path={path}\n state={state}\n >\n {children}\n </Thumbnail>\n <div>\n <p className=\"jkl-file__name\">{fileName}</p>\n <p className=\"jkl-file__description\">\n <span>{formatBytes(fileSize)}</span>\n {renderFeedbackElement()}\n </p>\n {supportLabel && hasErrorOrWarning && (\n <SupportLabel\n className=\"jkl-file__support-label\"\n id={supportId}\n label={supportLabel}\n labelType={supportLabelType}\n />\n )}\n </div>\n </Component>\n {onRemove && (\n <IconButton\n className=\"jkl-file__delete\"\n onClick={onRemove}\n title={`Fjern ${fileName}`}\n >\n <TrashCanIcon />\n </IconButton>\n )}\n </div>\n );\n\n return context ? <li>{fileComponent}</li> : fileComponent;\n};\n"],"names":["props","children","className","fileName","fileType","fileSize","path","file","supportLabel","supportLabelType","state","onRemove","rest","id","useId","supportId","context","useFileInputContext","Component","hasErrorOrWarning","hasSuccess","fileComponent","jsxs","clsx","href","target","jsx","Thumbnail","formatBytes","SuccessIcon","variant","SupportLabel","label","labelType","IconButton","onClick","title","TrashCanIcon"],"mappings":"s7DA2B4DA,IAClD,MACFC,SAAAA,EACAC,UAAAA,EACAC,SAAAA,EACAC,SAAAA,EACAC,SAAAA,EACAC,KAAAA,EACAC,KAAAA,EACAC,aAAAA,EACAC,iBAAAA,EACAC,MAAAA,EACAC,SAAAA,KACGC,GACHZ,EAEEa,EAAK,oBAAoBC,EAAAA,UACzBC,EAAYF,EAAK,WAEjBG,EAAUC,EAAAA,sBAEVC,EAAYZ,EAAO,IAAM,MAEzBa,EACmB,UAArBV,GAAqD,YAArBA,EAC9BW,EAAkC,YAArBX,
|
|
1
|
+
{"version":3,"file":"File.cjs","sources":["../../../../src/components/file-input/File.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React, {\n type ComponentProps,\n type FC,\n type MouseEvent,\n useId,\n} from \"react\";\nimport { TrashCanIcon, SuccessIcon } from \"../../components/icon/index.js\";\nimport { IconButton } from \"../../components/icon-button/IconButton.js\";\nimport { SupportLabel } from \"../../components/input-group/SupportLabel.js\";\nimport { formatBytes } from \"../../utilities/formatters/bytes/formatBytes.js\";\nimport { useFileInputContext } from \"./internal/fileInputContext.js\";\nimport { Thumbnail } from \"./internal/Thumbnail.js\";\nimport type { FileInputFileState } from \"./types.js\";\n\nexport type FileProps = {\n fileName: string;\n fileType: string;\n fileSize: number;\n path?: string;\n file?: File;\n supportLabel?: string;\n supportLabelType?: \"help\" | \"error\" | \"warning\" | \"success\";\n state?: FileInputFileState;\n onRemove?: (e: MouseEvent<HTMLButtonElement>) => void;\n};\n\nexport const File: FC<FileProps & ComponentProps<\"div\">> = (props) => {\n const {\n children,\n className,\n fileName,\n fileType,\n fileSize,\n path,\n file,\n supportLabel,\n supportLabelType,\n state,\n onRemove,\n ...rest\n } = props;\n\n const id = `jkl-file-preview-${useId()}`;\n const supportId = id + \"-support\";\n\n const context = useFileInputContext();\n\n const Component = path ? \"a\" : \"div\";\n\n const hasErrorOrWarning =\n supportLabelType === \"error\" || supportLabelType === \"warning\";\n const hasSuccess = supportLabelType === \"success\";\n\n const renderFeedbackElement = () => {\n if (!hasErrorOrWarning && !hasSuccess) {\n return (\n <SupportLabel\n className=\"jkl-file__support-label jkl-body\"\n id={supportId}\n label={supportLabel}\n labelType={supportLabelType}\n />\n );\n }\n\n if (hasSuccess)\n return (\n <SuccessIcon\n variant=\"small\"\n aria-label=\"Filen ble lastet opp uten feil\"\n aria-hidden={false}\n />\n );\n\n return null;\n };\n\n const fileComponent = (\n <div id={id} className={clsx(className, \"jkl-file\")} {...rest}>\n <Component\n className={clsx(\"jkl-file__content\", {\n \"jkl-file__content--error\": supportLabelType === \"error\",\n \"jkl-file__content--warning\":\n supportLabelType === \"warning\",\n })}\n href={path}\n target={path ? \"_blank\" : undefined}\n >\n <Thumbnail\n fileName={fileName}\n fileType={fileType}\n file={file}\n path={path}\n state={state}\n >\n {children}\n </Thumbnail>\n <div>\n <p className=\"jkl-file__name\">{fileName}</p>\n <p className=\"jkl-file__description\">\n <span>{formatBytes(fileSize)}</span>\n {renderFeedbackElement()}\n </p>\n {supportLabel && hasErrorOrWarning && (\n <SupportLabel\n className=\"jkl-file__support-label\"\n id={supportId}\n label={supportLabel}\n labelType={supportLabelType}\n />\n )}\n </div>\n </Component>\n {onRemove && (\n <IconButton\n className=\"jkl-file__delete\"\n onClick={onRemove}\n title={`Fjern ${fileName}`}\n >\n <TrashCanIcon />\n </IconButton>\n )}\n </div>\n );\n\n return context ? <li>{fileComponent}</li> : fileComponent;\n};\n"],"names":["props","children","className","fileName","fileType","fileSize","path","file","supportLabel","supportLabelType","state","onRemove","rest","id","useId","supportId","context","useFileInputContext","Component","hasErrorOrWarning","hasSuccess","fileComponent","jsxs","clsx","href","target","jsx","Thumbnail","formatBytes","SuccessIcon","variant","SupportLabel","label","labelType","IconButton","onClick","title","TrashCanIcon"],"mappings":"s7DA2B4DA,IAClD,MACFC,SAAAA,EACAC,UAAAA,EACAC,SAAAA,EACAC,SAAAA,EACAC,SAAAA,EACAC,KAAAA,EACAC,KAAAA,EACAC,aAAAA,EACAC,iBAAAA,EACAC,MAAAA,EACAC,SAAAA,KACGC,GACHZ,EAEEa,EAAK,oBAAoBC,EAAAA,UACzBC,EAAYF,EAAK,WAEjBG,EAAUC,EAAAA,sBAEVC,EAAYZ,EAAO,IAAM,MAEzBa,EACmB,UAArBV,GAAqD,YAArBA,EAC9BW,EAAkC,YAArBX,EA0BbY,EACDC,EAAAA,KAAA,MAAA,CAAIT,GAAAA,EAAQX,UAAWqB,OAAKrB,EAAW,eAAiBU,EACrDX,SAAA,CAAAqB,EAAAA,KAACJ,EAAA,CACGhB,UAAWqB,OAAK,oBAAqB,CACjC,2BAAiD,UAArBd,EAC5B,6BACyB,YAArBA,IAERe,KAAMlB,EACNmB,OAAQnB,EAAO,cAAW,EAE1BL,SAAA,CAAAyB,EAAAA,IAACC,EAAAA,UAAA,CACGxB,SAAAA,EACAC,SAAAA,EACAG,KAAAA,EACAD,KAAAA,EACAI,MAAAA,EAECT,SAAAA,WAEJ,MACG,CAAAA,SAAA,CAACyB,EAAAA,IAAA,IAAA,CAAExB,UAAU,iBAAkBD,SAASE,IACxCmB,EAAAA,KAAC,IAAE,CAAApB,UAAU,wBACTD,SAAA,CAACyB,EAAAA,IAAA,OAAA,CAAMzB,SAAY2B,EAAAA,YAAAvB,KA9C9Bc,GAAsBC,EAWvBA,EAEIM,EAAAA,IAACG,EAAAA,YAAA,CACGC,QAAQ,QACR,aAAW,iCACX,eAAa,IAIlB,KAlBCJ,EAAAA,IAACK,EAAAA,aAAA,CACG7B,UAAU,mCACVW,GAAIE,EACJiB,MAAOxB,EACPyB,UAAWxB,OA2CVD,GAAgBW,GACbO,EAAAA,IAACK,EAAAA,aAAA,CACG7B,UAAU,0BACVW,GAAIE,EACJiB,MAAOxB,EACPyB,UAAWxB,UAK1BE,GACGe,EAAAA,IAACQ,EAAAA,WAAA,CACGhC,UAAU,mBACViC,QAASxB,EACTyB,MAAO,SAASjC,IAEhBF,eAACoC,EAAaA,aAAA,SAM9B,OAAOrB,EAAUU,EAAAA,IAAC,KAAI,CAAAzB,SAAAoB,IAAsBA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),n=require("react"),r=require("../../text-input/TextInput.cjs"),o=require("../Icon.cjs");require("../icons/animated/ArrowVerticalAnimated.cjs"),require("../icons/animated/ArrowHorizontalAnimated.cjs"),require("../icons/animated/PlusRemoveAnimated.cjs");const c=require("../icons/ArrowDownIcon.cjs"),s=require("../icons/ArrowLeftIcon.cjs"),i=require("../icons/ArrowNorthEastIcon.cjs"),t=require("../icons/ArrowRightIcon.cjs"),u=require("../icons/ArrowUpIcon.cjs"),I=require("../icons/CalendarIcon.cjs"),a=require("../icons/CheckIcon.cjs"),l=require("../icons/ChevronDownIcon.cjs"),j=require("../icons/ChevronLeftIcon.cjs"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),n=require("react"),r=require("../../text-input/TextInput.cjs"),o=require("../Icon.cjs");require("../icons/animated/ArrowVerticalAnimated.cjs"),require("../icons/animated/ArrowHorizontalAnimated.cjs"),require("../icons/animated/PlusRemoveAnimated.cjs");const c=require("../icons/ArrowDownIcon.cjs"),s=require("../icons/ArrowLeftIcon.cjs"),i=require("../icons/ArrowNorthEastIcon.cjs"),t=require("../icons/ArrowRightIcon.cjs"),u=require("../icons/ArrowUpIcon.cjs"),I=require("../icons/CalendarIcon.cjs"),a=require("../icons/CheckIcon.cjs"),l=require("../icons/ChevronDownIcon.cjs"),j=require("../icons/ChevronLeftIcon.cjs"),q=require("../icons/ChevronRightIcon.cjs"),d=require("../icons/ChevronUpIcon.cjs"),h=require("../icons/CloseIcon.cjs"),m=require("../icons/CopyIcon.cjs"),p=require("../icons/DotsIcon.cjs"),w=require("../icons/DragIcon.cjs"),C=require("../icons/ErrorIcon.cjs"),v=require("../icons/GreenCheckIcon.cjs"),g=require("../icons/HamburgerIcon.cjs"),x=require("../icons/InfoIcon.cjs"),A=require("../icons/LinkIcon.cjs"),b=require("../icons/MinusIcon.cjs"),f=require("../icons/OpenInNewIcon.cjs"),k=require("../icons/PenIcon.cjs"),y=require("../icons/PlusIcon.cjs"),D=require("../icons/QuestionIcon.cjs"),T=require("../icons/RedCrossIcon.cjs"),S=require("../icons/SearchIcon.cjs"),N=require("../icons/SuccessIcon.cjs"),R=require("../icons/ThumbDownIcon.cjs"),L=require("../icons/ThumbUpIcon.cjs"),P=require("../icons/TrashCanIcon.cjs"),U=require("../icons/WarningIcon.cjs");;/* empty css */const E=({name:n,renderIcon:r,...o})=>e.jsx("div",{title:n||r.name,...o,children:r()}),M=({columns:n,children:r,...o})=>e.jsx("div",{className:`jkl-example-grid jkl-example-grid--${n}-columns`,...o,children:r}),H={title:"Komponenter/Ikoner",component:o.Icon,parameters:{layout:"centered"},tags:["autodocs"],argTypes:{variant:{control:"radio",options:["inherit","medium","small"]}}},O=[c.ArrowDownIcon,s.ArrowLeftIcon,i.ArrowNorthEastIcon,t.ArrowRightIcon,u.ArrowUpIcon,I.CalendarIcon,a.CheckIcon,l.ChevronDownIcon,j.ChevronLeftIcon,q.ChevronRightIcon,d.ChevronUpIcon,h.CloseIcon,m.CopyIcon,p.DotsIcon,w.DragIcon,C.ErrorIcon,v.GreenCheckIcon,g.HamburgerIcon,x.InfoIcon,A.LinkIcon,b.MinusIcon,f.OpenInNewIcon,k.PenIcon,y.PlusIcon,D.QuestionIcon,T.RedCrossIcon,S.SearchIcon,N.SuccessIcon,R.ThumbDownIcon,L.ThumbUpIcon,P.TrashCanIcon,U.WarningIcon],_={args:{variant:"small",bold:!1},render:({variant:o,bold:c})=>{const[s,i]=n.useState("1rem");return e.jsxs("div",{style:{width:"50vw"},children:["inherit"===o&&e.jsx(r.TextInput,{label:"Fontstørrelse",className:"jkl-spacing-24--bottom",value:s,onChange:e=>i(e.target.value),width:"10ch"}),e.jsx(M,{style:{fontSize:s},columns:"four",children:O.map((n=>e.jsx(E,{style:{justifySelf:"center"},renderIcon:()=>e.jsx(n,{bold:c,variant:o}),name:n.displayName},n.displayName)))})]})}};exports.Ikoner=_,exports.default=H;
|
|
2
2
|
//# sourceMappingURL=Icons.stories.cjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime");;/* empty css */const t=require("../skeletons/SkeletonAnimation.cjs"),n=require("../skeletons/SkeletonButton.cjs"),o=require("../skeletons/SkeletonCheckboxGroup.cjs"),l=require("../skeletons/SkeletonElement.cjs"),s=require("../skeletons/SkeletonInput.cjs"),r=require("../skeletons/SkeletonRadioButtonGroup.cjs"),i=require("../skeletons/SkeletonTable.cjs"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime");;/* empty css */const t=require("../skeletons/SkeletonAnimation.cjs"),n=require("../skeletons/SkeletonButton.cjs"),o=require("../skeletons/SkeletonCheckboxGroup.cjs"),l=require("../skeletons/SkeletonElement.cjs"),s=require("../skeletons/SkeletonInput.cjs"),r=require("../skeletons/SkeletonRadioButtonGroup.cjs"),i=require("../skeletons/SkeletonTable.cjs"),d=require("../skeletons/SkeletonTextArea.cjs"),k={title:"Komponenter/Loader/SkeletonTable",component:i.SkeletonTable,subcomponents:{SkeletonElement:l.SkeletonElement,SkeletonTableHeader:i.SkeletonTableHeader},argTypes:{width:{control:"number"}},tags:["autodocs"]},a={name:"Skeleton",args:{children:e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:40},children:[e.jsx(l.SkeletonElement,{width:350,height:32}),e.jsx(s.SkeletonInput,{}),e.jsx(d.SkeletonTextArea,{}),e.jsx(o.SkeletonCheckboxGroup,{checkboxes:3}),e.jsx(r.SkeletonRadioButtonGroup,{radioButtons:3}),e.jsx(n.SkeletonButton,{width:225}),e.jsxs(i.SkeletonTable,{children:[e.jsxs(i.SkeletonTableHeader,{children:[e.jsx("div",{style:{width:215},children:e.jsx(l.SkeletonElement,{width:115,height:16})}),e.jsx("div",{style:{width:115},children:e.jsx(l.SkeletonElement,{width:115,height:16})})]}),Array.from(Array(5)).map(((t,n)=>e.jsxs(i.SkeletonTableRow,{children:[e.jsx("div",{style:{width:215},children:e.jsx(l.SkeletonElement,{width:n%2?115:185,height:19})}),e.jsx("div",{style:{width:115},children:e.jsx(l.SkeletonElement,{width:24,height:24,shape:"circle"})})]},n)))]})]})},render:n=>e.jsx(t.SkeletonAnimation,{...n,role:"none presentation"})};exports.SkeletonStory=a,exports.default=k;
|
|
2
2
|
//# sourceMappingURL=Skeleton.stories.cjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../Logo.cjs");;/* empty css */const o={title:"Komponenter/Logo/Logo",component:e.Logo,parameters:{layout:"centered"},tags:["autodocs"]};exports.Logo={},exports.default=o;
|
|
2
|
+
//# sourceMappingURL=Logo.stories.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Logo.stories.cjs","sources":["../../../../../src/components/logo/stories/Logo.stories.tsx"],"sourcesContent":["import { Meta, StoryObj } from \"@storybook/react\";\nimport { Logo as LogoComponent } from \"../Logo.js\";\nimport \"../styles/_index.scss\";\n\nconst meta = {\n title: \"Komponenter/Logo/Logo\",\n component: LogoComponent,\n parameters: {\n layout: \"centered\",\n },\n tags: [\"autodocs\"],\n} satisfies Meta<typeof LogoComponent>;\n\nexport default meta;\ntype Story = StoryObj<typeof meta>;\n\nexport const Logo: Story = {};\n"],"names":["meta","title","component","LogoComponent","Logo","parameters","layout","tags"],"mappings":"sLAIA,MAAMA,EAAO,CACTC,MAAO,wBACPC,UAAWC,EAAAC,KACXC,WAAY,CACRC,OAAQ,YAEZC,KAAM,CAAC,0BAMgB,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: ({ className, id, centered, isSymbol, animated, title, ...rest }: import('../types.js').LogoProps) => JSX.Element;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
tags: string[];
|
|
9
|
+
};
|
|
10
|
+
export default meta;
|
|
11
|
+
type Story = StoryObj<typeof meta>;
|
|
12
|
+
export declare const Logo: Story;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),t=require("../LogoStamp.cjs"),o=require("../text-paths/FraSB1ogDNB.cjs");;/* empty css */const r={title:"Komponenter/Logo/LogoStamp",component:t.LogoStamp,parameters:{layout:"centered"},tags:["autodocs"]},a={args:{children:e.jsx(o.FraSB1ogDNB,{}),title:"Fra SB1 og DNB"}};exports.LogoStamp=a,exports.default=r;
|
|
2
|
+
//# sourceMappingURL=LogoStamp.stories.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LogoStamp.stories.cjs","sources":["../../../../../src/components/logo/stories/LogoStamp.stories.tsx"],"sourcesContent":["import { Meta, StoryObj } from \"@storybook/react\";\nimport React from \"react\";\nimport { LogoStamp as LogoStampComponent } from \"../LogoStamp.js\";\nimport { FraSB1ogDNB } from \"../text-paths/FraSB1ogDNB.js\";\nimport \"../styles/_index.scss\";\n\nconst meta = {\n title: \"Komponenter/Logo/LogoStamp\",\n component: LogoStampComponent,\n parameters: {\n layout: \"centered\",\n },\n tags: [\"autodocs\"],\n} satisfies Meta<typeof LogoStampComponent>;\n\nexport default meta;\ntype Story = StoryObj<typeof meta>;\n\nexport const LogoStamp: Story = {\n args: {\n children: <FraSB1ogDNB />,\n title: \"Fra SB1 og DNB\",\n },\n};\n"],"names":["meta","title","component","LogoStampComponent","LogoStamp","parameters","layout","tags","args","children","FraSB1ogDNB"],"mappings":"qQAMA,MAAMA,EAAO,CACTC,MAAO,6BACPC,UAAWC,EAAAC,UACXC,WAAY,CACRC,OAAQ,YAEZC,KAAM,CAAC,aAMEH,EAAmB,CAC5BI,KAAM,CACFC,eAAWC,EAAYA,YAAA,IACvBT,MAAO"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: ({ children, className, id, animated, title, ...rest }: import('../types.js').LogoStampProps) => JSX.Element;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
tags: string[];
|
|
9
|
+
};
|
|
10
|
+
export default meta;
|
|
11
|
+
type Story = StoryObj<typeof meta>;
|
|
12
|
+
export declare const LogoStamp: Story;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={title:"Komponenter/TextArea",component:require("../TextArea.cjs").TextArea,parameters:{layout:"centered"},tags:["autodocs"]};exports.TextArea={args:{label:"Beskrivelse"}},exports.default=e;
|
|
2
|
+
//# sourceMappingURL=TextArea.stories.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextArea.stories.cjs","sources":["../../../../../src/components/text-area/stories/TextArea.stories.tsx"],"sourcesContent":["import { Meta, StoryObj } from \"@storybook/react\";\nimport { TextArea as TextAreaComponent } from \"../TextArea.js\";\nimport \"../styles/_index.scss\";\n\nconst meta = {\n title: \"Komponenter/TextArea\",\n component: TextAreaComponent,\n parameters: {\n layout: \"centered\",\n },\n tags: [\"autodocs\"],\n} satisfies Meta<typeof TextAreaComponent>;\n\nexport default meta;\ntype Story = StoryObj<typeof meta>;\n\nexport const TextArea: Story = {\n args: {\n label: \"Beskrivelse\",\n },\n};\n"],"names":["meta","title","component","TextArea","parameters","layout","tags","args","label"],"mappings":"kHAIMA,EAAO,CACTC,MAAO,uBACPC,qCAAWC,SACXC,WAAY,CACRC,OAAQ,YAEZC,KAAM,CAAC,8BAMoB,CAC3BC,KAAM,CACFC,MAAO"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import('react').ForwardRefExoticComponent<import('../types.js').TextAreaProps & import('react').RefAttributes<HTMLTextAreaElement>>;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
tags: string[];
|
|
9
|
+
};
|
|
10
|
+
export default meta;
|
|
11
|
+
type Story = StoryObj<typeof meta>;
|
|
12
|
+
export declare const TextArea: Story;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={title:"Komponenter/ToggleSwitch",component:require("../ToggleSwitch.cjs").ToggleSwitch,parameters:{layout:"centered"},tags:["autodocs"]};exports.ToggleSwitch={args:{children:"Mørk modus"}},exports.default=e;
|
|
2
|
+
//# sourceMappingURL=ToggleSwitch.stories.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToggleSwitch.stories.cjs","sources":["../../../../../src/components/toggle-switch/stories/ToggleSwitch.stories.tsx"],"sourcesContent":["import { Meta, StoryObj } from \"@storybook/react\";\nimport { ToggleSwitch as ToggleSwitchComponent } from \"../ToggleSwitch.js\";\nimport \"../styles/_index.scss\";\n\nconst meta = {\n title: \"Komponenter/ToggleSwitch\",\n component: ToggleSwitchComponent,\n parameters: {\n layout: \"centered\",\n },\n tags: [\"autodocs\"],\n} satisfies Meta<typeof ToggleSwitchComponent>;\n\nexport default meta;\ntype Story = StoryObj<typeof meta>;\n\nexport const ToggleSwitch: Story = {\n args: {\n children: \"Mørk modus\",\n },\n};\n"],"names":["meta","title","component","ToggleSwitch","parameters","layout","tags","args","children"],"mappings":"kHAIMA,EAAO,CACTC,MAAO,2BACPC,yCAAWC,aACXC,WAAY,CACRC,OAAQ,YAEZC,KAAM,CAAC,kCAMwB,CAC/BC,KAAM,CACFC,SAAU"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import('react').ForwardRefExoticComponent<Omit<import('react').ButtonHTMLAttributes<HTMLButtonElement>, "onChange"> & {
|
|
5
|
+
density?: import('../../../index.js').Density;
|
|
6
|
+
onChange?: import('../types.js').ToggleChangeHandler<HTMLButtonElement>;
|
|
7
|
+
} & import('react').RefAttributes<HTMLButtonElement>>;
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: string;
|
|
10
|
+
};
|
|
11
|
+
tags: string[];
|
|
12
|
+
};
|
|
13
|
+
export default meta;
|
|
14
|
+
type Story = StoryObj<typeof meta>;
|
|
15
|
+
export declare const ToggleSwitch: Story;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as o,jsx as i}from"react/jsx-runtime";import{c as n}from"../../../clsx-BeLtu-UY.js";import{useId as c}from"react";import"../icon/Icon.js";import"../icon/icons/animated/ArrowVerticalAnimated.js";import"../icon/icons/animated/ArrowHorizontalAnimated.js";import"../icon/icons/animated/PlusRemoveAnimated.js";import"../icon/icons/ArrowDownIcon.js";import"../icon/icons/ArrowLeftIcon.js";import"../icon/icons/ArrowNorthEastIcon.js";import"../icon/icons/ArrowRightIcon.js";import"../icon/icons/ArrowUpIcon.js";import"../icon/icons/CalendarIcon.js";import"../icon/icons/CheckIcon.js";import"../icon/icons/ChevronDownIcon.js";import"../icon/icons/ChevronLeftIcon.js";import"../icon/icons/ChevronRightIcon.js";import"../icon/icons/ChevronUpIcon.js";import"../icon/icons/CloseIcon.js";import"../icon/icons/CopyIcon.js";import"../icon/icons/DotsIcon.js";import"../icon/icons/DragIcon.js";import"../icon/icons/ErrorIcon.js";import"../icon/icons/GreenCheckIcon.js";import"../icon/icons/HamburgerIcon.js";import"../icon/icons/InfoIcon.js";import"../icon/icons/LinkIcon.js";import"../icon/icons/MinusIcon.js";import"../icon/icons/OpenInNewIcon.js";import"../icon/icons/PenIcon.js";import"../icon/icons/PlusIcon.js";import"../icon/icons/QuestionIcon.js";import"../icon/icons/RedCrossIcon.js";import"../icon/icons/SearchIcon.js";import{SuccessIcon as s}from"../icon/icons/SuccessIcon.js";import"../icon/icons/ThumbDownIcon.js";import"../icon/icons/ThumbUpIcon.js";import{TrashCanIcon as r}from"../icon/icons/TrashCanIcon.js";import"../icon/icons/WarningIcon.js";import{IconButton as e}from"../icon-button/IconButton.js";import{SupportLabel as t}from"../input-group/SupportLabel.js";import{formatBytes as
|
|
1
|
+
import{jsxs as o,jsx as i}from"react/jsx-runtime";import{c as n}from"../../../clsx-BeLtu-UY.js";import{useId as c}from"react";import"../icon/Icon.js";import"../icon/icons/animated/ArrowVerticalAnimated.js";import"../icon/icons/animated/ArrowHorizontalAnimated.js";import"../icon/icons/animated/PlusRemoveAnimated.js";import"../icon/icons/ArrowDownIcon.js";import"../icon/icons/ArrowLeftIcon.js";import"../icon/icons/ArrowNorthEastIcon.js";import"../icon/icons/ArrowRightIcon.js";import"../icon/icons/ArrowUpIcon.js";import"../icon/icons/CalendarIcon.js";import"../icon/icons/CheckIcon.js";import"../icon/icons/ChevronDownIcon.js";import"../icon/icons/ChevronLeftIcon.js";import"../icon/icons/ChevronRightIcon.js";import"../icon/icons/ChevronUpIcon.js";import"../icon/icons/CloseIcon.js";import"../icon/icons/CopyIcon.js";import"../icon/icons/DotsIcon.js";import"../icon/icons/DragIcon.js";import"../icon/icons/ErrorIcon.js";import"../icon/icons/GreenCheckIcon.js";import"../icon/icons/HamburgerIcon.js";import"../icon/icons/InfoIcon.js";import"../icon/icons/LinkIcon.js";import"../icon/icons/MinusIcon.js";import"../icon/icons/OpenInNewIcon.js";import"../icon/icons/PenIcon.js";import"../icon/icons/PlusIcon.js";import"../icon/icons/QuestionIcon.js";import"../icon/icons/RedCrossIcon.js";import"../icon/icons/SearchIcon.js";import{SuccessIcon as s}from"../icon/icons/SuccessIcon.js";import"../icon/icons/ThumbDownIcon.js";import"../icon/icons/ThumbUpIcon.js";import{TrashCanIcon as r}from"../icon/icons/TrashCanIcon.js";import"../icon/icons/WarningIcon.js";import{IconButton as e}from"../icon-button/IconButton.js";import{SupportLabel as t}from"../input-group/SupportLabel.js";import{formatBytes as a}from"../../utilities/formatters/bytes/formatBytes.js";import{useFileInputContext as l}from"./internal/fileInputContext.js";import{Thumbnail as m}from"./internal/Thumbnail.js";const p=p=>{const{children:j,className:I,fileName:f,fileType:u,fileSize:d,path:h,file:b,supportLabel:_,supportLabelType:k,state:w,onRemove:C,...v}=p,N=`jkl-file-preview-${c()}`,T=N+"-support",g=l(),y=h?"a":"div",A="error"===k||"warning"===k,x="success"===k,L=o("div",{id:N,className:n(I,"jkl-file"),...v,children:[o(y,{className:n("jkl-file__content",{"jkl-file__content--error":"error"===k,"jkl-file__content--warning":"warning"===k}),href:h,target:h?"_blank":void 0,children:[i(m,{fileName:f,fileType:u,file:b,path:h,state:w,children:j}),o("div",{children:[i("p",{className:"jkl-file__name",children:f}),o("p",{className:"jkl-file__description",children:[i("span",{children:a(d)}),A||x?x?i(s,{variant:"small","aria-label":"Filen ble lastet opp uten feil","aria-hidden":!1}):null:i(t,{className:"jkl-file__support-label jkl-body",id:T,label:_,labelType:k})]}),_&&A&&i(t,{className:"jkl-file__support-label",id:T,label:_,labelType:k})]})]}),C&&i(e,{className:"jkl-file__delete",onClick:C,title:`Fjern ${f}`,children:i(r,{})})]});return g?i("li",{children:L}):L};export{p as File};
|
|
2
2
|
//# sourceMappingURL=File.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"File.js","sources":["../../../../src/components/file-input/File.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React, {\n type ComponentProps,\n type FC,\n type MouseEvent,\n useId,\n} from \"react\";\nimport { TrashCanIcon, SuccessIcon } from \"../../components/icon/index.js\";\nimport { IconButton } from \"../../components/icon-button/IconButton.js\";\nimport { SupportLabel } from \"../../components/input-group/SupportLabel.js\";\nimport { formatBytes } from \"../../utilities/formatters/bytes/formatBytes.js\";\nimport { useFileInputContext } from \"./internal/fileInputContext.js\";\nimport { Thumbnail } from \"./internal/Thumbnail.js\";\nimport type { FileInputFileState } from \"./types.js\";\n\nexport type FileProps = {\n fileName: string;\n fileType: string;\n fileSize: number;\n path?: string;\n file?: File;\n supportLabel?: string;\n supportLabelType?: \"help\" | \"error\" | \"warning\" | \"success\";\n state?: FileInputFileState;\n onRemove?: (e: MouseEvent<HTMLButtonElement>) => void;\n};\n\nexport const File: FC<FileProps & ComponentProps<\"div\">> = (props) => {\n const {\n children,\n className,\n fileName,\n fileType,\n fileSize,\n path,\n file,\n supportLabel,\n supportLabelType,\n state,\n onRemove,\n ...rest\n } = props;\n\n const id = `jkl-file-preview-${useId()}`;\n const supportId = id + \"-support\";\n\n const context = useFileInputContext();\n\n const Component = path ? \"a\" : \"div\";\n\n const hasErrorOrWarning =\n supportLabelType === \"error\" || supportLabelType === \"warning\";\n const hasSuccess = supportLabelType === \"success\";\n\n const renderFeedbackElement = () => {\n if (!hasErrorOrWarning && !hasSuccess) {\n return (\n <SupportLabel\n className=\"jkl-file__support-label jkl-body\"\n id={supportId}\n label={supportLabel}\n labelType={supportLabelType}\n />\n );\n }\n\n if (hasSuccess)\n return (\n <SuccessIcon\n variant=\"small\"\n aria-label=\"Filen ble lastet opp uten feil\"\n />\n );\n\n return null;\n };\n\n const fileComponent = (\n <div id={id} className={clsx(className, \"jkl-file\")} {...rest}>\n <Component\n className={clsx(\"jkl-file__content\", {\n \"jkl-file__content--error\": supportLabelType === \"error\",\n \"jkl-file__content--warning\":\n supportLabelType === \"warning\",\n })}\n href={path}\n target={path ? \"_blank\" : undefined}\n >\n <Thumbnail\n fileName={fileName}\n fileType={fileType}\n file={file}\n path={path}\n state={state}\n >\n {children}\n </Thumbnail>\n <div>\n <p className=\"jkl-file__name\">{fileName}</p>\n <p className=\"jkl-file__description\">\n <span>{formatBytes(fileSize)}</span>\n {renderFeedbackElement()}\n </p>\n {supportLabel && hasErrorOrWarning && (\n <SupportLabel\n className=\"jkl-file__support-label\"\n id={supportId}\n label={supportLabel}\n labelType={supportLabelType}\n />\n )}\n </div>\n </Component>\n {onRemove && (\n <IconButton\n className=\"jkl-file__delete\"\n onClick={onRemove}\n title={`Fjern ${fileName}`}\n >\n <TrashCanIcon />\n </IconButton>\n )}\n </div>\n );\n\n return context ? <li>{fileComponent}</li> : fileComponent;\n};\n"],"names":["File","props","children","className","fileName","fileType","fileSize","path","file","supportLabel","supportLabelType","state","onRemove","rest","id","useId","supportId","context","useFileInputContext","Component","hasErrorOrWarning","hasSuccess","fileComponent","jsxs","clsx","href","target","jsx","Thumbnail","formatBytes","SuccessIcon","variant","SupportLabel","label","labelType","IconButton","onClick","title","TrashCanIcon"],"mappings":"o1DA2Ba,MAAAA,EAA+CC,IAClD,MACFC,SAAAA,EACAC,UAAAA,EACAC,SAAAA,EACAC,SAAAA,EACAC,SAAAA,EACAC,KAAAA,EACAC,KAAAA,EACAC,aAAAA,EACAC,iBAAAA,EACAC,MAAAA,EACAC,SAAAA,KACGC,GACHZ,EAEEa,EAAK,oBAAoBC,MACzBC,EAAYF,EAAK,WAEjBG,EAAUC,IAEVC,EAAYZ,EAAO,IAAM,MAEzBa,EACmB,UAArBV,GAAqD,YAArBA,EAC9BW,EAAkC,YAArBX,
|
|
1
|
+
{"version":3,"file":"File.js","sources":["../../../../src/components/file-input/File.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React, {\n type ComponentProps,\n type FC,\n type MouseEvent,\n useId,\n} from \"react\";\nimport { TrashCanIcon, SuccessIcon } from \"../../components/icon/index.js\";\nimport { IconButton } from \"../../components/icon-button/IconButton.js\";\nimport { SupportLabel } from \"../../components/input-group/SupportLabel.js\";\nimport { formatBytes } from \"../../utilities/formatters/bytes/formatBytes.js\";\nimport { useFileInputContext } from \"./internal/fileInputContext.js\";\nimport { Thumbnail } from \"./internal/Thumbnail.js\";\nimport type { FileInputFileState } from \"./types.js\";\n\nexport type FileProps = {\n fileName: string;\n fileType: string;\n fileSize: number;\n path?: string;\n file?: File;\n supportLabel?: string;\n supportLabelType?: \"help\" | \"error\" | \"warning\" | \"success\";\n state?: FileInputFileState;\n onRemove?: (e: MouseEvent<HTMLButtonElement>) => void;\n};\n\nexport const File: FC<FileProps & ComponentProps<\"div\">> = (props) => {\n const {\n children,\n className,\n fileName,\n fileType,\n fileSize,\n path,\n file,\n supportLabel,\n supportLabelType,\n state,\n onRemove,\n ...rest\n } = props;\n\n const id = `jkl-file-preview-${useId()}`;\n const supportId = id + \"-support\";\n\n const context = useFileInputContext();\n\n const Component = path ? \"a\" : \"div\";\n\n const hasErrorOrWarning =\n supportLabelType === \"error\" || supportLabelType === \"warning\";\n const hasSuccess = supportLabelType === \"success\";\n\n const renderFeedbackElement = () => {\n if (!hasErrorOrWarning && !hasSuccess) {\n return (\n <SupportLabel\n className=\"jkl-file__support-label jkl-body\"\n id={supportId}\n label={supportLabel}\n labelType={supportLabelType}\n />\n );\n }\n\n if (hasSuccess)\n return (\n <SuccessIcon\n variant=\"small\"\n aria-label=\"Filen ble lastet opp uten feil\"\n aria-hidden={false}\n />\n );\n\n return null;\n };\n\n const fileComponent = (\n <div id={id} className={clsx(className, \"jkl-file\")} {...rest}>\n <Component\n className={clsx(\"jkl-file__content\", {\n \"jkl-file__content--error\": supportLabelType === \"error\",\n \"jkl-file__content--warning\":\n supportLabelType === \"warning\",\n })}\n href={path}\n target={path ? \"_blank\" : undefined}\n >\n <Thumbnail\n fileName={fileName}\n fileType={fileType}\n file={file}\n path={path}\n state={state}\n >\n {children}\n </Thumbnail>\n <div>\n <p className=\"jkl-file__name\">{fileName}</p>\n <p className=\"jkl-file__description\">\n <span>{formatBytes(fileSize)}</span>\n {renderFeedbackElement()}\n </p>\n {supportLabel && hasErrorOrWarning && (\n <SupportLabel\n className=\"jkl-file__support-label\"\n id={supportId}\n label={supportLabel}\n labelType={supportLabelType}\n />\n )}\n </div>\n </Component>\n {onRemove && (\n <IconButton\n className=\"jkl-file__delete\"\n onClick={onRemove}\n title={`Fjern ${fileName}`}\n >\n <TrashCanIcon />\n </IconButton>\n )}\n </div>\n );\n\n return context ? <li>{fileComponent}</li> : fileComponent;\n};\n"],"names":["File","props","children","className","fileName","fileType","fileSize","path","file","supportLabel","supportLabelType","state","onRemove","rest","id","useId","supportId","context","useFileInputContext","Component","hasErrorOrWarning","hasSuccess","fileComponent","jsxs","clsx","href","target","jsx","Thumbnail","formatBytes","SuccessIcon","variant","SupportLabel","label","labelType","IconButton","onClick","title","TrashCanIcon"],"mappings":"o1DA2Ba,MAAAA,EAA+CC,IAClD,MACFC,SAAAA,EACAC,UAAAA,EACAC,SAAAA,EACAC,SAAAA,EACAC,SAAAA,EACAC,KAAAA,EACAC,KAAAA,EACAC,aAAAA,EACAC,iBAAAA,EACAC,MAAAA,EACAC,SAAAA,KACGC,GACHZ,EAEEa,EAAK,oBAAoBC,MACzBC,EAAYF,EAAK,WAEjBG,EAAUC,IAEVC,EAAYZ,EAAO,IAAM,MAEzBa,EACmB,UAArBV,GAAqD,YAArBA,EAC9BW,EAAkC,YAArBX,EA0BbY,EACDC,EAAA,MAAA,CAAIT,GAAAA,EAAQX,UAAWqB,EAAKrB,EAAW,eAAiBU,EACrDX,SAAA,CAAAqB,EAACJ,EAAA,CACGhB,UAAWqB,EAAK,oBAAqB,CACjC,2BAAiD,UAArBd,EAC5B,6BACyB,YAArBA,IAERe,KAAMlB,EACNmB,OAAQnB,EAAO,cAAW,EAE1BL,SAAA,CAAAyB,EAACC,EAAA,CACGxB,SAAAA,EACAC,SAAAA,EACAG,KAAAA,EACAD,KAAAA,EACAI,MAAAA,EAECT,SAAAA,MAEJ,MACG,CAAAA,SAAA,CAACyB,EAAA,IAAA,CAAExB,UAAU,iBAAkBD,SAASE,IACxCmB,EAAC,IAAE,CAAApB,UAAU,wBACTD,SAAA,CAACyB,EAAA,OAAA,CAAMzB,SAAY2B,EAAAvB,KA9C9Bc,GAAsBC,EAWvBA,EAEIM,EAACG,EAAA,CACGC,QAAQ,QACR,aAAW,iCACX,eAAa,IAIlB,KAlBCJ,EAACK,EAAA,CACG7B,UAAU,mCACVW,GAAIE,EACJiB,MAAOxB,EACPyB,UAAWxB,OA2CVD,GAAgBW,GACbO,EAACK,EAAA,CACG7B,UAAU,0BACVW,GAAIE,EACJiB,MAAOxB,EACPyB,UAAWxB,UAK1BE,GACGe,EAACQ,EAAA,CACGhC,UAAU,mBACViC,QAASxB,EACTyB,MAAO,SAASjC,IAEhBF,WAACoC,EAAa,SAMvBrB,OAAAA,EAAUU,EAAC,KAAI,CAAAzB,SAAAoB,IAAsBA,CAAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as o,jsxs as n}from"react/jsx-runtime";import{useState as r}from"react";import{TextInput as s}from"../../text-input/TextInput.js";import{Icon as c}from"../Icon.js";import"../icons/animated/ArrowVerticalAnimated.js";import"../icons/animated/ArrowHorizontalAnimated.js";import"../icons/animated/PlusRemoveAnimated.js";import{ArrowDownIcon as i}from"../icons/ArrowDownIcon.js";import{ArrowLeftIcon as e}from"../icons/ArrowLeftIcon.js";import{ArrowNorthEastIcon as t}from"../icons/ArrowNorthEastIcon.js";import{ArrowRightIcon as m}from"../icons/ArrowRightIcon.js";import{ArrowUpIcon as a}from"../icons/ArrowUpIcon.js";import{CalendarIcon as I}from"../icons/CalendarIcon.js";import{CheckIcon as p}from"../icons/CheckIcon.js";import{ChevronDownIcon as f}from"../icons/ChevronDownIcon.js";import{ChevronLeftIcon as l}from"../icons/ChevronLeftIcon.js";import{ChevronRightIcon as j}from"../icons/ChevronRightIcon.js";import{ChevronUpIcon as
|
|
1
|
+
import{jsx as o,jsxs as n}from"react/jsx-runtime";import{useState as r}from"react";import{TextInput as s}from"../../text-input/TextInput.js";import{Icon as c}from"../Icon.js";import"../icons/animated/ArrowVerticalAnimated.js";import"../icons/animated/ArrowHorizontalAnimated.js";import"../icons/animated/PlusRemoveAnimated.js";import{ArrowDownIcon as i}from"../icons/ArrowDownIcon.js";import{ArrowLeftIcon as e}from"../icons/ArrowLeftIcon.js";import{ArrowNorthEastIcon as t}from"../icons/ArrowNorthEastIcon.js";import{ArrowRightIcon as m}from"../icons/ArrowRightIcon.js";import{ArrowUpIcon as a}from"../icons/ArrowUpIcon.js";import{CalendarIcon as I}from"../icons/CalendarIcon.js";import{CheckIcon as p}from"../icons/CheckIcon.js";import{ChevronDownIcon as f}from"../icons/ChevronDownIcon.js";import{ChevronLeftIcon as l}from"../icons/ChevronLeftIcon.js";import{ChevronRightIcon as j}from"../icons/ChevronRightIcon.js";import{ChevronUpIcon as h}from"../icons/ChevronUpIcon.js";import{CloseIcon as d}from"../icons/CloseIcon.js";import{CopyIcon as u}from"../icons/CopyIcon.js";import{DotsIcon as w}from"../icons/DotsIcon.js";import{DragIcon as C}from"../icons/DragIcon.js";import{ErrorIcon as v}from"../icons/ErrorIcon.js";import{GreenCheckIcon as g}from"../icons/GreenCheckIcon.js";import{HamburgerIcon as A}from"../icons/HamburgerIcon.js";import{InfoIcon as b}from"../icons/InfoIcon.js";import{LinkIcon as k}from"../icons/LinkIcon.js";import{MinusIcon as x}from"../icons/MinusIcon.js";import{OpenInNewIcon as y}from"../icons/OpenInNewIcon.js";import{PenIcon as D}from"../icons/PenIcon.js";import{PlusIcon as T}from"../icons/PlusIcon.js";import{QuestionIcon as N}from"../icons/QuestionIcon.js";import{RedCrossIcon as R}from"../icons/RedCrossIcon.js";import{SearchIcon as S}from"../icons/SearchIcon.js";import{SuccessIcon as L}from"../icons/SuccessIcon.js";import{ThumbDownIcon as U}from"../icons/ThumbDownIcon.js";import{ThumbUpIcon as P}from"../icons/ThumbUpIcon.js";import{TrashCanIcon as E}from"../icons/TrashCanIcon.js";import{WarningIcon as H}from"../icons/WarningIcon.js";/* empty css */const z=({name:n,renderIcon:r,...s})=>o("div",{title:n||r.name,...s,children:r()}),G=({columns:n,children:r,...s})=>o("div",{className:`jkl-example-grid jkl-example-grid--${n}-columns`,...s,children:r}),M={title:"Komponenter/Ikoner",component:c,parameters:{layout:"centered"},tags:["autodocs"],argTypes:{variant:{control:"radio",options:["inherit","medium","small"]}}},O=[i,e,t,m,a,I,p,f,l,j,h,d,u,w,C,v,g,A,b,k,x,y,D,T,N,R,S,L,U,P,E,H],Q={args:{variant:"small",bold:!1},render:({variant:c,bold:i})=>{const[e,t]=r("1rem");return n("div",{style:{width:"50vw"},children:["inherit"===c&&o(s,{label:"Fontstørrelse",className:"jkl-spacing-24--bottom",value:e,onChange:o=>t(o.target.value),width:"10ch"}),o(G,{style:{fontSize:e},columns:"four",children:O.map((n=>o(z,{style:{justifySelf:"center"},renderIcon:()=>o(n,{bold:i,variant:c}),name:n.displayName},n.displayName)))})]})}};export{Q as Ikoner,M as default};
|
|
2
2
|
//# sourceMappingURL=Icons.stories.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: ({ className, id, centered, isSymbol, animated, title, ...rest }: import('../types.js').LogoProps) => JSX.Element;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
tags: string[];
|
|
9
|
+
};
|
|
10
|
+
export default meta;
|
|
11
|
+
type Story = StoryObj<typeof meta>;
|
|
12
|
+
export declare const Logo: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Logo.stories.js","sources":["../../../../../src/components/logo/stories/Logo.stories.tsx"],"sourcesContent":["import { Meta, StoryObj } from \"@storybook/react\";\nimport { Logo as LogoComponent } from \"../Logo.js\";\nimport \"../styles/_index.scss\";\n\nconst meta = {\n title: \"Komponenter/Logo/Logo\",\n component: LogoComponent,\n parameters: {\n layout: \"centered\",\n },\n tags: [\"autodocs\"],\n} satisfies Meta<typeof LogoComponent>;\n\nexport default meta;\ntype Story = StoryObj<typeof meta>;\n\nexport const Logo: Story = {};\n"],"names":["meta","title","component","LogoComponent","parameters","layout","tags","Logo"],"mappings":"yEAIA,MAAMA,EAAO,CACTC,MAAO,wBACPC,UAAWC,EACXC,WAAY,CACRC,OAAQ,YAEZC,KAAM,CAAC,aAMEC,EAAc,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: ({ children, className, id, animated, title, ...rest }: import('../types.js').LogoStampProps) => JSX.Element;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
tags: string[];
|
|
9
|
+
};
|
|
10
|
+
export default meta;
|
|
11
|
+
type Story = StoryObj<typeof meta>;
|
|
12
|
+
export declare const LogoStamp: Story;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{LogoStamp as t}from"../LogoStamp.js";import{FraSB1ogDNB as a}from"../text-paths/FraSB1ogDNB.js";/* empty css */const r={title:"Komponenter/Logo/LogoStamp",component:t,parameters:{layout:"centered"},tags:["autodocs"]},e={args:{children:o(a,{}),title:"Fra SB1 og DNB"}};export{e as LogoStamp,r as default};
|
|
2
|
+
//# sourceMappingURL=LogoStamp.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LogoStamp.stories.js","sources":["../../../../../src/components/logo/stories/LogoStamp.stories.tsx"],"sourcesContent":["import { Meta, StoryObj } from \"@storybook/react\";\nimport React from \"react\";\nimport { LogoStamp as LogoStampComponent } from \"../LogoStamp.js\";\nimport { FraSB1ogDNB } from \"../text-paths/FraSB1ogDNB.js\";\nimport \"../styles/_index.scss\";\n\nconst meta = {\n title: \"Komponenter/Logo/LogoStamp\",\n component: LogoStampComponent,\n parameters: {\n layout: \"centered\",\n },\n tags: [\"autodocs\"],\n} satisfies Meta<typeof LogoStampComponent>;\n\nexport default meta;\ntype Story = StoryObj<typeof meta>;\n\nexport const LogoStamp: Story = {\n args: {\n children: <FraSB1ogDNB />,\n title: \"Fra SB1 og DNB\",\n },\n};\n"],"names":["meta","title","component","LogoStampComponent","parameters","layout","tags","LogoStamp","args","children","FraSB1ogDNB"],"mappings":"sLAMA,MAAMA,EAAO,CACTC,MAAO,6BACPC,UAAWC,EACXC,WAAY,CACRC,OAAQ,YAEZC,KAAM,CAAC,aAMEC,EAAmB,CAC5BC,KAAM,CACFC,WAAWC,EAAY,IACvBT,MAAO"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import('react').ForwardRefExoticComponent<import('../types.js').TextAreaProps & import('react').RefAttributes<HTMLTextAreaElement>>;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
tags: string[];
|
|
9
|
+
};
|
|
10
|
+
export default meta;
|
|
11
|
+
type Story = StoryObj<typeof meta>;
|
|
12
|
+
export declare const TextArea: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextArea.stories.js","sources":["../../../../../src/components/text-area/stories/TextArea.stories.tsx"],"sourcesContent":["import { Meta, StoryObj } from \"@storybook/react\";\nimport { TextArea as TextAreaComponent } from \"../TextArea.js\";\nimport \"../styles/_index.scss\";\n\nconst meta = {\n title: \"Komponenter/TextArea\",\n component: TextAreaComponent,\n parameters: {\n layout: \"centered\",\n },\n tags: [\"autodocs\"],\n} satisfies Meta<typeof TextAreaComponent>;\n\nexport default meta;\ntype Story = StoryObj<typeof meta>;\n\nexport const TextArea: Story = {\n args: {\n label: \"Beskrivelse\",\n },\n};\n"],"names":["meta","title","component","TextAreaComponent","parameters","layout","tags","TextArea","args","label"],"mappings":"0CAIA,MAAMA,EAAO,CACTC,MAAO,uBACPC,UAAWC,EACXC,WAAY,CACRC,OAAQ,YAEZC,KAAM,CAAC,aAMEC,EAAkB,CAC3BC,KAAM,CACFC,MAAO"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import('react').ForwardRefExoticComponent<Omit<import('react').ButtonHTMLAttributes<HTMLButtonElement>, "onChange"> & {
|
|
5
|
+
density?: import('../../../index.js').Density;
|
|
6
|
+
onChange?: import('../types.js').ToggleChangeHandler<HTMLButtonElement>;
|
|
7
|
+
} & import('react').RefAttributes<HTMLButtonElement>>;
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: string;
|
|
10
|
+
};
|
|
11
|
+
tags: string[];
|
|
12
|
+
};
|
|
13
|
+
export default meta;
|
|
14
|
+
type Story = StoryObj<typeof meta>;
|
|
15
|
+
export declare const ToggleSwitch: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToggleSwitch.stories.js","sources":["../../../../../src/components/toggle-switch/stories/ToggleSwitch.stories.tsx"],"sourcesContent":["import { Meta, StoryObj } from \"@storybook/react\";\nimport { ToggleSwitch as ToggleSwitchComponent } from \"../ToggleSwitch.js\";\nimport \"../styles/_index.scss\";\n\nconst meta = {\n title: \"Komponenter/ToggleSwitch\",\n component: ToggleSwitchComponent,\n parameters: {\n layout: \"centered\",\n },\n tags: [\"autodocs\"],\n} satisfies Meta<typeof ToggleSwitchComponent>;\n\nexport default meta;\ntype Story = StoryObj<typeof meta>;\n\nexport const ToggleSwitch: Story = {\n args: {\n children: \"Mørk modus\",\n },\n};\n"],"names":["meta","title","component","ToggleSwitchComponent","parameters","layout","tags","ToggleSwitch","args","children"],"mappings":"kDAIA,MAAMA,EAAO,CACTC,MAAO,2BACPC,UAAWC,EACXC,WAAY,CACRC,OAAQ,YAEZC,KAAM,CAAC,aAMEC,EAAsB,CAC/BC,KAAM,CACFC,SAAU"}
|