@rovula/ui 0.1.1 → 0.1.2

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.
Files changed (37) hide show
  1. package/dist/cjs/bundle.css +64 -0
  2. package/dist/cjs/bundle.js +1564 -1570
  3. package/dist/cjs/bundle.js.map +1 -1
  4. package/dist/cjs/types/components/Dropdown/Dropdown.stories.d.ts +1 -0
  5. package/dist/cjs/types/components/InputFilter/InputFilter.stories.d.ts +1 -0
  6. package/dist/cjs/types/components/MaskedTextInput/MaskedTextInput.d.ts +1 -0
  7. package/dist/cjs/types/components/MaskedTextInput/MaskedTextInput.stories.d.ts +2 -0
  8. package/dist/cjs/types/components/PasswordInput/PasswordInput.stories.d.ts +1 -0
  9. package/dist/cjs/types/components/Search/Search.stories.d.ts +1 -0
  10. package/dist/cjs/types/components/TextInput/TextInput.d.ts +2 -0
  11. package/dist/cjs/types/components/TextInput/TextInput.stories.d.ts +10 -0
  12. package/dist/cjs/types/components/TextInput/TextInput.styles.d.ts +15 -0
  13. package/dist/components/PasswordInput/PasswordInput.js +2 -2
  14. package/dist/components/TextArea/TextArea.styles.js +1 -1
  15. package/dist/components/TextInput/TextInput.js +33 -24
  16. package/dist/components/TextInput/TextInput.stories.js +14 -2
  17. package/dist/components/TextInput/TextInput.styles.js +25 -10
  18. package/dist/esm/bundle.css +64 -0
  19. package/dist/esm/bundle.js +1564 -1570
  20. package/dist/esm/bundle.js.map +1 -1
  21. package/dist/esm/types/components/Dropdown/Dropdown.stories.d.ts +1 -0
  22. package/dist/esm/types/components/InputFilter/InputFilter.stories.d.ts +1 -0
  23. package/dist/esm/types/components/MaskedTextInput/MaskedTextInput.d.ts +1 -0
  24. package/dist/esm/types/components/MaskedTextInput/MaskedTextInput.stories.d.ts +2 -0
  25. package/dist/esm/types/components/PasswordInput/PasswordInput.stories.d.ts +1 -0
  26. package/dist/esm/types/components/Search/Search.stories.d.ts +1 -0
  27. package/dist/esm/types/components/TextInput/TextInput.d.ts +2 -0
  28. package/dist/esm/types/components/TextInput/TextInput.stories.d.ts +10 -0
  29. package/dist/esm/types/components/TextInput/TextInput.styles.d.ts +15 -0
  30. package/dist/index.d.ts +3 -0
  31. package/dist/src/theme/global.css +83 -0
  32. package/package.json +1 -1
  33. package/src/components/PasswordInput/PasswordInput.tsx +2 -2
  34. package/src/components/TextArea/TextArea.styles.ts +1 -1
  35. package/src/components/TextInput/TextInput.stories.tsx +60 -2
  36. package/src/components/TextInput/TextInput.styles.ts +36 -19
  37. package/src/components/TextInput/TextInput.tsx +83 -55
