@rovula/ui 0.0.72 → 0.0.74

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.
@@ -298,3 +298,9 @@ export declare const Diabled: {
298
298
  };
299
299
  render: (args: {}) => import("react/jsx-runtime").JSX.Element;
300
300
  };
301
+ export declare const Horizontal: {
302
+ args: {
303
+ disabled: boolean;
304
+ };
305
+ render: (args: {}) => import("react/jsx-runtime").JSX.Element;
306
+ };
@@ -16,3 +16,4 @@ export declare const Leaf: StoryObj<typeof Tree>;
16
16
  export declare const HideCheckboxMode: StoryObj<typeof Tree>;
17
17
  export declare const RadioMode: StoryObj<typeof Tree>;
18
18
  export declare const CheckAll: StoryObj<typeof Tree>;
19
+ export declare const LongText: StoryObj<typeof Tree>;
@@ -34,6 +34,7 @@ export * from "./components/Toast/Toaster";
34
34
  export * from "./components/Toast/useToast";
35
35
  export * from "./components/Tree";
36
36
  export * from "./components/FocusedScrollView/FocusedScrollView";
37
+ export * from "./components/RadioGroup/RadioGroup";
37
38
  export type { ButtonProps } from "./components/Button/Button";
38
39
  export type { InputProps } from "./components/TextInput/TextInput";
39
40
  export type { DropdownProps, Options } from "./components/Dropdown/Dropdown";
@@ -1,11 +1,11 @@
1
1
  import { cva } from "class-variance-authority";
2
2
  export const labelVariant = cva([
3
- "block duration-450 transition-all px-[2px] text-input-text peer-focus:text-input-text-active",
3
+ "block cursor-pointer duration-450 transition-all px-[2px] text-foreground peer-focus:text-input-text-active",
4
4
  ], {
5
5
  variants: {
6
6
  size: {
7
7
  sm: "typography-small1",
8
- md: "typography-subtitile4",
8
+ md: "typography-subtitile2",
9
9
  lg: "typography-subtitile1",
10
10
  },
11
11
  disabled: {
@@ -31,3 +31,12 @@ export const Diabled = {
31
31
  return (_jsx("div", { className: "flex items-center space-x-2", children: _jsxs(RadioGroup, { defaultValue: "option-one", disabled: true, children: [_jsxs("div", { className: "flex items-center space-x-2", children: [_jsx(RadioGroupItem, { value: "option-one", id: "option-one" }), _jsx(Label, { htmlFor: "option-one", children: "Option One" })] }), _jsxs("div", { className: "flex items-center space-x-2", children: [_jsx(RadioGroupItem, { value: "option-two", id: "option-two" }), _jsx(Label, { htmlFor: "option-two", children: "Option Two" })] })] }) }));
32
32
  },
33
33
  };
34
+ export const Horizontal = {
35
+ args: {
36
+ disabled: true,
37
+ },
38
+ render: (args) => {
39
+ const props = Object.assign({}, args);
40
+ return (_jsxs(RadioGroup, { defaultValue: "option1", className: "flex flex-row space-x-4", children: [_jsxs("div", { className: "flex items-center space-x-2", children: [_jsx(RadioGroupItem, { value: "option1", id: "option1" }), _jsx(Label, { htmlFor: "option1", children: "Option 1" })] }), _jsxs("div", { className: "flex items-center space-x-2", children: [_jsx(RadioGroupItem, { value: "option2", id: "option2" }), _jsx(Label, { htmlFor: "option2", children: "Option 2" })] }), _jsxs("div", { className: "flex items-center space-x-2", children: [_jsx(RadioGroupItem, { value: "option3", id: "option3" }), _jsx(Label, { htmlFor: "option3", children: "Option 3" })] })] }));
41
+ },
42
+ };
@@ -123,7 +123,7 @@ export const TextInput = forwardRef((_a, ref) => {
123
123
  ]);
124
124
  return (_jsxs("div", { className: `inline-flex flex-col ${fullwidth ? "w-full" : ""}`, children: [_jsxs("div", { className: "relative", children: [hasSearchIcon && !hasLeftSectionIcon && (_jsx("div", { className: iconSearchWrapperClassname, children: _jsx(MagnifyingGlassIcon, { className: iconClassname }) })), _jsx("input", Object.assign({}, props, { placeholder: " ", ref: inputRef, type: type, id: _id, disabled: disabled, className: cn(inputClassname, props.className) })), startIconElement, hasClearIcon && !hasRightSectionIcon && (_jsx("div", { className: iconWrapperClassname, style: {
125
125
  display: keepCloseIconOnValue && props.value ? "flex" : undefined,
126
- }, children: _jsx(XCircleIcon, { type: "button", className: iconClassname, onMouseDown: handleClearInput }) })), endIconElement, _jsxs("label", { htmlFor: _id, className: cn(labelClassname, labelClassName), children: [label, " ", required && (_jsx("span", { className: cn("text-error", {
126
+ }, children: _jsx(XCircleIcon, { type: "button", className: iconClassname, onMouseDown: handleClearInput }) })), endIconElement, _jsxs("label", { htmlFor: _id, className: cn(labelClassname), children: [label, " ", required && (_jsx("span", { className: cn("text-error", {
127
127
  "text-input-disable-text": disabled,
128
128
  }), children: "*" }))] })] }), (errorMessage || helperText) && (_jsxs("span", { className: helperTextClassname, children: [_jsx("span", { className: "h-full", children: _jsx(ExclamationCircleIcon, { width: 16, height: 16, className: error ? "fill-error" : "" }) }), errorMessage || helperText] }))] }));
129
129
  });
@@ -222,3 +222,76 @@ export const CheckAll = {
222
222
  } }))] }));
