@temp-spotwork/ui 1.8.2 → 1.8.3

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.
@@ -1,6 +1,10 @@
1
1
  export type SegmentedControlOption = {
2
2
  id: string;
3
3
  label: string;
4
+ /**
5
+ * Optional count/status badge rendered after the label (design-system Badge)
6
+ */
7
+ badgeText?: string;
4
8
  };
5
9
  export type SegmentedControlProps = {
6
10
  /**
@@ -1,36 +1,46 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { Typography as i } from "../../../styles/typography/typography.js";
3
- import { getStyles as p, getContainerStyles as f } from "./styles.js";
4
- import { t as n } from "../../../../bundle-mjs-BjFsLjkg.js";
5
- function C({
1
+ import { jsx as o, jsxs as p } from "react/jsx-runtime";
2
+ import { Typography as d } from "../../../styles/typography/typography.js";
3
+ import { getStyles as g, getContainerStyles as u } from "./styles.js";
4
+ import { t as i } from "../../../../bundle-mjs-BjFsLjkg.js";
5
+ import { Badge as v } from "../../../atoms/badge/badge.js";
6
+ function w({
6
7
  segments: a,
7
- handleClick: l,
8
- inline: o = !1,
9
- activeSegment: t
8
+ handleClick: m,
9
+ inline: s = !1,
10
+ activeSegment: c
10
11
  }) {
11
- const s = p(o);
12
- return /* @__PURE__ */ e(
12
+ const n = g(s);
13
+ return /* @__PURE__ */ o(
13
14
  "div",
14
15
  {
15
- className: n(
16
- s.container,
17
- s.segmentsBorder
16
+ className: i(
17
+ n.container,
18
+ n.segmentsBorder
18
19
  ),
19
- children: a.map(({ id: r, label: c }) => {
20
- const m = f(o, r === t);
21
- return /* @__PURE__ */ e(
20
+ children: a.map(({ id: r, label: l, badgeText: e }) => {
21
+ const t = r === c, f = u(s, t);
22
+ return /* @__PURE__ */ p(
22
23
  "div",
23
24
  {
24
- className: n("cursor-pointer", m.container),
25
- onClick: () => l(r),
26
- children: /* @__PURE__ */ e(
27
- i,
28
- {
29
- children: c,
30
- color: r === t ? "active" : "default",
31
- swStyle: 1
32
- }
33
- )
25
+ className: i("cursor-pointer", f.container),
26
+ onClick: () => m(r),
27
+ children: [
28
+ /* @__PURE__ */ o(
29
+ d,
30
+ {
31
+ children: l,
32
+ color: t ? "active" : "default",
33
+ swStyle: 1
34
+ }
35
+ ),
36
+ e != null && e !== "" && /* @__PURE__ */ o(
37
+ v,
38
+ {
39
+ text: e,
40
+ color: t ? "affirmativeInverted" : "affirmative"
41
+ }
42
+ )
43
+ ]
34
44
  },
35
45
  r
36
46
  );
@@ -39,5 +49,5 @@ function C({
39
49
  );
40
50
  }
41
51
  export {
42
- C as SegmentedControl
52
+ w as SegmentedControl
43
53
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@temp-spotwork/ui",
3
3
  "private": false,
4
- "version": "1.8.2",
4
+ "version": "1.8.3",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",
7
7
  "types": "dist/main.d.ts",