fis-component 0.0.64 → 0.0.66

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.
@@ -18,6 +18,10 @@ export interface ButtonProps extends ComponentPropsWithoutRef<"button"> {
18
18
  * Defines the type of the button.
19
19
  */
20
20
  underline?: boolean;
21
+ /**
22
+ * If true, text will be truncated with ellipsis on single line
23
+ */
24
+ singleLine?: boolean;
21
25
  }
22
26
  declare const FISLinkButton: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
23
27
  export default FISLinkButton;
@@ -3,6 +3,7 @@ interface ButtonProps {
3
3
  $variant?: ButtonVariant;
4
4
  $size: ButtonSize;
5
5
  $underline?: boolean;
6
+ $singleLine?: boolean;
6
7
  }
7
8
  export declare const LinkButtonStyled: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, ButtonProps>> & string;
8
9
  export declare const IconStyled: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
@@ -11,6 +11,8 @@ export interface SelectFieldProps extends Omit<ComponentPropsWithoutRef<"input">
11
11
  actived?: boolean;
12
12
  /**active-dropdown for current field*/
13
13
  activeDropdown?: boolean;
14
+ /**negative for current field*/
15
+ negative?: boolean;
14
16
  }
15
17
  declare const FISSelectItem: import("react").ForwardRefExoticComponent<SelectFieldProps & import("react").RefAttributes<HTMLInputElement>>;
16
18
  export default FISSelectItem;
package/dist/esm/index.js CHANGED
@@ -60832,6 +60832,15 @@ const LinkButtonStyled = styled.button `
60832
60832
  css `
60833
60833
  text-decoration: underline;
60834
60834
  `}
60835
+
60836
+ ${(props) => props.$singleLine &&
60837
+ css `
60838
+ .button-content {
60839
+ white-space: nowrap;
60840
+ overflow: hidden;
60841
+ text-overflow: ellipsis;
60842
+ }
60843
+ `}
60835
60844
  `;
60836
60845
  const IconStyled$1 = styled.span `
60837
60846
  display: inline-flex;
@@ -60839,10 +60848,10 @@ const IconStyled$1 = styled.span `
60839
60848
  `;
60840
60849
 
60841
60850
  const FISLinkButton = forwardRef((props, ref) => {
60842
- const { type, children, size = "sm", variant = "default", underline, startIcon: startIconProp, endIcon: endIconProp, ...rest } = props;
60851
+ const { children, size = "sm", variant = "default", underline, startIcon: startIconProp, endIcon: endIconProp, singleLine = false, ...rest } = props;
60843
60852
  const startIcon = startIconProp && (jsx(IconStyled$1, { className: "button-icon", children: startIconProp }));
60844
60853
  const endIcon = endIconProp && (jsx(IconStyled$1, { className: "button-icon", children: endIconProp }));
60845
- return (jsxs(LinkButtonStyled, { ...rest, ref: ref, "$variant": variant, "$size": size, "$underline": underline, children: [startIcon, jsx("span", { className: "button-content", children: children }), endIcon] }));
60854
+ return (jsxs(LinkButtonStyled, { ...rest, ref: ref, "$variant": variant, "$size": size, "$underline": underline, "$singleLine": singleLine, children: [startIcon, jsx("span", { className: "button-content", children: children }), endIcon] }));
60846
60855
  });
60847
60856
  FISLinkButton.displayName = "FISLinkButton";
60848
60857
 
@@ -61456,7 +61465,7 @@ function FISProgressCircular({ variant, ...rest }) {
61456
61465
  FISProgressCircular.displayName = "FISProgressCircular";
61457
61466
 
61458
61467
  const FISIconButton = forwardRef((props, ref) => {
61459
- const { type, children, active = false, size = "md", variant = "primary", icon: iconProp, loading = false, disabled = false, ...rest } = props;
61468
+ const { children, active = false, size = "md", variant = "primary", icon: iconProp, loading = false, disabled = false, ...rest } = props;
61460
61469
  return (jsx(ButtonStyled, { type: "button", ...rest, ref: ref, "$variant": variant, "$size": size, "$active": active, "$loading": loading, disabled: disabled || loading, children: loading ? (jsx(FISProgressCircular, { size: size, variant: "indeterminate", invert: variant === "primary-white" ||
61461
61470
  variant === "secondary-white" ||
61462
61471
  variant === "secondary-invisible-white" })) : (iconProp) }));
@@ -62377,10 +62386,10 @@ const ProgressCircularSC$1 = styled(FISProgressCircular) `
62377
62386
  `;
62378
62387
 
62379
62388
  const FISButton = forwardRef((props, ref) => {
62380
- const { active, type, children, size = "md", variant = "primary", loading, disabled = false, startIcon: startIconProp, endIcon: endIconProp, ...rest } = props;
62389
+ const { active, children, size = "md", variant = "primary", loading, disabled = false, startIcon: startIconProp, endIcon: endIconProp, ...rest } = props;
62381
62390
  const startIcon = startIconProp && jsx(SpanIconSC$2, { children: startIconProp });
62382
62391
  const endIcon = endIconProp && jsx(SpanIconSC$2, { children: endIconProp });
62383
- return (jsxs(ButtonSC, { type: "button", ...rest, ref: ref, "$variant": variant, "$size": size, "$active": active, "$loading": loading, disabled: disabled || loading, children: [loading && (jsx(ProgressCircularSC$1, { size: size, variant: "indeterminate", invert: variant === "primary-white" || variant === "secondary-white" })), startIcon, jsx("span", { className: "button-content", children: children }), endIcon] }));
62392
+ return (jsxs(ButtonSC, { ...rest, ref: ref, "$variant": variant, "$size": size, "$active": active, "$loading": loading, disabled: disabled || loading, children: [loading && (jsx(ProgressCircularSC$1, { size: size, variant: "indeterminate", invert: variant === "primary-white" || variant === "secondary-white" })), startIcon, jsx("span", { className: "button-content", children: children }), endIcon] }));
62384
62393
  });
62385
62394
  FISButton.displayName = "FISButton";
62386
62395
 
@@ -73291,12 +73300,35 @@ const DivContainerSC = styled.div `
73291
73300
  color: ${getTheme("com/select/field/default/icon/color-icon/active")};
