@drivenets/design-system 0.0.4 → 0.0.5
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/CHANGELOG.md +7 -0
- package/README.md +51 -0
- package/dist/components/ds-button/ds-button.d.cts +2 -2
- package/dist/components/ds-button/ds-button.d.cts.map +1 -1
- package/dist/components/ds-button/ds-button.d.ts +2 -2
- package/dist/components/ds-confirmation/ds-confirmation.d.cts +8 -8
- package/dist/components/ds-confirmation/ds-confirmation.d.cts.map +1 -1
- package/dist/components/ds-confirmation/ds-confirmation.d.ts +8 -8
- package/dist/components/ds-drawer/ds-drawer.d.cts +9 -9
- package/dist/components/ds-drawer/ds-drawer.d.ts +9 -9
- package/dist/components/ds-expandable-text-input/ds-expandable-text-input.d.cts +2 -2
- package/dist/components/ds-expandable-text-input/ds-expandable-text-input.d.ts +2 -2
- package/dist/components/ds-form-control/ds-form-control.d.cts +7 -7
- package/dist/components/ds-modal/ds-modal.d.cts +8 -8
- package/dist/components/ds-modal/ds-modal.d.cts.map +1 -1
- package/dist/components/ds-modal/ds-modal.d.ts +8 -8
- package/dist/components/ds-panel/ds-panel.d.cts +2 -2
- package/dist/components/ds-panel/ds-panel.d.ts +2 -2
- package/dist/components/ds-segment-group/ds-segment-group.cjs +215 -0
- package/dist/components/ds-segment-group/ds-segment-group.d.cts +26 -0
- package/dist/components/ds-segment-group/ds-segment-group.d.cts.map +1 -0
- package/dist/components/ds-segment-group/ds-segment-group.d.ts +26 -0
- package/dist/components/ds-segment-group/ds-segment-group.d.ts.map +1 -0
- package/dist/components/ds-segment-group/ds-segment-group.js +214 -0
- package/dist/components/ds-segment-group/ds-segment-group.js.map +1 -0
- package/dist/components/ds-segment-group/ds-segment-group.module.cjs +12 -0
- package/dist/components/ds-segment-group/ds-segment-group.module.js +12 -0
- package/dist/components/ds-segment-group/ds-segment-group.module.js.map +1 -0
- package/dist/components/ds-segment-group/ds-segment-group.types.cjs +2 -0
- package/dist/components/ds-segment-group/ds-segment-group.types.d.cts +52 -0
- package/dist/components/ds-segment-group/ds-segment-group.types.d.cts.map +1 -0
- package/dist/components/ds-segment-group/ds-segment-group.types.d.ts +52 -0
- package/dist/components/ds-segment-group/ds-segment-group.types.d.ts.map +1 -0
- package/dist/components/ds-segment-group/ds-segment-group.types.js +2 -0
- package/dist/components/ds-segment-group/index.cjs +2 -0
- package/dist/components/ds-segment-group/index.d.ts +2 -0
- package/dist/components/ds-segment-group/index.js +2 -0
- package/dist/components/ds-select/ds-select.d.ts +2 -2
- package/dist/components/ds-smart-tabs/ds-smart-tabs.d.ts +2 -2
- package/dist/components/ds-stepper/components/ds-step-content.d.cts +2 -2
- package/dist/components/ds-stepper/components/ds-step-content.d.ts +2 -2
- package/dist/components/ds-stepper/components/ds-step-next-button.d.cts +2 -2
- package/dist/components/ds-stepper/components/ds-step-next-button.d.ts +2 -2
- package/dist/components/ds-stepper/components/ds-step.d.cts +2 -2
- package/dist/components/ds-stepper/components/ds-step.d.ts +2 -2
- package/dist/components/ds-stepper/ds-stepper.d.cts +2 -2
- package/dist/components/ds-stepper/ds-stepper.d.ts +2 -2
- package/dist/components/ds-table/ds-table.d.cts +2 -2
- package/dist/components/ds-vertical-tabs/ds-vertical-tabs.d.ts +5 -5
- package/dist/index.cjs +3 -0
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +3 -1
- package/dist/index.min.css +1 -1
- package/package.json +2 -2
- package/src/components/ds-segment-group/ds-segment-group.module.scss +99 -0
- package/src/components/ds-segment-group/ds-segment-group.tsx +76 -0
- package/src/components/ds-segment-group/ds-segment-group.types.tsx +64 -0
- package/src/components/ds-segment-group/index.tsx +2 -0
- package/src/index.ts +1 -0
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_ds_typography = require('../ds-typography/ds-typography.cjs');
|
|
3
|
+
const require_ds_segment_group_module = require('./ds-segment-group.module.cjs');
|
|
4
|
+
require('./ds-segment-group.types.cjs');
|
|
5
|
+
let react_compiler_runtime = require("react/compiler-runtime");
|
|
6
|
+
let classnames = require("classnames");
|
|
7
|
+
classnames = require_rolldown_runtime.__toESM(classnames);
|
|
8
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
|
+
let __ark_ui_react_segment_group = require("@ark-ui/react/segment-group");
|
|
10
|
+
|
|
11
|
+
//#region src/components/ds-segment-group/ds-segment-group.tsx
|
|
12
|
+
/**
|
|
13
|
+
* Root component - provides segment group context
|
|
14
|
+
*/
|
|
15
|
+
const Root = (t0) => {
|
|
16
|
+
const $ = (0, react_compiler_runtime.c)(17);
|
|
17
|
+
let children;
|
|
18
|
+
let className;
|
|
19
|
+
let onValueChange;
|
|
20
|
+
let props;
|
|
21
|
+
let t1;
|
|
22
|
+
if ($[0] !== t0) {
|
|
23
|
+
({className, children, onValueChange, size: t1, ...props} = t0);
|
|
24
|
+
$[0] = t0;
|
|
25
|
+
$[1] = children;
|
|
26
|
+
$[2] = className;
|
|
27
|
+
$[3] = onValueChange;
|
|
28
|
+
$[4] = props;
|
|
29
|
+
$[5] = t1;
|
|
30
|
+
} else {
|
|
31
|
+
children = $[1];
|
|
32
|
+
className = $[2];
|
|
33
|
+
onValueChange = $[3];
|
|
34
|
+
props = $[4];
|
|
35
|
+
t1 = $[5];
|
|
36
|
+
}
|
|
37
|
+
const t2 = (t1 === void 0 ? "default" : t1) === "small" && require_ds_segment_group_module.default.small;
|
|
38
|
+
let t3;
|
|
39
|
+
if ($[6] !== className || $[7] !== t2) {
|
|
40
|
+
t3 = (0, classnames.default)(require_ds_segment_group_module.default.segmentGroupRoot, t2, className);
|
|
41
|
+
$[6] = className;
|
|
42
|
+
$[7] = t2;
|
|
43
|
+
$[8] = t3;
|
|
44
|
+
} else t3 = $[8];
|
|
45
|
+
let t4;
|
|
46
|
+
if ($[9] !== onValueChange) {
|
|
47
|
+
t4 = (details) => onValueChange?.(details.value);
|
|
48
|
+
$[9] = onValueChange;
|
|
49
|
+
$[10] = t4;
|
|
50
|
+
} else t4 = $[10];
|
|
51
|
+
let t5;
|
|
52
|
+
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
53
|
+
t5 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ark_ui_react_segment_group.SegmentGroup.Indicator, { className: require_ds_segment_group_module.default.segmentIndicator });
|
|
54
|
+
$[11] = t5;
|
|
55
|
+
} else t5 = $[11];
|
|
56
|
+
let t6;
|
|
57
|
+
if ($[12] !== children || $[13] !== props || $[14] !== t3 || $[15] !== t4) {
|
|
58
|
+
t6 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__ark_ui_react_segment_group.SegmentGroup.Root, {
|
|
59
|
+
className: t3,
|
|
60
|
+
onValueChange: t4,
|
|
61
|
+
...props,
|
|
62
|
+
children: [t5, children]
|
|
63
|
+
});
|
|
64
|
+
$[12] = children;
|
|
65
|
+
$[13] = props;
|
|
66
|
+
$[14] = t3;
|
|
67
|
+
$[15] = t4;
|
|
68
|
+
$[16] = t6;
|
|
69
|
+
} else t6 = $[16];
|
|
70
|
+
return t6;
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Item component - renders a single segment button
|
|
74
|
+
*/
|
|
75
|
+
const Item = (t0) => {
|
|
76
|
+
const $ = (0, react_compiler_runtime.c)(20);
|
|
77
|
+
let children;
|
|
78
|
+
let className;
|
|
79
|
+
let label;
|
|
80
|
+
let props;
|
|
81
|
+
let style;
|
|
82
|
+
let value;
|
|
83
|
+
if ($[0] !== t0) {
|
|
84
|
+
({value, label, className, style, children, ...props} = t0);
|
|
85
|
+
$[0] = t0;
|
|
86
|
+
$[1] = children;
|
|
87
|
+
$[2] = className;
|
|
88
|
+
$[3] = label;
|
|
89
|
+
$[4] = props;
|
|
90
|
+
$[5] = style;
|
|
91
|
+
$[6] = value;
|
|
92
|
+
} else {
|
|
93
|
+
children = $[1];
|
|
94
|
+
className = $[2];
|
|
95
|
+
label = $[3];
|
|
96
|
+
props = $[4];
|
|
97
|
+
style = $[5];
|
|
98
|
+
value = $[6];
|
|
99
|
+
}
|
|
100
|
+
let t1;
|
|
101
|
+
if ($[7] !== className) {
|
|
102
|
+
t1 = (0, classnames.default)(require_ds_segment_group_module.default.segmentItem, className);
|
|
103
|
+
$[7] = className;
|
|
104
|
+
$[8] = t1;
|
|
105
|
+
} else t1 = $[8];
|
|
106
|
+
let t2;
|
|
107
|
+
if ($[9] !== children || $[10] !== label) {
|
|
108
|
+
t2 = label ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ItemText, { children: label }) : children;
|
|
109
|
+
$[9] = children;
|
|
110
|
+
$[10] = label;
|
|
111
|
+
$[11] = t2;
|
|
112
|
+
} else t2 = $[11];
|
|
113
|
+
let t3;
|
|
114
|
+
let t4;
|
|
115
|
+
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
116
|
+
t3 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ark_ui_react_segment_group.SegmentGroup.ItemControl, {});
|
|
117
|
+
t4 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ark_ui_react_segment_group.SegmentGroup.ItemHiddenInput, {});
|
|
118
|
+
$[12] = t3;
|
|
119
|
+
$[13] = t4;
|
|
120
|
+
} else {
|
|
121
|
+
t3 = $[12];
|
|
122
|
+
t4 = $[13];
|
|
123
|
+
}
|
|
124
|
+
let t5;
|
|
125
|
+
if ($[14] !== props || $[15] !== style || $[16] !== t1 || $[17] !== t2 || $[18] !== value) {
|
|
126
|
+
t5 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__ark_ui_react_segment_group.SegmentGroup.Item, {
|
|
127
|
+
value,
|
|
128
|
+
className: t1,
|
|
129
|
+
style,
|
|
130
|
+
...props,
|
|
131
|
+
children: [
|
|
132
|
+
t2,
|
|
133
|
+
t3,
|
|
134
|
+
t4
|
|
135
|
+
]
|
|
136
|
+
});
|
|
137
|
+
$[14] = props;
|
|
138
|
+
$[15] = style;
|
|
139
|
+
$[16] = t1;
|
|
140
|
+
$[17] = t2;
|
|
141
|
+
$[18] = value;
|
|
142
|
+
$[19] = t5;
|
|
143
|
+
} else t5 = $[19];
|
|
144
|
+
return t5;
|
|
145
|
+
};
|
|
146
|
+
/**
|
|
147
|
+
* ItemText component - renders text content within an item
|
|
148
|
+
*/
|
|
149
|
+
const ItemText = (t0) => {
|
|
150
|
+
const $ = (0, react_compiler_runtime.c)(12);
|
|
151
|
+
let children;
|
|
152
|
+
let className;
|
|
153
|
+
let props;
|
|
154
|
+
if ($[0] !== t0) {
|
|
155
|
+
({className, children, ...props} = t0);
|
|
156
|
+
$[0] = t0;
|
|
157
|
+
$[1] = children;
|
|
158
|
+
$[2] = className;
|
|
159
|
+
$[3] = props;
|
|
160
|
+
} else {
|
|
161
|
+
children = $[1];
|
|
162
|
+
className = $[2];
|
|
163
|
+
props = $[3];
|
|
164
|
+
}
|
|
165
|
+
let t1;
|
|
166
|
+
if ($[4] !== className) {
|
|
167
|
+
t1 = (0, classnames.default)(require_ds_segment_group_module.default.segmentItemText, className);
|
|
168
|
+
$[4] = className;
|
|
169
|
+
$[5] = t1;
|
|
170
|
+
} else t1 = $[5];
|
|
171
|
+
let t2;
|
|
172
|
+
if ($[6] !== children) {
|
|
173
|
+
t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ds_typography.default, {
|
|
174
|
+
variant: "body-sm-reg",
|
|
175
|
+
children
|
|
176
|
+
});
|
|
177
|
+
$[6] = children;
|
|
178
|
+
$[7] = t2;
|
|
179
|
+
} else t2 = $[7];
|
|
180
|
+
let t3;
|
|
181
|
+
if ($[8] !== props || $[9] !== t1 || $[10] !== t2) {
|
|
182
|
+
t3 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ark_ui_react_segment_group.SegmentGroup.ItemText, {
|
|
183
|
+
className: t1,
|
|
184
|
+
...props,
|
|
185
|
+
asChild: true,
|
|
186
|
+
children: t2
|
|
187
|
+
});
|
|
188
|
+
$[8] = props;
|
|
189
|
+
$[9] = t1;
|
|
190
|
+
$[10] = t2;
|
|
191
|
+
$[11] = t3;
|
|
192
|
+
} else t3 = $[11];
|
|
193
|
+
return t3;
|
|
194
|
+
};
|
|
195
|
+
/**
|
|
196
|
+
* Design system SegmentGroup component
|
|
197
|
+
*
|
|
198
|
+
* @example
|
|
199
|
+
* <DsSegmentGroup.Root value={value} onValueChange={setValue} size="default">
|
|
200
|
+
* <DsSegmentGroup.Indicator />
|
|
201
|
+
* <DsSegmentGroup.Item value="option1" label="Option 1" />
|
|
202
|
+
* <DsSegmentGroup.Item value="option2">
|
|
203
|
+
* <DsIcon icon="settings" />
|
|
204
|
+
* <DsSegmentGroup.ItemText>Option 2</DsSegmentGroup.ItemText>
|
|
205
|
+
* </DsSegmentGroup.Item>
|
|
206
|
+
* </DsSegmentGroup.Root>
|
|
207
|
+
*/
|
|
208
|
+
const DsSegmentGroup = {
|
|
209
|
+
Root,
|
|
210
|
+
Item,
|
|
211
|
+
ItemText
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
//#endregion
|
|
215
|
+
exports.DsSegmentGroup = DsSegmentGroup;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { DsSegmentGroupItemProps, DsSegmentGroupItemTextProps, DsSegmentGroupRootProps } from "./ds-segment-group.types.cjs";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/ds-segment-group/ds-segment-group.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Design system SegmentGroup component
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* <DsSegmentGroup.Root value={value} onValueChange={setValue} size="default">
|
|
11
|
+
* <DsSegmentGroup.Indicator />
|
|
12
|
+
* <DsSegmentGroup.Item value="option1" label="Option 1" />
|
|
13
|
+
* <DsSegmentGroup.Item value="option2">
|
|
14
|
+
* <DsIcon icon="settings" />
|
|
15
|
+
* <DsSegmentGroup.ItemText>Option 2</DsSegmentGroup.ItemText>
|
|
16
|
+
* </DsSegmentGroup.Item>
|
|
17
|
+
* </DsSegmentGroup.Root>
|
|
18
|
+
*/
|
|
19
|
+
declare const DsSegmentGroup: {
|
|
20
|
+
Root: React.FC<DsSegmentGroupRootProps>;
|
|
21
|
+
Item: React.FC<DsSegmentGroupItemProps>;
|
|
22
|
+
ItemText: React.FC<DsSegmentGroupItemTextProps>;
|
|
23
|
+
};
|
|
24
|
+
//#endregion
|
|
25
|
+
export { DsSegmentGroup };
|
|
26
|
+
//# sourceMappingURL=ds-segment-group.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ds-segment-group.d.cts","names":[],"sources":["../../../src/components/ds-segment-group/ds-segment-group.tsx"],"sourcesContent":[],"mappings":";;;;;;;AAuEA;;;;;;;;;;;cAAa"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { DsSegmentGroupItemProps, DsSegmentGroupItemTextProps, DsSegmentGroupRootProps } from "./ds-segment-group.types.js";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/ds-segment-group/ds-segment-group.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Design system SegmentGroup component
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* <DsSegmentGroup.Root value={value} onValueChange={setValue} size="default">
|
|
11
|
+
* <DsSegmentGroup.Indicator />
|
|
12
|
+
* <DsSegmentGroup.Item value="option1" label="Option 1" />
|
|
13
|
+
* <DsSegmentGroup.Item value="option2">
|
|
14
|
+
* <DsIcon icon="settings" />
|
|
15
|
+
* <DsSegmentGroup.ItemText>Option 2</DsSegmentGroup.ItemText>
|
|
16
|
+
* </DsSegmentGroup.Item>
|
|
17
|
+
* </DsSegmentGroup.Root>
|
|
18
|
+
*/
|
|
19
|
+
declare const DsSegmentGroup: {
|
|
20
|
+
Root: React.FC<DsSegmentGroupRootProps>;
|
|
21
|
+
Item: React.FC<DsSegmentGroupItemProps>;
|
|
22
|
+
ItemText: React.FC<DsSegmentGroupItemTextProps>;
|
|
23
|
+
};
|
|
24
|
+
//#endregion
|
|
25
|
+
export { DsSegmentGroup };
|
|
26
|
+
//# sourceMappingURL=ds-segment-group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ds-segment-group.d.ts","names":[],"sources":["../../../src/components/ds-segment-group/ds-segment-group.tsx"],"sourcesContent":[],"mappings":";;;;;;;AAuEA;;;;;;;;;;;cAAa"}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import ds_typography_default from "../ds-typography/ds-typography.js";
|
|
2
|
+
import ds_segment_group_module_default from "./ds-segment-group.module.js";
|
|
3
|
+
import "./ds-segment-group.types.js";
|
|
4
|
+
import { c } from "react/compiler-runtime";
|
|
5
|
+
import classNames from "classnames";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { SegmentGroup } from "@ark-ui/react/segment-group";
|
|
8
|
+
|
|
9
|
+
//#region src/components/ds-segment-group/ds-segment-group.tsx
|
|
10
|
+
/**
|
|
11
|
+
* Root component - provides segment group context
|
|
12
|
+
*/
|
|
13
|
+
const Root = (t0) => {
|
|
14
|
+
const $ = c(17);
|
|
15
|
+
let children;
|
|
16
|
+
let className;
|
|
17
|
+
let onValueChange;
|
|
18
|
+
let props;
|
|
19
|
+
let t1;
|
|
20
|
+
if ($[0] !== t0) {
|
|
21
|
+
({className, children, onValueChange, size: t1, ...props} = t0);
|
|
22
|
+
$[0] = t0;
|
|
23
|
+
$[1] = children;
|
|
24
|
+
$[2] = className;
|
|
25
|
+
$[3] = onValueChange;
|
|
26
|
+
$[4] = props;
|
|
27
|
+
$[5] = t1;
|
|
28
|
+
} else {
|
|
29
|
+
children = $[1];
|
|
30
|
+
className = $[2];
|
|
31
|
+
onValueChange = $[3];
|
|
32
|
+
props = $[4];
|
|
33
|
+
t1 = $[5];
|
|
34
|
+
}
|
|
35
|
+
const t2 = (t1 === void 0 ? "default" : t1) === "small" && ds_segment_group_module_default.small;
|
|
36
|
+
let t3;
|
|
37
|
+
if ($[6] !== className || $[7] !== t2) {
|
|
38
|
+
t3 = classNames(ds_segment_group_module_default.segmentGroupRoot, t2, className);
|
|
39
|
+
$[6] = className;
|
|
40
|
+
$[7] = t2;
|
|
41
|
+
$[8] = t3;
|
|
42
|
+
} else t3 = $[8];
|
|
43
|
+
let t4;
|
|
44
|
+
if ($[9] !== onValueChange) {
|
|
45
|
+
t4 = (details) => onValueChange?.(details.value);
|
|
46
|
+
$[9] = onValueChange;
|
|
47
|
+
$[10] = t4;
|
|
48
|
+
} else t4 = $[10];
|
|
49
|
+
let t5;
|
|
50
|
+
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
51
|
+
t5 = /* @__PURE__ */ jsx(SegmentGroup.Indicator, { className: ds_segment_group_module_default.segmentIndicator });
|
|
52
|
+
$[11] = t5;
|
|
53
|
+
} else t5 = $[11];
|
|
54
|
+
let t6;
|
|
55
|
+
if ($[12] !== children || $[13] !== props || $[14] !== t3 || $[15] !== t4) {
|
|
56
|
+
t6 = /* @__PURE__ */ jsxs(SegmentGroup.Root, {
|
|
57
|
+
className: t3,
|
|
58
|
+
onValueChange: t4,
|
|
59
|
+
...props,
|
|
60
|
+
children: [t5, children]
|
|
61
|
+
});
|
|
62
|
+
$[12] = children;
|
|
63
|
+
$[13] = props;
|
|
64
|
+
$[14] = t3;
|
|
65
|
+
$[15] = t4;
|
|
66
|
+
$[16] = t6;
|
|
67
|
+
} else t6 = $[16];
|
|
68
|
+
return t6;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Item component - renders a single segment button
|
|
72
|
+
*/
|
|
73
|
+
const Item = (t0) => {
|
|
74
|
+
const $ = c(20);
|
|
75
|
+
let children;
|
|
76
|
+
let className;
|
|
77
|
+
let label;
|
|
78
|
+
let props;
|
|
79
|
+
let style;
|
|
80
|
+
let value;
|
|
81
|
+
if ($[0] !== t0) {
|
|
82
|
+
({value, label, className, style, children, ...props} = t0);
|
|
83
|
+
$[0] = t0;
|
|
84
|
+
$[1] = children;
|
|
85
|
+
$[2] = className;
|
|
86
|
+
$[3] = label;
|
|
87
|
+
$[4] = props;
|
|
88
|
+
$[5] = style;
|
|
89
|
+
$[6] = value;
|
|
90
|
+
} else {
|
|
91
|
+
children = $[1];
|
|
92
|
+
className = $[2];
|
|
93
|
+
label = $[3];
|
|
94
|
+
props = $[4];
|
|
95
|
+
style = $[5];
|
|
96
|
+
value = $[6];
|
|
97
|
+
}
|
|
98
|
+
let t1;
|
|
99
|
+
if ($[7] !== className) {
|
|
100
|
+
t1 = classNames(ds_segment_group_module_default.segmentItem, className);
|
|
101
|
+
$[7] = className;
|
|
102
|
+
$[8] = t1;
|
|
103
|
+
} else t1 = $[8];
|
|
104
|
+
let t2;
|
|
105
|
+
if ($[9] !== children || $[10] !== label) {
|
|
106
|
+
t2 = label ? /* @__PURE__ */ jsx(ItemText, { children: label }) : children;
|
|
107
|
+
$[9] = children;
|
|
108
|
+
$[10] = label;
|
|
109
|
+
$[11] = t2;
|
|
110
|
+
} else t2 = $[11];
|
|
111
|
+
let t3;
|
|
112
|
+
let t4;
|
|
113
|
+
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
114
|
+
t3 = /* @__PURE__ */ jsx(SegmentGroup.ItemControl, {});
|
|
115
|
+
t4 = /* @__PURE__ */ jsx(SegmentGroup.ItemHiddenInput, {});
|
|
116
|
+
$[12] = t3;
|
|
117
|
+
$[13] = t4;
|
|
118
|
+
} else {
|
|
119
|
+
t3 = $[12];
|
|
120
|
+
t4 = $[13];
|
|
121
|
+
}
|
|
122
|
+
let t5;
|
|
123
|
+
if ($[14] !== props || $[15] !== style || $[16] !== t1 || $[17] !== t2 || $[18] !== value) {
|
|
124
|
+
t5 = /* @__PURE__ */ jsxs(SegmentGroup.Item, {
|
|
125
|
+
value,
|
|
126
|
+
className: t1,
|
|
127
|
+
style,
|
|
128
|
+
...props,
|
|
129
|
+
children: [
|
|
130
|
+
t2,
|
|
131
|
+
t3,
|
|
132
|
+
t4
|
|
133
|
+
]
|
|
134
|
+
});
|
|
135
|
+
$[14] = props;
|
|
136
|
+
$[15] = style;
|
|
137
|
+
$[16] = t1;
|
|
138
|
+
$[17] = t2;
|
|
139
|
+
$[18] = value;
|
|
140
|
+
$[19] = t5;
|
|
141
|
+
} else t5 = $[19];
|
|
142
|
+
return t5;
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* ItemText component - renders text content within an item
|
|
146
|
+
*/
|
|
147
|
+
const ItemText = (t0) => {
|
|
148
|
+
const $ = c(12);
|
|
149
|
+
let children;
|
|
150
|
+
let className;
|
|
151
|
+
let props;
|
|
152
|
+
if ($[0] !== t0) {
|
|
153
|
+
({className, children, ...props} = t0);
|
|
154
|
+
$[0] = t0;
|
|
155
|
+
$[1] = children;
|
|
156
|
+
$[2] = className;
|
|
157
|
+
$[3] = props;
|
|
158
|
+
} else {
|
|
159
|
+
children = $[1];
|
|
160
|
+
className = $[2];
|
|
161
|
+
props = $[3];
|
|
162
|
+
}
|
|
163
|
+
let t1;
|
|
164
|
+
if ($[4] !== className) {
|
|
165
|
+
t1 = classNames(ds_segment_group_module_default.segmentItemText, className);
|
|
166
|
+
$[4] = className;
|
|
167
|
+
$[5] = t1;
|
|
168
|
+
} else t1 = $[5];
|
|
169
|
+
let t2;
|
|
170
|
+
if ($[6] !== children) {
|
|
171
|
+
t2 = /* @__PURE__ */ jsx(ds_typography_default, {
|
|
172
|
+
variant: "body-sm-reg",
|
|
173
|
+
children
|
|
174
|
+
});
|
|
175
|
+
$[6] = children;
|
|
176
|
+
$[7] = t2;
|
|
177
|
+
} else t2 = $[7];
|
|
178
|
+
let t3;
|
|
179
|
+
if ($[8] !== props || $[9] !== t1 || $[10] !== t2) {
|
|
180
|
+
t3 = /* @__PURE__ */ jsx(SegmentGroup.ItemText, {
|
|
181
|
+
className: t1,
|
|
182
|
+
...props,
|
|
183
|
+
asChild: true,
|
|
184
|
+
children: t2
|
|
185
|
+
});
|
|
186
|
+
$[8] = props;
|
|
187
|
+
$[9] = t1;
|
|
188
|
+
$[10] = t2;
|
|
189
|
+
$[11] = t3;
|
|
190
|
+
} else t3 = $[11];
|
|
191
|
+
return t3;
|
|
192
|
+
};
|
|
193
|
+
/**
|
|
194
|
+
* Design system SegmentGroup component
|
|
195
|
+
*
|
|
196
|
+
* @example
|
|
197
|
+
* <DsSegmentGroup.Root value={value} onValueChange={setValue} size="default">
|
|
198
|
+
* <DsSegmentGroup.Indicator />
|
|
199
|
+
* <DsSegmentGroup.Item value="option1" label="Option 1" />
|
|
200
|
+
* <DsSegmentGroup.Item value="option2">
|
|
201
|
+
* <DsIcon icon="settings" />
|
|
202
|
+
* <DsSegmentGroup.ItemText>Option 2</DsSegmentGroup.ItemText>
|
|
203
|
+
* </DsSegmentGroup.Item>
|
|
204
|
+
* </DsSegmentGroup.Root>
|
|
205
|
+
*/
|
|
206
|
+
const DsSegmentGroup = {
|
|
207
|
+
Root,
|
|
208
|
+
Item,
|
|
209
|
+
ItemText
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
//#endregion
|
|
213
|
+
export { DsSegmentGroup };
|
|
214
|
+
//# sourceMappingURL=ds-segment-group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ds-segment-group.js","names":["React","SegmentGroup","classNames","styles","DsTypography","DsSegmentGroupItemProps","DsSegmentGroupItemTextProps","DsSegmentGroupRootProps","Root","FC","t0","$","_c","children","className","onValueChange","props","t1","size","undefined","t2","small","t3","segmentGroupRoot","t4","details","value","t5","Symbol","for","segmentIndicator","t6","Item","label","style","segmentItem","ItemText","segmentItemText","DsSegmentGroup"],"sources":["../../../src/components/ds-segment-group/ds-segment-group.tsx"],"sourcesContent":["import type React from 'react';\nimport { SegmentGroup } from '@ark-ui/react/segment-group';\nimport classNames from 'classnames';\nimport styles from './ds-segment-group.module.scss';\nimport DsTypography from '../ds-typography/ds-typography';\nimport {\n\ttype DsSegmentGroupItemProps,\n\ttype DsSegmentGroupItemTextProps,\n\ttype DsSegmentGroupRootProps,\n} from './ds-segment-group.types';\n\n/**\n * Root component - provides segment group context\n */\nconst Root: React.FC<DsSegmentGroupRootProps> = ({\n\tclassName,\n\tchildren,\n\tonValueChange,\n\tsize = 'default',\n\t...props\n}) => (\n\t<SegmentGroup.Root\n\t\tclassName={classNames(styles.segmentGroupRoot, size === 'small' && styles.small, className)}\n\t\tonValueChange={(details) => onValueChange?.(details.value)}\n\t\t{...props}\n\t>\n\t\t<SegmentGroup.Indicator className={styles.segmentIndicator} />\n\t\t{children}\n\t</SegmentGroup.Root>\n);\n\n/**\n * Item component - renders a single segment button\n */\nconst Item: React.FC<DsSegmentGroupItemProps> = ({ value, label, className, style, children, ...props }) => {\n\treturn (\n\t\t<SegmentGroup.Item\n\t\t\tvalue={value}\n\t\t\tclassName={classNames(styles.segmentItem, className)}\n\t\t\tstyle={style}\n\t\t\t{...props}\n\t\t>\n\t\t\t{label ? <ItemText>{label}</ItemText> : children}\n\t\t\t<SegmentGroup.ItemControl />\n\t\t\t<SegmentGroup.ItemHiddenInput />\n\t\t</SegmentGroup.Item>\n\t);\n};\n\n/**\n * ItemText component - renders text content within an item\n */\nconst ItemText: React.FC<DsSegmentGroupItemTextProps> = ({ className, children, ...props }) => (\n\t<SegmentGroup.ItemText className={classNames(styles.segmentItemText, className)} {...props} asChild>\n\t\t<DsTypography variant=\"body-sm-reg\">{children}</DsTypography>\n\t</SegmentGroup.ItemText>\n);\n\n/**\n * Design system SegmentGroup component\n *\n * @example\n * <DsSegmentGroup.Root value={value} onValueChange={setValue} size=\"default\">\n * <DsSegmentGroup.Indicator />\n * <DsSegmentGroup.Item value=\"option1\" label=\"Option 1\" />\n * <DsSegmentGroup.Item value=\"option2\">\n * <DsIcon icon=\"settings\" />\n * <DsSegmentGroup.ItemText>Option 2</DsSegmentGroup.ItemText>\n *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AAAX,EAAA,OAAAK,SAAAL,EAAA,OAAAM,MAAAN,EAAA,QAAAS,IAAA;AAD9DE,OAAA,oBAAA,aAAA;GAAkC,WAAAL;GAA6C,GAAMD;GAAO,SAAA;aAC3FI;IACuB;AAAAT,IAAA,KAAAK;AAAAL,IAAA,KAAAM;AAAAN,IAAA,MAAAS;AAAAT,IAAA,MAAAW;OAAAA,MAAAX,EAAA;AAAA,QAFxBW;;;;;;;;;;;;;;;AAkBD,MAAagB,iBAAiB;CAC7B9B;CACAwB;CACAI;CACA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/components/ds-segment-group/ds-segment-group.module.scss
|
|
3
|
+
var ds_segment_group_module_default = {
|
|
4
|
+
"segmentGroupRoot": "_segmentGroupRoot_1sd0t_1",
|
|
5
|
+
"small": "_small_1sd0t_1",
|
|
6
|
+
"segmentItem": "_segmentItem_1sd0t_1",
|
|
7
|
+
"segmentItemText": "_segmentItemText_1sd0t_1",
|
|
8
|
+
"segmentIndicator": "_segmentIndicator_1sd0t_1"
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
exports.default = ds_segment_group_module_default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region src/components/ds-segment-group/ds-segment-group.module.scss
|
|
2
|
+
var ds_segment_group_module_default = {
|
|
3
|
+
"segmentGroupRoot": "_segmentGroupRoot_1sd0t_1",
|
|
4
|
+
"small": "_small_1sd0t_1",
|
|
5
|
+
"segmentItem": "_segmentItem_1sd0t_1",
|
|
6
|
+
"segmentItemText": "_segmentItemText_1sd0t_1",
|
|
7
|
+
"segmentIndicator": "_segmentIndicator_1sd0t_1"
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
export { ds_segment_group_module_default as default };
|
|
12
|
+
//# sourceMappingURL=ds-segment-group.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ds-segment-group.module.js","names":[],"sources":["../../../src/components/ds-segment-group/ds-segment-group.module.scss"],"sourcesContent":[".segmentGroupRoot {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tposition: relative;\n\tbackground: var(--color-background-secondary);\n\tborder: 1px solid var(--color-border-contrast);\n\tborder-radius: 4px;\n\tgap: var(--spacing-2xs);\n\theight: 36px;\n\tpadding: var(--spacing-3xs);\n\n\t&.small {\n\t\theight: 28px;\n\t\tpadding: var(--spacing-4xs);\n\n\t\t.segmentItem {\n\t\t\tpadding: var(--spacing-4xs) var(--spacing-xs);\n\t\t}\n\t}\n}\n\n.segmentItem {\n\tposition: relative;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tpadding: var(--spacing-3xs) var(--spacing-sm);\n\tgap: var(--spacing-2xs);\n\tflex: 1;\n\tz-index: 1;\n\tcursor: pointer;\n\tborder-radius: 4px;\n\n\t&[data-state='checked'] {\n\t\t.segmentItemText {\n\t\t\tcolor: var(--color-font-main);\n\t\t\tfont-weight: var(--font-weight-medium);\n\t\t}\n\t}\n\n\t&[data-state='unchecked'] {\n\t\tbackground: transparent;\n\n\t\t.segmentItemText {\n\t\t\tcolor: var(--color-background-action);\n\t\t}\n\n\t\t&:hover:not([data-disabled]) {\n\t\t\tbackground: var(--color-background-action-secondary);\n\t\t}\n\n\t\t&:active:not([data-disabled]) {\n\t\t\tbackground: var(--color-background);\n\t\t\tborder-color: var(--color-border-contrast);\n\t\t}\n\t}\n\n\t&[data-disabled] {\n\t\tcursor: not-allowed;\n\t\tbackground: var(--color-background-secondary);\n\n\t\t.segmentItemText {\n\t\t\tcolor: var(--color-font-disabled);\n\t\t}\n\t}\n\n\t&:focus-visible {\n\t\toutline: 2px solid var(--color-border-action-secondary);\n\t\toutline-offset: 2px;\n\t}\n}\n\n[data-scope='segment-group'][data-part='item-control'] {\n\tposition: absolute;\n\tinset: 0;\n\tpointer-events: none;\n}\n\n.segmentItemText {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\twhite-space: nowrap;\n\ttransition: color 150ms ease-in-out;\n}\n\n.segmentIndicator {\n\tposition: absolute;\n\tbackground: var(--color-background);\n\tborder: 1px solid var(--color-border-contrast);\n\tborder-radius: 4px;\n\tbox-shadow: 0 1.25px 4px 0 rgba(0, 0, 0, 0.25);\n\tz-index: 0;\n\tpointer-events: none;\n\twidth: var(--width);\n\theight: var(--height);\n\tleft: var(--left);\n\ttop: var(--top);\n}\n"],"mappings":""}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { SegmentGroupItemProps, SegmentGroupItemTextProps, SegmentGroupRootProps } from "@ark-ui/react/segment-group";
|
|
3
|
+
|
|
4
|
+
//#region src/components/ds-segment-group/ds-segment-group.types.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Size variants for the segment group
|
|
8
|
+
*/
|
|
9
|
+
type DsSegmentGroupSize = 'small' | 'default';
|
|
10
|
+
/**
|
|
11
|
+
* Props for the DsSegmentGroup Root component
|
|
12
|
+
*/
|
|
13
|
+
interface DsSegmentGroupRootProps extends Pick<SegmentGroupRootProps, 'value' | 'defaultValue' | 'disabled' | 'name' | 'className' | 'style' | 'children'> {
|
|
14
|
+
/**
|
|
15
|
+
* Size variant of the segment group
|
|
16
|
+
* @default 'default'
|
|
17
|
+
*/
|
|
18
|
+
size?: DsSegmentGroupSize;
|
|
19
|
+
/**
|
|
20
|
+
* Event handler called when the selected value changes
|
|
21
|
+
*/
|
|
22
|
+
onValueChange?: (value: string | null) => void;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Props for the DsSegmentGroup Item component
|
|
26
|
+
*/
|
|
27
|
+
type DsSegmentGroupItemProps = Pick<SegmentGroupItemProps, 'id' | 'value' | 'disabled' | 'className' | 'style'> & ({
|
|
28
|
+
/**
|
|
29
|
+
* The segment group item content
|
|
30
|
+
*/
|
|
31
|
+
children: ReactNode;
|
|
32
|
+
/**
|
|
33
|
+
* Optional label text for the segment item
|
|
34
|
+
*/
|
|
35
|
+
label?: never;
|
|
36
|
+
} | {
|
|
37
|
+
/**
|
|
38
|
+
* The segment group item content
|
|
39
|
+
*/
|
|
40
|
+
children?: never;
|
|
41
|
+
/**
|
|
42
|
+
* Optional label text for the segment item
|
|
43
|
+
*/
|
|
44
|
+
label: string;
|
|
45
|
+
});
|
|
46
|
+
/**
|
|
47
|
+
* Props for the DsSegmentGroup ItemText component
|
|
48
|
+
*/
|
|
49
|
+
type DsSegmentGroupItemTextProps = Pick<SegmentGroupItemTextProps, 'className' | 'style' | 'children'>;
|
|
50
|
+
//#endregion
|
|
51
|
+
export { DsSegmentGroupItemProps, DsSegmentGroupItemTextProps, DsSegmentGroupRootProps, DsSegmentGroupSize };
|
|
52
|
+
//# sourceMappingURL=ds-segment-group.types.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ds-segment-group.types.d.cts","names":[],"sources":["../../../src/components/ds-segment-group/ds-segment-group.types.tsx"],"sourcesContent":[],"mappings":";;;;;;;AAUA;AAKiB,KALL,kBAAA,GAK6B,OAAA,GAAA,SAAA;;;;AAAY,UAApC,uBAAA,SAAgC,IAAI,CACpD,qBADoD,EAAA,OAAA,GAAA,cAAA,GAAA,UAAA,GAAA,MAAA,GAAA,WAAA,GAAA,OAAA,GAAA,UAAA,CAAA,CAAA;EAkBzC;;;;EASW,IAAA,CAAA,EAnBf,kBAmBe;EAqBX;;;;;;;;KA9BA,uBAAA,GAA0B,KACrC;;;;YAQa;;;;;;;;;;;;;;;;;;KAqBF,2BAAA,GAA8B,KAAK"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { SegmentGroupItemProps, SegmentGroupItemTextProps, SegmentGroupRootProps } from "@ark-ui/react/segment-group";
|
|
3
|
+
|
|
4
|
+
//#region src/components/ds-segment-group/ds-segment-group.types.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Size variants for the segment group
|
|
8
|
+
*/
|
|
9
|
+
type DsSegmentGroupSize = 'small' | 'default';
|
|
10
|
+
/**
|
|
11
|
+
* Props for the DsSegmentGroup Root component
|
|
12
|
+
*/
|
|
13
|
+
interface DsSegmentGroupRootProps extends Pick<SegmentGroupRootProps, 'value' | 'defaultValue' | 'disabled' | 'name' | 'className' | 'style' | 'children'> {
|
|
14
|
+
/**
|
|
15
|
+
* Size variant of the segment group
|
|
16
|
+
* @default 'default'
|
|
17
|
+
*/
|
|
18
|
+
size?: DsSegmentGroupSize;
|
|
19
|
+
/**
|
|
20
|
+
* Event handler called when the selected value changes
|
|
21
|
+
*/
|
|
22
|
+
onValueChange?: (value: string | null) => void;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Props for the DsSegmentGroup Item component
|
|
26
|
+
*/
|
|
27
|
+
type DsSegmentGroupItemProps = Pick<SegmentGroupItemProps, 'id' | 'value' | 'disabled' | 'className' | 'style'> & ({
|
|
28
|
+
/**
|
|
29
|
+
* The segment group item content
|
|
30
|
+
*/
|
|
31
|
+
children: ReactNode;
|
|
32
|
+
/**
|
|
33
|
+
* Optional label text for the segment item
|
|
34
|
+
*/
|
|
35
|
+
label?: never;
|
|
36
|
+
} | {
|
|
37
|
+
/**
|
|
38
|
+
* The segment group item content
|
|
39
|
+
*/
|
|
40
|
+
children?: never;
|
|
41
|
+
/**
|
|
42
|
+
* Optional label text for the segment item
|
|
43
|
+
*/
|
|
44
|
+
label: string;
|
|
45
|
+
});
|
|
46
|
+
/**
|
|
47
|
+
* Props for the DsSegmentGroup ItemText component
|
|
48
|
+
*/
|
|
49
|
+
type DsSegmentGroupItemTextProps = Pick<SegmentGroupItemTextProps, 'className' | 'style' | 'children'>;
|
|
50
|
+
//#endregion
|
|
51
|
+
export { DsSegmentGroupItemProps, DsSegmentGroupItemTextProps, DsSegmentGroupRootProps, DsSegmentGroupSize };
|
|
52
|
+
//# sourceMappingURL=ds-segment-group.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ds-segment-group.types.d.ts","names":[],"sources":["../../../src/components/ds-segment-group/ds-segment-group.types.tsx"],"sourcesContent":[],"mappings":";;;;;;;AAUA;AAKiB,KALL,kBAAA,GAK6B,OAAA,GAAA,SAAA;;;;AAAY,UAApC,uBAAA,SAAgC,IAAI,CACpD,qBADoD,EAAA,OAAA,GAAA,cAAA,GAAA,UAAA,GAAA,MAAA,GAAA,WAAA,GAAA,OAAA,GAAA,UAAA,CAAA,CAAA;EAkBzC;;;;EASW,IAAA,CAAA,EAnBf,kBAmBe;EAqBX;;;;;;;;KA9BA,uBAAA,GAA0B,KACrC;;;;YAQa;;;;;;;;;;;;;;;;;;KAqBF,2BAAA,GAA8B,KAAK"}
|