@caspeco/casper-ui-library 5.1.1 → 5.2.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/README.md CHANGED
@@ -63,3 +63,4 @@ export default defineConfig({
63
63
  3. Make your changes.
64
64
  4. Bump the `version` field in `package.json` (following [Semantic versioning](https://semver.org/)) and run `npm install`.
65
65
  5. Open a [pull request](https://github.com/Caspeco/casper-ui-library/pulls) using the template and assign a reviewer.
66
+ 6. When you have gotten your PR approved, merge the PR. If you have a new version in package.json it will automatically publish your changes to npm. A new version of the documentation website will always be built.
@@ -1,5 +1,5 @@
1
1
  import { BreadcrumbItemProps as ChakraBreadcrumbItemProps } from '@chakra-ui/react';
2
- type ChakraBreadcrumbItemProperties = Pick<ChakraBreadcrumbItemProps, "children" | "isCurrentPage" | "key" | "color">;
2
+ type ChakraBreadcrumbItemProperties = Pick<ChakraBreadcrumbItemProps, "overflow" | "children" | "isCurrentPage" | "key" | "color">;
3
3
  export type BreadcrumbItemProps = ChakraBreadcrumbItemProperties;
4
4
  export declare function BreadcrumbItem({ children, ...props }: BreadcrumbItemProps): import("react/jsx-runtime").JSX.Element;
5
5
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"breadcrumb-item.d.ts","sourceRoot":"","sources":["../../../lib/components/breadcrumbs/breadcrumb-item.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEN,KAAK,mBAAmB,IAAI,yBAAyB,EACrD,MAAM,kBAAkB,CAAC;AAE1B,KAAK,8BAA8B,GAAG,IAAI,CACzC,yBAAyB,EACzB,UAAU,GAAG,eAAe,GAAG,KAAK,GAAG,OAAO,CAC9C,CAAC;AACF,MAAM,MAAM,mBAAmB,GAAG,8BAA8B,CAAC;AAEjE,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB,2CAEzE"}
1
+ {"version":3,"file":"breadcrumb-item.d.ts","sourceRoot":"","sources":["../../../lib/components/breadcrumbs/breadcrumb-item.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEN,KAAK,mBAAmB,IAAI,yBAAyB,EACrD,MAAM,kBAAkB,CAAC;AAE1B,KAAK,8BAA8B,GAAG,IAAI,CACzC,yBAAyB,EACzB,UAAU,GAAG,UAAU,GAAG,eAAe,GAAG,KAAK,GAAG,OAAO,CAC3D,CAAC;AACF,MAAM,MAAM,mBAAmB,GAAG,8BAA8B,CAAC;AAEjE,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB,2CAMzE"}
@@ -1,8 +1,8 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { BreadcrumbItem as t } from "@chakra-ui/react";
3
- function a({ children: r, ...m }) {
4
- return /* @__PURE__ */ e(t, { ...m, children: r });
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import { BreadcrumbItem as o } from "@chakra-ui/react";
3
+ function c({ children: r, ...e }) {
4
+ return /* @__PURE__ */ m(o, { whiteSpace: "nowrap", overflow: "hidden", ...e, children: r });
5
5
  }
6
6
  export {
7
- a as BreadcrumbItem
7
+ c as BreadcrumbItem
8
8
  };
@@ -1 +1 @@
1
- {"version":3,"file":"breadcrumb-link.d.ts","sourceRoot":"","sources":["../../../lib/components/breadcrumbs/breadcrumb-link.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEN,KAAK,mBAAmB,IAAI,yBAAyB,EACrD,MAAM,kBAAkB,CAAC;AAE1B,KAAK,8BAA8B,GAAG,IAAI,CAAC,yBAAyB,EAAE,UAAU,GAAG,IAAI,GAAG,MAAM,CAAC,CAAC;AAClG,MAAM,MAAM,mBAAmB,GAAG,8BAA8B,GAAG;IAClE,EAAE,CAAC,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB,2CAEzE"}
1
+ {"version":3,"file":"breadcrumb-link.d.ts","sourceRoot":"","sources":["../../../lib/components/breadcrumbs/breadcrumb-link.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEN,KAAK,mBAAmB,IAAI,yBAAyB,EACrD,MAAM,kBAAkB,CAAC;AAE1B,KAAK,8BAA8B,GAAG,IAAI,CAAC,yBAAyB,EAAE,UAAU,GAAG,IAAI,GAAG,MAAM,CAAC,CAAC;AAClG,MAAM,MAAM,mBAAmB,GAAG,8BAA8B,GAAG;IAClE,EAAE,CAAC,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB,2CAMzE"}
@@ -1,7 +1,7 @@
1
1
  import { jsx as i } from "react/jsx-runtime";
2
- import { BreadcrumbLink as n } from "@chakra-ui/react";
3
- function t({ children: r, ...m }) {
4
- return /* @__PURE__ */ i(n, { ...m, children: r });
2
+ import { BreadcrumbLink as o } from "@chakra-ui/react";
3
+ function t({ children: r, ...e }) {
4
+ return /* @__PURE__ */ i(o, { overflow: "hidden", textOverflow: "ellipsis", ...e, children: r });
5
5
  }
6
6
  export {
7
7
  t as BreadcrumbLink
@@ -1,11 +1,22 @@
1
+ import { As } from '@chakra-ui/react';
1
2
  export type Breadcrumb = {
2
3
  title: string;
3
- as?: any;
4
+ as?: As;
4
5
  to?: string;
5
6
  href?: string;
6
7
  };
7
8
  export type BreadcrumbsProps = {
9
+ /**
10
+ * The number of items to show before the ellipsis when collapsed.
11
+ * @default 1
12
+ */
13
+ itemsBeforeCollapse?: number;
14
+ /**
15
+ * The number of items to show after the ellipsis when collapsed.
16
+ * @default 2
17
+ */
18
+ itemsAfterCollapse?: number;
8
19
  breadCrumbs: Breadcrumb[];
9
20
  };
10
- export declare function Breadcrumbs({ breadCrumbs }: BreadcrumbsProps): import("react/jsx-runtime").JSX.Element;
21
+ export declare function Breadcrumbs({ breadCrumbs, itemsBeforeCollapse, itemsAfterCollapse, }: BreadcrumbsProps): import("react/jsx-runtime").JSX.Element;
11
22
  //# sourceMappingURL=breadcrumbs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"breadcrumbs.d.ts","sourceRoot":"","sources":["../../../lib/components/breadcrumbs/breadcrumbs.tsx"],"names":[],"mappings":"AAMA,MAAM,MAAM,UAAU,GAAG;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,GAAG,CAAC;IACT,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAMF,MAAM,MAAM,gBAAgB,GAAG;IAC9B,WAAW,EAAE,UAAU,EAAE,CAAC;CAC1B,CAAC;AAgEF,wBAAgB,WAAW,CAAC,EAAE,WAAW,EAAE,EAAE,gBAAgB,2CAoC5D"}
1
+ {"version":3,"file":"breadcrumbs.d.ts","sourceRoot":"","sources":["../../../lib/components/breadcrumbs/breadcrumbs.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAkC,KAAK,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAI3E,MAAM,MAAM,UAAU,GAAG;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,EAAE,CAAC;IACR,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAMF,MAAM,MAAM,gBAAgB,GAAG;IAC9B;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,WAAW,EAAE,UAAU,EAAE,CAAC;CAC1B,CAAC;AAgEF,wBAAgB,WAAW,CAAC,EAC3B,WAAW,EACX,mBAAuB,EACvB,kBAAsB,GACtB,EAAE,gBAAgB,2CA6DlB"}
@@ -1,55 +1,80 @@
1
- import { jsx as o, jsxs as h } from "react/jsx-runtime";
2
- import { Breadcrumb as p } from "@chakra-ui/react";
3
- import { BreadcrumbItem as u } from "./breadcrumb-item.js";
4
- import { BreadcrumbLink as f } from "./breadcrumb-link.js";
5
- import { Menu as d } from "../menu/menu.js";
6
- import { MenuButton as g } from "../menu/menu-button.js";
7
- import { MenuList as M } from "../menu/menu-list.js";
8
- import { MenuItem as s } from "../menu/menu-item.js";
9
- import { ThemeFontVariable as k, ThemeFontSizeVariable as S, ThemeColorVariable as c } from "../../theme/theme-types.js";
10
- function y({ key: n, isCurrentPage: i, breadCrumb: t }) {
11
- const e = i ? c.OnBackground : c.OnBackgroundSubdued;
12
- return /* @__PURE__ */ h(u, { isCurrentPage: i, color: e, children: [
13
- t.as && t.to && !t.href && /* @__PURE__ */ o(f, { as: t.as, to: t.to, children: t.title }),
14
- t.href && !t.as && !t.to && /* @__PURE__ */ o(f, { href: t.href, children: t.title })
1
+ import { jsx as o, jsxs as d } from "react/jsx-runtime";
2
+ import { Breadcrumb as f } from "@chakra-ui/react";
3
+ import { BreadcrumbItem as M } from "./breadcrumb-item.js";
4
+ import { BreadcrumbLink as m } from "./breadcrumb-link.js";
5
+ import { Menu as O } from "../menu/menu.js";
6
+ import { MenuButton as w } from "../menu/menu-button.js";
7
+ import { MenuList as z } from "../menu/menu-list.js";
8
+ import { MenuItem as u } from "../menu/menu-item.js";
9
+ import { ThemeFontVariable as a, ThemeFontSizeVariable as B, ThemeColorVariable as c } from "../../theme/theme-types.js";
10
+ function g({ key: n, isCurrentPage: e, breadCrumb: t }) {
11
+ const i = e ? c.OnBackground : c.OnBackgroundSubdued;
12
+ return /* @__PURE__ */ d(M, { isCurrentPage: e, color: i, children: [
13
+ t.as && t.to && !t.href && /* @__PURE__ */ o(m, { as: t.as, to: t.to, children: t.title }),
14
+ t.href && !t.as && !t.to && /* @__PURE__ */ o(m, { href: t.href, children: t.title })
15
15
  ] }, n);
16
16
  }
17
- function I({ key: n, breadCrumbs: i }) {
18
- return /* @__PURE__ */ o(u, { color: c.OnBackgroundSubdued, children: /* @__PURE__ */ h(d, { children: [
19
- /* @__PURE__ */ o(g, { variant: "ghost", size: "sm", "aria-label": "Show collapsed items", children: "..." }),
20
- /* @__PURE__ */ o(M, { children: i.map((t, e) => t.as && t.to ? /* @__PURE__ */ o(s, { as: t.as, to: t.to, children: t.title }, e) : t.href ? /* @__PURE__ */ o(s, { itemType: "link", href: t.href, children: t.title }, e) : /* @__PURE__ */ o(s, { isDisabled: !0, children: t.title }, e)) })
17
+ function F({ key: n, breadCrumbs: e }) {
18
+ return /* @__PURE__ */ o(M, { overflow: "unset", color: c.OnBackgroundSubdued, children: /* @__PURE__ */ d(O, { children: [
19
+ /* @__PURE__ */ o(w, { variant: "ghost", size: "sm", "aria-label": "Show collapsed items", children: "..." }),
20
+ /* @__PURE__ */ o(z, { children: e.map((t, i) => t.as && t.to ? /* @__PURE__ */ o(u, { as: t.as, to: t.to, children: t.title }, i) : t.href ? /* @__PURE__ */ o(u, { itemType: "link", href: t.href, children: t.title }, i) : /* @__PURE__ */ o(u, { isDisabled: !0, children: t.title }, i)) })
21
21
  ] }) }, n);
22
22
  }
23
- function D({ breadCrumbs: n }) {
24
- const i = n.length > 4, t = i ? n.slice(1, -2) : [], e = n.filter((r) => !t.includes(r)), m = i ? [
25
- ...e.slice(0, 1),
23
+ function H({
24
+ breadCrumbs: n,
25
+ itemsBeforeCollapse: e = 1,
26
+ itemsAfterCollapse: t = 2
27
+ }) {
28
+ const i = e + t;
29
+ if (!(n.length > i)) {
30
+ const l = n;
31
+ return /* @__PURE__ */ o(
32
+ f,
33
+ {
34
+ color: c.OnBackground,
35
+ fontSize: B.Medium,
36
+ fontFamily: a.Body,
37
+ width: "100%",
38
+ children: l.map((r, s, h) => {
39
+ const I = s + 1 === h.length;
40
+ return g({
41
+ key: s.toString(),
42
+ isCurrentPage: I,
43
+ breadCrumb: r
44
+ });
45
+ })
46
+ }
47
+ );
48
+ }
49
+ const k = n.slice(0, e), p = t > 0 ? n.slice(-t) : [], S = n.slice(e, n.length - t), y = [
50
+ ...k,
26
51
  {
27
52
  title: "",
28
- as: "",
29
53
  isMenuButton: !0
30
54
  },
31
- ...e.slice(1)
32
- ] : e;
55
+ ...p
56
+ ];
33
57
  return /* @__PURE__ */ o(
34
- p,
58
+ f,
35
59
  {
36
60
  color: c.OnBackground,
37
- fontSize: S.Medium,
38
- fontFamily: k.Body,
39
- children: m.map((r, l, a) => {
40
- const B = l + 1 === a.length;
41
- return r.isMenuButton ? I({
42
- key: l.toString(),
43
- breadCrumbs: t
44
- }) : y({
45
- key: l.toString(),
46
- isCurrentPage: B,
47
- breadCrumb: r
61
+ fontSize: B.Medium,
62
+ fontFamily: a.Body,
63
+ width: "100%",
64
+ children: y.map((l, r, s) => {
65
+ const h = r + 1 === s.length;
66
+ return l.isMenuButton ? F({
67
+ key: r.toString(),
68
+ breadCrumbs: S
69
+ }) : g({
70
+ key: r.toString(),
71
+ isCurrentPage: h,
72
+ breadCrumb: l
48
73
  });
49
74
  })
50
75
  }
51
76
  );
52
77
  }
53
78
  export {
54
- D as Breadcrumbs
79
+ H as Breadcrumbs
55
80
  };
@@ -7,6 +7,7 @@ export declare const paginatorConfig: {
7
7
  display: string;
8
8
  justifyContent: string;
9
9
  alignItems: string;
10
+ fontVariant: string;
10
11
  padding: ThemeSpaceVariable;
11
12
  gap: ThemeSpaceVariable;
12
13
  div: {
@@ -1 +1 @@
1
- {"version":3,"file":"paginator-theme.d.ts","sourceRoot":"","sources":["../../../../lib/theme/theme-config/components/paginator-theme.ts"],"names":[],"mappings":"AACA,OAAO,EACN,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,MAAM,mBAAmB,CAAC;AAE3B,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgB1B,CAAC"}
1
+ {"version":3,"file":"paginator-theme.d.ts","sourceRoot":"","sources":["../../../../lib/theme/theme-config/components/paginator-theme.ts"],"names":[],"mappings":"AACA,OAAO,EACN,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,MAAM,mBAAmB,CAAC;AAE3B,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiB1B,CAAC"}
@@ -1,22 +1,23 @@
1
- import { defineStyleConfig as o } from "@chakra-ui/react";
2
- import { ThemeFontSizeVariable as a, ThemeSpaceVariable as e, ThemeColorVariable as i, ThemeFontVariable as t } from "../../theme-types.js";
3
- const r = o({
1
+ import { defineStyleConfig as a } from "@chakra-ui/react";
2
+ import { ThemeFontSizeVariable as o, ThemeSpaceVariable as e, ThemeColorVariable as t, ThemeFontVariable as i } from "../../theme-types.js";
3
+ const l = a({
4
4
  baseStyle: {
5
5
  width: "100%",
6
- fontFamily: t.Body,
7
- color: i.OnBackground,
6
+ fontFamily: i.Body,
7
+ color: t.OnBackground,
8
8
  display: "flex",
9
9
  justifyContent: "flex-end",
10
10
  alignItems: "center",
11
+ fontVariant: "tabular-nums",
11
12
  padding: e.Small,
12
13
  gap: e.Medium,
13
14
  div: {
14
15
  button: {
15
- fontSize: a.Large
16
+ fontSize: o.Large
16
17
  }
17
18
  }
18
19
  }
19
20
  });
20
21
  export {
21
- r as paginatorConfig
22
+ l as paginatorConfig
22
23
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caspeco/casper-ui-library",
3
- "version": "5.1.1",
3
+ "version": "5.2.0",
4
4
  "prettier": "@caspeco/prettier-config",
5
5
  "type": "module",
6
6
  "sideEffects": false,