@edifice.io/react 2.5.10-develop-b2school.20260226140419 → 2.5.10-develop-b2school.20260226151505

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.
@@ -27,6 +27,14 @@ export interface SegmentedControlProps extends Omit<React.HTMLAttributes<HTMLDiv
27
27
  * Selected value
28
28
  */
29
29
  value?: string;
30
+ /**
31
+ * Variant of the segmented control, affecting its styling.
32
+ * - 'default': standard segmented control with borders.
33
+ * - 'ghost': borderless segmented control, relying on background and text color for distinction.
34
+ *
35
+ * @default 'default'
36
+ */
37
+ variant?: 'default' | 'ghost';
30
38
  /**
31
39
  * Callback called when value changes
32
40
  */
@@ -1,20 +1,26 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { forwardRef } from "react";
3
2
  import { Segmented } from "antd";
3
+ import clsx from "clsx";
4
+ import { forwardRef } from "react";
4
5
  const SegmentedControl = /* @__PURE__ */ forwardRef(({
5
6
  options,
6
7
  value,
7
8
  onChange,
9
+ variant = "default",
10
+ className,
8
11
  ...htmlProps
9
12
  }, ref) => {
10
- const antProps = {
11
- options: options.map((option) => ({
12
- ...option,
13
- label: /* @__PURE__ */ jsx("span", { "data-testid": `segmented-option-${option.value}`, children: option.label })
14
- })),
13
+ const transformedOptions = options.map((option) => ({
14
+ ...option,
15
+ label: /* @__PURE__ */ jsx("span", { "data-testid": `segmented-option-${option.value}`, children: option.label })
16
+ })), classNames = clsx(className, {
17
+ ghost: variant === "ghost"
18
+ }), antProps = {
19
+ options: transformedOptions,
15
20
  value,
16
21
  onChange,
17
22
  ref,
23
+ className: classNames,
18
24
  ...htmlProps
19
25
  };
20
26
  return /* @__PURE__ */ jsx(Segmented, { ...antProps });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edifice.io/react",
3
- "version": "2.5.10-develop-b2school.20260226140419",
3
+ "version": "2.5.10-develop-b2school.20260226151505",
4
4
  "description": "Edifice React Library",
5
5
  "keywords": [
6
6
  "react",
@@ -135,9 +135,9 @@
135
135
  "swiper": "^10.1.0",
136
136
  "ua-parser-js": "^1.0.36",
137
137
  "react-pdf": "10.2.0",
138
- "@edifice.io/bootstrap": "2.5.10-develop-b2school.20260226140419",
139
- "@edifice.io/tiptap-extensions": "2.5.10-develop-b2school.20260226140419",
140
- "@edifice.io/utilities": "2.5.10-develop-b2school.20260226140419"
138
+ "@edifice.io/tiptap-extensions": "2.5.10-develop-b2school.20260226151505",
139
+ "@edifice.io/bootstrap": "2.5.10-develop-b2school.20260226151505",
140
+ "@edifice.io/utilities": "2.5.10-develop-b2school.20260226151505"
141
141
  },
142
142
  "devDependencies": {
143
143
  "@babel/plugin-transform-react-pure-annotations": "^7.23.3",
@@ -168,8 +168,8 @@
168
168
  "vite": "^5.4.11",
169
169
  "vite-plugin-dts": "^4.1.0",
170
170
  "vite-tsconfig-paths": "^5.0.1",
171
- "@edifice.io/client": "2.5.10-develop-b2school.20260226140419",
172
- "@edifice.io/config": "2.5.10-develop-b2school.20260226140419"
171
+ "@edifice.io/client": "2.5.10-develop-b2school.20260226151505",
172
+ "@edifice.io/config": "2.5.10-develop-b2school.20260226151505"
173
173
  },
174
174
  "peerDependencies": {
175
175
  "@react-spring/web": "^9.7.5",