bonkers-ui 2.0.14 → 2.0.15

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.
@@ -6,6 +6,8 @@ interface IUiPills {
6
6
  size?: EBadgeSize;
7
7
  icon?: React.ReactNode;
8
8
  rounded?: boolean;
9
+ justifyCenter?: boolean;
10
+ fullWidth?: boolean;
9
11
  className?: string;
10
12
  }
11
13
  export declare const UiPills: React.FC<IUiPills>;
@@ -1,43 +1,48 @@
1
- import { jsxs as m, jsx as p } from "react/jsx-runtime";
1
+ import { jsxs as g, jsx as m } from "react/jsx-runtime";
2
2
  import "react";
3
- import { EBadgeKind as r, EBadgeSize as e } from "./_types.js";
4
- import { UiTypography as g } from "../UiTypography/UiTypography.js";
5
- import { ETypographySizes as t, ETextWeight as c } from "../UiTypography/_types.js";
6
- import l from "classnames";
7
- const d = {
8
- [r.PRIMARY]: "bg-primary-100 text-primary-700",
9
- [r.ERROR]: "bg-error-300 text-error-700",
10
- [r.WARNING]: "bg-warning-300 text-warning-700",
11
- [r.ACCENT]: "bg-accent-300 text-accent-700",
12
- [r.PRIMARY_ALT]: "bg-primary-300 text-primary-800",
13
- [r.SECONDARY]: "bg-white text-secondary-300 ring-1 ring-secondary-alt-300",
14
- [r.ACCENT_ALT]: "bg-accent-alt-500 text-secondary-700"
15
- }, y = {
16
- [e.SMALL]: t.XXS,
17
- [e.MEDIUM]: t.XS,
18
- [e.LARGE]: t.SM
19
- }, S = ({
3
+ import { EBadgeKind as e, EBadgeSize as r } from "./_types.js";
4
+ import { UiTypography as c } from "../UiTypography/UiTypography.js";
5
+ import { ETypographySizes as t, ETextWeight as d } from "../UiTypography/_types.js";
6
+ import f from "classnames";
7
+ const y = {
8
+ [e.PRIMARY]: "bg-primary-100 text-primary-700",
9
+ [e.ERROR]: "bg-error-300 text-error-700",
10
+ [e.WARNING]: "bg-warning-300 text-warning-700",
11
+ [e.ACCENT]: "bg-accent-300 text-accent-700",
12
+ [e.PRIMARY_ALT]: "bg-primary-300 text-primary-800",
13
+ [e.SECONDARY]: "bg-white text-secondary-300 ring-1 ring-secondary-alt-300",
14
+ [e.ACCENT_ALT]: "bg-accent-alt-500 text-secondary-700"
15
+ }, A = {
16
+ [r.SMALL]: t.XXS,
17
+ [r.MEDIUM]: t.XS,
18
+ [r.LARGE]: t.SM
19
+ }, h = ({
20
20
  children: i,
21
- kind: s = r.PRIMARY,
22
- size: a = e.SMALL,
23
- className: o,
24
- icon: n,
25
- rounded: x = !1
26
- }) => /* @__PURE__ */ m("div", { className: l(
21
+ kind: a = e.PRIMARY,
22
+ size: o = r.SMALL,
23
+ className: n,
24
+ justifyCenter: x = !1,
25
+ icon: l,
26
+ rounded: s = !1,
27
+ fullWidth: p = !1
28
+ }) => /* @__PURE__ */ g("div", { className: f(
27
29
  "ui-pills",
28
- "grid w-max grid-flow-col justify-start",
30
+ "grid grid-flow-col",
29
31
  "items-center",
30
32
  "gap-xxxs",
31
- "px-xxs py-xxxs",
33
+ "py-xxxs",
34
+ s ? "px-xs" : "px-xxs",
32
35
  "overflow-hidden",
33
- x ? "rounded-full" : "rounded-sm",
34
- d[s],
35
- o
36
+ p ? "w-full" : "w-max",
37
+ x ? "justify-center" : "justify-start",
38
+ s ? "rounded-full" : "rounded-sm",
39
+ y[a],
40
+ n
36
41
  ), children: [
37
- n,
38
- i ? /* @__PURE__ */ p(g, { size: y[a], weight: c.SEMI_BOLD, className: "whitespace-nowrap", children: i }) : null
42
+ l,
43
+ i ? /* @__PURE__ */ m(c, { lineHeight: !0, size: A[o], weight: d.SEMI_BOLD, className: "whitespace-nowrap", children: i }) : null
39
44
  ] });
40
45
  export {
41
- S as UiPills
46
+ h as UiPills
42
47
  };
43
48
  //# sourceMappingURL=UiPills.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"UiPills.js","sources":["../../../src/components/UiPills/UiPills.tsx"],"sourcesContent":["import React from \"react\";\nimport { EBadgeKind, EBadgeSize } from \"./_types.ts\";\nimport { ETextWeight, ETypographySizes, UiTypography } from \"../UiTypography\";\nimport cx from \"classnames\";\n\ninterface IUiPills {\n\tchildren: React.ReactNode\n\tkind?: EBadgeKind,\n\tsize?: EBadgeSize,\n\ticon?: React.ReactNode,\n\trounded?: boolean,\n\tclassName?: string\n}\n\nconst kindClasses = {\n\t[EBadgeKind.PRIMARY]: \"bg-primary-100 text-primary-700\",\n\t[EBadgeKind.ERROR]: \"bg-error-300 text-error-700\",\n\t[EBadgeKind.WARNING]: \"bg-warning-300 text-warning-700\",\n\t[EBadgeKind.ACCENT]: \"bg-accent-300 text-accent-700\",\n\t[EBadgeKind.PRIMARY_ALT]: \"bg-primary-300 text-primary-800\",\n\t[EBadgeKind.SECONDARY]: \"bg-white text-secondary-300 ring-1 ring-secondary-alt-300\",\n\t[EBadgeKind.ACCENT_ALT]: \"bg-accent-alt-500 text-secondary-700\",\n};\n\nconst sizeEnums = {\n\t[EBadgeSize.SMALL]: ETypographySizes.XXS,\n\t[EBadgeSize.MEDIUM]: ETypographySizes.XS,\n\t[EBadgeSize.LARGE]: ETypographySizes.SM,\n};\n\nexport const UiPills: React.FC<IUiPills> = ({\n\tchildren,\n\tkind = EBadgeKind.PRIMARY,\n\tsize = EBadgeSize.SMALL,\n\tclassName,\n\ticon,\n\trounded = false\n}) => {\n\treturn (\n\t\t<div className={ cx(\n\t\t\t\"ui-pills\",\n\t\t\t\"grid w-max grid-flow-col justify-start\",\n\t\t\t\"items-center\",\n\t\t\t\"gap-xxxs\",\n\t\t\t\"px-xxs py-xxxs\",\n\t\t\t\"overflow-hidden\",\n\t\t\trounded\n\t\t\t\t? \"rounded-full\"\n\t\t\t\t: \"rounded-sm\",\n\t\t\tkindClasses[kind],\n\t\t\tclassName\n\t\t) }>\n\t\t\t{ icon }\n\t\t\t{ children\n\t\t\t\t? (\n\t\t\t\t\t<UiTypography size={ sizeEnums[size] } weight={ ETextWeight.SEMI_BOLD } className=\"whitespace-nowrap\">\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t</UiTypography>\n\t\t\t\t)\n\t\t\t\t: null }\n\t\t</div>\n\t);\n};\n"],"names":["kindClasses","EBadgeKind","sizeEnums","EBadgeSize","ETypographySizes","UiPills","children","kind","size","className","icon","rounded","jsxs","cx","jsx","UiTypography","ETextWeight"],"mappings":";;;;;;AAcA,MAAMA,IAAc;AAAA,EACnB,CAACC,EAAW,OAAO,GAAG;AAAA,EACtB,CAACA,EAAW,KAAK,GAAG;AAAA,EACpB,CAACA,EAAW,OAAO,GAAG;AAAA,EACtB,CAACA,EAAW,MAAM,GAAG;AAAA,EACrB,CAACA,EAAW,WAAW,GAAG;AAAA,EAC1B,CAACA,EAAW,SAAS,GAAG;AAAA,EACxB,CAACA,EAAW,UAAU,GAAG;AAC1B,GAEMC,IAAY;AAAA,EACjB,CAACC,EAAW,KAAK,GAAGC,EAAiB;AAAA,EACrC,CAACD,EAAW,MAAM,GAAGC,EAAiB;AAAA,EACtC,CAACD,EAAW,KAAK,GAAGC,EAAiB;AACtC,GAEaC,IAA8B,CAAC;AAAA,EAC3C,UAAAC;AAAA,EACA,MAAAC,IAAON,EAAW;AAAA,EAClB,MAAAO,IAAOL,EAAW;AAAA,EAClB,WAAAM;AAAA,EACA,MAAAC;AAAA,EACA,SAAAC,IAAU;AACX,MAEE,gBAAAC,EAAC,SAAI,WAAYC;AAAA,EAChB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACAF,IACG,iBACA;AAAA,EACHX,EAAYO,CAAI;AAAA,EAChBE;AAAA,GAEE,UAAA;AAAA,EAAAC;AAAA,EACAJ,IAEA,gBAAAQ,EAACC,GAAA,EAAa,MAAOb,EAAUM,CAAI,GAAI,QAASQ,EAAY,WAAY,WAAU,qBAC/E,UAAAV,GACH,IAEC;AAAA,GACJ;"}
1
+ {"version":3,"file":"UiPills.js","sources":["../../../src/components/UiPills/UiPills.tsx"],"sourcesContent":["import React from \"react\";\nimport { EBadgeKind, EBadgeSize } from \"./_types.ts\";\nimport { ETextWeight, ETypographySizes, UiTypography } from \"../UiTypography\";\nimport cx from \"classnames\";\n\ninterface IUiPills {\n\tchildren: React.ReactNode\n\tkind?: EBadgeKind,\n\tsize?: EBadgeSize,\n\ticon?: React.ReactNode,\n\trounded?: boolean,\n\tjustifyCenter?: boolean,\n\tfullWidth?: boolean,\n\tclassName?: string\n}\n\nconst kindClasses = {\n\t[EBadgeKind.PRIMARY]: \"bg-primary-100 text-primary-700\",\n\t[EBadgeKind.ERROR]: \"bg-error-300 text-error-700\",\n\t[EBadgeKind.WARNING]: \"bg-warning-300 text-warning-700\",\n\t[EBadgeKind.ACCENT]: \"bg-accent-300 text-accent-700\",\n\t[EBadgeKind.PRIMARY_ALT]: \"bg-primary-300 text-primary-800\",\n\t[EBadgeKind.SECONDARY]: \"bg-white text-secondary-300 ring-1 ring-secondary-alt-300\",\n\t[EBadgeKind.ACCENT_ALT]: \"bg-accent-alt-500 text-secondary-700\",\n};\n\nconst sizeEnums = {\n\t[EBadgeSize.SMALL]: ETypographySizes.XXS,\n\t[EBadgeSize.MEDIUM]: ETypographySizes.XS,\n\t[EBadgeSize.LARGE]: ETypographySizes.SM,\n};\n\nexport const UiPills: React.FC<IUiPills> = ({\n\tchildren,\n\tkind = EBadgeKind.PRIMARY,\n\tsize = EBadgeSize.SMALL,\n\tclassName,\n\tjustifyCenter = false,\n\ticon,\n\trounded = false,\n\tfullWidth = false\n}) => {\n\treturn (\n\t\t<div className={ cx(\n\t\t\t\"ui-pills\",\n\t\t\t\"grid grid-flow-col\",\n\t\t\t\"items-center\",\n\t\t\t\"gap-xxxs\",\n\t\t\t\"py-xxxs\",\n\t\t\trounded\n\t\t\t\t? \"px-xs\"\n\t\t\t\t: \"px-xxs\",\n\t\t\t\"overflow-hidden\",\n\t\t\tfullWidth\n\t\t\t\t? \"w-full\"\n\t\t\t\t: \"w-max\",\n\t\t\tjustifyCenter\n\t\t\t\t? \"justify-center\"\n\t\t\t\t: \"justify-start\",\n\t\t\trounded\n\t\t\t\t? \"rounded-full\"\n\t\t\t\t: \"rounded-sm\",\n\t\t\tkindClasses[kind],\n\t\t\tclassName\n\t\t) }>\n\t\t\t{ icon }\n\t\t\t{ children\n\t\t\t\t? (\n\t\t\t\t\t<UiTypography lineHeight size={ sizeEnums[size] } weight={ ETextWeight.SEMI_BOLD } className=\"whitespace-nowrap\">\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t</UiTypography>\n\t\t\t\t)\n\t\t\t\t: null }\n\t\t</div>\n\t);\n};\n"],"names":["kindClasses","EBadgeKind","sizeEnums","EBadgeSize","ETypographySizes","UiPills","children","kind","size","className","justifyCenter","icon","rounded","fullWidth","jsxs","cx","jsx","UiTypography","ETextWeight"],"mappings":";;;;;;AAgBA,MAAMA,IAAc;AAAA,EACnB,CAACC,EAAW,OAAO,GAAG;AAAA,EACtB,CAACA,EAAW,KAAK,GAAG;AAAA,EACpB,CAACA,EAAW,OAAO,GAAG;AAAA,EACtB,CAACA,EAAW,MAAM,GAAG;AAAA,EACrB,CAACA,EAAW,WAAW,GAAG;AAAA,EAC1B,CAACA,EAAW,SAAS,GAAG;AAAA,EACxB,CAACA,EAAW,UAAU,GAAG;AAC1B,GAEMC,IAAY;AAAA,EACjB,CAACC,EAAW,KAAK,GAAGC,EAAiB;AAAA,EACrC,CAACD,EAAW,MAAM,GAAGC,EAAiB;AAAA,EACtC,CAACD,EAAW,KAAK,GAAGC,EAAiB;AACtC,GAEaC,IAA8B,CAAC;AAAA,EAC3C,UAAAC;AAAA,EACA,MAAAC,IAAON,EAAW;AAAA,EAClB,MAAAO,IAAOL,EAAW;AAAA,EAClB,WAAAM;AAAA,EACA,eAAAC,IAAgB;AAAA,EAChB,MAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,WAAAC,IAAY;AACb,MAEE,gBAAAC,EAAC,SAAI,WAAYC;AAAA,EAChB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACAH,IACG,UACA;AAAA,EACH;AAAA,EACAC,IACG,WACA;AAAA,EACHH,IACG,mBACA;AAAA,EACHE,IACG,iBACA;AAAA,EACHZ,EAAYO,CAAI;AAAA,EAChBE;AAAA,GAEE,UAAA;AAAA,EAAAE;AAAA,EACAL,IAEA,gBAAAU,EAACC,GAAA,EAAa,YAAU,IAAC,MAAOf,EAAUM,CAAI,GAAI,QAASU,EAAY,WAAY,WAAU,qBAC1F,UAAAZ,GACH,IAEC;AAAA,GACJ;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bonkers-ui",
3
- "version": "v2.0.14",
3
+ "version": "v2.0.15",
4
4
  "type": "module",
5
5
  "description": "Bonkers ui library",
6
6
  "author": "cc6.magister@gmail.com",
@@ -30,26 +30,26 @@
30
30
  },
31
31
  "devDependencies": {
32
32
  "@chromatic-com/storybook": "^4.1.1",
33
- "@storybook/addon-docs": "^9.1.10",
34
- "@storybook/addon-onboarding": "^9.1.10",
35
- "@storybook/react-vite": "^9.1.10",
36
- "@stylistic/eslint-plugin": "^5.4.0",
33
+ "@storybook/addon-docs": "^9.1.13",
34
+ "@storybook/addon-onboarding": "^9.1.13",
35
+ "@storybook/react-vite": "^9.1.13",
36
+ "@stylistic/eslint-plugin": "^5.5.0",
37
37
  "@types/bun": "latest",
38
38
  "@types/react": "^19.2.2",
39
- "@types/react-dom": "^19.2.1",
39
+ "@types/react-dom": "^19.2.2",
40
40
  "@vitejs/plugin-react": "^5.0.4",
41
- "eslint": "^9.37.0",
42
- "eslint-plugin-better-tailwindcss": "^3.7.9",
41
+ "eslint": "^9.38.0",
42
+ "eslint-plugin-better-tailwindcss": "^3.7.10",
43
43
  "eslint-plugin-react": "^7.37.5",
44
- "eslint-plugin-storybook": "^9.1.10",
44
+ "eslint-plugin-storybook": "^9.1.13",
45
45
  "eslint-plugin-tailwindcss": "^3.18.2",
46
46
  "gh-pages": "^6.3.0",
47
47
  "husky": "^9.1.7",
48
- "lint-staged": "^16.2.3",
49
- "storybook": "^9.1.10",
48
+ "lint-staged": "^16.2.4",
49
+ "storybook": "^9.1.13",
50
50
  "typescript": "^5.9.3",
51
- "typescript-eslint": "^8.46.0",
52
- "vite": "^7.1.9",
51
+ "typescript-eslint": "^8.46.1",
52
+ "vite": "^7.1.11",
53
53
  "vite-plugin-dts": "^4.5.4",
54
54
  "vite-plugin-lib-inject-css": "^2.2.2"
55
55
  },