73292
73301
  }
73293
73302
  }
73303
+
73304
+ // Design chưa có negative
73305
+ &.negative {
73306
+ outline-color: ${getTheme("com/input/field/negative/border/default")};
73307
+ background-color: ${getTheme("com/input/field/negative/background/default")};
73308
+
73309
+ &:hover {
73310
+ outline-color: ${getTheme("com/input/field/negative/border/hover")};
73311
+ background-color: ${getTheme("com/input/field/negative/background/hover")};
73312
+ }
73313
+
73314
+ &:has(${InputSC}:focus) {
73315
+ outline-color: ${getTheme("com/input/field/negative/border/active")};
73316
+ background-color: ${getTheme("com/input/field/negative/background/active")};
73317
+ box-shadow: 0 0 0 ${getTheme("com/actived-mark/gap-spacing")}
73318
+ ${getTheme("com/actived-mark/color-gap-spacing-negative")};
73319
+ }
73320
+
73321
+ &::placeholder {
73322
+ color: ${getTheme("com/input/field/negative/label/color-text/placeholder")};
73323
+ }
73324
+ }
73294
73325
  `;
73295
73326
 
73296
73327
  const FISSelectItem = forwardRef((props, ref) => {
73297
- const { size = "md", iconPrefix, iconSuffix, disabled, activeDropdown, ...rest } = props;
73328
+ const { size = "md", iconPrefix, iconSuffix, disabled, activeDropdown, negative, ...rest } = props;
73298
73329
  return (jsx(DivContainerSC, { className: classNames({
73299
73330
  iconPrefix: iconPrefix,
73331
+ negative: negative,
73300
73332
  }), "$size": size, children: jsxs(DivWrapperSC, { children: [iconPrefix && (jsx(DivIconPrefixSC, { "$size": size, children: iconPrefix })), jsx(InputSC, { ...rest, ref: ref, disabled: disabled, "$size": size }), iconSuffix && (jsx(DivIconSuffixSC, { "$size": size, children: iconSuffix }))] }) }));
73301
73333
  });
73302
73334
  FISSelectItem.displayName = "FISSelectItem";
@@ -73440,7 +73472,7 @@ const FISSelect = forwardRef(({ className, style, size = "md", options, value, d
73440
73472
  document.addEventListener("mousedown", handleClickOutside);
73441
73473
  return () => document.removeEventListener("mousedown", handleClickOutside);
73442
73474
  }, [referenceElement, popperElement]);
73443
- return (jsxs(DivWrapperSC$1, { className: className, style: style, children: [(textLabel || iconLabel) && (jsx(FISInputLabel, { textLabel: textLabel, required: required, iconLabel: iconLabel, onClickIconLabel: onClickIconLabel })), jsx(DivInputWrapperSC, { ref: setReferenceElement, onClick: handleToggle, children: jsx(FISSelectItem, { ...restProps, ref: ref, size: size, iconSuffix: isOpen ? jsx(ArrowUpIcon, {}) : jsx(ArrowDownIcon, {}), value: computedDisplayValue(), disabled: disabled, activeDropdown: isOpen }) }), message && (jsx(SpanHintSC$3, { className: classNames({ disabled, negative, positive }), children: message })), multi && value.length > 0 && (jsx(SelectedTagsWrapper, { children: jsx(MultipleValue, { options: selectedItems, onRemove: handleOptionRemove }) })), isOpen && (jsx(Portal, { portal: portal, children: jsx(DivDropdownMenuSC, { ref: setPopperElement, style: {
73475
+ return (jsxs(DivWrapperSC$1, { className: className, style: style, children: [(textLabel || iconLabel) && (jsx(FISInputLabel, { textLabel: textLabel, required: required, iconLabel: iconLabel, onClickIconLabel: onClickIconLabel })), jsx(DivInputWrapperSC, { ref: setReferenceElement, onClick: handleToggle, children: jsx(FISSelectItem, { ...restProps, ref: ref, size: size, iconSuffix: isOpen ? jsx(ArrowUpIcon, {}) : jsx(ArrowDownIcon, {}), value: computedDisplayValue(), disabled: disabled, activeDropdown: isOpen, negative: negative }) }), message && (jsx(SpanHintSC$3, { className: classNames({ disabled, negative, positive }), children: message })), multi && value.length > 0 && (jsx(SelectedTagsWrapper, { children: jsx(MultipleValue, { options: selectedItems, onRemove: handleOptionRemove }) })), isOpen && (jsx(Portal, { portal: portal, children: jsx(DivDropdownMenuSC, { ref: setPopperElement, style: {
73444
73476
  ...styles.popper,
73445
73477
  width: referenceElement?.offsetWidth,
73446
73478
  zIndex: 9999,