@sikt/sds-notification 1.0.0

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/CHANGELOG.md ADDED
@@ -0,0 +1,9 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
4
+
5
+ ## 1.0.0 (2026-01-28)
6
+
7
+ ### Features
8
+
9
+ - **notification:** add new notification component ([42fbd81](https://gitlab.sikt.no/designsystem/sds-komponentbibliotek/commit/42fbd8115dbfe1a18f7d2c78c618babc917f121a))
package/README.md ADDED
@@ -0,0 +1,30 @@
1
+ # `@sikt/sds-notification`
2
+
3
+ ## Consume
4
+
5
+ ```sh
6
+ npm i -s @sikt/sds-notification
7
+ ```
8
+
9
+ ### React
10
+
11
+ ```js
12
+ import { Notification } from "packages/notification";
13
+ import "@sikt/sds-notification/dist/index.css";
14
+
15
+ /* jsx example goes here */
16
+ ```
17
+
18
+ ### Stylesheets & custom markup
19
+
20
+ Import stylesheet:
21
+
22
+ ```css
23
+ @import url("@sikt/sds-notification");
24
+ ```
25
+
26
+ Create custom markup:
27
+
28
+ ```html
29
+ <!-- html example goes here -->
30
+ ```
package/dist/index.css ADDED
@@ -0,0 +1,24 @@
1
+ /* src/notification.pcss */
2
+ .sds-notification {
3
+ align-items: center;
4
+ background-color: var(--sds-color-support-info-strong);
5
+ border-radius: var(--sds-space-border-radius-full);
6
+ color: var(--sds-color-text-on-strong);
7
+ display: inline-flex;
8
+ font-size: var(--sds-typography-fontsize-300);
9
+ justify-content: center;
10
+ padding: 0 var(--sds-space-padding-infinitesimal);
11
+ min-width: 1em;
12
+ min-height: 1em;
13
+ }
14
+ .sds-notification__count {
15
+ align-items: center;
16
+ display: inline-flex;
17
+ font-size: var(--sds-typography-body-default-fontsize);
18
+ font-weight: var(--sds-typography-fontweight-semibold);
19
+ justify-content: center;
20
+ line-height: var(--sds-typography-body-default-lineheight);
21
+ padding: 0 var(--sds-space-padding-minimal);
22
+ min-width: 1.25em;
23
+ }
24
+ /*# sourceMappingURL=index.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/notification.pcss"],"sourcesContent":[".sds-notification {\n align-items: center;\n background-color: var(--sds-color-support-info-strong);\n border-radius: var(--sds-space-border-radius-full);\n color: var(--sds-color-text-on-strong);\n display: inline-flex;\n font-size: var(--sds-typography-fontsize-300);\n justify-content: center;\n padding: 0 var(--sds-space-padding-infinitesimal);\n min-width: 1em;\n min-height: 1em;\n}\n\n .sds-notification__count {\n align-items: center;\n display: inline-flex;\n font-size: var(--sds-typography-body-default-fontsize);\n font-weight: var(--sds-typography-fontweight-semibold);\n justify-content: center;\n line-height: var(--sds-typography-body-default-lineheight);\n padding: 0 var(--sds-space-padding-minimal);\n min-width: 1.25em;\n }\n"],"mappings":";AAAA,CAAC;AACC,eAAa;AACb,oBAAkB,IAAI;AACtB,iBAAe,IAAI;AACnB,SAAO,IAAI;AACX,WAAS;AACT,aAAW,IAAI;AACf,mBAAiB;AACjB,WAAS,EAAE,IAAI;AACf,aAAW;AACX,cAAY;AACd;AAEE,CAAC;AACC,eAAa;AACb,WAAS;AACT,aAAW,IAAI;AACf,eAAa,IAAI;AACjB,mBAAiB;AACjB,eAAa,IAAI;AACjB,WAAS,EAAE,IAAI;AACf,aAAW;AACb;","names":[]}
@@ -0,0 +1,14 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { HTMLAttributes } from 'react';
3
+
4
+ interface NotificationProps extends HTMLAttributes<HTMLSpanElement> {
5
+ className?: string;
6
+ count?: number;
7
+ maxCount?: number;
8
+ }
9
+ declare const Notification: {
10
+ ({ className, count, maxCount, ...rest }: NotificationProps): react_jsx_runtime.JSX.Element;
11
+ displayName: string;
12
+ };
13
+
14
+ export { Notification, type NotificationProps };
@@ -0,0 +1,14 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { HTMLAttributes } from 'react';
3
+
4
+ interface NotificationProps extends HTMLAttributes<HTMLSpanElement> {
5
+ className?: string;
6
+ count?: number;
7
+ maxCount?: number;
8
+ }
9
+ declare const Notification: {
10
+ ({ className, count, maxCount, ...rest }: NotificationProps): react_jsx_runtime.JSX.Element;
11
+ displayName: string;
12
+ };
13
+
14
+ export { Notification, type NotificationProps };
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";var e=require("clsx/lite"),r=require("react/jsx-runtime"),t=Object.defineProperty,a=Object.defineProperties,n=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable,s=(e,r,a)=>r in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[r]=a,l=t=>{var l,f,u=t,{className:p,count:b,maxCount:m=1/0}=u,O=((e,r)=>{var t={};for(var a in e)i.call(e,a)&&r.indexOf(a)<0&&(t[a]=e[a]);if(null!=e&&o)for(var a of o(e))r.indexOf(a)<0&&c.call(e,a)&&(t[a]=e[a]);return t})(u,["className","count","maxCount"]);return r.jsx("span",(l=((e,r)=>{for(var t in r||(r={}))i.call(r,t)&&s(e,t,r[t]);if(o)for(var t of o(r))c.call(r,t)&&s(e,t,r[t]);return e})({className:e.clsx("sds-notification",p)},O),f={children:b&&r.jsx("span",{className:"sds-notification__count",children:m<b?"".concat(m,"+"):b})},a(l,n(f))))};l.displayName="Notification",exports.Notification=l;//# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/Notification.tsx"],"names":["jsx","clsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUa,IAAA,YAAA,GAAe,CAAC,EAKJ,KAAA;AALI,EAC3B,IAAA,EAAA,GAAA,EAAA,EAAA;AAAA,IAAA,SAAA;AAAA,IACA,KAAA;AAAA,IACA,QAAW,GAAA;AAAA,GAbb,GAU6B,EAIxB,EAAA,IAAA,GAAA,SAAA,CAJwB,EAIxB,EAAA;AAAA,IAHH,WAAA;AAAA,IACA,OAAA;AAAA,IACA;AAAA,GAAA,CAAA;AAGA,EACE,uBAAAA,cAAA,CAAC,uCAAK,SAAW,EAAAC,SAAA,CAAK,oBAAoB,SAAS,CAAA,EAAA,EAAO,OAAzD,EACE,QAAA,EAAA,KAAA,mCACE,MAAK,EAAA,EAAA,SAAA,EAAU,2BACb,QAAW,EAAA,QAAA,GAAA,KAAA,GAAQ,GAAG,MAAQ,CAAA,QAAA,EAAA,GAAA,CAAA,GAAM,OACvC,CAEJ,EAAA,CAAA,CAAA;AAEJ;AAEA,YAAA,CAAa,WAAc,GAAA,cAAA","file":"index.js","sourcesContent":["import { clsx } from \"clsx/lite\";\nimport { HTMLAttributes } from \"react\";\nimport \"./notification.pcss\";\n\nexport interface NotificationProps extends HTMLAttributes<HTMLSpanElement> {\n className?: string;\n count?: number;\n maxCount?: number;\n}\n\nexport const Notification = ({\n className,\n count,\n maxCount = Infinity,\n ...rest\n}: NotificationProps) => {\n return (\n <span className={clsx(\"sds-notification\", className)} {...rest}>\n {count && (\n <span className=\"sds-notification__count\">\n {maxCount < count ? `${maxCount}+` : count}\n </span>\n )}\n </span>\n );\n};\n\nNotification.displayName = \"Notification\";\n"]}
package/dist/index.mjs ADDED
@@ -0,0 +1 @@
1
+ import{clsx as e}from"clsx/lite";import{jsx as r}from"react/jsx-runtime";var t=Object.defineProperty,a=Object.defineProperties,o=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable,l=(e,r,a)=>r in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[r]=a,s=t=>{var s,f,p=t,{className:m,count:u,maxCount:b=1/0}=p,O=((e,r)=>{var t={};for(var a in e)i.call(e,a)&&r.indexOf(a)<0&&(t[a]=e[a]);if(null!=e&&n)for(var a of n(e))r.indexOf(a)<0&&c.call(e,a)&&(t[a]=e[a]);return t})(p,["className","count","maxCount"]);return r("span",(s=((e,r)=>{for(var t in r||(r={}))i.call(r,t)&&l(e,t,r[t]);if(n)for(var t of n(r))c.call(r,t)&&l(e,t,r[t]);return e})({className:e("sds-notification",m)},O),f={children:u&&r("span",{className:"sds-notification__count",children:b<u?"".concat(b,"+"):u})},a(s,o(f))))};s.displayName="Notification";export{s as Notification};//# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/Notification.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUa,IAAA,YAAA,GAAe,CAAC,EAKJ,KAAA;AALI,EAC3B,IAAA,EAAA,GAAA,EAAA,EAAA;AAAA,IAAA,SAAA;AAAA,IACA,KAAA;AAAA,IACA,QAAW,GAAA;AAAA,GAbb,GAU6B,EAIxB,EAAA,IAAA,GAAA,SAAA,CAJwB,EAIxB,EAAA;AAAA,IAHH,WAAA;AAAA,IACA,OAAA;AAAA,IACA;AAAA,GAAA,CAAA;AAGA,EACE,uBAAA,GAAA,CAAC,uCAAK,SAAW,EAAA,IAAA,CAAK,oBAAoB,SAAS,CAAA,EAAA,EAAO,OAAzD,EACE,QAAA,EAAA,KAAA,wBACE,MAAK,EAAA,EAAA,SAAA,EAAU,2BACb,QAAW,EAAA,QAAA,GAAA,KAAA,GAAQ,GAAG,MAAQ,CAAA,QAAA,EAAA,GAAA,CAAA,GAAM,OACvC,CAEJ,EAAA,CAAA,CAAA;AAEJ;AAEA,YAAA,CAAa,WAAc,GAAA,cAAA","file":"index.mjs","sourcesContent":["import { clsx } from \"clsx/lite\";\nimport { HTMLAttributes } from \"react\";\nimport \"./notification.pcss\";\n\nexport interface NotificationProps extends HTMLAttributes<HTMLSpanElement> {\n className?: string;\n count?: number;\n maxCount?: number;\n}\n\nexport const Notification = ({\n className,\n count,\n maxCount = Infinity,\n ...rest\n}: NotificationProps) => {\n return (\n <span className={clsx(\"sds-notification\", className)} {...rest}>\n {count && (\n <span className=\"sds-notification__count\">\n {maxCount < count ? `${maxCount}+` : count}\n </span>\n )}\n </span>\n );\n};\n\nNotification.displayName = \"Notification\";\n"]}
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "@sikt/sds-notification",
3
+ "version": "1.0.0",
4
+ "license": "UNLICENSED",
5
+ "description": "Notification component, Sikt component library",
6
+ "homepage": "https://designsystem.sikt.no/",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://gitlab.sikt.no/designsystem/sds-komponentbibliotek.git"
10
+ },
11
+ "type": "commonjs",
12
+ "main": "dist/index.js",
13
+ "module": "dist/index.mjs",
14
+ "exports": {
15
+ ".": {
16
+ "style": "./dist/index.css",
17
+ "import": {
18
+ "types": "./dist/index.d.mts",
19
+ "default": "./dist/index.mjs"
20
+ },
21
+ "require": {
22
+ "types": "./dist/index.d.ts",
23
+ "default": "./dist/index.js"
24
+ }
25
+ },
26
+ "./dist/*": "./dist/*"
27
+ },
28
+ "types": "dist/index.d.ts",
29
+ "style": "dist/index.css",
30
+ "files": [
31
+ "CHANGELOG.md",
32
+ "dist",
33
+ "README.md"
34
+ ],
35
+ "scripts": {
36
+ "build": "tsup"
37
+ },
38
+ "dependencies": {
39
+ "@sikt/sds-core": "^5.0.0"
40
+ },
41
+ "peerDependencies": {
42
+ "@types/react": "^18.0.0 || ^19.0.0",
43
+ "@types/react-dom": "^18.0.0 || ^19.0.0",
44
+ "clsx": "^2.1.0",
45
+ "react": "^18.0.0 || ^19.0.0",
46
+ "react-dom": "^18.0.0 || ^19.0.0"
47
+ }
48
+ }