@@ -364,6 +364,7 @@ declare const meta: {
364
364
  src?: string | undefined | undefined;
365
365
  iconMode?: "flat" | "solid" | undefined;
366
366
  keepCloseIconOnValue?: boolean | undefined;
367
+ keepFooterSpace?: boolean | undefined;
367
368
  labelClassName?: string | undefined;
368
369
  classes?: {
369
370
  iconWrapper?: string;
@@ -351,6 +351,7 @@ declare const meta: {
351
351
  src?: string | undefined | undefined;
352
352
  iconMode?: "flat" | "solid" | undefined;
353
353
  keepCloseIconOnValue?: boolean | undefined;
354
+ keepFooterSpace?: boolean | undefined;
354
355
  labelClassName?: string | undefined;
355
356
  classes?: {
356
357
  iconWrapper?: string;
@@ -46,6 +46,7 @@ export declare const MaskedTextInput: React.ForwardRefExoticComponent<{
46
46
  required?: boolean;
47
47
  isFloatingLabel?: boolean;
48
48
  keepCloseIconOnValue?: boolean;
49
+ keepFooterSpace?: boolean;
49
50
  hasClearIcon?: boolean;
50
51
  hasSearchIcon?: boolean;
51
52
  startIcon?: React.ReactNode;
@@ -17,6 +17,7 @@ declare const meta: {
17
17
  required?: boolean;
18
18
  isFloatingLabel?: boolean;
19
19
  keepCloseIconOnValue?: boolean;
20
+ keepFooterSpace?: boolean;
20
21
  hasClearIcon?: boolean;
21
22
  hasSearchIcon?: boolean;
22
23
  startIcon?: React.ReactNode;
@@ -63,6 +64,7 @@ declare const meta: {
63
64
  required?: boolean | undefined;
64
65
  isFloatingLabel?: boolean | undefined;
65
66
  keepCloseIconOnValue?: boolean | undefined;
67
+ keepFooterSpace?: boolean | undefined;
66
68
  hasClearIcon?: boolean | undefined;
67
69
  hasSearchIcon?: boolean | undefined;
68
70
  startIcon?: React.ReactNode;
@@ -320,6 +320,7 @@ declare const meta: {
320
320
  helperText?: string | undefined;
321
321
  errorMessage?: string | undefined;
322
322
  keepCloseIconOnValue?: boolean | undefined;
323
+ keepFooterSpace?: boolean | undefined;
323
324
  labelClassName?: string | undefined;
324
325
  classes?: {
325
326
  iconWrapper?: string;
@@ -345,6 +345,7 @@ declare const meta: {
345
345
  src?: string | undefined | undefined;
346
346
  iconMode?: "flat" | "solid" | undefined;
347
347
  keepCloseIconOnValue?: boolean | undefined;
348
+ keepFooterSpace?: boolean | undefined;
348
349
  labelClassName?: string | undefined;
349
350
  classes?: {
350
351
  iconWrapper?: string;
@@ -15,6 +15,7 @@ export type InputProps = {
15
15
  required?: boolean;
16
16
  isFloatingLabel?: boolean;
17
17
  keepCloseIconOnValue?: boolean;
18
+ keepFooterSpace?: boolean;
18
19
  hasClearIcon?: boolean;
19
20
  hasSearchIcon?: boolean;
20
21
  startIcon?: ReactNode;
@@ -49,6 +50,7 @@ export declare const TextInput: React.ForwardRefExoticComponent<{
49
50
  required?: boolean;
50
51
  isFloatingLabel?: boolean;
51
52
  keepCloseIconOnValue?: boolean;
53
+ keepFooterSpace?: boolean;
52
54
  hasClearIcon?: boolean;
53
55
  hasSearchIcon?: boolean;
54
56
  startIcon?: ReactNode;
@@ -17,6 +17,7 @@ declare const meta: {
17
17
  required?: boolean;
18
18
  isFloatingLabel?: boolean;
19
19
  keepCloseIconOnValue?: boolean;
20
+ keepFooterSpace?: boolean;
20
21
  hasClearIcon?: boolean;
21
22
  hasSearchIcon?: boolean;
22
23
  startIcon?: React.ReactNode;
@@ -55,6 +56,7 @@ declare const meta: {
55
56
  required?: boolean | undefined;
56
57
  isFloatingLabel?: boolean | undefined;
57
58
  keepCloseIconOnValue?: boolean | undefined;
59
+ keepFooterSpace?: boolean | undefined;
58
60
  hasClearIcon?: boolean | undefined;
59
61
  hasSearchIcon?: boolean | undefined;
60
62
  startIcon?: React.ReactNode;
@@ -396,3 +398,11 @@ export declare const CustomIcon: {
396
398
  };
397
399
  render: (args: {}) => import("react/jsx-runtime").JSX.Element;
398
400
  };
401
+ export declare const KeepFooterSpace: {
402
+ args: {
403
+ label: string;
404
+ fullwidth: boolean;
405
+ keepFooterSpace: boolean;
406
+ };
407
+ render: () => import("react/jsx-runtime").JSX.Element;
408
+ };
@@ -23,6 +23,21 @@ export declare const helperTextVariant: (props?: ({
23
23
  disabled?: boolean | null | undefined;
24
24
  error?: boolean | null | undefined;
25
25
  } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
26
+ export declare const inlineEndIconWrapperVariant: (props?: ({
27
+ size?: "sm" | "md" | "lg" | null | undefined;
28
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
29
+ export declare const inlineStartIconWrapperVariant: (props?: ({
30
+ size?: "sm" | "md" | "lg" | null | undefined;
31
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
32
+ export declare const iconActionVariant: (props?: ({
33
+ size?: "sm" | "md" | "lg" | null | undefined;
34
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
35
+ export declare const segmentedIconWrapperVariant: (props?: ({
36
+ size?: "sm" | "md" | "lg" | null | undefined;
37
+ rounded?: "none" | "normal" | "full" | null | undefined;
38
+ error?: boolean | null | undefined;
39
+ position?: "end" | "start" | null | undefined;
40
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
26
41
  export declare const iconWrapperVariant: (props?: ({
27
42
  size?: "sm" | "md" | "lg" | null | undefined;
28
43
  } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
@@ -28,8 +28,8 @@ export const PasswordInput = forwardRef((_a, ref) => {
28
28
  onClickEndIcon === null || onClickEndIcon === void 0 ? void 0 : onClickEndIcon();
29
29
  };
30
30
  const toggleIcon = visible
31
- ? showIcon !== null && showIcon !== void 0 ? showIcon : _jsx(Icon, { name: "eye", type: "lucide", size: "inherit", className: "size-full", "aria-label": "Hide password" })
32
- : hideIcon !== null && hideIcon !== void 0 ? hideIcon : _jsx(Icon, { name: "eye-closed", type: "lucide", size: "inherit", className: "size-full", "aria-label": "Show password" });
31
+ ? showIcon !== null && showIcon !== void 0 ? showIcon : _jsx(Icon, { name: "eye", type: "lucide", size: "inherit", className: "size-full stroke-input-default-stroke hover:stroke-input-active-stroke", "aria-label": "Hide password" })
32
+ : hideIcon !== null && hideIcon !== void 0 ? hideIcon : _jsx(Icon, { name: "eye-closed", type: "lucide", size: "inherit", className: "size-full stroke-input-default-stroke hover:stroke-input-active-stroke", "aria-label": "Show password" });
33
33
  return (_jsx(TextInput, Object.assign({ iconMode: "flat" }, props, { ref: inputRef, type: visible ? "text" : "password", hasClearIcon: hasClearIcon, endIcon: showToggle ? toggleIcon : endIcon, renderEndIcon: renderEndIcon, onClickEndIcon: showToggle ? handleToggleVisibility : onClickEndIcon, autoComplete: (_b = props.autoComplete) !== null && _b !== void 0 ? _b : "current-password" })));
34
34
  });
35
35
  PasswordInput.displayName = "PasswordInput";
@@ -184,7 +184,7 @@ export const clearIconVariant = cva([
184
184
  size: "md",
185
185
  },
186
186
  });
187
- export const helperTextVariant = cva(["text-small1 flex flex-row items-center gap-1"], {
187
+ export const helperTextVariant = cva(["typography-small1 flex flex-row items-center gap-1"], {
188
188
  variants: {
189
189
  size: {
190
190
  sm: "mt-1",
@@ -11,11 +11,11 @@ var __rest = (this && this.__rest) || function (s, e) {
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import { forwardRef, useCallback, useImperativeHandle, useMemo, useRef, } from "react";
14
- import { helperTextVariant, iconSearchWrapperVariant, iconVariant, iconWrapperVariant, inputVariant, labelVariant, sectionIconWrapperVariant, } from "./TextInput.styles";
15
- import { XCircleIcon, ExclamationCircleIcon, MagnifyingGlassIcon, } from "@heroicons/react/16/solid";
14
+ import { helperTextVariant, iconActionVariant, inlineEndIconWrapperVariant, inlineStartIconWrapperVariant, inputVariant, labelVariant, segmentedIconWrapperVariant, } from "./TextInput.styles";
15
+ import { CircleAlert, CircleX, Search, } from "lucide-react";
16
16
  import { cn } from "@/utils/cn";
17
17
  export const TextInput = forwardRef((_a, ref) => {
18
- var { id, label, size = "md", rounded = "normal", variant = "outline", type = "text", iconMode = "solid", helperText, errorMessage, fullwidth = true, disabled = false, error = false, required = true, isFloatingLabel = true, keepCloseIconOnValue = false, hasClearIcon = true, hasSearchIcon = false, startIcon, endIcon, labelClassName, onClickStartIcon, onClickEndIcon, renderStartIcon, renderEndIcon, classes } = _a, props = __rest(_a, ["id", "label", "size", "rounded", "variant", "type", "iconMode", "helperText", "errorMessage", "fullwidth", "disabled", "error", "required", "isFloatingLabel", "keepCloseIconOnValue", "hasClearIcon", "hasSearchIcon", "startIcon", "endIcon", "labelClassName", "onClickStartIcon", "onClickEndIcon", "renderStartIcon", "renderEndIcon", "classes"]);
18
+ var { id, label, size = "md", rounded = "normal", variant = "outline", type = "text", iconMode = "solid", helperText, errorMessage, fullwidth = true, disabled = false, error = false, required = true, isFloatingLabel = true, keepCloseIconOnValue = false, keepFooterSpace = true, hasClearIcon = true, hasSearchIcon = false, startIcon, endIcon, labelClassName, onClickStartIcon, onClickEndIcon, renderStartIcon, renderEndIcon, classes } = _a, props = __rest(_a, ["id", "label", "size", "rounded", "variant", "type", "iconMode", "helperText", "errorMessage", "fullwidth", "disabled", "error", "required", "isFloatingLabel", "keepCloseIconOnValue", "keepFooterSpace", "hasClearIcon", "hasSearchIcon", "startIcon", "endIcon", "labelClassName", "onClickStartIcon", "onClickEndIcon", "renderStartIcon", "renderEndIcon", "classes"]);
19
19
  const inputRef = useRef(null);
20
20
  const _id = id || `${type}-${label}-input`;
21
21
  const hasLeftSectionIcon = !!startIcon || !!renderStartIcon;
@@ -40,18 +40,24 @@ export const TextInput = forwardRef((_a, ref) => {
40
40
  hasLeftSectionIcon: iconMode === "solid" ? hasLeftSectionIcon : false,
41
41
  isFloatingLabel,
42
42
  });
43
- const helperTextClassname = helperTextVariant({ size, error, disabled });
44
- const iconWrapperClassname = iconWrapperVariant({ size });
45
- const iconSearchWrapperClassname = iconSearchWrapperVariant({ size });
46
- const iconClassname = iconVariant({ size });
43
+ const helperTextClassname = helperTextVariant({
44
+ size,
45
+ error,
46
+ disabled,
47
+ });
48
+ const inlineEndIconWrapperClassname = inlineEndIconWrapperVariant({ size });
49
+ const inlineStartIconWrapperClassname = inlineStartIconWrapperVariant({
50
+ size,
51
+ });
52
+ const iconActionClassname = iconActionVariant({ size });
47
53
  // TODO wait for clearify aboutm start,end, search and clearIcon with iconMode
48
- const startIconWrapperClassname = sectionIconWrapperVariant({
54
+ const startSegmentIconWrapperClassname = segmentedIconWrapperVariant({
49
55
  size,
50
56
  rounded,
51
57
  error,
52
58
  position: "start",
53
59
  });
54
- const endIconWrapperClassname = sectionIconWrapperVariant({
60
+ const endSegmentIconWrapperClassname = segmentedIconWrapperVariant({
55
61
  size,
56
62
  rounded,
57
63
  error,
@@ -87,19 +93,19 @@ export const TextInput = forwardRef((_a, ref) => {
87
93
  if (!hasLeftSectionIcon)
88
94
  return;
89
95
  if (renderStartIcon) {
90
- return (_jsx("div", { className: cn(iconSearchWrapperClassname, "flex", classes === null || classes === void 0 ? void 0 : classes.iconSearchWrapper), children: renderStartIcon() }));
96
+ return (_jsx("div", { className: cn(inlineStartIconWrapperClassname, "flex", classes === null || classes === void 0 ? void 0 : classes.iconSearchWrapper), children: renderStartIcon() }));
91
97
  }
92
98
  if (iconMode === "flat") {
93
- return (_jsx("div", { className: cn(iconSearchWrapperClassname, classes === null || classes === void 0 ? void 0 : classes.iconSearchWrapper), children: _jsx("div", { className: cn(iconClassname, classes === null || classes === void 0 ? void 0 : classes.icon), onClick: handleOnClickLeftSectionIcon, children: startIcon }) }));
99
+ return (_jsx("div", { className: cn(inlineStartIconWrapperClassname, classes === null || classes === void 0 ? void 0 : classes.iconSearchWrapper), children: _jsx("div", { className: cn(iconActionClassname, classes === null || classes === void 0 ? void 0 : classes.icon), onClick: handleOnClickLeftSectionIcon, children: startIcon }) }));
94
100
  }
95
- return (_jsx("div", { className: cn(startIconWrapperClassname, classes === null || classes === void 0 ? void 0 : classes.startIconWrapper), onClick: handleOnClickLeftSectionIcon, children: startIcon }));
101
+ return (_jsx("div", { className: cn(startSegmentIconWrapperClassname, classes === null || classes === void 0 ? void 0 : classes.startIconWrapper), onClick: handleOnClickLeftSectionIcon, children: startIcon }));
96
102
  }, [
97
103
  hasLeftSectionIcon,
98
104
  startIcon,
99
105
  iconMode,
100
- iconSearchWrapperClassname,
101
- startIconWrapperClassname,
102
- iconClassname,
106
+ inlineStartIconWrapperClassname,
107
+ startSegmentIconWrapperClassname,
108
+ iconActionClassname,
103
109
  renderStartIcon,
104
110
  handleOnClickLeftSectionIcon,
105
111
  ]);
@@ -107,26 +113,29 @@ export const TextInput = forwardRef((_a, ref) => {
107
113
  if (!hasRightSectionIcon)
108
114
  return;
109
115
  if (renderEndIcon) {
110
- return (_jsx("div", { className: cn(iconWrapperClassname, "flex", classes === null || classes === void 0 ? void 0 : classes.iconWrapper), children: renderEndIcon() }));
116
+ return (_jsx("div", { className: cn(inlineEndIconWrapperClassname, "flex", classes === null || classes === void 0 ? void 0 : classes.iconWrapper), children: renderEndIcon() }));
111
117
  }
112
118
  if (iconMode === "flat") {
113
- return (_jsx("div", { className: cn(iconWrapperClassname, "flex", classes === null || classes === void 0 ? void 0 : classes.iconWrapper), children: _jsx("div", { className: cn(iconClassname, classes === null || classes === void 0 ? void 0 : classes.icon), onClick: handleOnClickRightSectionIcon, children: endIcon }) }));
119
+ return (_jsx("div", { className: cn(inlineEndIconWrapperClassname, "flex", classes === null || classes === void 0 ? void 0 : classes.iconWrapper), children: _jsx("div", { className: cn(iconActionClassname, classes === null || classes === void 0 ? void 0 : classes.icon), onClick: handleOnClickRightSectionIcon, children: endIcon }) }));
114
120
  }
115
- return (_jsx("div", { className: cn(endIconWrapperClassname, classes === null || classes === void 0 ? void 0 : classes.endIconWrapper), onClick: handleOnClickRightSectionIcon, children: endIcon }));
121
+ return (_jsx("div", { className: cn(endSegmentIconWrapperClassname, classes === null || classes === void 0 ? void 0 : classes.endIconWrapper), onClick: handleOnClickRightSectionIcon, children: endIcon }));
116
122
  }, [
117
123
  hasRightSectionIcon,
118
124
  endIcon,
119
125
  iconMode,
120
- iconSearchWrapperClassname,
121
- endIconWrapperClassname,
122
- iconClassname,
126
+ inlineEndIconWrapperClassname,
127
+ endSegmentIconWrapperClassname,
128
+ iconActionClassname,
123
129
  renderEndIcon,
124
130
  handleOnClickRightSectionIcon,
125
131
  ]);
126
- return (_jsxs("div", { className: `inline-flex flex-col ${fullwidth ? "w-full" : ""}`, children: [_jsxs("div", { className: "relative", children: [hasSearchIcon && !hasLeftSectionIcon && (_jsx("div", { className: cn(iconSearchWrapperClassname, classes === null || classes === void 0 ? void 0 : classes.iconSearchWrapper), children: _jsx(MagnifyingGlassIcon, { className: cn(iconClassname, classes === null || classes === void 0 ? void 0 : classes.icon) }) })), _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: cn(iconWrapperClassname, classes === null || classes === void 0 ? void 0 : classes.iconWrapper), style: {
132
+ return (_jsxs("div", { className: `inline-flex flex-col ${fullwidth ? "w-full" : ""}`, children: [_jsxs("div", { className: "relative", children: [_jsx("input", Object.assign({}, props, { placeholder: " ", ref: inputRef, type: type, id: _id, disabled: disabled, className: cn(inputClassname, props.className) })), hasSearchIcon && !hasLeftSectionIcon && (_jsx("div", { className: cn(inlineStartIconWrapperClassname, classes === null || classes === void 0 ? void 0 : classes.iconSearchWrapper), children: _jsx(Search, { className: cn(iconActionClassname, classes === null || classes === void 0 ? void 0 : classes.icon) }) })), startIconElement, hasClearIcon && !hasRightSectionIcon && (_jsx("div", { className: cn(inlineEndIconWrapperClassname, classes === null || classes === void 0 ? void 0 : classes.iconWrapper), style: {
127
133
  display: keepCloseIconOnValue && props.value ? "flex" : undefined,
128
- }, children: _jsx(XCircleIcon, { type: "button", className: cn(iconClassname, classes === null || classes === void 0 ? void 0 : classes.icon), onMouseDown: handleClearInput }) })), endIconElement, _jsxs("label", { htmlFor: _id, className: cn(labelClassname), children: [label, " ", required && (_jsx("span", { className: cn("text-error", {
134
+ }, children: _jsx(CircleX, { className: cn(iconActionClassname,
135
+ // 'fill-none stroke-current',
136
+ // "fill-none stroke-input-default-text hover:stroke-input-filled-text active:stroke-input-filled-text",
137
+ classes === null || classes === void 0 ? void 0 : classes.icon), onMouseDown: handleClearInput }) })), endIconElement, _jsxs("label", { htmlFor: _id, className: cn(labelClassname), children: [label, " ", required && (_jsx("span", { className: cn("text-input-error", {
129
138
  "text-input-disable-text": disabled,
130
- }), 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] }))] }));
139
+ }), children: "*" }))] })] }), (errorMessage || helperText || keepFooterSpace) && (_jsxs("span", { className: helperTextClassname, children: [(errorMessage || helperText) && (_jsx("span", { className: "h-full shrink-0", children: _jsx(CircleAlert, { width: 14, height: 14, className: cn("fill-none", error ? "stroke-input-error" : "stroke-input-filled-text") }) })), keepFooterSpace && !error && !helperText && (_jsx("span", { className: "block min-h-[14px]", "aria-hidden": true })), (error ? errorMessage : helperText) || ''] }))] }));
131
140
  });
132
141
  export default TextInput;
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useRef } from "react";
2
+ import { useRef, useState } from "react";
3
3
  import TextInput from "./TextInput";
4
4
  import { CalendarIcon } from "@heroicons/react/16/solid";
5
5
  import Icon from "../Icon/Icon";
@@ -13,7 +13,7 @@ const meta = {
13
13
  layout: "fullscreen",
14
14
  },
15
15
  decorators: [
16
- (Story) => (_jsx("div", { className: "p-5 flex w-full bg-[rgb(var(--base-bg-2))] ", children: _jsx(Story, {}) })),
16
+ (Story) => (_jsx("div", { className: "p-5 flex h-full w-full bg-[var(--base-color-popup)] ", children: _jsx(Story, {}) })),
17
17
  ],
18
18
  };
19
19
  export default meta;
@@ -76,3 +76,15 @@ export const CustomIcon = {
76
76
  hasClearIcon: true }))] }));
77
77
  },
78
78
  };
79
+ const KeepFooterSpaceDemo = () => {
80
+ const [hasError, setHasError] = useState(false);
81
+ return (_jsxs("div", { className: "flex flex-col gap-8 w-full max-w-md", children: [_jsxs("p", { className: "text-sm text-text-grey-dark", children: ["Use ", _jsx("code", { children: "keepFooterSpace" }), " to always reserve space for the footer/helper area, preventing layout shift when an error or helper text is shown or hidden."] }), _jsxs("div", { className: "flex flex-col gap-4", children: [_jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [_jsx("input", { type: "checkbox", checked: hasError, onChange: (e) => setHasError(e.target.checked) }), "Show error message"] }), _jsxs("div", { className: "flex flex-col", children: [_jsxs("div", { children: [_jsx("h4", { className: "text-sm font-medium mb-2 text-text-grey-dark", children: "With keepFooterSpace (layout stays stable)" }), _jsx(TextInput, { id: "with-keep", label: "Email", keepFooterSpace: true, error: hasError, errorMessage: hasError ? "Please enter a valid email address" : undefined })] }), _jsxs("div", { children: [_jsx("h4", { className: "text-sm font-medium mb-2 text-text-grey-dark", children: "Without keepFooterSpace (layout shifts when error appears)" }), _jsx(TextInput, { id: "no-keep", label: "Email", error: hasError, errorMessage: hasError ? "Please enter a valid email address" : undefined })] }), _jsx("div", {})] })] })] }));
82
+ };
83
+ export const KeepFooterSpace = {
84
+ args: {
85
+ label: "Email",
86
+ fullwidth: true,
87
+ keepFooterSpace: true,
88
+ },
89
+ render: () => _jsx(KeepFooterSpaceDemo, {}),
90
+ };
@@ -35,7 +35,7 @@ export const inputVariant = cva([
35
35
  ],
36
36
  },
37
37
  error: {
38
- true: "ring-input-error focus:ring-input-error",
38
+ true: "ring-input-error hover:ring-input-error focus:ring-input-error",
39
39
  },
40
40
  hasClearIcon: {
41
41
  true: "",
@@ -131,7 +131,7 @@ export const inputVariant = cva([
131
131
  });
132
132
  export const labelVariant = cva([
133
133
  "absolute block duration-450 transition-all px-[2px] text-input-default-text",
134
- "peer-focus:text-input-filled-text peer-focus:bg-input-label-bg", // TODO bg
134
+ "peer-focus:text-input-default-text peer-focus:bg-input-label-bg", // TODO bg
135
135
  ], {
136
136
  variants: {
137
137
  size: {
@@ -329,7 +329,7 @@ export const labelVariant = cva([
329
329
  isFloatingLabel: true,
330
330
  },
331
331
  });
332
- export const helperTextVariant = cva(["text-small1 flex flex-row items-center gap-1"], {
332
+ export const helperTextVariant = cva(["typography-small1 flex flex-row items-center gap-1"], {
333
333
  variants: {
334
334
  size: {
335
335
  sm: "mt-1",
@@ -350,8 +350,17 @@ export const helperTextVariant = cva(["text-small1 flex flex-row items-center ga
350
350
  error: false,
351
351
  },
352
352
  });
353
- export const iconWrapperVariant = cva([
353
+ const iconInteractiveColorStateClasses = [
354
+ "fill-input-default-text",
355
+ "peer-hover:fill-input-filled-text peer-focus:fill-input-filled-text peer-active:fill-input-filled-text",
356
+ "peer-disabled:fill-input-disable-stroke",
357
+ "[&_svg]:text-input-default-text",
358
+ "peer-hover:[&_svg]:text-input-filled-text peer-focus:[&_svg]:text-input-filled-text peer-active:[&_svg]:text-input-filled-text",
359
+ "peer-disabled:[&_svg]:text-input-disable-stroke",
360
+ ];
361
+ export const inlineEndIconWrapperVariant = cva([
354
362
  "absolute inset-y-0 right-0 items-center justify-center hidden peer-focus:flex",
363
+ ...iconInteractiveColorStateClasses,
355
364
  ], {
356
365
  variants: {
357
366
  size: {
@@ -364,7 +373,10 @@ export const iconWrapperVariant = cva([
364
373
  size: "md",
365
374
  },
366
375
  });
367
- export const iconSearchWrapperVariant = cva(["absolute inset-y-0 left-0 items-center justify-center flex"], {
376
+ export const inlineStartIconWrapperVariant = cva([
377
+ "absolute inset-y-0 left-0 items-center justify-center flex",
378
+ ...iconInteractiveColorStateClasses,
379
+ ], {
368
380
  variants: {
369
381
  size: {
370
382
  sm: "ml-2",
@@ -376,9 +388,7 @@ export const iconSearchWrapperVariant = cva(["absolute inset-y-0 left-0 items-ce
376
388
  size: "md",
377
389
  },
378
390
  });
379
- export const iconVariant = cva([
380
- "cursor-pointer z-50 fill-input-active-stroke hover:fill-input-default-text",
381
- ], {
391
+ export const iconActionVariant = cva(["cursor-pointer z-50"], {
382
392
  variants: {
383
393
  size: {
384
394
  sm: "size-3",
@@ -390,10 +400,10 @@ export const iconVariant = cva([
390
400
  size: "md",
391
401
  },
392
402
  });
393
- export const sectionIconWrapperVariant = cva([
403
+ export const segmentedIconWrapperVariant = cva([
394
404
  "cursor-pointer",
395
405
  "absolute items-center justify-center flex",
396
- "fill-input-default-text peer-hover:fill-input-filled-text peer-focus:fill-input-filled-text peer-disabled:fill-input-disable-stroke",
406
+ ...iconInteractiveColorStateClasses,
397
407
  ], {
398
408
  variants: {
399
409
  size: {
@@ -471,3 +481,8 @@ export const sectionIconWrapperVariant = cva([
471
481
  position: "end",
472
482
  },
473
483
  });
484
+ // Backward-compatible aliases (can be removed in a future major version)
485
+ export const iconWrapperVariant = inlineEndIconWrapperVariant;
486
+ export const iconSearchWrapperVariant = inlineStartIconWrapperVariant;
487
+ export const iconVariant = iconActionVariant;
488
+ export const sectionIconWrapperVariant = segmentedIconWrapperVariant;
@@ -719,6 +719,9 @@ input[type=number] {
719
719
  .mb-1{
720
720
  margin-bottom: 0.25rem;
721
721
  }
722
+ .mb-2{
723
+ margin-bottom: 0.5rem;
724
+ }
722
725
  .ml-2{
723
726
  margin-left: 0.5rem;
724
727
  }
@@ -938,6 +941,9 @@ input[type=number] {
938
941
  .min-h-10{
939
942
  min-height: 2.5rem;
940
943
  }
944
+ .min-h-\[14px\]{
945
+ min-height: 14px;
946
+ }
941
947
  .min-h-screen{
942
948
  min-height: 100vh;
943
949
  }
@@ -1197,6 +1203,9 @@ input[type=number] {
1197
1203
  .gap-6{
1198
1204
  gap: 1.5rem;
1199
1205
  }
1206
+ .gap-8{
1207
+ gap: 2rem;
1208
+ }
1200
1209
  .gap-\[2px\]{
1201
1210
  gap: 2px;
1202
1211
  }
@@ -1593,6 +1602,9 @@ input[type=number] {
1593
1602
  .bg-\[rgb\(var\(--navbar-bg-color\)\)\]{
1594
1603
  background-color: rgb(var(--navbar-bg-color));
1595
1604
  }
1605
+ .bg-\[var\(--base-color-popup\)\]{
1606
+ background-color: var(--base-color-popup);
1607
+ }
1596
1608
  .bg-\[var\(--dropdown-menu-default-bg\)\]{
1597
1609
  background-color: var(--dropdown-menu-default-bg);
1598
1610
  }
@@ -2938,6 +2950,9 @@ input[type=number] {
2938
2950
  .fill-input-disable-stroke{
2939
2951
  fill: color-mix(in srgb, var(--input-color-disable-stroke) calc(100% * 1), transparent);
2940
2952
  }
2953
+ .fill-none{
2954
+ fill: none;
2955
+ }
2941
2956
  .fill-primary{
2942
2957
  fill: color-mix(in srgb, var(--state-color-primary-default) calc(100% * 1), transparent);
2943
2958
  }
@@ -2956,9 +2971,18 @@ input[type=number] {
2956
2971
  .stroke-input-default-stroke{
2957
2972
  stroke: color-mix(in srgb, var(--input-color-default-stroke) calc(100% * 1), transparent);
2958
2973
  }
2974
+ .stroke-input-default-text{
2975
+ stroke: color-mix(in srgb, var(--input-color-default-text) calc(100% * 1), transparent);
2976
+ }
2959
2977
  .stroke-input-disable-stroke{
2960
2978
  stroke: color-mix(in srgb, var(--input-color-disable-stroke) calc(100% * 1), transparent);
2961
2979
  }
2980
+ .stroke-input-error{
2981
+ stroke: color-mix(in srgb, var(--input-color-error) calc(100% * 1), transparent);
2982
+ }
2983
+ .stroke-input-filled-text{
2984
+ stroke: color-mix(in srgb, var(--input-color-filled-text) calc(100% * 1), transparent);
2985
+ }
2962
2986
  .stroke-primary-default{
2963
2987
  stroke: color-mix(in srgb, var(--state-color-primary-default) calc(100% * 1), transparent);
2964
2988
  }
@@ -4290,6 +4314,12 @@ input[type=number] {
4290
4314
  .hover\:fill-input-default-text:hover{
4291
4315
  fill: color-mix(in srgb, var(--input-color-default-text) calc(100% * 1), transparent);
4292
4316
  }
4317
+ .hover\:stroke-input-active-stroke:hover{
4318
+ stroke: color-mix(in srgb, var(--input-color-active-stroke) calc(100% * 1), transparent);
4319
+ }
4320
+ .hover\:stroke-input-filled-text:hover{
4321
+ stroke: color-mix(in srgb, var(--input-color-filled-text) calc(100% * 1), transparent);
4322
+ }
4293
4323
  .hover\:text-\[var\(--dropdown-menu-hover-text\)\]:hover{
4294
4324
  color: var(--dropdown-menu-hover-text);
4295
4325
  }
@@ -4424,6 +4454,10 @@ input[type=number] {
4424
4454
  --tw-ring-opacity: 1;
4425
4455
  --tw-ring-color: color-mix(in srgb, var(--input-color-disable-stroke) calc(100% * var(--tw-ring-opacity, 1)), transparent);
4426
4456
  }
4457
+ .hover\:ring-input-error:hover{
4458
+ --tw-ring-opacity: 1;
4459
+ --tw-ring-color: color-mix(in srgb, var(--input-color-error) calc(100% * var(--tw-ring-opacity, 1)), transparent);
4460
+ }
4427
4461
  .hover\:placeholder\:text-input-disable-text:hover::-moz-placeholder{
4428
4462
  --tw-text-opacity: 1;
4429
4463
  color: color-mix(in srgb, var(--input-color-disable-text) calc(100% * var(--tw-text-opacity, 1)), transparent);
@@ -4812,6 +4846,9 @@ input[type=number] {
4812
4846
  .active\:fill-button-warning-solid-active:active{
4813
4847
  fill: color-mix(in srgb, var(--button-warning-solid-active-text) calc(100% * 1), transparent);
4814
4848
  }
4849
+ .active\:stroke-input-filled-text:active{
4850
+ stroke: color-mix(in srgb, var(--input-color-filled-text) calc(100% * 1), transparent);
4851
+ }
4815
4852
  .active\:text-action-button-icon-active-pressed:active{
4816
4853
  --tw-text-opacity: 1;
4817
4854
  color: color-mix(in srgb, var(--action-button-icon-active-pressed-text) calc(100% * var(--tw-text-opacity, 1)), transparent);
@@ -5401,6 +5438,10 @@ input[type=number] {
5401
5438
  .peer:focus ~ .peer-focus\:stroke-primary-hover{
5402
5439
  stroke: color-mix(in srgb, var(--state-color-primary-hover) calc(100% * 1), transparent);
5403
5440
  }
5441
+ .peer:focus ~ .peer-focus\:text-input-default-text{
5442
+ --tw-text-opacity: 1;
5443
+ color: color-mix(in srgb, var(--input-color-default-text) calc(100% * var(--tw-text-opacity, 1)), transparent);
5444
+ }
5404
5445
  .peer:focus ~ .peer-focus\:text-input-filled-text{
5405
5446
  --tw-text-opacity: 1;
5406
5447
  color: color-mix(in srgb, var(--input-color-filled-text) calc(100% * var(--tw-text-opacity, 1)), transparent);
@@ -5415,6 +5456,9 @@ input[type=number] {
5415
5456
  line-height: var(--label-label2-line-height, 10px);
5416
5457
  font-weight: var(--label-label2-weight, 400);
5417
5458
  }
5459
+ .peer:active ~ .peer-active\:fill-input-filled-text{
5460
+ fill: color-mix(in srgb, var(--input-color-filled-text) calc(100% * 1), transparent);
5461
+ }
5418
5462
  .peer:disabled ~ .peer-disabled\:cursor-not-allowed{
5419
5463
  cursor: not-allowed;
5420
5464
  }
@@ -5983,6 +6027,26 @@ input[type=number] {
5983
6027
  width: 32px;
5984
6028
  height: 32px;
5985
6029
  }
6030
+ .\[\&_svg\]\:text-input-default-text svg{
6031
+ --tw-text-opacity: 1;
6032
+ color: color-mix(in srgb, var(--input-color-default-text) calc(100% * var(--tw-text-opacity, 1)), transparent);
6033
+ }
6034
+ .peer:hover ~ .peer-hover\:\[\&_svg\]\:text-input-filled-text svg{
6035
+ --tw-text-opacity: 1;
6036
+ color: color-mix(in srgb, var(--input-color-filled-text) calc(100% * var(--tw-text-opacity, 1)), transparent);
6037
+ }
6038
+ .peer:focus ~ .peer-focus\:\[\&_svg\]\:text-input-filled-text svg{
6039
+ --tw-text-opacity: 1;
6040
+ color: color-mix(in srgb, var(--input-color-filled-text) calc(100% * var(--tw-text-opacity, 1)), transparent);
6041
+ }
6042
+ .peer:active ~ .peer-active\:\[\&_svg\]\:text-input-filled-text svg{
6043
+ --tw-text-opacity: 1;
6044
+ color: color-mix(in srgb, var(--input-color-filled-text) calc(100% * var(--tw-text-opacity, 1)), transparent);
6045
+ }
6046
+ .peer:disabled ~ .peer-disabled\:\[\&_svg\]\:text-input-disable-stroke svg{
6047
+ --tw-text-opacity: 1;
6048
+ color: color-mix(in srgb, var(--input-color-disable-stroke) calc(100% * var(--tw-text-opacity, 1)), transparent);
6049
+ }
5986
6050
  .\[\&_tr\:last-child\]\:border-0 tr:last-child{
5987
6051
  border-width: 0px;
5988
6052
  }