223
223
  },
224
224
  };
225
+ export const LongText = {
226
+ args: {
227
+ data: [
228
+ {
229
+ id: "2699d80b-6772-4878-9639-75e370786e79",
230
+ title: "Level1 RUNLINE_LV_2_00000000000000000000000000000000000000000000000000000000",
231
+ children: [
232
+ {
233
+ id: "9b4511f4-ad9a-42e0-8376-60d5edbeffb3",
234
+ title: "Level1 RUNLINE_LV_3_0000000000000000000000000000000000000000000000000000",
235
+ children: [
236
+ {
237
+ id: "c8d5dfb5-6c61-482b-88fe-186eb7685479",
238
+ title: "2025-07-27_05-25-53",
239
+ children: [],
240
+ },
241
+ {
242
+ id: "81ff1dd0-b283-4f60-864e-5d814e99d903",
243
+ title: "2025-07-27_06-05-53",
244
+ children: [],
245
+ },
246
+ ],
247
+ },
248
+ ],
249
+ },
250
+ {
251
+ id: "ad79c17b-2861-431a-af0e-3f1c73164508",
252
+ title: "RUNLINE_LV_2",
253
+ children: [
254
+ {
255
+ id: "46ee87c4-4ea7-48f8-9ed9-14833e4dacc2",
256
+ title: "2025-07-27_06-25-53",
257
+ children: [],
258
+ },
259
+ {
260
+ id: "1379b081-9f7f-4d82-8470-8321d9b7de0c",
261
+ title: "RUNLINE_LV_3",
262
+ children: [
263
+ {
264
+ id: "cf9145d4-ad06-4433-8384-4c10d266a6aa",
265
+ title: "2025-07-26_19-01-31",
266
+ children: [],
267
+ },
268
+ {
269
+ id: "f247313c-01cb-4363-a390-a72b889c72d3",
270
+ title: "2025-07-26_19-11-31",
271
+ children: [],
272
+ },
273
+ {
274
+ id: "0b7c650a-0d78-4e6e-8399-5dbaeb510751",
275
+ title: "Lv4",
276
+ children: [
277
+ {
278
+ id: "88d89572-462d-46c9-b4d0-4df736117799",
279
+ title: "Lv 5",
280
+ children: [],
281
+ },
282
+ ],
283
+ },
284
+ ],
285
+ },
286
+ ],
287
+ },
288
+ ],
289
+ },
290
+ render: (args) => {
291
+ const [isCheckedAll, setIsCheckedAll] = useState(false);
292
+ const [checkedId, onCheckedId] = useState([]);
293
+ return (_jsxs("div", { className: "flex flex-col gap-4 w-full", children: [_jsxs("div", { className: "flex gap-2", children: [_jsxs(Button, { variant: "outline", onClick: () => setIsCheckedAll(!isCheckedAll), children: [isCheckedAll ? "Unchecked" : "Checked", " All"] }), _jsx(Button, { variant: "outline", onClick: () => onCheckedId([]), children: "Clear" })] }), _jsx("div", { className: "w-full max-w-[300px]", children: _jsx(Tree, Object.assign({}, args, { hierarchicalCheck: true, checkedAll: isCheckedAll, checkedId: checkedId, onCheckedChange: (state) => {
294
+ onCheckedId(Object.keys(state).filter((key) => state === null || state === void 0 ? void 0 : state[key]));
295
+ } })) })] }));
296
+ },
297
+ };
@@ -85,6 +85,6 @@ const TreeItem = ({ id, title, classes, children, isFirstLevel = false, isLeaf =
85
85
  !isLastItem &&
86
86
  ((isExpanded && (hasChildren || isLoading)) || !isExpanded) && (_jsx("div", { className: cn("flex w-[2px] h-1/2 bg-grey-150", classes === null || classes === void 0 ? void 0 : classes.branch), style: styles.branch }))] }), _jsxs("div", { className: cn("flex flex-1 items-center py-2 min-h-10", classes === null || classes === void 0 ? void 0 : classes.itemContainer), children: [!isFirstLevel && (_jsx("div", { className: cn("bg-grey-150", classes === null || classes === void 0 ? void 0 : classes.horizontalLine), style: styles.horizontalLine })), isFirstLevel && !shouldExpandButton && (_jsx("div", { className: cn("flex mr-[2px]", classes === null || classes === void 0 ? void 0 : classes.expandButton), style: styles.expandButton })), shouldExpandButton && (_jsx("div", { className: cn("flex mr-[2px]", classes === null || classes === void 0 ? void 0 : classes.expandButton), style: styles.expandButton, onClick: !isLoading && handleExpandToggle, children: _jsx(ActionButton, { variant: "icon", size: "sm", children: isLoading ? (_jsx(Loading, {})) : (_jsx(Icon, { name: isExpanded ? "chevron-down" : "chevron-right" })) }) })), shouldShowCheckbox ? (_jsx(Checkbox, { id: id, className: cn("size-[16px]", classes === null || classes === void 0 ? void 0 : classes.checkbox), checked: isChecked, disabled: disabled, onCheckedChange: (newChecked) => onCheckedChange === null || onCheckedChange === void 0 ? void 0 : onCheckedChange(id, newChecked, itemData) })) : (_jsx("div", { className: isFirstLevel && checkable
87
87
  ? cn("size-[16px]", classes === null || classes === void 0 ? void 0 : classes.checkbox)
88
- : "" })), _jsxs("div", { className: cn("ml-2 gap-1 flex flex-1 items-center text-foreground", classes === null || classes === void 0 ? void 0 : classes.item), onClick: handleOnClickItem, children: [showIcon ? customIcon || defaultIcon : null, _jsx("div", { className: cn("flex flex-1 cursor-pointer text-subtitle5 text-ellipsis", classes === null || classes === void 0 ? void 0 : classes.title), children: titleContent })] }), rightIcon] })] }), isExpanded && hasChildren && currentLevel < (maxLevel || Infinity) && (_jsxs("div", { className: cn("flex flex-row overflow-hidden", classes === null || classes === void 0 ? void 0 : classes.expandedChildrenWrapper), children: [!isFirstLevel && !isLastItem && (_jsx("div", { className: cn("flex w-[2px] h-full bg-grey-150", classes === null || classes === void 0 ? void 0 : classes.branch), style: styles.branch })), _jsx("div", { className: cn("flex flex-col overflow-hidden", classes === null || classes === void 0 ? void 0 : classes.expandedChildrenWrapperInner), style: styles.childPadding, children: children === null || children === void 0 ? void 0 : children.map((child, idx) => (_jsx(TreeItem, Object.assign({ classes: classes, isLastItem: idx === children.length - 1, checkIsExpanded: checkIsExpanded, checkIsChecked: checkIsChecked, checkAutoDisabled: checkAutoDisabled, checkIsLoading: checkIsLoading, onExpandChange: onExpandChange, onCheckedChange: onCheckedChange, renderIcon: renderIcon, renderElement: renderElement, renderTitle: renderTitle, disabled: checkAutoDisabled(child.id), showIcon: showIcon, lineSize: lineSize, horizontalLineWidth: horizontalLineWidth, expandButtonSize: expandButtonSize, spacing: spacing, notifyClickItem: notifyClickItem, maxLevel: maxLevel, currentLevel: currentLevel + 1, checkable: checkable }, child), child.id))) })] })), enableSeparatorLine && isFirstLevel && !isLastItem && (_jsx("div", { className: cn("bg-grey-150 w-full h-[2px] rounded", classes === null || classes === void 0 ? void 0 : classes.separatorLine) }))] }) }));
88
+ : "" })), _jsxs("div", { className: cn("ml-2 gap-1 flex flex-1 items-center text-foreground", classes === null || classes === void 0 ? void 0 : classes.item), onClick: handleOnClickItem, children: [showIcon ? customIcon || defaultIcon : null, _jsx("div", { className: cn("flex flex-1 cursor-pointer text-subtitle5 text-ellipsis overflow-hidden break-all text-left", classes === null || classes === void 0 ? void 0 : classes.title), children: titleContent })] }), rightIcon] })] }), isExpanded && hasChildren && currentLevel < (maxLevel || Infinity) && (_jsxs("div", { className: cn("flex flex-row overflow-hidden", classes === null || classes === void 0 ? void 0 : classes.expandedChildrenWrapper), children: [!isFirstLevel && !isLastItem && (_jsx("div", { className: cn("flex w-[2px] h-full bg-grey-150", classes === null || classes === void 0 ? void 0 : classes.branch), style: styles.branch })), _jsx("div", { className: cn("flex flex-col overflow-hidden", classes === null || classes === void 0 ? void 0 : classes.expandedChildrenWrapperInner), style: styles.childPadding, children: children === null || children === void 0 ? void 0 : children.map((child, idx) => (_jsx(TreeItem, Object.assign({ classes: classes, isLastItem: idx === children.length - 1, checkIsExpanded: checkIsExpanded, checkIsChecked: checkIsChecked, checkAutoDisabled: checkAutoDisabled, checkIsLoading: checkIsLoading, onExpandChange: onExpandChange, onCheckedChange: onCheckedChange, renderIcon: renderIcon, renderElement: renderElement, renderTitle: renderTitle, disabled: checkAutoDisabled(child.id), showIcon: showIcon, lineSize: lineSize, horizontalLineWidth: horizontalLineWidth, expandButtonSize: expandButtonSize, spacing: spacing, notifyClickItem: notifyClickItem, maxLevel: maxLevel, currentLevel: currentLevel + 1, checkable: checkable }, child), child.id))) })] })), enableSeparatorLine && isFirstLevel && !isLastItem && (_jsx("div", { className: cn("bg-grey-150 w-full h-[2px] rounded", classes === null || classes === void 0 ? void 0 : classes.separatorLine) }))] }) }));
89
89
  };
