@abumble/design-system 0.0.17 → 0.0.18

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/LICENSE CHANGED
@@ -1,20 +1,21 @@
1
- MIT License Copyright (c) 2025 abi
1
+ MIT License Copyright (c) 2025 Abilaesh Kandiah
2
2
 
3
- Permission is hereby granted, free of charge,
4
- to any person obtaining a copy of this software and associated documentation
5
- files (the "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish, distribute,
7
- sublicense, and/or sell copies of the Software, and to permit persons to whom the
8
- Software is furnished to do so, subject to the following conditions:
3
+ Permission is hereby granted,
4
+ free of charge, to any person obtaining a copy of this software and associated
5
+ documentation files (the "Software"), to deal in the Software without
6
+ restriction, including without limitation the rights to use, copy, modify, merge,
7
+ publish, distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to the
9
+ following conditions:
9
10
 
10
- The above
11
- copyright notice and this permission notice (including the next paragraph) shall
12
- be included in all copies or substantial portions of the Software.
11
+ The above copyright notice and this permission notice
12
+ (including the next paragraph) shall be included in all copies or substantial
13
+ portions of the Software.
13
14
 
14
- THE SOFTWARE
15
- IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
16
- BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
17
- PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
18
- BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
19
- CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
16
+ ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
18
+ EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
19
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -18,5 +18,5 @@ interface MessageBannerProps extends BannerProps {
18
18
  message: string | React.ReactNode;
19
19
  }
20
20
  declare function MessageBanner({ message, ...props }: MessageBannerProps): import("react/jsx-runtime").JSX.Element;
21
- export { Banner, MessageBanner, bannerType, type TBannerType };
21
+ export { Banner, bannerType, MessageBanner, type TBannerType };
22
22
  //# sourceMappingURL=Banner.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Banner.d.ts","sourceRoot":"","sources":["../../../src/components/Banner/Banner.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAMrD,QAAA,MAAM,UAAU;;;;;CAKN,CAAC;AAEX,KAAK,WAAW,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,CAAC,CAAC;AAiBhE,UAAU,WAAY,SAAQ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;IACxD,IAAI,EAAE,WAAW,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,eAAe,CAAC,iBAAiB,CAAC,CAAC;CAC7C;AAED,iBAAS,MAAM,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAA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@@ -1,76 +1,71 @@
1
- import { jsx as e, jsxs as o, Fragment as x } from "react/jsx-runtime";
2
- import { colorWeights as s } from "../constants.js";
3
- import { c as b } from "../shared/utils.js";
4
- import { CircleX as v, TriangleAlert as w, Lightbulb as B, Info as C, X as $ } from "lucide-react";
5
- import { B as I } from "../shared/Button.js";
6
- import { S as a } from "../shared/Skeleton.js";
7
- const n = {
1
+ import { jsx as n, jsxs as r, Fragment as u } from "react/jsx-runtime";
2
+ import { c as p } from "../shared/utils.js";
3
+ import { CircleX as N, TriangleAlert as g, Lightbulb as x, Info as b, X as v } from "lucide-react";
4
+ import { B } from "../shared/Button.js";
5
+ import { S as s } from "../shared/Skeleton.js";
6
+ const a = {
8
7
  Info: "info",
9
8
  Note: "note",
10
9
  Warning: "warning",
11
10
  Alert: "alert"
12
- }, i = {
13
- [n.Info]: C,
14
- [n.Note]: B,
15
- [n.Warning]: w,
16
- [n.Alert]: v
17
- }, m = {
18
- [n.Info]: "blue",
19
- [n.Note]: "green",
20
- [n.Warning]: "yellow",
21
- [n.Alert]: "red"
11
+ }, o = {
12
+ [a.Info]: b,
13
+ [a.Note]: x,
14
+ [a.Warning]: g,
15
+ [a.Alert]: N
22
16
  };
23
- function y({ type: r, title: t, loading: d, hideIcon: f, onClose: c, children: h, className: u, ...p }) {
24
- const l = m[r] || m.note, N = `bg-${l}-${s[0]} text-${l}-${s[1]} border-${l}-${s[2]}`, g = i[r] || i.note;
25
- return /* @__PURE__ */ e(
17
+ function w({ type: e, title: t, loading: i, hideIcon: c, onClose: l, children: m, className: d, ...h }) {
18
+ const f = o[e] ?? o[a.Note];
19
+ return /* @__PURE__ */ n(
26
20
  "div",
27
21
  {
28
- className: b("p-3 border-l-4 rounded", N, u),
22
+ "data-banner-type": e,
23
+ className: p(d),
29
24
  role: "alert",
30
- ...p,
31
- children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
32
- d ? /* @__PURE__ */ e(A, {}) : /* @__PURE__ */ o(x, { children: [
33
- !f && /* @__PURE__ */ e("div", { className: "flex-shrink-0 mr-3", children: /* @__PURE__ */ e(g, {}) }),
34
- /* @__PURE__ */ o("section", { children: [
35
- t && /* @__PURE__ */ e("p", { className: "font-bold", children: t }),
36
- h
25
+ ...h,
26
+ children: /* @__PURE__ */ r("div", { className: "flex items-start", children: [
27
+ i ? /* @__PURE__ */ n(C, {}) : /* @__PURE__ */ r(u, { children: [
28
+ !c && /* @__PURE__ */ n("div", { className: "flex-shrink-0 mr-3", children: /* @__PURE__ */ n(f, {}) }),
29
+ /* @__PURE__ */ r("section", { children: [
30
+ t && /* @__PURE__ */ n("p", { className: "font-bold", children: t }),
31
+ m
37
32
  ] })
38
33
  ] }),
39
- c && /* @__PURE__ */ e(W, { onClick: c })
34
+ l && /* @__PURE__ */ n(I, { onClick: l })
40
35
  ] })
41
36
  }
42
37
  );
43
38
  }
44
- function z({ message: r, ...t }) {
45
- return /* @__PURE__ */ e(y, { ...t, children: /* @__PURE__ */ e("p", { className: "text-sm", children: r }) });
39
+ function S({ message: e, ...t }) {
40
+ return /* @__PURE__ */ n(w, { ...t, children: /* @__PURE__ */ n("p", { className: "text-sm", children: e }) });
46
41
  }
47
- function A() {
48
- return /* @__PURE__ */ o("div", { className: "flex items-center space-x-4", children: [
49
- /* @__PURE__ */ e(a, { className: "h-12 w-12 rounded-full" }),
50
- /* @__PURE__ */ o("div", { className: "space-y-2", children: [
51
- /* @__PURE__ */ e(a, { className: "h-4 w-[250px]" }),
52
- /* @__PURE__ */ e(a, { className: "h-4 w-[200px]" })
42
+ function C() {
43
+ return /* @__PURE__ */ r("div", { className: "flex items-center space-x-4", children: [
44
+ /* @__PURE__ */ n(s, { className: "h-12 w-12 rounded-full" }),
45
+ /* @__PURE__ */ r("div", { className: "space-y-2", children: [
46
+ /* @__PURE__ */ n(s, { className: "h-4 w-[250px]" }),
47
+ /* @__PURE__ */ n(s, { className: "h-4 w-[200px]" })
53
48
  ] })
54
49
  ] });
55
50
  }
56
- function W(r) {
57
- return /* @__PURE__ */ o(
58
- I,
51
+ function I(e) {
52
+ return /* @__PURE__ */ r(
53
+ B,
59
54
  {
60
55
  variant: "ghost",
61
56
  size: "icon",
62
57
  className: "h-8 w-8 rounded-full ml-auto mb-auto relative -top-1 -right-1",
63
- ...r,
58
+ ...e,
64
59
  children: [
65
- /* @__PURE__ */ e($, {}),
66
- /* @__PURE__ */ e("span", { className: "sr-only", children: "Close banner" })
60
+ /* @__PURE__ */ n(v, {}),
61
+ /* @__PURE__ */ n("span", { className: "sr-only", children: "Close banner" })
67
62
  ]
68
63
  }
69
64
  );
70
65
  }
71
66
  export {
72
- y as Banner,
73
- z as MessageBanner,
74
- n as bannerType
67
+ w as Banner,
68
+ S as MessageBanner,
69
+ a as bannerType
75
70
  };
76
71
  //# sourceMappingURL=Banner.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Banner.js","sources":["../../src/components/Banner/Banner.tsx"],"sourcesContent":["import { colorWeights } from \"@/constants/constants\";\nimport { cn } from \"@/utils\";\nimport type { onClickCallback } from \"@/types/types\";\nimport { CircleX, Info, Lightbulb, TriangleAlert, X } from \"lucide-react\";\nimport { Button } from \"../Button\";\nimport { Skeleton } from \"../Skeleton\";\n\n\nconst bannerType = {\n\tInfo: 'info',\n\tNote: 'note',\n\tWarning: 'warning',\n\tAlert: 'alert'\n} as const;\n\ntype TBannerType = (typeof bannerType)[keyof typeof bannerType];\n\nconst icons: Record<TBannerType, React.ComponentType> = {\n\t[bannerType.Info]: Info,\n\t[bannerType.Note]: Lightbulb,\n\t[bannerType.Warning]: TriangleAlert,\n\t[bannerType.Alert]: CircleX\n};\n\nconst styleColor: Record<TBannerType, string> = {\n\t[bannerType.Info]: 'blue',\n\t[bannerType.Note]: 'green',\n\t[bannerType.Warning]: 'yellow',\n\t[bannerType.Alert]: 'red',\n};\n\n\ninterface BannerProps extends React.ComponentProps<\"div\"> {\n\ttype: TBannerType;\n\ttitle?: string;\n\tloading?: boolean;\n\thideIcon?: boolean;\n\tonClose?: onClickCallback<HTMLButtonElement>;\n}\n\nfunction Banner({ type, title, loading, hideIcon, onClose, children, className, ...props }: BannerProps) {\n\n\tconst color = styleColor[type] || styleColor.note;\n\tconst containerClass = `bg-${color}-${colorWeights[0]} text-${color}-${colorWeights[1]} border-${color}-${colorWeights[2]}`;\n\tconst Icon = icons[type] || icons.note;\n\n\treturn (\n\t\t<div\n\t\t\tclassName={cn(`p-3 border-l-4 rounded`, containerClass, className)}\n\t\t\trole=\"alert\"\n\t\t\t{...props}\n\t\t>\n\t\t\t<div className={`flex items-start`}>\n\t\t\t\t{loading ?\n\t\t\t\t\t<BannerLoadingContent />\n\t\t\t\t\t:\n\t\t\t\t\t<>\n\t\t\t\t\t\t{!hideIcon &&\n\t\t\t\t\t\t\t<div className={`flex-shrink-0 mr-3`}>\n\t\t\t\t\t\t\t\t<Icon />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t}\n\t\t\t\t\t\t<section>\n\t\t\t\t\t\t\t{title && (\n\t\t\t\t\t\t\t\t<p className={`font-bold`}>\n\t\t\t\t\t\t\t\t\t{title}\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t</section>\n\t\t\t\t\t</>\n\t\t\t\t}\n\n\t\t\t\t{onClose &&\n\t\t\t\t\t<CloseButton onClick={onClose} />\n\t\t\t\t}\n\t\t\t</div>\n\t\t</div>\n\t)\n}\n\ninterface MessageBannerProps extends BannerProps {\n\tmessage: string | React.ReactNode;\n}\n\nfunction MessageBanner({ message, ...props }: MessageBannerProps) {\n\treturn (\n\t\t<Banner {...props}>\n\t\t\t<p className=\"text-sm\">\n\t\t\t\t{message}\n\t\t\t</p>\n\t\t</Banner>\n\t)\n}\n\nfunction BannerLoadingContent() {\n\treturn (\n\t\t<div className=\"flex items-center space-x-4\">\n\t\t\t<Skeleton className=\"h-12 w-12 rounded-full\" />\n\t\t\t<div className=\"space-y-2\">\n\t\t\t\t<Skeleton className=\"h-4 w-[250px]\" />\n\t\t\t\t<Skeleton className=\"h-4 w-[200px]\" />\n\t\t\t</div>\n\t\t</div>\n\t)\n}\n\nfunction CloseButton(props: React.ComponentProps<\"button\">) {\n\treturn (\n\t\t<Button\n\t\t\tvariant=\"ghost\"\n\t\t\tsize=\"icon\"\n\t\t\tclassName=\"h-8 w-8 rounded-full ml-auto mb-auto relative -top-1 -right-1\"\n\t\t\t{...props}\n\t\t>\n\t\t\t<X />\n\t\t\t<span className=\"sr-only\">Close banner</span>\n\t\t</Button>\n\t);\n}\n\nexport { Banner, MessageBanner, bannerType, type TBannerType };\n\n"],"names":["bannerType","icons","Info","Lightbulb","TriangleAlert","CircleX","styleColor","Banner","type","title","loading","hideIcon","onClose","children","className","props","color","containerClass","colorWeights","Icon","jsx","cn","jsxs","BannerLoadingContent","Fragment","CloseButton","MessageBanner","message","Skeleton","Button","X"],"mappings":";;;;;;AAQA,MAAMA,IAAa;AAAA,EAClB,MAAM;AAAA,EACN,MAAM;AAAA,EACN,SAAS;AAAA,EACT,OAAO;AACR,GAIMC,IAAkD;AAAA,EACvD,CAACD,EAAW,IAAI,GAAGE;AAAA,EACnB,CAACF,EAAW,IAAI,GAAGG;AAAA,EACnB,CAACH,EAAW,OAAO,GAAGI;AAAA,EACtB,CAACJ,EAAW,KAAK,GAAGK;AACrB,GAEMC,IAA0C;AAAA,EAC/C,CAACN,EAAW,IAAI,GAAG;AAAA,EACnB,CAACA,EAAW,IAAI,GAAG;AAAA,EACnB,CAACA,EAAW,OAAO,GAAG;AAAA,EACtB,CAACA,EAAW,KAAK,GAAG;AACrB;AAWA,SAASO,EAAO,EAAE,MAAAC,GAAM,OAAAC,GAAO,SAAAC,GAAS,UAAAC,GAAU,SAAAC,GAAS,UAAAC,GAAU,WAAAC,GAAW,GAAGC,KAAsB;AAExG,QAAMC,IAAQV,EAAWE,CAAI,KAAKF,EAAW,MACvCW,IAAiB,MAAMD,CAAK,IAAIE,EAAa,CAAC,CAAC,SAASF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,gBAAA,CAAgB;AAAA,IAAA,EAAA,CACrC;AAAA,EAAA,GACD;AAEF;AAEA,SAASH,EAAYV,GAAuC;AAC3D,SACC,gBAAAO;AAAA,IAACO;AAAA,IAAA;AAAA,MACA,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,WAAU;AAAA,MACT,GAAGd;AAAA,MAEJ,UAAA;AAAA,QAAA,gBAAAK,EAACU,GAAA,EAAE;AAAA,QACH,gBAAAV,EAAC,QAAA,EAAK,WAAU,WAAU,UAAA,eAAA,CAAY;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGzC;"}
1
+ {"version":3,"file":"Banner.js","sources":["../../src/components/Banner/Banner.tsx"],"sourcesContent":["import type { onClickCallback } from \"@/types/types\";\nimport { cn } from \"@/utils\";\nimport { CircleX, Info, Lightbulb, TriangleAlert, X } from \"lucide-react\";\nimport { Button } from \"../Button\";\nimport { Skeleton } from \"../Skeleton\";\n\nconst bannerType = {\n\tInfo: 'info',\n\tNote: 'note',\n\tWarning: 'warning',\n\tAlert: 'alert'\n} as const;\n\ntype TBannerType = (typeof bannerType)[keyof typeof bannerType];\n\nconst icons: Record<TBannerType, React.ComponentType> = {\n\t[bannerType.Info]: Info,\n\t[bannerType.Note]: Lightbulb,\n\t[bannerType.Warning]: TriangleAlert,\n\t[bannerType.Alert]: CircleX\n};\n\n\ninterface BannerProps extends React.ComponentProps<\"div\"> {\n\ttype: TBannerType;\n\ttitle?: string;\n\tloading?: boolean;\n\thideIcon?: boolean;\n\tonClose?: onClickCallback<HTMLButtonElement>;\n}\n\nfunction Banner({ type, title, loading, hideIcon, onClose, children, className, ...props }: BannerProps) {\n\tconst Icon = icons[type] ?? icons[bannerType.Note];\n\n\treturn (\n\t\t<div\n\t\t\tdata-banner-type={type}\n\t\t\tclassName={cn(className)}\n\t\t\trole=\"alert\"\n\t\t\t{...props}\n\t\t>\n\t\t\t<div className={`flex items-start`}>\n\t\t\t\t{loading ?\n\t\t\t\t\t<BannerLoadingContent />\n\t\t\t\t\t:\n\t\t\t\t\t<>\n\t\t\t\t\t\t{!hideIcon &&\n\t\t\t\t\t\t\t<div className={`flex-shrink-0 mr-3`}>\n\t\t\t\t\t\t\t\t<Icon />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t}\n\t\t\t\t\t\t<section>\n\t\t\t\t\t\t\t{title && (\n\t\t\t\t\t\t\t\t<p className={`font-bold`}>\n\t\t\t\t\t\t\t\t\t{title}\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t</section>\n\t\t\t\t\t</>\n\t\t\t\t}\n\n\t\t\t\t{onClose &&\n\t\t\t\t\t<CloseButton onClick={onClose} />\n\t\t\t\t}\n\t\t\t</div>\n\t\t</div>\n\t)\n}\n\ninterface MessageBannerProps extends BannerProps {\n\tmessage: string | React.ReactNode;\n}\n\nfunction MessageBanner({ message, ...props }: MessageBannerProps) {\n\treturn (\n\t\t<Banner {...props}>\n\t\t\t<p className=\"text-sm\">\n\t\t\t\t{message}\n\t\t\t</p>\n\t\t</Banner>\n\t)\n}\n\nfunction BannerLoadingContent() {\n\treturn (\n\t\t<div className=\"flex items-center space-x-4\">\n\t\t\t<Skeleton className=\"h-12 w-12 rounded-full\" />\n\t\t\t<div className=\"space-y-2\">\n\t\t\t\t<Skeleton className=\"h-4 w-[250px]\" />\n\t\t\t\t<Skeleton className=\"h-4 w-[200px]\" />\n\t\t\t</div>\n\t\t</div>\n\t)\n}\n\nfunction CloseButton(props: React.ComponentProps<\"button\">) {\n\treturn (\n\t\t<Button\n\t\t\tvariant=\"ghost\"\n\t\t\tsize=\"icon\"\n\t\t\tclassName=\"h-8 w-8 rounded-full ml-auto mb-auto relative -top-1 -right-1\"\n\t\t\t{...props}\n\t\t>\n\t\t\t<X />\n\t\t\t<span className=\"sr-only\">Close banner</span>\n\t\t</Button>\n\t);\n}\n\nexport { Banner, bannerType, MessageBanner, type TBannerType };\n\n"],"names":["bannerType","icons","Info","Lightbulb","TriangleAlert","CircleX","Banner","type","title","loading","hideIcon","onClose","children","className","props","Icon","jsx","cn","jsxs","BannerLoadingContent","Fragment","CloseButton","MessageBanner","message","Skeleton","Button","X"],"mappings":";;;;;AAMA,MAAMA,IAAa;AAAA,EAClB,MAAM;AAAA,EACN,MAAM;AAAA,EACN,SAAS;AAAA,EACT,OAAO;AACR,GAIMC,IAAkD;AAAA,EACvD,CAACD,EAAW,IAAI,GAAGE;AAAA,EACnB,CAACF,EAAW,IAAI,GAAGG;AAAA,EACnB,CAACH,EAAW,OAAO,GAAGI;AAAA,EACtB,CAACJ,EAAW,KAAK,GAAGK;AACrB;AAWA,SAASC,EAAO,EAAE,MAAAC,GAAM,OAAAC,GAAO,SAAAC,GAAS,UAAAC,GAAU,SAAAC,GAAS,UAAAC,GAAU,WAAAC,GAAW,GAAGC,KAAsB;AACxG,QAAMC,IAAOd,EAAMM,CAAI,KAAKN,EAAMD,EAAW,IAAI;AAEjD,SACC,gBAAAgB;AAAA,IAAC;AAAA,IAAA;AAAA,MACA,oBAAkBT;AAAA,MAClB,WAAWU,EAAGJ,CAAS;AAAA,MACvB,MAAK;AAAA,MACJ,GAAGC;AAAA,MAEJ,UAAA,gBAAAI,EAAC,OAAA,EAAI,WAAW,oBACd,UAAA;AAAA,QAAAT,IACA,gBAAAO,EAACG,GAAA,CAAA,CAAqB,IAEtB,gBAAAD,EAAAE,GAAA,EACE,UAAA;AAAA,UAAA,CAACV,KACD,gBAAAM,EAAC,OAAA,EAAI,WAAW,sBACf,UAAA,gBAAAA,EAACD,KAAK,EAAA,CACP;AAAA,4BAEA,WAAA,EACC,UAAA;AAAA,YAAAP,KACA,gBAAAQ,EAAC,KAAA,EAAE,WAAW,aACZ,UAAAR,GACF;AAAA,YAEAI;AAAA,UAAA,EAAA,CACF;AAAA,QAAA,GACD;AAAA,QAGAD,KACA,gBAAAK,EAACK,GAAA,EAAY,SAASV,EAAA,CAAS;AAAA,MAAA,EAAA,CAEjC;AAAA,IAAA;AAAA,EAAA;AAGH;AAMA,SAASW,EAAc,EAAE,SAAAC,GAAS,GAAGT,KAA6B;AACjE,SACC,gBAAAE,EAACV,KAAQ,GAAGQ,GACX,4BAAC,KAAA,EAAE,WAAU,WACX,UAAAS,EAAA,CACF,EAAA,CACD;AAEF;AAEA,SAASJ,IAAuB;AAC/B,SACC,gBAAAD,EAAC,OAAA,EAAI,WAAU,+BACd,UAAA;AAAA,IAAA,gBAAAF,EAACQ,GAAA,EAAS,WAAU,yBAAA,CAAyB;AAAA,IAC7C,gBAAAN,EAAC,OAAA,EAAI,WAAU,aACd,UAAA;AAAA,MAAA,gBAAAF,EAACQ,GAAA,EAAS,WAAU,gBAAA,CAAgB;AAAA,MACpC,gBAAAR,EAACQ,GAAA,EAAS,WAAU,gBAAA,CAAgB;AAAA,IAAA,EAAA,CACrC;AAAA,EAAA,GACD;AAEF;AAEA,SAASH,EAAYP,GAAuC;AAC3D,SACC,gBAAAI;AAAA,IAACO;AAAA,IAAA;AAAA,MACA,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,WAAU;AAAA,MACT,GAAGX;AAAA,MAEJ,UAAA;AAAA,QAAA,gBAAAE,EAACU,GAAA,EAAE;AAAA,QACH,gBAAAV,EAAC,QAAA,EAAK,WAAU,WAAU,UAAA,eAAA,CAAY;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGzC;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abumble/design-system",
3
- "version": "0.0.17",
3
+ "version": "0.0.18",
4
4
  "files": [
5
5
  "dist",
6
6
  "src/styles.css"
@@ -133,6 +133,7 @@
133
133
  "@storybook/addon-docs": "^10.0.7",
134
134
  "@storybook/addon-onboarding": "^10.0.7",
135
135
  "@storybook/addon-vitest": "^10.0.7",
136
+ "@storybook/builder-vite": "^10.0.7",
136
137
  "@storybook/react-vite": "^10.0.7",
137
138
  "@tailwindcss/vite": "^4.0.6",
138
139
  "@types/node": "^24.10.0",
package/src/styles.css CHANGED
@@ -1,8 +1,7 @@
1
1
  @import 'tailwindcss';
2
+ @import 'tailwindcss/preflight';
2
3
  @import 'tw-animate-css';
3
4
 
4
- @tailwind base;
5
- @tailwind components;
6
5
  @tailwind utilities;
7
6
 
8
7
 
@@ -193,6 +192,19 @@ code {
193
192
  --sidebar-accent-foreground: oklch(0.21 0.006 285.885);
194
193
  --sidebar-border: oklch(0.92 0.004 286.32);
195
194
  --sidebar-ring: oklch(0.871 0.006 286.286);
195
+ /* Banner type semantic tokens (light) */
196
+ --banner-warning: oklch(0.95 0.06 85);
197
+ --banner-warning-foreground: oklch(0.45 0.12 75);
198
+ --banner-warning-border: oklch(0.75 0.15 85);
199
+ --banner-info: oklch(0.94 0.04 250);
200
+ --banner-info-foreground: oklch(0.35 0.12 265);
201
+ --banner-info-border: oklch(0.65 0.18 250);
202
+ --banner-alert: oklch(0.97 0.02 25);
203
+ --banner-alert-foreground: oklch(0.45 0.18 25);
204
+ --banner-alert-border: oklch(0.65 0.2 25);
205
+ --banner-note: oklch(0.967 0.001 286.375);
206
+ --banner-note-foreground: oklch(0.45 0.02 286);
207
+ --banner-note-border: oklch(0.85 0.01 286);
196
208
  }
197
209
 
198
210
  .dark {
@@ -228,6 +240,47 @@ code {
228
240
  --sidebar-accent-foreground: oklch(0.985 0 0);
229
241
  --sidebar-border: oklch(0.274 0.006 286.033);
230
242
  --sidebar-ring: oklch(0.442 0.017 285.786);
243
+ /* Banner type semantic tokens (dark) */
244
+ --banner-warning: oklch(0.28 0.08 75);
245
+ --banner-warning-foreground: oklch(0.88 0.1 85);
246
+ --banner-warning-border: oklch(0.5 0.12 75);
247
+ --banner-info: oklch(0.22 0.06 265);
248
+ --banner-info-foreground: oklch(0.85 0.08 250);
249
+ --banner-info-border: oklch(0.45 0.15 265);
250
+ --banner-alert: oklch(0.28 0.08 25);
251
+ --banner-alert-foreground: oklch(0.88 0.1 25);
252
+ --banner-alert-border: oklch(0.5 0.15 25);
253
+ --banner-note: oklch(0.274 0.006 286.033);
254
+ --banner-note-foreground: oklch(0.705 0.015 286.067);
255
+ --banner-note-border: oklch(0.4 0.02 286);
256
+ }
257
+
258
+ /* Banner: style by type so colors work when package is imported in other projects */
259
+ [data-banner-type] {
260
+ padding: 0.75rem;
261
+ border-left-width: 4px;
262
+ border-left-style: solid;
263
+ border-radius: var(--radius);
264
+ }
265
+ [data-banner-type="warning"] {
266
+ background: var(--banner-warning);
267
+ color: var(--banner-warning-foreground);
268
+ border-color: var(--banner-warning-border);
269
+ }
270
+ [data-banner-type="info"] {
271
+ background: var(--banner-info);
272
+ color: var(--banner-info-foreground);
273
+ border-color: var(--banner-info-border);
274
+ }
275
+ [data-banner-type="alert"] {
276
+ background: var(--banner-alert);
277
+ color: var(--banner-alert-foreground);
278
+ border-color: var(--banner-alert-border);
279
+ }
280
+ [data-banner-type="note"] {
281
+ background: var(--banner-note);
282
+ color: var(--banner-note-foreground);
283
+ border-color: var(--banner-note-border);
231
284
  }
232
285
 
233
286
  @theme inline {