@underverse-ui/underverse 1.0.206 → 1.0.208

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,8 +1,8 @@
1
1
  {
2
2
  "package": "@underverse-ui/underverse",
3
- "version": "1.0.206",
3
+ "version": "1.0.208",
4
4
  "sourceEntry": "src/index.ts",
5
- "totalExports": 252,
5
+ "totalExports": 256,
6
6
  "exports": [
7
7
  {
8
8
  "name": "*",
@@ -1121,6 +1121,13 @@
1121
1121
  "reexport": true,
1122
1122
  "local": false
1123
1123
  },
1124
+ {
1125
+ "name": "RadioButtonGroup",
1126
+ "kind": "value",
1127
+ "source": "./components/RadioGroup",
1128
+ "reexport": true,
1129
+ "local": false
1130
+ },
1124
1131
  {
1125
1132
  "name": "RadioGroup",
1126
1133
  "kind": "value",
@@ -1171,6 +1178,13 @@
1171
1178
  "local": false,
1172
1179
  "aliasOf": "default"
1173
1180
  },
1181
+ {
1182
+ "name": "SegmentedControl",
1183
+ "kind": "value",
1184
+ "source": "./components/RadioGroup",
1185
+ "reexport": true,
1186
+ "local": false
1187
+ },
1174
1188
  {
1175
1189
  "name": "SelectDropdown",
1176
1190
  "kind": "value",
@@ -1241,6 +1255,13 @@
1241
1255
  "reexport": true,
1242
1256
  "local": false
1243
1257
  },
1258
+ {
1259
+ "name": "SimpleRadioGroup",
1260
+ "kind": "value",
1261
+ "source": "./components/RadioGroup",
1262
+ "reexport": true,
1263
+ "local": false
1264
+ },
1244
1265
  {
1245
1266
  "name": "SimpleTabs",
1246
1267
  "kind": "value",
@@ -1491,6 +1512,13 @@
1491
1512
  "local": false,
1492
1513
  "aliasOf": "default"
1493
1514
  },
1515
+ {
1516
+ "name": "ToggleGroup",
1517
+ "kind": "value",
1518
+ "source": "./components/RadioGroup",
1519
+ "reexport": true,
1520
+ "local": false
1521
+ },
1494
1522
  {
1495
1523
  "name": "Tooltip",
1496
1524
  "kind": "value",
package/dist/index.cjs CHANGED
@@ -9390,17 +9390,20 @@ __export(src_exports, {
9390
9390
  Popover: () => Popover,
9391
9391
  Progress: () => Progress,
9392
9392
  PulseBadge: () => PulseBadge,
9393
+ RadioButtonGroup: () => RadioButtonGroup,
9393
9394
  RadioGroup: () => RadioGroup,
9394
9395
  RadioGroupItem: () => RadioGroupItem,
9395
9396
  SIZE_STYLES_BTN: () => SIZE_STYLES_BTN,
9396
9397
  ScrollArea: () => ScrollArea,
9397
9398
  SearchInput: () => SearchInput,
9398
9399
  Section: () => Section_default,
9400
+ SegmentedControl: () => SegmentedControl,
9399
9401
  SegmentedProgress: () => SegmentedProgress,
9400
9402
  SelectDropdown: () => SelectDropdown,
9401
9403
  Sheet: () => Sheet,
9402
9404
  SidebarSheet: () => SidebarSheet,
9403
9405
  SimplePagination: () => SimplePagination,
9406
+ SimpleRadioGroup: () => SimpleRadioGroup,
9404
9407
  SimpleTabs: () => SimpleTabs,
9405
9408
  Skeleton: () => Skeleton_default,
9406
9409
  SkeletonAvatar: () => SkeletonAvatar,
@@ -9437,6 +9440,7 @@ __export(src_exports, {
9437
9440
  Timeline: () => Timeline_default,
9438
9441
  TimelineItem: () => TimelineItem,
9439
9442
  ToastProvider: () => Toast_default,
9443
+ ToggleGroup: () => ToggleGroup,
9440
9444
  Tooltip: () => Tooltip,
9441
9445
  TranslationProvider: () => TranslationProvider,
9442
9446
  UEditor: () => UEditor_default,
@@ -25166,6 +25170,158 @@ var RadioGroupItem = React47.forwardRef(
25166
25170
  }
25167
25171
  );
25168
25172
  RadioGroupItem.displayName = "RadioGroupItem";
25173
+ var SimpleRadioGroup = ({
25174
+ items,
25175
+ value,
25176
+ defaultValue,
25177
+ onValueChange,
25178
+ name,
25179
+ disabled = false,
25180
+ orientation = "vertical",
25181
+ size = "md",
25182
+ variant = "default",
25183
+ borderMode,
25184
+ className,
25185
+ required = false,
25186
+ error = false,
25187
+ errorMessage
25188
+ }) => {
25189
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
25190
+ RadioGroup,
25191
+ {
25192
+ value,
25193
+ defaultValue,
25194
+ onValueChange,
25195
+ name,
25196
+ disabled,
25197
+ orientation,
25198
+ size,
25199
+ variant,
25200
+ borderMode,
25201
+ className,
25202
+ required,
25203
+ error,
25204
+ errorMessage,
25205
+ children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
25206
+ RadioGroupItem,
25207
+ {
25208
+ value: item.value,
25209
+ label: item.label,
25210
+ description: item.description,
25211
+ disabled: item.disabled,
25212
+ icon: item.icon
25213
+ },
25214
+ item.value
25215
+ ))
25216
+ }
25217
+ );
25218
+ };
25219
+ var RadioButtonGroup = ({
25220
+ items,
25221
+ value,
25222
+ defaultValue,
25223
+ onValueChange,
25224
+ name,
25225
+ disabled = false,
25226
+ size = "md",
25227
+ variant = "default",
25228
+ borderMode,
25229
+ className,
25230
+ fullWidth = false
25231
+ }) => {
25232
+ const globalConfig = useUnderverseUIConfig();
25233
+ const resolvedBorderMode = borderMode ?? globalConfig.input?.borderMode ?? globalConfig.borderMode ?? "full";
25234
+ const [internalValue, setInternalValue] = React47.useState(defaultValue || "");
25235
+ const isControlled = value !== void 0;
25236
+ const currentValue = isControlled ? value : internalValue;
25237
+ const handleValueChange = (newValue) => {
25238
+ if (!disabled) {
25239
+ if (!isControlled) {
25240
+ setInternalValue(newValue);
25241
+ }
25242
+ onValueChange?.(newValue);
25243
+ }
25244
+ };
25245
+ const sizeClasses2 = {
25246
+ sm: "px-3 py-1.5 text-xs",
25247
+ md: "px-4 py-2 text-sm",
25248
+ lg: "px-6 py-3 text-base"
25249
+ };
25250
+ const variantClasses3 = {
25251
+ default: {
25252
+ container: "bg-muted p-1",
25253
+ base: "bg-transparent hover:bg-background/50",
25254
+ selected: "bg-background text-foreground shadow-sm"
25255
+ },
25256
+ outline: {
25257
+ container: "border border-border/50 overflow-hidden",
25258
+ base: "bg-background border-r border-border/50 hover:bg-accent",
25259
+ selected: "bg-primary text-primary-foreground border-primary"
25260
+ },
25261
+ solid: {
25262
+ container: "border border-border/50 overflow-hidden",
25263
+ base: "bg-background hover:bg-accent",
25264
+ selected: "bg-primary text-primary-foreground"
25265
+ },
25266
+ primary: {
25267
+ container: "bg-muted py-1 px-2",
25268
+ base: "bg-transparent hover:bg-background/50",
25269
+ selected: "bg-primary text-primary-foreground shadow-sm"
25270
+ }
25271
+ };
25272
+ const uniqueId = React47.useId();
25273
+ const radioName = name || `radio-button-group-${uniqueId}`;
25274
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: cn("inline-flex", variantClasses3[variant].container, getBorderRadiusClass(resolvedBorderMode), fullWidth && "w-full", className), role: "radiogroup", children: items.map((item, index) => {
25275
+ const isSelected = currentValue === item.value;
25276
+ const isDisabled = item.disabled || disabled;
25277
+ const Icon = item.icon;
25278
+ const isLast = index === items.length - 1;
25279
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
25280
+ "button",
25281
+ {
25282
+ type: "button",
25283
+ disabled: isDisabled,
25284
+ role: "radio",
25285
+ "aria-checked": isSelected,
25286
+ className: cn(
25287
+ "relative inline-flex items-center justify-center gap-2 font-medium transition-all duration-200",
25288
+ "focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",
25289
+ "disabled:cursor-not-allowed disabled:opacity-50",
25290
+ sizeClasses2[size],
25291
+ isSelected ? variantClasses3[variant].selected : variantClasses3[variant].base,
25292
+ variant === "outline" && !isLast && "border-r border-border/50",
25293
+ variant === "default" && getBorderRadiusClass(resolvedBorderMode),
25294
+ fullWidth && "flex-1"
25295
+ ),
25296
+ onClick: () => handleValueChange(item.value),
25297
+ children: [
25298
+ Icon && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Icon, { className: "w-4 h-4" }),
25299
+ item.label,
25300
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
25301
+ "input",
25302
+ {
25303
+ type: "radio",
25304
+ name: radioName,
25305
+ value: item.value,
25306
+ checked: isSelected,
25307
+ onChange: () => {
25308
+ },
25309
+ className: "sr-only",
25310
+ tabIndex: -1
25311
+ }
25312
+ )
25313
+ ]
25314
+ },
25315
+ item.value
25316
+ );
25317
+ }) });
25318
+ };
25319
+ var SegmentedControl = (props) => {
25320
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(RadioButtonGroup, { ...props, variant: "default" });
25321
+ };
25322
+ var ToggleGroup = (props) => {
25323
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(RadioButtonGroup, { ...props, variant: "outline" });
25324
+ };
25169
25325
 