90
90
  export default TreeItem;
@@ -987,6 +987,9 @@ input[type=number] {
987
987
  min-width: -moz-fit-content;
988
988
  min-width: fit-content;
989
989
  }
990
+ .max-w-\[300px\]{
991
+ max-width: 300px;
992
+ }
990
993
  .max-w-full{
991
994
  max-width: 100%;
992
995
  }
@@ -1159,6 +1162,11 @@ input[type=number] {
1159
1162
  margin-right: calc(0.5rem * var(--tw-space-x-reverse));
1160
1163
  margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse)));
1161
1164
  }
1165
+ .space-x-4 > :not([hidden]) ~ :not([hidden]){
1166
+ --tw-space-x-reverse: 0;
1167
+ margin-right: calc(1rem * var(--tw-space-x-reverse));
1168
+ margin-left: calc(1rem * calc(1 - var(--tw-space-x-reverse)));
1169
+ }
1162
1170
  .space-y-2 > :not([hidden]) ~ :not([hidden]){
1163
1171
  --tw-space-y-reverse: 0;
1164
1172
  margin-top: calc(0.5rem * calc(1 - var(--tw-space-y-reverse)));
@@ -1209,6 +1217,9 @@ input[type=number] {
1209
1217
  .whitespace-nowrap{
1210
1218
  white-space: nowrap;
1211
1219
  }
1220
+ .break-all{
1221
+ word-break: break-all;
1222
+ }
1212
1223
  .rounded{
1213
1224
  border-radius: 0.25rem;
1214
1225
  }