sellmate-design-system-react 9.0.0-beta.27 → 9.0.0-beta.28
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/dist/components/SLinearProgress/README.md +7 -0
- package/dist/components/SLinearProgress/SLinearProgress.d.ts +3 -0
- package/dist/components/SLinearProgress/index.d.ts +1 -1
- package/dist/components/SRadioButton/README.md +1 -1
- package/dist/components/SRadioButton/SRadioButton.d.ts +1 -1
- package/dist/components/STag/README.md +1 -0
- package/dist/components/STag/STag.d.ts +3 -1
- package/dist/index.cjs +153 -75
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +153 -75
- package/dist/index.js.map +1 -1
- package/dist/llms-full.txt +10 -1
- package/dist/llms.txt +1 -0
- package/dist/styles.css +50 -88
- package/dist/theme.css +45 -9
- package/eslint/scale.gen.mjs +1 -1
- package/package.json +1 -1
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
|------|------|---------|-------------|
|
|
11
11
|
| `value?` | `number` | `0` | 진행률 (0–100) |
|
|
12
12
|
| `type?` | `SLinearProgressType` | `'primary'` | 색상 타입 |
|
|
13
|
+
| `size?` | `SLinearProgressSize` | `'sm'` | 바 높이. xs 는 바 안에 퍼센트 텍스트를 넣지 않는다 |
|
|
13
14
|
| `indeterminate?` | `boolean` | `false` | 진행률 없이 무한 애니메이션 |
|
|
14
15
|
| `label?` | `string` | — | 하단 레이블 |
|
|
15
16
|
| `className?` | `string` | — | |
|
|
@@ -23,3 +24,9 @@
|
|
|
23
24
|
export type SLinearProgressType = 'primary' | 'error' | 'complete';
|
|
24
25
|
```
|
|
25
26
|
|
|
27
|
+
### SLinearProgressSize
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
export type SLinearProgressSize = 'xs' | 'sm' | 'md';
|
|
31
|
+
```
|
|
32
|
+
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { type CSSProperties } from 'react';
|
|
2
2
|
export type SLinearProgressType = 'primary' | 'error' | 'complete';
|
|
3
|
+
export type SLinearProgressSize = 'xs' | 'sm' | 'md';
|
|
3
4
|
export interface SLinearProgressProps {
|
|
4
5
|
/** 진행률 (0–100) */
|
|
5
6
|
value?: number;
|
|
6
7
|
/** 색상 타입 */
|
|
7
8
|
type?: SLinearProgressType;
|
|
9
|
+
/** 바 높이. xs 는 바 안에 퍼센트 텍스트를 넣지 않는다 */
|
|
10
|
+
size?: SLinearProgressSize;
|
|
8
11
|
/** 진행률 없이 무한 애니메이션 */
|
|
9
12
|
indeterminate?: boolean;
|
|
10
13
|
/** 하단 레이블 */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { SLinearProgress, type SLinearProgressProps, type SLinearProgressType, } from './SLinearProgress';
|
|
1
|
+
export { SLinearProgress, type SLinearProgressProps, type SLinearProgressType, type SLinearProgressSize, } from './SLinearProgress';
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
| `shape?` | `STagShape` | `'square'` | 모양 |
|
|
12
12
|
| `size?` | `STagSize` | `'sm'` | 크기 |
|
|
13
13
|
| `color?` | `STagColor` | `'grey'` | 색상 |
|
|
14
|
+
| `deep?` | `boolean` | `false` | 진한 배경(deep) 버전. 배경에 강조색을 채우고 텍스트·아이콘을 반전색으로 쓴다 |
|
|
14
15
|
| `label?` | `string` | `''` | 레이블 텍스트 |
|
|
15
16
|
| `icon?` | `SIconName` | — | 아이콘명 |
|
|
16
17
|
| `iconLeft?` | `boolean` | `true` | 아이콘을 레이블 왼쪽에 배치 |
|
|
@@ -8,6 +8,8 @@ export interface STagProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'color'
|
|
|
8
8
|
size?: STagSize;
|
|
9
9
|
/** 색상 */
|
|
10
10
|
color?: STagColor;
|
|
11
|
+
/** 진한 배경(deep) 버전. 배경에 강조색을 채우고 텍스트·아이콘을 반전색으로 쓴다 */
|
|
12
|
+
deep?: boolean;
|
|
11
13
|
/** 레이블 텍스트 */
|
|
12
14
|
label?: string;
|
|
13
15
|
/** 아이콘명 */
|
|
@@ -20,6 +22,6 @@ export interface STagProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'color'
|
|
|
20
22
|
/**
|
|
21
23
|
* STag — sd-tag 포팅.
|
|
22
24
|
* Stencil의 `name`(예: square_sm_grey) 프리셋을 shape/size/color 세 prop으로 분리.
|
|
23
|
-
* 색상은 컴포넌트 토큰 `--cmp-tag-<color>-{bg,content}
|
|
25
|
+
* 색상은 컴포넌트 토큰 `--cmp-tag-<color>-{bg,content}`, deep 은 `--cmp-tag-<color>-deep-*` 참조.
|
|
24
26
|
*/
|
|
25
27
|
export declare const STag: import("react").ForwardRefExoticComponent<STagProps & import("react").RefAttributes<HTMLSpanElement>>;
|
package/dist/index.cjs
CHANGED
|
@@ -3770,7 +3770,7 @@ var SDraggableItemView = /* @__PURE__ */ react.forwardRef(
|
|
|
3770
3770
|
"rounded-(--cmp-listDraggableItem-radius-bordered) border border-(--cmp-listDraggableItem-border-default)",
|
|
3771
3771
|
!disabled && !selected && !dragging && "hover:border-(--cmp-listDraggableItem-bordered-border-hover)",
|
|
3772
3772
|
!disabled && selected && !dragging && "border-(--cmp-listDraggableItem-bordered-border-selected) bg-(--cmp-listDraggableItem-bordered-bg-selected)",
|
|
3773
|
-
!disabled && selected && dragging && "border-
|
|
3773
|
+
!disabled && selected && dragging && "border-(--cmp-listDraggableItem-bordered-dragging-border-color) bg-(--cmp-listDraggableItem-bordered-dragging-bg)"
|
|
3774
3774
|
),
|
|
3775
3775
|
disabled && "cursor-not-allowed",
|
|
3776
3776
|
className
|
|
@@ -4150,10 +4150,12 @@ function SDraggableProviderInternal({
|
|
|
4150
4150
|
if (movedItem !== void 0) {
|
|
4151
4151
|
if (source === target) {
|
|
4152
4152
|
const toIndex = dropRef.current.index > dragging.index ? dropRef.current.index - 1 : dropRef.current.index;
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
|
|
4153
|
+
if (toIndex !== dragging.index) {
|
|
4154
|
+
const nextItems = [...source.items];
|
|
4155
|
+
nextItems.splice(dragging.index, 1);
|
|
4156
|
+
nextItems.splice(toIndex, 0, movedItem);
|
|
4157
|
+
source.onChange?.(nextItems);
|
|
4158
|
+
}
|
|
4157
4159
|
} else {
|
|
4158
4160
|
const nextSourceItems = source.items.filter((_, index) => index !== dragging.index);
|
|
4159
4161
|
const nextTargetItems = [...target.items];
|
|
@@ -4214,6 +4216,13 @@ function reorder(items, fromIndex, toIndex) {
|
|
|
4214
4216
|
function clampDepth(depth, maxDepth) {
|
|
4215
4217
|
return Math.max(1, Math.min(maxDepth, Math.floor(depth)));
|
|
4216
4218
|
}
|
|
4219
|
+
function getDepthOffset(depth) {
|
|
4220
|
+
return (Math.max(1, Math.floor(depth)) - 1) * 20;
|
|
4221
|
+
}
|
|
4222
|
+
function getIndicatorOffset(depth) {
|
|
4223
|
+
const depthOffset = getDepthOffset(depth);
|
|
4224
|
+
return depthOffset === 0 ? 0 : `calc(var(--cmp-listDraggableItem-paddingX) + ${depthOffset}px)`;
|
|
4225
|
+
}
|
|
4217
4226
|
function getSubtreeEnd(items, startIndex, getDepth) {
|
|
4218
4227
|
const startDepth = getDepth(items[startIndex], startIndex);
|
|
4219
4228
|
let endIndex = startIndex + 1;
|
|
@@ -4281,6 +4290,7 @@ function SDraggableListInner({
|
|
|
4281
4290
|
const fromIndexRef = react.useRef(null);
|
|
4282
4291
|
const currentSelectedKey = selectedKey ?? internalSelectedKey;
|
|
4283
4292
|
const usesDepth = getDepth != null;
|
|
4293
|
+
const depthEnabled = usesDepth && !useGap;
|
|
4284
4294
|
const groupDragging = dragContext?.dragging;
|
|
4285
4295
|
const draggedSubtreeStart = dragContext ? groupDragging?.listId === listId ? groupDragging?.index ?? null : null : draggingIndex;
|
|
4286
4296
|
const startDrag = react.useCallback((event, index) => {
|
|
@@ -4301,19 +4311,14 @@ function SDraggableListInner({
|
|
|
4301
4311
|
);
|
|
4302
4312
|
if (!itemElements) return;
|
|
4303
4313
|
let nextDropTarget = items.length === 0 ? { index: 0, intent: "before" } : { index: items.length - 1, intent: "after" };
|
|
4304
|
-
const draggingEndIndex =
|
|
4305
|
-
let previousDropIndex = null;
|
|
4314
|
+
const draggingEndIndex = depthEnabled && draggingIndex != null ? getSubtreeEnd(items, draggingIndex, readDepth) : draggingIndex + 1;
|
|
4306
4315
|
for (let index = 0; index < itemElements.length; index += 1) {
|
|
4307
4316
|
const itemElement = itemElements[index];
|
|
4308
4317
|
const rect = itemElement.getBoundingClientRect();
|
|
4309
4318
|
if (index >= draggingIndex && index < draggingEndIndex) {
|
|
4310
|
-
if (event.clientY <= rect.bottom) {
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
} else {
|
|
4314
|
-
nextDropTarget = { index: draggingIndex, intent: "before" };
|
|
4315
|
-
}
|
|
4316
|
-
break;
|
|
4319
|
+
if (event.clientY >= rect.top && event.clientY <= rect.bottom) {
|
|
4320
|
+
setDropTarget(null);
|
|
4321
|
+
return;
|
|
4317
4322
|
}
|
|
4318
4323
|
continue;
|
|
4319
4324
|
}
|
|
@@ -4322,12 +4327,11 @@ function SDraggableListInner({
|
|
|
4322
4327
|
break;
|
|
4323
4328
|
}
|
|
4324
4329
|
if (event.clientY > rect.bottom) {
|
|
4325
|
-
previousDropIndex = index;
|
|
4326
4330
|
nextDropTarget = { index, intent: "after" };
|
|
4327
4331
|
continue;
|
|
4328
4332
|
}
|
|
4329
4333
|
const ratio = (event.clientY - rect.top) / rect.height;
|
|
4330
|
-
if (!
|
|
4334
|
+
if (!depthEnabled) {
|
|
4331
4335
|
nextDropTarget = ratio < 0.5 ? { index, intent: "before" } : { index, intent: "after" };
|
|
4332
4336
|
break;
|
|
4333
4337
|
}
|
|
@@ -4344,27 +4348,35 @@ function SDraggableListInner({
|
|
|
4344
4348
|
}
|
|
4345
4349
|
setDropTarget(nextDropTarget);
|
|
4346
4350
|
};
|
|
4351
|
+
const cancelDrag = () => {
|
|
4352
|
+
fromIndexRef.current = null;
|
|
4353
|
+
setDraggingIndex(null);
|
|
4354
|
+
setDropTarget(null);
|
|
4355
|
+
};
|
|
4347
4356
|
const handleMouseUp = () => {
|
|
4348
4357
|
const fromIndex = fromIndexRef.current;
|
|
4349
4358
|
const nextDropTarget = dropTarget;
|
|
4350
4359
|
if (fromIndex != null && nextDropTarget != null && items[nextDropTarget.index]) {
|
|
4351
4360
|
const insertionIndex = getInsertionIndex(items, nextDropTarget, () => 1);
|
|
4352
|
-
const nextItems =
|
|
4361
|
+
const nextItems = depthEnabled ? moveWithDepth(items, fromIndex, nextDropTarget, readDepth, setDepth, maxDepth) : reorder(
|
|
4353
4362
|
items,
|
|
4354
4363
|
fromIndex,
|
|
4355
4364
|
insertionIndex > fromIndex ? insertionIndex - 1 : insertionIndex
|
|
4356
4365
|
);
|
|
4357
4366
|
if (nextItems !== items) onChange?.(nextItems);
|
|
4358
4367
|
}
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4368
|
+
cancelDrag();
|
|
4369
|
+
};
|
|
4370
|
+
const handleKeyDown = (event) => {
|
|
4371
|
+
if (event.key === "Escape") cancelDrag();
|
|
4362
4372
|
};
|
|
4363
4373
|
window.addEventListener("mousemove", handleMouseMove);
|
|
4364
4374
|
window.addEventListener("mouseup", handleMouseUp);
|
|
4375
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
4365
4376
|
return () => {
|
|
4366
4377
|
window.removeEventListener("mousemove", handleMouseMove);
|
|
4367
4378
|
window.removeEventListener("mouseup", handleMouseUp);
|
|
4379
|
+
window.removeEventListener("keydown", handleKeyDown);
|
|
4368
4380
|
};
|
|
4369
4381
|
}, [
|
|
4370
4382
|
draggingIndex,
|
|
@@ -4373,7 +4385,7 @@ function SDraggableListInner({
|
|
|
4373
4385
|
onChange,
|
|
4374
4386
|
dragContext,
|
|
4375
4387
|
getDepth,
|
|
4376
|
-
|
|
4388
|
+
depthEnabled,
|
|
4377
4389
|
readDepth,
|
|
4378
4390
|
setDepth,
|
|
4379
4391
|
maxDepth,
|
|
@@ -4387,8 +4399,18 @@ function SDraggableListInner({
|
|
|
4387
4399
|
const currentDropIntent = dragContext ? void 0 : dropTarget?.intent;
|
|
4388
4400
|
const isDropTarget = dragContext ? groupDrop?.group === dragGroup && groupDrop?.listId === listId : draggingIndex != null;
|
|
4389
4401
|
const showEmptyDrop = Boolean(dragContext && isDropTarget && items.length === 0);
|
|
4390
|
-
const
|
|
4391
|
-
|
|
4402
|
+
const beforeIndicatorStyle = (depth) => ({
|
|
4403
|
+
borderTop: "2px solid var(--sys-color-fg-accentLight)",
|
|
4404
|
+
left: getIndicatorOffset(depth),
|
|
4405
|
+
right: 0,
|
|
4406
|
+
top: useGap ? -5 : 0
|
|
4407
|
+
});
|
|
4408
|
+
const afterIndicatorStyle = (depth) => ({
|
|
4409
|
+
borderTop: "2px solid var(--sys-color-fg-accentLight)",
|
|
4410
|
+
bottom: useGap ? -5 : -1,
|
|
4411
|
+
left: getIndicatorOffset(depth),
|
|
4412
|
+
right: 0
|
|
4413
|
+
});
|
|
4392
4414
|
const setListRef = (node) => {
|
|
4393
4415
|
listRef.current = node;
|
|
4394
4416
|
if (dragContext && dragGroup && listId) {
|
|
@@ -4409,15 +4431,15 @@ function SDraggableListInner({
|
|
|
4409
4431
|
ref: setListRef,
|
|
4410
4432
|
...rest,
|
|
4411
4433
|
useGap,
|
|
4412
|
-
className: `${className ?? ""} ${dragContext ? "min-h-[40px]" : ""} ${showEmptyDrop ? "relative before:absolute before:left-0 before:right-0 before:top-0 before:z-10 before:h-[2px] before:bg-(--sys-color-
|
|
4434
|
+
className: `${className ?? ""} ${dragContext ? "min-h-[40px]" : ""} ${showEmptyDrop ? "relative before:absolute before:left-0 before:right-0 before:top-0 before:z-10 before:h-[2px] before:bg-(--sys-color-fg-accentLight) before:content-['']" : ""}`,
|
|
4413
4435
|
"data-draggable-group": dragContext ? dragGroup : void 0,
|
|
4414
4436
|
"data-draggable-list-id": dragContext ? listId : void 0,
|
|
4415
4437
|
children: items.map((item2, index) => {
|
|
4416
4438
|
const itemKey = getKey(item2, index);
|
|
4417
|
-
const disabled = (getDisabled?.(item2, index) ?? false) || isDescendant(items, index, draggedSubtreeStart,
|
|
4418
|
-
const depth = readDepth(item2, index);
|
|
4439
|
+
const disabled = (getDisabled?.(item2, index) ?? false) || isDescendant(items, index, draggedSubtreeStart, depthEnabled ? readDepth : void 0);
|
|
4440
|
+
const depth = depthEnabled ? readDepth(item2, index) : 1;
|
|
4419
4441
|
const showBefore = isDropTarget && currentDropIndex === index && (dragContext || currentDropIntent === "before");
|
|
4420
|
-
const showInside = isDropTarget && currentDropIndex === index && !dragContext &&
|
|
4442
|
+
const showInside = isDropTarget && currentDropIndex === index && !dragContext && depthEnabled && currentDropIntent === "inside";
|
|
4421
4443
|
const showAfter = isDropTarget && (dragContext ? currentDropIndex === items.length && index === items.length - 1 : currentDropIndex === index && currentDropIntent === "after");
|
|
4422
4444
|
const selectItem = () => {
|
|
4423
4445
|
if (disabled) return;
|
|
@@ -4429,7 +4451,7 @@ function SDraggableListInner({
|
|
|
4429
4451
|
event.preventDefault();
|
|
4430
4452
|
selectItem();
|
|
4431
4453
|
};
|
|
4432
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
4454
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4433
4455
|
"div",
|
|
4434
4456
|
{
|
|
4435
4457
|
"data-draggable-list-item": true,
|
|
@@ -4438,18 +4460,49 @@ function SDraggableListInner({
|
|
|
4438
4460
|
"aria-disabled": disabled || void 0,
|
|
4439
4461
|
onClick: selectItem,
|
|
4440
4462
|
onKeyDown: handleItemKeyDown,
|
|
4441
|
-
className:
|
|
4442
|
-
children:
|
|
4443
|
-
|
|
4444
|
-
|
|
4445
|
-
|
|
4446
|
-
|
|
4447
|
-
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
|
|
4463
|
+
className: "relative",
|
|
4464
|
+
children: [
|
|
4465
|
+
showBefore && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4466
|
+
"span",
|
|
4467
|
+
{
|
|
4468
|
+
"aria-hidden": "true",
|
|
4469
|
+
"data-draggable-drop-indicator": "before",
|
|
4470
|
+
className: "pointer-events-none absolute z-10",
|
|
4471
|
+
style: beforeIndicatorStyle(depth)
|
|
4472
|
+
}
|
|
4473
|
+
),
|
|
4474
|
+
showAfter && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4475
|
+
"span",
|
|
4476
|
+
{
|
|
4477
|
+
"aria-hidden": "true",
|
|
4478
|
+
"data-draggable-drop-indicator": "after",
|
|
4479
|
+
className: "pointer-events-none absolute z-10",
|
|
4480
|
+
style: afterIndicatorStyle(depth)
|
|
4481
|
+
}
|
|
4482
|
+
),
|
|
4483
|
+
showInside && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4484
|
+
"span",
|
|
4485
|
+
{
|
|
4486
|
+
"aria-hidden": "true",
|
|
4487
|
+
"data-draggable-drop-indicator": "inside",
|
|
4488
|
+
className: "pointer-events-none absolute inset-0 z-10",
|
|
4489
|
+
style: {
|
|
4490
|
+
border: "2px solid var(--sys-color-fg-accentLight)"
|
|
4491
|
+
}
|
|
4492
|
+
}
|
|
4493
|
+
),
|
|
4494
|
+
renderItem(item2, index, {
|
|
4495
|
+
onDragHandleMouseDown: (event) => {
|
|
4496
|
+
if (disabled) return;
|
|
4497
|
+
if (dragContext && dragGroup && listId) {
|
|
4498
|
+
dragContext.startDrag(event, dragGroup, listId, index, itemKey);
|
|
4499
|
+
} else startDrag(event, index);
|
|
4500
|
+
},
|
|
4501
|
+
selected: currentSelectedKey === itemKey,
|
|
4502
|
+
disabled,
|
|
4503
|
+
depth
|
|
4504
|
+
})
|
|
4505
|
+
]
|
|
4453
4506
|
},
|
|
4454
4507
|
itemKey
|
|
4455
4508
|
);
|
|
@@ -4922,6 +4975,7 @@ var STag = /* @__PURE__ */ react.forwardRef(function STag2({
|
|
|
4922
4975
|
shape = "square",
|
|
4923
4976
|
size = "sm",
|
|
4924
4977
|
color = "grey",
|
|
4978
|
+
deep = false,
|
|
4925
4979
|
label = "",
|
|
4926
4980
|
icon,
|
|
4927
4981
|
iconLeft = true,
|
|
@@ -4931,7 +4985,8 @@ var STag = /* @__PURE__ */ react.forwardRef(function STag2({
|
|
|
4931
4985
|
...rest
|
|
4932
4986
|
}, ref) {
|
|
4933
4987
|
const s = TAG_SIZE_CONFIG[size];
|
|
4934
|
-
const contentColor = `var(--cmp-tag-${color}-content)`;
|
|
4988
|
+
const contentColor = deep ? `var(--cmp-tag-${color}-deep-content, var(--cmp-tag-deep-content))` : `var(--cmp-tag-${color}-content)`;
|
|
4989
|
+
const bgColor = deep ? `var(--cmp-tag-${color}-deep-bg)` : `var(--cmp-tag-${color}-bg)`;
|
|
4935
4990
|
const iconNode = icon ? /* @__PURE__ */ jsxRuntime.jsx(SIcon, { name: icon, size: s.iconSize, color: contentColor }) : null;
|
|
4936
4991
|
const resolvedWidth = typeof width === "number" ? `${width}px` : width;
|
|
4937
4992
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -4951,7 +5006,7 @@ var STag = /* @__PURE__ */ react.forwardRef(function STag2({
|
|
|
4951
5006
|
fontSize: s.fontSize,
|
|
4952
5007
|
fontWeight: s.fontWeight,
|
|
4953
5008
|
lineHeight: `${s.lineHeight}px`,
|
|
4954
|
-
background:
|
|
5009
|
+
background: bgColor,
|
|
4955
5010
|
color: contentColor,
|
|
4956
5011
|
...resolvedWidth != null ? { width: resolvedWidth } : {},
|
|
4957
5012
|
...style
|
|
@@ -6202,11 +6257,12 @@ var FILL_COLOR = {
|
|
|
6202
6257
|
};
|
|
6203
6258
|
var clamp2 = (v) => Number.isFinite(v) ? Math.max(0, Math.min(100, v)) : 0;
|
|
6204
6259
|
var SLinearProgress = /* @__PURE__ */ react.forwardRef(
|
|
6205
|
-
function SLinearProgress2({ value = 0, type = "primary", indeterminate = false, label, className, style }, ref) {
|
|
6260
|
+
function SLinearProgress2({ value = 0, type = "primary", size = "sm", indeterminate = false, label, className, style }, ref) {
|
|
6206
6261
|
const v = clamp2(value);
|
|
6207
6262
|
const fill = FILL_COLOR[type];
|
|
6208
6263
|
const valueColor = v === 0 ? "var(--sys-color-fg-tertiary, #888888)" : fill;
|
|
6209
6264
|
const valueText = `${Math.round(v)}%`;
|
|
6265
|
+
const showValue = !indeterminate && size !== "xs";
|
|
6210
6266
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6211
6267
|
"div",
|
|
6212
6268
|
{
|
|
@@ -6214,36 +6270,43 @@ var SLinearProgress = /* @__PURE__ */ react.forwardRef(
|
|
|
6214
6270
|
className: cn("flex w-full flex-col gap-[12px]", className),
|
|
6215
6271
|
style,
|
|
6216
6272
|
children: [
|
|
6217
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6218
|
-
|
|
6219
|
-
|
|
6220
|
-
|
|
6221
|
-
|
|
6222
|
-
|
|
6223
|
-
|
|
6273
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6274
|
+
"div",
|
|
6275
|
+
{
|
|
6276
|
+
className: "relative w-full overflow-hidden rounded-full bg-[var(--cmp-progress-color-track)]",
|
|
6277
|
+
style: { height: `var(--cmp-progress-linear-height-${size})` },
|
|
6278
|
+
children: [
|
|
6279
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6280
|
+
"div",
|
|
6281
|
+
{
|
|
6282
|
+
className: cn(
|
|
6283
|
+
"absolute inset-y-0 left-0 h-full rounded-[inherit]",
|
|
6284
|
+
indeterminate ? "w-full origin-left animate-linear-indeterminate" : "transition-[width] duration-[400ms] ease-linear"
|
|
6285
|
+
),
|
|
6286
|
+
style: { background: fill, width: indeterminate ? void 0 : `${v}%` }
|
|
6287
|
+
}
|
|
6224
6288
|
),
|
|
6225
|
-
|
|
6226
|
-
|
|
6227
|
-
|
|
6228
|
-
|
|
6229
|
-
|
|
6230
|
-
|
|
6231
|
-
|
|
6232
|
-
|
|
6233
|
-
|
|
6234
|
-
|
|
6235
|
-
|
|
6236
|
-
|
|
6237
|
-
|
|
6238
|
-
|
|
6239
|
-
|
|
6240
|
-
|
|
6241
|
-
|
|
6242
|
-
|
|
6243
|
-
|
|
6244
|
-
|
|
6245
|
-
|
|
6246
|
-
] }),
|
|
6289
|
+
showValue && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
6290
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6291
|
+
"span",
|
|
6292
|
+
{
|
|
6293
|
+
className: "pointer-events-none absolute inset-x-0 top-1/2 -translate-y-1/2 select-none text-center text-[12px] font-bold leading-[20px]",
|
|
6294
|
+
style: { color: valueColor },
|
|
6295
|
+
children: valueText
|
|
6296
|
+
}
|
|
6297
|
+
),
|
|
6298
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6299
|
+
"span",
|
|
6300
|
+
{
|
|
6301
|
+
className: "pointer-events-none absolute inset-x-0 top-1/2 -translate-y-1/2 select-none text-center text-[12px] font-bold leading-[20px] text-[color:var(--cmp-progress-bar-text)]",
|
|
6302
|
+
style: { clipPath: `inset(0 ${100 - v}% 0 0)` },
|
|
6303
|
+
children: valueText
|
|
6304
|
+
}
|
|
6305
|
+
)
|
|
6306
|
+
] })
|
|
6307
|
+
]
|
|
6308
|
+
}
|
|
6309
|
+
),
|
|
6247
6310
|
label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-center text-[12px] font-normal leading-[20px] text-[color:var(--cmp-progress-color-label)]", children: label })
|
|
6248
6311
|
]
|
|
6249
6312
|
}
|
|
@@ -15335,6 +15398,11 @@ var SForm = /* @__PURE__ */ react.forwardRef(function SForm2({ formClass, onSubm
|
|
|
15335
15398
|
}
|
|
15336
15399
|
) });
|
|
15337
15400
|
});
|
|
15401
|
+
var SIZE_CONFIG2 = {
|
|
15402
|
+
xs: { fontSize: 12, lineHeight: 20, radius: "var(--cmp-radioButton-radius-sm)" },
|
|
15403
|
+
sm: { fontSize: 12, lineHeight: 20, radius: "var(--cmp-radioButton-radius-sm)" },
|
|
15404
|
+
md: { fontSize: 16, lineHeight: 26, radius: "var(--cmp-radioButton-radius-md)" }
|
|
15405
|
+
};
|
|
15338
15406
|
function SRadioButton({
|
|
15339
15407
|
options = [],
|
|
15340
15408
|
value,
|
|
@@ -15345,6 +15413,7 @@ function SRadioButton({
|
|
|
15345
15413
|
className,
|
|
15346
15414
|
style
|
|
15347
15415
|
}) {
|
|
15416
|
+
const s = SIZE_CONFIG2[size];
|
|
15348
15417
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
15349
15418
|
"div",
|
|
15350
15419
|
{
|
|
@@ -15355,6 +15424,8 @@ function SRadioButton({
|
|
|
15355
15424
|
children: options.map((o, i) => {
|
|
15356
15425
|
const selected = o.value === value;
|
|
15357
15426
|
const od = disabled || o.disabled;
|
|
15427
|
+
const first = i === 0;
|
|
15428
|
+
const last = i === options.length - 1;
|
|
15358
15429
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
15359
15430
|
"button",
|
|
15360
15431
|
{
|
|
@@ -15365,9 +15436,8 @@ function SRadioButton({
|
|
|
15365
15436
|
disabled: od,
|
|
15366
15437
|
onClick: () => !od && !selected && onValueChange?.(o.value),
|
|
15367
15438
|
className: cn(
|
|
15368
|
-
"relative box-border grow inline-flex items-center justify-center whitespace-nowrap border border-solid
|
|
15369
|
-
|
|
15370
|
-
i === options.length - 1 ? "rounded-r-[var(--cmp-radioButton-radius)]" : "",
|
|
15439
|
+
"relative box-border grow inline-flex items-center justify-center whitespace-nowrap border border-solid font-medium transition-colors",
|
|
15440
|
+
first ? "" : "-ml-px",
|
|
15371
15441
|
selected ? "z-10" : "",
|
|
15372
15442
|
!od && !selected && "hover:!bg-[var(--cmp-radioButton-bg-hover)] hover:!text-[color:var(--cmp-radioButton-content-hover)] hover:!border-[color:var(--cmp-radioButton-bg-hover)] hover:z-10",
|
|
15373
15443
|
od ? "cursor-not-allowed" : "cursor-pointer"
|
|
@@ -15375,6 +15445,14 @@ function SRadioButton({
|
|
|
15375
15445
|
style: {
|
|
15376
15446
|
height: `var(--cmp-radioButton-${size}-height)`,
|
|
15377
15447
|
padding: `0 var(--cmp-radioButton-${size}-paddingX)`,
|
|
15448
|
+
fontSize: `${s.fontSize}px`,
|
|
15449
|
+
lineHeight: `${s.lineHeight}px`,
|
|
15450
|
+
borderRadius: [
|
|
15451
|
+
first ? s.radius : "0",
|
|
15452
|
+
last ? s.radius : "0",
|
|
15453
|
+
last ? s.radius : "0",
|
|
15454
|
+
first ? s.radius : "0"
|
|
15455
|
+
].join(" "),
|
|
15378
15456
|
background: od ? "var(--cmp-radioButton-bg-disabled)" : "var(--cmp-radioButton-bg-default)",
|
|
15379
15457
|
borderColor: od ? "var(--cmp-radioButton-border-disabled)" : selected ? "var(--cmp-radioButton-border-select)" : "var(--cmp-radioButton-border-default)",
|
|
15380
15458
|
color: od ? "var(--cmp-radioButton-content-disabled)" : selected ? "var(--cmp-radioButton-content-select)" : "var(--cmp-radioButton-content-default)"
|