25170
25326
  // src/components/Slider.tsx
25171
25327
  var React48 = __toESM(require("react"), 1);
@@ -47697,17 +47853,20 @@ function getUnderverseMessages(locale = "en") {
47697
47853
  Popover,
47698
47854
  Progress,
47699
47855
  PulseBadge,
47856
+ RadioButtonGroup,
47700
47857
  RadioGroup,
47701
47858
  RadioGroupItem,
47702
47859
  SIZE_STYLES_BTN,
47703
47860
  ScrollArea,
47704
47861
  SearchInput,
47705
47862
  Section,
47863
+ SegmentedControl,
47706
47864
  SegmentedProgress,
47707
47865
  SelectDropdown,
47708
47866
  Sheet,
47709
47867
  SidebarSheet,
47710
47868
  SimplePagination,
47869
+ SimpleRadioGroup,
47711
47870
  SimpleTabs,
47712
47871
  Skeleton,
47713
47872
  SkeletonAvatar,
@@ -47744,6 +47903,7 @@ function getUnderverseMessages(locale = "en") {
47744
47903
  Timeline,
47745
47904
  TimelineItem,
47746
47905
  ToastProvider,
47906
+ ToggleGroup,
47747
47907
  Tooltip,
47748
47908
  TranslationProvider,
47749
47909
  UEditor,