@rovula/ui 0.1.0 → 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 (94) hide show
  1. package/dist/cjs/bundle.css +129 -0
  2. package/dist/cjs/bundle.js +9255 -3
  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/Footer/Footer.d.ts +21 -0
  6. package/dist/cjs/types/components/Footer/Footer.stories.d.ts +45 -0
  7. package/dist/cjs/types/components/Footer/index.d.ts +2 -0
  8. package/dist/cjs/types/components/Icon/Icon.d.ts +1 -1
  9. package/dist/cjs/types/components/Icon/Icon.stories.d.ts +9 -1
  10. package/dist/cjs/types/components/InputFilter/InputFilter.stories.d.ts +1 -0
  11. package/dist/cjs/types/components/MaskedTextInput/MaskedTextInput.d.ts +1 -0
  12. package/dist/cjs/types/components/MaskedTextInput/MaskedTextInput.stories.d.ts +2 -0
  13. package/dist/cjs/types/components/Navbar/Navbar.d.ts +5 -0
  14. package/dist/cjs/types/components/Navbar/Navbar.stories.d.ts +14 -0
  15. package/dist/cjs/types/components/PasswordInput/PasswordInput.d.ts +19 -0
  16. package/dist/cjs/types/components/PasswordInput/PasswordInput.stories.d.ts +396 -0
  17. package/dist/cjs/types/components/PasswordInput/index.d.ts +2 -0
  18. package/dist/cjs/types/components/Search/Search.stories.d.ts +1 -0
  19. package/dist/cjs/types/components/TextInput/TextInput.d.ts +2 -0
  20. package/dist/cjs/types/components/TextInput/TextInput.stories.d.ts +10 -0
  21. package/dist/cjs/types/components/TextInput/TextInput.styles.d.ts +15 -0
  22. package/dist/cjs/types/icons/index.d.ts +1 -0
  23. package/dist/cjs/types/icons/lucideIconNames.d.ts +9 -0
  24. package/dist/cjs/types/index.d.ts +7 -1
  25. package/dist/cjs/types/utils/colors.d.ts +330 -0
  26. package/dist/components/Footer/Footer.js +11 -0
  27. package/dist/components/Footer/Footer.stories.js +34 -0
  28. package/dist/components/Footer/index.js +2 -0
  29. package/dist/components/Icon/Icon.js +28 -11
  30. package/dist/components/Icon/Icon.stories.js +39 -0
  31. package/dist/components/Navbar/Navbar.js +18 -4
  32. package/dist/components/Navbar/Navbar.stories.js +16 -9
  33. package/dist/components/PasswordInput/PasswordInput.js +36 -0
  34. package/dist/components/PasswordInput/PasswordInput.stories.js +67 -0
  35. package/dist/components/PasswordInput/index.js +1 -0
  36. package/dist/components/TextArea/TextArea.styles.js +1 -1
  37. package/dist/components/TextInput/TextInput.js +33 -24
  38. package/dist/components/TextInput/TextInput.stories.js +14 -2
  39. package/dist/components/TextInput/TextInput.styles.js +25 -10
  40. package/dist/esm/bundle.css +129 -0
  41. package/dist/esm/bundle.js +9255 -3
  42. package/dist/esm/bundle.js.map +1 -1
  43. package/dist/esm/types/components/Dropdown/Dropdown.stories.d.ts +1 -0
  44. package/dist/esm/types/components/Footer/Footer.d.ts +21 -0
  45. package/dist/esm/types/components/Footer/Footer.stories.d.ts +45 -0
  46. package/dist/esm/types/components/Footer/index.d.ts +2 -0
  47. package/dist/esm/types/components/Icon/Icon.d.ts +1 -1
  48. package/dist/esm/types/components/Icon/Icon.stories.d.ts +9 -1
  49. package/dist/esm/types/components/InputFilter/InputFilter.stories.d.ts +1 -0
  50. package/dist/esm/types/components/MaskedTextInput/MaskedTextInput.d.ts +1 -0
  51. package/dist/esm/types/components/MaskedTextInput/MaskedTextInput.stories.d.ts +2 -0
  52. package/dist/esm/types/components/Navbar/Navbar.d.ts +5 -0
  53. package/dist/esm/types/components/Navbar/Navbar.stories.d.ts +14 -0
  54. package/dist/esm/types/components/PasswordInput/PasswordInput.d.ts +19 -0
  55. package/dist/esm/types/components/PasswordInput/PasswordInput.stories.d.ts +396 -0
  56. package/dist/esm/types/components/PasswordInput/index.d.ts +2 -0
  57. package/dist/esm/types/components/Search/Search.stories.d.ts +1 -0
  58. package/dist/esm/types/components/TextInput/TextInput.d.ts +2 -0
  59. package/dist/esm/types/components/TextInput/TextInput.stories.d.ts +10 -0
  60. package/dist/esm/types/components/TextInput/TextInput.styles.d.ts +15 -0
  61. package/dist/esm/types/icons/index.d.ts +1 -0
  62. package/dist/esm/types/icons/lucideIconNames.d.ts +9 -0
  63. package/dist/esm/types/index.d.ts +7 -1
  64. package/dist/esm/types/utils/colors.d.ts +330 -0
  65. package/dist/icons/index.js +1 -0
  66. package/dist/icons/lucideIconNames.js +12 -0
  67. package/dist/index.d.ts +389 -2
  68. package/dist/index.js +4 -0
  69. package/dist/src/theme/global.css +200 -24
  70. package/dist/utils/colors.js +369 -0
  71. package/package.json +2 -1
  72. package/src/components/Footer/Footer.stories.tsx +119 -0
  73. package/src/components/Footer/Footer.tsx +122 -0
  74. package/src/components/Footer/index.ts +3 -0
  75. package/src/components/Icon/Icon.stories.tsx +89 -0
  76. package/src/components/Icon/Icon.tsx +44 -23
  77. package/src/components/Navbar/Navbar.stories.tsx +109 -55
  78. package/src/components/Navbar/Navbar.tsx +41 -3
  79. package/src/components/PasswordInput/PasswordInput.stories.tsx +111 -0
  80. package/src/components/PasswordInput/PasswordInput.tsx +50 -0
  81. package/src/components/PasswordInput/index.ts +2 -0
  82. package/src/components/TextArea/TextArea.styles.ts +1 -1
  83. package/src/components/TextInput/TextInput.stories.tsx +60 -2
  84. package/src/components/TextInput/TextInput.styles.ts +36 -19
  85. package/src/components/TextInput/TextInput.tsx +83 -55
  86. package/src/icons/index.ts +1 -0
  87. package/src/icons/lucideIconNames.ts +14 -0
  88. package/src/index.ts +15 -1
  89. package/src/theme/themes/skyller/typography.css +24 -24
  90. package/src/theme/tokens/baseline.css +1 -0
  91. package/src/theme/tokens/components/footer.css +9 -0
  92. package/src/theme/tokens/components/navbar.css +2 -1
  93. package/src/types/lucide-react.d.ts +5 -0
  94. package/src/utils/colors.ts +383 -0
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import Navbar from "./Navbar";
3
+ import { Footer } from "../Footer";
3
4
  const meta = {
4
5
  title: "Components/Navbar",
5
6
  component: Navbar,
@@ -14,17 +15,23 @@ const meta = {
14
15
  export default meta;
15
16
  export const Default = {
16
17
  args: {},
17
- render: (args) => {
18
- console.log("args ", args);
19
- const props = Object.assign({}, args);
20
- return (_jsx("div", { className: "flex flex-row gap-4 w-full", children: _jsx(Navbar, { leftNav: _jsxs("ul", { className: "flex gap-2", children: [_jsx("li", { children: "link 1" }), _jsx("li", { children: "link 2" }), _jsx("li", { children: "link 3" })] }), center: _jsx(_Fragment, { children: "Center text" }), rightNav: _jsxs("ul", { className: "flex gap-2", children: [_jsx("li", { children: "sss 1" }), _jsx("li", { children: "ddd 2" }), _jsx("li", { children: "vvvv 3" })] }) }) }));
18
+ render: (args) => (_jsx("div", { className: "flex flex-row gap-4 w-full", children: _jsx(Navbar, { leftNav: _jsxs("ul", { className: "flex gap-2", children: [_jsx("li", { children: "link 1" }), _jsx("li", { children: "link 2" }), _jsx("li", { children: "link 3" })] }), center: _jsx(_Fragment, { children: "Center text" }), rightNav: _jsxs("ul", { className: "flex gap-2", children: [_jsx("li", { children: "sss 1" }), _jsx("li", { children: "ddd 2" }), _jsx("li", { children: "vvvv 3" })] }) }) })),
19
+ };
20
+ export const Transparent = {
21
+ args: {},
22
+ render: (args) => (_jsxs("div", { className: "flex flex-col w-full min-h-screen bg-primary-5", children: [_jsx(Navbar, { variant: "transparent", position: "sticky", scrollShadow: true, leftNav: _jsxs("ul", { className: "flex gap-2", children: [_jsx("li", { children: "link 1" }), _jsx("li", { children: "link 2" })] }), center: _jsx(_Fragment, { children: "Transparent Navbar" }), rightNav: _jsxs("ul", { className: "flex gap-2", children: [_jsx("li", { children: "Menu 1" }), _jsx("li", { children: "Menu 2" })] }) }), _jsx("div", { className: "flex-1 p-8", children: "Scroll down to see shadow" }), _jsx(Footer, { variant: "transparent", copyright: "\u00A9 2024" })] })),
23
+ };
24
+ export const WithScrollShadow = {
25
+ args: {},
26
+ parameters: {
27
+ layout: "fullscreen",
21
28
  },
29
+ decorators: [
30
+ (Story) => (_jsx("div", { className: "w-full h-[200vh]", children: _jsxs("div", { className: "h-screen flex flex-col", children: [_jsx(Story, {}), _jsx("div", { className: "flex-1 p-8 text-center", children: "Scroll down to see navbar shadow" })] }) })),
31
+ ],
32
+ render: (args) => (_jsx(Navbar, { position: "sticky", scrollShadow: true, leftNav: _jsxs("ul", { className: "flex gap-2", children: [_jsx("li", { children: "link 1" }), _jsx("li", { children: "link 2" })] }), center: _jsx(_Fragment, { children: "Sticky + Scroll Shadow" }), rightNav: _jsxs("ul", { className: "flex gap-2", children: [_jsx("li", { children: "Menu 1" }), _jsx("li", { children: "Menu 2" })] }) })),
22
33
  };
23
34
  export const Custom = {
24
35
  args: {},
25
- render: (args) => {
26
- console.log("args ", args);
27
- const props = Object.assign({}, args);
28
- return (_jsx("div", { className: "flex flex-row gap-4 w-full", children: _jsx(Navbar, { className: "px-8", leftNav: _jsxs("ul", { className: "flex gap-2", children: [_jsx("li", { children: "link 1" }), _jsx("li", { children: "link 2" }), _jsx("li", { children: "link 3" })] }), center: _jsx(_Fragment, { children: "Center text" }), rightNav: _jsxs("ul", { className: "flex gap-2", children: [_jsx("li", { children: "sss 1" }), _jsx("li", { children: "ddd 2" }), _jsx("li", { children: "vvvv 3" })] }) }) }));
29
- },
36
+ render: (args) => (_jsx("div", { className: "flex flex-row gap-4 w-full", children: _jsx(Navbar, { className: "px-8", leftNav: _jsxs("ul", { className: "flex gap-2", children: [_jsx("li", { children: "link 1" }), _jsx("li", { children: "link 2" }), _jsx("li", { children: "link 3" })] }), center: _jsx(_Fragment, { children: "Center text" }), rightNav: _jsxs("ul", { className: "flex gap-2", children: [_jsx("li", { children: "sss 1" }), _jsx("li", { children: "ddd 2" }), _jsx("li", { children: "vvvv 3" })] }) }) })),
30
37
  };
@@ -0,0 +1,36 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import { forwardRef, useImperativeHandle, useRef, useState } from "react";
14
+ import TextInput from "../TextInput/TextInput";
15
+ import Icon from "../Icon/Icon";
16
+ export const PasswordInput = forwardRef((_a, ref) => {
17
+ var _b;
18
+ var { showToggle = true, hasClearIcon = false, hideIcon, showIcon, endIcon, renderEndIcon, onClickEndIcon } = _a, props = __rest(_a, ["showToggle", "hasClearIcon", "hideIcon", "showIcon", "endIcon", "renderEndIcon", "onClickEndIcon"]);
19
+ const inputRef = useRef(null);
20
+ const [visible, setVisible] = useState(false);
21
+ useImperativeHandle(ref, () => inputRef === null || inputRef === void 0 ? void 0 : inputRef.current);
22
+ const handleToggleVisibility = () => {
23
+ var _a;
24
+ if (props.disabled)
25
+ return;
26
+ setVisible((v) => !v);
27
+ (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
28
+ onClickEndIcon === null || onClickEndIcon === void 0 ? void 0 : onClickEndIcon();
29
+ };
30
+ const toggleIcon = visible
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
+ 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
+ });
35
+ PasswordInput.displayName = "PasswordInput";
36
+ export default PasswordInput;
@@ -0,0 +1,67 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import PasswordInput from "./PasswordInput";
3
+ const meta = {
4
+ title: "Components/PasswordInput",
5
+ component: PasswordInput,
6
+ tags: ["autodocs"],
7
+ parameters: {
8
+ layout: "fullscreen",
9
+ },
10
+ decorators: [
11
+ (Story) => (_jsx("div", { className: "p-5 flex w-full bg-[rgb(var(--base-bg-2))]", children: _jsx(Story, {}) })),
12
+ ],
13
+ };
14
+ export default meta;
15
+ export const Default = {
16
+ args: {
17
+ label: "Password",
18
+ placeholder: "Enter your password",
19
+ fullwidth: true,
20
+ },
21
+ render: (args) => (_jsxs("div", { className: "flex flex-col gap-4 w-full max-w-md", children: [_jsx(PasswordInput, Object.assign({ id: "1", size: "lg" }, args)), _jsx(PasswordInput, Object.assign({ id: "2", size: "md" }, args)), _jsx(PasswordInput, Object.assign({ id: "3", size: "sm" }, args))] })),
22
+ };
23
+ export const WithHelperText = {
24
+ args: {
25
+ label: "Password",
26
+ placeholder: "Enter your password",
27
+ helperText: "Must be at least 8 characters",
28
+ fullwidth: true,
29
+ },
30
+ render: (args) => (_jsx("div", { className: "w-full max-w-md", children: _jsx(PasswordInput, Object.assign({ id: "1", size: "md" }, args)) })),
31
+ };
32
+ export const WithError = {
33
+ args: {
34
+ label: "Password",
35
+ placeholder: "Enter your password",
36
+ error: true,
37
+ errorMessage: "Password is required",
38
+ fullwidth: true,
39
+ },
40
+ render: (args) => (_jsx("div", { className: "w-full max-w-md", children: _jsx(PasswordInput, Object.assign({ id: "1", size: "md" }, args)) })),
41
+ };
42
+ export const Disabled = {
43
+ args: {
44
+ label: "Password",
45
+ value: "secret123",
46
+ disabled: true,
47
+ fullwidth: true,
48
+ },
49
+ render: (args) => (_jsx("div", { className: "w-full max-w-md", children: _jsx(PasswordInput, Object.assign({ id: "1", size: "md" }, args)) })),
50
+ };
51
+ export const CustomIcons = {
52
+ args: {
53
+ label: "Password",
54
+ placeholder: "Enter your password",
55
+ fullwidth: true,
56
+ },
57
+ render: (args) => (_jsx("div", { className: "w-full max-w-md", children: _jsx(PasswordInput, Object.assign({}, args, { id: "1", hideIcon: _jsx("span", { className: "text-sm", children: "\uD83D\uDC41" }), showIcon: _jsx("span", { className: "text-sm", children: "\uD83D\uDE48" }) })) })),
58
+ };
59
+ export const WithoutToggle = {
60
+ args: {
61
+ label: "Password",
62
+ placeholder: "Enter your password",
63
+ showToggle: false,
64
+ fullwidth: true,
65
+ },
66
+ render: (args) => (_jsx("div", { className: "w-full max-w-md", children: _jsx(PasswordInput, Object.assign({ id: "1", size: "md" }, args)) })),
67
+ };
@@ -0,0 +1 @@
1
+ export { default } from "./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;